]>
Commit | Line | Data |
---|---|---|
88840341 | 1 | /* |
88840341 RC |
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., | |
8e23110a | 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
88840341 RC |
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" | |
8265ff28 | 31 | #include "addressing.h" |
10719d6d | 32 | #include "ntp.h" |
88840341 | 33 | |
88840341 | 34 | typedef struct { |
8265ff28 | 35 | IPAddr ip_addr; |
88840341 RC |
36 | int stratum; |
37 | int poll; | |
38 | enum {RPT_NTP_CLIENT, RPT_NTP_PEER, RPT_LOCAL_REFERENCE} mode; | |
83ea9fe2 ML |
39 | enum { |
40 | RPT_NONSELECTABLE, | |
41 | RPT_FALSETICKER, | |
42 | RPT_JITTERY, | |
43 | RPT_SELECTABLE, | |
44 | RPT_UNSELECTED, | |
45 | RPT_SELECTED, | |
46 | } state; | |
88840341 | 47 | |
19b3c5be | 48 | int reachability; |
88840341 | 49 | unsigned long latest_meas_ago; /* seconds */ |
2dd9f337 ML |
50 | double orig_latest_meas; /* seconds */ |
51 | double latest_meas; /* seconds */ | |
52 | double latest_meas_err; /* seconds */ | |
88840341 RC |
53 | } RPT_SourceReport ; |
54 | ||
55 | typedef struct { | |
91279a0f | 56 | uint32_t ref_id; |
1570f97e | 57 | IPAddr ip_addr; |
10719d6d ML |
58 | int stratum; |
59 | NTP_Leap leap_status; | |
d0dfa1de | 60 | struct timespec ref_time; |
2dd9f337 | 61 | double current_correction; |
19b3c5be ML |
62 | double last_offset; |
63 | double rms_offset; | |
88840341 RC |
64 | double freq_ppm; |
65 | double resid_freq_ppm; | |
66 | double skew_ppm; | |
67 | double root_delay; | |
68 | double root_dispersion; | |
19b3c5be | 69 | double last_update_interval; |
88840341 RC |
70 | } RPT_TrackingReport; |
71 | ||
72 | typedef struct { | |
91279a0f | 73 | uint32_t ref_id; |
8265ff28 | 74 | IPAddr ip_addr; |
88840341 RC |
75 | unsigned long n_samples; |
76 | unsigned long n_runs; | |
77 | unsigned long span_seconds; | |
78 | double resid_freq_ppm; | |
79 | double skew_ppm; | |
2dd9f337 | 80 | double sd; |
b32432c2 ML |
81 | double est_offset; |
82 | double est_offset_err; | |
88840341 RC |
83 | } RPT_SourcestatsReport; |
84 | ||
85 | typedef struct { | |
d0dfa1de | 86 | struct timespec ref_time; |
f9e2a585 ML |
87 | unsigned long n_samples; |
88 | unsigned long n_runs; | |
88840341 RC |
89 | unsigned long span_seconds; |
90 | double rtc_seconds_fast; | |
91 | double rtc_gain_rate_ppm; | |
92 | } RPT_RTC_Report; | |
93 | ||
88840341 | 94 | typedef struct { |
8265ff28 | 95 | IPAddr ip_addr; |
657929f8 | 96 | uint32_t ntp_hits; |
ab54f76a | 97 | uint32_t nke_hits; |
657929f8 ML |
98 | uint32_t cmd_hits; |
99 | uint16_t ntp_drops; | |
ab54f76a | 100 | uint16_t nke_drops; |
657929f8 ML |
101 | uint16_t cmd_drops; |
102 | int8_t ntp_interval; | |
ab54f76a | 103 | int8_t nke_interval; |
657929f8 ML |
104 | int8_t cmd_interval; |
105 | int8_t ntp_timeout_interval; | |
106 | uint32_t last_ntp_hit_ago; | |
ab54f76a | 107 | uint32_t last_nke_hit_ago; |
657929f8 | 108 | uint32_t last_cmd_hit_ago; |
88840341 RC |
109 | } RPT_ClientAccessByIndex_Report; |
110 | ||
9b019a03 ML |
111 | typedef struct { |
112 | uint32_t ntp_hits; | |
ab54f76a | 113 | uint32_t nke_hits; |
9b019a03 ML |
114 | uint32_t cmd_hits; |
115 | uint32_t ntp_drops; | |
ab54f76a | 116 | uint32_t nke_drops; |
9b019a03 ML |
117 | uint32_t cmd_drops; |
118 | uint32_t log_drops; | |
ab54f76a | 119 | uint32_t ntp_auth_hits; |
9b019a03 ML |
120 | } RPT_ServerStatsReport; |
121 | ||
88840341 | 122 | typedef struct { |
d0dfa1de | 123 | struct timespec when; |
88840341 RC |
124 | double slewed_offset; |
125 | double orig_offset; | |
126 | double residual; | |
127 | } RPT_ManualSamplesReport; | |
128 | ||
129 | typedef struct { | |
130 | int online; | |
131 | int offline; | |
132 | int burst_online; | |
133 | int burst_offline; | |
19b3c5be | 134 | int unresolved; |
88840341 RC |
135 | } RPT_ActivityReport; |
136 | ||
fb9c2c7d ML |
137 | typedef struct { |
138 | int active; | |
139 | int leap_only; | |
140 | double offset; | |
141 | double freq_ppm; | |
142 | double wander_ppm; | |
143 | double last_update_ago; | |
144 | double remaining_time; | |
145 | } RPT_SmoothingReport; | |
146 | ||
535ca64b ML |
147 | typedef struct { |
148 | IPAddr remote_addr; | |
149 | IPAddr local_addr; | |
150 | uint16_t remote_port; | |
151 | uint8_t leap; | |
152 | uint8_t version; | |
153 | uint8_t mode; | |
154 | uint8_t stratum; | |
155 | int8_t poll; | |
156 | int8_t precision; | |
157 | double root_delay; | |
158 | double root_dispersion; | |
159 | uint32_t ref_id; | |
160 | struct timespec ref_time; | |
161 | double offset; | |
162 | double peer_delay; | |
163 | double peer_dispersion; | |
164 | double response_time; | |
165 | double jitter_asymmetry; | |
166 | uint16_t tests; | |
167 | int interleaved; | |
168 | int authenticated; | |
169 | char tx_tss_char; | |
170 | char rx_tss_char; | |
171 | uint32_t total_tx_count; | |
172 | uint32_t total_rx_count; | |
173 | uint32_t total_valid_count; | |
174 | } RPT_NTPReport; | |
175 | ||
79c7384e ML |
176 | typedef struct { |
177 | NTP_AuthMode mode; | |
178 | uint32_t key_id; | |
179 | int key_type; | |
180 | int key_length; | |
181 | int ke_attempts; | |
182 | uint32_t last_ke_ago; | |
183 | int cookies; | |
51fe589a | 184 | int cookie_length; |
79c7384e ML |
185 | int nak; |
186 | } RPT_AuthReport; | |
187 | ||
03541f36 ML |
188 | typedef struct { |
189 | uint32_t ref_id; | |
190 | IPAddr ip_addr; | |
191 | char state_char; | |
192 | int authentication; | |
698f270b | 193 | NTP_Leap leap; |
03541f36 ML |
194 | int conf_options; |
195 | int eff_options; | |
196 | uint32_t last_sample_ago; | |
197 | double score; | |
198 | double lo_limit; | |
199 | double hi_limit; | |
200 | } RPT_SelectReport; | |
201 | ||
88840341 | 202 | #endif /* GOT_REPORTS_H */ |