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. Advertising

  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. Advertising

  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. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
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,033
    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:
    269
    Calvin Guan
    Aug 26, 2006
  3. Devang

    NDIS hook driver - no packet data in sent packet

    Devang, Nov 13, 2008, in forum: Windows Vista Drivers
    Replies:
    2
    Views:
    1,111
    Maxim S. Shatskih
    Nov 27, 2008
  4. Ren
    Replies:
    0
    Views:
    1,213
  5. Spin
    Replies:
    2
    Views:
    164
    Walter Roberson
    Jul 18, 2008
Loading...

Share This Page