PcapNgPlusPlus is a modern C++14 implementation of a pcapng reader and writer, intended to replace LightPcapNg in PcapPlusPlus. It reads, writes and appends pcapng files, including zstd-compressed ones.
Status: early development (milestone M1). Nothing here is usable as a library yet. See
docs/PLAN.mdfor the plan and progress.
LightPcapNg is written in C and has accumulated bugs, edge cases and local patches in PcapPlusPlus. A rewrite is only safe if it provably behaves the same, so this project builds the test suite first and the new implementation second.
| Path | What |
|---|---|
legacy/ |
A read-only copy of LightPcapNg as patched by PcapPlusPlus, pinned to a PcapPlusPlus commit. It is the reference implementation. |
src/, include/ |
The new C++14 implementation. |
conformance/ |
A test suite that runs both implementations on the same inputs and compares the results. |
bench/, fuzz/ |
Benchmarks and a differential fuzzer covering both implementations. |
- Inputs: a corpus generated from the pcapng spec (every block type and option, with malformed variants), real-world captures, and files found by fuzzing.
- Oracle: golden outputs recorded from the legacy implementation. The new implementation must match them, except for intentional fixes listed in
conformance/divergences.yaml. - Memory: no leaks or sanitizer reports, and peak memory within a tolerance of legacy's, on each of 9 platforms.
- Performance: throughput within a tolerance of legacy's on every benchmark, on each of 9 platforms.
Details are in docs/PLAN.md.
cmake -S . -B build # add -DLIGHT_PCAPNG_ZSTD=ON for zstd support
cmake --build buildOnly the legacy LightPcapNg library builds for now.
Read AGENTS.md before contributing. It covers the repo rules (for example, legacy/ and golden files are never edited by hand) and the coding conventions, which follow PcapPlusPlus.
MIT. See LICENSE. The copy of LightPcapNg in legacy/ keeps its original license.