make tun dependency optional (#142)

* remove log crates
* remove udp/raw of smoltcp
* make tun as optional dependancy, compile for freebsd works
This commit is contained in:
Sijie.Sun
2024-06-11 09:09:32 +08:00
committed by GitHub
parent 8aa57ebc22
commit 34f832bbad
26 changed files with 310 additions and 488 deletions
+23 -5
View File
@@ -36,7 +36,6 @@ tracing-subscriber = { version = "0.3", features = [
"time",
] }
tracing-appender = "0.2.3"
log = "0.4"
thiserror = "1.0"
auto_impl = "1.1.0"
crossbeam = "0.8.4"
@@ -85,7 +84,9 @@ http = { version = "1", default-features = false, features = [
tokio-rustls = { version = "0.26", default-features = false, optional = true }
# for tap device
tun = { package = "tun-easytier", version = "0.6.1", features = ["async"] }
tun = { package = "tun-easytier", version = "0.6.1", features = [
"async",
], optional = true }
# for net ns
nix = { version = "0.27", features = ["sched", "socket", "ioctl"] }
@@ -155,7 +156,14 @@ indexmap = { version = "~1.9.3", optional = false, features = ["std"] }
atomic-shim = "0.2.0"
smoltcp = { version = "0.11.0", optional = true }
smoltcp = { version = "0.11.0", optional = true, default-features = false, features = [
"std",
"medium-ip",
"proto-ipv4",
"proto-ipv6",
"socket-tcp",
"async",
] }
parking_lot = { version = "0.12.0", optional = true }
[target.'cfg(windows)'.dependencies]
@@ -182,13 +190,23 @@ defguard_wireguard_rs = "0.4.2"
[features]
default = ["wireguard", "mimalloc", "websocket", "smoltcp"]
full = ["quic", "websocket", "wireguard", "mimalloc", "aes-gcm", "smoltcp"]
default = ["wireguard", "mimalloc", "websocket", "smoltcp", "tun"]
full = [
"quic",
"websocket",
"wireguard",
"mimalloc",
"aes-gcm",
"smoltcp",
"tun",
]
mips = ["aes-gcm", "mimalloc", "wireguard"]
bsd = ["aes-gcm", "mimalloc", "smoltcp"]
wireguard = ["dep:boringtun", "dep:ring"]
quic = ["dep:quinn", "dep:rustls", "dep:rcgen"]
mimalloc = ["dep:mimalloc-rust"]
aes-gcm = ["dep:aes-gcm"]
tun = ["dep:tun"]
websocket = [
"dep:tokio-websockets",
"dep:http",