]>
git.saurik.com Git - apple/network_cmds.git/blob - tcpdump.tproj/ntp.h
dd69af9f45fb70752c013e3f8a29e515070abb6d
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * "Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.0 (the 'License'). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
14 * The Original Code and all software distributed under the License are
15 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
22 * @APPLE_LICENSE_HEADER_END@
24 /* $Header: /cvs/Darwin/Commands/NeXT/network_cmds/tcpdump.tproj/ntp.h,v 1.1.1.1 1999/05/02 03:58:32 wsanchez Exp $ */
27 * Based on ntp.h from the U of MD implementation
28 * This file is based on Version 2 of the NTP spec (RFC1119).
32 * Definitions for the masses
34 #define JAN_1970 2208988800 /* 1970 - 1900 in seconds */
37 * Structure definitions for NTP fixed point values
40 * 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
41 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
43 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
45 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
48 * 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
49 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
50 * | Integer Part | Fraction Part |
51 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
63 /* ================= Table 3.3. Packet Variables ================= */
66 * 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
67 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
68 * |LI | VN | Mode| Stratum | Poll | Precision |
69 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
70 * | Synchronizing Distance |
71 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
72 * | Synchronizing Dispersion |
73 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
74 * | Reference Clock Identifier |
75 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
77 * | Reference Timestamp (64 bits) |
79 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
81 * | Originate Timestamp (64 bits) |
83 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
85 * | Receive Timestamp (64 bits) |
87 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
89 * | Transmit Timestamp (64 bits) |
91 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
94 u_char status
; /* status of local clock and leap info */
95 u_char stratum
; /* Stratum level */
96 u_char ppoll
; /* poll value */
98 struct s_fixedpt distance
;
99 struct s_fixedpt dispersion
;
101 struct l_fixedpt reftime
;
102 struct l_fixedpt org
;
103 struct l_fixedpt rec
;
104 struct l_fixedpt xmt
;
107 * Leap Second Codes (high order two bits)
109 #define NO_WARNING 0x00 /* no warning */
110 #define PLUS_SEC 0x40 /* add a second (61 seconds) */
111 #define MINUS_SEC 0x80 /* minus a second (59 seconds) */
112 #define ALARM 0xc0 /* alarm condition (clock unsynchronized) */
115 * Clock Status Bits that Encode Version
117 #define NTPVERSION_1 0x08
118 #define VERSIONMASK 0x38
119 #define LEAPMASK 0xc0
120 #define MODEMASK 0x07
125 #define MODE_UNSPEC 0 /* unspecified */
126 #define MODE_SYM_ACT 1 /* symmetric active */
127 #define MODE_SYM_PAS 2 /* symmetric passive */
128 #define MODE_CLIENT 3 /* client */
129 #define MODE_SERVER 4 /* server */
130 #define MODE_BROADCAST 5 /* broadcast */
131 #define MODE_RES1 6 /* reserved */
132 #define MODE_RES2 7 /* reserved */
135 * Stratum Definitions
137 #define UNSPECIFIED 0
138 #define PRIM_REF 1 /* radio clock */
139 #define INFO_QUERY 62 /* **** THIS implementation dependent **** */
140 #define INFO_REPLY 63 /* **** THIS implementation dependent **** */