uint8_t ip6[16];
} addr;
uint16_t f_family;
+ uint16_t padding;
} tChrony_IPAddr;
typedef struct ATTRIB_PACKED {
tChrony_IPAddr addr;
- uint16_t
- dummy; /* FIXME: Strange dummy space. Needed on gcc 4.8.3/clang 3.4.1 on
- x86_64 */
int16_t f_poll; /* 2^f_poll = Time between polls (s) */
uint16_t f_stratum; /* Remote clock stratum */
uint16_t f_state; /* 0 = RPY_SD_ST_SYNC, 1 = RPY_SD_ST_UNREACH, 2 =
typedef struct ATTRIB_PACKED {
uint32_t f_ref_id;
tChrony_IPAddr addr;
- uint16_t
- dummy; /* FIXME: Strange dummy space. Needed on gcc 4.8.3/clang 3.4.1 on
- x86_64 */
uint32_t f_n_samples; /* Number of measurements done */
uint32_t f_n_runs; /* How many measurements to come */
uint32_t f_span_seconds; /* For how long we're measuring */
typedef struct ATTRIB_PACKED {
uint32_t f_ref_id;
tChrony_IPAddr addr;
- uint16_t
- dummy; /* FIXME: Strange dummy space. Needed on gcc 4.8.3/clang 3.4.1 on
- x86_64 */
uint16_t f_stratum;
uint16_t f_leap_status;
tTimeval f_ref_time;
}
static void nreftostr(uint32_t nrefid, char *p_buf, size_t p_buf_size) {
- int i, j, c;
+ size_t j = 0;
- for (i = j = 0; i < 4; i++) {
- c = ntohl(nrefid) << i * 8 >> 24;
+ for (int i = 0; i < 4; i++) {
+ int c = ntohl(nrefid) << i * 8 >> 24;
if (!isalnum(c) || j + 1 >= p_buf_size)
continue;
p_buf[j++] = c;
ntohs(chrony_resp.body.source_data.f_reachability));
chrony_push_data_valid("clock_last_meas", src_addr, is_reachable,
ntohl(chrony_resp.body.source_data.f_since_sample));
+ chrony_push_data_valid(
+ "time_offset", src_addr, is_reachable,
+ ntohf(chrony_resp.body.source_data.f_origin_latest_meas));
return CHRONY_RC_OK;
}
size_t chrony_resp_size;
tChrony_Request chrony_req;
tChrony_Response chrony_resp;
- double skew_ppm, frequency_error, time_offset;
+ double skew_ppm, frequency_error;
if (*p_is_reachable == 0) {
skew_ppm = 0;
frequency_error = 0;
- time_offset = 0;
} else {
chrony_init_req(&chrony_req);
chrony_req.body.source_stats.f_index = htonl(p_src_idx);
skew_ppm = ntohf(chrony_resp.body.source_stats.f_skew_ppm);
frequency_error = ntohf(chrony_resp.body.source_stats.f_rtc_gain_rate_ppm);
- time_offset = ntohf(chrony_resp.body.source_stats.f_est_offset);
DEBUG(PLUGIN_NAME
": Source[%d] stat: .addr = %s, .ref_id= %u, .n_samples = %u, "
ntohl(chrony_resp.body.source_stats.f_n_runs),
ntohl(chrony_resp.body.source_stats.f_span_seconds),
ntohf(chrony_resp.body.source_stats.f_rtc_seconds_fast),
- frequency_error, skew_ppm, time_offset,
+ frequency_error, skew_ppm,
+ ntohf(chrony_resp.body.source_stats.f_est_offset),
ntohf(chrony_resp.body.source_stats.f_est_offset_err));
} /* if (*is_reachable) */
chrony_push_data_valid("clock_skew_ppm", src_addr, *p_is_reachable, skew_ppm);
chrony_push_data_valid("frequency_error", src_addr, *p_is_reachable,
frequency_error); /* unit: ppm */
- chrony_push_data_valid("time_offset", src_addr, *p_is_reachable,
- time_offset); /* unit: s */
return CHRONY_RC_OK;
}