home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
nisttime.carsoncity.k12.mi.us
/
nisttime.carsoncity.k12.mi.us.tar
/
nisttime.carsoncity.k12.mi.us
/
pub
/
autolock
/
ntp-packet.h
< prev
next >
Wrap
C/C++ Source or Header
|
2003-12-09
|
2KB
|
66 lines
/*
file ntp-packet.h defines the structure of an NTP
network packet.
this description follows appendix A, RFC 1305, page 50.
the parameter NTPJL is used to prevent this structure
from being multiply defined in several modules.
note that root delay and root dispersion are treated as
simple 32-bit integers here, although they are actually
two 16 bit integer quantities, representing the integer
seconds and the seconds fraction. We are just going
to set this stuff to 0 anyway.
*/
#ifndef NTPJL
#define NTPJL 1
#define u_char unsigned char
#define s_char signed char
#define s_fp signed int
#define u_fp unsigned int
#define u_int32 int
#define l_fp unsigned long int
/*
the 64-bit ntp times are each comprised of two 32-bit
integers: the first is the number of seconds since 1900.0
and the second is the seconds fraction.
the union declaration in each case makes it easier to
refer to the two parts separately.
*/
struct ntppkt
{
u_char li_vn_mode; /* contains leap indicator, version and mode */
u_char stratum; /* peer's stratum */
s_char ppoll; /* the peer polling interval */
s_char precision; /* peer clock precision */
s_fp rootdelay; /* distance to primary clock */
u_fp rootdispersion; /* clock dispersion */
u_int32 refid; /* reference clock ID */
union
{
l_fp ntptime;
u_fp sys[2];
} reftime; /*time peer clock was last updated*/
union
{
l_fp ntptime;
u_fp sys[2];
} org; /* originate time stamp */
union
{
l_fp ntptime;
u_fp sys[2];
} rec; /* receive time stamp */
union
{
l_fp ntptime;
u_fp sys[2];
} xmt; /* transmit time stamp */
/*
char auth[12]; 96-bit authenticator -- not used
*/
};
#endif