[package] name = "tun-rs" version = "1.4.7" edition = "2021" authors = ["xmh0511, vnt-dev"] license = "Apache-2.0" description = "A cross-platform infrastructure of Tun/Tap device creation and handling." repository = "https://github.com/xmh0511/tun-rs" keywords = ["tun", "tap", "network", "tunnel", "cross-platform"] [lib] crate-type = ["staticlib", "cdylib", "lib"] [dependencies] bytes = { version = "1" } cfg-if = "1" libc = { version = "0.2", features = ["extra_traits"] } log = "0.4" thiserror = "1" blocking = { version = "1.6", optional = true } tokio = { version = "1", features = [ "net", "macros", "io-util", "rt", ], optional = true } async-io = { version = "2.3", optional = true } bitflags = "2.6.0" ipnet = "2" byteorder = "1.5.0" [target.'cfg(any(target_os = "linux", target_os = "macos", target_os = "android", target_os="freebsd"))'.dependencies] nix = { version = "0.29", features = ["ioctl"] } [target.'cfg(target_os = "windows")'.dependencies] encoding_rs = "0.8.34" scopeguard = "1.2.0" winreg = "0.52.0" c2rust-bitfields = "0.19" windows-sys = { version = "0.59", features = [ "Win32_Devices_DeviceAndDriverInstallation", "Win32_Storage_FileSystem", "Win32_System_Registry", "Win32_Networking_WinSock", "Win32_NetworkManagement_Ndis", "Win32_Foundation", "Win32_Security", "Win32_Security_WinTrust", "Win32_Security_Cryptography", "Win32_System_Threading", "Win32_UI_WindowsAndMessaging", "Win32_System_LibraryLoader", "Win32_NetworkManagement_IpHelper", ] } wintun = { version = "0.7", features = ["panic_on_unsent_packets"], package = "wintun-bindings" } libloading = "0.8" [target.'cfg(any(target_os = "linux", target_os = "freebsd",target_os = "windows"))'.dependencies] mac_address = "1.1.7" [dev-dependencies] ctrlc2 = { version = "3", features = ["tokio", "termination"] } env_logger = "0.11" futures = "0.3" packet = "0.1" pnet_packet = "0.35.0" serde_json = "1" tokio = { version = "1", features = ["rt-multi-thread", "time"] } async-std = { version = "1", features = ["attributes", "unstable"] } async-ctrlc = "1.2.0" [features] default = ["wintun-dns"] async = ["async_tokio"] async_tokio = ["blocking", "tokio"] async_std = ["blocking", "async-io"] wintun-dns = [] experimental = [] [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] [[example]] name = "read-async-tokio" required-features = ["async_tokio"] [[example]] name = "read-async-std" required-features = ["async_std"] [[example]] name = "ping-tun-tokio" required-features = ["async_tokio"] [[example]] name = "ping-tun-async-std" required-features = ["async_std"] [[example]] name = "ping-tap-tokio" required-features = ["async_tokio"] [[example]] name = "ping-tap-async-std" required-features = ["async_std"] [[example]] name = "ping-tun-offload-tokio" required-features = ["async_tokio"]