Question

I need to capture packets which are coming from interface (say eth0) and need to print those packet details (same as wireshark) through C language. Packet can be any general packet. is there any way to achieve this ?? (I don't want to use any application like wireshark for this purpose)

OS:Centos

Was it helpful?

Solution

Try having a look at libpcap. http://www.tcpdump.org/ I believe it will do what you want.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top