Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > how to acces whole packet on (IN/OUT) TRANSPORT LAYER

Reply
Thread Tools Display Modes

how to acces whole packet on (IN/OUT) TRANSPORT LAYER

 
 
nakato
Guest
Posts: n/a

 
      10-31-2009
Hi, i ha ve a following problem .. I registered callout on in, out transport
layer and i want to get the whole packet data from ETHERNET HEADER (mean from
dest. mac, source mac, protocol ) ending with the data data ...

i have tried this :

NdisRetreatNetBufferDataStart(
NET_BUFFER_LIST_FIRST_NB(pendedPacket->netBufferList),
pendedPacket->ipHeaderSize + pendedPacket->transportHeaderSize, 0,
NULL);

pendedPacket->netBufferListSize =
NET_BUFFER_DATA_LENGTH(NET_BUFFER_LIST_FIRST_NB(pe ndedPacket->netBufferList));

netBuffer = NET_BUFFER_LIST_FIRST_NB(pendedPacket->netBufferList);
pendedPacket->netBufferDataLength =NET_BUFFER_DATA_LENGTH(netBuffer);
currentMdl =NET_BUFFER_CURRENT_MDL(netBuffer);

packet = (UCHAR*) MmGetSystemAddressForMdlSafe(currentMdl, HighPagePriority
);

pendedPacket->packetDataLength = MmGetMdlByteCount(currentMdl);

-----
in packet, there should be the whole packet from begginig of the Eth.
Header, but there is not. What im doing wrong ? Where does
MmGetSystemAddressForMdlSafe point ?

thx for answers ..
 
Reply With Quote
 
 
 
 
nakato
Guest
Posts: n/a

 
      11-03-2009
Hi, thx for answer, but didnt helped ... Im currently using WFP to get data
packet data in TRANSPORT CALLOUT (IN/OUT direction).

if i do what you wrote, it will give me the same portion of data .. i
checked in windbg. Something is there not good :/

"eagersh" wrote:

> On Oct 31, 1:09 pm, nakato <nak...@discussions.microsoft.com> wrote:
> > Hi, i ha ve a following problem .. I registered callout on in, out transport
> > layer and i want to get the whole packet data from ETHERNET HEADER (mean from
> > dest. mac, source mac, protocol ) ending with the data data ...
> >
> > i have tried this :
> >
> > NdisRetreatNetBufferDataStart(
> > NET_BUFFER_LIST_FIRST_NB(pendedPacket->netBufferList),
> > pendedPacket->ipHeaderSize + pendedPacket->transportHeaderSize, 0,
> > NULL);
> >
> > pendedPacket->netBufferListSize =
> > NET_BUFFER_DATA_LENGTH(NET_BUFFER_LIST_FIRST_NB(pe ndedPacket->netBufferList));
> >
> > netBuffer = NET_BUFFER_LIST_FIRST_NB(pendedPacket->netBufferList);
> > pendedPacket->netBufferDataLength =NET_BUFFER_DATA_LENGTH(netBuffer);
> > currentMdl =NET_BUFFER_CURRENT_MDL(netBuffer);
> >
> > packet = (UCHAR*) MmGetSystemAddressForMdlSafe(currentMdl, HighPagePriority
> > );
> >
> > pendedPacket->packetDataLength = MmGetMdlByteCount(currentMdl);
> >
> > -----
> > in packet, there should be the whole packet from begginig of the Eth.
> > Header, but there is not. What im doing wrong ? Where does
> > MmGetSystemAddressForMdlSafe point ?
> >
> > thx for answers ..

>
> Because you move the current pointer in NET_BUFFER by
> NdisRetreatNetBufferDataStart you could not get Ethernet header.
> Before calling NdisRetreatNetBufferDataStart you should call
> packet = MmGetSystemAddressForMdlSafe(NET_BUFFER_CURRENT_MD L()) +
> NET_BUFFER_CURRENT_MDL_OFFSET());
>
> Igor Sharovar
>
> .
>

 
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
Easy Transfer Error Message Jim Windows Vista Installation 11 09-22-2007 08:23 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59