How can I get conntrack info by C function?
Now we can use conntrack tool to get these info, but if I want to get these info in my program, how can I get conntrack info such as "conntrack -L". My program is running on user space, so kernel module is an unuseful choice. And use cmd mode will lack efficiency.
e.g. I use iptables nat to revert all the tcp connection of some users to port 10000, and my program is listening to this port, I want to get the original ports of the accepted tcp connection, so I need conntrack info.
Last edited by moonsaint; 04-01-2015 at 02:44 AM.
Reason: add the example
|