Search code examples
clibpcappacket-sniffers

Packet sniffing in linux without using libpcap


I have been given a project for a course at university (network engineering) which involves writing a packet sniffer that can capture and identify IPv4, IPv6, TCP, UDP, IP, ICMP etc. packets and display their contents.

Originally we were directed to use libpcap to do this, but we have just been informed by one of the university technicians that it is not possible to use libpcap with the current installation (Arch linux).

What other ways are there to create a packet sniffer in C that does not use libpcap?

I am not asking for the answer to this project, I am just asking for direction, where I should start?


Solution

  • I would go and ask someone more senior what you're actually supposed to be doing. There seem to be two completely different tasks here - one is parsing and displaying network packets and the other is interfacing with the OS/hardware to capture the packets. If you're supposed to be learning about the former, then you probably shouldn't spend time on the latter.