Mike,
I think you are getting confused by the naming in the NETVMINI sample.
The code and usage of NICIsPacketTransmittable() is correct. It would make
more sense if the name of the function was
NICIsPacketRecievable() instead, however.
The function checks the DSTMAC to see if it matches the packet filter of the
‘receiving’ adapter, not the sending adapter.
NDIS does not ever expect a NIC to filter based on SRCMAC. Indeed, it
expect that whatever SRCMAC is placed in the packet will be sent onto the
wire.
But you are 100% correct that this is a very good sample to start with when
looking to create a ‘virtual’ Miniport, especially one that might ultimately
wish to push transmitted packets back up to usermode with an ‘inverted’ call
model.
Good Luck,
Dave Cattley
Consulting Engineer
Systems Software Development
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mike Loving
Sent: Thursday, January 17, 2008 2:22 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Which Sample i should Consider for My reference for
creating virtual network adaptor
I recently used netvmini as a base for an NDIS driver. I am certainly not
an expert
at drivers, but I found it to be fine except for 2 things.
-
There is an outright bug in the function NICIsPacketTransmittable.
This code tests outgoing packet contents (addressing) to see if they are
“legal”. One of the last tests is for directed packets and the code
comments
say that it is going to test whether the source MAC address is the same as
what
the driver has recorded as the MAC address of the (virtual) adapter (NIC).
Unfortunately,
the sample code compares the DESTINATION MAC address to the stored MAC
address. For directed packets, these will never match, so this function
ends up
filtering out all directed packets.
else if(Adapter->PacketFilter & NDIS_PACKET_TYPE_DIRECTED)
{
//
// This has to be a directed packet. If so, does packet source
// address match with the mac address of the NIC.
//
ETH_COMPARE_NETWORK_ADDRESSES_EQ(
Address, (should be
Address+6) <--------
Adapter->CurrentAddress,
-
The netvmini driver creates a list of installed netvmini adapters (driver
instances).
When it goes to send, it walks this list. You won’t really need the list of
adapters, but
it won’t really hurt anything either. It just adds a little bit of
confusion.
----- Original Message ----
From: nayan kumar
To: Windows System Software Devs Interest List
Sent: Thursday, January 17, 2008 2:58:21 AM
Subject: [ntdev] Which Sample i should Consider for My reference for
creating virtual network adaptor
Hi All,
I have been assigned the task to create a virtual network adaopter
that is supposed to take the actual data from another driver eg usb and
make a packet based on the data that i will get from usb driver and send it
that will be read by user mode application by using socket or so on.
i am thinking to use the NDIS Virtual Miniport Driver as refernce for my
work .
i want to know weather my decision of using the NDIS Virtual Miniport Driver
for my work is right or not if yes then If there is any other thing
according to you expert people that i should know apart from whatever has
been given in the ddk sample and documentation please guide me what should
be that and from where i can that.
if my decision of using the above mention example is wrong then which
example is best fit for my requirment and from where i can get the help in
this regard.
Regards
Live the life in style with MSN Lifestyle. Check out! Try
http: it now!
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
_____
Never miss a thing. Make Yahoo
http: your homepage.
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer</http:></http:>