2 * Definitions for packet disassembly structures and routines
4 * $Id: packet-ntp.h,v 1.4 2000/04/08 07:07:32 guy Exp $
6 * Ethereal - Network traffic analyzer
7 * By Gerald Combs <gerald@zing.org>
8 * Copyright 1998 Gerald Combs
9 * Joerg Mayer <jmayer@telemation.de>
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 /* This is from yahoolib.h from gtkyahoo */
32 #define NTP_LI_MASK 192
36 #define NTP_LI_ALARM 192
38 #define NTP_VN_MASK 56
48 #define NTP_MODE_MASK 7
49 #define NTP_MODE_RSV 0
50 #define NTP_MODE_SYMACT 1
51 #define NTP_MODE_SYMPAS 2
52 #define NTP_MODE_CLIENT 3
53 #define NTP_MODE_SERVER 4
54 #define NTP_MODE_BCAST 5
55 #define NTP_MODE_CTRL 6
56 #define NTP_MODE_PRIV 7
58 /* NTP_BASETIME is infact epoch - ntp_start_time */
59 #define NTP_BASETIME 2208988800ul
60 #define NTP_TS_SIZE 100
62 /* packet structure based on one in xntp package */
63 /* to satisfy it's requirements, even though the code isn't copied
66 /***********************************************************************
68 * Copyright (c) David L. Mills 1992, 1993, 1994, 1995, 1996 *
70 * Permission to use, copy, modify, and distribute this software and *
71 * its documentation for any purpose and without fee is hereby *
72 * granted, provided that the above copyright notice appears in all *
73 * copies and that both the copyright notice and this permission *
74 * notice appear in supporting documentation, and that the name *
75 * University of Delaware not be used in advertising or publicity *
76 * pertaining to distribution of the software without specific, *
77 * written prior permission. The University of Delaware makes no *
78 * representations about the suitability this software for any *
79 * purpose. It is provided "as is" without express or implied *
81 **********************************************************************/
85 unsigned char flags[1]; /* leap indicator, version and mode */ /* 0 */
86 unsigned char stratum[1]; /* peer's stratum */
87 unsigned char ppoll[1]; /* the peer polling interval */
88 char precision[1]; /* peer clock precision */
89 unsigned char rootdelay[4]; /* distance to primary clock */ /* 4 */
90 unsigned char rootdispersion[4]; /* clock dispersion */ /* 8 */
91 unsigned char refid[4]; /* reference clock ID */ /* 12-15 */
92 unsigned char reftime[8]; /* time peer clock was last updated */ /* 16-23 */
93 unsigned char org[8]; /* originate time stamp */ /* 24 */
94 unsigned char rec[8]; /* receive time stamp */ /* 32 */
95 unsigned char xmt[8]; /* transmit time stamp */
96 unsigned char keyid[4]; /* key identification */ /* 48 */
97 unsigned char mac[16]; /* message-authentication code */ /* 52 - 60 */
98 /* can also be 16, if MD5 instead of DES */