mirror of
https://github.com/jmcorgan/fips.git
synced 2026-07-30 19:46:15 +00:00
peer: add the per-peer FMP control state machine (unwired)
Introduce src/peer/machine.rs: a sans-IO per-peer control FSM that consolidates the scattered handshake/rekey/timeout driver logic now spread across node/handlers. The machine is a pure reducer — step(event, now, index_allocator) -> [action] — that reuses the existing FMP decision cores (establish_inbound/establish_outbound/ cross_connection_winner/poll_*) rather than reimplementing any decision, and returns runtime-agnostic actions the driver executes. Control-tier state only; the published send-state boundary and the driver wiring land in following commits. The machine is terminal at Closed — re-dial is the reconciler's, so it holds no cross-attempt retry state. Includes eight unit tests: inbound and outbound establish, N:1 identity crystallization, the dual-initiation tie-break, restart-override, rekey initiator cutover, the data-plane-owned responder cutover boundary, and liveness -> link-dead -> report-lost. Unwired — nothing calls it yet.
This commit is contained in:
+1673
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,7 @@ mod active;
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
pub(crate) mod connected_udp;
|
||||
mod connection;
|
||||
pub(crate) mod machine;
|
||||
|
||||
pub use active::{ActivePeer, ConnectivityState};
|
||||
pub use connection::{HandshakeState, PeerConnection};
|
||||
|
||||
Reference in New Issue
Block a user