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   Header file defining parameters that can be set on a per source basis
25   */
26 
27 #ifndef GOT_SRCPARAMS_H
28 #define GOT_SRCPARAMS_H
29 
30 #include "sources.h"
31 
32 typedef enum {
33   SRC_OFFLINE,
34   SRC_ONLINE,
35   SRC_MAYBE_ONLINE,
36 } SRC_Connectivity;
37 
38 typedef struct {
39   int minpoll;
40   int maxpoll;
41   SRC_Connectivity connectivity;
42   int auto_offline;
43   int presend_minpoll;
44   int burst;
45   int iburst;
46   int min_stratum;
47   int poll_target;
48   int version;
49   int max_sources;
50   int min_samples;
51   int max_samples;
52   int filter_length;
53   int interleaved;
54   int sel_options;
55   int nts;
56   int nts_port;
57   int copy;
58   int ext_fields;
59   uint32_t authkey;
60   uint32_t cert_set;
61   double max_delay;
62   double max_delay_ratio;
63   double max_delay_dev_ratio;
64   double min_delay;
65   double asymmetry;
66   double offset;
67 } SourceParameters;
68 
69 #define SRC_DEFAULT_PORT 123
70 #define SRC_DEFAULT_MINPOLL 6
71 #define SRC_DEFAULT_MAXPOLL 10
72 #define SRC_DEFAULT_PRESEND_MINPOLL 100
73 #define SRC_DEFAULT_MAXDELAY 3.0
74 #define SRC_DEFAULT_MAXDELAYRATIO 0.0
75 #define SRC_DEFAULT_MAXDELAYDEVRATIO 10.0
76 #define SRC_DEFAULT_MINSTRATUM 0
77 #define SRC_DEFAULT_POLLTARGET 8
78 #define SRC_DEFAULT_MAXSOURCES 4
79 #define SRC_DEFAULT_MINSAMPLES (-1)
80 #define SRC_DEFAULT_MAXSAMPLES (-1)
81 #define SRC_DEFAULT_ASYMMETRY 1.0
82 #define SRC_DEFAULT_NTSPORT 4460
83 #define SRC_DEFAULT_CERTSET 0
84 #define INACTIVE_AUTHKEY 0
85 
86 /* Flags for source selection */
87 #define SRC_SELECT_NOSELECT 0x1
88 #define SRC_SELECT_PREFER 0x2
89 #define SRC_SELECT_TRUST 0x4
90 #define SRC_SELECT_REQUIRE 0x8
91 
92 #endif /* GOT_SRCPARAMS_H */
93