[package]
edition = "2024"
rust-version = "1.85"
name = "netring"
version = "0.8.0"
authors = ["Marc Pardo <p13marc@gmail.com>"]
build = false
exclude = [
"CLAUDE.md",
"SPEC.md",
]
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"
resolver = "2"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
"--cfg",
"docsrs",
]
[features]
af-xdp = []
channel = ["dep:crossbeam-channel"]
default = []
flow = [
"parse",
"flowscope/tracker",
"flowscope/reassembler",
"flowscope/session",
"dep:bytes",
"dep:ahash",
]
integration-tests = []
metrics = ["dep:metrics"]
nightly = []
parse = [
"dep:etherparse",
"flowscope/extractors",
]
pcap = ["dep:pcap-file"]
tokio = [
"dep:tokio",
"dep:tokio-stream",
"dep:futures-core",
]
xdp-loader = [
"af-xdp",
"dep:aya",
]
[lib]
name = "netring"
path = "src/lib.rs"
[[example]]
name = "async_bridge"
path = "examples/async_bridge.rs"
[[example]]
name = "async_capture"
path = "examples/async_capture.rs"
[[example]]
name = "async_flow_channel"
path = "examples/async_flow_channel.rs"
required-features = [
"tokio",
"flow",
]
[[example]]
name = "async_flow_conversations"
path = "examples/async_flow_conversations.rs"
required-features = [
"tokio",
"flow",
]
[[example]]
name = "async_flow_filter"
path = "examples/async_flow_filter.rs"
required-features = [
"tokio",
"flow",
]
[[example]]
name = "async_flow_history"
path = "examples/async_flow_history.rs"
required-features = [
"tokio",
"flow",
]
[[example]]
name = "async_flow_keys"
path = "examples/async_flow_keys.rs"
required-features = [
"tokio",
"parse",
]
[[example]]
name = "async_flow_summary"
path = "examples/async_flow_summary.rs"
required-features = [
"tokio",
"flow",
]
[[example]]
name = "async_inject"
path = "examples/async_inject.rs"
[[example]]
name = "async_lo_dedup"
path = "examples/async_lo_dedup.rs"
required-features = ["tokio"]
[[example]]
name = "async_metrics"
path = "examples/async_metrics.rs"
required-features = [
"tokio",
"metrics",
]
[[example]]
name = "async_pipeline"
path = "examples/async_pipeline.rs"
[[example]]
name = "async_signal"
path = "examples/async_signal.rs"
[[example]]
name = "async_stream"
path = "examples/async_stream.rs"
[[example]]
name = "async_streamext"
path = "examples/async_streamext.rs"
[[example]]
name = "async_xdp"
path = "examples/async_xdp.rs"
required-features = [
"tokio",
"af-xdp",
]
[[example]]
name = "async_xdp_busy_poll"
path = "examples/async_xdp_busy_poll.rs"
required-features = [
"tokio",
"af-xdp",
]
[[example]]
name = "async_xdp_self_loaded"
path = "examples/async_xdp_self_loaded.rs"
required-features = [
"tokio",
"af-xdp",
"xdp-loader",
]
[[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 = "pcap_write"
path = "examples/pcap_write.rs"
required-features = ["pcap"]
[[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 = "bridge"
path = "tests/bridge.rs"
[[test]]
name = "channel_capture"
path = "tests/channel_capture.rs"
[[test]]
name = "dedup_lo"
path = "tests/dedup_lo.rs"
[[test]]
name = "eintr"
path = "tests/eintr.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"
[[test]]
name = "timeout"
path = "tests/timeout.rs"
[[test]]
name = "xdp"
path = "tests/xdp.rs"
[[bench]]
name = "throughput"
path = "benches/throughput.rs"
harness = false
[dependencies.ahash]
version = "0.8"
optional = true
default-features = false
[dependencies.aya]
version = "0.13"
optional = true
[dependencies.bitflags]
version = "2"
[dependencies.bytes]
version = "1"
optional = true
[dependencies.crossbeam-channel]
version = "0.5"
optional = true
[dependencies.etherparse]
version = "0.16"
optional = true
[dependencies.flowscope]
version = "0.1"
default-features = false
[dependencies.futures-core]
version = "0.3"
features = ["std"]
optional = true
default-features = false
[dependencies.libc]
version = "0.2"
[dependencies.metrics]
version = "0.24"
optional = true
[dependencies.nix]
version = "0.31"
features = [
"socket",
"mman",
"poll",
"net",
"ioctl",
]
[dependencies.pcap-file]
version = "2"
optional = true
[dependencies.thiserror]
version = "2"
[dependencies.tokio]
version = "1"
features = [
"io-util",
"net",
"macros",
"rt-multi-thread",
"time",
"signal",
"sync",
]
optional = true
[dependencies.tokio-stream]
version = "0.1"
features = ["sync"]
optional = true
[dependencies.tracing]
version = "0.1"
features = ["std"]
default-features = false
[dependencies.xxhash-rust]
version = "0.8"
features = ["xxh3"]
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"
[dev-dependencies.futures]
version = "0.3"