Skip to main content

chrony_confile/ast/
selection.rs

1//! Source selection tuning configuration types.
2//!
3//! These directives control how chrony selects the best time sources among available NTP peers,
4//! including authentication mode, combine limits, distance/jitter constraints, and minimum
5//! source counts.
6
7/// Authentication selection mode for NTP sources.
8///
9/// Controls how chrony selects among sources with different authentication statuses.
10#[derive(Debug, Clone, Copy, PartialEq, Eq)]
11pub enum AuthSelectMode {
12    /// Require authenticated sources.
13    Require,
14    /// Prefer authenticated sources but accept unauthenticated ones.
15    Prefer,
16    /// Mix authenticated and unauthenticated sources.
17    Mix,
18    /// Ignore authentication status in source selection.
19    Ignore,
20}
21
22#[derive(Debug, Clone, PartialEq)]
23pub struct CombineLimitConfig { pub limit: f64 }
24
25#[derive(Debug, Clone, PartialEq)]
26pub struct MaxDistanceConfig { pub distance: f64 }
27
28#[derive(Debug, Clone, PartialEq)]
29pub struct MaxJitterConfig { pub jitter: f64 }
30
31#[derive(Debug, Clone, PartialEq)]
32pub struct MinSourcesConfig { pub sources: u32 }
33
34#[derive(Debug, Clone, PartialEq)]
35pub struct ReselectDistConfig { pub distance: f64 }
36
37#[derive(Debug, Clone, PartialEq)]
38pub struct StratumWeightConfig { pub distance: f64 }