How to get a tcp/ucp port in im driver without copying all packet content?

Discussion in 'Windows Vista Drivers' started by LIMING, Feb 4, 2008.

  1. LIMING

    LIMING Guest

    In my intermediate driver (ndis5.1), i just want to check each tcp/udp
    packet's port number. I check the packet in the way that copy each packet
    content to my own buffer and then check the port number.
    I want to know is there any way to know the tcp/ucp packet port number
    without copying the content each time?
    Or the copy procedure is the must be....?
    Thanks for your advice!
     
    LIMING, Feb 4, 2008
    #1
    1. Advertisements

  2. LIMING

    PCAUSA Guest

    Re: How to get a tcp/ucp port in im driver without copying all packetcontent?

    On Feb 4, 12:02 am, "LIMING" <> wrote:
    > In my intermediate driver (ndis5.1), i just want to check each tcp/udp
    > packet's port number. I check the packet in the way that copy each packet
    > content to my own buffer and then check the port number.
    > I want to know is there any way to know the tcp/ucp packet port number
    > without copying the content each time?
    > Or the copy procedure is the must be....?
    > Thanks for your advice!


    NDIS 6 has an interesting NDIS library function called
    "NdisGetDataBuffer" that can be helpful.

    There isn't a similar function for NDIS 5, but it should be easy for
    you to write a similar function that operates on NDIS 5 packets.
    Basically the function would walk the MDL chain until it found the MDL
    containing a header and then return a pointer for the data in the MDL.
    The premise is that any single specific header would reside in a
    single MDL.

    NDIS.com shows a somewhat useful function that is called
    UtilReadOnPacket the can read parts of packet contents. See the "NDIS
    Packet Discussion" at the URL:

    http://ndis.com/papers/default.htm

    Good luck,

    Thomas F. DIvine
     
    PCAUSA, Feb 4, 2008
    #2
    1. Advertisements

  3. NdisGetDataBuffer makes parsing the headers easier by copying them to a
    contiguous buffer -if- necessary.

    That's all.

    To OP, I don't understand why you have to copy the headers before checking
    out for the port number.

    -ali

    --
    This posting is provided "AS IS" with no warranties, and confers no rights.

    NDIS does not
    "PCAUSA" <> wrote in message
    news:...
    On Feb 4, 12:02 am, "LIMING" <> wrote:
    > In my intermediate driver (ndis5.1), i just want to check each tcp/udp
    > packet's port number. I check the packet in the way that copy each packet
    > content to my own buffer and then check the port number.
    > I want to know is there any way to know the tcp/ucp packet port number
    > without copying the content each time?
    > Or the copy procedure is the must be....?
    > Thanks for your advice!


    NDIS 6 has an interesting NDIS library function called
    "NdisGetDataBuffer" that can be helpful.

    There isn't a similar function for NDIS 5, but it should be easy for
    you to write a similar function that operates on NDIS 5 packets.
    Basically the function would walk the MDL chain until it found the MDL
    containing a header and then return a pointer for the data in the MDL.
    The premise is that any single specific header would reside in a
    single MDL.

    NDIS.com shows a somewhat useful function that is called
    UtilReadOnPacket the can read parts of packet contents. See the "NDIS
    Packet Discussion" at the URL:

    http://ndis.com/papers/default.htm

    Good luck,

    Thomas F. DIvine
     
    Alireza Dabagh [MS], Feb 5, 2008
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. khuggart

    Can't configure tcp/ip printer port-Error loading the Tcp Mib Libr

    khuggart, Nov 16, 2006, in forum: Windows Vista Printing / Faxing / Scanning
    Replies:
    2
    Views:
    1,365
    khuggart
    Nov 16, 2006
  2. miki

    packet does not get to tcp ip

    miki, Aug 21, 2006, in forum: Windows Vista Drivers
    Replies:
    9
    Views:
    369
    Calvin Guan
    Aug 26, 2006
  3. Peter

    IM driver modifying packet content and task offload

    Peter, Feb 11, 2007, in forum: Windows Vista Drivers
    Replies:
    6
    Views:
    427
    Stephan Wolf [MVP]
    Feb 12, 2007
  4. Devang

    NDIS hook driver - no packet data in sent packet

    Devang, Nov 13, 2008, in forum: Windows Vista Drivers
    Replies:
    2
    Views:
    1,433
    Maxim S. Shatskih
    Nov 27, 2008
  5. Replies:
    0
    Views:
    403
  6. Gerbmeister
    Replies:
    2
    Views:
    456
    Bernard Cheah [MVP]
    May 16, 2007
  7. Ren
    Replies:
    0
    Views:
    1,696
  8. Spin
    Replies:
    2
    Views:
    238
    Walter Roberson
    Jul 18, 2008
Loading...