PcapPlusPlus
Multiplatform C++ library for parsing and crafting of network packets
.... It enables amazingly fast packet processing with minimum overhead. PcapPlusPlus is fully supported on Windows, MacOS, Linux, Android and FreeBSD. You can download pre-built binaries for each platform or build it from source. PcapPlusPlus is available in popular package managers such as Homebrew and Conan. PcapPlusPlus provides an easy-to-use interface for reading and writing network packets into files.It supports the most popular file formats which are PCAP and PCAPNG.