Dear all
I’m studying the IM driver development ,and use the DDK sample
‘PASSTHRU’. After I intall PASSTHRU , I find that PASSTHRU will bind to each
Adapter, which means if there are two Ethernet cards ,the IM will bind to
each one.
My question is that can I send packets to a specified Ethernet Card in
PASSTHRU ? Example : there are two Ethernet Cards on PC , A and B, Can I
just send packets to Ethenet card A ?
Any suggetstion and clue are welcome .
Best Regards.
Josephxu
“ze zefeng” wrote in message news:xxxxx@ntdev…
Dear all
I’m studying the IM driver development ,and use the DDK sample ‘PASSTHRU’. After I intall PASSTHRU , I find that PASSTHRU will bind to each Adapter, which means if there are two Ethernet cards ,the IM will bind to each one.
My question is that can I send packets to a specified Ethernet Card in PASSTHRU ? Example : there are two Ethernet Cards on PC , A and B, Can I just send packets to Ethenet card A ?
Any suggetstion and clue are welcome .
Best Regards.
Josephxu
See the three-part series of articles “Extending the PassThru NDIS Intermediate Driver…” at http://www/wd-3.com.
The first two parts are in the Archives.
The sample extends the PassThru driver to include an IOCTL interface that can 1.) enumerate bound adapters and 2.) selectively open handles to one or more of the bound adapters. The sample illustrates making NDIS requests on an adapter handle. You would extend the sample to send packets on a specific handle (adapter).
Good luck,
Thomas F. Divine
Thomas, Thanks for answer 
I have studied the codes , in the sample codes ,User can specify the
adapter via IOCTRL, And it just can open a adapter one time .
Then ,my another question is that , whether IM can get packets(X)
from adapter(A) , then forwarding thoese packets(X) to adapter(B) ?
Best regards
Josephxu
2005/12/13, Thomas F. Divine :
>
>
>
> “ze zefeng” wrote in message news:xxxxx@ntdev…
>
>
> Dear all
> I’m studying the IM driver development ,and use the DDK sample
> ‘PASSTHRU’. After I intall PASSTHRU , I find that PASSTHRU will bind to each
> Adapter, which means if there are two Ethernet cards ,the IM will bind to
> each one.
> My question is that can I send packets to a specified Ethernet Card
> in PASSTHRU ? Example : there are two Ethernet Cards on PC , A and B, Can I
> just send packets to Ethenet card A ?
> Any suggetstion and clue are welcome .
>
>
> Best Regards.
> Josephxu
>
>
> See the three-part series of articles “Extending the PassThru NDIS
> Intermediate Driver…” at http://www/wd-3.com.
>
> The first two parts are in the Archives.
>
> The sample extends the PassThru driver to include an IOCTL interface that
> can 1.) enumerate bound adapters and 2.) selectively open handles to one or
> more of the bound adapters. The sample illustrates making NDIS requests on
> an adapter handle. You would extend the sample to send packets on a specific
> handle (adapter).
>
> Good luck,
>
> Thomas F. Divine
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
>
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>Then ,my another question is that , whether IM can get packets(X)
from adapter(A) , then forwarding thoese packets(X) to adapter(B) ?
You will need another NDIS_PACKET structure. You can reuse the same buffer
chain there, provided you will not update the data.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
Yes,Maxim. I can rewrap the packets , but , how can I forward to adapter
B? I means how can I send to adapter B. Because I get the packets from
adapter A, and then I know the handle of adapter A, but don’t know the
handle of adapter B .
2005/12/15, Maxim S. Shatskih :
>
> >Then ,my another question is that , whether IM can get packets(X)
> >from adapter(A) , then forwarding thoese packets(X) to adapter(B) ?
>
> You will need another NDIS_PACKET structure. You can reuse the same buffer
> chain there, provided you will not update the data.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
You filter both adapters I think.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “ze zefeng”
To: “Windows System Software Devs Interest List”
Sent: Thursday, December 15, 2005 10:18 AM
Subject: Re: [ntdev] About IM binds Adapters
Yes,Maxim. I can rewrap the packets , but , how can I forward to adapter
B? I means how can I send to adapter B. Because I get the packets from
adapter A, and then I know the handle of adapter A, but don’t know the
handle of adapter B .
2005/12/15, Maxim S. Shatskih :
>
> >Then ,my another question is that , whether IM can get packets(X)
> >from adapter(A) , then forwarding thoese packets(X) to adapter(B) ?
>
> You will need another NDIS_PACKET structure. You can reuse the same buffer
> chain there, provided you will not update the data.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
“ze zefeng” wrote in message news:xxxxx@ntdev…
Yes,Maxim. I can rewrap the packets , but , how can I forward to adapter B? I means how can I send to adapter B. Because I get the packets from adapter A, and then I know the handle of adapter A, but don’t know the handle of adapter B .
Open a handle to both adapters. When you read on adapter A (handle A), then you would write on adapter B (handle B) to forward the packet. Likewise, when you read a packet on B, you would then write of A.
Of course, you must modify the Ethernet and IP headers correctly along the way.
You must also deal with loopback of forwarded packets. For example, when you write the forwarded packet on B it may be looped back to appear as a received packet on B. Of course, you don’t want to forward this loopback packet back to A because you would get into an infinite loop. There is some information about the way NDIS loopback works at http://www.ndis.com.
You must also study all of the network protocols because you may want to handle some packets specially. For example, a packet directed to A should not be forwarded; instead, it should be passed upwards to the normal TCP/IP stack.
Good luck,
Thomas F. Divine, Windows DDK MVP
http://www.pcausa.com
Hi, Thomas
“*Open a handle to both adapters*.*When you read on adapter A (handle A),
then you would write on adapter B (handle B) to forward the packet*.” "
Do you mean a handle can be specified to more than one adapter at one
time ? If so, how can we verify the adapter which the handle points to ?
“*Of course, you must modify the Ethernet and IP headers correctly along
the way.*”
Do you mean the handle know which adapter the packets shoule be sent via
*the Ethernet and IP headers .?*
**
* *Sorry for these basic question . I’m confused about them .
2005/12/16, Thomas F. Divine :
>
>
>
> “ze zefeng” wrote in message news:xxxxx@ntdev…
> Yes,Maxim. I can rewrap the packets , but , how can I forward to adapter
> B? I means how can I send to adapter B. Because I get the packets from
> adapter A, and then I know the handle of adapter A, but don’t know the
> handle of adapter B .
>
>
> Open a handle to both adapters. When you read on adapter A (handle A),
> then you would write on adapter B (handle B) to forward the packet.
> Likewise, when you read a packet on B, you would then write of A.
>
> Of course, you must modify the Ethernet and IP headers correctly along the
> way.
>
> You must also deal with loopback of forwarded packets. For example, when
> you write the forwarded packet on B it may be looped back to appear as a
> received packet on B. Of course, you don’t want to forward this loopback
> packet back to A because you would get into an infinite loop. There is some
> information about the way NDIS loopback works at http://www.ndis.com.
>
> You must also study all of the network protocols because you may want to
> handle some packets specially. For example, a packet directed to A should
> not be forwarded; instead, it should be passed upwards to the normal TCP/IP
> stack.
>
> Good luck,
>
> Thomas F. Divine, Windows DDK MVP
> http://www.pcausa.com
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
>
> To unsubscribe send a blank email to xxxxx@lists.osr.com
“ze zefeng” wrote in message news:xxxxx@ntdev…
Hi, Thomas
“Open a handle to both adapters.When you read on adapter A (handle A), then you would write on adapter B (handle B) to forward the packet. " “
Do you mean a handle can be specified to more than one adapter at one time ? If so, how can we verify the adapter which the handle points to ?
Yes, multiple handles can be opened concurrently. You really should read the article at http://www/wd-3.com and look at the test application that comes with it.
When you open each handle you can fetch quite a bit information about the each adapter. Fetching of some of the information is illustrated in the Test application that is included with the Part 1 article. Here is some of the output from the test application with three adapters (and three handles) opened:
PassThru User I/O Test Application
Copyright (c) 2003-2005 Printing Communications Assoc., Inc. (PCAUSA)
All rights reserved.Driver Bindings:
“\Device{67A4853E-1940-43A3-A442-74701B5133B0}”
Description: " Intel 8255x-based Integrated Fast Ethernet”
Medium: 802.3
Mac address = 00-00-39-14-92-A9
Media Connect Status: Disconnected “\Device{0611AD65-41D8-4BB1-8A8F-43008BB362A3}”
Description: " NdisWan Adapter”
Medium: 802.3
Mac address = C0-F2-20-52-41-53
Media Connect Status: Connected “\Device{8DA82E8E-D091-4FB2-902A-673FBEC2DA7C}”
Description: “3CRWE737A AirConnect Wireless LAN PC Card”
Medium: 802.3
Mac address = 00-50-DA-03-4E-6C
Media Connect Status: ConnectedYou can fetch more information if you like. You can make additional NDIS requrests to query different information. You can also use the MAC address or the Device GUID to fetch information using the IP Helper API.
So, there is no problem knowing all that you could ever want to know about handle-adapter association.
“Of course, you must modify the Ethernet and IP headers correctly along the way.”
Do you mean the handle know which adapter the packets shoule be sent via the Ethernet and IP headers .?
No, the handle doesn’t “know anything”. If you open a handle to a file, the handle doesn’t “know anything” either. You must know what each handle “means” because you opened it.
If you write on one handle, packets are sent on network through the adapter that is associated with that handle. If you write on a different handle, then the packet is sent on the network through the adapter addociated with that different handle.
Of course, the sample doesn’t include code that actually sends or receive packets. Just code that shown how to open a handle to a specific adapter. You will have to writer the IPR_MJ_WRITE and IPR_MJ_READ handlers yourself.
Good luck,
Thomas F. Divine, Windows DDK MVP
http://www.pcausa.com
Sorry for these basic question . I’m confused about them .
2005/12/16, Thomas F. Divine :
“ze zefeng” wrote in message news:xxxxx@ntdev…
Yes,Maxim. I can rewrap the packets , but , how can I forward to adapter B? I means how can I send to adapter B. Because I get the packets from adapter A, and then I know the handle of adapter A, but don’t know the handle of adapter B .
Open a handle to both adapters. When you read on adapter A (handle A), then you would write on adapter B (handle B) to forward the packet. Likewise, when you read a packet on B, you would then write of A.
Of course, you must modify the Ethernet and IP headers correctly along the way.
You must also deal with loopback of forwarded packets. For example, when you write the forwarded packet on B it may be looped back to appear as a received packet on B. Of course, you don’t want to forward this loopback packet back to A because you would get into an infinite loop. There is some information about the way NDIS loopback works at http://www.ndis.com.
You must also study all of the network protocols because you may want to handle some packets specially. For example, a packet directed to A should not be forwarded; instead, it should be passed upwards to the normal TCP/IP stack.
Good luck,
Thomas F. Divine, Windows DDK MVP
http://www.pcausa.com
—
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com