[package]
name = "tun"
version = "0.8.13"
edition = "2024"
authors = ["meh. <meh@schizofreni.co>", "@ssrlive"]
license = "WTFPL"
description = "TUN device creation and handling."
repository = "https://github.com/meh/rust-tun"
keywords = ["tun", "network", "tunnel", "bindings"]
[package.metadata.docs.rs]
all-features = true
[lib]
crate-type = ["staticlib", "lib"]
[features]
async = [
"tokio",
"futures-core",
"futures",
"tokio-util",
"wintun-bindings/async",
]
verify_binary_signature = ["wintun-bindings/verify_binary_signature"]
[dependencies]
bytes = { version = "1.12.0" }
cfg-if = "1.0.4"
futures-core = { version = "0.3.32", optional = true }
libc = { version = "0.2.186", features = ["extra_traits"] }
log = "0.4.32"
thiserror = "2.0.18"
tokio = { version = "1.52.3", features = [
"net",
"macros",
"io-util",
], optional = true }
tokio-util = { version = "0.7.18", features = ["codec"], optional = true }
[build-dependencies]
serde_json = "1.0.150"
[target.'cfg(any(target_os = "macos", target_os = "freebsd"))'.dependencies]
ipnet = "2.12.0"
[target.'cfg(target_os = "windows")'.dependencies]
futures = { version = "0.3.32", optional = true }
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",
] }
wintun-bindings = { version = "0.7.39", features = [
"panic_on_unsent_packets",
"async",
"enable_inner_logging",
"winreg",
] }
[target.'cfg(unix)'.dependencies]
nix = { version = "0.31.3", features = ["ioctl"] }
[dev-dependencies]
ctrlc2 = { version = "4.0.0", features = ["async", "termination"] }
env_logger = "0.11.10"
futures = "0.3.32"
packet = "0.1.4"
serde_json = "1.0.150"
tokio = { version = "1.52.3", features = ["rt-multi-thread"] }
tokio-util = { version = "0.7.18", features = [] }
[target.'cfg(unix)'.dev-dependencies]
futures = "0.3.32"
nix = { version = "0.31.3", features = ["ioctl"] }
[[example]]
name = "read-async"
required-features = ["async"]
[[example]]
name = "read-async-codec"
required-features = ["async"]
[[example]]
name = "ping-tun"
required-features = ["async"]
[[example]]
name = "split-async"
required-features = ["async"]