The miniport does not do any ‘reversing’ (loopback) based on IP address. In
fact, the miniport ignores pretty much all but the MAC header and will
always send the packet onto the wire with the destination MAC address
determining if any other station (or stations) will accept the packet for
receive.
If your IM driver is to perform as I noted, the IM driver itself must make a
copy of the original packet, perform the translation, and then ‘reverse’ (by
indicating a receive) the packet itself.
Please also understand that addresses on the ‘loopback’ interface are not in
general going to work (though, I cannot recall if in NT5 this is enforced by
the stack). The IM driver is filtering one or more interfaces. Those
interfaces have IP addresses and are attached to a network (either as a
point-to-point, point-to-multipoint, or multicast link). The one interface
an IM driver is *never* attached to (and thus can filter) is the loopback
interface. An NDIS IM filter driver can only filter traffic that passes
across interfaces on adapter devices with NDIS miniport drivers.
Good Luck,
Dave Cattley
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@mail.ru
Sent: Tuesday, August 31, 2010 3:57 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Heed help! NDIS driver or else
to Pavel
I just want to implement it and learn this process.
Thanks Pavel!
to David
David, you are right!
I don’t thought about this case, where all this on same host!
Cause NDIS below TCP/IP,
if I rewrite only destination TCP port in packet, it will pass to miniport
driver and into nic card…
I imagine, this wouldn’t works…
So, as you’ve posted above, if I rewrite source to dest, does miniport/nic
card will ‘reverse’ it packet back to stack?
Sample
Local proxy listen 127.0.0.1:9099
Application try to connect to not listen local port (127.0.0.1:8081) and we
will rewrite it.
ORIG HEADER
SOURCE PORT: 7483
SOURCE ADDR: 127.0.0.1
DEST PORT: 8081
DEST ADDR: 127.0.0.1
REWRITED HEADER
SOURCE PORT: 7483
SOURCE ADDR: 127.0.0.1
DEST PORT: 9099
DEST ADDR: 127.0.0.1
So, packet pass below to miniport driver and to nic card.
What is happen in this case?
May be, tcp/ip driver not pass this packet to NDIS and proceed it itself,
make port unreachable response…
David, sorry for my detail investigate, I just wont to understand how all
its works.
PS: Why I need to pass packet thru NDIS but not direct to listen port, as
sample, I can implement en/decryption in NDIS or similar service.
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