#define __KERNEL__
#define MODULE
#define LINUX
#define __NO_VERSION__.#include </usr/include/linux/module.h>
#include </usr/include/linux/version.h>
#include </usr/src/linux-2.4.20-8/include/linux/netfilter.h>
#include </usr/src/linux-2.4.20-8/include/linux/netfilter_ipv4.h>
MODULE_LICENSE("GPL");
MODULE_AUTHOR("asik");
struct nf_hook_ops nf_incoming;
struct nf_hook_ops nf_outgoing;
unsigned int main_hook (unsigned int hooknum,struct sk_buff **skb,const struct net_device *in,const struct net_device *out,int (*okfn)(struct sk_buff*))
{
/* Drop all */
return NF_DROP;
}
int init_module ()
{
//Incoming
nf_incoming.hook = main_hook; /* @ */
nf_incoming.pf = PF_INET;
nf_incoming.hooknum = NF_IP_PRE_ROUTING;
nf_incoming.priority = NF_IP_PRI_FIRST;
//outgoing
nf_outgoing.hook = main_hook;
nf_outgoing.pf = PF_INET;
nf_outgoing.hooknum = NF_IP_PRE_ROUTING;
nf_outgoing.priority = NF_IP_PRI_FIRST;
nf_register_hook(&nf_incoming);
nf_register_hook(&nf_outgoing);
printk ("FireWall loaded \n");
return 0;
}
void cleanup_module ()
{
nf_unregister_hook(&nf_incoming);
nf_unregister_hook(&nf_outgoing);
printk ("FireWall unload \n");
}