# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
name = "nlink"
version = "0.15.1"
authors = ["Marc Pardo <p13marc@gmail.com>"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Async netlink library for Linux network configuration"
documentation = "https://docs.rs/nlink"
readme = "README.md"
keywords = [
    "netlink",
    "linux",
    "networking",
    "async",
    "iproute2",
]
categories = [
    "network-programming",
    "os::linux-apis",
    "asynchronous",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/p13marc/nlink"
resolver = "2"

[package.metadata.docs.rs]
all-features = true
targets = ["x86_64-unknown-linux-gnu"]
rustdoc-args = [
    "--cfg",
    "docsrs",
]

[features]
default = []
full = [
    "sockdiag",
    "tuntap",
    "tuntap-async",
    "output",
    "namespace_watcher",
    "lab",
]
integration = []
lab = []
namespace_watcher = ["dep:inotify"]
output = [
    "dep:serde",
    "dep:serde_json",
]
sockdiag = ["dep:serde"]
tuntap = []
tuntap-async = ["tuntap"]

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

[[example]]
name = "audit_status"
path = "examples/audit/audit_status.rs"

[[example]]
name = "connector_process_monitor"
path = "examples/connector/process_monitor.rs"

[[example]]
name = "connector_process_monitor_stream"
path = "examples/connector/process_monitor_stream.rs"

[[example]]
name = "ethtool_features"
path = "examples/genl/ethtool_features.rs"

[[example]]
name = "ethtool_link_state"
path = "examples/genl/ethtool_link_state.rs"

[[example]]
name = "ethtool_monitor"
path = "examples/genl/ethtool_monitor.rs"

[[example]]
name = "ethtool_rings"
path = "examples/genl/ethtool_rings.rs"

[[example]]
name = "events_ip_monitor"
path = "examples/events/ip_monitor.rs"

[[example]]
name = "events_monitor"
path = "examples/events/monitor.rs"

[[example]]
name = "events_monitor_namespace"
path = "examples/events/monitor_namespace.rs"

[[example]]
name = "events_multi_source"
path = "examples/events/multi_source.rs"

[[example]]
name = "events_tc_monitor"
path = "examples/events/tc_monitor.rs"

[[example]]
name = "fib_lookup_route_lookup"
path = "examples/fib_lookup/route_lookup.rs"

[[example]]
name = "genl_devlink"
path = "examples/genl/devlink.rs"

[[example]]
name = "genl_macsec"
path = "examples/genl/macsec.rs"

[[example]]
name = "genl_mptcp"
path = "examples/genl/mptcp.rs"

[[example]]
name = "genl_nl80211"
path = "examples/genl/nl80211.rs"

[[example]]
name = "genl_wireguard"
path = "examples/genl/wireguard.rs"

[[example]]
name = "impair_per_peer"
path = "examples/impair/per_peer.rs"

[[example]]
name = "lab_three_namespace"
path = "examples/lab/three_namespace.rs"
required-features = ["lab"]

[[example]]
name = "namespace_events"
path = "examples/namespace/events.rs"

[[example]]
name = "namespace_watch"
path = "examples/namespace/watch.rs"
required-features = ["namespace_watcher"]

[[example]]
name = "netfilter_conntrack"
path = "examples/netfilter/conntrack.rs"

[[example]]
name = "netfilter_conntrack_events"
path = "examples/netfilter/conntrack_events.rs"

[[example]]
name = "nftables_firewall"
path = "examples/nftables/firewall.rs"

[[example]]
name = "ratelimit_simple"
path = "examples/ratelimit/simple.rs"

[[example]]
name = "route_addresses"
path = "examples/route/addresses.rs"

[[example]]
name = "route_batch"
path = "examples/route/batch.rs"

[[example]]
name = "route_bond"
path = "examples/route/bond.rs"

[[example]]
name = "route_error_handling"
path = "examples/route/error_handling.rs"

[[example]]
name = "route_link_create"
path = "examples/route/link_create.rs"

[[example]]
name = "route_list_interfaces"
path = "examples/route/list_interfaces.rs"

[[example]]
name = "route_namespaces"
path = "examples/route/namespaces.rs"

[[example]]
name = "route_neighbors"
path = "examples/route/neighbors.rs"

[[example]]
name = "route_routes"
path = "examples/route/routes.rs"

[[example]]
name = "route_stats"
path = "examples/route/stats.rs"

[[example]]
name = "route_tc_bpf"
path = "examples/route/tc/bpf.rs"

[[example]]
name = "route_tc_htb"
path = "examples/route/tc/htb.rs"

[[example]]
name = "route_tc_netem"
path = "examples/route/tc/netem.rs"

[[example]]
name = "route_tc_stats"
path = "examples/route/tc/stats.rs"

[[example]]
name = "route_timeout"
path = "examples/route/timeout.rs"

[[example]]
name = "selinux_monitor"
path = "examples/selinux/selinux_monitor.rs"

[[example]]
name = "selinux_monitor_stream"
path = "examples/selinux/selinux_monitor_stream.rs"

[[example]]
name = "sockdiag_kill"
path = "examples/sockdiag/kill.rs"
required-features = ["sockdiag"]

[[example]]
name = "sockdiag_list_sockets"
path = "examples/sockdiag/list_sockets.rs"
required-features = ["sockdiag"]

[[example]]
name = "sockdiag_summary"
path = "examples/sockdiag/summary.rs"
required-features = ["sockdiag"]

[[example]]
name = "sockdiag_tcp_connections"
path = "examples/sockdiag/tcp_connections.rs"
required-features = ["sockdiag"]

[[example]]
name = "sockdiag_unix_sockets"
path = "examples/sockdiag/unix_sockets.rs"
required-features = ["sockdiag"]

[[example]]
name = "uevent_device_monitor"
path = "examples/uevent/device_monitor.rs"

[[example]]
name = "uevent_device_monitor_stream"
path = "examples/uevent/device_monitor_stream.rs"

[[example]]
name = "xfrm_ipsec_monitor"
path = "examples/xfrm/ipsec_monitor.rs"
required-features = ["lab"]

[[test]]
name = "integration"
path = "tests/integration.rs"
required-features = ["lab"]

[dependencies.bytes]
version = "1"

[dependencies.inotify]
version = "0.11"
features = ["stream"]
optional = true
default-features = false

[dependencies.libc]
version = "0.2"

[dependencies.netlink-sys]
version = "0.8"

[dependencies.serde]
version = "1"
features = ["derive"]
optional = true

[dependencies.serde_json]
version = "1"
optional = true

[dependencies.thiserror]
version = "2"

[dependencies.tokio]
version = "1"
features = [
    "full",
    "net",
    "io-util",
    "sync",
]

[dependencies.tokio-stream]
version = "0.1"

[dependencies.tracing]
version = "0.1"

[dependencies.winnow]
version = "1.0"

[dependencies.zerocopy]
version = "0.8"
features = ["derive"]

[dev-dependencies.tokio]
version = "1"
features = [
    "full",
    "net",
    "io-util",
    "sync",
    "macros",
    "rt-multi-thread",
]
