HELP NEEDED:packet filtering,kernel module programing

HELP NEEDED:packet filtering,kernel module programing

Post by Chayawat Siltor » Tue, 16 Nov 1999 04:00:00



Hello,

I have to write IP packet filtering using kernel module programing.
Anyone know how to do that or know where to find more information or
prototype, please help me.

Thank you very much,
--book--

 
 
 

HELP NEEDED:packet filtering,kernel module programing

Post by B. James Phillipp » Tue, 16 Nov 1999 04:00:00



> Hello,

> I have to write IP packet filtering using kernel module programing.
> Anyone know how to do that or know where to find more information or
> prototype, please help me.

It's not too complicated.  Start by reading <linux/firewall.h>.  Basically,
you fill in a struct firewall_ops with function pointers to your own
firewall operations (that you define in your module) and then do a
register_firewall() at some point during module load and an
unregister_firewall() at module unload.  The kernel will do all the hard
work; all you have to do is decide how you want the packet handled and then
return one of the FW_* macros from your firewall operation functions.

-bp
--
# bryan at terran dot org
# http://www.terran.org/~bryan