]> git.ipfire.org Git - thirdparty/chrony.git/blob - privops.h
cmdmon: save NTS cookies and server keys on dump command
[thirdparty/chrony.git] / privops.h
1 /*
2 chronyd/chronyc - Programs for keeping computer clocks accurate.
3
4 **********************************************************************
5 * Copyright (C) Bryan Christianson 2015
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 Perform privileged operations over a unix socket to a privileged fork.
25
26 */
27
28 #ifndef GOT_PRIVOPS_H
29 #define GOT_PRIVOPS_H
30
31 #ifdef PRIVOPS_ADJUSTTIME
32 int PRV_AdjustTime(const struct timeval *delta, struct timeval *olddelta);
33 #else
34 #define PRV_AdjustTime adjtime
35 #endif
36
37 #ifdef PRIVOPS_ADJUSTTIMEX
38 int PRV_AdjustTimex(struct timex *txc);
39 #else
40 #define PRV_AdjustTimex ntp_adjtime
41 #endif
42
43 #ifdef PRIVOPS_SETTIME
44 int PRV_SetTime(const struct timeval *tp, const struct timezone *tzp);
45 #else
46 #define PRV_SetTime settimeofday
47 #endif
48
49 #ifdef PRIVOPS_BINDSOCKET
50 int PRV_BindSocket(int sock, struct sockaddr *address, socklen_t address_len);
51 #else
52 #define PRV_BindSocket bind
53 #endif
54
55 #ifdef PRIVOPS_NAME2IPADDRESS
56 int PRV_Name2IPAddress(const char *name, IPAddr *ip_addrs, int max_addrs);
57 #else
58 #define PRV_Name2IPAddress DNS_Name2IPAddress
59 #endif
60
61 #ifdef PRIVOPS_RELOADDNS
62 void PRV_ReloadDNS(void);
63 #else
64 #define PRV_ReloadDNS DNS_Reload
65 #endif
66
67 #ifdef PRIVOPS_HELPER
68 void PRV_Initialise(void);
69 void PRV_StartHelper(void);
70 void PRV_Finalise(void);
71 #else
72 #define PRV_Initialise()
73 #define PRV_StartHelper()
74 #define PRV_Finalise()
75 #endif
76
77 #endif