netdev 0.41.0

Cross-platform library for enumerating network interfaces with metadata.
Documentation
[package]
name = "netdev"
version = "0.41.0"
authors = ["shellrow <shellrow@foctal.com>"]
edition = "2024"
description = "Cross-platform library for enumerating network interfaces with metadata."
repository = "https://github.com/shellrow/netdev"
readme = "README.md"
keywords = ["network"]
categories = ["network-programming"]
license = "MIT"

[dependencies]
mac-addr = { version = "0.3" }
serde = { version = "1", features = ["derive"], optional = true }
ipnet = { version = "2.12" }

[target.'cfg(unix)'.dependencies]
libc = "0.2"

[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
netlink-packet-core = "0.8"
netlink-packet-route = "0.29"
netlink-sys = "0.8.8"

[target.'cfg(target_os = "android")'.dependencies]
dlopen2 = { version = "0.8.2", default-features = false }
once_cell = "1"

[target.'cfg(windows)'.dependencies.windows-sys]
version = "0.61"
features = [
    "Win32_Foundation",
    "Win32_NetworkManagement_IpHelper",
    "Win32_Networking_WinSock",
    "Win32_NetworkManagement_Ndis",
]

[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
objc2-core-foundation = "0.3"
objc2-system-configuration = { version = "0.3", features = ["SCNetworkConfiguration"] }
plist = "1.8"

[target.'cfg(target_os = "ios")'.dependencies]
dispatch2 = "0.3"
block2 = "0.6"

[dev-dependencies]
serde_json = "1.0"

[features]
default = ["gateway"]
serde = ["dep:serde", "mac-addr/serde", "ipnet/serde"]
gateway = []

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

[[example]]
name = "default_interface"
path = "examples/default_interface.rs"
required-features = ["gateway"]

[[example]]
name = "default_gateway"
path = "examples/default_gateway.rs"
required-features = ["gateway"]

[[example]]
name = "serialize"
path = "examples/serialize.rs"
required-features = ["serde", "gateway"]

[[example]]
name = "global_ips"
path = "examples/global_ips.rs"
required-features = ["gateway"]

[[example]]
name = "stats"
path = "examples/stats.rs"
required-features = ["gateway"]