I have a Linux box which is routing TCP/IP. I would like to see the contents of the packets that are being routed. I can do this with libpcap, but, I'm looking for a way which is simpler and better performance.
Is there any way to get a socket or any other type of interface into packets that are not for this host but are being routed by the host?
UPDATE:
- I'd like to do this in C
- If it's possible in user space, that's best. If I need to do this in kernel space, I'd consider it, but might opt to just do pcap instead.
You have three alternatives to libpcap