Merge upstream main into shared virtual NIC work

Port shared TUN ownership, routing, mobile source dispatch, and
Magic DNS route claims onto the native runtime-host architecture.

Preserve per-member lifecycle and add focused desktop, mobile, netlink,
GUI, FFI, and root integration validation for the merged code.
This commit is contained in:
KKRainbow
2026-08-13 00:56:52 +08:00
609 changed files with 130194 additions and 69014 deletions
+139 -110
View File
@@ -19,43 +19,44 @@ build = "build/main.rs"
name = "easytier-core"
path = "src/easytier-core.rs"
test = false
required-features = ["management"]
[[bin]]
name = "easytier-cli"
path = "src/easytier-cli.rs"
required-features = ["management"]
[lib]
name = "easytier"
path = "src/lib.rs"
[[bench]]
name = "packet_bytes_extraction"
harness = false
[dependencies]
easytier-core = { path = "../easytier-core", version = "2.6.4", default-features = false }
easytier-proto = { path = "../easytier-proto", version = "2.6.4", default-features = false, features = ["api", "core"] }
git-version = "0.3.9"
tracing = { version = "0.1", features = ["log"] }
tracing-subscriber = { version = "0.3", features = [
"env-filter",
"local-time",
"time",
] }
derivative = "2.2.0"
tracing = "0.1"
log = { version = "0.4", features = ["std"] }
tracing-subscriber = { version = "0.3", default-features = false, features = [
"registry",
], optional = true }
derive_more = { version = "2.1.1", features = ["full"] }
console-subscriber = { version = "0.4.1", optional = true }
indoc = "2.0.7"
regex = "1.8"
paste = "1.0"
thiserror = "1.0"
auto_impl = "1.1.0"
crossbeam = "0.8.4"
arc-swap = "1.7"
time = "0.3"
toml = "0.8.12"
chrono = { version = "0.4.37", features = ["serde"] }
guarden = "0.1"
delegate = "0.13.5"
itertools = "0.14.0"
guarden = "0.2"
quanta = "0.12"
strum = { version = "0.27.2", features = ["derive"] }
@@ -63,23 +64,30 @@ gethostname = "0.5.0"
futures = { version = "0.3", features = ["bilock", "unstable"] }
tokio = { version = "1", features = ["full"] }
tokio-stream = "0.1"
tokio = { version = "1", default-features = false, features = [
"fs",
"io-util",
"macros",
"net",
"process",
"rt",
"signal",
"sync",
"time",
] }
tokio-util = { version = "0.7.9", features = ["codec", "net", "io", "rt"] }
async-stream = "0.3.5"
async-trait = "0.1.74"
dashmap = "6.0"
moka = { version = "0.12", features = ["future"] }
timedmap = "=1.0.1"
# for full-path zero-copy
zerocopy = { version = "0.7.32", features = ["derive", "simd"] }
bytes = "1.5.0"
pin-project-lite = "0.2.13"
atomic_refcell = "0.1.13"
atomic-write-file = { version = "0.2.3", optional = true }
quinn = { version = "0.11.8", optional = true, features = ["ring"] }
quinn-proto = { version = "0.11.12", optional = true }
@@ -88,20 +96,20 @@ seahash = { version = "4.1.0", optional = true }
rustls = { version = "0.23.0", features = [
"ring", "tls12"
], default-features = false, optional = true }
rcgen = { version = "0.12.1", optional = true }
# for websocket
tokio-websockets = { version = "0.13.2", optional = true, features = [
tokio-websockets = { version = "0.13.2", git = "https://github.com/EasyTier/tokio-websockets", optional = true, features = [
"rustls-webpki-roots",
"client",
"server",
"fastrand",
"ring",
] }
forwarded-header-value = { version = "0.1.1", optional = true }
http = { version = "1", default-features = false, features = [
"std",
], optional = true }
forwarded-header-value = { version = "0.1.1", optional = true }
rcgen = { version = "0.12.1", optional = true }
tokio-rustls = { version = "0.26", default-features = false, optional = true }
# for tap device
@@ -129,15 +137,10 @@ once_cell = "1.18.0"
# for rpc
prost = "0.14.3"
prost-reflect = { version = "0.16.4", default-features = false, features = ["derive"] }
prost-wkt-types = "0.7.1"
pbjson = "0.9.0"
anyhow = "1.0"
url = { version = "2.5", features = ["serde"] }
percent-encoding = "2.3.1"
idna = "1.0"
# for tun packet
byteorder = "1.5.0"
@@ -145,15 +148,20 @@ byteorder = "1.5.0"
# for proxy
cidr = { version = "0.3.1", features = ["serde"] }
socket2 = { version = "0.5.10", features = ["all"] }
prefix-trie = { version = "0.7.0", features = ["cidr"] }
# for hole punching
stun_codec = "0.3.4"
bytecodec = "0.4.15"
rand = "0.8.5"
serde = { version = "1.0", features = ["derive"] }
pnet = { version = "0.35.0", features = ["serde"] }
pnet_datalink = { version = "0.35.0", optional = true }
pnet_packet = "0.35.0"
smoltcp = { git = "https://github.com/smoltcp-rs/smoltcp.git", rev = "0a926767a68bc88d5512afefa7529c5ecdade4ea", optional = true, default-features = false, features = [
"std",
"medium-ethernet",
"proto-ipv4",
"proto-ipv6",
"socket-raw",
] }
serde_json = "1"
clap = { version = "4.5.30", features = [
@@ -168,23 +176,11 @@ clap_complete_nushell = { version = "4.5.10" }
async-recursion = "1.0.5"
network-interface = "2.0"
# for ospf route
petgraph = "0.8.1"
ordered_hash_map = "0.5.0"
network-interface = "2.0.5"
# for wireguard
boringtun = { package = "boringtun-easytier", version = "0.6.1", optional = true }
# for encryption
ring = { version = "0.17", optional = true }
bitflags = "2.5"
aes-gcm = { version = "0.10.3", optional = true }
openssl = { version = "0.10", optional = true, features = ["vendored"] }
snow = "0.10.0"
x25519-dalek = { version = "2.0", features = ["static_secrets"] }
# for cli
tabled = "0.16"
humansize = "2.1.3"
@@ -198,45 +194,20 @@ mimalloc = { version = "*", optional = true }
# mips
atomic-shim = "0.2.0"
smoltcp = { git = "https://github.com/smoltcp-rs/smoltcp.git", rev = "0a926767a68bc88d5512afefa7529c5ecdade4ea", optional = true, default-features = false, features = [
"std",
"medium-ip",
"proto-ipv4",
"proto-ipv6",
"proto-ipv4-fragmentation",
"fragmentation-buffer-size-8192",
"assembler-max-segment-count-16",
"reassembly-buffer-size-8192",
"reassembly-buffer-count-16",
"socket-tcp",
"socket-udp",
# "socket-tcp-cubic",
"async",
] }
parking_lot = { version = "0.12.0" }
wildmatch = "2.3.4"
rust-i18n = "3"
sys-locale = "0.3"
ringbuf = "0.4.5"
async-ringbuf = "0.3.1"
service-manager = { git = "https://github.com/EasyTier/service-manager-rs.git", branch = "main" }
zstd = { version = "0.13", optional = true }
kcp-sys = { git = "https://github.com/EasyTier/kcp-sys", rev = "d7427c22d764deb1860a7d37acc446ed5033464c", optional = true }
# for http connector
http_req = { git = "https://github.com/EasyTier/http_req.git", default-features = false, features = [
"rust-tls",
] }
# for dns connector
hickory-resolver = "0.25.2"
hickory-proto = "0.25.2"
hickory-resolver = { version = "0.25.2", optional = true }
hickory-proto = { version = "0.25.2", optional = true }
# for magic dns
hickory-client = { version = "0.25.2", optional = true }
@@ -247,30 +218,18 @@ hickory-server = { version = "0.25.2", features = [
bon = "3.9.1"
derive_builder = "0.20.2"
humantime-serde = "1.1.1"
multimap = "0.10.1"
version-compare = "0.2.0"
hmac = "0.12.1"
sha2 = "0.10.8"
shellexpand = "3.1.1"
# for fake tcp
flume = { version = "0.12", optional = true }
igd-next = { version = "0.17.0", features = ["aio_tokio"] }
natpmp = "0.5.0"
igd-next = { version = "0.17.0", features = ["aio_tokio"], optional = true }
natpmp = { version = "0.5.0", optional = true }
[target.'cfg(any(target_os = "linux", target_os = "macos", target_os = "windows", target_os = "freebsd"))'.dependencies]
machine-uid = "0.5.3"
[target.'cfg(any(target_os = "linux"))'.dependencies]
netlink-sys = "0.8.7"
netlink-packet-route = "0.21.0"
netlink-packet-core = { version = "0.7.0" }
netlink-packet-utils = "0.5.2"
# for magic dns
resolv-conf = "0.7.3"
dbus = { version = "0.9.7", features = ["vendored"] }
which = "7.0.3"
netlink-sys = { version = "0.8.7", optional = true }
[target.'cfg(all(windows, any(target_arch = "x86_64", target_arch = "x86")))'.dependencies]
windivert = { git = "https://github.com/EasyTier/windivert-rust.git", rev = "adcc56d1550f7b5377ec2b3429f413ee24a77375", features = [
"static",
@@ -316,30 +275,34 @@ jemalloc-sys = { package = "tikv-jemalloc-sys", version = "0.6.0", features = [
[build-dependencies]
cfg_aliases = "0.2.1"
indoc = "2.0"
globwalk = "0.8.1"
regex = "1"
prost-build = "0.14.3"
prost-reflect-build = "0.16.0"
pbjson-build = "0.9.0"
proc-macro2 = "1"
quote = "1"
thunk-rs = { git = "https://github.com/easytier/thunk.git", default-features = false, features = [
"win7",
] }
[target.'cfg(windows)'.build-dependencies]
reqwest = { version = "0.12.12", features = ["blocking"] }
zip = "4.0.0"
[dev-dependencies]
criterion = "0.5.1"
easytier-core = { path = "../easytier-core", version = "2.6.4", default-features = false, features = [
"test-utils",
] }
serial_test = "3.0.0"
rstest = "0.25.0"
futures-util = "0.3.31"
maplit = "1.0.2"
tempfile = "3.22.0"
ctor = "0.8.0"
stun_codec = "0.3.4"
bytecodec = "0.4.15"
x25519-dalek = { version = "2.0", features = ["static_secrets"] }
smoltcp = { git = "https://github.com/smoltcp-rs/smoltcp.git", rev = "0a926767a68bc88d5512afefa7529c5ecdade4ea", default-features = false, features = [
"std",
"medium-ethernet",
"proto-ipv4",
"proto-ipv6",
"socket-raw",
] }
[target.'cfg(target_os = "linux")'.dev-dependencies]
defguard_wireguard_rs = "0.4.2"
@@ -358,12 +321,19 @@ default = [
"faketcp",
"magic-dns",
"zstd",
"upnp",
"icmp-proxy",
"management",
"endpoint-discovery",
"extended-services",
"linux-netlink",
"tcp-hole-punch",
]
full = [
"websocket",
"wireguard",
"aes-gcm",
"openssl-crypto", # need openssl-dev libs
"openssl-crypto",
"smoltcp",
"tun",
"socks5",
@@ -372,23 +342,34 @@ full = [
"faketcp",
"magic-dns",
"zstd",
"upnp",
"icmp-proxy",
"management",
"endpoint-discovery",
"extended-services",
"tcp-hole-punch",
]
wireguard = ["dep:boringtun", "dep:ring"]
quic = ["dep:quinn", "dep:quinn-proto", "dep:seahash", "dep:rustls", "dep:rcgen"]
kcp = ["dep:kcp-sys"]
wireguard = ["vpn-portal", "dep:boringtun", "ring-crypto", "easytier-proto/wireguard"]
quic = ["wrapped-transport", "easytier-core/proxy-packet", "dep:quinn", "dep:quinn-proto", "dep:seahash", "dep:rustls", "easytier-proto/quic"]
kcp = ["wrapped-transport", "easytier-core/proxy-packet", "dep:kcp-sys"]
mimalloc = ["dep:mimalloc"]
aes-gcm = ["dep:aes-gcm"]
openssl-crypto = ["dep:openssl"]
tun = ["dep:tun"]
aes-gcm = ["easytier-core/aes-gcm"]
openssl-crypto = ["easytier-core/openssl-crypto"]
ring-crypto = ["easytier-core/ring-crypto"]
tun = ["dep:tun", "linux-netlink"]
linux-netlink = ["dep:netlink-sys"]
proxy-cidr-monitor = ["easytier-core/proxy-cidr-monitor"]
websocket = [
"dep:tokio-websockets",
"dep:http",
"dep:forwarded-header-value",
"dep:http",
"dep:rcgen",
"dep:tokio-rustls",
"dep:rustls",
"dep:rcgen",
"easytier-proto/websocket",
]
smoltcp = ["dep:smoltcp"]
smoltcp = ["easytier-core/proxy-smoltcp-stack"]
icmp-proxy = ["easytier-core/proxy-packet"]
socks5 = ["smoltcp"]
ffi-dataplane = ["socks5"]
jemalloc = ["dep:jemallocator", "dep:jemalloc-sys"]
@@ -399,9 +380,57 @@ jemalloc-prof = [
"jemalloc-sys/profiling",
"jemalloc-sys/stats",
]
tracing = ["tokio/tracing", "dep:console-subscriber"]
magic-dns = ["dep:hickory-client", "dep:hickory-server"]
faketcp = ["dep:flume"]
zstd = ["dep:zstd"]
tracing = ["tokio/tracing", "dep:console-subscriber", "dep:tracing-subscriber"]
tracing-log = ["tracing/log", "easytier-core/tracing-log"]
logging = []
dns-resolver = ["dep:hickory-proto", "dep:hickory-resolver"]
magic-dns = [
"dns-resolver",
"dep:hickory-client",
"dep:hickory-server",
"easytier-core/proxy-packet",
"easytier-proto/magic-dns",
]
faketcp = [
"dep:flume",
"dep:pnet_datalink",
"dep:smoltcp",
"easytier-proto/faketcp",
]
zstd = ["easytier-core/zstd", "easytier-proto/zstd"]
upnp = ["dep:igd-next", "dep:natpmp"]
endpoint-discovery = [
"dns-resolver",
"easytier-core/endpoint-discovery",
]
dhcp-ipv4 = ["easytier-core/dhcp-ipv4"]
public-ipv6-provider = ["linux-netlink", "easytier-core/public-ipv6-provider"]
vpn-portal = ["easytier-core/vpn-portal"]
wrapped-transport = ["easytier-core/wrapped-transport"]
extended-services = [
"dhcp-ipv4",
"public-ipv6-provider",
"vpn-portal",
"wrapped-transport",
"proxy-cidr-monitor",
]
management = [
"dep:atomic-write-file",
"web-client",
"logging",
"easytier-core/management",
"easytier-proto/json-rpc",
"easytier-proto/utils",
"tokio/full",
]
management-rpc = ["easytier-core/management-rpc"]
web-client = ["management-rpc", "easytier-core/web-client"]
tcp-hole-punch = ["easytier-core/tcp-hole-punch"]
# Deprecated: hotpath profiling has been removed. These feature aliases are
# retained as no-ops so existing build scripts using `--features hotpath*`
# continue to work without pulling in any dependencies.
hotpath = []
hotpath-cpu = ["hotpath"]
hotpath-alloc = ["hotpath"]
# For Network Extension on macOS
macos-ne = []