Hi

I want to develop a special NDIS IM driver (based on the
passthru sample)with the only functionality, that it
bridges all packets that come from one of the two
installed NICs to the other one and vice versa. Now,
every packet I receive in my ReceivePacket handler is
received in a special context (right?), e.g. all the
handles to the miniports etc. that are part of the PADAPT
structure. Now, how can I use another NIC to
really 'receive' the packet on?
Or is my whole approach wrong? If so, how is this done?


Thanks a lot
Sam

RE: NDIS IM ethernet bridge by bburgin

bburgin
Sat Oct 25 21:35:19 CDT 2003

------=_NextPart_0001_CEAA577F
Content-Type: text/plain
Content-Transfer-Encoding: 7bit



Seems that since you won't need a miniport edge at all, you could just
create a protocol driver (based on NDISPROT -- but you won't need the
IRP/IOCTL interface to receive packets from user space (through the
NdisuioWrite code path). When you are indicated a packet from one NIC, you
can just send it down to the other NIC via NdisSend/NdisSendPackets --
being very careful to make sure you keep track of who owns the packet and
payload, amking copies of payload, as necessary, and creating new packet
descripters, etc, as the original miniport will want its packet returned,
etc.

Bryan S. Burgin
bburgin@microsoft.com

This posting is provided "AS IS" with no warranties, and confers no rights.
------=_NextPart_0001_CEAA577F
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20
\par
\par Seems that since you won't need a miniport edge at all, you could just create a protocol driver (based on NDISPROT -- but you won't need the IRP/IOCTL interface to receive packets from user space (through the NdisuioWrite code path). When you are indicated a packet from one NIC, you can just send it down to the other NIC via NdisSend/NdisSendPackets -- being very careful to make sure you keep track of who owns the packet and payload, amking copies of payload, as necessary, and creating new packet descripters, etc, as the original miniport will want its packet returned, etc.
\par
\par Bryan S. Burgin
\par bburgin@microsoft.com
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par }
------=_NextPart_0001_CEAA577F--


Re: NDIS IM ethernet bridge by Duh

Duh
Wed Oct 29 14:29:25 CST 2003

Sam Johnson wrote:
> Hi
>
> I want to develop a special NDIS IM driver (based on the
> passthru sample)with the only functionality, that it
> bridges all packets that come from one of the two
> installed NICs to the other one and vice versa. Now,
> every packet I receive in my ReceivePacket handler is
> received in a special context (right?), e.g. all the
> handles to the miniports etc. that are part of the PADAPT
> structure. Now, how can I use another NIC to
> really 'receive' the packet on?
> Or is my whole approach wrong? If so, how is this done?
>

It seems like you need (no matter will you do this in IM or PROT driver)
a shared area for your virtual adapters. Original PASSTHRU sample does
LBFO (Load-Balancing and Fail-Over), which means it already has some
shared are with adapter list in it. It combines virtual adapters in
"bundles", meaning that any receive from adapters in bundle will be
indicated only at "main" adapter's miniport edge. That means it perform
lookup at this adapter list to find that "main" adapter, its PADAPT
structure. What you need to change is not indicate the received packet
by using mainpAdapt->bindingHandle, but send it down to the network by
using mainpAdapt->adapterHandle. After that you just kill the packet not
indicating it to the stack. Incoming SendCompletes on "main" adapter may
be dropped off, as they are useless. Incoming ReceiveCompletes from
not-"main" adapter are also of few use.

Wanna beer for that advice! =))

Good luck, Duh.


Re: NDIS IM ethernet bridge by Stephan

Stephan
Fri Oct 31 11:30:39 CST 2003

Why are you trying to implement an already existing feature? See


http://groups.google.com/groups?selm=en5unvo7ehcquflubdbk88i7hkhvit2t2o%404ax.com

Stephan
---
On Sat, 25 Oct 2003 12:49:42 -0700, "Sam Johnson"
<anonymous@discussions.microsoft.com> wrote:

>Hi
>
>I want to develop a special NDIS IM driver (based on the
>passthru sample)with the only functionality, that it
>bridges all packets that come from one of the two
>installed NICs to the other one and vice versa. Now,
>every packet I receive in my ReceivePacket handler is
>received in a special context (right?), e.g. all the
>handles to the miniports etc. that are part of the PADAPT
>structure. Now, how can I use another NIC to
>really 'receive' the packet on?
>Or is my whole approach wrong? If so, how is this done?
>
>
>Thanks a lot
>Sam