xref: /freebsd/contrib/ntp/libparse/parse_conf.c (revision 23f282aa31e9b6fceacd449020e936e98d6f2298)
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 <sys/types.h>
30 #include <sys/time.h>
31 
32 #include "ntp_fp.h"
33 #include "ntp_unixtime.h"
34 #include "ntp_calendar.h"
35 
36 #include "parse.h"
37 
38 #ifdef CLOCK_SCHMID
39 extern clockformat_t clock_schmid;
40 #endif
41 
42 #ifdef CLOCK_DCF7000
43 extern clockformat_t clock_dcf7000;
44 #endif
45 
46 #ifdef CLOCK_MEINBERG
47 extern clockformat_t clock_meinberg[];
48 #endif
49 
50 #ifdef CLOCK_RAWDCF
51 extern clockformat_t clock_rawdcf;
52 #endif
53 
54 #ifdef CLOCK_TRIMTAIP
55 extern clockformat_t clock_trimtaip;
56 #endif
57 
58 #ifdef CLOCK_TRIMTSIP
59 extern clockformat_t clock_trimtsip;
60 #endif
61 
62 #ifdef CLOCK_RCC8000
63 extern clockformat_t clock_rcc8000;
64 #endif
65 
66 #ifdef CLOCK_HOPF6021
67 extern clockformat_t clock_hopf6021;
68 #endif
69 
70 #ifdef CLOCK_COMPUTIME
71 extern clockformat_t clock_computime;
72 #endif
73 
74 #ifdef CLOCK_WHARTON_400A
75 extern clockformat_t clock_wharton_400a;
76 #endif
77 
78 #ifdef CLOCK_VARITEXT
79 extern clockformat_t clock_varitext;
80 #endif
81 
82 /*
83  * format definitions
84  */
85 clockformat_t *clockformats[] =
86 {
87 #ifdef CLOCK_MEINBERG
88 	&clock_meinberg[0],
89 	&clock_meinberg[1],
90 	&clock_meinberg[2],
91 #endif
92 #ifdef CLOCK_DCF7000
93 	&clock_dcf7000,
94 #endif
95 #ifdef CLOCK_SCHMID
96 	&clock_schmid,
97 #endif
98 #ifdef CLOCK_RAWDCF
99 	&clock_rawdcf,
100 #endif
101 #ifdef CLOCK_TRIMTAIP
102 	&clock_trimtaip,
103 #endif
104 #ifdef CLOCK_TRIMTSIP
105 	&clock_trimtsip,
106 #endif
107 #ifdef CLOCK_RCC8000
108 	&clock_rcc8000,
109 #endif
110 #ifdef CLOCK_HOPF6021
111 	&clock_hopf6021,
112 #endif
113 #ifdef CLOCK_COMPUTIME
114 	&clock_computime,
115 #endif
116 #ifdef CLOCK_WHARTON_400A
117 	&clock_wharton_400a,
118 #endif
119 #ifdef CLOCK_VARITEXT
120         &clock_varitext,
121 #endif
122 	0};
123 
124 unsigned short nformats = sizeof(clockformats) / sizeof(clockformats[0]) - 1;
125 
126 #else /* not (REFCLOCK && CLOCK_PARSE) */
127 int parse_conf_bs;
128 #endif /* not (REFCLOCK && CLOCK_PARSE) */
129 
130 /*
131  * History:
132  *
133  * parse_conf.c,v
134  * Revision 4.5  1999/11/28 09:13:53  kardel
135  * RECON_4_0_98F
136  *
137  * Revision 4.4  1999/02/28 15:27:25  kardel
138  * wharton clock integration
139  *
140  * Revision 4.3  1998/08/16 18:52:15  kardel
141  * (clockformats): Trimble TSIP driver now also
142  * available for kernel operation
143  *
144  * Revision 4.2  1998/06/12 09:13:48  kardel
145  * conditional compile macros fixed
146  *
147  * Revision 4.1  1998/05/24 09:40:49  kardel
148  * adjustments of log messages
149  *
150  *
151  * from V3 3.24 log info deleted 1998/04/11 kardel
152  */
153