Skip to main content

Crate ntp_server

Crate ntp_server 

Source
Expand description

NTP server library with tokio/smol runtime support and NTS-KE.

This crate provides NTPv4 server implementations using either the tokio or smol async runtimes, with optional NTS (Network Time Security) support.

§Feature Flags

FeatureDefaultDescription
tokionoNTP server using the tokio runtime.
smol-runtimenoNTP server using the smol runtime.
ntsnoNTS-KE server (RFC 8915) via tokio + tokio-rustls. Implies tokio.
nts-smolnoNTS-KE server via smol + futures-rustls. Implies smol-runtime. Cannot be combined with nts (different TLS backends).
pq-ntsnoEnable post-quantum key exchange for NTS (ML-KEM via aws-lc-rs).
symmetricnoNTP symmetric passive mode (RFC 5905 mode 2).
broadcastnoNTP broadcast mode (mode 5). Deprecated by RFC 8633.
refclocknoReference clock support for Stratum 1. Implies tokio, pulls in ntp_usg-client.
gpsnoGPS reference clock driver. Implies refclock.
ppsnoPPS reference clock driver. Implies refclock.
socket-optsnoDSCP, IPV6_V6ONLY, and multicast socket options via socket2.
ipv4noDefault to 0.0.0.0 instead of [::] for listen addresses.
ntpv5noNTPv5 draft support (draft-ietf-ntp-ntpv5).

Modules§

error
Custom error types for buffer-based NTP packet parsing and serialization. Custom error types for buffer-based NTP packet parsing and serialization.
extension
NTP extension field parsing and NTS extension types. NTP extension field parsing and NTS (Network Time Security) extension types.
protocol
NTP protocol types and constants (RFC 5905). Types and constants that precisely match the specification.
unix_time
Unix time conversion utilities for NTP timestamps.