0

I was trying to write a test bridge between two ethernet adapters using the NDIS proto example given in the WDK for Win 7. So far just got the driver and prototest built. Now I was wondering how to proceeed? Is there any way to bind to only a couple of adapters at one time?

rene
  • 41,474
  • 78
  • 114
  • 152
Jimson James
  • 2,937
  • 6
  • 43
  • 78

1 Answers1

0

An NDIS protocol automatically binds to all supported adapters. So you don't need to do extra work to get NDISPROT to bind over two Ethernet NICs.

Once you've built the driver, all you need to do is:

  1. Install the driver (use INetCfgClassSetup::Install as illustrated in the bindview sample; or for casual experimentation, the NIC properties GUI has an Add... button that lets you install protocols with a GUI).
  2. Start the driver service (use StartService API; or for casual experimentation, net start ndisprot will do).

That's it. NDIS will call your protocol's ProtocolBindAdpaterEx handler for each Ethernet NIC on the system. This callback is named NdisprotBindAdapter in the sample.

Use !ndiskd.protocol to verify that your protocol is now bound to multiple miniports.

Jeffrey Tippet
  • 3,146
  • 1
  • 14
  • 15
  • Thanks Jeffrey, can I bind to only selected adapters? – Jimson James Apr 03 '13 at 01:18
  • also, is it the right way to make ethernet bridge or should I use miniport or filter driver? Do you know of any example ethernet bridge driver in NDIS6.x? – Jimson James Apr 03 '13 at 01:21
  • To bind to selected adapters: in usermode, use INetCfgBindingPath::Enable(FALSE) to disable bindings to certain adapters. In kernelmode: in your ProtocolBindAdapterEx handler, just choose to not call NdisOpenAdapterEx if you don't want to bind. – Jeffrey Tippet Apr 03 '13 at 20:33
  • Windows comes with an Ethernet bridge, so that's the best example to compare with. It is implemented as a MUX-IM driver, which is fairly complicated to get right. The advantage to a MUX-IM versus a regular protocol is the bridged adapters appear as 1 unified network interface to the OS. If it's ok that the bridged adapters each appear independently to the OS, then you don't need a MUX-IM, and a protocol is sufficient. – Jeffrey Tippet Apr 03 '13 at 20:36
  • no problem in appearing the bridged adapters appearing independently to OS, But what I'm now confused at is, after reading this link http://www.tech-archive.net/Archive/Development/microsoft.public.development.device.drivers/2004-04/1377.html Is it possible to achieve the same by modifying passthru? If yes, wondering how? – Jimson James Apr 04 '13 at 03:28
  • Don't use passthru for this. Since this answer requires more space, I answered here: http://stackoverflow.com/questions/15792238/ndis-6-x-ethernet-bridge-driver – Jeffrey Tippet Apr 04 '13 at 21:42