ntp_proto/lib.rs
1// Copyright 2026 U.S. Federal Government (in countries where recognized)
2// SPDX-License-Identifier: Apache-2.0
3
4//! NTP protocol types, extension fields, and NTS cryptographic primitives.
5//!
6//! This crate provides the foundational types and parsing logic for the
7//! Network Time Protocol (RFC 5905) and Network Time Security (RFC 8915).
8
9#![cfg_attr(not(feature = "std"), no_std)]
10#![deny(unsafe_code)]
11#![warn(missing_docs)]
12
13#[cfg(feature = "alloc")]
14extern crate alloc;
15
16/// Custom error types for buffer-based NTP packet parsing and serialization.
17pub mod error;
18
19/// NTP extension field parsing and NTS extension types.
20pub mod extension;
21
22/// NTP protocol types and constants (RFC 5905).
23pub mod protocol;
24
25/// Unix time conversion utilities for NTP timestamps.
26pub mod unix_time;
27
28/// Shared NTS logic: AEAD encryption, key establishment records, and NTS packet building.
29///
30/// Used by both client and server NTS implementations.
31#[cfg(feature = "nts")]
32pub mod nts_common;