]> git.ipfire.org Git - thirdparty/chrony.git/blob - conf.h
examples: harden systemd services
[thirdparty/chrony.git] / conf.h
1 /*
2 chronyd/chronyc - Programs for keeping computer clocks accurate.
3
4 **********************************************************************
5 * Copyright (C) Richard P. Curnow 1997-2003
6 * Copyright (C) Miroslav Lichvar 2013-2014
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of version 2 of the GNU General Public License as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 *
21 **********************************************************************
22
23 =======================================================================
24
25 Header file for configuration module
26 */
27
28 #ifndef GOT_CONF_H
29 #define GOT_CONF_H
30
31 #include "addressing.h"
32 #include "reference.h"
33 #include "sources.h"
34
35 extern void CNF_Initialise(int restarted, int client_only);
36 extern void CNF_Finalise(void);
37
38 extern void CNF_EnablePrint(void);
39
40 extern char *CNF_GetRtcDevice(void);
41
42 extern void CNF_ReadFile(const char *filename);
43 extern void CNF_ParseLine(const char *filename, int number, char *line);
44
45 extern void CNF_CreateDirs(uid_t uid, gid_t gid);
46
47 extern void CNF_AddInitSources(void);
48 extern void CNF_AddSources(void);
49 extern void CNF_AddBroadcasts(void);
50 extern void CNF_AddRefclocks(void);
51
52 extern void CNF_ReloadSources(void);
53
54 extern int CNF_GetAcquisitionPort(void);
55 extern int CNF_GetNTPPort(void);
56 extern char *CNF_GetDriftFile(void);
57 extern char *CNF_GetLogDir(void);
58 extern char *CNF_GetDumpDir(void);
59 extern int CNF_GetLogBanner(void);
60 extern int CNF_GetLogMeasurements(int *raw);
61 extern int CNF_GetLogStatistics(void);
62 extern int CNF_GetLogTracking(void);
63 extern int CNF_GetLogRtc(void);
64 extern int CNF_GetLogRefclocks(void);
65 extern int CNF_GetLogTempComp(void);
66 extern char *CNF_GetKeysFile(void);
67 extern char *CNF_GetRtcFile(void);
68 extern int CNF_GetManualEnabled(void);
69 extern int CNF_GetCommandPort(void);
70 extern int CNF_GetRtcOnUtc(void);
71 extern int CNF_GetRtcSync(void);
72 extern void CNF_GetMakeStep(int *limit, double *threshold);
73 extern void CNF_GetMaxChange(int *delay, int *ignore, double *offset);
74 extern double CNF_GetLogChange(void);
75 extern void CNF_GetMailOnChange(int *enabled, double *threshold, char **user);
76 extern int CNF_GetNoClientLog(void);
77 extern unsigned long CNF_GetClientLogLimit(void);
78 extern void CNF_GetFallbackDrifts(int *min, int *max);
79 extern void CNF_GetBindAddress(int family, IPAddr *addr);
80 extern void CNF_GetBindAcquisitionAddress(int family, IPAddr *addr);
81 extern void CNF_GetBindCommandAddress(int family, IPAddr *addr);
82 extern char *CNF_GetBindNtpInterface(void);
83 extern char *CNF_GetBindAcquisitionInterface(void);
84 extern char *CNF_GetBindCommandInterface(void);
85 extern char *CNF_GetBindCommandPath(void);
86 extern int CNF_GetNtpDscp(void);
87 extern char *CNF_GetNtpSigndSocket(void);
88 extern char *CNF_GetPidFile(void);
89 extern REF_LeapMode CNF_GetLeapSecMode(void);
90 extern char *CNF_GetLeapSecTimezone(void);
91
92 /* Value returned in ppm, as read from file */
93 extern double CNF_GetMaxUpdateSkew(void);
94 extern double CNF_GetMaxClockError(void);
95 extern double CNF_GetMaxDrift(void);
96 extern double CNF_GetCorrectionTimeRatio(void);
97 extern double CNF_GetMaxSlewRate(void);
98 extern double CNF_GetClockPrecision(void);
99
100 extern SRC_AuthSelectMode CNF_GetAuthSelectMode(void);
101 extern double CNF_GetMaxDistance(void);
102 extern double CNF_GetMaxJitter(void);
103 extern double CNF_GetReselectDistance(void);
104 extern double CNF_GetStratumWeight(void);
105 extern double CNF_GetCombineLimit(void);
106
107 extern int CNF_AllowLocalReference(int *stratum, int *orphan, double *distance);
108
109 extern void CNF_SetupAccessRestrictions(void);
110
111 extern int CNF_GetSchedPriority(void);
112 extern int CNF_GetLockMemory(void);
113
114 extern int CNF_GetNTPRateLimit(int *interval, int *burst, int *leak);
115 extern int CNF_GetNtsRateLimit(int *interval, int *burst, int *leak);
116 extern int CNF_GetCommandRateLimit(int *interval, int *burst, int *leak);
117 extern void CNF_GetSmooth(double *max_freq, double *max_wander, int *leap_only);
118 extern void CNF_GetTempComp(char **file, double *interval, char **point_file, double *T0, double *k0, double *k1, double *k2);
119
120 extern char *CNF_GetUser(void);
121
122 extern int CNF_GetMaxSamples(void);
123 extern int CNF_GetMinSamples(void);
124
125 extern int CNF_GetMinSources(void);
126
127 extern double CNF_GetRtcAutotrim(void);
128 extern char *CNF_GetHwclockFile(void);
129
130 extern int CNF_GetInitSources(void);
131 extern double CNF_GetInitStepThreshold(void);
132
133 typedef enum {
134 CNF_HWTS_RXFILTER_ANY,
135 CNF_HWTS_RXFILTER_NONE,
136 CNF_HWTS_RXFILTER_NTP,
137 CNF_HWTS_RXFILTER_PTP,
138 CNF_HWTS_RXFILTER_ALL,
139 } CNF_HwTs_RxFilter;
140
141 typedef struct {
142 char *name;
143 int minpoll;
144 int min_samples;
145 int max_samples;
146 int nocrossts;
147 CNF_HwTs_RxFilter rxfilter;
148 double precision;
149 double tx_comp;
150 double rx_comp;
151 } CNF_HwTsInterface;
152
153 extern int CNF_GetHwTsInterface(unsigned int index, CNF_HwTsInterface **iface);
154
155 extern int CNF_GetPtpPort(void);
156
157 extern char *CNF_GetNtsDumpDir(void);
158 extern char *CNF_GetNtsNtpServer(void);
159 extern int CNF_GetNtsServerCertAndKeyFiles(const char ***certs, const char ***keys);
160 extern int CNF_GetNtsServerPort(void);
161 extern int CNF_GetNtsServerProcesses(void);
162 extern int CNF_GetNtsServerConnections(void);
163 extern int CNF_GetNtsRefresh(void);
164 extern int CNF_GetNtsRotate(void);
165 extern int CNF_GetNtsTrustedCertsPaths(const char ***paths, uint32_t **ids);
166 extern int CNF_GetNoSystemCert(void);
167 extern int CNF_GetNoCertTimeCheck(void);
168
169 #endif /* GOT_CONF_H */