ztunnel-core is in active development. The figures on this page are derived from the crate source as it stands today (Cargo.toml, src/lib.rs, src/ffi.rs): version, crate-types, the dotted commands matched in Engine::invoke, and the exported C symbols. The "planned" column lists work that is not yet implemented — it is a roadmap, not a claim of coverage.
Module map
| module | role today | planned |
|---|---|---|
| lib (Engine) | one dotted command surface via Engine::invoke; event sink; connect/disconnect orchestration | backend process supervision, auto-reconnect loop |
| model | config · backend · connection · status · stats · log · settings types | per-config advanced OpenVPN options matrix |
| config | parse + import OpenVPN .ovpn, Tunnelblick .tblk bundles, WireGuard .conf; backend auto-detect | inline-file extraction from .tblk, config validation lints |
| manager | per-config lifecycle state machine; logs; throughput sampling | multi-connection policies, on-demand triggers |
| openvpn | argv construction + management-interface protocol parser (STATE · BYTECOUNT · PASSWORD · LOG) | process spawn + socket I/O (net), interactive auth |
| wireguard | typed .conf parse with 32-byte key validation | userspace Noise data path + UDP socket |
| platform (macos · linux) | typed NetOp set; privilege detection | utun/tun creation, routing, DNS via privileged helper |
| privileged | ordered bring-up PrivilegePlan from a config | SMAppService (macOS) / polkit (Linux) helper execution |
| creds | CredStore trait + session-only in-memory store (no plaintext on disk) | macOS Keychain / Linux Secret Service backend |
| log · stats | bounded per-connection log buffer; throughput rate sampler | log export, historical stats |
| store | profile (configs + settings) JSON load/save | config versioning / migration |
| ffi | C ABI: ztn_init · ztn_invoke · ztn_set_event_callback · ztn_string_free | richer event payloads |
tauri_plugin (feature tauri) | Tauri v2 plugin glue + mountable webui | per-window capability scoping |
Build surfaces
The crate declares crate-type = ["rlib", "staticlib", "cdylib"]. The rlib links natively into Rust/Tauri hosts; the staticlib/cdylib expose the C ABI for non-Rust hosts. The default net feature gates the OS-level transport (OpenVPN management socket, WireGuard UDP), all std-only today; building --no-default-features yields a pure config/model/manager core that compiles in headless CI. The optional tauri feature adds the GUI plugin layer.
Verification
The crate carries 40 in-source unit tests across the engine and its modules: the command surface (version/platform reporting, config add/list/get/remove, a connect-without-privilege honest-error path, log accumulation, bad-WireGuard rejection, unknown-command tagging), plus module-level tests in config, wireguard, openvpn (management-line parsing + argv), manager (state transitions), privileged (plan building), stats, store, log and util. Tests run without root or network access and pass identically in headless Linux CI; the privileged bring-up returns an honest needs_privilege error rather than a faked tunnel.