Routing between miniports in NDIS IM driver

Hi everyone,

I’ve run into a scenario and was curious what the best way would be to solve
this problem. I’ve written an NDIS IM driver that is responsible for taking
certain packets, rewriting certain IP headers (like NAT), and then
forwarding them out the proper interface. The latter part is that which I’m
not quite sure the best way to accomplish. It would appear that in order to
do this properly I would somehow need a way to correlate the routes in
machine’s routing table directly to miniports. That would likely be the
optimal way. However, it seems that it’s not likely that I’ll be able to do
this (or even access the routing table in KM). Another proposed solution is
that I make a TDI client that opens RawIp and strips off whatever link layer
frames the packet may have. This would likely work, but I’m worried about
speed. Lastly, I’ve been reading a bit about FFP in the DDK, but some of
its references are a bit ambiguous (‘…used in conjunction with routing and
filtering code…’).

So, in quick summary, I’m looking for a way to do IP-based routing in the
kernel in the context of an NDIS IM driver.

Thanks in advance,
Matt