libpcap is a very popular user-space networking library, with which you can capture and or generate packets. libpcap is the underlying framework for many popular packet capture tools such as tcpdump, Wireshark and so on. In fact libpcap is a part of tcpdump project. But besides just using it as a packet capture tool, you can use libpcap in various applications, such as user-space based networking stack development, etc. In some cases libpcap is yet another alternative to raw-sockets and tun/tap interfaces.
Refer my other video series on:
Linux (user-space) RAW Socket Programming ↗
Linux TUN/TAP virtual network interfaces ↗
Also refer:
tcpdump and libpcap project ↗
libpcap github ↗
libpcap example code github ↗
Capturing Packets In Your C Program, With Libpcap ↗
Using libpcap in C ↗
tcpdump & libpcap official website ↗
libpcap: An Architecture and Op2miza2on Methodology for Packet Capture ↗
Here is my detailed multi-episode YouTube video series on libpcap Library with a sample libpcap C code.
Download this episode my entire kernel module sample code, make file, clean script which I hosted in my GitHub Repo.
I also conduct sessions/classes on Systems and Network Software Programming, Linux Kernel Programming and Architecture. If you are interested, click HERE for more details.
If you have any queries or anything to discuss further on Linux Kernel Programming and writing Kernel modules kindly feel free to contact me.