Expand description
Simple Network Time Protocol (SNTPv4, RFC 4330) client messages.
use oxstack_net::sntp;
let request = sntp::request();
// send `request` over UDP to port 123, receive `reply`, then:
let t = sntp::parse_reply(&reply).unwrap();
assert!(t.unix_seconds > 1_700_000_000);Structs§
- Server
Time - Time reported by a server.
Enums§
- Error
- Why a reply was rejected.
Constants§
- PACKET_
LEN - Size of an SNTP message without extensions.
- PORT
- UDP port SNTP servers listen on.
Functions§
- parse_
reply - Validates a reply and extracts its transmit timestamp.
- request
- A client request: just the header byte, everything else zero (RFC 4330 §5 allows clients to leave the transmit timestamp zero).