summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/include/ntp_request.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ntp/include/ntp_request.h')
-rw-r--r--contrib/ntp/include/ntp_request.h124
1 files changed, 87 insertions, 37 deletions
diff --git a/contrib/ntp/include/ntp_request.h b/contrib/ntp/include/ntp_request.h
index 9e76df5..8166a4d 100644
--- a/contrib/ntp/include/ntp_request.h
+++ b/contrib/ntp/include/ntp_request.h
@@ -2,6 +2,9 @@
* ntp_request.h - definitions for the ntpd remote query facility
*/
+#ifndef _NTP_REQUEST_H
+#define _NTP_REQUEST_H
+
#include "ntp_types.h"
/*
@@ -111,10 +114,6 @@
/*
* A request packet. These are almost a fixed length.
*/
-
-#define MAXFILENAME 128 /* max key file name length */
- /* NOTE: also in ntp.h */
-
struct req_pkt {
u_char rm_vn_mode; /* response, more, version, mode */
u_char auth_seq; /* key, sequence number */
@@ -122,7 +121,8 @@ struct req_pkt {
u_char request; /* request number */
u_short err_nitems; /* error code/number of data items */
u_short mbz_itemsize; /* item size */
- char data[MAXFILENAME + 16]; /* data area [32 prev](144 byte max) */
+ char data[MAXFILENAME + 48]; /* data area [32 prev](176 byte max) */
+ /* struct conf_peer must fit */
l_fp tstamp; /* time stamp, for authentication */
keyid_t keyid; /* encryption key */
char mac[MAX_MAC_LEN-sizeof(u_int32)]; /* (optional) 8 byte auth code */
@@ -207,7 +207,7 @@ struct resp_pkt {
|((u_short)(nitems)&0xfff))))
#define INFO_MBZ(mbz_itemsize) ((ntohs(mbz_itemsize)>>12)&0xf)
-#define INFO_ITEMSIZE(mbz_itemsize) (ntohs(mbz_itemsize)&0xfff)
+#define INFO_ITEMSIZE(mbz_itemsize) ((u_short)(ntohs(mbz_itemsize)&0xfff))
#define MBZ_ITEMSIZE(itemsize) (htons((u_short)(itemsize)))
@@ -215,7 +215,8 @@ struct resp_pkt {
* Implementation numbers. One for universal use and one for ntpd.
*/
#define IMPL_UNIV 0
-#define IMPL_XNTPD 2
+#define IMPL_XNTPD_OLD 2 /* Used by pre ipv6 ntpdc */
+#define IMPL_XNTPD 3 /* Used by post ipv6 ntpdc */
/*
* Some limits related to authentication. Frames which are
@@ -275,6 +276,9 @@ struct resp_pkt {
#define REQ_MON_GETLIST_1 42 /* return collected v1 monitor data */
#define REQ_HOSTNAME_ASSOCID 43 /* Here is a hostname + assoc_id */
+/* Determine size of pre-v6 version of structures */
+#define v4sizeof(type) offsetof(type, v6_flag)
+
/*
* Flags in the peer information returns
*/
@@ -305,10 +309,13 @@ struct resp_pkt {
* Well, it *would* have gone without saying, but somebody said it.
*/
struct info_peer_list {
- u_int32 address; /* address of peer */
+ u_int32 addr; /* address of peer */
u_short port; /* port number of peer */
u_char hmode; /* mode for this peer */
u_char flags; /* flags (from above) */
+ u_int v6_flag; /* is this v6 or not */
+ u_int unused1; /* (unused) padding for addr6 */
+ struct in6_addr addr6; /* v6 address of peer */
};
@@ -328,6 +335,10 @@ struct info_peer_summary {
s_fp delay; /* peer.estdelay */
l_fp offset; /* peer.estoffset */
u_fp dispersion; /* peer.estdisp */
+ u_int v6_flag; /* is this v6 or not */
+ u_int unused1; /* (unused) padding for dstadr6 */
+ struct in6_addr dstadr6; /* local address (v6) */
+ struct in6_addr srcadr6; /* source address (v6) */
};
@@ -336,7 +347,7 @@ struct info_peer_summary {
*/
struct info_peer {
u_int32 dstadr; /* local address */
- u_int32 srcadr; /* remote address */
+ u_int32 srcadr; /* source address */
u_short srcport; /* remote port */
u_char flags; /* peer flags */
u_char leap; /* peer.leap */
@@ -379,6 +390,10 @@ struct info_peer {
int32 unused6;
int32 unused7;
s_fp estbdelay; /* broadcast offset */
+ u_int v6_flag; /* is this v6 or not */
+ u_int unused9; /* (unused) padding for dstadr6 */
+ struct in6_addr dstadr6; /* local address (v6-like) */
+ struct in6_addr srcadr6; /* sources address (v6-like) */
};
@@ -410,6 +425,10 @@ struct info_peer_stats {
u_char unused6; /* (unused) */
u_char unused7; /* (unused) */
u_char unused8; /* (unused) */
+ u_int v6_flag; /* is this v6 or not */
+ u_int unused9; /* (unused) padding for dstadr6 */
+ struct in6_addr dstadr6; /* local address */
+ struct in6_addr srcadr6; /* remote address */
};
@@ -429,7 +448,7 @@ struct info_loop {
* the implementation.
*/
struct info_sys {
- u_int32 peer; /* system peer address */
+ u_int32 peer; /* system peer address (v4) */
u_char peer_mode; /* mode we are syncing to peer in */
u_char leap; /* system leap bits */
u_char stratum; /* our stratum */
@@ -447,6 +466,9 @@ struct info_sys {
s_fp frequency; /* frequency residual (scaled ppm) */
l_fp authdelay; /* default authentication delay */
u_fp stability; /* clock stability (scaled ppm) */
+ u_int v6_flag; /* is this v6 or not */
+ u_int unused4; /* unused, padding for peer6 */
+ struct in6_addr peer6; /* system peer address (v6) */
};
@@ -454,17 +476,17 @@ struct info_sys {
* System stats. These are collected in the protocol module
*/
struct info_sys_stats {
- u_int32 timeup; /* time we have been up and running */
- u_int32 timereset; /* time since these were last cleared */
- u_int32 badstratum; /* packets claiming an invalid stratum */
- u_int32 oldversionpkt; /* old version packets received */
- u_int32 newversionpkt; /* new version packets received */
- u_int32 unknownversion; /* don't know version packets */
- u_int32 badlength; /* packets with bad length */
+ u_int32 timeup; /* time since restart */
+ u_int32 timereset; /* time since reset */
+ u_int32 denied; /* access denied */
+ u_int32 oldversionpkt; /* recent version */
+ u_int32 newversionpkt; /* current version */
+ u_int32 unknownversion; /* bad version */
+ u_int32 badlength; /* bad length or format */
u_int32 processed; /* packets processed */
- u_int32 badauth; /* packets dropped because of authorization */
- u_int32 wanderhold; /* (obsolete) */
- u_int32 limitrejected; /* rejected because of client limitation */
+ u_int32 badauth; /* bad authentication */
+ u_int32 received; /* packets received */
+ u_int32 limitrejected; /* rate exceeded */
};
@@ -472,16 +494,16 @@ struct info_sys_stats {
* System stats - old version
*/
struct old_info_sys_stats {
- u_int32 timeup; /* time we have been up and running */
- u_int32 timereset; /* time since these were last cleared */
- u_int32 badstratum; /* packets claiming an invalid stratum */
- u_int32 oldversionpkt; /* old version packets received */
- u_int32 newversionpkt; /* new version packets received */
- u_int32 unknownversion; /* don't know version packets */
- u_int32 badlength; /* packets with bad length */
+ u_int32 timeup; /* time since restart */
+ u_int32 timereset; /* time since reset */
+ u_int32 denied; /* access denied */
+ u_int32 oldversionpkt; /* recent version */
+ u_int32 newversionpkt; /* current version */
+ u_int32 unknownversion; /* bad version */
+ u_int32 badlength; /* bad length or format */
u_int32 processed; /* packets processed */
- u_int32 badauth; /* packets dropped because of authorization */
- u_int32 wanderhold;
+ u_int32 badauth; /* bad authentication */
+ u_int32 wanderhold; /* (not used) */
};
@@ -552,9 +574,12 @@ struct conf_peer {
u_char maxpoll; /* max host poll interval */
u_char flags; /* flags for this request */
u_char ttl; /* time to live (multicast) or refclock mode */
- u_short unused; /* unused */
+ u_short unused1; /* unused */
keyid_t keyid; /* key to use for this association */
char keystr[MAXFILENAME]; /* public key file name*/
+ u_int v6_flag; /* is this v6 or not */
+ u_int unused2; /* unused, padding for peeraddr6 */
+ struct in6_addr peeraddr6; /* ipv6 address to poll */
};
#define CONF_FLAG_AUTHENABLE 0x01
@@ -570,7 +595,9 @@ struct conf_peer {
* this addess.
*/
struct conf_unpeer {
- u_int32 peeraddr; /* address of peer */
+ u_int32 peeraddr; /* address of peer */
+ u_int v6_flag; /* is this v6 or not */
+ struct in6_addr peeraddr6; /* address of peer (v6) */
};
/*
@@ -601,6 +628,10 @@ struct info_restrict {
u_int32 count; /* number of packets matched */
u_short flags; /* restrict flags */
u_short mflags; /* match flags */
+ u_int v6_flag; /* is this v6 or not */
+ u_int unused1; /* unused, padding for addr6 */
+ struct in6_addr addr6; /* match address (v6) */
+ struct in6_addr mask6; /* match mask (v6) */
};
@@ -608,10 +639,13 @@ struct info_restrict {
* Structure used for specifying restrict entries
*/
struct conf_restrict {
- u_int32 addr; /* match address */
+ u_int32 addr; /* match address */
u_int32 mask; /* match mask */
u_short flags; /* restrict flags */
u_short mflags; /* match flags */
+ u_int v6_flag; /* is this v6 or not */
+ struct in6_addr addr6; /* match address (v6) */
+ struct in6_addr mask6; /* match mask (v6) */
};
@@ -623,12 +657,16 @@ struct info_monitor_1 {
u_int32 firsttime; /* first time we received a packet */
u_int32 lastdrop; /* last time we rejected a packet due to client limitation policy */
u_int32 count; /* count of packets received */
- u_int32 addr; /* host address */
+ u_int32 addr; /* host address V4 style */
u_int32 daddr; /* destination host address */
u_int32 flags; /* flags about destination */
u_short port; /* port number of last reception */
u_char mode; /* mode of last packet */
u_char version; /* version number of last packet */
+ u_int v6_flag; /* is this v6 or not */
+ u_int unused1; /* unused, padding for addr6 */
+ struct in6_addr addr6; /* host address V6 style */
+ struct in6_addr daddr6; /* host address V6 style */
};
@@ -644,6 +682,9 @@ struct info_monitor {
u_short port; /* port number of last reception */
u_char mode; /* mode of last packet */
u_char version; /* version number of last packet */
+ u_int v6_flag; /* is this v6 or not */
+ u_int unused1; /* unused, padding for addr6 */
+ struct in6_addr addr6; /* host v6 address */
};
/*
@@ -657,6 +698,8 @@ struct old_info_monitor {
u_short port; /* port number of last reception */
u_char mode; /* mode of last packet */
u_char version; /* version number of last packet */
+ u_int v6_flag; /* is this v6 or not */
+ struct in6_addr addr6; /* host address (v6)*/
};
/*
@@ -699,24 +742,30 @@ struct info_auth {
* Structure used to pass trap information to the client
*/
struct info_trap {
- u_int32 local_address; /* local interface address */
- u_int32 trap_address; /* remote client's address */
+ u_int32 local_address; /* local interface addres (v4) */
+ u_int32 trap_address; /* remote client's addres (v4) */
u_short trap_port; /* remote port number */
u_short sequence; /* sequence number */
u_int32 settime; /* time trap last set */
u_int32 origtime; /* time trap originally set */
u_int32 resets; /* number of resets on this trap */
u_int32 flags; /* trap flags, as defined in ntp_control.h */
+ u_int v6_flag; /* is this v6 or not */
+ struct in6_addr local_address6; /* local interface address (v6) */
+ struct in6_addr trap_address6; /* remote client's address (v6) */
};
/*
* Structure used to pass add/clear trap information to the client
*/
struct conf_trap {
- u_int32 local_address; /* local interface address */
- u_int32 trap_address; /* remote client's address */
+ u_int32 local_address; /* remote client's address */
+ u_int32 trap_address; /* local interface address */
u_short trap_port; /* remote client's port */
u_short unused; /* (unused) */
+ u_int v6_flag; /* is this v6 or not */
+ struct in6_addr local_address6; /* local interface address (v6) */
+ struct in6_addr trap_address6; /* remote client's address (v6) */
};
@@ -832,3 +881,4 @@ struct info_dns_assoc {
associd_t associd; /* association ID */
char hostname[NTP_MAXHOSTNAME]; /* hostname */
};
+#endif /* NTP_REQUEST_H */
OpenPOWER on IntegriCloud