I am trying to make my own network traffic filter. To achieve this, I am building a Linux kernel module using netfilter and getting access to all the network packets. In order to filter these captured network packets I need to use a separate program (*filter_prog*) which I have developed. The output of this *filter_prog* determines whether the packet will be allowed to go through or not.
My query is, how can I use this *filter_prog* in a kernel module?
Secondly, is the approach correct? or there is an alternative approach which is more easy to implement and is fast.
Thanks for any help.
The *filter_prog* performs some hashing on the packet and matches this hash against a list. If the hash matches, the packet is blocked. Also, this hashing is not conventional hashing.
Also, I have found this http://people.ee.ethz.ch/~arkeller/linux/kernel_user_space_howto.html#ss4.1. Not sure which suits the best to my case.