Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > How to get a tcp/ucp port in im driver without copying all packet content?

Reply
Thread Tools Display Modes

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

 
 
LIMING
Guest
Posts: n/a

 
      02-04-2008
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!

 
Reply With Quote
 
 
 
 
PCAUSA
Guest
Posts: n/a

 
      02-04-2008
On Feb 4, 12:02*am, "LIMING" <someblue2...@hotmail.com> 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
 
Reply With Quote
 
 
 
 
Alireza Dabagh [MS]
Guest
Posts: n/a

 
      02-05-2008
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:05e9b5d4-d30a-4af6-bde1-...
On Feb 4, 12:02 am, "LIMING" <someblue2...@hotmail.com> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
USB zero length packet as the last packet of an URB Ren Windows Vista Drivers 0 10-12-2009 02:30 PM
How I Get current packet information ( like IP PORT PROTOCOL.. ) byWFP method? saicong@gmail.com Windows Vista Drivers 0 12-16-2008 07:58 AM
NDIS hook driver - no packet data in sent packet Devang Windows Vista Drivers 2 11-27-2008 06:05 PM
I2C through PC parallel port, serial port and/or USB port - please help Adam Windows Vista Drivers 22 06-29-2004 04:48 PM