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

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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" <pcausa@xxxxxxxxx> wrote in message news:05e9b5d4-d30a-4af6-bde1-5c70f13a88d0@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Feb 4, 12:02 am, "LIMING" <someblue2...@xxxxxxxxxxx> 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

.



Relevant Pages

  • Re: How to get a tcp/ucp port in im driver without copying all packet content?
    ... I check the packet in the way that copy each packet ... content to my own buffer and then check the port number. ... NDIS 6 has an interesting NDIS library function called ... Basically the function would walk the MDL chain until it found the MDL ...
    (microsoft.public.development.device.drivers)
  • Re: NDIS miniport with WDM lower edge, SG list for a MDL, DMA adapter
    ... This packet is made of several chained MDL. ... NDIS uses the chain field of the MDL. ...
    (microsoft.public.development.device.drivers)
  • Re: xPC Binary Fifo Problem
    ... In general you'll be looking for one of the headers ... packet could trigger the code to think that it was the ... header of a different command. ... The problem I'm encountering is that the binary header FIFO ...
    (comp.soft-sys.matlab)
  • Re: xPC Binary Fifo Problem
    ... packet could trigger the code to think that it was the ... header of a different command. ... The problem I'm encountering is that the binary header FIFO ... under the serial system has problems with headers that start ...
    (comp.soft-sys.matlab)
  • Re: Is a HTTP header a clear text?
    ... getting the HTTP headers which is supposed to be clear text we're ... This is the whole captured packet we got by writing it in a file using ... tcp headers. ...
    (comp.os.linux.networking)