xref: /freebsd/contrib/ntp/libparse/parse_conf.c (revision 1e413cf93298b5b97441a21d9a50fdcd0ee9945e)
1 /*
2  * /src/NTP/ntp-4/libparse/parse_conf.c,v 4.5 1999/11/28 09:13:53 kardel RELEASE_19991128_A
3  *
4  * parse_conf.c,v 4.5 1999/11/28 09:13:53 kardel RELEASE_19991128_A
5  *
6  * Parser configuration module for reference clocks
7  *
8  * STREAM define switches between two personalities of the module
9  * if STREAM is defined this module can be used with dcf77sync.c as
10  * a STREAMS kernel module. In this case the time stamps will be
11  * a struct timeval.
12  * when STREAM is not defined NTP time stamps will be used.
13  *
14  * Copyright (C) 1995-1998 by Frank Kardel
15  * Copyright (C) 1992-1994 by Frank Kardel, Friedrich-Alexander Universit�t Erlangen-N�rnberg, Germany
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20  *
21  */
22 
23 #ifdef HAVE_CONFIG_H
24 # include <config.h>
25 #endif
26 
27 #if defined(REFCLOCK) && defined(CLOCK_PARSE)
28 
29 #include "ntp_fp.h"
30 #include "ntp_unixtime.h"
31 #include "ntp_calendar.h"
32 
33 #include "parse.h"
34 
35 #ifdef CLOCK_SCHMID
36 extern clockformat_t clock_schmid;
37 #endif
38 
39 #ifdef CLOCK_DCF7000
40 extern clockformat_t clock_dcf7000;
41 #endif
42 
43 #ifdef CLOCK_MEINBERG
44 extern clockformat_t clock_meinberg[];
45 #endif
46 
47 #ifdef CLOCK_RAWDCF
48 extern clockformat_t clock_rawdcf;
49 #endif
50 
51 #ifdef CLOCK_TRIMTAIP
52 extern clockformat_t clock_trimtaip;
53 #endif
54 
55 #ifdef CLOCK_TRIMTSIP
56 extern clockformat_t clock_trimtsip;
57 #endif
58 
59 #ifdef CLOCK_RCC8000
60 extern clockformat_t clock_rcc8000;
61 #endif
62 
63 #ifdef CLOCK_HOPF6021
64 extern clockformat_t clock_hopf6021;
65 #endif
66 
67 #ifdef CLOCK_COMPUTIME
68 extern clockformat_t clock_computime;
69 #endif
70 
71 #ifdef CLOCK_WHARTON_400A
72 extern clockformat_t clock_wharton_400a;
73 #endif
74 
75 #ifdef CLOCK_VARITEXT
76 extern clockformat_t clock_varitext;
77 #endif
78 
79 /*
80  * format definitions
81  */
82 clockformat_t *clockformats[] =
83 {
84 #ifdef CLOCK_MEINBERG
85 	&clock_meinberg[0],
86 	&clock_meinberg[1],
87 	&clock_meinberg[2],
88 #endif
89 #ifdef CLOCK_DCF7000
90 	&clock_dcf7000,
91 #endif
92 #ifdef CLOCK_SCHMID
93 	&clock_schmid,
94 #endif
95 #ifdef CLOCK_RAWDCF
96 	&clock_rawdcf,
97 #endif
98 #ifdef CLOCK_TRIMTAIP
99 	&clock_trimtaip,
100 #endif
101 #ifdef CLOCK_TRIMTSIP
102 	&clock_trimtsip,
103 #endif
104 #ifdef CLOCK_RCC8000
105 	&clock_rcc8000,
106 #endif
107 #ifdef CLOCK_HOPF6021
108 	&clock_hopf6021,
109 #endif
110 #ifdef CLOCK_COMPUTIME
111 	&clock_computime,
112 #endif
113 #ifdef CLOCK_WHARTON_400A
114 	&clock_wharton_400a,
115 #endif
116 #ifdef CLOCK_VARITEXT
117         &clock_varitext,
118 #endif
119 	0};
120 
121 unsigned short nformats = sizeof(clockformats) / sizeof(clockformats[0]) - 1;
122 
123 #else /* not (REFCLOCK && CLOCK_PARSE) */
124 int parse_conf_bs;
125 #endif /* not (REFCLOCK && CLOCK_PARSE) */
126 
127 /*
128  * History:
129  *
130  * parse_conf.c,v
131  * Revision 4.5  1999/11/28 09:13:53  kardel
132  * RECON_4_0_98F
133  *
134  * Revision 4.4  1999/02/28 15:27:25  kardel
135  * wharton clock integration
136  *
137  * Revision 4.3  1998/08/16 18:52:15  kardel
138  * (clockformats): Trimble TSIP driver now also
139  * available for kernel operation
140  *
141  * Revision 4.2  1998/06/12 09:13:48  kardel
142  * conditional compile macros fixed
143  *
144  * Revision 4.1  1998/05/24 09:40:49  kardel
145  * adjustments of log messages
146  *
147  *
148  * from V3 3.24 log info deleted 1998/04/11 kardel
149  */
150