summaryrefslogtreecommitdiff
path: root/include/ntp_control.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ntp_control.h')
-rw-r--r--include/ntp_control.h122
1 files changed, 63 insertions, 59 deletions
diff --git a/include/ntp_control.h b/include/ntp_control.h
index c299794534b3b..3bca32b6e5b1c 100644
--- a/include/ntp_control.h
+++ b/include/ntp_control.h
@@ -18,7 +18,7 @@ struct ntp_control {
/*
* Length of the control header, in octets
*/
-#define CTL_HEADER_LEN 12
+#define CTL_HEADER_LEN (offsetof(struct ntp_control, data))
#define CTL_MAX_DATA_LEN 468
@@ -45,30 +45,31 @@ struct ntp_control {
/*
* Opcodes
*/
-#define CTL_OP_UNSPEC 0
-#define CTL_OP_READSTAT 1
-#define CTL_OP_READVAR 2
-#define CTL_OP_WRITEVAR 3
-#define CTL_OP_READCLOCK 4
-#define CTL_OP_WRITECLOCK 5
-#define CTL_OP_SETTRAP 6
-#define CTL_OP_ASYNCMSG 7
-#define CTL_OP_UNSETTRAP 31
+#define CTL_OP_UNSPEC 0 /* unspeciffied */
+#define CTL_OP_READSTAT 1 /* read status */
+#define CTL_OP_READVAR 2 /* read variables */
+#define CTL_OP_WRITEVAR 3 /* write variables */
+#define CTL_OP_READCLOCK 4 /* read clock variables */
+#define CTL_OP_WRITECLOCK 5 /* write clock variables */
+#define CTL_OP_SETTRAP 6 /* set trap address */
+#define CTL_OP_ASYNCMSG 7 /* asynchronous message */
+#define CTL_OP_CONFIGURE 8 /* runtime configuration */
+#define CTL_OP_SAVECONFIG 9 /* save config to file */
+#define CTL_OP_UNSETTRAP 31 /* unset trap */
/*
* {En,De}coding of the system status word
*/
-#define CTL_SST_TS_UNSPEC 0 /* time source unspecified */
-#define CTL_SST_TS_ATOM 1 /* time source calibrated atomic */
-#define CTL_SST_TS_LF 2 /* time source VLF or LF radio */
-#define CTL_SST_TS_HF 3 /* time source HF radio */
-#define CTL_SST_TS_UHF 4 /* time source UHF radio */
-#define CTL_SST_TS_LOCAL 5 /* time source LOCAL */
-#define CTL_SST_TS_NTP 6 /* time source NTP */
-#define CTL_SST_TS_UDPTIME 7 /* time source UDP/TIME */
-#define CTL_SST_TS_WRSTWTCH 8 /* time source is wristwatch */
-#define CTL_SST_TS_TELEPHONE 9 /* time source is telephone modem */
-#define CTL_SST_TS_PPS 0x20 /* time source is PPS signal */
+#define CTL_SST_TS_UNSPEC 0 /* unspec */
+#define CTL_SST_TS_ATOM 1 /* pps */
+#define CTL_SST_TS_LF 2 /* lf radio */
+#define CTL_SST_TS_HF 3 /* hf radio */
+#define CTL_SST_TS_UHF 4 /* uhf radio */
+#define CTL_SST_TS_LOCAL 5 /* local */
+#define CTL_SST_TS_NTP 6 /* ntp */
+#define CTL_SST_TS_UDPTIME 7 /* other */
+#define CTL_SST_TS_WRSTWTCH 8 /* wristwatch */
+#define CTL_SST_TS_TELEPHONE 9 /* telephone */
#define CTL_SYS_MAXEVENTS 15
@@ -90,14 +91,14 @@ struct ntp_control {
#define CTL_PST_AUTHENABLE 0x40
#define CTL_PST_AUTHENTIC 0x20
#define CTL_PST_REACH 0x10
-#define CTL_PST_UNSPEC 0x08
+#define CTL_PST_BCAST 0x08
#define CTL_PST_SEL_REJECT 0 /* reject */
#define CTL_PST_SEL_SANE 1 /* x falsetick */
#define CTL_PST_SEL_CORRECT 2 /* . excess */
#define CTL_PST_SEL_SELCAND 3 /* - outlyer */
-#define CTL_PST_SEL_SYNCCAND 4 /* + candidat */
-#define CTL_PST_SEL_DISTSYSPEER 5 /* # selected */
+#define CTL_PST_SEL_SYNCCAND 4 /* + candidate */
+#define CTL_PST_SEL_EXCESS 5 /* # backup */
#define CTL_PST_SEL_SYSPEER 6 /* * sys.peer */
#define CTL_PST_SEL_PPS 7 /* o pps.peer */
@@ -154,31 +155,32 @@ struct ntp_control {
#define CS_REFTIME 7
#define CS_POLL 8
#define CS_PEERID 9
-#define CS_STATE 10
-#define CS_OFFSET 11
-#define CS_DRIFT 12
-#define CS_JITTER 13
-#define CS_ERROR 14
-#define CS_CLOCK 15
-#define CS_PROCESSOR 16
-#define CS_SYSTEM 17
-#define CS_VERSION 18
-#define CS_STABIL 19
-#define CS_VARLIST 20
+#define CS_OFFSET 10
+#define CS_DRIFT 11
+#define CS_JITTER 12
+#define CS_ERROR 13
+#define CS_CLOCK 14
+#define CS_PROCESSOR 15
+#define CS_SYSTEM 16
+#define CS_VERSION 17
+#define CS_STABIL 18
+#define CS_VARLIST 19
+#define CS_TAI 20
+#define CS_LEAPTAB 21
+#define CS_LEAPEND 22
+#define CS_RATE 23
#ifdef OPENSSL
-#define CS_FLAGS 21
-#define CS_HOST 22
-#define CS_PUBLIC 23
-#define CS_CERTIF 24
-#define CS_REVTIME 25
-#define CS_LEAPTAB 26
-#define CS_TAI 27
-#define CS_DIGEST 28
-#define CS_IDENT 29
-#define CS_REVOKE 30
-#define CS_MAXCODE CS_REVOKE
+#define CS_FLAGS 24
+#define CS_HOST 25
+#define CS_PUBLIC 26
+#define CS_CERTIF 27
+#define CS_SIGNATURE 28
+#define CS_REVTIME 29
+#define CS_GROUP 30
+#define CS_DIGEST 31
+#define CS_MAXCODE CS_DIGEST
#else
-#define CS_MAXCODE CS_VARLIST
+#define CS_MAXCODE CS_RATE
#endif /* OPENSSL */
/*
@@ -221,18 +223,21 @@ struct ntp_control {
#define CP_FLASH 35
#define CP_TTL 36
#define CP_VARLIST 37
+#define CP_IN 38
+#define CP_OUT 39
+#define CP_RATE 40
+#define CP_BIAS 41
#ifdef OPENSSL
-#define CP_FLAGS 38
-#define CP_HOST 39
-#define CP_VALID 40
-#define CP_INITSEQ 41
-#define CP_INITKEY 42
-#define CP_INITTSP 43
-#define CP_DIGEST 44
-#define CP_IDENT 45
-#define CP_MAXCODE CP_IDENT
+#define CP_FLAGS 42
+#define CP_HOST 43
+#define CP_VALID 44
+#define CP_INITSEQ 45
+#define CP_INITKEY 46
+#define CP_INITTSP 47
+#define CP_SIGNATURE 48
+#define CP_MAXCODE CP_SIGNATURE
#else
-#define CP_MAXCODE CP_VARLIST
+#define CP_MAXCODE CP_BIAS
#endif /* OPENSSL */
/*
@@ -251,7 +256,6 @@ struct ntp_control {
#define CC_FLAGS 11
#define CC_DEVICE 12
#define CC_VARLIST 13
-
#define CC_MAXCODE CC_VARLIST
/*
@@ -259,7 +263,7 @@ struct ntp_control {
* ntp_request.c wants to see this.
*/
struct ctl_trap {
- struct sockaddr_storage tr_addr;/* address of trap recipient */
+ sockaddr_u tr_addr; /* address of trap recipient */
struct interface *tr_localaddr; /* interface to send this through */
u_long tr_settime; /* time trap was set */
u_long tr_count; /* async messages sent to this guy */