]>
The Tcpdump Group git mirrors - tcpdump/blob - ntp.h
1 /* $Header: /tcpdump/master/tcpdump/ntp.h,v 1.6 2002-12-11 07:13:56 guy Exp $ */
4 * Based on ntp.h from the U of MD implementation
5 * This file is based on Version 2 of the NTP spec (RFC1119).
9 * Definitions for the masses
11 #define JAN_1970 2208988800 /* 1970 - 1900 in seconds */
14 * Structure definitions for NTP fixed point values
17 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
18 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
20 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
22 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
25 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
26 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
27 * | Integer Part | Fraction Part |
28 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
40 /* ================= Table 3.3. Packet Variables ================= */
43 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
44 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
45 * |LI | VN | Mode| Stratum | Poll | Precision |
46 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
47 * | Synchronizing Distance |
48 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
49 * | Synchronizing Dispersion |
50 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
51 * | Reference Clock Identifier |
52 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
54 * | Reference Timestamp (64 bits) |
56 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
58 * | Originate Timestamp (64 bits) |
60 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
62 * | Receive Timestamp (64 bits) |
64 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
66 * | Transmit Timestamp (64 bits) |
68 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
71 u_char status
; /* status of local clock and leap info */
72 u_char stratum
; /* Stratum level */
73 u_char ppoll
; /* poll value */
75 struct s_fixedpt distance
;
76 struct s_fixedpt dispersion
;
78 struct l_fixedpt reftime
;
84 * Leap Second Codes (high order two bits)
86 #define NO_WARNING 0x00 /* no warning */
87 #define PLUS_SEC 0x40 /* add a second (61 seconds) */
88 #define MINUS_SEC 0x80 /* minus a second (59 seconds) */
89 #define ALARM 0xc0 /* alarm condition (clock unsynchronized) */
92 * Clock Status Bits that Encode Version
94 #define NTPVERSION_1 0x08
95 #define VERSIONMASK 0x38
102 #define MODE_UNSPEC 0 /* unspecified */
103 #define MODE_SYM_ACT 1 /* symmetric active */
104 #define MODE_SYM_PAS 2 /* symmetric passive */
105 #define MODE_CLIENT 3 /* client */
106 #define MODE_SERVER 4 /* server */
107 #define MODE_BROADCAST 5 /* broadcast */
108 #define MODE_RES1 6 /* reserved */
109 #define MODE_RES2 7 /* reserved */
112 * Stratum Definitions
114 #define UNSPECIFIED 0
115 #define PRIM_REF 1 /* radio clock */
116 #define INFO_QUERY 62 /* **** THIS implementation dependent **** */
117 #define INFO_REPLY 63 /* **** THIS implementation dependent **** */