I want to write a kernel module that adds some features to linux iptables. Before starting to code my own module, I want to do some tests and try to use some modules and try to add them to my freshly installed Ubuntu 15.5 machine. It provides the libipt_xx.c , ipt_xx.c and ipt_xx.h, about which I read in some tutorial that they should past the file in that way:
ipt_xx.c -> /usr/src/linux-headers-4.2.0-16/net/ipv4/netfilter/
ipt_xx.h -> /usr/src/linux-headers-4.2.0-16/include/uapi/linux/netfilter_ipv4
libipt_xx.c -> /usr/local/src/iptables-x.x.x/extensions/
But, I can't find the /usr/local/src/iptables-x.x.x/ directory. When I execute iptables -V , I have iptables v1.4.21 as output, so it means I should have a folder like iptables-1.4.21.
Thanks for help.
Some of the files that you mention are part of the Linux kernel source. You get them when you download the Linux kernel source code from one of multiple places. These files are compiled into the kernel, either statically or in the form of modules. These are the files located in:
net/ipv4/netfilter/
include/uapi/linux/netfilter_ipv4/
Other files are part of iptables source code which is a user space application. You can get the source code from Netfilter Git repository. These are the files located in:
iptables-x.x.x/extensions/