[package]
edition = "2024"
name = "tun"
version = "0.8.6"
authors = [
"meh. <meh@schizofreni.co>",
"@ssrlive",
]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "TUN device creation and handling."
readme = "README.md"
keywords = [
"tun",
"network",
"tunnel",
"bindings",
]
license = "WTFPL"
repository = "https://github.com/meh/rust-tun"
[package.metadata.docs.rs]
all-features = true
[features]
async = [
"tokio",
"futures-core",
"futures",
"tokio-util",
"wintun-bindings/async",
]
verify_binary_signature = ["wintun-bindings/verify_binary_signature"]
[lib]
name = "tun"
crate-type = [
"staticlib",
"lib",
]
path = "src/lib.rs"
[[example]]
name = "dev-config"
path = "examples/dev-config.rs"
[[example]]
name = "ping-tun"
path = "examples/ping-tun.rs"
required-features = ["async"]
[[example]]
name = "read"
path = "examples/read.rs"
[[example]]
name = "read-async"
path = "examples/read-async.rs"
required-features = ["async"]
[[example]]
name = "read-async-codec"
path = "examples/read-async-codec.rs"
required-features = ["async"]
[[example]]
name = "split"
path = "examples/split.rs"
[[example]]
name = "split-async"
path = "examples/split-async.rs"
required-features = ["async"]
[[example]]
name = "write"
path = "examples/write.rs"
[dependencies.bytes]
version = "1.11.1"
[dependencies.cfg-if]
version = "1.0.4"
[dependencies.futures-core]
version = "0.3.31"
optional = true
[dependencies.libc]
version = "0.2"
features = ["extra_traits"]
[dependencies.log]
version = "0.4.29"
[dependencies.thiserror]
version = "2.0.18"
[dependencies.tokio]
version = "1.49.0"
features = [
"net",
"macros",
"io-util",
]
optional = true
[dependencies.tokio-util]
version = "0.7.18"
features = ["codec"]
optional = true
[dev-dependencies.ctrlc2]
version = "3.7.3"
features = [
"async",
"termination",
]
[dev-dependencies.env_logger]
version = "0.11.9"
[dev-dependencies.futures]
version = "0.3.31"
[dev-dependencies.packet]
version = "0.1.4"
[dev-dependencies.serde_json]
version = "1.0.149"
[dev-dependencies.tokio]
version = "1.49.0"
features = ["rt-multi-thread"]
[dev-dependencies.tokio-util]
version = "0.7.18"
features = []
[target.'cfg(any(target_os = "macos", target_os = "freebsd"))'.dependencies.ipnet]
version = "2.11.0"
[target.'cfg(target_os = "windows")'.dependencies.futures]
version = "0.3.31"
optional = true
[target.'cfg(target_os = "windows")'.dependencies.windows-sys]
version = "0.61.2"
features = [
"Win32_Foundation",
"Win32_Networking_WinSock",
"Win32_NetworkManagement_Ndis",
"Win32_NetworkManagement_IpHelper",
"Win32_Security",
"Win32_Security_WinTrust",
"Win32_Security_Cryptography",
"Win32_System_Threading",
"Win32_UI_WindowsAndMessaging",
"Win32_System_LibraryLoader",
]
[target.'cfg(target_os = "windows")'.dependencies.wintun-bindings]
version = "^0.7.34"
features = [
"panic_on_unsent_packets",
"async",
"enable_inner_logging",
"winreg",
]
[target."cfg(unix)".dependencies.nix]
version = "0.31.2"
features = ["ioctl"]
[target."cfg(unix)".dev-dependencies.futures]
version = "0.3.31"
[target."cfg(unix)".dev-dependencies.nix]
version = "0.31.2"
features = ["ioctl"]