Expand description
Server-side policy: client tracking, rate limiting, and interleaved mode.
All decisions, no I/O. The daemon owns sockets and NTS; this module owns what the answer should be, which is what makes it testable without a network and portable to wasm.
The client key is generic on purpose: the core must not know what an IP address is (mission plan §4 — the core knows bytes and timestamps, never a product type). The daemon instantiates it with the peer address.
Structs§
- Client
Handle - A resolved position in the table.
- Client
Hash Builder - A fast, seeded hasher for short keys.
- Client
Hasher - Client
Record - Per-client state: enough for rate limiting, interleaved mode and the MRU report, and no more — this is multiplied by every client that has ever spoken to us.
- Client
Table - Bounded most-recently-used client table.
- Rate
Limit Config - Rate-limit policy, mirroring chrony’s
ratelimit interval/burst/leak. - Server
Stats - Aggregate counters for the
status.serverstatsop.
Enums§
- Disposition
- What the server should do with one request.
- Response
Mode - Which timestamps a response should carry.
Functions§
- mark_
server_ timestamps - Mark a server response’s timestamps so the two are distinguishable by their
lowest bit: receive has bit 0 set, transmit has it clear (RFC 9769 and
chrony’s
ntp_core.c).