A Simple program use netfilter hook to filter designated incoming/outgoing packets.
First, you should compile the kernel module separately in {Program Path}/src/KernelModule, execute "make" in shell.
Then, you can test it by executing "insmod myhook.ko" in shell to load this kernel module and executing "rmmod myhook" to unload it.
You can see the kernel module running infomation in /var/log/message.
The program will auto load and unload this kernel module.
Second, you should install 3 dependent packages in {Program Path}/dependents.
You may need add "#include <stdint.h>" to libnetfilter_queue/libnetfilter_queue.h and add "#include <netinet/in.h>" to netfilter.h.
Then, you should change kernel module path in your system in src/Application/main.c line 303, or you can comment line 302,303,304,378,379 and load the kernel module yourself.
Now, you can run this program by executing**./Linux_Netfilter_Program**, and you can use -i to add ip address and use -h to add hostname(it will be resolved to ip address).
All the filtering rule will be saved in ./filterlist file, you can change it by modifying this file.
You can see the program running infomation in ./log file.
If you have any question, you can contact me by email.