Multiplatform C++ library for high-performance network packet capture, parsing, crafting, and analysis. Supports libpcap, DPDK, AF_XDP, PF_RING, and includes TCP reassembly, TLS fingerprinting, and protocol decoding.
PcapPlusPlus is a multiplatform C++ library for capturing, parsing and crafting of network packets. It is designed to be efficient, powerful and easy to use.
PcapPlusPlus enables decoding and forging capabilities for a large variety of network protocols. It also provides easy to use C++ wrappers for the most popular packet processing engines such as libpcap, WinPcap, Npcap, DPDK, eBPF AF_XDP, WinDivert and PF_RING.
Translations: English · 正體中文 · 한국어 · 日本語 · Русский
You can choose between downloading from GitHub release page, use a package manager or build PcapPlusPlus yourself. For more details please visit the Download page in PcapPlusPlus web-site.
https://github.com/seladb/PcapPlusPlus/releases/latest
brew install pcapplusplus
Homebrew formulae: https://formulae.brew.sh/formula/pcapplusplus
Windows:
.\vcpkg install pcapplusplus
MacOS/Linux:
vcpkg install pcapplusplus
Vcpkg port: https://github.com/microsoft/vcpkg/tree/master/ports/pcapplusplus
conan install "pcapplusplus/[>0]@" -u
The package in ConanCenter: https://conan.io/center/pcapplusplus
Clone the git repository:
git clone https://github.com/seladb/PcapPlusPlus.git
Follow the build instructions according to your platform in the Build From Source page in PcapPlusPlus web-site.
PcapPlusPlus releases which newer than v23.09 are signed with GitHub attestation. All of the attestations can be found here. You can verify the attestation of these packages with GitHub CLI. To verify packages you can follow the most recent instructions from gh attestation verify. For simple instructions you can use the following command:
gh attestation verify <path-to-package-file> --repository seladb/PcapPlusPlus
and you should see the following output in your terminal:
✓ Verification succeeded!
Writing applications with PcapPlusPlus is very easy and intuitive. Here is a simple application that shows how to read a packet from a PCAP file and parse it: