ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
ntp_server.h File Reference

NTP/SNTP time server (RFC 5905 / RFC 4330 server mode) on UDP/123. More...

#include "protocore_config.h"

Go to the source code of this file.

Detailed Description

NTP/SNTP time server (RFC 5905 / RFC 4330 server mode) on UDP/123.

Answers client NTP requests from the device's own clock. Stateless request/response: a client sends a 48-octet packet, the server fills in the reference/receive/transmit timestamps, echoes the client's transmit stamp as the origin, and sends it back. Zero heap; gated by PROTOCORE_ENABLE_NTP_SERVER (default off).

protocore_ntp_server_build_response() is pure: request bytes and an NTP-epoch time in, reply bytes out. protocore_ntp_server_begin() binds UDP/123 via the transport UDP service and drives it from protocore_time_now() (seconds) plus a protocore_millis()-derived sub-second fraction.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file ntp_server.h.