ntp.h 604 B

1234567891011121314151617
  1. /* Minimal SNTP client (RFC 4330): see ntp.c. */
  2. #ifndef NTP_H
  3. #define NTP_H
  4. #include "syscall.h"
  5. /* Server used when the caller passes an empty name. */
  6. #define NTP_DEFAULT_SERVER "pool.ntp.org"
  7. /* Resolve `server` (a dotted address skips DNS), ARP the next hop, send one
  8. * NTP client request and wait for the reply. Returns a SYS_NTP_* code and,
  9. * on success, fills `out` with the server's UTC transmit time. The caller
  10. * must own the receiver (sys_ntp_sync() takes care of that for ring 3). */
  11. int ntp_sync(const char *server, unsigned int timeout_ms,
  12. struct sys_datetime *out);
  13. #endif