]> git.ipfire.org Git - thirdparty/chrony.git/blob - cmdparse.h
cmdmon: save NTS cookies and server keys on dump command
[thirdparty/chrony.git] / cmdparse.h
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 for the command parser
25 */
26
27 #ifndef GOT_CMDPARSE_H
28 #define GOT_CMDPARSE_H
29
30 #include "srcparams.h"
31 #include "addressing.h"
32
33 typedef struct {
34 char *name;
35 unsigned short port;
36 SourceParameters params;
37 } CPS_NTP_Source;
38
39 /* Parse a command to add an NTP server or peer */
40 extern int CPS_ParseNTPSourceAdd(char *line, CPS_NTP_Source *src);
41
42 /* Parse a command to enable local reference */
43 extern int CPS_ParseLocal(char *line, int *stratum, int *orphan, double *distance);
44
45 /* Remove extra white-space and comments */
46 extern void CPS_NormalizeLine(char *line);
47
48 /* Terminate first word and return pointer to the next word */
49 extern char *CPS_SplitWord(char *line);
50
51 /* Parse a key from keyfile */
52 extern int CPS_ParseKey(char *line, uint32_t *id, const char **type, char **key);
53
54 #endif /* GOT_CMDPARSE_H */