parse_conf.c revision 290000
11573Srgrimes/*
21573Srgrimes * /src/NTP/ntp4-dev/libparse/parse_conf.c,v 4.9 2005/04/16 17:32:10 kardel RELEASE_20050508_A
31573Srgrimes *
41573Srgrimes * parse_conf.c,v 4.9 2005/04/16 17:32:10 kardel RELEASE_20050508_A
51573Srgrimes *
61573Srgrimes * Parser configuration module for reference clocks
71573Srgrimes *
81573Srgrimes * STREAM define switches between two personalities of the module
91573Srgrimes * if STREAM is defined this module can be used with dcf77sync.c as
101573Srgrimes * a STREAMS kernel module. In this case the time stamps will be
111573Srgrimes * a struct timeval.
121573Srgrimes * when STREAM is not defined NTP time stamps will be used.
13251069Semaste *
141573Srgrimes * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
151573Srgrimes * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
161573Srgrimes *
171573Srgrimes * Redistribution and use in source and binary forms, with or without
181573Srgrimes * modification, are permitted provided that the following conditions
191573Srgrimes * are met:
201573Srgrimes * 1. Redistributions of source code must retain the above copyright
211573Srgrimes *    notice, this list of conditions and the following disclaimer.
221573Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
231573Srgrimes *    notice, this list of conditions and the following disclaimer in the
241573Srgrimes *    documentation and/or other materials provided with the distribution.
251573Srgrimes * 3. Neither the name of the author nor the names of its contributors
261573Srgrimes *    may be used to endorse or promote products derived from this software
271573Srgrimes *    without specific prior written permission.
281573Srgrimes *
291573Srgrimes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
301573Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
311573Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
321573Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
3386170Sobrien * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3486170Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
351573Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
361573Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37102637Srobert * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38102637Srobert * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
391573Srgrimes * SUCH DAMAGE.
40229368Sed *
411573Srgrimes */
42123631Sjkh
43123631Sjkh#ifdef HAVE_CONFIG_H
44123631Sjkh# include <config.h>
451573Srgrimes#endif
46123584Sjkh
47102637Srobert#if defined(REFCLOCK) && defined(CLOCK_PARSE)
48102637Srobert
49102637Srobert#include "ntp_fp.h"
501573Srgrimes#include "ntp_unixtime.h"
511573Srgrimes#include "ntp_calendar.h"
521573Srgrimes
53229368Sed#include "parse.h"
54229571Sed
55#ifdef CLOCK_SCHMID
56extern clockformat_t clock_schmid;
57#endif
58
59#ifdef CLOCK_DCF7000
60extern clockformat_t clock_dcf7000;
61#endif
62
63#ifdef CLOCK_MEINBERG
64extern clockformat_t clock_meinberg[];
65#endif
66
67#ifdef CLOCK_RAWDCF
68extern clockformat_t clock_rawdcf;
69#endif
70
71#ifdef CLOCK_TRIMTAIP
72extern clockformat_t clock_trimtaip;
73#endif
74
75#ifdef CLOCK_TRIMTSIP
76extern clockformat_t clock_trimtsip;
77#endif
78
79#ifdef CLOCK_RCC8000
80extern clockformat_t clock_rcc8000;
81#endif
82
83#ifdef CLOCK_HOPF6021
84extern clockformat_t clock_hopf6021;
85#endif
86
87#ifdef CLOCK_COMPUTIME
88extern clockformat_t clock_computime;
89#endif
90
91#ifdef CLOCK_WHARTON_400A
92extern clockformat_t clock_wharton_400a;
93#endif
94
95#ifdef CLOCK_VARITEXT
96extern clockformat_t clock_varitext;
97#endif
98
99#ifdef CLOCK_SEL240X
100extern clockformat_t clock_sel240x;
101#endif
102
103/*
104 * format definitions
105 */
106clockformat_t *clockformats[] =
107{
108#ifdef CLOCK_MEINBERG
109	&clock_meinberg[0],
110	&clock_meinberg[1],
111	&clock_meinberg[2],
112#endif
113#ifdef CLOCK_DCF7000
114	&clock_dcf7000,
115#endif
116#ifdef CLOCK_SCHMID
117	&clock_schmid,
118#endif
119#ifdef CLOCK_RAWDCF
120	&clock_rawdcf,
121#endif
122#ifdef CLOCK_TRIMTAIP
123	&clock_trimtaip,
124#endif
125#ifdef CLOCK_TRIMTSIP
126	&clock_trimtsip,
127#endif
128#ifdef CLOCK_RCC8000
129	&clock_rcc8000,
130#endif
131#ifdef CLOCK_HOPF6021
132	&clock_hopf6021,
133#endif
134#ifdef CLOCK_COMPUTIME
135	&clock_computime,
136#endif
137#ifdef CLOCK_WHARTON_400A
138	&clock_wharton_400a,
139#endif
140#ifdef CLOCK_VARITEXT
141        &clock_varitext,
142#endif
143#ifdef CLOCK_SEL240X
144        &clock_sel240x,
145#endif
146	0};
147
148unsigned short nformats = sizeof(clockformats) / sizeof(clockformats[0]) - 1;
149
150#else /* not (REFCLOCK && CLOCK_PARSE) */
151int parse_conf_bs;
152#endif /* not (REFCLOCK && CLOCK_PARSE) */
153
154/*
155 * History:
156 *
157 * parse_conf.c,v
158 * Revision 4.9  2005/04/16 17:32:10  kardel
159 * update copyright
160 *
161 * Revision 4.8  2004/11/14 15:29:41  kardel
162 * support PPSAPI, upgrade Copyright to Berkeley style
163 *
164 * Revision 4.5  1999/11/28 09:13:53  kardel
165 * RECON_4_0_98F
166 *
167 * Revision 4.4  1999/02/28 15:27:25  kardel
168 * wharton clock integration
169 *
170 * Revision 4.3  1998/08/16 18:52:15  kardel
171 * (clockformats): Trimble TSIP driver now also
172 * available for kernel operation
173 *
174 * Revision 4.2  1998/06/12 09:13:48  kardel
175 * conditional compile macros fixed
176 *
177 * Revision 4.1  1998/05/24 09:40:49  kardel
178 * adjustments of log messages
179 *
180 *
181 * from V3 3.24 log info deleted 1998/04/11 kardel
182 */
183