xref: /freebsd-src/contrib/tcpdump/ntp.h (revision ee67461e56828dd1f8de165947ba83f6d9148a87)
1*ee67461eSJoseph Mingrone /*
2*ee67461eSJoseph Mingrone  * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
3*ee67461eSJoseph Mingrone  *	The Regents of the University of California.  All rights reserved.
4*ee67461eSJoseph Mingrone  *
5*ee67461eSJoseph Mingrone  * Redistribution and use in source and binary forms, with or without
6*ee67461eSJoseph Mingrone  * modification, are permitted provided that: (1) source code distributions
7*ee67461eSJoseph Mingrone  * retain the above copyright notice and this paragraph in its entirety, (2)
8*ee67461eSJoseph Mingrone  * distributions including binary code include the above copyright notice and
9*ee67461eSJoseph Mingrone  * this paragraph in its entirety in the documentation or other materials
10*ee67461eSJoseph Mingrone  * provided with the distribution, and (3) all advertising materials mentioning
11*ee67461eSJoseph Mingrone  * features or use of this software display the following acknowledgement:
12*ee67461eSJoseph Mingrone  * ``This product includes software developed by the University of California,
13*ee67461eSJoseph Mingrone  * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
14*ee67461eSJoseph Mingrone  * the University nor the names of its contributors may be used to endorse
15*ee67461eSJoseph Mingrone  * or promote products derived from this software without specific prior
16*ee67461eSJoseph Mingrone  * written permission.
17*ee67461eSJoseph Mingrone  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18*ee67461eSJoseph Mingrone  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19*ee67461eSJoseph Mingrone  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20*ee67461eSJoseph Mingrone  *
21*ee67461eSJoseph Mingrone  */
22*ee67461eSJoseph Mingrone 
23*ee67461eSJoseph Mingrone #include "netdissect-stdinc.h"
24*ee67461eSJoseph Mingrone 
25*ee67461eSJoseph Mingrone #include "netdissect.h"
26*ee67461eSJoseph Mingrone 
27*ee67461eSJoseph Mingrone /*
28*ee67461eSJoseph Mingrone  * Structure definitions for NTP fixed point values
29*ee67461eSJoseph Mingrone  *
30*ee67461eSJoseph Mingrone  *    0			  1		      2			  3
31*ee67461eSJoseph Mingrone  *    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
32*ee67461eSJoseph Mingrone  *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
33*ee67461eSJoseph Mingrone  *   |			       Integer Part			     |
34*ee67461eSJoseph Mingrone  *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
35*ee67461eSJoseph Mingrone  *   |			       Fraction Part			     |
36*ee67461eSJoseph Mingrone  *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
37*ee67461eSJoseph Mingrone  *
38*ee67461eSJoseph Mingrone  *    0			  1		      2			  3
39*ee67461eSJoseph Mingrone  *    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
40*ee67461eSJoseph Mingrone  *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
41*ee67461eSJoseph Mingrone  *   |		  Integer Part	     |	   Fraction Part	     |
42*ee67461eSJoseph Mingrone  *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
43*ee67461eSJoseph Mingrone */
44*ee67461eSJoseph Mingrone struct l_fixedpt {
45*ee67461eSJoseph Mingrone 	nd_uint32_t int_part;
46*ee67461eSJoseph Mingrone 	nd_uint32_t fraction;
47*ee67461eSJoseph Mingrone };
48*ee67461eSJoseph Mingrone 
49*ee67461eSJoseph Mingrone struct s_fixedpt {
50*ee67461eSJoseph Mingrone 	nd_uint16_t int_part;
51*ee67461eSJoseph Mingrone 	nd_uint16_t fraction;
52*ee67461eSJoseph Mingrone };
53*ee67461eSJoseph Mingrone 
54*ee67461eSJoseph Mingrone void p_ntp_time(netdissect_options *, const struct l_fixedpt *);
55