Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > PtReceiveNBL how to forward packet.

Reply
Thread Tools Display Modes

PtReceiveNBL how to forward packet.

 
 
ttan
Guest
Posts: n/a

 
      06-30-2010
Hi,

I'm had IM driver with 2 NICs. How do I forward a packet in PtReceiveNBL?

What I'm trying to do is: If I receive a packet, I do checked if this packet
for me I indicated it up. If it not for me I forward the packet on to
another node.

What I have tried and didn't work:
duplicate the packet and used NdisSendNetBufferLists(pAdapt->BindingHandle,
CurrentNetBufferList,
PortNumber,
SendFlags);
to forward this packet.

Can someone help me to get this work? I'm really appreciated.


 
Reply With Quote
 
 
 
 
Thomas F. Divine
Guest
Posts: n/a

 
      06-30-2010
You need to think of this as if you were creating your own packet
(NET_BUFFER) from scratch. So please read and understand the WDK topics
related to "Sending Network Data".

You will need to construct your own NET_BUFFER (for the packet) and
NET_BUFFER_LIST (the packet list).

You must modify the link and network address headers in your new NET_BUFFER
(packet) to have the correct source and destination addresses. There is no
facility at the NDIS level that will do this for you automatically.

If you study the NET_BUFFER description and buffer management functions
carefully you can associate the payload MDLs of the received NET_BUFFER with
the new NET_BUFFER that you will be sending. A simpler approach might be to
create a copy of the payload in memory that you allocate yourself.

You will need to use the context area of your new NET_BUFFER_LIST (or some
other scheme...) to keep a reference to the original received
NET_BUFFER_LIST.

When your send completes you will need to examine the send NET_BUFFER_LIST
context to fetch the original receive NET_BUFFER_LIST and return it. Then
recycle the NET_BUFFER_LIST and other resources that you allocated to send
the redirected packet.

This chat assumes that you are "forwarding" a packet to a different node on
the network (a remote host).

The Devil is in the details, which you must learn for yourself.

Good luck,

Thomas F. Divine
http://www.pcausa.com

"ttan" <> wrote in message
news:E984395D-CCAA-450F-A2FB-...
> Hi,
>
> I'm had IM driver with 2 NICs. How do I forward a packet in PtReceiveNBL?
>
> What I'm trying to do is: If I receive a packet, I do checked if this
> packet
> for me I indicated it up. If it not for me I forward the packet on to
> another node.
>
> What I have tried and didn't work:
> duplicate the packet and used
> NdisSendNetBufferLists(pAdapt->BindingHandle,
> CurrentNetBufferList,
> PortNumber,
> SendFlags);
> to forward this packet.
>
> Can someone help me to get this work? I'm really appreciated.
>
>

 
Reply With Quote
 
ttan
Guest
Posts: n/a

 
      06-30-2010
Thomas, Thank you for your respond.

You must modify the link and network address headers in your new NET_BUFFER
(packet) to have the correct source and destination addresses.

Another question to the statement above?
If I had node A--B--C how do I modify the source and destination addresses
to be able to ping?
When I do a ping I can ping A to B but I can not ping A to C.



"Thomas F. Divine" wrote:

> You need to think of this as if you were creating your own packet
> (NET_BUFFER) from scratch. So please read and understand the WDK topics
> related to "Sending Network Data".
>
> You will need to construct your own NET_BUFFER (for the packet) and
> NET_BUFFER_LIST (the packet list).
>
> You must modify the link and network address headers in your new NET_BUFFER
> (packet) to have the correct source and destination addresses. There is no
> facility at the NDIS level that will do this for you automatically.
>
> If you study the NET_BUFFER description and buffer management functions
> carefully you can associate the payload MDLs of the received NET_BUFFER with
> the new NET_BUFFER that you will be sending. A simpler approach might be to
> create a copy of the payload in memory that you allocate yourself.
>
> You will need to use the context area of your new NET_BUFFER_LIST (or some
> other scheme...) to keep a reference to the original received
> NET_BUFFER_LIST.
>
> When your send completes you will need to examine the send NET_BUFFER_LIST
> context to fetch the original receive NET_BUFFER_LIST and return it. Then
> recycle the NET_BUFFER_LIST and other resources that you allocated to send
> the redirected packet.
>
> This chat assumes that you are "forwarding" a packet to a different node on
> the network (a remote host).
>
> The Devil is in the details, which you must learn for yourself.
>
> Good luck,
>
> Thomas F. Divine
> http://www.pcausa.com
>
> "ttan" <> wrote in message
> news:E984395D-CCAA-450F-A2FB-...
> > Hi,
> >
> > I'm had IM driver with 2 NICs. How do I forward a packet in PtReceiveNBL?
> >
> > What I'm trying to do is: If I receive a packet, I do checked if this
> > packet
> > for me I indicated it up. If it not for me I forward the packet on to
> > another node.
> >
> > What I have tried and didn't work:
> > duplicate the packet and used
> > NdisSendNetBufferLists(pAdapt->BindingHandle,
> > CurrentNetBufferList,
> > PortNumber,
> > SendFlags);
> > to forward this packet.
> >
> > Can someone help me to get this work? I'm really appreciated.
> >
> >

 
Reply With Quote
 
