Commit Graph
11 Commits
Author SHA1 Message Date
ktims ea56afd2f2 Add YAML configuration model and loader
Config is layered: built-in defaults, then the YAML file, then BFD_* environment variables, then CLI flags. Global defaults live under a 'defaults' mapping; per-peer settings are file-only. Includes config.yaml.dist and ScriptHookSink::with_script_dir so the hooks directory is configurable.
2026-10-22 17:48:59 -07:00
ktims 0284ee17b1 clippies 2026-10-22 15:47:16 -07:00
ktims dcbf25ebe0 Add Dockerfile
Multi-stage build producing a slim image with rust-bfdd as the entrypoint. Dependencies are built against stub sources in their own layer so source-only changes do not rebuild them.
2026-10-22 15:44:39 -07:00
ktims 146f8d4c32 Log session table at debug level
The per-packet session dump is too noisy at info.
2026-10-22 15:41:08 -07:00
ktims 4773c9e4f7 Fix protocol conformance issues found in interop testing
Implement the Poll Sequence (initiate on reaching Up when the configured interval is lower than the slow-start one; respond to Poll with Final; terminate on Final) and apply DesiredMinTxInterval changes per RFC 5880 section 6.8.3, keeping the slow rate until the peer has acknowledged. Never set the Demand bit unless demand mode is active, clear the C bit (this implementation shares fate with the control plane), discard packets whose Length exceeds the received payload, and log effective timer changes.
2026-10-22 15:41:08 -07:00
ktims 0bd4f8766a Bind session sockets without panicking
Select a random unused source port in the RFC 5881 range (retrying on EADDRINUSE) instead of unwrapping a pure-random bind. Propagate bind errors out of session start-up, store the local IP on the session instead of unwrapping local_addr(), and log (rather than panic on) receive errors in the rx loop.
2026-10-22 15:41:08 -07:00
ktims c7a6ed16e4 Add command line arguments
Replace the hard-coded addresses with clap arguments: --bind <IP> and one or more --peer <IP>. Peers must match the address family of the bind address. Also updates Cargo.lock.
2026-10-22 15:41:08 -07:00
ktims 0bb1f437ae Declare nix dependency
lib.rs and events.rs already use nix; it was missing from Cargo.toml so the crate did not build.
2026-10-22 15:41:08 -07:00
ktims 953f37d1c7 Lots of refactoring and improvements. Script hooks.
Can now establish and hold a session with BIRD, successfully detect Down
state, and call scripts on state change via an event dispatch engine.

Can't maintain a session with VyOS. I think it is calculating the timers
incorrectly, but don't trust my own implementation of course...
2024-10-07 23:56:33 -07:00
ktims 466d6462a4 Basically working version 2024-05-19 15:02:57 -07:00
ktims d00f47d004 Initial commit. Kinda does something. 2024-01-31 00:59:42 -08:00