]> git.ipfire.org Git - thirdparty/chrony.git/blob - candm.h
cmdmon: limit reported clients by number of packets
[thirdparty/chrony.git] / candm.h
1 /*
2 chronyd/chronyc - Programs for keeping computer clocks accurate.
3
4 **********************************************************************
5 * Copyright (C) Richard P. Curnow 1997-2003
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 Definitions for the network protocol used for command and monitoring
25 of the timeserver.
26
27 */
28
29 #ifndef GOT_CANDM_H
30 #define GOT_CANDM_H
31
32 #include "sysincl.h"
33 #include "addressing.h"
34
35 /* This is the default port to use for CANDM, if no alternative is
36 defined */
37 #define DEFAULT_CANDM_PORT 323
38
39 /* Request codes */
40 #define REQ_NULL 0
41 #define REQ_ONLINE 1
42 #define REQ_OFFLINE 2
43 #define REQ_BURST 3
44 #define REQ_MODIFY_MINPOLL 4
45 #define REQ_MODIFY_MAXPOLL 5
46 #define REQ_DUMP 6
47 #define REQ_MODIFY_MAXDELAY 7
48 #define REQ_MODIFY_MAXDELAYRATIO 8
49 #define REQ_MODIFY_MAXUPDATESKEW 9
50 #define REQ_LOGON 10
51 #define REQ_SETTIME 11
52 #define REQ_LOCAL 12
53 #define REQ_MANUAL 13
54 #define REQ_N_SOURCES 14
55 #define REQ_SOURCE_DATA 15
56 #define REQ_REKEY 16
57 #define REQ_ALLOW 17
58 #define REQ_ALLOWALL 18
59 #define REQ_DENY 19
60 #define REQ_DENYALL 20
61 #define REQ_CMDALLOW 21
62 #define REQ_CMDALLOWALL 22
63 #define REQ_CMDDENY 23
64 #define REQ_CMDDENYALL 24
65 #define REQ_ACCHECK 25
66 #define REQ_CMDACCHECK 26
67 #define REQ_ADD_SERVER 27
68 #define REQ_ADD_PEER 28
69 #define REQ_DEL_SOURCE 29
70 #define REQ_WRITERTC 30
71 #define REQ_DFREQ 31
72 #define REQ_DOFFSET 32
73 #define REQ_TRACKING 33
74 #define REQ_SOURCESTATS 34
75 #define REQ_RTCREPORT 35
76 #define REQ_TRIMRTC 36
77 #define REQ_CYCLELOGS 37
78 #define REQ_SUBNETS_ACCESSED 38
79 #define REQ_CLIENT_ACCESSES 39
80 #define REQ_CLIENT_ACCESSES_BY_INDEX 40
81 #define REQ_MANUAL_LIST 41
82 #define REQ_MANUAL_DELETE 42
83 #define REQ_MAKESTEP 43
84 #define REQ_ACTIVITY 44
85 #define REQ_MODIFY_MINSTRATUM 45
86 #define REQ_MODIFY_POLLTARGET 46
87 #define REQ_MODIFY_MAXDELAYDEVRATIO 47
88 #define REQ_RESELECT 48
89 #define REQ_RESELECTDISTANCE 49
90 #define REQ_MODIFY_MAKESTEP 50
91 #define REQ_SMOOTHING 51
92 #define REQ_SMOOTHTIME 52
93 #define REQ_REFRESH 53
94 #define REQ_SERVER_STATS 54
95 #define REQ_CLIENT_ACCESSES_BY_INDEX2 55
96 #define REQ_LOCAL2 56
97 #define REQ_NTP_DATA 57
98 #define REQ_ADD_SERVER2 58
99 #define REQ_ADD_PEER2 59
100 #define REQ_ADD_SERVER3 60
101 #define REQ_ADD_PEER3 61
102 #define REQ_SHUTDOWN 62
103 #define REQ_ONOFFLINE 63
104 #define REQ_ADD_SOURCE 64
105 #define REQ_NTP_SOURCE_NAME 65
106 #define REQ_RESET_SOURCES 66
107 #define REQ_AUTH_DATA 67
108 #define REQ_CLIENT_ACCESSES_BY_INDEX3 68
109 #define N_REQUEST_TYPES 69
110
111 /* Structure used to exchange timespecs independent of time_t size */
112 typedef struct {
113 uint32_t tv_sec_high;
114 uint32_t tv_sec_low;
115 uint32_t tv_nsec;
116 } Timespec;
117
118 /* This is used in tv_sec_high for 32-bit timestamps */
119 #define TV_NOHIGHSEC 0x7fffffff
120
121 /* 32-bit floating-point format consisting of 7-bit signed exponent
122 and 25-bit signed coefficient without hidden bit.
123 The result is calculated as: 2^(exp - 25) * coef */
124 typedef struct {
125 int32_t f;
126 } Float;
127
128 /* The EOR (end of record) fields are used by the offsetof operator in
129 pktlength.c, to get the number of bytes that ought to be
130 transmitted for each packet type. */
131
132 typedef struct {
133 int32_t EOR;
134 } REQ_Null;
135
136 typedef struct {
137 IPAddr mask;
138 IPAddr address;
139 int32_t EOR;
140 } REQ_Online;
141
142 typedef struct {
143 IPAddr mask;
144 IPAddr address;
145 int32_t EOR;
146 } REQ_Offline;
147
148 typedef struct {
149 IPAddr mask;
150 IPAddr address;
151 int32_t n_good_samples;
152 int32_t n_total_samples;
153 int32_t EOR;
154 } REQ_Burst;
155
156 typedef struct {
157 IPAddr address;
158 int32_t new_minpoll;
159 int32_t EOR;
160 } REQ_Modify_Minpoll;
161
162 typedef struct {
163 IPAddr address;
164 int32_t new_maxpoll;
165 int32_t EOR;
166 } REQ_Modify_Maxpoll;
167
168 typedef struct {
169 int32_t pad;
170 int32_t EOR;
171 } REQ_Dump;
172
173 typedef struct {
174 IPAddr address;
175 Float new_max_delay;
176 int32_t EOR;
177 } REQ_Modify_Maxdelay;
178
179 typedef struct {
180 IPAddr address;
181 Float new_max_delay_ratio;
182 int32_t EOR;
183 } REQ_Modify_Maxdelayratio;
184
185 typedef struct {
186 IPAddr address;
187 Float new_max_delay_dev_ratio;
188 int32_t EOR;
189 } REQ_Modify_Maxdelaydevratio;
190
191 typedef struct {
192 IPAddr address;
193 int32_t new_min_stratum;
194 int32_t EOR;
195 } REQ_Modify_Minstratum;
196
197 typedef struct {
198 IPAddr address;
199 int32_t new_poll_target;
200 int32_t EOR;
201 } REQ_Modify_Polltarget;
202
203 typedef struct {
204 Float new_max_update_skew;
205 int32_t EOR;
206 } REQ_Modify_Maxupdateskew;
207
208 typedef struct {
209 int32_t limit;
210 Float threshold;
211 int32_t EOR;
212 } REQ_Modify_Makestep;
213
214 typedef struct {
215 Timespec ts;
216 int32_t EOR;
217 } REQ_Logon;
218
219 typedef struct {
220 Timespec ts;
221 int32_t EOR;
222 } REQ_Settime;
223
224 typedef struct {
225 int32_t on_off;
226 int32_t stratum;
227 Float distance;
228 int32_t orphan;
229 int32_t EOR;
230 } REQ_Local;
231
232 typedef struct {
233 int32_t option;
234 int32_t EOR;
235 } REQ_Manual;
236
237 typedef struct {
238 int32_t index;
239 int32_t EOR;
240 } REQ_Source_Data;
241
242 typedef struct {
243 IPAddr ip;
244 int32_t subnet_bits;
245 int32_t EOR;
246 } REQ_Allow_Deny;
247
248 typedef struct {
249 IPAddr ip;
250 int32_t EOR;
251 } REQ_Ac_Check;
252
253 /* Source types in NTP source requests */
254 #define REQ_ADDSRC_SERVER 1
255 #define REQ_ADDSRC_PEER 2
256 #define REQ_ADDSRC_POOL 3
257
258 /* Flags used in NTP source requests */
259 #define REQ_ADDSRC_ONLINE 0x1
260 #define REQ_ADDSRC_AUTOOFFLINE 0x2
261 #define REQ_ADDSRC_IBURST 0x4
262 #define REQ_ADDSRC_PREFER 0x8
263 #define REQ_ADDSRC_NOSELECT 0x10
264 #define REQ_ADDSRC_TRUST 0x20
265 #define REQ_ADDSRC_REQUIRE 0x40
266 #define REQ_ADDSRC_INTERLEAVED 0x80
267 #define REQ_ADDSRC_BURST 0x100
268 #define REQ_ADDSRC_NTS 0x200
269
270 typedef struct {
271 uint32_t type;
272 int8_t name[256];
273 uint32_t port;
274 int32_t minpoll;
275 int32_t maxpoll;
276 int32_t presend_minpoll;
277 uint32_t min_stratum;
278 uint32_t poll_target;
279 uint32_t version;
280 uint32_t max_sources;
281 int32_t min_samples;
282 int32_t max_samples;
283 uint32_t authkey;
284 uint32_t nts_port;
285 Float max_delay;
286 Float max_delay_ratio;
287 Float max_delay_dev_ratio;
288 Float min_delay;
289 Float asymmetry;
290 Float offset;
291 uint32_t flags;
292 int32_t filter_length;
293 uint32_t reserved[3];
294 int32_t EOR;
295 } REQ_NTP_Source;
296
297 typedef struct {
298 IPAddr ip_addr;
299 int32_t EOR;
300 } REQ_Del_Source;
301
302 typedef struct {
303 Float dfreq;
304 int32_t EOR;
305 } REQ_Dfreq;
306
307 typedef struct {
308 int32_t sec;
309 int32_t usec;
310 int32_t EOR;
311 } REQ_Doffset;
312
313 typedef struct {
314 uint32_t index;
315 int32_t EOR;
316 } REQ_Sourcestats;
317
318 /* This is based on the response size rather than the
319 request size */
320 #define MAX_CLIENT_ACCESSES 8
321
322 typedef struct {
323 uint32_t first_index;
324 uint32_t n_clients;
325 uint32_t min_hits;
326 uint32_t reset;
327 int32_t EOR;
328 } REQ_ClientAccessesByIndex;
329
330 typedef struct {
331 int32_t index;
332 int32_t EOR;
333 } REQ_ManualDelete;
334
335 typedef struct {
336 Float distance;
337 int32_t EOR;
338 } REQ_ReselectDistance;
339
340 #define REQ_SMOOTHTIME_RESET 0
341 #define REQ_SMOOTHTIME_ACTIVATE 1
342
343 typedef struct {
344 int32_t option;
345 int32_t EOR;
346 } REQ_SmoothTime;
347
348 typedef struct {
349 IPAddr ip_addr;
350 int32_t EOR;
351 } REQ_NTPData;
352
353 typedef struct {
354 IPAddr ip_addr;
355 int32_t EOR;
356 } REQ_NTPSourceName;
357
358 typedef struct {
359 IPAddr ip_addr;
360 int32_t EOR;
361 } REQ_AuthData;
362
363 /* ================================================== */
364
365 #define PKT_TYPE_CMD_REQUEST 1
366 #define PKT_TYPE_CMD_REPLY 2
367
368 /* This version number needs to be incremented whenever the packet
369 size and/or the format of any of the existing messages is changed.
370 Other changes, e.g. new command types, should be handled cleanly by
371 client.c and cmdmon.c anyway, so the version can stay the same.
372
373 Version 1 : original version with fixed size packets
374
375 Version 2 : both command and reply packet sizes made capable of
376 being variable length.
377
378 Version 3 : NTP_Source message lengthened (auto_offline)
379
380 Version 4 : IPv6 addressing added, 64-bit time values, sourcestats
381 and tracking reports extended, added flags to NTP source request,
382 trimmed source report, replaced fixed-point format with floating-point
383 and used also instead of integer microseconds, new commands: modify stratum,
384 modify polltarget, modify maxdelaydevratio, reselect, reselectdistance
385
386 Version 5 : auth data moved to the end of the packet to allow hashes with
387 different sizes, extended sources, tracking and activity reports, dropped
388 subnets accessed and client accesses
389
390 Version 6 : added padding to requests to prevent amplification attack,
391 changed maximum number of samples in manual list to 16, new commands: modify
392 makestep, smoothing, smoothtime
393
394 Support for authentication was removed later in version 6 of the protocol
395 and commands that required authentication are allowed only locally over Unix
396 domain socket.
397
398 Version 6 (no authentication) : changed format of client accesses by index
399 (using new request/reply types) and manual timestamp, added new fields and
400 flags to NTP source request and report, made length of manual list constant,
401 added new commands: ntpdata, refresh, serverstats, shutdown
402 */
403
404 #define PROTO_VERSION_NUMBER 6
405
406 /* The oldest protocol versions that are compatible enough with the current
407 version to report a version mismatch for the server and the client */
408 #define PROTO_VERSION_MISMATCH_COMPAT_SERVER 5
409 #define PROTO_VERSION_MISMATCH_COMPAT_CLIENT 4
410
411 /* The first protocol version using padding in requests */
412 #define PROTO_VERSION_PADDING 6
413
414 /* The maximum length of padding in request packet, currently
415 defined by MANUAL_LIST */
416 #define MAX_PADDING_LENGTH 396
417
418 /* ================================================== */
419
420 typedef struct {
421 uint8_t version; /* Protocol version */
422 uint8_t pkt_type; /* What sort of packet this is */
423 uint8_t res1;
424 uint8_t res2;
425 uint16_t command; /* Which command is being issued */
426 uint16_t attempt; /* How many resends the client has done
427 (count up from zero for same sequence
428 number) */
429 uint32_t sequence; /* Client's sequence number */
430 uint32_t pad1;
431 uint32_t pad2;
432
433 union {
434 REQ_Null null;
435 REQ_Online online;
436 REQ_Offline offline;
437 REQ_Burst burst;
438 REQ_Modify_Minpoll modify_minpoll;
439 REQ_Modify_Maxpoll modify_maxpoll;
440 REQ_Dump dump;
441 REQ_Modify_Maxdelay modify_maxdelay;
442 REQ_Modify_Maxdelayratio modify_maxdelayratio;
443 REQ_Modify_Maxdelaydevratio modify_maxdelaydevratio;
444 REQ_Modify_Minstratum modify_minstratum;
445 REQ_Modify_Polltarget modify_polltarget;
446 REQ_Modify_Maxupdateskew modify_maxupdateskew;
447 REQ_Modify_Makestep modify_makestep;
448 REQ_Logon logon;
449 REQ_Settime settime;
450 REQ_Local local;
451 REQ_Manual manual;
452 REQ_Source_Data source_data;
453 REQ_Allow_Deny allow_deny;
454 REQ_Ac_Check ac_check;
455 REQ_NTP_Source ntp_source;
456 REQ_Del_Source del_source;
457 REQ_Dfreq dfreq;
458 REQ_Doffset doffset;
459 REQ_Sourcestats sourcestats;
460 REQ_ClientAccessesByIndex client_accesses_by_index;
461 REQ_ManualDelete manual_delete;
462 REQ_ReselectDistance reselect_distance;
463 REQ_SmoothTime smoothtime;
464 REQ_NTPData ntp_data;
465 REQ_NTPSourceName ntp_source_name;
466 REQ_AuthData auth_data;
467 } data; /* Command specific parameters */
468
469 /* Padding used to prevent traffic amplification. It only defines the
470 maximum size of the packet, there is no hole after the data field. */
471 uint8_t padding[MAX_PADDING_LENGTH];
472
473 } CMD_Request;
474
475 /* ================================================== */
476 /* Authority codes for command types */
477
478 #define PERMIT_OPEN 0
479 #define PERMIT_LOCAL 1
480 #define PERMIT_AUTH 2
481
482 /* ================================================== */
483
484 /* Reply codes */
485 #define RPY_NULL 1
486 #define RPY_N_SOURCES 2
487 #define RPY_SOURCE_DATA 3
488 #define RPY_MANUAL_TIMESTAMP 4
489 #define RPY_TRACKING 5
490 #define RPY_SOURCESTATS 6
491 #define RPY_RTC 7
492 #define RPY_SUBNETS_ACCESSED 8
493 #define RPY_CLIENT_ACCESSES 9
494 #define RPY_CLIENT_ACCESSES_BY_INDEX 10
495 #define RPY_MANUAL_LIST 11
496 #define RPY_ACTIVITY 12
497 #define RPY_SMOOTHING 13
498 #define RPY_SERVER_STATS 14
499 #define RPY_CLIENT_ACCESSES_BY_INDEX2 15
500 #define RPY_NTP_DATA 16
501 #define RPY_MANUAL_TIMESTAMP2 17
502 #define RPY_MANUAL_LIST2 18
503 #define RPY_NTP_SOURCE_NAME 19
504 #define RPY_AUTH_DATA 20
505 #define N_REPLY_TYPES 21
506
507 /* Status codes */
508 #define STT_SUCCESS 0
509 #define STT_FAILED 1
510 #define STT_UNAUTH 2
511 #define STT_INVALID 3
512 #define STT_NOSUCHSOURCE 4
513 #define STT_INVALIDTS 5
514 #define STT_NOTENABLED 6
515 #define STT_BADSUBNET 7
516 #define STT_ACCESSALLOWED 8
517 #define STT_ACCESSDENIED 9
518 /* Deprecated */
519 #define STT_NOHOSTACCESS 10
520 #define STT_SOURCEALREADYKNOWN 11
521 #define STT_TOOMANYSOURCES 12
522 #define STT_NORTC 13
523 #define STT_BADRTCFILE 14
524 #define STT_INACTIVE 15
525 #define STT_BADSAMPLE 16
526 #define STT_INVALIDAF 17
527 #define STT_BADPKTVERSION 18
528 #define STT_BADPKTLENGTH 19
529 #define STT_INVALIDNAME 21
530
531 typedef struct {
532 int32_t EOR;
533 } RPY_Null;
534
535 typedef struct {
536 uint32_t n_sources;
537 int32_t EOR;
538 } RPY_N_Sources;
539
540 #define RPY_SD_MD_CLIENT 0
541 #define RPY_SD_MD_PEER 1
542 #define RPY_SD_MD_REF 2
543
544 #define RPY_SD_ST_SYNC 0
545 #define RPY_SD_ST_UNREACH 1
546 #define RPY_SD_ST_FALSETICKER 2
547 #define RPY_SD_ST_JITTERY 3
548 #define RPY_SD_ST_CANDIDATE 4
549 #define RPY_SD_ST_OUTLIER 5
550
551 #define RPY_SD_FLAG_NOSELECT 0x1
552 #define RPY_SD_FLAG_PREFER 0x2
553 #define RPY_SD_FLAG_TRUST 0x4
554 #define RPY_SD_FLAG_REQUIRE 0x8
555
556 typedef struct {
557 IPAddr ip_addr;
558 int16_t poll;
559 uint16_t stratum;
560 uint16_t state;
561 uint16_t mode;
562 uint16_t flags;
563 uint16_t reachability;
564 uint32_t since_sample;
565 Float orig_latest_meas;
566 Float latest_meas;
567 Float latest_meas_err;
568 int32_t EOR;
569 } RPY_Source_Data;
570
571 typedef struct {
572 uint32_t ref_id;
573 IPAddr ip_addr;
574 uint16_t stratum;
575 uint16_t leap_status;
576 Timespec ref_time;
577 Float current_correction;
578 Float last_offset;
579 Float rms_offset;
580 Float freq_ppm;
581 Float resid_freq_ppm;
582 Float skew_ppm;
583 Float root_delay;
584 Float root_dispersion;
585 Float last_update_interval;
586 int32_t EOR;
587 } RPY_Tracking;
588
589 typedef struct {
590 uint32_t ref_id;
591 IPAddr ip_addr;
592 uint32_t n_samples;
593 uint32_t n_runs;
594 uint32_t span_seconds;
595 Float sd;
596 Float resid_freq_ppm;
597 Float skew_ppm;
598 Float est_offset;
599 Float est_offset_err;
600 int32_t EOR;
601 } RPY_Sourcestats;
602
603 typedef struct {
604 Timespec ref_time;
605 uint16_t n_samples;
606 uint16_t n_runs;
607 uint32_t span_seconds;
608 Float rtc_seconds_fast;
609 Float rtc_gain_rate_ppm;
610 int32_t EOR;
611 } RPY_Rtc;
612
613 typedef struct {
614 Float offset;
615 Float dfreq_ppm;
616 Float new_afreq_ppm;
617 int32_t EOR;
618 } RPY_ManualTimestamp;
619
620 typedef struct {
621 IPAddr ip;
622 uint32_t ntp_hits;
623 uint32_t cmd_hits;
624 uint32_t ntp_drops;
625 uint32_t cmd_drops;
626 int8_t ntp_interval;
627 int8_t cmd_interval;
628 int8_t ntp_timeout_interval;
629 int8_t pad;
630 uint32_t last_ntp_hit_ago;
631 uint32_t last_cmd_hit_ago;
632 } RPY_ClientAccesses_Client;
633
634 typedef struct {
635 uint32_t n_indices; /* how many indices there are in the server's table */
636 uint32_t next_index; /* the index 1 beyond those processed on this call */
637 uint32_t n_clients; /* the number of valid entries in the following array */
638 RPY_ClientAccesses_Client clients[MAX_CLIENT_ACCESSES];
639 int32_t EOR;
640 } RPY_ClientAccessesByIndex;
641
642 typedef struct {
643 uint32_t ntp_hits;
644 uint32_t cmd_hits;
645 uint32_t ntp_drops;
646 uint32_t cmd_drops;
647 uint32_t log_drops;
648 int32_t EOR;
649 } RPY_ServerStats;
650
651 #define MAX_MANUAL_LIST_SAMPLES 16
652
653 typedef struct {
654 Timespec when;
655 Float slewed_offset;
656 Float orig_offset;
657 Float residual;
658 } RPY_ManualListSample;
659
660 typedef struct {
661 uint32_t n_samples;
662 RPY_ManualListSample samples[MAX_MANUAL_LIST_SAMPLES];
663 int32_t EOR;
664 } RPY_ManualList;
665
666 typedef struct {
667 int32_t online;
668 int32_t offline;
669 int32_t burst_online;
670 int32_t burst_offline;
671 int32_t unresolved;
672 int32_t EOR;
673 } RPY_Activity;
674
675 #define RPY_SMT_FLAG_ACTIVE 0x1
676 #define RPY_SMT_FLAG_LEAPONLY 0x2
677
678 typedef struct {
679 uint32_t flags;
680 Float offset;
681 Float freq_ppm;
682 Float wander_ppm;
683 Float last_update_ago;
684 Float remaining_time;
685 int32_t EOR;
686 } RPY_Smoothing;
687
688 #define RPY_NTP_FLAGS_TESTS 0x3ff
689 #define RPY_NTP_FLAG_INTERLEAVED 0x4000
690 #define RPY_NTP_FLAG_AUTHENTICATED 0x8000
691
692 typedef struct {
693 IPAddr remote_addr;
694 IPAddr local_addr;
695 uint16_t remote_port;
696 uint8_t leap;
697 uint8_t version;
698 uint8_t mode;
699 uint8_t stratum;
700 int8_t poll;
701 int8_t precision;
702 Float root_delay;
703 Float root_dispersion;
704 uint32_t ref_id;
705 Timespec ref_time;
706 Float offset;
707 Float peer_delay;
708 Float peer_dispersion;
709 Float response_time;
710 Float jitter_asymmetry;
711 uint16_t flags;
712 uint8_t tx_tss_char;
713 uint8_t rx_tss_char;
714 uint32_t total_tx_count;
715 uint32_t total_rx_count;
716 uint32_t total_valid_count;
717 uint32_t reserved[4];
718 int32_t EOR;
719 } RPY_NTPData;
720
721 typedef struct {
722 int8_t name[256];
723 int32_t EOR;
724 } RPY_NTPSourceName;
725
726 #define RPY_AD_MD_NONE 0
727 #define RPY_AD_MD_SYMMETRIC 1
728 #define RPY_AD_MD_NTS 2
729
730 typedef struct {
731 uint16_t mode;
732 uint16_t key_type;
733 uint32_t key_id;
734 uint16_t key_length;
735 uint16_t ke_attempts;
736 uint32_t last_ke_ago;
737 uint16_t cookies;
738 uint16_t nak;
739 int32_t EOR;
740 } RPY_AuthData;
741
742 typedef struct {
743 uint8_t version;
744 uint8_t pkt_type;
745 uint8_t res1;
746 uint8_t res2;
747 uint16_t command; /* Which command is being replied to */
748 uint16_t reply; /* Which format of reply this is */
749 uint16_t status; /* Status of command processing */
750 uint16_t pad1; /* Padding for compatibility and 4 byte alignment */
751 uint16_t pad2;
752 uint16_t pad3;
753 uint32_t sequence; /* Echo of client's sequence number */
754 uint32_t pad4;
755 uint32_t pad5;
756
757 union {
758 RPY_Null null;
759 RPY_N_Sources n_sources;
760 RPY_Source_Data source_data;
761 RPY_ManualTimestamp manual_timestamp;
762 RPY_Tracking tracking;
763 RPY_Sourcestats sourcestats;
764 RPY_Rtc rtc;
765 RPY_ClientAccessesByIndex client_accesses_by_index;
766 RPY_ServerStats server_stats;
767 RPY_ManualList manual_list;
768 RPY_Activity activity;
769 RPY_Smoothing smoothing;
770 RPY_NTPData ntp_data;
771 RPY_NTPSourceName ntp_source_name;
772 RPY_AuthData auth_data;
773 } data; /* Reply specific parameters */
774
775 } CMD_Reply;
776
777 /* ================================================== */
778
779 #endif /* GOT_CANDM_H */