First of all, if you are implementing a firewall on TCP/UDP, then using the
Windows Filtering Platform (WFP) is absolutely the way to go. There
information like IP addresses are handed to you on a silver platter and you
have access to process ID’s, etc. that simply aren’t available at the NDIS
layers.
In addition, with WFP you can configure some filtering operations from the
comfort and safety of a user-mode application.
Use WFP in user-mode first and WFP in kernel-mode second, then implement
others (ARP, etc.) in a NDIS filter. You may end up with two drivers, but
will have a better more achievable solution.
In any case study how WFP implements adding and removing filters. The
methods used by Microsoft may help you design your own filter plug-in
scheme.
As far as kernel-mode “plug-ins” are concerned: These are usually a separate
driver per plug-in function.
These can be what is called an “export driver”, which is similar to a DLL
and is compiled/linked into your driver. The main advantage of an export
driver is modularity.
It is also possible to implement plug-in as a separate legacy driver or
“kernel service”. Here you have a problem of controlling communication
between drivers and when companion drivers are loaded. Here features like
the NDIS Network Module Registrar can be helpful.
I would suggest avoiding plug-ins if you are at the point of asking about
them. The concept will slow you down.
There is nothing wrong with doing some work at user mode if you understand
that doing so will effect throughput. In some cases (slower links) there may
be no measurable effect on performance.
Finally: Who needs another firewall? Unless this is an academic exercise it
is probably not worth much time.
Good luck!
Thomas F. Divine
http://www.pcausa.com
From:
Sent: Wednesday, January 04, 2012 6:49 AM
To: “Windows System Software Devs Interest List”
Subject: RE:[ntdev] NDIS, What kind of driver to develop dilemma
> Thanks, I have an other question if you do not mind 
>
> The idea is to have a plugin based system for each protocol (so you will
> have a TCP plugin that will disect and observe TCP packets and then
> instruct the firewall if it should block that packet or not) at first i
> was gonna implement this system at user mode through dlls (it should be
> easy to add new plugins) but then someone suggested that it will be
> ineffcient as such this descsion should be taken at kernel mode.
>
> Is their a way, to implement a plugin based system in kernel? (simlair to
> the way dlls work)
>
> Thanks again!!
>
> —
> 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