diff options
author | Joachim Wiedorn <ad_debian@joonet.de> | 2013-11-22 20:17:58 +0100 |
---|---|---|
committer | Joachim Wiedorn <ad_debian@joonet.de> | 2013-11-22 20:17:58 +0100 |
commit | a160a2e093a8079fa72908b58087d2e227709c3e (patch) | |
tree | 3e82a32b0ac0e476e9b7baff5da7d2c09038e2f9 /candm.h | |
parent | c98446b75a1624e5b8cebf601ac4ed6e516b5e26 (diff) |
Imported Upstream version 1.29
Diffstat (limited to 'candm.h')
-rw-r--r-- | candm.h | 57 |
1 files changed, 25 insertions, 32 deletions
@@ -31,6 +31,7 @@ #include "sysincl.h" #include "addressing.h" +#include "hash.h" /* This is the default port to use for CANDM, if no alternative is defined */ @@ -297,23 +298,11 @@ typedef struct { uint32_t bits_specd; } REQ_SubnetsAccessed_Subnet; -#define MAX_SUBNETS_ACCESSED 8 - -typedef struct { - uint32_t n_subnets; - REQ_SubnetsAccessed_Subnet subnets[MAX_SUBNETS_ACCESSED]; -} REQ_SubnetsAccessed; - /* This is based on the response size rather than the request size */ #define MAX_CLIENT_ACCESSES 8 typedef struct { - uint32_t n_clients; - IPAddr client_ips[MAX_CLIENT_ACCESSES]; -} REQ_ClientAccesses; - -typedef struct { uint32_t first_index; uint32_t n_indices; int32_t EOR; @@ -368,9 +357,12 @@ typedef struct { and used also instead of integer microseconds, new commands: modify stratum, modify polltarget, modify maxdelaydevratio, reselect, reselectdistance + Version 5 : auth data moved to the end of the packet to allow hashes with + different sizes, extended sources, tracking and activity reports, dropped + subnets accessed and client accesses */ -#define PROTO_VERSION_NUMBER 4 +#define PROTO_VERSION_NUMBER 5 /* The oldest protocol version that is compatible enough with the current version to report a version mismatch */ @@ -390,7 +382,6 @@ typedef struct { uint32_t sequence; /* Client's sequence number */ uint32_t utoken; /* Unique token per incarnation of daemon */ uint32_t token; /* Command token (to prevent replay attack) */ - uint32_t auth[4]; /* MD5 authentication of the packet */ union { REQ_Online online; @@ -424,8 +415,6 @@ typedef struct { REQ_RTCReport rtcreport; REQ_TrimRTC trimrtc; REQ_CycleLogs cyclelogs; - REQ_SubnetsAccessed subnets_accessed; - REQ_ClientAccesses client_accesses; REQ_ClientAccessesByIndex client_accesses_by_index; REQ_ManualList manual_list; REQ_ManualDelete manual_delete; @@ -435,6 +424,10 @@ typedef struct { REQ_ReselectDistance reselect_distance; } data; /* Command specific parameters */ + /* authentication of the packet, there is no hole after the actual data + from the data union, this field only sets the maximum auth size */ + uint8_t auth[MAX_HASH_LENGTH]; + } CMD_Request; /* ================================================== */ @@ -501,7 +494,10 @@ typedef struct { #define RPY_SD_ST_FALSETICKER 2 #define RPY_SD_ST_JITTERY 3 #define RPY_SD_ST_CANDIDATE 4 -#define RPY_SD_ST_OUTLYER 5 +#define RPY_SD_ST_OUTLIER 5 + +#define RPY_SD_FLAG_NOSELECT 0x1 +#define RPY_SD_FLAG_PREFER 0x2 typedef struct { IPAddr ip_addr; @@ -509,6 +505,8 @@ typedef struct { uint16_t stratum; uint16_t state; uint16_t mode; + uint16_t flags; + uint16_t reachability; uint32_t since_sample; Float orig_latest_meas; Float latest_meas; @@ -519,14 +517,18 @@ typedef struct { typedef struct { uint32_t ref_id; IPAddr ip_addr; - uint32_t stratum; + uint16_t stratum; + uint16_t leap_status; Timeval ref_time; Float current_correction; + Float last_offset; + Float rms_offset; Float freq_ppm; Float resid_freq_ppm; Float skew_ppm; Float root_delay; Float root_dispersion; + Float last_update_interval; int32_t EOR; } RPY_Tracking; @@ -568,11 +570,6 @@ typedef struct { } RPY_SubnetsAccessed_Subnet; typedef struct { - uint32_t n_subnets; - RPY_SubnetsAccessed_Subnet subnets[MAX_SUBNETS_ACCESSED]; -} RPY_SubnetsAccessed; - -typedef struct { IPAddr ip; uint32_t client_hits; uint32_t peer_hits; @@ -584,11 +581,6 @@ typedef struct { } RPY_ClientAccesses_Client; typedef struct { - uint32_t n_clients; - RPY_ClientAccesses_Client clients[MAX_CLIENT_ACCESSES]; -} RPY_ClientAccesses; - -typedef struct { uint32_t n_indices; /* how many indices there are in the server's table */ uint32_t next_index; /* the index 1 beyond those processed on this call */ uint32_t n_clients; /* the number of valid entries in the following array */ @@ -614,6 +606,7 @@ typedef struct { int32_t offline; int32_t burst_online; int32_t burst_offline; + int32_t unresolved; int32_t EOR; } RPY_Activity; @@ -632,8 +625,6 @@ typedef struct { uint32_t utoken; /* Unique token per incarnation of daemon */ uint32_t token; /* New command token (only if command was successfully authenticated) */ - uint32_t auth[4]; /* MD5 authentication of the packet */ - union { RPY_Null null; RPY_N_Sources n_sources; @@ -642,13 +633,15 @@ typedef struct { RPY_Tracking tracking; RPY_Sourcestats sourcestats; RPY_Rtc rtc; - RPY_SubnetsAccessed subnets_accessed; - RPY_ClientAccesses client_accesses; RPY_ClientAccessesByIndex client_accesses_by_index; RPY_ManualList manual_list; RPY_Activity activity; } data; /* Reply specific parameters */ + /* authentication of the packet, there is no hole after the actual data + from the data union, this field only sets the maximum auth size */ + uint8_t auth[MAX_HASH_LENGTH]; + } CMD_Reply; /* ================================================== */ |