OSDN Git Service

Fix no pic
[uclinux-h8/uClinux-dist.git] / user / sendip / ntp.h
1 /* ntp.h
2  */
3 #ifndef _SENDIP_NTP_H
4 #define _SENDIP_NTP_H
5
6 typedef struct {
7         u_int32_t intpart;
8         u_int32_t fracpart;
9 } ntp_ts;
10
11 /* NTP HEADER
12  */
13 typedef struct {
14         /* TODO BYTEORDER!!! */
15         u_int8_t leap:2;     
16         u_int8_t status:6;  
17         u_int8_t type;
18         /* END TODO */
19
20         u_int16_t precision;
21         u_int32_t error;
22         u_int32_t drift;
23         union {
24                 u_int32_t ipaddr;
25                 char id[4];
26         } reference;
27         ntp_ts reference_ts;
28         ntp_ts originate_ts;
29         ntp_ts receive_ts;
30         ntp_ts transmit_ts;
31 } ntp_header;
32
33 /* Defines for which parts have been modified
34  */
35 #define NTP_MOD_LEAP      (1)
36 #define NTP_MOD_STATUS    (1<<1)
37 #define NTP_MOD_TYPE      (1<<2)
38 #define NTP_MOD_PRECISION (1<<3)
39 #define NTP_MOD_ERROR     (1<<4)
40 #define NTP_MOD_DRIFT     (1<<5)
41 #define NTP_MOD_REF       (1<<6)
42 #define NTP_MOD_REFERENCE (1<<7)
43 #define NTP_MOD_ORIGINATE (1<<8)
44 #define NTP_MOD_RECEIVE   (1<<9)
45 #define NTP_MOD_TRANSMIT  (1<<10)
46
47 /* Options
48  */
49 sendip_option ntp_opts[] = {
50         {"l",1,"NTP Leap Indicator","00 (no warning)"},
51         {"s",1,"NTP status","0 (clock operating OK)"},
52         {"t",1,"NTP type","0 (unspecified)"},
53         {"p",1,"NTP precision","0"},
54         {"e",1,"NTP estimated error","0.0"},
55         {"d",1,"NTP estimated drift rate","0.0"},
56         {"r",1,"NTP reference clock ID (string or IP or number)","0"},
57         {"f",1,"NTP reference timestamp","0.0"},
58         {"o",1,"NTP originate timestamp","0.0"},
59         {"a",1,"NTP arrival (receive) timestamp","0.0"},
60         {"x",1,"NTP xmit (transmit) timestamp","0.0"}
61 };
62
63 #endif  /* _SENDIP_NTP_H */