ZTUNNEL-CORE // ENGINEERING REPORT

// module map · command surface · FFI exports · test status

Home Tunnelblick Port Source
0.1.0version
3crate-types (rlib · staticlib · cdylib)
19engine commands
4C-ABI exports

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

modulerole todayplanned
lib (Engine)one dotted command surface via Engine::invoke; event sink; connect/disconnect orchestrationbackend process supervision, auto-reconnect loop
modelconfig · backend · connection · status · stats · log · settings typesper-config advanced OpenVPN options matrix
configparse + import OpenVPN .ovpn, Tunnelblick .tblk bundles, WireGuard .conf; backend auto-detectinline-file extraction from .tblk, config validation lints
managerper-config lifecycle state machine; logs; throughput samplingmulti-connection policies, on-demand triggers
openvpnargv construction + management-interface protocol parser (STATE · BYTECOUNT · PASSWORD · LOG)process spawn + socket I/O (net), interactive auth
wireguardtyped .conf parse with 32-byte key validationuserspace Noise data path + UDP socket
platform (macos · linux)typed NetOp set; privilege detectionutun/tun creation, routing, DNS via privileged helper
privilegedordered bring-up PrivilegePlan from a configSMAppService (macOS) / polkit (Linux) helper execution
credsCredStore trait + session-only in-memory store (no plaintext on disk)macOS Keychain / Linux Secret Service backend
log · statsbounded per-connection log buffer; throughput rate samplerlog export, historical stats
storeprofile (configs + settings) JSON load/saveconfig versioning / migration
ffiC ABI: ztn_init · ztn_invoke · ztn_set_event_callback · ztn_string_freericher event payloads
tauri_plugin (feature tauri)Tauri v2 plugin glue + mountable webuiper-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.