push-packet 0.1.0

Packet-inspection and routing library for Linux, built on eBPF XDP and AF_XDP with aya.
Documentation
[package]
name = "push-packet"
edition.workspace = true
rust-version.workspace = true
version.workspace = true
license.workspace = true
description = "Packet-inspection and routing library for Linux, built on eBPF XDP and AF_XDP with aya."
repository.workspace = true
homepage.workspace = true
keywords.workspace = true
categories.workspace = true
readme = "../README.md"

[package.metadata.docs.rs]
default-target = "x86_64-unknown-linux-gnu"
targets = []

[dependencies]
push-packet-common = { workspace = true, features = ["user"] }

aya = { workspace = true }
ipnet = { workspace = true }
thiserror = {workspace = true}
nix = {workspace=true, features=["net", "poll", "sched"]}
crossbeam-queue = "0.3.12"
xdpilone = "1.3.0"

[build-dependencies]
aya-build = { workspace = true, optional = true }
cargo_metadata = { workspace = true, optional = true }
anyhow = { workspace = true, default-features = true, optional=true }
# TODO(https://github.com/rust-lang/cargo/issues/12375): this should be an artifact dependency, but
# it's not possible to tell cargo to use `-Z build-std` to build it. We cargo-in-cargo in the build
# script to build this, but we want to teach cargo about the dependency so that cache invalidation
# works properly.
#
# Note also that https://github.com/rust-lang/cargo/issues/10593 occurs when `target = ...` is added
# to an artifact dependency; it seems possible to work around that by setting `resolver = "1"` in
# Cargo.toml in the workspace root.
#
# Finally note that *any* usage of `artifact = ...` in *any* Cargo.toml in the workspace breaks
# workflows with stable cargo; stable cargo outright refuses to load manifests that use unstable
# features.
push-packet-ebpf = { workspace = true, optional = true }

[dev-dependencies]
clap = {version="4.6.1", features=["derive"]}
color-eyre = "0.6.5"
etherparse = "0.20.1"
ratatui = "0.30.0"
serial_test = "3.4.0"

[features]
default = ["linear"]
linear = ["push-packet-common/linear"]
build-ebpf = ["dep:aya-build", "dep:cargo_metadata", "dep:push-packet-ebpf", "dep:anyhow"]

[lib]
name = "push_packet"
path = "src/lib.rs"