]> git.ipfire.org Git - thirdparty/chrony.git/blob - reports.h
logging: move severity_chars to fix compiler warning
[thirdparty/chrony.git] / reports.h
1 /*
2 chronyd/chronyc - Programs for keeping computer clocks accurate.
3
4 **********************************************************************
5 * Copyright (C) Richard P. Curnow 1997-2002
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of version 2 of the GNU General Public License as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 *
20 **********************************************************************
21
22 =======================================================================
23
24 Data structure definitions within the daemon for various reports that
25 can be generated */
26
27 #ifndef GOT_REPORTS_H
28 #define GOT_REPORTS_H
29
30 #include "sysincl.h"
31 #include "addressing.h"
32 #include "ntp.h"
33
34 typedef struct {
35 IPAddr ip_addr;
36 int stratum;
37 int poll;
38 enum {RPT_NTP_CLIENT, RPT_NTP_PEER, RPT_LOCAL_REFERENCE} mode;
39 enum {
40 RPT_NONSELECTABLE,
41 RPT_FALSETICKER,
42 RPT_JITTERY,
43 RPT_SELECTABLE,
44 RPT_UNSELECTED,
45 RPT_SELECTED,
46 } state;
47
48 int reachability;
49 unsigned long latest_meas_ago; /* seconds */
50 double orig_latest_meas; /* seconds */
51 double latest_meas; /* seconds */
52 double latest_meas_err; /* seconds */
53 } RPT_SourceReport ;
54
55 typedef struct {
56 uint32_t ref_id;
57 IPAddr ip_addr;
58 int stratum;
59 NTP_Leap leap_status;
60 struct timespec ref_time;
61 double current_correction;
62 double last_offset;
63 double rms_offset;
64 double freq_ppm;
65 double resid_freq_ppm;
66 double skew_ppm;
67 double root_delay;
68 double root_dispersion;
69 double last_update_interval;
70 } RPT_TrackingReport;
71
72 typedef struct {
73 uint32_t ref_id;
74 IPAddr ip_addr;
75 unsigned long n_samples;
76 unsigned long n_runs;
77 unsigned long span_seconds;
78 double resid_freq_ppm;
79 double skew_ppm;
80 double sd;
81 double est_offset;
82 double est_offset_err;
83 } RPT_SourcestatsReport;
84
85 typedef struct {
86 struct timespec ref_time;
87 unsigned long n_samples;
88 unsigned long n_runs;
89 unsigned long span_seconds;
90 double rtc_seconds_fast;
91 double rtc_gain_rate_ppm;
92 } RPT_RTC_Report;
93
94 typedef struct {
95 IPAddr ip_addr;
96 uint32_t ntp_hits;
97 uint32_t nke_hits;
98 uint32_t cmd_hits;
99 uint16_t ntp_drops;
100 uint16_t nke_drops;
101 uint16_t cmd_drops;
102 int8_t ntp_interval;
103 int8_t nke_interval;
104 int8_t cmd_interval;
105 int8_t ntp_timeout_interval;
106 uint32_t last_ntp_hit_ago;
107 uint32_t last_nke_hit_ago;
108 uint32_t last_cmd_hit_ago;
109 } RPT_ClientAccessByIndex_Report;
110
111 typedef struct {
112 uint64_t ntp_hits;
113 uint64_t nke_hits;
114 uint64_t cmd_hits;
115 uint64_t ntp_drops;
116 uint64_t nke_drops;
117 uint64_t cmd_drops;
118 uint64_t log_drops;
119 uint64_t ntp_auth_hits;
120 uint64_t ntp_interleaved_hits;
121 uint64_t ntp_timestamps;
122 uint64_t ntp_span_seconds;
123 uint64_t ntp_daemon_rx_timestamps;
124 uint64_t ntp_daemon_tx_timestamps;
125 uint64_t ntp_kernel_rx_timestamps;
126 uint64_t ntp_kernel_tx_timestamps;
127 uint64_t ntp_hw_rx_timestamps;
128 uint64_t ntp_hw_tx_timestamps;
129 } RPT_ServerStatsReport;
130
131 typedef struct {
132 struct timespec when;
133 double slewed_offset;
134 double orig_offset;
135 double residual;
136 } RPT_ManualSamplesReport;
137
138 typedef struct {
139 int online;
140 int offline;
141 int burst_online;
142 int burst_offline;
143 int unresolved;
144 } RPT_ActivityReport;
145
146 typedef struct {
147 int active;
148 int leap_only;
149 double offset;
150 double freq_ppm;
151 double wander_ppm;
152 double last_update_ago;
153 double remaining_time;
154 } RPT_SmoothingReport;
155
156 typedef struct {
157 IPAddr remote_addr;
158 IPAddr local_addr;
159 uint16_t remote_port;
160 uint8_t leap;
161 uint8_t version;
162 uint8_t mode;
163 uint8_t stratum;
164 int8_t poll;
165 int8_t precision;
166 double root_delay;
167 double root_dispersion;
168 uint32_t ref_id;
169 struct timespec ref_time;
170 double offset;
171 double peer_delay;
172 double peer_dispersion;
173 double response_time;
174 double jitter_asymmetry;
175 uint16_t tests;
176 int interleaved;
177 int authenticated;
178 char tx_tss_char;
179 char rx_tss_char;
180 uint32_t total_tx_count;
181 uint32_t total_rx_count;
182 uint32_t total_valid_count;
183 uint32_t total_good_count;
184 } RPT_NTPReport;
185
186 typedef struct {
187 NTP_AuthMode mode;
188 uint32_t key_id;
189 int key_type;
190 int key_length;
191 int ke_attempts;
192 uint32_t last_ke_ago;
193 int cookies;
194 int cookie_length;
195 int nak;
196 } RPT_AuthReport;
197
198 typedef struct {
199 uint32_t ref_id;
200 IPAddr ip_addr;
201 char state_char;
202 int authentication;
203 NTP_Leap leap;
204 int conf_options;
205 int eff_options;
206 uint32_t last_sample_ago;
207 double score;
208 double lo_limit;
209 double hi_limit;
210 } RPT_SelectReport;
211
212 #endif /* GOT_REPORTS_H */