Skip to main content

Module pcap

Module pcap 

Source
Expand description

Streaming PCAP / PCAPng reader.

Yields one PacketInfo per packet in file order, without buffering payloads. Uses pcap-parser for file framing and etherparse for zero-copy layer parsing.

Structs§

PacketData
Parsed metadata for a single packet, together with the raw captured bytes.
PacketInfo
Parsed metadata for a single packet.

Functions§

count_flows_in_file
Count packets per flow ID in a single streaming pass over path.
iter_legacy
Iterate over packets in a legacy PCAP file.
iter_pcapng
Iterate over packets in a PCAPng file.
open
Open a file, auto-detect PCAP vs PCAPng, and return a boxed packet iterator.
open_with_payload
Open a file and return an iterator that yields both PacketInfo and the raw captured bytes for each packet.