Get packet that's being routed

101 views Asked by At

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:

  1. I'd like to do this in C
  2. 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.
1

There are 1 answers

0
rodolk On

You have three alternatives to libpcap