You might try exposing an auxilary miniport (adapter) which behaves the way
the NDISWAN “Bloodhound” adapter behaves. (Bloodhound is what Netmon was
once know as. I guess they were looking for something…)
Set your auxilary adapter up with
HKR, Ndi, BindForm, 0, “NdisWanBh”
HKR, Ndi\Interfaces, UpperRange, 0, “ndiswanbh”
HKR, Ndi\Interfaces, LowerRange, 0, “wan”
Look in %windir%\inf\netrasa.inf for more…
And have it report that the medium is NdisMediumWan. It wil *not* be an
NDISWAN driver but will be an normal NDIS ‘ethernet’ driver. Netmon should
bind to this and open it in promiscuous mode. At that point, you can
indicate all of your PPP encapsulated traffic in the Netmon
‘psuedo-ethernet’ format which is to say an Ethernet packet header appended
to a HDLC packet. Capture a few frames with Netmon from a PPP connection
via NDISWAN and you will get the idea. The MAC addresses are typically set
to the octets ‘SEND’ and ‘RECV’ to identify what path the packet was grabbed
from. I imagine that if you read through the sources for WinPCAP, it
probably lays out the ‘protocol’ side logic. From that, perhaps, you can
figure out what a miniport needs to do.
This mechanism is how NDISWAN provides netmon with PPP frames. I must admit
I have never tried to create a Miniport entity which emulates this behavior
so this all could be just about as good an idea as the original Tacoma
Narrows Bridge design.
Alternatively, you could just write the packets to a file (reflect them to
usermode and write them to a file that is) in one of the many (way to many)
capture formats available - all of which Ethereal will read.
Good Luck,
Dave Cattley
Consulting Engineer
Systems Software Development
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Tuesday, October 02, 2007 6:45 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] How do I extend NetMon to capture traffic from my NDIS
miniport driver
Thanks for the reply. Let me provide a little background that might help.
My NDIS miniport driver recieves 802.3 packets from the NDIS upper edge, but
then stips off the ethernet headers and slaps on a PPP protocol, spoofing
ARP and DHCP requests. I can bind NetMon or Ethereal to the protocol edge
and see the 802.3 packets, but I actually want to log the PPP encapsulated
packets I’m sending out on my lower edge.
If anyone has insights on how to do that within NetMon or Ethereal I would
appreciate any pointers.
thanks,
Kashif Hasan
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