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