ntp.h 662 B

123456789101112131415161718192021222324252627282930313233
  1. #define JAN_1970 2208988800UL /* 1970 - 1900 in seconds */
  2. struct l_fixedpt { /* 64-bit fixed-point */
  3. uint32_t int_part;
  4. uint32_t fraction;
  5. };
  6. struct s_fixedpt { /* 32-bit fixed-point */
  7. uint16_t int_part;
  8. uint16_t fraction;
  9. };
  10. struct ntpdata { /* NTP header */
  11. u_char status;
  12. u_char stratum;
  13. u_char ppoll;
  14. int precision:8;
  15. struct s_fixedpt distance;
  16. struct s_fixedpt dispersion;
  17. uint32_t refid;
  18. struct l_fixedpt reftime;
  19. struct l_fixedpt org;
  20. struct l_fixedpt rec;
  21. struct l_fixedpt xmt;
  22. };
  23. #define VERSION_MASK 0x38
  24. #define MODE_MASK 0x07
  25. #define MODE_CLIENT 3
  26. #define MODE_SERVER 4
  27. #define MODE_BROADCAST 5