packet-strata

Crates.iopacket-strata
lib.rspacket-strata
version0.2.0
created_at2026-01-03 08:55:15.850405+00
updated_at2026-01-20 08:16:22.333363+00
descriptionA high-performance packet parsing library
homepagehttps://github.com/awgn/packet-strata
repositoryhttps://github.com/awgn/packet-strata
max_upload_size
id2019803
size1,054,486
Nicola Bonelli (awgn)

documentation

https://docs.rs/packet-strata

README

Packet Strata

A high-performance packet parsing library and PCAP reader for Rust.

⚠️ Disclaimer

This library is under active development. Breaking changes may occur between versions as the API evolves and stabilizes.

If you're using or experimenting with this library and encounter bugs or develop interesting features, please consider opening a pull request at https://github.com/awgn/packet-strata

Workspace Structure

This repository is organized as a Cargo workspace containing:

  • packet-strata-lib/ - Core packet parsing library

    • Zero-copy packet parsing
    • Support for multiple protocols (Ethernet, IPv4/IPv6, TCP, UDP, tunnels, etc.)
    • Iterator-based and full-packet parsing modes
  • pcap-reader/ - Command-line PCAP file analyzer

    • Reads PCAP and PCAPNG files
    • Provides detailed packet statistics
    • High-performance packet processing

Building

Build the library (default):

cargo build --release

Build the entire workspace (library + pcap-reader):

cargo build --release --workspace

Build only the library:

cargo build --release -p packet-strata

Build only the pcap-reader:

cargo build --release -p pcap-reader

Usage

Using the Library

Add to your Cargo.toml:

[dependencies]
packet-strata = "0.1" 

Note: When adding packet-strata as a dependency, only the library will be built. The pcap-reader binary is excluded from default builds and won't be compiled unless explicitly requested with cargo build --workspace or cargo build -p pcap-reader.

Using the PCAP Reader

# Basic usage
cargo run -p pcap-reader -- -p path/to/file.pcap

# With statistics
cargo run -p pcap-reader -- -p path/to/file.pcap --stats

# Dump packet contents
cargo run -p pcap-reader -- -p path/to/file.pcap --dump-packet

# Use full packet parsing (instead of iterator mode)
cargo run -p pcap-reader -- -p path/to/file.pcap --full-parse

Or after building:

./target/release/pcap-reader --help

Features

Supported Protocols

Link Layer:

  • Ethernet
  • Linux Cooked Capture (SLL/SLLv2)
  • Null/Loopback

Network Layer:

  • IPv4
  • IPv6
  • ARP
  • MPLS

Transport Layer:

  • TCP
  • UDP
  • SCTP
  • ICMP/ICMPv6

Tunnel Protocols:

  • VXLAN
  • Geneve
  • GRE/NVGRE
  • MPLS
  • Teredo
  • GTPv1/GTPv2
  • L2TPv2/L2TPv3
  • PBB
  • STT
  • PPTP
  • IP-in-IP (IPIP, SIT, IP4in6, IP6Tnl)

License

MIT

Author

Nicola Bonelli nicola.bonelli@larthia.com

Commit count: 35

cargo fmt