bgp route refresh/MP capability option.
[obnox/wireshark/wip.git] / packet-ntp.h
1 /* packet-ntp.h
2  * Definitions for packet disassembly structures and routines
3  *
4  * $Id: packet-ntp.h,v 1.4 2000/04/08 07:07:32 guy Exp $
5  *
6  * Ethereal - Network traffic analyzer
7  * By Gerald Combs <gerald@zing.org>
8  * Copyright 1998 Gerald Combs
9  * Joerg Mayer <jmayer@telemation.de>
10  *
11  * 
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.
16  * 
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.
21  * 
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.
25  */
26
27 /* This is from yahoolib.h from gtkyahoo */
28
29 #ifndef PACKET_NTP_H
30 #define PACKET_NTP_H
31
32 #define NTP_LI_MASK     192
33 #define NTP_LI_NONE     0
34 #define NTP_LI_61       64
35 #define NTP_LI_59       128
36 #define NTP_LI_ALARM    192
37
38 #define NTP_VN_MASK     56
39 #define NTP_VN_R0       0
40 #define NTP_VN_R1       8
41 #define NTP_VN_R2       16
42 #define NTP_VN_3        24
43 #define NTP_VN_4        32
44 #define NTP_VN_R5       40
45 #define NTP_VN_R6       48
46 #define NTP_VN_R7       56
47
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
57
58 /* NTP_BASETIME is infact epoch - ntp_start_time */
59 #define NTP_BASETIME 2208988800ul
60 #define NTP_TS_SIZE 100
61
62 /* packet structure based on one in xntp package */
63 /* to satisfy it's requirements, even though the code isn't copied
64 directly: */
65
66 /***********************************************************************
67  *                                                                     *
68  * Copyright (c) David L. Mills 1992, 1993, 1994, 1995, 1996           *
69  *                                                                     *
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          *
80  * warranty.                                                           *
81  **********************************************************************/
82
83 struct ntp_packet
84 {
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 */
99 };
100
101 #endif