Skip to main content

Module nat_wire

Module nat_wire 

Source
Expand description

Wire-safe NAT-traversal DTOs shared across the daemon / overlayd boundary.

The live NAT-traversal types (NatConfig, Candidate, RelayServerConfig, …) live in zlayer-overlay behind its nat cargo feature. They cannot be referenced from zlayer-types (a leaf crate that must not depend on zlayer-overlay, and must compile with NAT disabled), so this module mirrors the subset that crosses the overlayd IPC channel as plain, always-available, serde-friendly structs.

The conversion NatConfigSpeczlayer_overlay::NatConfig is performed in the crates that already depend on zlayer-overlay (the agent shim and the overlayd server) — never here — so the leaf-crate dependency rule holds.

Every field is #[serde(default)] so an older daemon/overlayd that omits the nat object (or any sub-field) deserializes cleanly: a missing object means “no explicit NAT config supplied” and overlayd falls back to its built-in NatConfig::default().

Structs§

NatCandidateWire
Wire form of a single zlayer_overlay::nat::Candidate.
NatConfigSpec
Wire form of zlayer_overlay::nat::NatConfig.
RelayServerSpec
Wire form of zlayer_overlay::nat::RelayServerConfig, plus the cluster-wide shared auth_credential clients use to derive the relay’s BLAKE2b auth key.
TurnServerSpec
Wire form of zlayer_overlay::nat::TurnServerConfig.