Writing protocol driver for Raw Packet bridging



I am in the process of writing a protocol driver for the purpose of
catching all packets on one network card and passing it to a second
network card (Bridge). It seems that the Bridge supplied in CE does
not work properly for us, and numerous newsgroup posts suggest the
same thing. I am using two things to try to get this done, first is
the NDISUIO sample in platform builder, and the documentation from
http://www.codeproject.com/cs/internet/sendrawpacket.asp?df=100&forum...

I can from the project above, that it was not specifically for windows
CE 5.0, but the code in the NDISUIO sample was very close to that of
the windows code. According to the above instructions, I added
promiscuous mode to the filters...

#define NUIOO_PACKET_FILTER (NDIS_PACKET_TYPE_DIRECTED| \
NDIS_PACKET_TYPE_MULTICAST| \
NDIS_PACKET_TYPE_BROADCAST| \
NDIS_PACKET_TYPE_PROMISCUOUS) //
**Added**

But the next step requires commenting out a mac address check (anti-
spoofing) before sending.

// send.c
// line 136
// Comment out to support sending packets from any MAC source address

// To prevent applications from sending packets with spoofed
// mac address, we will do the following check to make sure the
source
// address in the packet is same as the current MAC address of
the NIC.
//
if ((pIrp->RequestorMode == UserMode) &&
!NPROT_MEM_CMP(pEthHeader->SrcAddr,
pOpenContext->CurrentAddress, NPROT_MAC_ADDR_LEN))
{
DEBUGP(DL_WARN, ("Write: Failing with invalid Source
address"));
NtStatus = STATUS_INVALID_PARAMETER;
break;
}

I can not find any MAC address checking in any of the NDISUIO code.
Is it not there? If it is not there, then I am assuming that the code
does not check for spoofed mac addresses, and my modifications are
done.

have discovered the following...

snip...

"You are correct that there is no provision in CE for an application
to
directly access an NDIS miniport driver.

End Snip...

So that leaves me with using the registry for the task. Is there any
words of wisdom on this. To be honest, looking through MSDN on
miniport drivers is very confusing to me. The end goal is to get
packets from a wireless card and pass then through to a wired card.

Thanks,
Tom

.



Relevant Pages

  • Re: question regarding load-balancing intermediate driver
    ... I am working on an load-balancing/fail-over intermediate driver ... Whenever I disable one of the physical adapter which is part of team, ... driver stops receiving packets. ... MAC address of the adapter that was disabled? ...
    (microsoft.public.development.device.drivers)
  • Re: Promiscuous Mode
    ... packets not destined for your MAC address anyway (Unless they're ... I have a related question: if your network card is in promisc mode and ... something), and someone sends a packet with a MAC address that isn't yours, ...
    (Pen-Test)
  • Re: MAC OSX PCI network driver development for newbies
    ... I have developed a Windows NDIS Miniport Driver for a network card. ... i want the same driver to be ported to the MAC OSX 10.4.3. ... And one more thing is that KEXT (Kernel extentions). ...
    (comp.sys.mac.programmer.help)
  • Re: Problem with matching kind of NDIS driver.
    ... What does your driver really need to do? ... Note also that you will not see any packets in the TDI ... I need a driver which will catch all packets going through network card, ... advices, Mirage2k2. ...
    (microsoft.public.development.device.drivers)
  • Re: Retrieving MAC address
    ... Yes, it is true, but the driver itself is able to read the ... MAC address. ... >> Is it possible to retrieve the MAC address if the network card is ... >> Gabriel Topala ...
    (microsoft.public.win32.programmer.networks)