rkik 2.2.0

Rusty Klock Inspection Kit - NTP Query and Compare Tool
Documentation
use chrono::{DateTime, Local, Utc};
use std::net::IpAddr;

#[cfg(feature = "json")]
use serde::Serialize;

#[cfg(feature = "nts")]
use crate::adapters::nts_client::{NtsKeData, NtsValidationOutcome};

/// Target host resolved to an IP address.
#[derive(Clone, Debug)]
#[cfg_attr(feature = "json", derive(Serialize))]
pub struct Target {
    pub name: String,
    pub ip: IpAddr,
    pub port: u16,
}

/// Result of probing an NTP server.
#[derive(Clone, Debug)]
#[cfg_attr(feature = "json", derive(Serialize))]
pub struct ProbeResult {
    pub target: Target,
    pub offset_ms: f64,
    pub rtt_ms: f64,
    pub stratum: u8,
    pub ref_id: String,
    pub utc: DateTime<Utc>,
    pub local: DateTime<Local>,
    pub timestamp: i64,      // Unix timestamp
    pub authenticated: bool, // Whether NTS authentication was used
    #[cfg(feature = "nts")]
    pub nts_ke_data: Option<NtsKeData>, // NTS-KE diagnostic data (only with nts feature)
    #[cfg(feature = "nts")]
    pub nts_validation: Option<NtsValidationOutcome>, // Detailed NTS validation outcome
}