Thomas F. Divine
Guest
Posts: n/a

 
      06-30-2010
I am afraid that you must study the details of packet addressing yourself.
You must know this. After you do, you can answer for yourself.

Thomas

"ttan" <> wrote in message
news:B8242E6C-743C-41D1-8DC9-...
> Thomas, Thank you for your respond.
>
> You must modify the link and network address headers in your new
> NET_BUFFER
> (packet) to have the correct source and destination addresses.
>
> Another question to the statement above?
> If I had node A--B--C how do I modify the source and destination addresses
> to be able to ping?
> When I do a ping I can ping A to B but I can not ping A to C.
>
>
>
> "Thomas F. Divine" wrote:
>
>> You need to think of this as if you were creating your own packet
>> (NET_BUFFER) from scratch. So please read and understand the WDK topics
>> related to "Sending Network Data".
>>
>> You will need to construct your own NET_BUFFER (for the packet) and
>> NET_BUFFER_LIST (the packet list).
>>
>> You must modify the link and network address headers in your new
>> NET_BUFFER
>> (packet) to have the correct source and destination addresses. There is
>> no
>> facility at the NDIS level that will do this for you automatically.
>>
>> If you study the NET_BUFFER description and buffer management functions
>> carefully you can associate the payload MDLs of the received NET_BUFFER
>> with
>> the new NET_BUFFER that you will be sending. A simpler approach might be
>> to
>> create a copy of the payload in memory that you allocate yourself.
>>
>> You will need to use the context area of your new NET_BUFFER_LIST (or
>> some
>> other scheme...) to keep a reference to the original received
>> NET_BUFFER_LIST.
>>
>> When your send completes you will need to examine the send
>> NET_BUFFER_LIST
>> context to fetch the original receive NET_BUFFER_LIST and return it. Then
>> recycle the NET_BUFFER_LIST and other resources that you allocated to
>> send
>> the redirected packet.
>>
>> This chat assumes that you are "forwarding" a packet to a different node
>> on
>> the network (a remote host).
>>
>> The Devil is in the details, which you must learn for yourself.
>>
>> Good luck,
>>
>> Thomas F. Divine
>> http://www.pcausa.com
>>
>> "ttan" <> wrote in message
>> news:E984395D-CCAA-450F-A2FB-...
>> > Hi,
>> >
>> > I'm had IM driver with 2 NICs. How do I forward a packet in
>> > PtReceiveNBL?
>> >
>> > What I'm trying to do is: If I receive a packet, I do checked if this
>> > packet
>> > for me I indicated it up. If it not for me I forward the packet on to
>> > another node.
>> >
>> > What I have tried and didn't work:
>> > duplicate the packet and used
>> > NdisSendNetBufferLists(pAdapt->BindingHandle,
>> > CurrentNetBufferList,
>> > PortNumber,
>> > SendFlags);
>> > to forward this packet.
>> >
>> > Can someone help me to get this work? I'm really appreciated.
>> >
>> >

 
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
Windbg trouble debugging - target Win7 pro AMD64 Clay Windows Vista Drivers 0 06-29-2010 10:15 PM
Windows TCP TimeStamp not compliant to (RFC 1323) !?!? feyb64 Server Networking 8 03-15-2010 03:41 PM
Re: VPN keeps dropping at the 3 minute mark Cliff Galiher Windows Small Business Server 3 12-07-2009 02:36 PM
WLM strips photos from Forwards Jim Windows Live Mail 8 12-04-2009 03:38 PM
Easy Transfer Error Message Jim Windows Vista Installation 11 09-22-2007 07: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