[package]
edition = "2024"
rust-version = "1.85"
name = "netring"
version = "0.2.0"
build = false
exclude = [
"CLAUDE.md",
"SPEC.md",
"justfile",
"plans/",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "High-performance zero-copy packet I/O for Linux (AF_PACKET TPACKET_V3 + AF_XDP)"
homepage = "https://github.com/p13marc/netring"
documentation = "https://docs.rs/netring"
readme = "README.md"
keywords = [
"packet",
"capture",
"af_packet",
"af_xdp",
"zero-copy",
]
categories = [
"network-programming",
"os::linux-apis",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/p13marc/netring"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
"--cfg",
"docsrs",
]
[features]
af-xdp = []
channel = ["dep:crossbeam-channel"]
default = []
integration-tests = []
nightly = []
parse = ["dep:etherparse"]
tokio = ["dep:tokio"]
[lib]
name = "netring"
path = "src/lib.rs"
[[example]]
name = "async_capture"
path = "examples/async_capture.rs"
[[example]]
name = "batch_processing"
path = "examples/batch_processing.rs"
[[example]]
name = "bridge"
path = "examples/bridge.rs"
[[example]]
name = "capture"
path = "examples/capture.rs"
[[example]]
name = "channel_consumer"
path = "examples/channel_consumer.rs"
[[example]]
name = "dpi"
path = "examples/dpi.rs"
[[example]]
name = "ebpf_filter"
path = "examples/ebpf_filter.rs"
[[example]]
name = "fanout"
path = "examples/fanout.rs"
[[example]]
name = "inject"
path = "examples/inject.rs"
[[example]]
name = "low_latency"
path = "examples/low_latency.rs"
[[example]]
name = "stats_monitor"
path = "examples/stats_monitor.rs"
[[example]]
name = "xdp_send"
path = "examples/xdp_send.rs"
required-features = ["af-xdp"]
[[test]]
name = "async_capture"
path = "tests/async_capture.rs"
[[test]]
name = "block_timeout"
path = "tests/block_timeout.rs"
[[test]]
name = "channel_capture"
path = "tests/channel_capture.rs"
[[test]]
name = "error_conditions"
path = "tests/error_conditions.rs"
[[test]]
name = "fanout"
path = "tests/fanout.rs"
[[test]]
name = "helpers"
path = "tests/helpers.rs"
[[test]]
name = "injector"
path = "tests/injector.rs"
[[test]]
name = "loopback_capture"
path = "tests/loopback_capture.rs"
[[test]]
name = "statistics"
path = "tests/statistics.rs"
[[bench]]
name = "throughput"
path = "benches/throughput.rs"
harness = false
[dependencies.bitflags]
version = "2"
[dependencies.crossbeam-channel]
version = "0.5"
optional = true
[dependencies.etherparse]
version = "0.16"
optional = true
[dependencies.libc]
version = "0.2"
[dependencies.nix]
version = "0.31"
features = [
"socket",
"mman",
"poll",
"net",
"ioctl",
]
[dependencies.thiserror]
version = "2"
[dependencies.tokio]
version = "1"
features = [
"io-util",
"net",
"macros",
"rt-multi-thread",
"time",
]
optional = true
[dependencies.tracing]
version = "0.1"
features = ["std"]
default-features = false
[dev-dependencies.core_affinity]
version = "0.8"
[dev-dependencies.criterion]
version = "0.5"
features = ["html_reports"]
[dev-dependencies.divan]
version = "0.1"
[dev-dependencies.env_logger]
version = "0.11"
[dev-dependencies.etherparse]
version = "0.16"