diff options
Diffstat (limited to 'contrib/ntp/libparse')
27 files changed, 1697 insertions, 1111 deletions
diff --git a/contrib/ntp/libparse/Makefile.am b/contrib/ntp/libparse/Makefile.am index 8e21463..2988e08 100644 --- a/contrib/ntp/libparse/Makefile.am +++ b/contrib/ntp/libparse/Makefile.am @@ -1,168 +1,173 @@ -#AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies -AUTOMAKE_OPTIONS = ../util/ansi2knr +NULL= +BUILT_SOURCES = $(VPHACK) info_trimble.c $(VPHACK_AFTER) +CLEANFILES = noinst_LIBRARIES = @MAKE_LIBPARSE@ @MAKE_LIBPARSE_KERNEL@ EXTRA_LIBRARIES = libparse.a libparse_kernel.a EXTRA_PROGRAMS = parsestreams parsesolaris noinst_PROGRAMS = @MAKE_PARSEKMODULE@ -CLEANFILES = libparse.a libparse_kernel.a K_CFLAGS = -DPARSESTREAM -DNTP_NEED_BOPS +# info_trimble.c was mistakenly created in the build directory +# previously. It is located in $(srcdir) and any updates must +# end up there. + +# +# VPHACK and VPHACK_AFTER are enabled on non-GNU makes (such as +# BSD make) to work around build/dependency issues where we want +# built source files to live in srcdir, as opposed to builddir. +# + +if VPATH_HACK +VPHACK= vphack +VPHACK_AFTER= vphack_after +else +VPHACK= +VPHACK_AFTER= +endif + +vphack: + test -e info_trimble.c || ln -s $(srcdir)/info_trimble.c . + +vphack_after: + test -L info_trimble.c || ( \ + mv info_trimble.c $(srcdir)/info_trimble.c && \ + ln -s $(srcdir)/info_trimble.c . \ + ) + libparse_a_SOURCES = parse.c \ - parse_conf.c \ - clk_meinberg.c \ - clk_schmid.c \ + parse_conf.c \ + clk_meinberg.c \ + clk_schmid.c \ clk_rawdcf.c \ clk_trimtsip.c \ - clk_dcf7000.c \ - clk_trimtaip.c \ - clk_rcc8000.c \ - clk_hopf6021.c \ - clk_computime.c \ + clk_dcf7000.c \ + clk_trimtaip.c \ + clk_rcc8000.c \ + clk_hopf6021.c \ + clk_computime.c \ clk_wharton.c \ clk_varitext.c \ - data_mbg.c \ + clk_sel240x.c \ + data_mbg.c \ info_trimble.c \ trim_info.c \ binio.c \ ieee754io.c \ mfp_mul.c \ - gpstolfp.c + gpstolfp.c \ + $(NULL) libparse_kernel_a_SOURCES = -libparse_kernel_a_LIBADD = kparse$U.o \ - kparse_conf$U.o \ - kclk_computime$U.o \ - kclk_dcf7000$U.o \ - kclk_hopf6021$U.o \ - kclk_meinberg$U.o \ - kclk_rawdcf$U.o \ - kclk_rcc8000$U.o \ - kclk_schmid$U.o \ - kclk_trimtaip$U.o \ - kclk_trimtsip$U.o \ - kclk_varitext$U.o \ - kclk_wharton$U.o \ - kbinio$U.o \ - kieee754io$U.o \ - kmfp_mul$U.o \ - kgpstolfp$U.o - - -INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/kernel -ETAGS_ARGS = Makefile.am +libparse_kernel_a_LIBADD = \ + kparse.o \ + kparse_conf.o \ + kclk_computime.o \ + kclk_dcf7000.o \ + kclk_hopf6021.o \ + kclk_meinberg.o \ + kclk_rawdcf.o \ + kclk_rcc8000.o \ + kclk_schmid.o \ + kclk_trimtaip.o \ + kclk_trimtsip.o \ + kclk_varitext.o \ + kclk_wharton.o \ + kclk_sel240x.o \ + kbinio.o \ + kieee754io.o \ + kmfp_mul.o \ + kgpstolfp.o \ + $(NULL) + +AM_CFLAGS = $(CFLAGS_NTP) + +AM_CPPFLAGS = $(NTP_INCS) +AM_CPPFLAGS += -I$(top_srcdir)/kernel +AM_CPPFLAGS += $(CPPFLAGS_NTP) EXTRA_DIST = parsesolaris.c parsestreams.c mkinfo_scmd.sed mkinfo_rcmd.sed info_trimble.c -# -# create info_trimble.c -# -info_trimble.c: $(top_srcdir)/include/trimble.h mkinfo_rcmd.sed mkinfo_scmd.sed - @rm -f info_trimble.c - sed -n -f $(srcdir)/mkinfo_scmd.sed $(top_srcdir)/include/trimble.h > info_trimble.c || rm -f info_trimble.c - sed -n -f $(srcdir)/mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> info_trimble.c || rm -f info_trimble.c +info_trimble.c: $(top_srcdir)/include/trimble.h $(srcdir)/Makefile.am $(srcdir)/mkinfo_scmd.sed $(srcdir)/mkinfo_rcmd.sed + sed -n -f $(srcdir)/mkinfo_scmd.sed $(top_srcdir)/include/trimble.h > info_trimble.new + sed -n -f $(srcdir)/mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> info_trimble.new + mv -f info_trimble.new $@ + +#$(srcdir)/info_trimble.c: $(top_srcdir)/include/trimble.h $(srcdir)/Makefile.am $(srcdir)/mkinfo_scmd.sed $(srcdir)/mkinfo_rcmd.sed +# sed -n -f $(srcdir)/mkinfo_scmd.sed $(top_srcdir)/include/trimble.h > info_trimble.new +# sed -n -f $(srcdir)/mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> info_trimble.new +# mv -f info_trimble.new $@ -kieee754io.o: ieee754io.c +kieee754io.o: $(srcdir)/ieee754io.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/ieee754io.c -o $@ -kmfp_mul.o: mfp_mul.c +kmfp_mul.o: $(srcdir)/mfp_mul.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/mfp_mul.c -o $@ -kgpstolfp.o: gpstolfp.c +kgpstolfp.o: $(srcdir)/gpstolfp.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/gpstolfp.c -o $@ -kbinio.o: binio.c +kbinio.o: $(srcdir)/binio.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/binio.c -o $@ -kclk_computime.o: clk_computime.c +kclk_computime.o: $(srcdir)/clk_computime.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_computime.c -o $@ -kclk_computime_.o: clk_computime_.c - $(COMPILE) $(K_CFLAGS) -c clk_computime_.c -o $@ - -kclk_dcf7000.o: clk_dcf7000.c +kclk_dcf7000.o: $(srcdir)/clk_dcf7000.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_dcf7000.c -o $@ -kclk_dcf7000_.o: clk_dcf7000_.c - $(COMPILE) $(K_CFLAGS) -c clk_dcf7000_.c -o $@ - -kclk_hopf6021.o: clk_hopf6021.c +kclk_hopf6021.o: $(srcdir)/clk_hopf6021.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_hopf6021.c -o $@ -kclk_hopf6021_.o: clk_hopf6021_.c - $(COMPILE) $(K_CFLAGS) -c clk_hopf6021_.c -o $@ - -kclk_meinberg.o: clk_meinberg.c +kclk_meinberg.o: $(srcdir)/clk_meinberg.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_meinberg.c -o $@ -kclk_meinberg_.o: clk_meinberg_.c - $(COMPILE) $(K_CFLAGS) -c clk_meinberg_.c -o $@ - -kclk_rawdcf.o: clk_rawdcf.c +kclk_rawdcf.o: $(srcdir)/clk_rawdcf.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_rawdcf.c -o $@ -kclk_rawdcf_.o: clk_rawdcf_.c - $(COMPILE) $(K_CFLAGS) -c clk_rawdcf_.c -o $@ - -kclk_rcc8000.o: clk_rcc8000.c +kclk_rcc8000.o: $(srcdir)/clk_rcc8000.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_rcc8000.c -o $@ -kclk_rcc8000_.o: clk_rcc8000_.c - $(COMPILE) $(K_CFLAGS) -c clk_rcc8000_.c -o $@ - -kclk_schmid.o: clk_schmid.c +kclk_schmid.o: $(srcdir)/clk_schmid.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_schmid.c -o $@ -kclk_schmid_.o: clk_schmid_.c - $(COMPILE) $(K_CFLAGS) -c clk_schmid_.c -o $@ - -kclk_trimtaip.o: clk_trimtaip.c +kclk_trimtaip.o: $(srcdir)/clk_trimtaip.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_trimtaip.c -o $@ -kclk_trimtaip_.o: clk_trimtaip_.c - $(COMPILE) $(K_CFLAGS) -c clk_trimtaip_.c -o $@ - -kclk_trimtsip.o: clk_trimtsip.c +kclk_trimtsip.o: $(srcdir)/clk_trimtsip.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_trimtsip.c -o $@ -kclk_trimtsip_.o: clk_trimtsip_.c - $(COMPILE) $(K_CFLAGS) -c clk_trimtsip_.c -o $@ - -kclk_varitext.o: clk_varitext.c +kclk_varitext.o: $(srcdir)/clk_varitext.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_varitext.c -o $@ -kclk_varitext_.o: clk_varitext_.c - $(COMPILE) $(K_CFLAGS) -c clk_varitext_.c -o $@ - -kclk_wharton.o: clk_wharton.c +kclk_wharton.o: $(srcdir)/clk_wharton.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_wharton.c -o $@ -kclk_wharton_.o: clk_wharton_.c - $(COMPILE) $(K_CFLAGS) -c clk_wharton_.c -o $@ +kclk_sel240x.o: $(srcdir)/clk_sel240x.c + $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_sel240x.c -o $@ -kparse.o: parse.c +kparse.o: $(srcdir)/parse.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/parse.c -o $@ -kparse_.o: parse_.c - $(COMPILE) $(K_CFLAGS) -c parse_.c -o $@ - -kparse_conf.o: parse_conf.c +kparse_conf.o: $(srcdir)/parse_conf.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/parse_conf.c -o $@ -kparse_conf_.o: parse_conf_.c - $(COMPILE) $(K_CFLAGS) -c parse_conf_.c -o $@ - parsestreams.loadable_module.o: $(parsestreams_OBJECTS) libparse_kernel.a ../libntp/libntp.a $(LD) -r -o $@ $(parsestreams_OBJECTS) libparse_kernel.a ../libntp/libntp.a parse: $(parsesolaris_OBJECTS) libparse_kernel.a ../libntp/libntp.a $(LD) -r -o $@ $(parsesolaris_OBJECTS) libparse_kernel.a ../libntp/libntp.a -../libntp/libntp.a: - cd ../libntp && $(MAKE) - parsesolaris.o: sys/systm.h sys/systm.h: - mkdir sys && \ + -mkdir sys sed -e '/ffs(.*)/d' < /usr/include/sys/systm.h > sys/systm.h + +## check-libparse is invoked by ntpd/Makefile.am +check-libparse: $(noinst_LIBRARIES) + @: do-nothing action to avoid default SCCS get + +include $(top_srcdir)/sntp/check-libntp.mf +include $(top_srcdir)/depsver.mf +include $(top_srcdir)/includes.mf diff --git a/contrib/ntp/libparse/Makefile.in b/contrib/ntp/libparse/Makefile.in index 7307c15..4b15dd6 100644 --- a/contrib/ntp/libparse/Makefile.in +++ b/contrib/ntp/libparse/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -17,6 +16,61 @@ VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -35,110 +89,227 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -ANSI2KNR = ../util/ansi2knr EXTRA_PROGRAMS = parsestreams$(EXEEXT) parsesolaris$(EXEEXT) subdir = libparse -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \ - $(top_srcdir)/m4/define_dir.m4 \ - $(top_srcdir)/m4/hs_ulong_const.m4 \ - $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/version.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ + $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ + $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \ + $(top_srcdir)/sntp/m4/define_dir.m4 \ + $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ + $(top_srcdir)/sntp/m4/libtool.m4 \ + $(top_srcdir)/sntp/m4/ltoptions.m4 \ + $(top_srcdir)/sntp/m4/ltsugar.m4 \ + $(top_srcdir)/sntp/m4/ltversion.m4 \ + $(top_srcdir)/sntp/m4/lt~obsolete.m4 \ + $(top_srcdir)/sntp/m4/ntp_cacheversion.m4 \ + $(top_srcdir)/sntp/m4/ntp_compiler.m4 \ + $(top_srcdir)/sntp/m4/ntp_crosscompile.m4 \ + $(top_srcdir)/sntp/m4/ntp_crypto_rand.m4 \ + $(top_srcdir)/sntp/m4/ntp_debug.m4 \ + $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \ + $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \ + $(top_srcdir)/sntp/m4/ntp_googletest.m4 \ + $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \ + $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \ + $(top_srcdir)/sntp/m4/ntp_libevent.m4 \ + $(top_srcdir)/sntp/m4/ntp_libntp.m4 \ + $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \ + $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \ + $(top_srcdir)/sntp/m4/ntp_openssl.m4 \ + $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \ + $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \ + $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \ + $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ + $(top_srcdir)/sntp/m4/ntp_unitytest.m4 \ + $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ + $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/os_cflags.m4 \ + $(top_srcdir)/sntp/m4/snprintf.m4 \ + $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS ?= cru +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = libparse_a_AR = $(AR) $(ARFLAGS) libparse_a_LIBADD = -am_libparse_a_OBJECTS = parse$U.$(OBJEXT) parse_conf$U.$(OBJEXT) \ - clk_meinberg$U.$(OBJEXT) clk_schmid$U.$(OBJEXT) \ - clk_rawdcf$U.$(OBJEXT) clk_trimtsip$U.$(OBJEXT) \ - clk_dcf7000$U.$(OBJEXT) clk_trimtaip$U.$(OBJEXT) \ - clk_rcc8000$U.$(OBJEXT) clk_hopf6021$U.$(OBJEXT) \ - clk_computime$U.$(OBJEXT) clk_wharton$U.$(OBJEXT) \ - clk_varitext$U.$(OBJEXT) data_mbg$U.$(OBJEXT) \ - info_trimble$U.$(OBJEXT) trim_info$U.$(OBJEXT) \ - binio$U.$(OBJEXT) ieee754io$U.$(OBJEXT) mfp_mul$U.$(OBJEXT) \ - gpstolfp$U.$(OBJEXT) +am__objects_1 = +am_libparse_a_OBJECTS = parse.$(OBJEXT) parse_conf.$(OBJEXT) \ + clk_meinberg.$(OBJEXT) clk_schmid.$(OBJEXT) \ + clk_rawdcf.$(OBJEXT) clk_trimtsip.$(OBJEXT) \ + clk_dcf7000.$(OBJEXT) clk_trimtaip.$(OBJEXT) \ + clk_rcc8000.$(OBJEXT) clk_hopf6021.$(OBJEXT) \ + clk_computime.$(OBJEXT) clk_wharton.$(OBJEXT) \ + clk_varitext.$(OBJEXT) clk_sel240x.$(OBJEXT) \ + data_mbg.$(OBJEXT) info_trimble.$(OBJEXT) trim_info.$(OBJEXT) \ + binio.$(OBJEXT) ieee754io.$(OBJEXT) mfp_mul.$(OBJEXT) \ + gpstolfp.$(OBJEXT) $(am__objects_1) libparse_a_OBJECTS = $(am_libparse_a_OBJECTS) libparse_kernel_a_AR = $(AR) $(ARFLAGS) -libparse_kernel_a_DEPENDENCIES = kparse$U.o kparse_conf$U.o \ - kclk_computime$U.o kclk_dcf7000$U.o kclk_hopf6021$U.o \ - kclk_meinberg$U.o kclk_rawdcf$U.o kclk_rcc8000$U.o \ - kclk_schmid$U.o kclk_trimtaip$U.o kclk_trimtsip$U.o \ - kclk_varitext$U.o kclk_wharton$U.o kbinio$U.o kieee754io$U.o \ - kmfp_mul$U.o kgpstolfp$U.o +am__DEPENDENCIES_1 = +libparse_kernel_a_DEPENDENCIES = kparse.o kparse_conf.o \ + kclk_computime.o kclk_dcf7000.o kclk_hopf6021.o \ + kclk_meinberg.o kclk_rawdcf.o kclk_rcc8000.o kclk_schmid.o \ + kclk_trimtaip.o kclk_trimtsip.o kclk_varitext.o kclk_wharton.o \ + kclk_sel240x.o kbinio.o kieee754io.o kmfp_mul.o kgpstolfp.o \ + $(am__DEPENDENCIES_1) am_libparse_kernel_a_OBJECTS = libparse_kernel_a_OBJECTS = $(am_libparse_kernel_a_OBJECTS) PROGRAMS = $(noinst_PROGRAMS) parsesolaris_SOURCES = parsesolaris.c -parsesolaris_OBJECTS = parsesolaris$U.$(OBJEXT) +parsesolaris_OBJECTS = parsesolaris.$(OBJEXT) parsesolaris_LDADD = $(LDADD) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = parsestreams_SOURCES = parsestreams.c -parsestreams_OBJECTS = parsestreams$U.$(OBJEXT) +parsestreams_OBJECTS = parsestreams.$(OBJEXT) parsestreams_LDADD = $(LDADD) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/sntp/libevent/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(libparse_a_SOURCES) $(libparse_kernel_a_SOURCES) \ parsesolaris.c parsestreams.c DIST_SOURCES = $(libparse_a_SOURCES) $(libparse_kernel_a_SOURCES) \ parsesolaris.c parsestreams.c +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depsver.mf \ + $(top_srcdir)/includes.mf $(top_srcdir)/sntp/check-libntp.mf \ + $(top_srcdir)/sntp/libevent/build-aux/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARLIB_DIR = @ARLIB_DIR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ -BINSUBDIR = @BINSUBDIR@ +CALC_TICKADJ_DB = @CALC_TICKADJ_DB@ +CALC_TICKADJ_DL = @CALC_TICKADJ_DL@ +CALC_TICKADJ_DS = @CALC_TICKADJ_DS@ +CALC_TICKADJ_MS = @CALC_TICKADJ_MS@ +CALC_TICKADJ_NI = @CALC_TICKADJ_NI@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CFLAGS_NTP = @CFLAGS_NTP@ CHUTEST = @CHUTEST@ -CLKTEST = @CLKTEST@ +CONFIG_SHELL = @CONFIG_SHELL@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@ +CPPFLAGS_NTP = @CPPFLAGS_NTP@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DCFD = @DCFD@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -ECHO = @ECHO@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ -EF_LIBS = @EF_LIBS@ -EF_PROGS = @EF_PROGS@ +EDITLINE_LIBS = @EDITLINE_LIBS@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +FGREP = @FGREP@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_CPPFLAGS = @GTEST_CPPFLAGS@ +GTEST_CXXFLAGS = @GTEST_CXXFLAGS@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ +GTEST_LIBS = @GTEST_LIBS@ HAVE_INLINE = @HAVE_INLINE@ +HAVE_LEAPSMEARINTERVAL = @HAVE_LEAPSMEARINTERVAL@ +HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@ +HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LCRYPTO = @LCRYPTO@ +LD = @LD@ +LDADD_LIBEVENT = @LDADD_LIBEVENT@ +LDADD_LIBNTP = @LDADD_LIBNTP@ +LDADD_LIBUTIL = @LDADD_LIBUTIL@ +LDADD_NLIST = @LDADD_NLIST@ +LDADD_NTP = @LDADD_NTP@ LDFLAGS = @LDFLAGS@ +LDFLAGS_NTP = @LDFLAGS_NTP@ +LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@ +LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@ LIBOPTS_DIR = @LIBOPTS_DIR@ @@ -146,6 +317,8 @@ LIBOPTS_LDADD = @LIBOPTS_LDADD@ LIBPARSE = @LIBPARSE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ LN_S = @LN_S@ LSCF = @LSCF@ LTLIBOBJS = @LTLIBOBJS@ @@ -157,15 +330,76 @@ MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@ MAKE_LIBPARSE = @MAKE_LIBPARSE@ MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@ MAKE_NTPDSIM = @MAKE_NTPDSIM@ +MAKE_NTPSNMPD = @MAKE_NTPSNMPD@ MAKE_NTPTIME = @MAKE_NTPTIME@ MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@ MAKE_TICKADJ = @MAKE_TICKADJ@ MAKE_TIMETRIM = @MAKE_TIMETRIM@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MANTAGFMT = @MANTAGFMT@ MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NTPDATE_DB = @NTPDATE_DB@ +NTPDATE_DL = @NTPDATE_DL@ +NTPDATE_DS = @NTPDATE_DS@ +NTPDATE_MS = @NTPDATE_MS@ +NTPDATE_NI = @NTPDATE_NI@ +NTPDC_DB = @NTPDC_DB@ +NTPDC_DL = @NTPDC_DL@ +NTPDC_DS = @NTPDC_DS@ +NTPDC_MS = @NTPDC_MS@ +NTPDC_NI = @NTPDC_NI@ +NTPDSIM_DB = @NTPDSIM_DB@ +NTPDSIM_DL = @NTPDSIM_DL@ +NTPDSIM_DS = @NTPDSIM_DS@ +NTPDSIM_MS = @NTPDSIM_MS@ +NTPDSIM_NI = @NTPDSIM_NI@ +NTPD_DB = @NTPD_DB@ +NTPD_DL = @NTPD_DL@ +NTPD_DS = @NTPD_DS@ +NTPD_MS = @NTPD_MS@ +NTPD_NI = @NTPD_NI@ +NTPQ_DB = @NTPQ_DB@ +NTPQ_DL = @NTPQ_DL@ +NTPQ_DS = @NTPQ_DS@ +NTPQ_MS = @NTPQ_MS@ +NTPQ_NI = @NTPQ_NI@ +NTPSNMPD_DB = @NTPSNMPD_DB@ +NTPSNMPD_DL = @NTPSNMPD_DL@ +NTPSNMPD_DS = @NTPSNMPD_DS@ +NTPSNMPD_MS = @NTPSNMPD_MS@ +NTPSNMPD_NI = @NTPSNMPD_NI@ +NTPSWEEP_DB = @NTPSWEEP_DB@ +NTPSWEEP_DL = @NTPSWEEP_DL@ +NTPSWEEP_DS = @NTPSWEEP_DS@ +NTPSWEEP_MS = @NTPSWEEP_MS@ +NTPSWEEP_NI = @NTPSWEEP_NI@ +NTPTIME_DB = @NTPTIME_DB@ +NTPTIME_DL = @NTPTIME_DL@ +NTPTIME_DS = @NTPTIME_DS@ +NTPTIME_MS = @NTPTIME_MS@ +NTPTIME_NI = @NTPTIME_NI@ +NTPTRACE_DB = @NTPTRACE_DB@ +NTPTRACE_DL = @NTPTRACE_DL@ +NTPTRACE_DS = @NTPTRACE_DS@ +NTPTRACE_MS = @NTPTRACE_MS@ +NTPTRACE_NI = @NTPTRACE_NI@ +NTP_KEYGEN_DB = @NTP_KEYGEN_DB@ +NTP_KEYGEN_DL = @NTP_KEYGEN_DL@ +NTP_KEYGEN_DS = @NTP_KEYGEN_DS@ +NTP_KEYGEN_MS = @NTP_KEYGEN_MS@ +NTP_KEYGEN_NI = @NTP_KEYGEN_NI@ +NTP_KEYSDIR = @NTP_KEYSDIR@ +NTP_WAIT_DB = @NTP_WAIT_DB@ +NTP_WAIT_DL = @NTP_WAIT_DL@ +NTP_WAIT_DS = @NTP_WAIT_DS@ +NTP_WAIT_MS = @NTP_WAIT_MS@ +NTP_WAIT_NI = @NTP_WAIT_NI@ +OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL = @OPENSSL@ -OPENSSL_INC = @OPENSSL_INC@ -OPENSSL_LIB = @OPENSSL_LIB@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -173,23 +407,59 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@ PATH_PERL = @PATH_PERL@ +PATH_RUBY = @PATH_RUBY@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PATH_SH = @PATH_SH@ +PATH_TEST = @PATH_TEST@ +PERLLIBDIR = @PERLLIBDIR@ +PKG_CONFIG = @PKG_CONFIG@ +POSIX_SHELL = @POSIX_SHELL@ PROPDELAY = @PROPDELAY@ +PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ -READLINE_LIBS = @READLINE_LIBS@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SNMP_CFLAGS = @SNMP_CFLAGS@ +SNMP_CPPFLAGS = @SNMP_CPPFLAGS@ +SNMP_LIBS = @SNMP_LIBS@ +SNTP = @SNTP@ +SNTP_DB = @SNTP_DB@ +SNTP_DL = @SNTP_DL@ +SNTP_DS = @SNTP_DS@ +SNTP_MS = @SNTP_MS@ +SNTP_NI = @SNTP_NI@ +STDNORETURN_H = @STDNORETURN_H@ STRIP = @STRIP@ TESTDCF = @TESTDCF@ -U = @U@ +TICKADJ_DB = @TICKADJ_DB@ +TICKADJ_DL = @TICKADJ_DL@ +TICKADJ_DS = @TICKADJ_DS@ +TICKADJ_MS = @TICKADJ_MS@ +TICKADJ_NI = @TICKADJ_NI@ +TIMETRIM_DB = @TIMETRIM_DB@ +TIMETRIM_DL = @TIMETRIM_DL@ +TIMETRIM_DS = @TIMETRIM_DS@ +TIMETRIM_MS = @TIMETRIM_MS@ +TIMETRIM_NI = @TIMETRIM_NI@ +UPDATE_LEAP_DB = @UPDATE_LEAP_DB@ +UPDATE_LEAP_DL = @UPDATE_LEAP_DL@ +UPDATE_LEAP_DS = @UPDATE_LEAP_DS@ +UPDATE_LEAP_MS = @UPDATE_LEAP_MS@ +UPDATE_LEAP_NI = @UPDATE_LEAP_NI@ VERSION = @VERSION@ +VER_SUFFIX = @VER_SUFFIX@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -236,62 +506,85 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ - -#AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies -AUTOMAKE_OPTIONS = ../util/ansi2knr +NULL = +BUILT_SOURCES = $(VPHACK) info_trimble.c $(VPHACK_AFTER) check-libntp \ + .deps-ver +CLEANFILES = check-libntp .deps-ver noinst_LIBRARIES = @MAKE_LIBPARSE@ @MAKE_LIBPARSE_KERNEL@ EXTRA_LIBRARIES = libparse.a libparse_kernel.a noinst_PROGRAMS = @MAKE_PARSEKMODULE@ -CLEANFILES = libparse.a libparse_kernel.a K_CFLAGS = -DPARSESTREAM -DNTP_NEED_BOPS +@VPATH_HACK_FALSE@VPHACK = + +# info_trimble.c was mistakenly created in the build directory +# previously. It is located in $(srcdir) and any updates must +# end up there. + +# +# VPHACK and VPHACK_AFTER are enabled on non-GNU makes (such as +# BSD make) to work around build/dependency issues where we want +# built source files to live in srcdir, as opposed to builddir. +# +@VPATH_HACK_TRUE@VPHACK = vphack +@VPATH_HACK_FALSE@VPHACK_AFTER = +@VPATH_HACK_TRUE@VPHACK_AFTER = vphack_after libparse_a_SOURCES = parse.c \ - parse_conf.c \ - clk_meinberg.c \ - clk_schmid.c \ + parse_conf.c \ + clk_meinberg.c \ + clk_schmid.c \ clk_rawdcf.c \ clk_trimtsip.c \ - clk_dcf7000.c \ - clk_trimtaip.c \ - clk_rcc8000.c \ - clk_hopf6021.c \ - clk_computime.c \ + clk_dcf7000.c \ + clk_trimtaip.c \ + clk_rcc8000.c \ + clk_hopf6021.c \ + clk_computime.c \ clk_wharton.c \ clk_varitext.c \ - data_mbg.c \ + clk_sel240x.c \ + data_mbg.c \ info_trimble.c \ trim_info.c \ binio.c \ ieee754io.c \ mfp_mul.c \ - gpstolfp.c + gpstolfp.c \ + $(NULL) libparse_kernel_a_SOURCES = -libparse_kernel_a_LIBADD = kparse$U.o \ - kparse_conf$U.o \ - kclk_computime$U.o \ - kclk_dcf7000$U.o \ - kclk_hopf6021$U.o \ - kclk_meinberg$U.o \ - kclk_rawdcf$U.o \ - kclk_rcc8000$U.o \ - kclk_schmid$U.o \ - kclk_trimtaip$U.o \ - kclk_trimtsip$U.o \ - kclk_varitext$U.o \ - kclk_wharton$U.o \ - kbinio$U.o \ - kieee754io$U.o \ - kmfp_mul$U.o \ - kgpstolfp$U.o - -INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/kernel -ETAGS_ARGS = Makefile.am +libparse_kernel_a_LIBADD = \ + kparse.o \ + kparse_conf.o \ + kclk_computime.o \ + kclk_dcf7000.o \ + kclk_hopf6021.o \ + kclk_meinberg.o \ + kclk_rawdcf.o \ + kclk_rcc8000.o \ + kclk_schmid.o \ + kclk_trimtaip.o \ + kclk_trimtsip.o \ + kclk_varitext.o \ + kclk_wharton.o \ + kclk_sel240x.o \ + kbinio.o \ + kieee754io.o \ + kmfp_mul.o \ + kgpstolfp.o \ + $(NULL) + +AM_CFLAGS = $(CFLAGS_NTP) +AM_CPPFLAGS = $(NTP_INCS) -I$(top_srcdir)/kernel $(CPPFLAGS_NTP) EXTRA_DIST = parsesolaris.c parsestreams.c mkinfo_scmd.sed mkinfo_rcmd.sed info_trimble.c -all: all-am +NTP_INCS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ + -I$(top_srcdir)/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ + -I$(top_srcdir)/lib/isc/unix/include +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/sntp/check-libntp.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -303,7 +596,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libparse/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libparse/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -312,6 +604,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; +$(top_srcdir)/sntp/check-libntp.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -324,14 +617,16 @@ $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -libparse.a: $(libparse_a_OBJECTS) $(libparse_a_DEPENDENCIES) - -rm -f libparse.a - $(libparse_a_AR) libparse.a $(libparse_a_OBJECTS) $(libparse_a_LIBADD) - $(RANLIB) libparse.a -libparse_kernel.a: $(libparse_kernel_a_OBJECTS) $(libparse_kernel_a_DEPENDENCIES) - -rm -f libparse_kernel.a - $(libparse_kernel_a_AR) libparse_kernel.a $(libparse_kernel_a_OBJECTS) $(libparse_kernel_a_LIBADD) - $(RANLIB) libparse_kernel.a + +libparse.a: $(libparse_a_OBJECTS) $(libparse_a_DEPENDENCIES) $(EXTRA_libparse_a_DEPENDENCIES) + $(AM_V_at)-rm -f libparse.a + $(AM_V_AR)$(libparse_a_AR) libparse.a $(libparse_a_OBJECTS) $(libparse_a_LIBADD) + $(AM_V_at)$(RANLIB) libparse.a + +libparse_kernel.a: $(libparse_kernel_a_OBJECTS) $(libparse_kernel_a_DEPENDENCIES) $(EXTRA_libparse_kernel_a_DEPENDENCIES) + $(AM_V_at)-rm -f libparse_kernel.a + $(AM_V_AR)$(libparse_kernel_a_AR) libparse_kernel.a $(libparse_kernel_a_OBJECTS) $(libparse_kernel_a_LIBADD) + $(AM_V_at)$(RANLIB) libparse_kernel.a clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ @@ -341,125 +636,65 @@ clean-noinstPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -parsesolaris$(EXEEXT): $(parsesolaris_OBJECTS) $(parsesolaris_DEPENDENCIES) + +parsesolaris$(EXEEXT): $(parsesolaris_OBJECTS) $(parsesolaris_DEPENDENCIES) $(EXTRA_parsesolaris_DEPENDENCIES) @rm -f parsesolaris$(EXEEXT) - $(LINK) $(parsesolaris_OBJECTS) $(parsesolaris_LDADD) $(LIBS) -parsestreams$(EXEEXT): $(parsestreams_OBJECTS) $(parsestreams_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(parsesolaris_OBJECTS) $(parsesolaris_LDADD) $(LIBS) + +parsestreams$(EXEEXT): $(parsestreams_OBJECTS) $(parsestreams_DEPENDENCIES) $(EXTRA_parsestreams_DEPENDENCIES) @rm -f parsestreams$(EXEEXT) - $(LINK) $(parsestreams_OBJECTS) $(parsestreams_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(parsestreams_OBJECTS) $(parsestreams_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c -../util/ansi2knr: - $(am__cd) ../util && $(MAKE) $(AM_MAKEFLAGS) ./ansi2knr - -mostlyclean-kr: - -test "$U" = "" || rm -f *_.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binio$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_computime$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_dcf7000$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_hopf6021$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_meinberg$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_rawdcf$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_rcc8000$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_schmid$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_trimtaip$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_trimtsip$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_varitext$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_wharton$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data_mbg$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpstolfp$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ieee754io$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/info_trimble$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mfp_mul$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_conf$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsesolaris$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsestreams$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trim_info$U.Po@am__quote@ + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_computime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_dcf7000.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_hopf6021.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_meinberg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_rawdcf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_rcc8000.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_schmid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_sel240x.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_trimtaip.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_trimtsip.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_varitext.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_wharton.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data_mbg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpstolfp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ieee754io.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/info_trimble.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mfp_mul.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_conf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsesolaris.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsestreams.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trim_info.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< -binio_.c: binio.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/binio.c; then echo $(srcdir)/binio.c; else echo binio.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -clk_computime_.c: clk_computime.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/clk_computime.c; then echo $(srcdir)/clk_computime.c; else echo clk_computime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -clk_dcf7000_.c: clk_dcf7000.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/clk_dcf7000.c; then echo $(srcdir)/clk_dcf7000.c; else echo clk_dcf7000.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -clk_hopf6021_.c: clk_hopf6021.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/clk_hopf6021.c; then echo $(srcdir)/clk_hopf6021.c; else echo clk_hopf6021.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -clk_meinberg_.c: clk_meinberg.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/clk_meinberg.c; then echo $(srcdir)/clk_meinberg.c; else echo clk_meinberg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -clk_rawdcf_.c: clk_rawdcf.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/clk_rawdcf.c; then echo $(srcdir)/clk_rawdcf.c; else echo clk_rawdcf.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -clk_rcc8000_.c: clk_rcc8000.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/clk_rcc8000.c; then echo $(srcdir)/clk_rcc8000.c; else echo clk_rcc8000.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -clk_schmid_.c: clk_schmid.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/clk_schmid.c; then echo $(srcdir)/clk_schmid.c; else echo clk_schmid.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -clk_trimtaip_.c: clk_trimtaip.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/clk_trimtaip.c; then echo $(srcdir)/clk_trimtaip.c; else echo clk_trimtaip.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -clk_trimtsip_.c: clk_trimtsip.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/clk_trimtsip.c; then echo $(srcdir)/clk_trimtsip.c; else echo clk_trimtsip.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -clk_varitext_.c: clk_varitext.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/clk_varitext.c; then echo $(srcdir)/clk_varitext.c; else echo clk_varitext.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -clk_wharton_.c: clk_wharton.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/clk_wharton.c; then echo $(srcdir)/clk_wharton.c; else echo clk_wharton.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -data_mbg_.c: data_mbg.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/data_mbg.c; then echo $(srcdir)/data_mbg.c; else echo data_mbg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -gpstolfp_.c: gpstolfp.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/gpstolfp.c; then echo $(srcdir)/gpstolfp.c; else echo gpstolfp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -ieee754io_.c: ieee754io.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ieee754io.c; then echo $(srcdir)/ieee754io.c; else echo ieee754io.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -info_trimble_.c: info_trimble.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/info_trimble.c; then echo $(srcdir)/info_trimble.c; else echo info_trimble.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -mfp_mul_.c: mfp_mul.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mfp_mul.c; then echo $(srcdir)/mfp_mul.c; else echo mfp_mul.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -parse_.c: parse.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/parse.c; then echo $(srcdir)/parse.c; else echo parse.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -parse_conf_.c: parse_conf.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/parse_conf.c; then echo $(srcdir)/parse_conf.c; else echo parse_conf.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -parsesolaris_.c: parsesolaris.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/parsesolaris.c; then echo $(srcdir)/parsesolaris.c; else echo parsesolaris.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -parsestreams_.c: parsestreams.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/parsestreams.c; then echo $(srcdir)/parsestreams.c; else echo parsestreams.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -trim_info_.c: trim_info.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/trim_info.c; then echo $(srcdir)/trim_info.c; else echo trim_info.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -binio_.$(OBJEXT) binio_.lo clk_computime_.$(OBJEXT) clk_computime_.lo \ -clk_dcf7000_.$(OBJEXT) clk_dcf7000_.lo clk_hopf6021_.$(OBJEXT) \ -clk_hopf6021_.lo clk_meinberg_.$(OBJEXT) clk_meinberg_.lo \ -clk_rawdcf_.$(OBJEXT) clk_rawdcf_.lo clk_rcc8000_.$(OBJEXT) \ -clk_rcc8000_.lo clk_schmid_.$(OBJEXT) clk_schmid_.lo \ -clk_trimtaip_.$(OBJEXT) clk_trimtaip_.lo clk_trimtsip_.$(OBJEXT) \ -clk_trimtsip_.lo clk_varitext_.$(OBJEXT) clk_varitext_.lo \ -clk_wharton_.$(OBJEXT) clk_wharton_.lo data_mbg_.$(OBJEXT) \ -data_mbg_.lo gpstolfp_.$(OBJEXT) gpstolfp_.lo ieee754io_.$(OBJEXT) \ -ieee754io_.lo info_trimble_.$(OBJEXT) info_trimble_.lo \ -mfp_mul_.$(OBJEXT) mfp_mul_.lo parse_.$(OBJEXT) parse_.lo \ -parse_conf_.$(OBJEXT) parse_conf_.lo parsesolaris_.$(OBJEXT) \ -parsesolaris_.lo parsestreams_.$(OBJEXT) parsestreams_.lo \ -trim_info_.$(OBJEXT) trim_info_.lo : $(ANSI2KNR) +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo @@ -467,26 +702,15 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -498,15 +722,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -515,6 +735,21 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -550,10 +785,12 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am -check: check-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LIBRARIES) $(PROGRAMS) installdirs: -install: install-am +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -563,10 +800,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: @@ -579,6 +821,7 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ @@ -637,7 +880,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am -mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr \ +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am @@ -650,136 +893,176 @@ ps-am: uninstall-am: -.MAKE: ../util/ansi2knr install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLIBRARIES clean-noinstPROGRAMS ctags \ - distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ +.MAKE: all check install install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLIBRARIES clean-noinstPROGRAMS \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-kr mostlyclean-libtool pdf \ - pdf-am ps ps-am tags uninstall uninstall-am + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am +.PRECIOUS: Makefile -# -# create info_trimble.c -# -info_trimble.c: $(top_srcdir)/include/trimble.h mkinfo_rcmd.sed mkinfo_scmd.sed - @rm -f info_trimble.c - sed -n -f $(srcdir)/mkinfo_scmd.sed $(top_srcdir)/include/trimble.h > info_trimble.c || rm -f info_trimble.c - sed -n -f $(srcdir)/mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> info_trimble.c || rm -f info_trimble.c -kieee754io.o: ieee754io.c +vphack: + test -e info_trimble.c || ln -s $(srcdir)/info_trimble.c . + +vphack_after: + test -L info_trimble.c || ( \ + mv info_trimble.c $(srcdir)/info_trimble.c && \ + ln -s $(srcdir)/info_trimble.c . \ + ) + +info_trimble.c: $(top_srcdir)/include/trimble.h $(srcdir)/Makefile.am $(srcdir)/mkinfo_scmd.sed $(srcdir)/mkinfo_rcmd.sed + sed -n -f $(srcdir)/mkinfo_scmd.sed $(top_srcdir)/include/trimble.h > info_trimble.new + sed -n -f $(srcdir)/mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> info_trimble.new + mv -f info_trimble.new $@ + +#$(srcdir)/info_trimble.c: $(top_srcdir)/include/trimble.h $(srcdir)/Makefile.am $(srcdir)/mkinfo_scmd.sed $(srcdir)/mkinfo_rcmd.sed +# sed -n -f $(srcdir)/mkinfo_scmd.sed $(top_srcdir)/include/trimble.h > info_trimble.new +# sed -n -f $(srcdir)/mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> info_trimble.new +# mv -f info_trimble.new $@ + +kieee754io.o: $(srcdir)/ieee754io.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/ieee754io.c -o $@ -kmfp_mul.o: mfp_mul.c +kmfp_mul.o: $(srcdir)/mfp_mul.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/mfp_mul.c -o $@ -kgpstolfp.o: gpstolfp.c +kgpstolfp.o: $(srcdir)/gpstolfp.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/gpstolfp.c -o $@ -kbinio.o: binio.c +kbinio.o: $(srcdir)/binio.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/binio.c -o $@ -kclk_computime.o: clk_computime.c +kclk_computime.o: $(srcdir)/clk_computime.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_computime.c -o $@ -kclk_computime_.o: clk_computime_.c - $(COMPILE) $(K_CFLAGS) -c clk_computime_.c -o $@ - -kclk_dcf7000.o: clk_dcf7000.c +kclk_dcf7000.o: $(srcdir)/clk_dcf7000.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_dcf7000.c -o $@ -kclk_dcf7000_.o: clk_dcf7000_.c - $(COMPILE) $(K_CFLAGS) -c clk_dcf7000_.c -o $@ - -kclk_hopf6021.o: clk_hopf6021.c +kclk_hopf6021.o: $(srcdir)/clk_hopf6021.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_hopf6021.c -o $@ -kclk_hopf6021_.o: clk_hopf6021_.c - $(COMPILE) $(K_CFLAGS) -c clk_hopf6021_.c -o $@ - -kclk_meinberg.o: clk_meinberg.c +kclk_meinberg.o: $(srcdir)/clk_meinberg.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_meinberg.c -o $@ -kclk_meinberg_.o: clk_meinberg_.c - $(COMPILE) $(K_CFLAGS) -c clk_meinberg_.c -o $@ - -kclk_rawdcf.o: clk_rawdcf.c +kclk_rawdcf.o: $(srcdir)/clk_rawdcf.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_rawdcf.c -o $@ -kclk_rawdcf_.o: clk_rawdcf_.c - $(COMPILE) $(K_CFLAGS) -c clk_rawdcf_.c -o $@ - -kclk_rcc8000.o: clk_rcc8000.c +kclk_rcc8000.o: $(srcdir)/clk_rcc8000.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_rcc8000.c -o $@ -kclk_rcc8000_.o: clk_rcc8000_.c - $(COMPILE) $(K_CFLAGS) -c clk_rcc8000_.c -o $@ - -kclk_schmid.o: clk_schmid.c +kclk_schmid.o: $(srcdir)/clk_schmid.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_schmid.c -o $@ -kclk_schmid_.o: clk_schmid_.c - $(COMPILE) $(K_CFLAGS) -c clk_schmid_.c -o $@ - -kclk_trimtaip.o: clk_trimtaip.c +kclk_trimtaip.o: $(srcdir)/clk_trimtaip.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_trimtaip.c -o $@ -kclk_trimtaip_.o: clk_trimtaip_.c - $(COMPILE) $(K_CFLAGS) -c clk_trimtaip_.c -o $@ - -kclk_trimtsip.o: clk_trimtsip.c +kclk_trimtsip.o: $(srcdir)/clk_trimtsip.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_trimtsip.c -o $@ -kclk_trimtsip_.o: clk_trimtsip_.c - $(COMPILE) $(K_CFLAGS) -c clk_trimtsip_.c -o $@ - -kclk_varitext.o: clk_varitext.c +kclk_varitext.o: $(srcdir)/clk_varitext.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_varitext.c -o $@ -kclk_varitext_.o: clk_varitext_.c - $(COMPILE) $(K_CFLAGS) -c clk_varitext_.c -o $@ - -kclk_wharton.o: clk_wharton.c +kclk_wharton.o: $(srcdir)/clk_wharton.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_wharton.c -o $@ -kclk_wharton_.o: clk_wharton_.c - $(COMPILE) $(K_CFLAGS) -c clk_wharton_.c -o $@ +kclk_sel240x.o: $(srcdir)/clk_sel240x.c + $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_sel240x.c -o $@ -kparse.o: parse.c +kparse.o: $(srcdir)/parse.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/parse.c -o $@ -kparse_.o: parse_.c - $(COMPILE) $(K_CFLAGS) -c parse_.c -o $@ - -kparse_conf.o: parse_conf.c +kparse_conf.o: $(srcdir)/parse_conf.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/parse_conf.c -o $@ -kparse_conf_.o: parse_conf_.c - $(COMPILE) $(K_CFLAGS) -c parse_conf_.c -o $@ - parsestreams.loadable_module.o: $(parsestreams_OBJECTS) libparse_kernel.a ../libntp/libntp.a $(LD) -r -o $@ $(parsestreams_OBJECTS) libparse_kernel.a ../libntp/libntp.a parse: $(parsesolaris_OBJECTS) libparse_kernel.a ../libntp/libntp.a $(LD) -r -o $@ $(parsesolaris_OBJECTS) libparse_kernel.a ../libntp/libntp.a -../libntp/libntp.a: - cd ../libntp && $(MAKE) - parsesolaris.o: sys/systm.h sys/systm.h: - mkdir sys && \ + -mkdir sys sed -e '/ffs(.*)/d' < /usr/include/sys/systm.h > sys/systm.h +check-libparse: $(noinst_LIBRARIES) + @: do-nothing action to avoid default SCCS get + +check-libntp: ../libntp/libntp.a + @echo stamp > $@ + +../libntp/libntp.a: + cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a +$(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver + @[ -f $@ ] || \ + cp $(top_srcdir)/deps-ver $@ + @[ -w $@ ] || \ + chmod ug+w $@ + @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ + $(MAKE) $(AM_MAKEFLAGS) clean && \ + echo -n "Prior $(subdir)/$(DEPDIR) version " && \ + cat $@ && \ + rm -rf $(DEPDIR) && \ + mkdir $(DEPDIR) && \ + case "$(top_builddir)" in \ + .) \ + ./config.status Makefile depfiles \ + ;; \ + *) \ + cd "$(top_builddir)" && \ + ./config.status $(subdir)/Makefile depfiles && \ + cd $(subdir) \ + ;; \ + esac && \ + echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ + cat $(top_srcdir)/deps-ver \ + ) + cp $(top_srcdir)/deps-ver $@ + +.deps-ver: $(top_srcdir)/deps-ver + @[ ! -d $(DEPDIR) ] || $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/deps-ver + @touch $@ + +# +# depsver.mf included in Makefile.am for directories with .deps +# +# When building in the same directory with sources that change over +# time, such as when tracking using bk, the .deps files can become +# stale with respect to moved, deleted, or superceded headers. Most +# commonly, this would exhibit as make reporting a failure to make a +# header file which is no longer in the location given. To address +# this issue, we use a deps-ver file which is updated with each change +# that breaks old .deps files. A copy of deps-ver is made into +# $(DEPDIR) if not already present. If $(DEPDIR)/deps-ver is present +# with different contents than deps-ver, we make clean to ensure all +# .o files built before the incompatible change are rebuilt along with +# their updated .deps files, then remove $(DEPDIR) and recreate it as +# empty stubs. +# +# It is normal when configured with --disable-dependency-tracking for +# the DEPDIR to not have been created. For this reason, we use the +# intermediate target .deps-ver, which invokes make recursively if +# DEPDIR exists. +# +# If you modify depsver.mf, please make the changes to the master +# copy, the one in sntp is copied by the bootstrap script from it. +# +# This comment block follows rather than leads the related code so that +# it stays with it in the generated Makefile.in and Makefile. +# + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/contrib/ntp/libparse/binio.c b/contrib/ntp/libparse/binio.c index 2f8546b..24aa286 100644 --- a/contrib/ntp/libparse/binio.c +++ b/contrib/ntp/libparse/binio.c @@ -33,6 +33,7 @@ * */ +#include <config.h> #include "binio.h" long @@ -68,7 +69,7 @@ get_lsb_long( retval = *((*bufpp)++); retval |= *((*bufpp)++) << 8; retval |= *((*bufpp)++) << 16; - retval |= *((*bufpp)++) << 24; + retval |= (u_long)*((*bufpp)++) << 24; return retval; } @@ -115,7 +116,7 @@ get_msb_long( { long retval; - retval = *((*bufpp)++) << 24; + retval = (u_long)*((*bufpp)++) << 24; retval |= *((*bufpp)++) << 16; retval |= *((*bufpp)++) << 8; retval |= *((*bufpp)++); diff --git a/contrib/ntp/libparse/clk_computime.c b/contrib/ntp/libparse/clk_computime.c index d0db6a9..5026232 100644 --- a/contrib/ntp/libparse/clk_computime.c +++ b/contrib/ntp/libparse/clk_computime.c @@ -7,15 +7,15 @@ * /src/NTP/ntp4-dev/libparse/clk_computime.c,v 4.10 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * clk_computime.c,v 4.10 2005/04/16 17:32:10 kardel RELEASE_20050508_A - * + * * Supports Diem's Computime Radio Clock - * + * * Used the Meinberg clock as a template for Diem's Computime Radio Clock * * adapted by Alois Camenzind <alois.camenzind@ubs.ch> - * + * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -54,27 +54,27 @@ #include <stdio.h> #else #include "sys/parsestreams.h" -extern void printf P((const char *, ...)); +extern int printf (const char *, ...); #endif /* * The Computime receiver sends a datagram in the following format every minute - * - * Timestamp T:YY:MM:MD:WD:HH:MM:SSCRLF + * + * Timestamp T:YY:MM:MD:WD:HH:MM:SSCRLF * Pos 0123456789012345678901 2 3 * 0000000000111111111122 2 2 * Parse T: : : : : : : rn - * - * T Startcharacter "T" specifies start of the timestamp - * YY Year MM Month 1-12 - * MD Day of the month - * WD Day of week - * HH Hour - * MM Minute + * + * T Startcharacter "T" specifies start of the timestamp + * YY Year MM Month 1-12 + * MD Day of the month + * WD Day of week + * HH Hour + * MM Minute * SS Second - * CR Carriage return + * CR Carriage return * LF Linefeed - * + * */ static struct format computime_fmt = @@ -88,10 +88,10 @@ static struct format computime_fmt = 0 }; -static u_long cvt_computime P((unsigned char *, int, struct format *, clocktime_t *, void *)); -static unsigned long inp_computime P((parse_t *, unsigned int, timestamp_t *)); +static parse_cvt_fnc_t cvt_computime; +static parse_inp_fnc_t inp_computime; -clockformat_t clock_computime = +clockformat_t clock_computime = { inp_computime, /* Computime input handling */ cvt_computime, /* Computime conversion */ @@ -99,15 +99,15 @@ clockformat_t clock_computime = (void *)&computime_fmt, /* conversion configuration */ "Diem's Computime Radio Clock", /* Computime Radio Clock */ 24, /* string buffer */ - 0 /* no private data (complete pakets) */ + 0 /* no private data (complete packets) */ }; /* - * cvt_computime - * + * parse_cvt_fnc_t cvt_computime + * * convert simple type format */ -static u_long +static u_long cvt_computime( unsigned char *buffer, int size, @@ -117,7 +117,7 @@ cvt_computime( ) { - if (!Strok(buffer, format->fixed_string)) { + if (!Strok(buffer, format->fixed_string)) { return CVT_NONE; } else { if (Stoi(&buffer[format->field_offsets[O_DAY].offset], &clock_time->day, @@ -131,7 +131,7 @@ cvt_computime( Stoi(&buffer[format->field_offsets[O_MIN].offset], &clock_time->minute, format->field_offsets[O_MIN].length) || Stoi(&buffer[format->field_offsets[O_SEC].offset], &clock_time->second, - format->field_offsets[O_SEC].length)) { + format->field_offsets[O_SEC].length)) { return CVT_FAIL | CVT_BADFMT; } else { @@ -144,31 +144,31 @@ cvt_computime( } /* - * inp_computime + * parse_inp_fnc_t inp_computime * - * grep data from input stream + * grab data from input stream */ static u_long inp_computime( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { unsigned int rtc; - + parseprintf(DD_PARSE, ("inp_computime(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); - + switch (ch) { case 'T': parseprintf(DD_PARSE, ("inp_computime: START seen\n")); - + parseio->parse_index = 1; parseio->parse_data[0] = ch; parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */ return PARSE_INP_SKIP; - + case '\n': parseprintf(DD_PARSE, ("inp_computime: END seen\n")); if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP) diff --git a/contrib/ntp/libparse/clk_dcf7000.c b/contrib/ntp/libparse/clk_dcf7000.c index e481731..f1da9ef 100644 --- a/contrib/ntp/libparse/clk_dcf7000.c +++ b/contrib/ntp/libparse/clk_dcf7000.c @@ -1,12 +1,12 @@ /* * /src/NTP/ntp4-dev/libparse/clk_dcf7000.c,v 4.10 2005/04/16 17:32:10 kardel RELEASE_20050508_A - * + * * clk_dcf7000.c,v 4.10 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * ELV DCF7000 module * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -51,7 +51,7 @@ #include <stdio.h> #else #include "sys/parsestreams.h" -extern void printf P((const char *, ...)); +extern int printf (const char *, ...); #endif static struct format dcf7000_fmt = @@ -63,9 +63,10 @@ static struct format dcf7000_fmt = }, (const unsigned char *)" - - - - - - - \r", 0 -}; -static u_long cvt_dcf7000 P((unsigned char *, int, struct format *, clocktime_t *, void *)); -static unsigned long inp_dcf7000 P((parse_t *, unsigned int, timestamp_t *)); +}; + +static parse_cvt_fnc_t cvt_dcf7000; +static parse_inp_fnc_t inp_dcf7000; clockformat_t clock_dcf7000 = { @@ -75,11 +76,11 @@ clockformat_t clock_dcf7000 = (void *)&dcf7000_fmt, /* conversion configuration */ "ELV DCF7000", /* ELV clock */ 24, /* string buffer */ - 0 /* no private data (complete pakets) */ + 0 /* no private data (complete packets) */ }; /* - * cvt_dcf7000 + * parse_cvt_fnc_t cvt_dcf7000 * * convert dcf7000 type format */ @@ -117,7 +118,7 @@ cvt_dcf7000( { unsigned char *f = &buffer[format->field_offsets[O_FLAGS].offset]; long flags; - + clock_time->flags = 0; clock_time->usecond = 0; @@ -144,21 +145,21 @@ cvt_dcf7000( } /* - * inp_dcf700 + * parse_inp_fnc_t inp_dcf700 * - * grep data from input stream + * grab data from input stream */ static u_long inp_dcf7000( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { unsigned int rtc; - + parseprintf(DD_PARSE, ("inp_dcf7000(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); - + switch (ch) { case '\r': diff --git a/contrib/ntp/libparse/clk_hopf6021.c b/contrib/ntp/libparse/clk_hopf6021.c index 426ea48..357ac2e 100644 --- a/contrib/ntp/libparse/clk_hopf6021.c +++ b/contrib/ntp/libparse/clk_hopf6021.c @@ -34,13 +34,13 @@ #include <stdio.h> #else #include "sys/parsestreams.h" -extern void printf P((const char *, ...)); +extern int printf (const char *, ...); #endif -/* - * hopf Funkuhr 6021 +/* + * hopf Funkuhr 6021 * used with 9600,8N1, - * UTC ueber serielle Schnittstelle + * UTC ueber serielle Schnittstelle * Sekundenvorlauf ON * ETX zum Sekundenvorlauf ON * Datenstring 6021 @@ -71,7 +71,7 @@ extern void printf P((const char *, ...)); * x x 0 x - Wintertime * x x 1 x - Summertime * 0 0 x x - Time/Date invalid - * 0 1 x x - Internal clock used + * 0 1 x x - Internal clock used * 1 0 x x - Radio clock * 1 1 x x - Radio clock highprecision * @@ -90,10 +90,10 @@ extern void printf P((const char *, ...)); #define HOPF_DSTWARN 0x01 /* DST switch warning */ #define HOPF_DST 0x02 /* DST in effect */ -#define HOPF_MODE 0x0C /* operation mode mask */ +#define HOPF_MODE 0x0C /* operation mode mask */ #define HOPF_INVALID 0x00 /* no time code available */ #define HOPF_INTERNAL 0x04 /* internal clock */ -#define HOPF_RADIO 0x08 /* radio clock */ +#define HOPF_RADIO 0x08 /* radio clock */ #define HOPF_RADIOHP 0x0C /* high precision radio clock */ #define HOPF_UTC 0x08 /* time code in UTC */ @@ -102,13 +102,13 @@ extern void printf P((const char *, ...)); static struct format hopf6021_fmt = { { - { 9, 2 }, {11, 2}, { 13, 2}, /* Day, Month, Year */ - { 3, 2 }, { 5, 2}, { 7, 2}, /* Hour, Minute, Second */ + { 9, 2 }, {11, 2}, { 13, 2}, /* Day, Month, Year */ + { 3, 2 }, { 5, 2}, { 7, 2}, /* Hour, Minute, Second */ { 2, 1 }, { 1, 1}, { 0, 0}, /* Weekday, Flags, Zone */ /* ... */ }, (const unsigned char *)"\002 \n\r\003", - 0 + 0 }; #define OFFS(x) format->field_offsets[(x)].offset @@ -118,8 +118,8 @@ static struct format hopf6021_fmt = ('A' <= (x) && (x) <= 'F') ? (x) - 'A' + 10 : \ -1) -static unsigned long cvt_hopf6021 P((unsigned char *, int, struct format *, clocktime_t *, void *)); -static unsigned long inp_hopf6021 P((parse_t *, unsigned int, timestamp_t *)); +static parse_cvt_fnc_t cvt_hopf6021; +static parse_inp_fnc_t inp_hopf6021; clockformat_t clock_hopf6021 = { @@ -132,7 +132,8 @@ clockformat_t clock_hopf6021 = 0 /* private data length, no private data */ }; -static unsigned long +/* parse_cvt_fnc_t cvt_hopf6021 */ +static u_long cvt_hopf6021( unsigned char *buffer, int size, @@ -162,8 +163,8 @@ cvt_hopf6021( clock_time->usecond = 0; clock_time->utcoffset = 0; - status = hexval(buffer[OFFS(O_FLAGS)]); - weekday= hexval(buffer[OFFS(O_WDAY)]); + status = (u_char) hexval(buffer[OFFS(O_FLAGS)]); + weekday= (u_char) hexval(buffer[OFFS(O_WDAY)]); if ((status == 0xFF) || (weekday == 0xFF)) { @@ -213,21 +214,21 @@ cvt_hopf6021( } /* - * inp_hopf6021 + * parse_inp_fnc_t inp_hopf6021 * - * grep data from input stream + * grab data from input stream */ static u_long inp_hopf6021( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { unsigned int rtc; - + parseprintf(DD_PARSE, ("inp_hopf6021(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); - + switch (ch) { case ETX: diff --git a/contrib/ntp/libparse/clk_meinberg.c b/contrib/ntp/libparse/clk_meinberg.c index 90bb886..9d2b676 100644 --- a/contrib/ntp/libparse/clk_meinberg.c +++ b/contrib/ntp/libparse/clk_meinberg.c @@ -1,12 +1,12 @@ /* * /src/NTP/REPOSITORY/ntp4-dev/libparse/clk_meinberg.c,v 4.12.2.1 2005/09/25 10:22:35 kardel RELEASE_20050925_A - * + * * clk_meinberg.c,v 4.12.2.1 2005/09/25 10:22:35 kardel RELEASE_20050925_A * * Meinberg clock support * - * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1995-2015 by Frank Kardel <kardel <AT> ntp.org> + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -65,7 +65,7 @@ /* * The Meinberg receiver every second sends a datagram of the following form * (Standard Format) - * + * * <STX>D:<dd>.<mm>.<yy>;T:<w>;U:<hh>:<mm>:<ss>;<S><F><D><A><ETX> * pos: 0 00 00 0 00 0 11 111 1 111 12 2 22 2 22 2 2 2 3 3 3 * 1 23 45 6 78 9 01 234 5 678 90 1 23 4 56 7 8 9 0 1 2 @@ -105,12 +105,14 @@ * <A> = '!' during the hour preceeding an daylight saving time * start/end change * <L> = 'A' LEAP second announcement - * <R> = 'R' alternate antenna + * <R> = 'R' "call bit" used to signalize irregularities in the control facilities, + * usually ' ', until 2003 indicated transmission via alternate antenna * - * Meinberg GPS166 receiver + * Meinberg GPS receivers * - * You must get the Uni-Erlangen firmware for the GPS receiver support + * For very old devices you must get the Uni-Erlangen firmware for the GPS receiver support * to work to full satisfaction ! + * With newer GPS receiver types the Uni Erlangen string format can be configured at the device. * * <STX><dd>.<mm>.<yy>; <w>; <hh>:<mm>:<ss>; <+/-><00:00>; <U><S><F><D><A><L><R><L>; <position...><ETX> * @@ -118,7 +120,7 @@ * 123456789012345678901234567890123456789012345678901234567890123456 * \x0209.07.93; 5; 08:48:26; +00:00; #*S!A L; 49.5736N 11.0280E 373m\x03 * - * + * * <STX> = '\002' ASCII start of text * <ETX> = '\003' ASCII end of text * <dd>,<mm>,<yy> = day, month, year(2 digits!!) @@ -131,8 +133,10 @@ * <A> = '!' during the hour preceeding an daylight saving time * start/end change * <L> = 'A' LEAP second announcement - * <R> = 'R' alternate antenna (reminiscent of PZF535) usually ' ' - * <L> = 'L' on 23:59:60 + * <R> = 'R' "call bit" used to signalize irregularities in the control facilities, + * usually ' ', until 2003 indicated transmission via alternate antenna + * (reminiscent of PZF receivers) + * <L> = 'L' on 23:59:60 * * Binary messages have a lead in for a fixed header of SOH */ @@ -150,19 +154,20 @@ /* Ret val: the checksum */ /*+-------------------------------------------------------------*/ -unsigned long +CSUM mbg_csum( unsigned char *p, unsigned int n ) { - unsigned long sum = 0; - short i; - + unsigned int sum = 0; + unsigned int i; + for ( i = 0; i < n; i++ ) sum += *p++; - - return( sum ); + + return (CSUM) sum; + } /* csum */ void @@ -171,10 +176,10 @@ get_mbg_header( GPS_MSG_HDR *headerp ) { - headerp->gps_cmd = get_lsb_short(bufpp); - headerp->gps_len = get_lsb_short(bufpp); - headerp->gps_data_csum = get_lsb_short(bufpp); - headerp->gps_hdr_csum = get_lsb_short(bufpp); + headerp->cmd = (GPS_CMD) get_lsb_short(bufpp); + headerp->len = get_lsb_uint16(bufpp); + headerp->data_csum = (CSUM) get_lsb_short(bufpp); + headerp->hdr_csum = (CSUM) get_lsb_short(bufpp); } static struct format meinberg_fmt[] = @@ -209,10 +214,10 @@ static struct format meinberg_fmt[] = } }; -static u_long cvt_meinberg P((unsigned char *, int, struct format *, clocktime_t *, void *)); -static u_long cvt_mgps P((unsigned char *, int, struct format *, clocktime_t *, void *)); -static u_long mbg_input P((parse_t *, unsigned int, timestamp_t *)); -static u_long gps_input P((parse_t *, unsigned int, timestamp_t *)); +static parse_cvt_fnc_t cvt_meinberg; +static parse_cvt_fnc_t cvt_mgps; +static parse_inp_fnc_t mbg_input; +static parse_inp_fnc_t gps_input; struct msg_buf { @@ -224,7 +229,7 @@ struct msg_buf #define MBG_HEADER 1 /* receiving header */ #define MBG_DATA 2 /* receiving data */ #define MBG_STRING 3 /* receiving standard data message */ - + clockformat_t clock_meinberg[] = { { @@ -234,7 +239,7 @@ clockformat_t clock_meinberg[] = 0, /* conversion configuration */ "Meinberg Standard", /* Meinberg simple format - beware */ 32, /* string buffer */ - 0 /* no private data (complete pakets) */ + 0 /* no private data (complete packets) */ }, { mbg_input, /* normal input handling */ @@ -243,21 +248,21 @@ clockformat_t clock_meinberg[] = 0, /* conversion configuration */ "Meinberg Extended", /* Meinberg enhanced format */ 32, /* string buffer */ - 0 /* no private data (complete pakets) */ + 0 /* no private data (complete packets) */ }, { gps_input, /* no input handling */ - cvt_mgps, /* Meinberg GPS166 conversion */ + cvt_mgps, /* Meinberg GPS receiver conversion */ pps_one, /* easy PPS monitoring */ (void *)&meinberg_fmt[2], /* conversion configuration */ - "Meinberg GPS Extended", /* Meinberg FAU GPS format */ + "Meinberg GPS Extended", /* Meinberg FAU GPS format */ 512, /* string buffer */ - sizeof(struct msg_buf) /* no private data (complete pakets) */ + sizeof(struct msg_buf) /* no private data (complete packets) */ } }; /* - * cvt_meinberg + * parse_cvt_fnc_t cvt_meinberg * * convert simple type format */ @@ -271,7 +276,7 @@ cvt_meinberg( ) { struct format *format; - + /* * select automagically correct data format */ @@ -312,7 +317,7 @@ cvt_meinberg( else { unsigned char *f = &buffer[format->field_offsets[O_FLAGS].offset]; - + clock_time->usecond = 0; clock_time->flags = PARSEB_S_LEAP; @@ -348,7 +353,7 @@ cvt_meinberg( case ' ': clock_time->utcoffset = -1*60*60; /* MET */ break; - + case 'S': clock_time->utcoffset = -2*60*60; /* MED */ break; @@ -360,27 +365,27 @@ cvt_meinberg( clock_time->utcoffset = 0; /* UTC */ clock_time->flags |= PARSEB_UTC; break; - + default: return CVT_FAIL|CVT_BADFMT; } } - + /* * gather status flags */ if (buffer[format->field_offsets[O_ZONE].offset] == 'S') clock_time->flags |= PARSEB_DST; - + if (f[0] == '#') clock_time->flags |= PARSEB_POWERUP; - + if (f[1] == '*') clock_time->flags |= PARSEB_NOSYNC; - + if (f[3] == '!') clock_time->flags |= PARSEB_ANNOUNCE; - + /* * oncoming leap second * 'a' code not confirmed - earth is not @@ -388,27 +393,27 @@ cvt_meinberg( */ if (f[3] == 'A') clock_time->flags |= PARSEB_LEAPADD; - + if (f[3] == 'a') clock_time->flags |= PARSEB_LEAPDEL; - - + + if (format->flags & MBG_EXTENDED) { - clock_time->flags |= PARSEB_S_ANTENNA; - + clock_time->flags |= PARSEB_S_CALLBIT; + /* * DCF77 does not encode the direction - * so we take the current default - * earth slowing down */ clock_time->flags &= ~PARSEB_LEAPDEL; - + if (f[4] == 'A') clock_time->flags |= PARSEB_LEAPADD; - + if (f[5] == 'R') - clock_time->flags |= PARSEB_ALTERNATE; + clock_time->flags |= PARSEB_CALLBIT; } return CVT_OK; } @@ -416,31 +421,31 @@ cvt_meinberg( /* - * mbg_input + * parse_inp_fnc_t mbg_input * - * grep data from input stream + * grab data from input stream */ static u_long mbg_input( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { unsigned int rtc; - + parseprintf(DD_PARSE, ("mbg_input(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); - + switch (ch) { case STX: parseprintf(DD_PARSE, ("mbg_input: STX seen\n")); - + parseio->parse_index = 1; parseio->parse_data[0] = ch; parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */ return PARSE_INP_SKIP; - + case ETX: parseprintf(DD_PARSE, ("mbg_input: ETX seen\n")); if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP) @@ -455,7 +460,7 @@ mbg_input( /* - * cvt_mgps + * parse_cvt_fnc_t cvt_mgps * * convert Meinberg GPS format */ @@ -493,9 +498,9 @@ cvt_mgps( { long h; unsigned char *f = &buffer[format->field_offsets[O_FLAGS].offset]; - + clock_time->flags = PARSEB_S_LEAP|PARSEB_S_POSITION; - + clock_time->usecond = 0; /* @@ -522,22 +527,22 @@ cvt_mgps( clock_time->utcoffset = -clock_time->utcoffset; } } - + /* * gather status flags */ if (buffer[format->field_offsets[O_ZONE].offset] == 'S') clock_time->flags |= PARSEB_DST; - + if (clock_time->utcoffset == 0) clock_time->flags |= PARSEB_UTC; - + /* * no sv's seen - no time & position */ if (f[0] == '#') clock_time->flags |= PARSEB_POWERUP; - + /* * at least one sv seen - time (for last position) */ @@ -546,13 +551,13 @@ cvt_mgps( else if (!(clock_time->flags & PARSEB_POWERUP)) clock_time->flags |= PARSEB_POSITION; - + /* * oncoming zone switch */ if (f[3] == '!') clock_time->flags |= PARSEB_ANNOUNCE; - + /* * oncoming leap second * 'a' code not confirmed - earth is not @@ -560,14 +565,14 @@ cvt_mgps( */ if (f[4] == 'A') clock_time->flags |= PARSEB_LEAPADD; - + if (f[4] == 'a') clock_time->flags |= PARSEB_LEAPDEL; /* * f[5] == ' ' */ - + /* * this is the leap second */ @@ -580,35 +585,35 @@ cvt_mgps( } /* - * gps_input + * parse_inp_fnc_t gps_input * * grep binary data from input stream */ static u_long gps_input( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { CSUM calc_csum; /* used to compare the incoming csums */ GPS_MSG_HDR header; struct msg_buf *msg_buf; - + msg_buf = (struct msg_buf *)parseio->parse_pdata; parseprintf(DD_PARSE, ("gps_input(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); if (!msg_buf) return PARSE_INP_SKIP; - + if ( msg_buf->phase == MBG_NONE ) { /* not receiving yet */ switch (ch) { case SOH: parseprintf(DD_PARSE, ("gps_input: SOH seen\n")); - + msg_buf->len = sizeof( header ); /* prepare to receive msg header */ msg_buf->phase = MBG_HEADER; /* receiving header */ break; @@ -621,7 +626,7 @@ gps_input( parseio->parse_index = 1; parseio->parse_data[0] = ch; break; - + default: return PARSE_INP_SKIP; /* keep searching */ } @@ -638,7 +643,7 @@ gps_input( if ((msg_buf->phase == MBG_STRING) && (parseio->parse_index < parseio->parse_dsize)) parseio->parse_data[parseio->parse_index++] = ch; - + parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] = ch; if (parseio->parse_dtime.parse_msglen > sizeof(parseio->parse_dtime.parse_msg)) @@ -649,7 +654,7 @@ gps_input( parseio->parse_ldsize = parseio->parse_index; return PARSE_INP_DATA; } - + switch (msg_buf->phase) { case MBG_HEADER: @@ -685,41 +690,41 @@ gps_input( if ( msg_buf->phase == MBG_HEADER ) { /* header complete now */ unsigned char *datap = parseio->parse_dtime.parse_msg + 1; - + get_mbg_header(&datap, &header); - + parseprintf(DD_PARSE, ("gps_input: header: cmd 0x%x, len %d, dcsum 0x%x, hcsum 0x%x\n", - (int)header.gps_cmd, (int)header.gps_len, (int)header.gps_data_csum, - (int)header.gps_hdr_csum)); - + (int)header.cmd, (int)header.len, (int)header.data_csum, + (int)header.hdr_csum)); + calc_csum = mbg_csum( (unsigned char *) parseio->parse_dtime.parse_msg + 1, (unsigned short)6 ); - if ( calc_csum != header.gps_hdr_csum ) + if ( calc_csum != header.hdr_csum ) { parseprintf(DD_PARSE, ("gps_input: header checksum mismatch expected 0x%x, got 0x%x\n", (int)calc_csum, (int)mbg_csum( (unsigned char *) parseio->parse_dtime.parse_msg, (unsigned short)6 ))); - + msg_buf->phase = MBG_NONE; /* back to hunting mode */ return PARSE_INP_DATA; /* invalid header checksum received - pass up for detection */ } - if ((header.gps_len == 0) || /* no data to wait for */ - (header.gps_len >= (sizeof (parseio->parse_dtime.parse_msg) - sizeof(header) - 1))) /* blows anything we have space for */ + if ((header.len == 0) || /* no data to wait for */ + (header.len >= (sizeof (parseio->parse_dtime.parse_msg) - sizeof(header) - 1))) /* blows anything we have space for */ { msg_buf->phase = MBG_NONE; /* back to hunting mode */ - return (header.gps_len == 0) ? PARSE_INP_DATA : PARSE_INP_SKIP; /* message complete/throwaway */ + return (header.len == 0) ? PARSE_INP_DATA : PARSE_INP_SKIP; /* message complete/throwaway */ } - - parseprintf(DD_PARSE, ("gps_input: expecting %d bytes of data message\n", (int)header.gps_len)); - - msg_buf->len = header.gps_len;/* save number of bytes to wait for */ + + parseprintf(DD_PARSE, ("gps_input: expecting %d bytes of data message\n", (int)header.len)); + + msg_buf->len = header.len;/* save number of bytes to wait for */ msg_buf->phase = MBG_DATA; /* flag header already complete */ return PARSE_INP_SKIP; } parseprintf(DD_PARSE, ("gps_input: message data complete\n")); - + /* Header and data have been received. The header checksum has been */ /* checked */ diff --git a/contrib/ntp/libparse/clk_rawdcf.c b/contrib/ntp/libparse/clk_rawdcf.c index 3ef36c4..ca43263 100644 --- a/contrib/ntp/libparse/clk_rawdcf.c +++ b/contrib/ntp/libparse/clk_rawdcf.c @@ -1,12 +1,12 @@ /* * /src/NTP/REPOSITORY/ntp4-dev/libparse/clk_rawdcf.c,v 4.18 2006/06/22 18:40:01 kardel RELEASE_20060622_A - * + * * clk_rawdcf.c,v 4.18 2006/06/22 18:40:01 kardel RELEASE_20060622_A * * Raw DCF77 pulse clock support * - * Copyright (c) 1995-2006 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1995-2015 by Frank Kardel <kardel <AT> ntp.org> + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -41,6 +41,7 @@ #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_RAWDCF) #include "ntp_fp.h" +#include "timevalops.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" @@ -75,7 +76,8 @@ * Second Contents * 0 - 10 AM: free, FM: 0 * 11 - 14 free - * 15 R - alternate antenna + * 15 R - "call bit" used to signalize irregularities in the control facilities + * (until 2003 indicated transmission via alternate antenna) * 16 A1 - expect zone change (1 hour before) * 17 - 18 Z1,Z2 - time zone * 0 0 illegal @@ -101,12 +103,14 @@ * 59 - usually missing (minute indication), except for leap insertion */ -static u_long pps_rawdcf P((parse_t *, int, timestamp_t *)); -static u_long cvt_rawdcf P((unsigned char *, int, struct format *, clocktime_t *, void *)); -static u_long inp_rawdcf P((parse_t *, unsigned int, timestamp_t *)); +static parse_pps_fnc_t pps_rawdcf; +static parse_cvt_fnc_t cvt_rawdcf; +static parse_inp_fnc_t inp_rawdcf; typedef struct last_tcode { - time_t tcode; /* last converted time code */ + time_t tcode; /* last converted time code */ + timestamp_t tminute; /* sample time for minute start */ + timestamp_t timeout; /* last timeout timestamp */ } last_tcode_t; #define BUFFER_MAX 61 @@ -125,15 +129,15 @@ clockformat_t clock_rawdcf = static struct dcfparam { - unsigned char *onebits; - unsigned char *zerobits; -} dcfparameter = + const unsigned char *onebits; + const unsigned char *zerobits; +} dcfparameter = { - (unsigned char *)"###############RADMLS1248124P124812P1248121241248112481248P??", /* 'ONE' representation */ - (unsigned char *)"--------------------s-------p------p----------------------p__" /* 'ZERO' representation */ + (const unsigned char *)"###############RADMLS1248124P124812P1248121241248112481248P??", /* 'ONE' representation */ + (const unsigned char *)"--------------------s-------p------p----------------------p__" /* 'ZERO' representation */ }; -static struct rawdcfcode +static struct rawdcfcode { char offset; /* start bit */ } rawdcfcode[] = @@ -182,14 +186,14 @@ static u_long ext_bf( unsigned char *buf, int idx, - unsigned char *zero + const unsigned char *zero ) { u_long sum = 0; int i, first; first = rawdcfcode[idx].offset; - + for (i = rawdcfcode[idx+1].offset - 1; i >= first; i--) { sum <<= 1; @@ -202,7 +206,7 @@ static unsigned pcheck( unsigned char *buf, int idx, - unsigned char *zero + const unsigned char *zero ) { int i,last; @@ -225,20 +229,20 @@ convert_rawdcf( ) { unsigned char *s = buffer; - unsigned char *b = dcfprm->onebits; - unsigned char *c = dcfprm->zerobits; + const unsigned char *b = dcfprm->onebits; + const unsigned char *c = dcfprm->zerobits; int i; - parseprintf(DD_RAWDCF,("parse: convert_rawdcf: \"%s\"\n", buffer)); + parseprintf(DD_RAWDCF,("parse: convert_rawdcf: \"%.*s\"\n", size, buffer)); if (size < 57) { #ifndef PARSEKERNEL - msyslog(LOG_ERR, "parse: convert_rawdcf: INCOMPLETE DATA - time code only has %d bits\n", size); + msyslog(LOG_ERR, "parse: convert_rawdcf: INCOMPLETE DATA - time code only has %d bits", size); #endif - return CVT_NONE; + return CVT_FAIL|CVT_BADFMT; } - + for (i = 0; i < size; i++) { if ((*s != *b) && (*s != *c)) @@ -249,7 +253,7 @@ convert_rawdcf( #ifndef PARSEKERNEL msyslog(LOG_ERR, "parse: convert_rawdcf: BAD DATA - no conversion"); #endif - return CVT_NONE; + return CVT_FAIL|CVT_BADFMT; } if (*b) b++; if (*c) c++; @@ -269,7 +273,7 @@ convert_rawdcf( */ parseprintf(DD_RAWDCF,("parse: convert_rawdcf: parity check passed\n")); - clock_time->flags = PARSEB_S_ANTENNA|PARSEB_S_LEAP; + clock_time->flags = PARSEB_S_CALLBIT|PARSEB_S_LEAP; clock_time->utctime= 0; clock_time->usecond= 0; clock_time->second = 0; @@ -307,9 +311,9 @@ convert_rawdcf( clock_time->flags |= PARSEB_LEAPADD; /* default: DCF77 data format deficiency */ if (ext_bf(buffer, DCF_R, dcfprm->zerobits)) - clock_time->flags |= PARSEB_ALTERNATE; + clock_time->flags |= PARSEB_CALLBIT; - parseprintf(DD_RAWDCF,("parse: convert_rawdcf: TIME CODE OK: %d:%d, %d.%d.%d, flags 0x%lx\n", + parseprintf(DD_RAWDCF,("parse: convert_rawdcf: TIME CODE OK: %02d:%02d, %02d.%02d.%02d, flags 0x%lx\n", (int)clock_time->hour, (int)clock_time->minute, (int)clock_time->day, (int)clock_time->month,(int) clock_time->year, (u_long)clock_time->flags)); return CVT_OK; @@ -320,13 +324,14 @@ convert_rawdcf( * bad format - not for us */ #ifndef PARSEKERNEL - msyslog(LOG_ERR, "parse: convert_rawdcf: parity check FAILED for \"%s\"\n", buffer); + msyslog(LOG_ERR, "parse: convert_rawdcf: start bit / parity check FAILED for \"%.*s\"", size, buffer); #endif return CVT_FAIL|CVT_BADFMT; } } /* + * parse_cvt_fnc_t cvt_rawdcf * raw dcf input routine - needs to fix up 50 baud * characters for 1/0 decision */ @@ -342,8 +347,8 @@ cvt_rawdcf( last_tcode_t *t = (last_tcode_t *)local; unsigned char *s = (unsigned char *)buffer; unsigned char *e = s + size; - unsigned char *b = dcfparameter.onebits; - unsigned char *c = dcfparameter.zerobits; + const unsigned char *b = dcfparameter.onebits; + const unsigned char *c = dcfparameter.zerobits; u_long rtc = CVT_NONE; unsigned int i, lowmax, highmax, cutoff, span; #define BITS 9 @@ -379,7 +384,7 @@ cvt_rawdcf( ch >>= 1; } - *s = i; + *s = (unsigned char) i; histbuf[i]++; cutoff += i; lowmax++; @@ -482,6 +487,8 @@ cvt_rawdcf( if (*c) c++; } + *s = '\0'; + if (rtc == CVT_NONE) { rtc = convert_rawdcf(buffer, size, &dcfparameter, clock_time); @@ -492,24 +499,26 @@ cvt_rawdcf( newtime = parse_to_unixtime(clock_time, &rtc); if ((rtc == CVT_OK) && t) { - if ((newtime - t->tcode) == 60) /* guard against multi bit errors */ + if ((newtime - t->tcode) <= 600) /* require a successful telegram within last 10 minutes */ { + parseprintf(DD_RAWDCF,("parse: cvt_rawdcf: recent timestamp check OK\n")); clock_time->utctime = newtime; } else { - rtc = CVT_FAIL|CVT_BADTIME; + parseprintf(DD_RAWDCF,("parse: cvt_rawdcf: recent timestamp check FAIL - ignore timestamp\n")); + rtc = CVT_SKIP; } t->tcode = newtime; } } } - + return rtc; } /* - * pps_rawdcf + * parse_pps_fnc_t pps_rawdcf * * currently a very stupid version - should be extended to decode * also ones and zeros (which is easy) @@ -531,13 +540,63 @@ pps_rawdcf( return CVT_NONE; } +static long +calc_usecdiff( + timestamp_t *ref, + timestamp_t *base, + long offset + ) +{ + struct timeval delta; + long delta_usec = 0; + +#ifdef PARSEKERNEL + delta.tv_sec = ref->tv.tv_sec - offset - base->tv.tv_sec; + delta.tv_usec = ref->tv.tv_usec - base->tv.tv_usec; + if (delta.tv_usec < 0) + { + delta.tv_sec -= 1; + delta.tv_usec += 1000000; + } +#else + l_fp delt; + + delt = ref->fp; + delt.l_i -= offset; + L_SUB(&delt, &base->fp); + TSTOTV(&delt, &delta); +#endif + + delta_usec = 1000000 * (int32_t)delta.tv_sec + delta.tv_usec; + return delta_usec; +} + static u_long snt_rawdcf( parse_t *parseio, timestamp_t *ptime ) { - if ((parseio->parse_dtime.parse_status & CVT_MASK) == CVT_OK) + /* + * only synthesize if all of following conditions are met: + * - CVT_OK parse_status (we have a time stamp base) + * - ABS(ptime - tminute - (parse_index - 1) sec) < 500ms (spaced by 1 sec +- 500ms) + * - minute marker is available (confirms minute raster as base) + */ + last_tcode_t *t = (last_tcode_t *)parseio->parse_pdata; + long delta_usec = -1; + + if (t != NULL && t->tminute.tv.tv_sec != 0) { + delta_usec = calc_usecdiff(ptime, &t->tminute, parseio->parse_index - 1); + if (delta_usec < 0) + delta_usec = -delta_usec; + } + + parseprintf(DD_RAWDCF,("parse: snt_rawdcf: synth for offset %d seconds - absolute usec error %ld\n", + parseio->parse_index - 1, delta_usec)); + + if (((parseio->parse_dtime.parse_status & CVT_MASK) == CVT_OK) && + (delta_usec < 500000 && delta_usec >= 0)) /* only if minute marker is available */ { parseio->parse_dtime.parse_stime = *ptime; @@ -546,44 +605,77 @@ snt_rawdcf( #else parseio->parse_dtime.parse_time.fp.l_ui++; #endif - + parseprintf(DD_RAWDCF,("parse: snt_rawdcf: time stamp synthesized offset %d seconds\n", parseio->parse_index - 1)); - + return updatetimeinfo(parseio, parseio->parse_lstate); } return CVT_NONE; } /* - * inp_rawdcf + * parse_inp_fnc_t inp_rawdcf * * grab DCF77 data from input stream */ static u_long inp_rawdcf( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { static struct timeval timeout = { 1, 500000 }; /* 1.5 secongs denote second #60 */ - + parseprintf(DD_PARSE, ("inp_rawdcf(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); - + parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */ if (parse_timedout(parseio, tstamp, &timeout)) { - parseprintf(DD_PARSE, ("inp_rawdcf: time out seen\n")); - + last_tcode_t *t = (last_tcode_t *)parseio->parse_pdata; + long delta_usec; + + parseprintf(DD_RAWDCF, ("inp_rawdcf: time out seen\n")); + /* finish collection */ (void) parse_end(parseio); + + if (t != NULL) + { + /* remember minute start sample time if timeouts occur in minute raster */ + if (t->timeout.tv.tv_sec != 0) + { + delta_usec = calc_usecdiff(tstamp, &t->timeout, 60); + if (delta_usec < 0) + delta_usec = -delta_usec; + } + else + { + delta_usec = -1; + } + + if (delta_usec < 500000 && delta_usec >= 0) + { + parseprintf(DD_RAWDCF, ("inp_rawdcf: timeout time difference %ld usec - minute marker set\n", delta_usec)); + /* collect minute markers only if spaced by 60 seconds */ + t->tminute = *tstamp; + } + else + { + parseprintf(DD_RAWDCF, ("inp_rawdcf: timeout time difference %ld usec - minute marker cleared\n", delta_usec)); + memset((char *)&t->tminute, 0, sizeof(t->tminute)); + } + t->timeout = *tstamp; + } (void) parse_addchar(parseio, ch); + + /* pass up to higher layers */ return PARSE_INP_TIME; } else { unsigned int rtc; - + rtc = parse_addchar(parseio, ch); if (rtc == PARSE_INP_SKIP) { diff --git a/contrib/ntp/libparse/clk_rcc8000.c b/contrib/ntp/libparse/clk_rcc8000.c index 9ce270d..a690e588 100644 --- a/contrib/ntp/libparse/clk_rcc8000.c +++ b/contrib/ntp/libparse/clk_rcc8000.c @@ -1,6 +1,6 @@ /* * /src/NTP/ntp4-dev/libparse/clk_rcc8000.c,v 4.9 2004/11/14 15:29:41 kardel RELEASE_20050508_A - * + * * clk_rcc8000.c,v 4.9 2004/11/14 15:29:41 kardel RELEASE_20050508_A * * Radiocode Clocks Ltd RCC 8000 Intelligent Off-Air Master Clock support @@ -30,7 +30,7 @@ #include <stdio.h> #else #include "sys/parsestreams.h" -extern void printf P((const char *, ...)); +extern int printf (const char *, ...); #endif /* Type II Serial Output format @@ -49,16 +49,16 @@ extern void printf P((const char *, ...)); #define O_USEC O_WDAY static struct format rcc8000_fmt = -{ { { 13, 2 }, {16, 2}, { 19, 2}, /* Day, Month, Year */ - { 0, 2 }, { 3, 2}, { 6, 2}, /* Hour, Minute, Second */ +{ { { 13, 2 }, {16, 2}, { 19, 2}, /* Day, Month, Year */ + { 0, 2 }, { 3, 2}, { 6, 2}, /* Hour, Minute, Second */ { 9, 3 }, {28, 1}, { 0, 0}, /* uSec, Status (Valid,Reject,BST,Leapyear) */ }, - (const unsigned char *)" : : . / / \r\n", + (const unsigned char *)" : : . / / \r\n", /*"15:50:36.534 30/09/94 273 5 A\x0d\x0a" */ - 0 + 0 }; -static unsigned long cvt_rcc8000 P((unsigned char *, int, struct format *, clocktime_t *, void *)); -static unsigned long inp_rcc8000 P((parse_t *, unsigned int, timestamp_t *)); +static parse_cvt_fnc_t cvt_rcc8000; +static parse_inp_fnc_t inp_rcc8000; clockformat_t clock_rcc8000 = { @@ -71,7 +71,8 @@ clockformat_t clock_rcc8000 = 0 /* no private data */ }; -static unsigned long +/* parse_cvt_fnc_t cvt_rcc8000 */ +static u_long cvt_rcc8000( unsigned char *buffer, int size, @@ -121,27 +122,27 @@ cvt_rcc8000( clock_time->flags |= PARSEB_POWERUP; clock_time->flags |= PARSEB_UTC; /* British special - guess why 8-) */ - + /* other flags not used */ } return CVT_OK; } /* - * inp_rcc8000 + * parse_inp_fnc_t inp_rcc8000 * - * grep data from input stream + * grab data from input stream */ static u_long inp_rcc8000( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { unsigned int rtc; - + parseprintf(DD_PARSE, ("inp_rcc8000(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); - + switch (ch) { case '\n': @@ -150,7 +151,7 @@ inp_rcc8000( return parse_end(parseio); else return rtc; - + default: if (parseio->parse_index == 0) /* take sample at start of message */ diff --git a/contrib/ntp/libparse/clk_schmid.c b/contrib/ntp/libparse/clk_schmid.c index 4f48201..c4f02b0 100644 --- a/contrib/ntp/libparse/clk_schmid.c +++ b/contrib/ntp/libparse/clk_schmid.c @@ -1,13 +1,13 @@ /* * /src/NTP/ntp4-dev/libparse/clk_schmid.c,v 4.9 2005/04/16 17:32:10 kardel RELEASE_20050508_A - * + * * clk_schmid.c,v 4.9 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * Schmid clock support * based on information and testing from Adam W. Feigin et. al (Swisstime iis.ethz.ch) * - * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1995-2015 by Frank Kardel <kardel <AT> ntp.org> + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -52,7 +52,7 @@ #include <stdio.h> #else #include "sys/parsestreams.h" -extern void printf P((const char *, ...)); +extern int printf (const char *, ...); #endif /* @@ -61,7 +61,7 @@ extern void printf P((const char *, ...)); * The command to Schmid's DCF77 clock is a single byte; each bit * allows the user to select some part of the time string, as follows (the * output for the lsb is sent first). - * + * * Bit 0: time in MEZ, 4 bytes *binary, not BCD*; hh.mm.ss.tenths * Bit 1: date 3 bytes *binary, not BCD: dd.mm.yy * Bit 2: week day, 1 byte (unused here) @@ -82,15 +82,15 @@ extern void printf P((const char *, ...)); #define WS_TIME 0x01 #define WS_SIGNAL 0x02 -#define WS_ALTERNATE 0x01 +#define WS_CALLBIT 0x01 /* "call bit" used to signalize irregularities in the control facilities */ #define WS_ANNOUNCE 0x02 #define WS_TZ 0x0c #define WS_MET 0x08 #define WS_MEST 0x04 #define WS_LEAP 0x10 -static u_long cvt_schmid P((unsigned char *, int, struct format *, clocktime_t *, void *)); -static unsigned long inp_schmid P((parse_t *, unsigned int, timestamp_t *)); +static parse_cvt_fnc_t cvt_schmid; +static parse_inp_fnc_t inp_schmid; clockformat_t clock_schmid = { @@ -103,7 +103,7 @@ clockformat_t clock_schmid = 0, /* no private data (complete messages) */ }; - +/* parse_cvt_fnc_t */ static u_long cvt_schmid( unsigned char *buffer, @@ -155,7 +155,7 @@ cvt_schmid( default: return CVT_FAIL|CVT_BADFMT; } - + if (!(buffer[7] & WS_TIME)) { clock_time->flags |= PARSEB_POWERUP; @@ -168,9 +168,9 @@ cvt_schmid( if (buffer[7] & WS_SIGNAL) { - if (buffer[8] & WS_ALTERNATE) + if (buffer[8] & WS_CALLBIT) { - clock_time->flags |= PARSEB_ALTERNATE; + clock_time->flags |= PARSEB_CALLBIT; } if (buffer[8] & WS_ANNOUNCE) @@ -184,33 +184,33 @@ cvt_schmid( } } - clock_time->flags |= PARSEB_S_LEAP|PARSEB_S_ANTENNA; - + clock_time->flags |= PARSEB_S_LEAP|PARSEB_S_CALLBIT; + return CVT_OK; } } } /* - * inp_schmid + * parse_inp_fnc_t inp_schmid * - * grep data from input stream + * grab data from input stream */ static u_long inp_schmid( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { unsigned int rtc; - + parseprintf(DD_PARSE, ("inp_schmid(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); - - switch (ch) + + switch ((uint8_t)ch) { case 0xFD: /* */ - parseprintf(DD_PARSE, ("mbg_input: ETX seen\n")); + parseprintf(DD_PARSE, ("inp_schmid: 0xFD seen\n")); if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP) return parse_end(parseio); else diff --git a/contrib/ntp/libparse/clk_sel240x.c b/contrib/ntp/libparse/clk_sel240x.c new file mode 100644 index 0000000..b1390b4 --- /dev/null +++ b/contrib/ntp/libparse/clk_sel240x.c @@ -0,0 +1,172 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2009,2012 - +// Schweitzer Engineering Laboratories, Inc. <opensource@selinc.com> +////////////////////////////////////////////////////////////////////////////// + +// Need to have _XOPEN_SOURCE defined for time.h to give the +// correct strptime signature. As per feature_test_macros(7), +// define this before including any header files. + +// #ifndef _XOPEN_SOURCE +// #define _XOPEN_SOURCE +// #endif + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_SEL240X) + +#include "ntp_syslog.h" +#include "ntp_types.h" +#include "ntp_fp.h" +#include "ntp_unixtime.h" +#include "ntp_calendar.h" +#include "ntp_machine.h" +#include "ntp_stdlib.h" + +#include "parse.h" + +#ifndef PARSESTREAM +# include <stdio.h> +#else +# include "sys/parsestreams.h" +#endif + +#include <time.h> + +////////////////////////////////////////////////////////////////////////////// +// The B8 output has the following format B8 = '\x01YYYY:ddd:hh:mm:ssq\r\n' +// where q = ' ' locked +// '.' <1 us +// '*' <10 us +// '#' <100 us +// '?' >100 us +// +// Based on this we need to recored the stime when we receive the <SOH> +// character and end it when we see the \n. +// +// The q or quality character indicates satellite lock and sync. For the +// purposes of NTP we are going to call it valid when we receive anything but +// a '?'. But we are only going to call it synced when we receive a ' ' +////////////////////////////////////////////////////////////////////////////// + +static parse_inp_fnc_t inp_sel240x; +static parse_cvt_fnc_t cvt_sel240x; + +// Parse clock format structure describing the message above +static struct format sel240x_fmt = +{ { { 6, 3 }, + { 0, 0 }, + { 1, 4 }, + { 10, 2 }, + { 13, 2 }, + { 16, 2 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 } + }, + (const unsigned char *)"\x01 : : : : \x0d\x0a", + 0 +}; + +// Structure desctibing the parser +clockformat_t clock_sel240x = +{ + inp_sel240x, + cvt_sel240x, + pps_one, + (void*)&sel240x_fmt, + "SEL B8", + 25, + 0 +}; + +////////////////////////////////////////////////////////////////////////////// +static unsigned long +inp_sel240x( parse_t *parseio, + char ch, + timestamp_t *tstamp + ) +{ + unsigned long rc; + + parseprintf( DD_PARSE, + ("inp_sel240x(0x%lx, 0x%x, ...)\n",(long)parseio, ch)); + + switch( ch ) + { + case '\x01': + parseio->parse_index = 1; + parseio->parse_data[0] = ch; + parseio->parse_dtime.parse_stime = *tstamp; + rc = PARSE_INP_SKIP; + break; + case '\n': + if( (rc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP ) + { + rc = parse_end( parseio ); + } + break; + default: + rc = parse_addchar( parseio, ch ); + } + + return rc; +} + +////////////////////////////////////////////////////////////////////////////// +static unsigned long +cvt_sel240x( unsigned char *buffer, + int size, + struct format *format, + clocktime_t *clock_time, + void *local + ) +{ + unsigned long rc = CVT_NONE; + + if( Strok(buffer, format->fixed_string) ) + { + struct tm ptime; + buffer++; + buffer = (unsigned char *) strptime( + (const char *)buffer, "%Y:%j:%H:%M:%S", &ptime ); + if( *(buffer+1) != '\x0d' ) + { + rc = CVT_FAIL | CVT_BADFMT; + } + else + { + clock_time->day = ptime.tm_mday; + clock_time->month = ptime.tm_mon + 1; + clock_time->year = ptime.tm_year + 1900; + clock_time->hour = ptime.tm_hour; + clock_time->minute = ptime.tm_min; + clock_time->second = ptime.tm_sec; + clock_time->usecond = 0; + clock_time->utcoffset = 0; + clock_time->flags = PARSEB_UTC; + + if( *buffer == '?' ) + { + clock_time->flags |= PARSEB_POWERUP; + } + else if( *buffer != ' ' ) + { + clock_time->flags |= PARSEB_NOSYNC; + } + + rc = CVT_OK; + } + } + + return rc; +} + +#else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_SEL240X) */ +int clk_sel240x_bs; +#endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_SEL240X) */ diff --git a/contrib/ntp/libparse/clk_trimtaip.c b/contrib/ntp/libparse/clk_trimtaip.c index 67db471..426e897 100644 --- a/contrib/ntp/libparse/clk_trimtaip.c +++ b/contrib/ntp/libparse/clk_trimtaip.c @@ -6,7 +6,7 @@ * Trimble SV6 clock support - several collected codepieces * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -51,7 +51,7 @@ #include <stdio.h> #else #include "sys/parsestreams.h" -extern void printf P((const char *, ...)); +extern int printf (const char *, ...); #endif /* 0000000000111111111122222222223333333 / char @@ -78,8 +78,8 @@ extern void printf P((const char *, ...)); 0 }; -static unsigned long cvt_trimtaip P((unsigned char *, int, struct format *, clocktime_t *, void *)); -static unsigned long inp_trimtaip P((parse_t *, unsigned int, timestamp_t *)); +static parse_cvt_fnc_t cvt_trimtaip; +static parse_inp_fnc_t inp_trimtaip; clockformat_t clock_trimtaip = { @@ -92,7 +92,8 @@ clockformat_t clock_trimtaip = 0 /* no private data */ }; -static unsigned long +/* parse_cvt_fnc_t cvt_trimtaip */ +static u_long cvt_trimtaip( unsigned char *buffer, int size, @@ -141,31 +142,31 @@ cvt_trimtaip( } /* - * inp_trimtaip + * parse_inp_fnc_t inp_trimtaip * - * grep data from input stream + * grab data from input stream */ static u_long inp_trimtaip( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { unsigned int rtc; - + parseprintf(DD_PARSE, ("inp_trimtaip(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); - + switch (ch) { case '>': parseprintf(DD_PARSE, ("inp_trimptaip: START seen\n")); - + parseio->parse_index = 1; parseio->parse_data[0] = ch; parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */ return PARSE_INP_SKIP; - + case '<': parseprintf(DD_PARSE, ("inp_trimtaip: END seen\n")); if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP) diff --git a/contrib/ntp/libparse/clk_trimtsip.c b/contrib/ntp/libparse/clk_trimtsip.c index be97b74..6c71d75 100644 --- a/contrib/ntp/libparse/clk_trimtsip.c +++ b/contrib/ntp/libparse/clk_trimtsip.c @@ -1,13 +1,13 @@ /* - * /src/NTP/ntp4-dev/libparse/clk_trimtsip.c,v 4.17 2005/04/16 17:32:10 kardel RELEASE_20050508_A + * /src/NTP/REPOSITORY/ntp4-dev/libparse/clk_trimtsip.c,v 4.19 2009/11/01 10:47:49 kardel RELEASE_20091101_A * - * clk_trimtsip.c,v 4.17 2005/04/16 17:32:10 kardel RELEASE_20050508_A + * clk_trimtsip.c,v 4.19 2009/11/01 10:47:49 kardel RELEASE_20091101_A * * Trimble TSIP support * Thanks to Sven Dietrich for providing test hardware * - * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1995-2009 by Frank Kardel <kardel <AT> ntp.org> + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -44,7 +44,7 @@ #include "ntp_syslog.h" #include "ntp_types.h" #include "ntp_fp.h" -#include "ntp_unixtime.h" +#include "timevalops.h" #include "ntp_calendar.h" #include "ntp_machine.h" #include "ntp_stdlib.h" @@ -116,8 +116,8 @@ struct trimble #define STATUS_UNSAFE 1 /* not enough receivers for full precision */ #define STATUS_SYNC 2 /* enough information for good operation */ -static unsigned long inp_tsip P((parse_t *, unsigned int, timestamp_t *)); -static unsigned long cvt_trimtsip P((unsigned char *, int, struct format *, clocktime_t *, void *)); +static unsigned long inp_tsip (parse_t *, char, timestamp_t *); +static unsigned long cvt_trimtsip (unsigned char *, int, struct format *, clocktime_t *, void *); struct clockformat clock_trimtsip = { @@ -136,7 +136,7 @@ struct clockformat clock_trimtsip = static unsigned long inp_tsip( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { @@ -183,13 +183,14 @@ inp_tsip( /* DLE,ETX -> end of packet */ parseio->parse_data[parseio->parse_index++] = DLE; parseio->parse_data[parseio->parse_index] = ch; - parseio->parse_ldsize = parseio->parse_index+1; + parseio->parse_ldsize = (u_short) (parseio->parse_index + 1); memcpy(parseio->parse_ldata, parseio->parse_data, parseio->parse_ldsize); parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] = DLE; parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] = ch; t->t_in_pkt = t->t_dle = 0; return PARSE_INP_TIME|PARSE_INP_DATA; } + /*FALLTHROUGH*/ default: /* collect data */ t->t_dle = 0; @@ -199,13 +200,13 @@ inp_tsip( return PARSE_INP_SKIP; } - -static int + +static short getshort( unsigned char *p ) { - return get_msb_short(&p); + return (short) get_msb_short(&p); } /* @@ -244,7 +245,7 @@ cvt_trimtsip( { unsigned char *bp; cmd = buffer[1]; - + switch(cmd) { case CMD_RCURTIME: @@ -257,15 +258,15 @@ cvt_trimtsip( bp = &mb(0); if (fetch_ieee754(&bp, IEEE_SINGLE, &secs, trim_offsets) != IEEE_OK) return CVT_FAIL|CVT_BADFMT; - + if ((secs.l_i <= 0) || (t->t_utcknown == 0)) { clock_time->flags = PARSEB_POWERUP; return CVT_OK; } - if (week < 990) { - week += 1024; + if (week < GPSWRAP) { + week += GPSWEEKS; } /* time OK */ @@ -274,7 +275,7 @@ cvt_trimtsip( bp = &mb(6); if (fetch_ieee754(&bp, IEEE_SINGLE, &utcoffset, trim_offsets) != IEEE_OK) return CVT_FAIL|CVT_BADFMT; - + L_SUB(&secs, &utcoffset); /* adjust GPS time to UTC time */ gpstolfp((unsigned short)week, (unsigned short)0, @@ -288,10 +289,10 @@ cvt_trimtsip( if (t->t_leap == ADDSECOND) clock_time->flags |= PARSEB_LEAPADD; - + if (t->t_leap == DELSECOND) clock_time->flags |= PARSEB_LEAPDEL; - + switch (t->t_operable) { case STATUS_SYNC: @@ -306,12 +307,12 @@ cvt_trimtsip( clock_time->flags |= PARSEB_NOSYNC|PARSEB_POWERUP; break; } - + if (t->t_mode == 0) clock_time->flags |= PARSEB_POSITION; - + clock_time->flags |= PARSEB_S_LEAP|PARSEB_S_POSITION; - + return CVT_OK; } /* case 0x41 */ @@ -345,26 +346,26 @@ cvt_trimtsip( { l_fp t0t; unsigned char *lbp; - + /* UTC correction data - derive a leap warning */ - int tls = t->t_gpsutc = getshort((unsigned char *)&mb(12)); /* current leap correction (GPS-UTC) */ - int tlsf = t->t_gpsutcleap = getshort((unsigned char *)&mb(24)); /* new leap correction */ - - t->t_weekleap = getshort((unsigned char *)&mb(20)); /* week no of leap correction */ - if (t->t_weekleap < 990) - t->t_weekleap += 1024; - - t->t_dayleap = getshort((unsigned char *)&mb(22)); /* day in week of leap correction */ - t->t_week = getshort((unsigned char *)&mb(18)); /* current week no */ - if (t->t_week < 990) - t->t_week += 1024; - + int tls = t->t_gpsutc = (u_short) getshort((unsigned char *)&mb(12)); /* current leap correction (GPS-UTC) */ + int tlsf = t->t_gpsutcleap = (u_short) getshort((unsigned char *)&mb(24)); /* new leap correction */ + + t->t_weekleap = (u_short) getshort((unsigned char *)&mb(20)); /* week no of leap correction */ + if (t->t_weekleap < GPSWRAP) + t->t_weekleap = (u_short)(t->t_weekleap + GPSWEEKS); + + t->t_dayleap = (u_short) getshort((unsigned char *)&mb(22)); /* day in week of leap correction */ + t->t_week = (u_short) getshort((unsigned char *)&mb(18)); /* current week no */ + if (t->t_week < GPSWRAP) + t->t_week = (u_short)(t->t_weekleap + GPSWEEKS); + lbp = (unsigned char *)&mb(14); /* last update time */ if (fetch_ieee754(&lbp, IEEE_SINGLE, &t0t, trim_offsets) != IEEE_OK) return CVT_FAIL|CVT_BADFMT; t->t_utcknown = t0t.l_ui != 0; - + if ((t->t_utcknown) && /* got UTC information */ (tlsf != tls) && /* something will change */ ((t->t_weekleap - t->t_week) < 5)) /* and close in the future */ @@ -398,6 +399,12 @@ int clk_trimtsip_bs; * History: * * clk_trimtsip.c,v + * Revision 4.19 2009/11/01 10:47:49 kardel + * de-P() + * + * Revision 4.18 2009/11/01 08:46:46 kardel + * clarify case FALLTHROUGH + * * Revision 4.17 2005/04/16 17:32:10 kardel * update copyright * diff --git a/contrib/ntp/libparse/clk_varitext.c b/contrib/ntp/libparse/clk_varitext.c index 01b8719..022549e 100644 --- a/contrib/ntp/libparse/clk_varitext.c +++ b/contrib/ntp/libparse/clk_varitext.c @@ -9,14 +9,14 @@ * clk_varitext.c,v 1.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * Varitext code variant by A.McConnell 1997/01/19 - * + * * Supports Varitext's Radio Clock - * + * * Used the Meinberg/Computime clock as a template for Varitext Radio Clock * * Codebase: * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -55,7 +55,7 @@ # include <stdio.h> #else # include "sys/parsestreams.h" -extern void printf P((const char *, ...)); +extern int printf (const char *, ...); #endif static const u_char VT_INITIALISED = 0x01; @@ -67,31 +67,31 @@ static const u_char VT_LAST_TELEGRAM_OK = 0x20; /* * The Varitext receiver sends a datagram in the following format every minute - * - * Timestamp T:YY:MM:MD:WD:HH:MM:SSCRLFSTXXX + * + * Timestamp T:YY:MM:MD:WD:HH:MM:SSCRLFSTXXX * Pos 0123456789012345678901 2 3 4567 * 0000000000111111111122 2 2 2222 - * Parse T: : : : : : : \r\n - * - * T Startcharacter "T" specifies start of the timestamp - * YY Year MM Month 1-12 - * MD Day of the month - * WD Day of week - * HH Hour - * MM Minute - * SS Second - * CR Carriage return - * LF Linefeed + * Parse T: : : : : : : \r\n + * + * T Startcharacter "T" specifies start of the timestamp + * YY Year MM Month 1-12 + * MD Day of the month + * WD Day of week + * HH Hour + * MM Minute + * SS Second + * CR Carriage return + * LF Linefeed * ST Status character * Bit 0 - Set= Initialised; Reset=Time Invalid (DO NOT USE) - * Bit 1 - Set= Synchronised; Reset= Unsynchronised - * Bit 2 - Set= Alarm state; Reset= No alarm - * Bit 3 - Set= BST; Reset= GMT - * Bit 4 - Set= Seasonal change in approx hour; Reset= No seasonal change expected + * Bit 1 - Set= Synchronised; Reset= Unsynchronised + * Bit 2 - Set= Alarm state; Reset= No alarm + * Bit 3 - Set= BST; Reset= GMT + * Bit 4 - Set= Seasonal change in approx hour; Reset= No seasonal change expected * Bit 5 - Set= Last MSF telegram was OK; Reset= Last telegram was in error; - * Bit 6 - Always set + * Bit 6 - Always set * Bit 7 - Unused - * XXX Checksum calculated using Fletcher's method (ignored for now). + * XXX Checksum calculated using Fletcher's method (ignored for now). */ static struct format varitext_fmt = @@ -105,8 +105,8 @@ static struct format varitext_fmt = 0 }; -static u_long cvt_varitext P((unsigned char *, int, struct format *, clocktime_t *, void *)); -static u_long inp_varitext P((parse_t *, unsigned int, timestamp_t *)); +static parse_cvt_fnc_t cvt_varitext; +static parse_inp_fnc_t inp_varitext; struct varitext { unsigned char start_found; @@ -128,11 +128,11 @@ clockformat_t clock_varitext = }; /* - * cvt_varitext - * + * parse_cvt_fnc_t cvt_varitext + * * convert simple type format */ -static u_long +static u_long cvt_varitext( unsigned char *buffer, int size, @@ -142,7 +142,7 @@ cvt_varitext( ) { - if (!Strok(buffer, format->fixed_string)) { + if (!Strok(buffer, format->fixed_string)) { return CVT_NONE; } else { if (Stoi(&buffer[format->field_offsets[O_DAY].offset], &clock_time->day, @@ -156,7 +156,7 @@ cvt_varitext( Stoi(&buffer[format->field_offsets[O_MIN].offset], &clock_time->minute, format->field_offsets[O_MIN].length) || Stoi(&buffer[format->field_offsets[O_SEC].offset], &clock_time->second, - format->field_offsets[O_SEC].length)) { + format->field_offsets[O_SEC].length)) { return CVT_FAIL | CVT_BADFMT; } else { u_char *f = (u_char*) &buffer[format->field_offsets[O_FLAGS].offset]; @@ -170,24 +170,25 @@ cvt_varitext( clock_time->flags |= PARSEB_DST; } /* - if (!((*f) & VT_INITIALISED)) Clock not initialised + if (!((*f) & VT_INITIALISED)) Clock not initialised clock_time->flags |= PARSEB_POWERUP; - - if (!((*f) & VT_SYNCHRONISED)) Clock not synchronised + + if (!((*f) & VT_SYNCHRONISED)) Clock not synchronised clock_time->flags |= PARSEB_NOSYNC; - - if (((*f) & VT_SEASON_CHANGE)) Seasonal change expected in the next hour + + if (((*f) & VT_SEASON_CHANGE)) Seasonal change expected in the next hour clock_time->flags |= PARSEB_ANNOUNCE; */ - return CVT_OK; + return CVT_OK; } } } -static u_long +/* parse_inp_fnc_t inp_varitext */ +static u_long inp_varitext( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { @@ -196,10 +197,10 @@ inp_varitext( parseprintf(DD_PARSE, ("inp_varitext(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); - if (!t) + if (!t) return PARSE_INP_SKIP; /* local data not allocated - sigh! */ - if (ch == 'T') + if (ch == 'T') t->tstamp = *tstamp; if ((t->previous_ch == 'T') && (ch == ':')) @@ -224,7 +225,7 @@ inp_varitext( return rtc; } - if (t->end_found) + if (t->end_found) { if (++(t->end_count) == 4) /* Finally found the end of the message */ { @@ -235,16 +236,16 @@ inp_varitext( return parse_end(parseio); else return rtc; - } + } } - if ((t->previous_ch == '\r') && (ch == '\n')) + if ((t->previous_ch == '\r') && (ch == '\n')) { t->end_found = 1; } } - + t->previous_ch = ch; return PARSE_INP_SKIP; diff --git a/contrib/ntp/libparse/clk_wharton.c b/contrib/ntp/libparse/clk_wharton.c index b4332fb..a65bc53 100644 --- a/contrib/ntp/libparse/clk_wharton.c +++ b/contrib/ntp/libparse/clk_wharton.c @@ -30,7 +30,7 @@ #include <stdio.h> #else #include "sys/parsestreams.h" -extern void printf P((const char *, ...)); +extern void printf (const char *, ...); #endif /* @@ -74,8 +74,11 @@ extern void printf P((const char *, ...)); * */ +static parse_cvt_fnc_t cvt_wharton_400a; +static parse_inp_fnc_t inp_wharton_400a; + /* - * cvt_wharton_400a + * parse_cvt_fnc_t cvt_wharton_400a * * convert simple type format */ @@ -91,7 +94,7 @@ cvt_wharton_400a( int i; /* The given `size' includes a terminating null-character. */ - if (size != 16 || buffer[0] != STX || buffer[14] != ETX + if (size != 15 || buffer[0] != STX || buffer[14] != ETX || buffer[13] < '0' || buffer[13] > ('0' + 0xf)) return CVT_NONE; for (i = 1; i < 13; i += 1) @@ -121,14 +124,14 @@ cvt_wharton_400a( } /* - * inp_wharton_400a + * parse_inp_fnc_t inp_wharton_400a * - * grep data from input stream + * grab data from input stream */ static u_long inp_wharton_400a( parse_t *parseio, - unsigned int ch, + char ch, timestamp_t *tstamp ) { @@ -166,7 +169,7 @@ clockformat_t clock_wharton_400a = 0, /* conversion configuration */ "WHARTON 400A Series clock Output Format 1", /* String format name */ 15, /* string buffer */ - 0 /* no private data (complete pakets) */ + 0 /* no private data (complete packets) */ }; #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_WHARTON_400A) */ diff --git a/contrib/ntp/libparse/data_mbg.c b/contrib/ntp/libparse/data_mbg.c index 9b6f1aa..0b3808c 100644 --- a/contrib/ntp/libparse/data_mbg.c +++ b/contrib/ntp/libparse/data_mbg.c @@ -33,6 +33,7 @@ * */ +#include <config.h> #ifdef PARSESTREAM #define NEED_BOPS #include "ntp_string.h" @@ -42,12 +43,13 @@ #include "ntp_types.h" #include "ntp_stdlib.h" #include "ntp_fp.h" +#include "ntp_calendar.h" #include "mbg_gps166.h" #include "binio.h" #include "ieee754io.h" -static void get_mbg_tzname P((unsigned char **, char *)); -static void mbg_time_status_str P((char **, unsigned int, int)); +static void get_mbg_tzname (unsigned char **, char *); +static void mbg_time_status_str (char **, unsigned int, int); #if 0 /* no actual floats on Meinberg binary interface */ static offsets_t mbg_float = { 1, 0, 3, 2, 0, 0, 0, 0 }; /* byte order for meinberg floats */ @@ -62,10 +64,10 @@ put_mbg_header( GPS_MSG_HDR *headerp ) { - put_lsb_short(bufpp, headerp->gps_cmd); - put_lsb_short(bufpp, headerp->gps_len); - put_lsb_short(bufpp, headerp->gps_data_csum); - put_lsb_short(bufpp, headerp->gps_hdr_csum); + put_lsb_short(bufpp, headerp->cmd); + put_lsb_short(bufpp, headerp->len); + put_lsb_short(bufpp, headerp->data_csum); + put_lsb_short(bufpp, headerp->hdr_csum); } void @@ -74,7 +76,7 @@ get_mbg_sw_rev( SW_REV *sw_revp ) { - sw_revp->code = get_lsb_short(bufpp); + sw_revp->code = get_lsb_uint16(bufpp); memcpy(sw_revp->name, *bufpp, sizeof(sw_revp->name)); *bufpp += sizeof(sw_revp->name); } @@ -85,8 +87,8 @@ get_mbg_ascii_msg( ASCII_MSG *ascii_msgp ) { - ascii_msgp->csum = get_lsb_short(bufpp); - ascii_msgp->valid = get_lsb_short(bufpp); + ascii_msgp->csum = (CSUM) get_lsb_short(bufpp); + ascii_msgp->valid = get_lsb_int16(bufpp); memcpy(ascii_msgp->s, *bufpp, sizeof(ascii_msgp->s)); *bufpp += sizeof(ascii_msgp->s); } @@ -97,7 +99,7 @@ get_mbg_svno( SVNO *svnop ) { - *svnop = get_lsb_short(bufpp); + *svnop = (SVNO) get_lsb_short(bufpp); } void @@ -106,7 +108,7 @@ get_mbg_health( HEALTH *healthp ) { - *healthp = get_lsb_short(bufpp); + *healthp = (HEALTH) get_lsb_short(bufpp); } void @@ -115,7 +117,7 @@ get_mbg_cfg( CFG *cfgp ) { - *cfgp = get_lsb_short(bufpp); + *cfgp = (CFG) get_lsb_short(bufpp); } void @@ -124,7 +126,7 @@ get_mbg_tgps( T_GPS *tgpsp ) { - tgpsp->wn = get_lsb_short(bufpp); + tgpsp->wn = get_lsb_uint16(bufpp); tgpsp->sec = get_lsb_long(bufpp); tgpsp->tick = get_lsb_long(bufpp); } @@ -132,20 +134,20 @@ get_mbg_tgps( void get_mbg_tm( unsigned char **buffpp, - TM *tmp + TM_GPS *tmp ) { - tmp->year = get_lsb_short(buffpp); + tmp->year = get_lsb_int16(buffpp); tmp->month = *(*buffpp)++; - tmp->mday = *(*buffpp)++; - tmp->yday = get_lsb_short(buffpp); - tmp->wday = *(*buffpp)++; - tmp->hour = *(*buffpp)++; - tmp->minute = *(*buffpp)++; - tmp->second = *(*buffpp)++; - tmp->frac = get_lsb_long(buffpp); + tmp->mday = *(*buffpp)++; + tmp->yday = get_lsb_int16(buffpp); + tmp->wday = *(*buffpp)++; + tmp->hour = *(*buffpp)++; + tmp->min = *(*buffpp)++; + tmp->sec = *(*buffpp)++; + tmp->frac = get_lsb_long(buffpp); tmp->offs_from_utc = get_lsb_long(buffpp); - tmp->status= get_lsb_short(buffpp); + tmp->status = get_lsb_uint16(buffpp); } void @@ -154,7 +156,7 @@ get_mbg_ttm( TTM *ttmp ) { - ttmp->channel = get_lsb_short(buffpp); + ttmp->channel = get_lsb_int16(buffpp); get_mbg_tgps(buffpp, &ttmp->t); get_mbg_tm(buffpp, &ttmp->tm); } @@ -165,9 +167,9 @@ get_mbg_synth( SYNTH *synthp ) { - synthp->freq = get_lsb_short(buffpp); - synthp->range = get_lsb_short(buffpp); - synthp->phase = get_lsb_short(buffpp); + synthp->freq = get_lsb_int16(buffpp); + synthp->range = get_lsb_int16(buffpp); + synthp->phase = get_lsb_int16(buffpp); } static void @@ -176,7 +178,7 @@ get_mbg_tzname( char *tznamep ) { - strncpy(tznamep, (char *)*buffpp, sizeof(TZ_NAME)); + strlcpy(tznamep, (char *)*buffpp, sizeof(TZ_NAME)); *buffpp += sizeof(TZ_NAME); } @@ -200,7 +202,7 @@ get_mbg_antinfo( ANT_INFO *antinfop ) { - antinfop->status = get_lsb_short(buffpp); + antinfop->status = get_lsb_int16(buffpp); get_mbg_tm(buffpp, &antinfop->tm_disconn); get_mbg_tm(buffpp, &antinfop->tm_reconn); antinfop->delta_t = get_lsb_long(buffpp); @@ -215,8 +217,8 @@ mbg_time_status_str( { static struct state { - int flag; /* bit flag */ - const char *string; /* bit name */ + int flag; /* bit flag */ + const char *string; /* bit name */ } states[] = { { TM_UTC, "UTC CORR" }, @@ -232,7 +234,7 @@ mbg_time_status_str( { char *start, *p; struct state *s; - + start = p = *buffpp; for (s = states; s->flag; s++) @@ -241,35 +243,37 @@ mbg_time_status_str( { if (p != *buffpp) { - strncpy(p, ", ", size - (p - start)); + strlcpy(p, ", ", size - (p - start)); p += 2; } - strncpy(p, s->string, size - (p - start)); + strlcpy(p, s->string, size - (p - start)); p += strlen(p); } } *buffpp = p; } } - + void mbg_tm_str( char **buffpp, - TM *tmp, - int size + TM_GPS *tmp, + int size, + int print_status ) { char *s = *buffpp; snprintf(*buffpp, size, "%04d-%02d-%02d %02d:%02d:%02d.%07ld (%c%02d%02d) ", tmp->year, tmp->month, tmp->mday, - tmp->hour, tmp->minute, tmp->second, tmp->frac, + tmp->hour, tmp->min, tmp->sec, (long) tmp->frac, (tmp->offs_from_utc < 0) ? '-' : '+', - abs(tmp->offs_from_utc) / 3600, - (abs(tmp->offs_from_utc) / 60) % 60); + abs((int)tmp->offs_from_utc) / 3600, + (abs((int)tmp->offs_from_utc) / 60) % 60); *buffpp += strlen(*buffpp); - mbg_time_status_str(buffpp, tmp->status, size - (*buffpp - s)); + if (print_status) + mbg_time_status_str(buffpp, tmp->status, size - (*buffpp - s)); } void @@ -280,8 +284,8 @@ mbg_tgps_str( ) { snprintf(*buffpp, size, "week %d + %ld days + %ld.%07ld sec", - tgpsp->wn, tgpsp->sec / 86400, - tgpsp->sec % 86400, tgpsp->tick); + tgpsp->wn, (long) tgpsp->sec / SECSPERDAY, + (long) tgpsp->sec % SECSPERDAY, (long) tgpsp->tick); *buffpp += strlen(*buffpp); } @@ -292,19 +296,19 @@ get_mbg_cfgh( ) { int i; - - cfghp->csum = get_lsb_short(buffpp); - cfghp->valid = get_lsb_short(buffpp); + + cfghp->csum = (CSUM) get_lsb_short(buffpp); + cfghp->valid = get_lsb_int16(buffpp); get_mbg_tgps(buffpp, &cfghp->tot_51); get_mbg_tgps(buffpp, &cfghp->tot_63); get_mbg_tgps(buffpp, &cfghp->t0a); - for (i = MIN_SVNO; i <= MAX_SVNO; i++) + for (i = 0; i < N_SVNO_GPS; i++) { get_mbg_cfg(buffpp, &cfghp->cfg[i]); } - - for (i = MIN_SVNO; i <= MAX_SVNO; i++) + + for (i = 0; i < N_SVNO_GPS; i++) { get_mbg_health(buffpp, &cfghp->health[i]); } @@ -316,23 +320,23 @@ get_mbg_utc( UTC *utcp ) { - utcp->csum = get_lsb_short(buffpp); - utcp->valid = get_lsb_short(buffpp); + utcp->csum = (CSUM) get_lsb_short(buffpp); + utcp->valid = get_lsb_int16(buffpp); get_mbg_tgps(buffpp, &utcp->t0t); - + if (fetch_ieee754(buffpp, IEEE_DOUBLE, &utcp->A0, mbg_double) != IEEE_OK) { L_CLR(&utcp->A0); } - + if (fetch_ieee754(buffpp, IEEE_DOUBLE, &utcp->A1, mbg_double) != IEEE_OK) { L_CLR(&utcp->A1); } - utcp->WNlsf = get_lsb_short(buffpp); - utcp->DNt = get_lsb_short(buffpp); + utcp->WNlsf = get_lsb_uint16(buffpp); + utcp->DNt = get_lsb_int16(buffpp); utcp->delta_tls = *(*buffpp)++; utcp->delta_tlsf = *(*buffpp)++; } @@ -344,7 +348,7 @@ get_mbg_lla( ) { int i; - + for (i = LAT; i <= ALT; i++) { if (fetch_ieee754(buffpp, IEEE_DOUBLE, &lla[i], mbg_double) != IEEE_OK) @@ -366,7 +370,7 @@ get_mbg_xyz( ) { int i; - + for (i = XP; i <= ZP; i++) { if (fetch_ieee754(buffpp, IEEE_DOUBLE, &xyz[i], mbg_double) != IEEE_OK) @@ -382,14 +386,14 @@ get_mbg_comparam( COM_PARM *comparamp ) { - int i; - + size_t i; + comparamp->baud_rate = get_lsb_long(buffpp); for (i = 0; i < sizeof(comparamp->framing); i++) { comparamp->framing[i] = *(*buffpp)++; } - comparamp->handshake = get_lsb_short(buffpp); + comparamp->handshake = get_lsb_int16(buffpp); } void @@ -399,12 +403,12 @@ get_mbg_portparam( ) { int i; - - for (i = 0; i < N_COM; i++) + + for (i = 0; i < DEFAULT_N_COM; i++) { get_mbg_comparam(buffpp, &portparamp->com[i]); } - for (i = 0; i < N_COM; i++) + for (i = 0; i < DEFAULT_N_COM; i++) { portparamp->mode[i] = *(*buffpp)++; } @@ -415,20 +419,20 @@ get_mbg_portparam( { \ L_CLR(addr); \ } - + void get_mbg_eph( unsigned char ** buffpp, EPH *ephp ) { - ephp->csum = get_lsb_short(buffpp); - ephp->valid = get_lsb_short(buffpp); - - ephp->health = get_lsb_short(buffpp); - ephp->IODC = get_lsb_short(buffpp); - ephp->IODE2 = get_lsb_short(buffpp); - ephp->IODE3 = get_lsb_short(buffpp); + ephp->csum = (CSUM) get_lsb_short(buffpp); + ephp->valid = get_lsb_int16(buffpp); + + ephp->health = (HEALTH) get_lsb_short(buffpp); + ephp->IODC = (IOD) get_lsb_short(buffpp); + ephp->IODE2 = (IOD) get_lsb_short(buffpp); + ephp->IODE3 = (IOD) get_lsb_short(buffpp); get_mbg_tgps(buffpp, &ephp->tt); get_mbg_tgps(buffpp, &ephp->t0c); @@ -455,7 +459,7 @@ get_mbg_eph( FETCH_DOUBLE(buffpp, &ephp->af2); FETCH_DOUBLE(buffpp, &ephp->tgd); - ephp->URA = get_lsb_short(buffpp); + ephp->URA = get_lsb_uint16(buffpp); ephp->L2code = *(*buffpp)++; ephp->L2flag = *(*buffpp)++; @@ -467,10 +471,10 @@ get_mbg_alm( ALM *almp ) { - almp->csum = get_lsb_short(buffpp); - almp->valid = get_lsb_short(buffpp); - - almp->health = get_lsb_short(buffpp); + almp->csum = (CSUM) get_lsb_short(buffpp); + almp->valid = get_lsb_int16(buffpp); + + almp->health = (HEALTH) get_lsb_short(buffpp); get_mbg_tgps(buffpp, &almp->t0a); @@ -492,8 +496,8 @@ get_mbg_iono( IONO *ionop ) { - ionop->csum = get_lsb_short(buffpp); - ionop->valid = get_lsb_short(buffpp); + ionop->csum = (CSUM) get_lsb_short(buffpp); + ionop->valid = get_lsb_int16(buffpp); FETCH_DOUBLE(buffpp, &ionop->alpha_0); FETCH_DOUBLE(buffpp, &ionop->alpha_1); diff --git a/contrib/ntp/libparse/gpstolfp.c b/contrib/ntp/libparse/gpstolfp.c index fd7be31..c162429 100644 --- a/contrib/ntp/libparse/gpstolfp.c +++ b/contrib/ntp/libparse/gpstolfp.c @@ -32,11 +32,10 @@ * SUCH DAMAGE. * */ +#include <config.h> #include "ntp_fp.h" - -#define GPSORIGIN ULONG_CONST(2524953600) /* NTP origin - GPS origin in seconds */ -#define SECSPERWEEK (unsigned)(604800) /* seconds per week - GPS tells us about weeks */ -#define GPSWRAP 990 /* assume week count less than this in the previous epoch */ +#include "ntp_calendar.h" +#include "parse.h" void gpstolfp( @@ -48,10 +47,10 @@ gpstolfp( { if (weeks < GPSWRAP) { - weeks += 1024; + weeks += GPSWEEKS; } - lfp->l_ui = weeks * SECSPERWEEK + days * 86400 + seconds + GPSORIGIN; /* convert to NTP time */ + lfp->l_ui = (uint32_t)(weeks * SECSPERWEEK + days * SECSPERDAY + seconds + GPSORIGIN); /* convert to NTP time */ lfp->l_uf = 0; } diff --git a/contrib/ntp/libparse/ieee754io.c b/contrib/ntp/libparse/ieee754io.c index 27c6525..61bc853 100644 --- a/contrib/ntp/libparse/ieee754io.c +++ b/contrib/ntp/libparse/ieee754io.c @@ -43,9 +43,9 @@ #include "ntp_fp.h" #include "ieee754io.h" -static unsigned char get_byte P((unsigned char *, offsets_t, int *)); +static unsigned char get_byte (unsigned char *, offsets_t, int *); #ifdef __not_yet__ -static void put_byte P((unsigned char *, offsets_t, int *, unsigned char)); +static void put_byte (unsigned char *, offsets_t, int *, unsigned char); #endif #ifdef LIBDEBUG @@ -89,14 +89,15 @@ fmt_flt( unsigned long ch ) { - char *buf; + char *buf; - LIB_GETBUF(buf); - sprintf(buf, "%c %s %s %s", sign ? '-' : '+', - fmt_blong(ch, 11), - fmt_blong(mh, 20), - fmt_blong(ml, 32)); - return buf; + LIB_GETBUF(buf); + snprintf(buf, LIB_BUFLENGTH, "%c %s %s %s", sign ? '-' : '+', + fmt_blong(ch, 11), + fmt_blong(mh, 20), + fmt_blong(ml, 32)); + + return buf; } static char * @@ -105,15 +106,18 @@ fmt_hex( int length ) { - char *buf; - int i; + char * buf; + char hex[4]; + int i; + + LIB_GETBUF(buf); + buf[0] = '\0'; + for (i = 0; i < length; i++) { + snprintf(hex, sizeof(hex), "%02x", bufp[i]); + strlcat(buf, hex, LIB_BUFLENGTH); + } - LIB_GETBUF(buf); - for (i = 0; i < length; i++) - { - sprintf(buf+i*2, "%02x", bufp[i]); - } - return buf; + return buf; } #endif @@ -217,7 +221,7 @@ fetch_ieee754( mantissa_high = 0; mantissa_low = (val &0x7F) << 16; - mantissa_low |= get_byte(bufp, offsets, &fieldindex) << 8; + mantissa_low |= (u_long)get_byte(bufp, offsets, &fieldindex) << 8; mantissa_low |= get_byte(bufp, offsets, &fieldindex); break; @@ -226,12 +230,12 @@ fetch_ieee754( characteristic |= (val & 0xF0) >> 4; /* grab lower characteristic bits */ mantissa_high = (val & 0x0F) << 16; - mantissa_high |= get_byte(bufp, offsets, &fieldindex) << 8; + mantissa_high |= (u_long)get_byte(bufp, offsets, &fieldindex) << 8; mantissa_high |= get_byte(bufp, offsets, &fieldindex); - mantissa_low = get_byte(bufp, offsets, &fieldindex) << 24; - mantissa_low |= get_byte(bufp, offsets, &fieldindex) << 16; - mantissa_low |= get_byte(bufp, offsets, &fieldindex) << 8; + mantissa_low = (u_long)get_byte(bufp, offsets, &fieldindex) << 24; + mantissa_low |= (u_long)get_byte(bufp, offsets, &fieldindex) << 16; + mantissa_low |= (u_long)get_byte(bufp, offsets, &fieldindex) << 8; mantissa_low |= get_byte(bufp, offsets, &fieldindex); break; diff --git a/contrib/ntp/libparse/info_trimble.c b/contrib/ntp/libparse/info_trimble.c index eea6cbd..53b2e32 100644 --- a/contrib/ntp/libparse/info_trimble.c +++ b/contrib/ntp/libparse/info_trimble.c @@ -2,6 +2,7 @@ * Automatically generated - do not modify */ +#include <config.h> #include "ntp_types.h" #include "ntpd.h" #include "trimble.h" @@ -47,7 +48,7 @@ cmd_info_t trimble_scmds[] = { { CMD_CHIGH8CNT, "CMD_CHIGH8CNT", "high-8 (best 4) / high-6 (overdetermined) control (0x75)", "", 0 }, { CMD_CMAXDGPSCOR, "CMD_CMAXDGPSCOR", "maximum rate of DGPS corrections (0x77)", "", 0 }, { CMD_CSUPER, "CMD_CSUPER", "super paket (0x8E)", "", 0 }, - { 0xFF, "", "" } + { 0xFF, "", "", "", 0 } }; @@ -89,6 +90,5 @@ cmd_info_t trimble_rcmds[] = { { CMD_RDOUBLELLA, "CMD_RDOUBLELLA", "double precision LLA (0x84)", "gps_position_ext(LLA)", RO|DEF }, { CMD_RDGPSSTAT, "CMD_RDGPSSTAT", "differential correction status (0x85)", "trimble_dgpsstatus", RO }, { CMD_RSUPER, "CMD_RSUPER", "super paket (0x8F)", "", 0 }, - { 0xFF, "", "" } + { 0xFF, "", "", "", 0 } }; - diff --git a/contrib/ntp/libparse/mfp_mul.c b/contrib/ntp/libparse/mfp_mul.c index 677ed18..43c1e39 100644 --- a/contrib/ntp/libparse/mfp_mul.c +++ b/contrib/ntp/libparse/mfp_mul.c @@ -32,6 +32,7 @@ * SUCH DAMAGE. * */ +#include <config.h> #include <stdio.h> #include "ntp_stdlib.h" #include "ntp_types.h" diff --git a/contrib/ntp/libparse/mkinfo_rcmd.sed b/contrib/ntp/libparse/mkinfo_rcmd.sed index 570c7a0..b8ed623 100644 --- a/contrib/ntp/libparse/mkinfo_rcmd.sed +++ b/contrib/ntp/libparse/mkinfo_rcmd.sed @@ -1,8 +1,8 @@ 1i\ \ +\ cmd_info_t trimble_rcmds[] = { -s!^#define[ ][ ]*\(CMD_R[^ ]*\)[ ][ ]*\([^ ]*\)[ ][ ]*/\*[ ][ ]*\(.*\)[ ]*:\([^:]*\):\([^:]*\)[ ][ ]*\*/! { \1, "\1", "\3 (\2)", "\4", \5 },!p +s!^#define[ \ ][ \ ]*\(CMD_R[^ \ ]*\)[ \ ][ \ ]*\([^ \ ]*\)[ \ ][ \ ]*/\*[ \ ][ \ ]*\(.*\)[ \ ]*:\([^:]*\):\([^:]*\)[ \ ][ \ ]*\*/!\ { \1, "\1", "\3 (\2)", "\4", \5 },!p $a\ - { 0xFF, "", "" }\ -};\ - +\ { 0xFF, "", "", "", 0 }\ +}; diff --git a/contrib/ntp/libparse/mkinfo_scmd.sed b/contrib/ntp/libparse/mkinfo_scmd.sed index cabe065..fb58d32 100644 --- a/contrib/ntp/libparse/mkinfo_scmd.sed +++ b/contrib/ntp/libparse/mkinfo_scmd.sed @@ -1,8 +1,9 @@ 1i\ /*\ - * Automatically generated - do not modify\ - */\ +\ * Automatically generated - do not modify\ +\ */\ \ +#include <config.h>\ #include "ntp_types.h"\ #include "ntpd.h"\ #include "trimble.h"\ @@ -10,7 +11,5 @@ cmd_info_t trimble_scmds[] = { s!^#define[ ][ ]*\(CMD_C[^ ]*\)[ ][ ]*\([^ ]*\)[ ][ ]*/\*[ ][ ]*\(.*\)[ ][ ]*\*/! { \1, "\1", "\3 (\2)", "", 0 },!p $a\ - { 0xFF, "", "" }\ -};\ - - +\ { 0xFF, "", "", "", 0 }\ +}; diff --git a/contrib/ntp/libparse/parse.c b/contrib/ntp/libparse/parse.c index dfbbaa6..64167f1 100644 --- a/contrib/ntp/libparse/parse.c +++ b/contrib/ntp/libparse/parse.c @@ -1,6 +1,6 @@ /* * /src/NTP/ntp4-dev/libparse/parse.c,v 4.20 2005/08/06 17:39:40 kardel RELEASE_20050806_A - * + * * parse.c,v 4.20 2005/08/06 17:39:40 kardel RELEASE_20050806_A * * Parser module for reference clock @@ -12,7 +12,7 @@ * when PARSEKERNEL is not defined NTP time stamps will be used. * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -51,7 +51,7 @@ static char rcsid[] = "parse.c,v 4.20 2005/08/06 17:39:40 kardel RELEASE_2005080 #endif #include "ntp_fp.h" -#include "ntp_unixtime.h" +#include "timevalops.h" #include "ntp_calendar.h" #include "ntp_stdlib.h" #include "ntp_machine.h" @@ -68,7 +68,7 @@ static char rcsid[] = "parse.c,v 4.20 2005/08/06 17:39:40 kardel RELEASE_2005080 extern clockformat_t *clockformats[]; extern unsigned short nformats; -static u_long timepacket P((parse_t *)); +static u_long timepacket (parse_t *); /* * strings support usually not in kernel - duplicated, but what the heck @@ -106,7 +106,7 @@ Strcmp( while (!(c = *s++ - *t++) && *s && *t) /* empty loop */; - + return c; } @@ -128,10 +128,6 @@ parse_timedout( delta.tv_usec += 1000000; } #else - extern long tstouslo[]; - extern long tstousmid[]; - extern long tstoushi[]; - l_fp delt; delt = tstamp->fp; @@ -158,10 +154,10 @@ parse_ioinit( ) { parseprintf(DD_PARSE, ("parse_iostart\n")); - + parseio->parse_plen = 0; parseio->parse_pdata = (void *)0; - + parseio->parse_data = 0; parseio->parse_ldata = 0; parseio->parse_dsize = 0; @@ -170,7 +166,7 @@ parse_ioinit( parseio->parse_ioflags = PARSE_IO_CS7; /* usual unix default */ parseio->parse_index = 0; parseio->parse_ldsize = 0; - + return 1; } @@ -192,15 +188,15 @@ parse_ioend( unsigned int parse_restart( parse_t *parseio, - unsigned int ch + char ch ) { unsigned int updated = PARSE_INP_SKIP; - + /* * re-start packet - timeout - overflow - start symbol */ - + if (parseio->parse_index) { /* @@ -212,17 +208,17 @@ parse_restart( parseio->parse_ldsize = parseio->parse_index; updated = PARSE_INP_TIME; } - + parseio->parse_index = 1; parseio->parse_data[0] = ch; parseprintf(DD_PARSE, ("parse: parse_restart: buffer start (updated = %x)\n", updated)); return updated; } - + unsigned int parse_addchar( parse_t *parseio, - unsigned int ch + char ch ) { /* @@ -234,7 +230,7 @@ parse_addchar( * collect into buffer */ parseprintf(DD_PARSE, ("parse: parse_addchar: buffer[%d] = 0x%x\n", parseio->parse_index, ch)); - parseio->parse_data[parseio->parse_index++] = ch; + parseio->parse_data[parseio->parse_index++] = (char)ch; return PARSE_INP_SKIP; } else @@ -243,7 +239,7 @@ parse_addchar( */ return parse_restart(parseio, ch); } - + unsigned int parse_end( parse_t *parseio @@ -264,11 +260,11 @@ parse_end( int parse_ioread( register parse_t *parseio, - register unsigned int ch, + register char ch, register timestamp_t *tstamp ) { - register unsigned updated = CVT_NONE; + register u_int updated = CVT_NONE; /* * within STREAMS CSx (x < 8) chars still have the upper bits set * so we normalize the characters by masking unecessary bits off. @@ -286,9 +282,9 @@ parse_ioread( case PARSE_IO_CS7: ch &= 0x7F; break; - + case PARSE_IO_CS8: - ch &= 0xFF; + ch &= (char) 0xFFU; break; } @@ -310,18 +306,18 @@ parse_ioread( { updated = CVT_OK; } - + if (input_status & PARSE_INP_TIME) /* time sample is available */ { - updated = timepacket(parseio); + updated = (u_int) timepacket(parseio); } - + if (input_status & PARSE_INP_DATA) /* got additional data */ { updated |= CVT_ADDITIONAL; } } - + /* * remember last character time @@ -357,7 +353,7 @@ parse_iopps( register timestamp_t *ptime ) { - register unsigned updated = CVT_NONE; + register u_int updated = CVT_NONE; /* * PPS pulse information will only be delivered to ONE clock format @@ -368,7 +364,7 @@ parse_iopps( if (clockformats[parseio->parse_lformat]->syncpps) { - updated = clockformats[parseio->parse_lformat]->syncpps(parseio, status == SYNC_ONE, ptime); + updated = (u_int) clockformats[parseio->parse_lformat]->syncpps(parseio, status == SYNC_ONE, ptime); parseprintf(DD_PARSE, ("parse_iopps: updated = 0x%x\n", updated)); } @@ -407,13 +403,13 @@ parse_to_unixtime( ) { #define SETRTC(_X_) { if (cvtrtc) *cvtrtc = (_X_); } - static int days_of_month[] = + static int days_of_month[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; register int i; time_t t; - + if (clock_time->utctime) return clock_time->utctime; /* if the conversion routine gets it right away - why not */ @@ -427,12 +423,12 @@ parse_to_unixtime( SETRTC(CVT_FAIL|CVT_BADDATE); return -1; } - + /* * sorry, slow section here - but it's not time critical anyway */ t = julian0(clock_time->year) - julian0(1970); /* Y2kFixes */ - /* month */ + /* month */ if (clock_time->month <= 0 || clock_time->month > 12) { SETRTC(CVT_FAIL|CVT_BADDATE); @@ -470,7 +466,7 @@ parse_to_unixtime( t = TIMES24(t) + clock_time->hour; - /* min */ + /* min */ if (clock_time->minute < 0 || clock_time->minute > 59) { SETRTC(CVT_FAIL|CVT_BADTIME); @@ -479,7 +475,7 @@ parse_to_unixtime( t = TIMES60(t) + clock_time->minute; /* sec */ - + if (clock_time->second < 0 || clock_time->second > 60) /* allow for LEAPs */ { SETRTC(CVT_FAIL|CVT_BADTIME); @@ -514,7 +510,7 @@ Stoi( while(*s == ' ') s++; - + if (*s == '-') { s++; @@ -523,7 +519,7 @@ Stoi( else if (*s == '+') s++; - + for(;;) { c = *s++; @@ -577,16 +573,16 @@ updatetimeinfo( { int s = splhigh(); #endif - + parseio->parse_lstate = parseio->parse_dtime.parse_state | flags | PARSEB_TIMECODE; - + parseio->parse_dtime.parse_state = parseio->parse_lstate; #ifdef PARSEKERNEL (void)splx((unsigned int)s); } #endif - + #ifdef PARSEKERNEL parseprintf(DD_PARSE, ("updatetimeinfo status=0x%x, time=%x\n", parseio->parse_dtime.parse_state, @@ -595,7 +591,7 @@ updatetimeinfo( parseprintf(DD_PARSE, ("updatetimeinfo status=0x%lx, time=%x\n", (long)parseio->parse_dtime.parse_state, parseio->parse_dtime.parse_time.fp.l_ui)); #endif - + return CVT_OK; /* everything fine and dandy... */ } @@ -618,7 +614,7 @@ syn_simple( } /* - * pps_simple + * parse_pps_fnc_t pps_simple * * handle a pps time stamp */ @@ -632,12 +628,12 @@ pps_simple( { parseio->parse_dtime.parse_ptime = *ptime; parseio->parse_dtime.parse_state |= PARSEB_PPS|PARSEB_S_PPS; - + return CVT_NONE; } /* - * pps_one + * parse_pps_fnc_t pps_one * * handle a pps time stamp in ONE edge */ @@ -651,12 +647,12 @@ pps_one( { if (status) return pps_simple(parseio, status, ptime); - + return CVT_NONE; } /* - * pps_zero + * parse_pps_fnc_t pps_zero * * handle a pps time stamp in ZERO edge */ @@ -670,7 +666,7 @@ pps_zero( { if (!status) return pps_simple(parseio, status, ptime); - + return CVT_NONE; } @@ -688,39 +684,39 @@ timepacket( register time_t t; u_long cvtrtc; /* current conversion result */ clocktime_t clock_time; - + memset((char *)&clock_time, 0, sizeof clock_time); format = parseio->parse_lformat; if (format == (unsigned short)~0) return CVT_NONE; - + switch ((cvtrtc = clockformats[format]->convert ? clockformats[format]->convert((unsigned char *)parseio->parse_ldata, parseio->parse_ldsize, (struct format *)(clockformats[format]->data), &clock_time, parseio->parse_pdata) : CVT_NONE) & CVT_MASK) { case CVT_FAIL: parseio->parse_badformat++; - break; - + return cvtrtc; + case CVT_NONE: /* * too bad - pretend bad format */ parseio->parse_badformat++; - break; - + return CVT_NONE; + case CVT_OK: break; - + case CVT_SKIP: return CVT_NONE; default: /* shouldn't happen */ #ifndef PARSEKERNEL - msyslog(LOG_WARNING, "parse: INTERNAL error: bad return code of convert routine \"%s\"\n", clockformats[format]->name); -#endif + msyslog(LOG_WARNING, "parse: INTERNAL error: bad return code of convert routine \"%s\"", clockformats[format]->name); +#endif return CVT_FAIL|cvtrtc; } @@ -728,7 +724,7 @@ timepacket( { return CVT_FAIL|cvtrtc; } - + /* * time stamp */ @@ -736,7 +732,7 @@ timepacket( parseio->parse_dtime.parse_time.tv.tv_sec = t; parseio->parse_dtime.parse_time.tv.tv_usec = clock_time.usecond; #else - parseio->parse_dtime.parse_time.fp.l_ui = t + JAN_1970; + parseio->parse_dtime.parse_time.fp.l_ui = (uint32_t) (t + JAN_1970); TVUTOTSF(clock_time.usecond, parseio->parse_dtime.parse_time.fp.l_uf); #endif @@ -762,7 +758,7 @@ parse_timecode( */ dct->parsegettc.parse_badformat = parse->parse_badformat; parse->parse_badformat = 0; - + if (parse->parse_ldsize <= PARSE_TCMAX) { dct->parsegettc.parse_count = parse->parse_ldsize; @@ -775,7 +771,7 @@ parse_timecode( } } - + /*ARGSUSED*/ int parse_setfmt( @@ -796,7 +792,7 @@ parse_setfmt( if (parse->parse_pdata) FREE(parse->parse_pdata, parse->parse_plen); parse->parse_pdata = 0; - + parse->parse_plen = clockformats[i]->plen; if (parse->parse_plen) @@ -813,9 +809,9 @@ parse_setfmt( if (parse->parse_data) FREE(parse->parse_data, (unsigned)(parse->parse_dsize * 2 + 2)); parse->parse_ldata = parse->parse_data = 0; - + parse->parse_dsize = clockformats[i]->length; - + if (parse->parse_dsize) { parse->parse_data = (char*)MALLOC((unsigned)(parse->parse_dsize * 2 + 2)); @@ -824,20 +820,20 @@ parse_setfmt( if (parse->parse_pdata) FREE(parse->parse_pdata, parse->parse_plen); parse->parse_pdata = 0; - + parseprintf(DD_PARSE, ("init failed: malloc for data area failed\n")); return 0; } } - + /* * leave room for '\0' */ parse->parse_ldata = parse->parse_data + parse->parse_dsize + 1; - + parse->parse_lformat = i; - + return 1; } } @@ -856,7 +852,7 @@ parse_getfmt( if (dct->parseformat.parse_format < nformats && Strlen(clockformats[dct->parseformat.parse_format]->name) <= PARSE_TCMAX) { - dct->parseformat.parse_count = Strlen(clockformats[dct->parseformat.parse_format]->name)+1; + dct->parseformat.parse_count = (unsigned short) (Strlen(clockformats[dct->parseformat.parse_format]->name) + 1); memcpy(dct->parseformat.parse_buffer, clockformats[dct->parseformat.parse_format]->name, dct->parseformat.parse_count); return 1; } @@ -874,7 +870,7 @@ parse_setcs( ) { parse->parse_ioflags &= ~PARSE_IO_CSIZE; - parse->parse_ioflags |= dct->parsesetcs.parse_cs & PARSE_IO_CSIZE; + parse->parse_ioflags |= (int) (dct->parsesetcs.parse_cs & PARSE_IO_CSIZE); return 1; } diff --git a/contrib/ntp/libparse/parse_conf.c b/contrib/ntp/libparse/parse_conf.c index b5451cf..37871c9 100644 --- a/contrib/ntp/libparse/parse_conf.c +++ b/contrib/ntp/libparse/parse_conf.c @@ -1,6 +1,6 @@ /* * /src/NTP/ntp4-dev/libparse/parse_conf.c,v 4.9 2005/04/16 17:32:10 kardel RELEASE_20050508_A - * + * * parse_conf.c,v 4.9 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * Parser configuration module for reference clocks @@ -12,7 +12,7 @@ * when STREAM is not defined NTP time stamps will be used. * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -96,6 +96,10 @@ extern clockformat_t clock_wharton_400a; extern clockformat_t clock_varitext; #endif +#ifdef CLOCK_SEL240X +extern clockformat_t clock_sel240x; +#endif + /* * format definitions */ @@ -136,6 +140,9 @@ clockformat_t *clockformats[] = #ifdef CLOCK_VARITEXT &clock_varitext, #endif +#ifdef CLOCK_SEL240X + &clock_sel240x, +#endif 0}; unsigned short nformats = sizeof(clockformats) / sizeof(clockformats[0]) - 1; diff --git a/contrib/ntp/libparse/parsesolaris.c b/contrib/ntp/libparse/parsesolaris.c index c023ad8..8c91257 100644 --- a/contrib/ntp/libparse/parsesolaris.c +++ b/contrib/ntp/libparse/parsesolaris.c @@ -1,12 +1,12 @@ /* * /src/NTP/ntp4-dev/libparse/parsesolaris.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A - * + * * parsesolaris.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * STREAMS module for reference clocks * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -40,6 +40,7 @@ static char rcsid[] = "parsesolaris.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A"; #endif +#include <config.h> #include <sys/types.h> #include <sys/conf.h> #include <sys/errno.h> @@ -73,7 +74,7 @@ static struct fmodsw fmod_templ = extern struct mod_ops mod_strmodops; -static struct modlstrmod modlstrmod = +static struct modlstrmod modlstrmod = { &mod_strmodops, /* a STREAMS module */ "PARSE - NTP reference", /* name this baby - keep room for revision number */ @@ -99,13 +100,13 @@ _init( ) { static char revision[] = "4.6"; - char *s, *S; + char *s, *S; char *t; - + #ifndef lint t = rcsid; #endif - + /* * copy RCS revision into Drv_name * @@ -124,25 +125,25 @@ _init( } if (*s == ' ') s++; } - - t = modlstrmod.strmod_linkinfo; + + t = modlstrmod.strmod_linkinfo; while (*t && (*t != ' ')) { t++; } if (*t == ' ') t++; - + S = s; while (*S && (((*S >= '0') && (*S <= '9')) || (*S == '.'))) { S++; } - + if (*s && *t && (S > s)) { if (strlen(t) >= (S - s)) { - (void) strncpy(t, s, (unsigned)(S - s)); + strlcpy(t, s, (unsigned)(S - s)); } } return (mod_install(&modlinkage)); @@ -173,11 +174,11 @@ _fini( /*--------------- stream module definition ----------------------------*/ -static int parseopen P((queue_t *, dev_t *, int, int, cred_t *)); -static int parseclose P((queue_t *, int)); -static int parsewput P((queue_t *, mblk_t *)); -static int parserput P((queue_t *, mblk_t *)); -static int parsersvc P((queue_t *)); +static int parseopen (queue_t *, dev_t *, int, int, cred_t *); +static int parseclose (queue_t *, int); +static int parsewput (queue_t *, mblk_t *); +static int parserput (queue_t *, mblk_t *); +static int parsersvc (queue_t *); static struct module_info driverinfo = { @@ -244,8 +245,8 @@ int parsedebug = 0; }\ } while (0) -static int init_linemon P((queue_t *)); -static void close_linemon P((queue_t *, queue_t *)); +static int init_linemon (queue_t *); +static void close_linemon (queue_t *, queue_t *); #define M_PARSE 0x0001 #define M_NOPARSE 0x0002 @@ -264,7 +265,7 @@ ntp_memset( static void pprintf( int lev, - const char *form, + char *form, ... ) { @@ -273,7 +274,7 @@ pprintf( va_start(ap, form); if (lev & parsedebug) - vcmn_err(CE_CONT, (char *)form, ap); + vcmn_err(CE_CONT, form, ap); va_end(ap); } @@ -291,7 +292,7 @@ setup_stream( mp = allocb(sizeof(struct stroptions), BPRI_MED); if (mp) { - struct stroptions *str = (struct stroptions *)mp->b_wptr; + struct stroptions *str = (void *)mp->b_wptr; str->so_flags = SO_READOPT|SO_HIWAT|SO_LOWAT|SO_ISNTTY; str->so_readopt = (mode == M_PARSE) ? RMSGD : RNORM; @@ -307,7 +308,7 @@ setup_stream( } else { - pprintf(DD_OPEN, "parse: setup_stream - FAILED - no MEMORY for allocb\n"); + pprintf(DD_OPEN, "parse: setup_stream - FAILED - no MEMORY for allocb\n"); return 0; } } @@ -324,18 +325,18 @@ parseopen( { register parsestream_t *parse; static int notice = 0; - - pprintf(DD_OPEN, "parse: OPEN - q=%x\n", q); - + + pprintf(DD_OPEN, "parse: OPEN - q=%x\n", q); + if (sflag != MODOPEN) { /* open only for modules */ - pprintf(DD_OPEN, "parse: OPEN - FAILED - not MODOPEN\n"); + pprintf(DD_OPEN, "parse: OPEN - FAILED - not MODOPEN\n"); return EIO; } if (q->q_ptr != (caddr_t)NULL) { - pprintf(DD_OPEN, "parse: OPEN - FAILED - EXCLUSIVE ONLY\n"); + pprintf(DD_OPEN, "parse: OPEN - FAILED - EXCLUSIVE ONLY\n"); return EBUSY; } @@ -345,10 +346,10 @@ parseopen( return ENOMEM; } - pprintf(DD_OPEN, "parse: OPEN - parse area q=%x, q->q_ptr=%x\n", q, q->q_ptr); + pprintf(DD_OPEN, "parse: OPEN - parse area q=%x, q->q_ptr=%x\n", q, q->q_ptr); WR(q)->q_ptr = q->q_ptr; - pprintf(DD_OPEN, "parse: OPEN - WQ parse area q=%x, q->q_ptr=%x\n", WR(q), WR(q)->q_ptr); - + pprintf(DD_OPEN, "parse: OPEN - WQ parse area q=%x, q->q_ptr=%x\n", WR(q), WR(q)->q_ptr); + parse = (parsestream_t *) q->q_ptr; bzero((caddr_t)parse, sizeof(*parse)); parse->parse_queue = q; @@ -359,7 +360,7 @@ parseopen( qprocson(q); - pprintf(DD_OPEN, "parse: OPEN - initializing io subsystem q=%x\n", q); + pprintf(DD_OPEN, "parse: OPEN - initializing io subsystem q=%x\n", q); if (!parse_ioinit(&parse->parse_io)) { @@ -373,12 +374,12 @@ parseopen( return EIO; } - pprintf(DD_OPEN, "parse: OPEN - initializing stream q=%x\n", q); + pprintf(DD_OPEN, "parse: OPEN - initializing stream q=%x\n", q); if (setup_stream(q, M_PARSE)) { (void) init_linemon(q); /* hook up PPS ISR routines if possible */ - pprintf(DD_OPEN, "parse: OPEN - SUCCEEDED\n"); + pprintf(DD_OPEN, "parse: OPEN - SUCCEEDED\n"); /* * I know that you know the delete key, but you didn't write this @@ -411,19 +412,19 @@ parseclose( { register parsestream_t *parse = (parsestream_t *)q->q_ptr; register unsigned long s; - + pprintf(DD_CLOSE, "parse: CLOSE\n"); - + qprocsoff(q); s = splhigh(); - + if (parse->parse_dqueue) close_linemon(parse->parse_dqueue, q); parse->parse_dqueue = (queue_t *)0; (void) splx(s); - + parse_ioend(&parse->parse_io); kmem_free((caddr_t)parse, sizeof(parsestream_t)); @@ -443,7 +444,7 @@ parsersvc( ) { mblk_t *mp; - + while ((mp = getq(q))) { if (canputnext(q) || (mp->b_datap->db_type > QPCTL)) @@ -476,17 +477,17 @@ parsewput( register mblk_t *datap; register struct iocblk *iocp; parsestream_t *parse = (parsestream_t *)q->q_ptr; - + pprintf(DD_WPUT, "parse: parsewput\n"); - + switch (mp->b_datap->db_type) { default: putnext(q, mp); break; - + case M_IOCTL: - iocp = (struct iocblk *)mp->b_rptr; + iocp = (void *)mp->b_rptr; switch (iocp->ioc_cmd) { default: @@ -510,14 +511,15 @@ parsewput( } mp->b_cont = datap; - *(struct ppsclockev *)datap->b_wptr = parse->parse_ppsclockev; + /* (void *) quiets cast alignment warning */ + *(struct ppsclockev *)(void *)datap->b_wptr = parse->parse_ppsclockev; datap->b_wptr += sizeof(struct ppsclockev) / sizeof(*datap->b_wptr); mp->b_datap->db_type = M_IOCACK; iocp->ioc_count = sizeof(struct ppsclockev); qreply(q, mp); break; - + case PARSEIOC_ENABLE: case PARSEIOC_DISABLE: { @@ -535,7 +537,7 @@ parsewput( } qreply(q, mp); break; - } + } case PARSEIOC_TIMECODE: case PARSEIOC_SETFMT: @@ -543,7 +545,7 @@ parsewput( case PARSEIOC_SETCS: if (iocp->ioc_count == sizeof(parsectl_t)) { - parsectl_t *dct = (parsectl_t *)mp->b_cont->b_rptr; + parsectl_t *dct = (void *)mp->b_cont->b_rptr; switch (iocp->ioc_cmd) { @@ -551,7 +553,7 @@ parsewput( pprintf(DD_WPUT, "parse: parsewput - PARSEIOC_TIMECODE\n"); ok = parse_timecode(dct, &parse->parse_io); break; - + case PARSEIOC_SETFMT: pprintf(DD_WPUT, "parse: parsewput - PARSEIOC_SETFMT\n"); ok = parse_setfmt(dct, &parse->parse_io); @@ -598,7 +600,7 @@ rdchar( else { register mblk_t *mmp = *mp; - + *mp = (*mp)->b_cont; freeb(mmp); } @@ -617,7 +619,7 @@ parserput( { register unsigned char type; mblk_t *mp = imp; - + switch (type = mp->b_datap->db_type) { default: @@ -634,22 +636,22 @@ parserput( else putq(q, mp); break; - + case M_BREAK: case M_DATA: { register parsestream_t * parse = (parsestream_t *)q->q_ptr; register mblk_t *nmp; register unsigned long ch; - timestamp_t ctime; + timestamp_t c_time; timespec_t hres_time; /* * get time on packet delivery */ gethrestime(&hres_time); - ctime.tv.tv_sec = hres_time.tv_sec; - ctime.tv.tv_usec = hres_time.tv_nsec / 1000; + c_time.tv.tv_sec = hres_time.tv_sec; + c_time.tv.tv_usec = hres_time.tv_nsec / 1000; if (!(parse->parse_status & PARSE_ENABLE)) { @@ -672,7 +674,7 @@ parserput( while (mp != (mblk_t *)NULL) { ch = rdchar(&mp); - if (ch != ~0 && parse_ioread(&parse->parse_io, (unsigned int)ch, &ctime)) + if (ch != ~0 && parse_ioread(&parse->parse_io, (unsigned int)ch, &c_time)) { /* * up up and away (hopefully ...) @@ -689,11 +691,11 @@ parserput( if (nmp) freemsg(nmp); parse_iodone(&parse->parse_io); } - } + } } else { - if (parse_ioread(&parse->parse_io, (unsigned int)0, &ctime)) + if (parse_ioread(&parse->parse_io, (unsigned int)0, &c_time)) { /* * up up and away (hopefully ...) @@ -723,19 +725,19 @@ parserput( case M_UNHANGUP: { register parsestream_t * parse = (parsestream_t *)q->q_ptr; - timestamp_t ctime; + timestamp_t c_time; timespec_t hres_time; register mblk_t *nmp; register int status = cd_invert ^ (type == M_UNHANGUP); gethrestime(&hres_time); - ctime.tv.tv_sec = hres_time.tv_sec; - ctime.tv.tv_usec = hres_time.tv_nsec / 1000; - + c_time.tv.tv_sec = hres_time.tv_sec; + c_time.tv.tv_usec = hres_time.tv_nsec / 1000; + pprintf(DD_RPUT, "parse: parserput - M_%sHANGUP\n", (type == M_HANGUP) ? "" : "UN"); if ((parse->parse_status & PARSE_ENABLE) && - parse_iopps(&parse->parse_io, status ? SYNC_ONE : SYNC_ZERO, &ctime)) + parse_iopps(&parse->parse_io, status ? SYNC_ONE : SYNC_ZERO, &c_time)) { nmp = (mblk_t *)NULL; if (canputnext(parse->parse_queue) && (nmp = allocb(sizeof(parsetime_t), BPRI_MED))) @@ -756,10 +758,10 @@ parserput( } else putq(q, mp); - + if (status) { - parse->parse_ppsclockev.tv = ctime.tv; + parse->parse_ppsclockev.tv = c_time.tv; ++(parse->parse_ppsclockev.serial); } } @@ -767,8 +769,8 @@ parserput( return 0; } -static int init_zs_linemon P((queue_t *, queue_t *)); /* handle line monitor for "zs" driver */ -static void close_zs_linemon P((queue_t *, queue_t *)); +static int init_zs_linemon (queue_t *, queue_t *); /* handle line monitor for "zs" driver */ +static void close_zs_linemon (queue_t *, queue_t *); /*-------------------- CD isr status monitor ---------------*/ @@ -778,7 +780,7 @@ init_linemon( ) { register queue_t *dq; - + dq = WR(q); /* * we ARE doing very bad things down here (basically stealing ISR @@ -849,7 +851,7 @@ close_linemon( #include <sys/ser_async.h> #include <sys/ser_zscc.h> -static void zs_xsisr P((struct zscom *)); /* zs external status interupt handler */ +static void zs_xsisr (struct zscom *); /* zs external status interupt handler */ /* * there should be some docs telling how to get to @@ -911,17 +913,17 @@ init_zs_linemon( parsestream->parse_dqueue = q; /* remember driver */ szs->zsops = *zs->zs_ops; - szs->zsops.zsop_xsint = (void (*) P((struct zscom *)))zs_xsisr; /* place our bastard */ + szs->zsops.zsop_xsint = (void (*) (struct zscom *))zs_xsisr; /* place our bastard */ szs->oldzsops = zs->zs_ops; emergencyzs = zs->zs_ops; - + zs->zs_ops = &szs->zsops; /* hook it up */ /* - * XXX: this is usually done via zsopinit() + * XXX: this is usually done via zsopinit() * - have yet to find a way to call that routine */ - zs->zs_xsint = (void (*) P((struct zscom *)))zs_xsisr; - + zs->zs_xsint = (void (*) (struct zscom *))zs_xsisr; + mutex_exit(zs->zs_excl); pprintf(DD_INSTALL, "init_zs_linemon: CD monitor installed\n"); @@ -932,7 +934,7 @@ init_zs_linemon( } /* - * unregister our ISR routine - must call under splhigh() (or + * unregister our ISR routine - must call under splhigh() (or * whatever block ZS status interrupts) */ static void @@ -968,7 +970,7 @@ close_zs_linemon( mutex_exit(zs->zs_excl); kmem_free((caddr_t)szs, sizeof (struct savedzsops)); - + pprintf(DD_INSTALL, "close_zs_linemon: CD monitor deleted\n"); return; } @@ -986,7 +988,7 @@ zs_xsisr( struct zscom *zs ) { - register struct asyncline *za = (struct asyncline *)zs->zs_priv; + register struct asyncline *za = (void *)zs->zs_priv; register queue_t *q; register unsigned char zsstatus; register int loopcheck; @@ -1003,7 +1005,7 @@ zs_xsisr( { timestamp_t cdevent; register int status; - + /* * time stamp */ @@ -1022,7 +1024,7 @@ zs_xsisr( * ok - now the hard part - find ourself */ loopcheck = MAXDEPTH; - + while (q) { if (q->q_qinfo && q->q_qinfo->qi_minfo) @@ -1050,7 +1052,7 @@ zs_xsisr( */ parse_iodone(&((parsestream_t *)q->q_ptr)->parse_io); } - + if (status) { ((parsestream_t *)q->q_ptr)->parse_ppsclockev.tv = cdevent.tv; @@ -1089,9 +1091,9 @@ zs_xsisr( SCC_WRITE0(ZSWR0_RESET_STATUS); /* might kill other conditions here */ return; } - } + } - pprintf(DD_ISR, "zs_xsisr: non CD event 0x%x for \"%s\"\n", + pprintf(DD_ISR, "zs_xsisr: non CD event 0x%x for \"%s\"\n", (za->za_rr0 ^ zsstatus) & ~ZSRR0_CD,dname); /* * we are now gathered here to process some unusual external status @@ -1106,7 +1108,7 @@ zs_xsisr( q = za->za_ttycommon.t_readq; loopcheck = MAXDEPTH; - + /* * the real thing for everything else ... */ @@ -1117,8 +1119,8 @@ zs_xsisr( dname = q->q_qinfo->qi_minfo->mi_idname; if (!strcmp(dname, parseinfo.st_rdinit->qi_minfo->mi_idname)) { - register void (*zsisr) P((struct zscom *)); - + register void (*zsisr) (struct zscom *); + /* * back home - phew (hopping along stream queues might * prove dangerous to your health) @@ -1127,7 +1129,7 @@ zs_xsisr( zsisr(zs); else panic("zs_xsisr: unable to locate original ISR"); - + pprintf(DD_ISR, "zs_xsisr: non CD event was processed for \"%s\"\n", dname); /* * now back to our program ... @@ -1149,7 +1151,7 @@ zs_xsisr( * corrupted TTY structures */ printf("zs_zsisr: looking for \"%s\" - found \"%s\" - taking EMERGENCY path\n", parseinfo.st_rdinit->qi_minfo->mi_idname, dname ? dname : "-NIL-"); - + if (emergencyzs && emergencyzs->zsop_xsint) emergencyzs->zsop_xsint(zs); else diff --git a/contrib/ntp/libparse/parsestreams.c b/contrib/ntp/libparse/parsestreams.c index 7df3542..6cd9d8f 100644 --- a/contrib/ntp/libparse/parsestreams.c +++ b/contrib/ntp/libparse/parsestreams.c @@ -1,13 +1,13 @@ /* * /src/NTP/ntp4-dev/libparse/parsestreams.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A - * + * * parsestreams.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * STREAMS module for reference clocks * (SunOS4.x) * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -77,15 +77,15 @@ static char rcsid[] = "parsestreams.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_ /* * just make checking compilers more silent */ -extern int printf P((const char *, ...)); -extern int putctl1 P((queue_t *, int, int)); -extern int canput P((queue_t *)); -extern void putbq P((queue_t *, mblk_t *)); -extern void freeb P((mblk_t *)); -extern void qreply P((queue_t *, mblk_t *)); -extern void freemsg P((mblk_t *)); -extern void panic P((const char *, ...)); -extern void usec_delay P((int)); +extern int printf (const char *, ...); +extern int putctl1 (queue_t *, int, int); +extern int canput (queue_t *); +extern void putbq (queue_t *, mblk_t *); +extern void freeb (mblk_t *); +extern void qreply (queue_t *, mblk_t *); +extern void freemsg (mblk_t *); +extern void panic (const char *, ...); +extern void usec_delay (int); #include "parse.h" #include "sys/parsestreams.h" @@ -110,7 +110,7 @@ static char mnam[] = "PARSEPPS "; /* name this baby - keep room for revision #else static char mnam[] = "PARSE "; /* name this baby - keep room for revision number */ #endif -struct vdldrv parsesync_vd = +struct vdldrv parsesync_vd = { VDMAGIC_PSEUDO, /* nothing like a real driver - a STREAMS module */ mnam, @@ -166,7 +166,7 @@ Strcmp( while (!(c = *s++ - *t++) && *s && *t) /* empty loop */; - + return c; } @@ -186,10 +186,10 @@ Strncmp( while (n-- && !(c = *s++ - *t++) && *s && *t) /* empty loop */; - + return c; } - + void ntp_memset( char *a, @@ -217,12 +217,12 @@ xxxinit( { extern struct fmodsw fmodsw[]; extern int fmodcnt; - + struct fmodsw *fm = fmodsw; struct fmodsw *fmend = &fmodsw[fmodcnt]; struct fmodsw *ifm = (struct fmodsw *)0; char *mname = parseinfo.st_rdinit->qi_minfo->mi_idname; - + switch (fc) { case VDLOAD: @@ -233,13 +233,13 @@ xxxinit( */ while (fm <= fmend) { - if (!Strncmp(fm->f_name, mname, FMNAMESZ)) + if (!Strncmp(fm->f_name, mname, FMNAMESZ)) { printf("vddrinit[%s]: STREAMS module already loaded.\n", mname); return(EBUSY); } else - if ((ifm == (struct fmodsw *)0) && + if ((ifm == (struct fmodsw *)0) && (fm->f_name[0] == '\0') && (fm->f_str == (struct streamtab *)0)) { @@ -261,7 +261,7 @@ xxxinit( { static char revision[] = "4.7"; char *s, *S, *t; - + s = rcsid; /* NOOP - keep compilers happy */ Strncpy(ifm->f_name, mname, FMNAMESZ); @@ -285,20 +285,20 @@ xxxinit( } if (*s == ' ') s++; } - - t = parsesync_vd.Drv_name; + + t = parsesync_vd.Drv_name; while (*t && (*t != ' ')) { t++; } if (*t == ' ') t++; - + S = s; while (*S && (((*S >= '0') && (*S <= '9')) || (*S == '.'))) { S++; } - + if (*s && *t && (S > s)) { if (Strlen(t) >= (S - s)) @@ -307,9 +307,9 @@ xxxinit( } } return (0); - } + } break; - + case VDUNLOAD: if (parsebusy > 0) { @@ -328,7 +328,7 @@ xxxinit( fm->f_name[0] = '\0'; fm->f_str = (struct streamtab *)0; fm++; - + break; } fm++; @@ -341,14 +341,14 @@ xxxinit( else return (0); } - + case VDSTAT: return (0); default: return (EIO); - + } return EIO; } @@ -357,11 +357,11 @@ xxxinit( /*--------------- stream module definition ----------------------------*/ -static int parseopen P((queue_t *, dev_t, int, int)); -static int parseclose P((queue_t *, int)); -static int parsewput P((queue_t *, mblk_t *)); -static int parserput P((queue_t *, mblk_t *)); -static int parsersvc P((queue_t *)); +static int parseopen (queue_t *, dev_t, int, int); +static int parseclose (queue_t *, int); +static int parsewput (queue_t *, mblk_t *); +static int parserput (queue_t *, mblk_t *); +static int parsersvc (queue_t *); static char mn[] = "parse"; @@ -416,7 +416,7 @@ int cd_invert = 1; /* invert status of CD line - PPS support via CD input */ int parsedebug = ~0; -extern void uniqtime P((struct timeval *)); +extern void uniqtime (struct timeval *); /*--------------- module implementation -----------------------------*/ @@ -429,8 +429,8 @@ extern void uniqtime P((struct timeval *)); }\ } while (0) -static int init_linemon P((queue_t *)); -static void close_linemon P((queue_t *, queue_t *)); +static int init_linemon (queue_t *); +static void close_linemon (queue_t *, queue_t *); #define M_PARSE 0x0001 #define M_NOPARSE 0x0002 @@ -460,7 +460,7 @@ setup_stream( } else { - parseprintf(DD_OPEN,("parse: setup_stream - FAILED - no MEMORY for allocb\n")); + parseprintf(DD_OPEN,("parse: setup_stream - FAILED - no MEMORY for allocb\n")); return 0; } } @@ -476,37 +476,37 @@ parseopen( { register parsestream_t *parse; static int notice = 0; - - parseprintf(DD_OPEN,("parse: OPEN\n")); - + + parseprintf(DD_OPEN,("parse: OPEN\n")); + if (sflag != MODOPEN) { /* open only for modules */ - parseprintf(DD_OPEN,("parse: OPEN - FAILED - not MODOPEN\n")); + parseprintf(DD_OPEN,("parse: OPEN - FAILED - not MODOPEN\n")); return OPENFAIL; } if (q->q_ptr != (caddr_t)NULL) { u.u_error = EBUSY; - parseprintf(DD_OPEN,("parse: OPEN - FAILED - EXCLUSIVE ONLY\n")); + parseprintf(DD_OPEN,("parse: OPEN - FAILED - EXCLUSIVE ONLY\n")); return OPENFAIL; } #ifdef VDDRV parsebusy++; #endif - + q->q_ptr = (caddr_t)kmem_alloc(sizeof(parsestream_t)); if (q->q_ptr == (caddr_t)0) { - parseprintf(DD_OPEN,("parse: OPEN - FAILED - no memory\n")); + parseprintf(DD_OPEN,("parse: OPEN - FAILED - no memory\n")); #ifdef VDDRV parsebusy--; #endif return OPENFAIL; } WR(q)->q_ptr = q->q_ptr; - + parse = (parsestream_t *)(void *)q->q_ptr; bzero((caddr_t)parse, sizeof(*parse)); parse->parse_queue = q; @@ -531,7 +531,7 @@ parseopen( { (void) init_linemon(q); /* hook up PPS ISR routines if possible */ - parseprintf(DD_OPEN,("parse: OPEN - SUCCEEDED\n")); + parseprintf(DD_OPEN,("parse: OPEN - SUCCEEDED\n")); /* * I know that you know the delete key, but you didn't write this @@ -569,17 +569,17 @@ parseclose( { register parsestream_t *parse = (parsestream_t *)(void *)q->q_ptr; register unsigned long s; - + parseprintf(DD_CLOSE,("parse: CLOSE\n")); - + s = splhigh(); - + if (parse->parse_dqueue) close_linemon(parse->parse_dqueue, q); parse->parse_dqueue = (queue_t *)0; (void) splx(s); - + parse_ioend(&parse->parse_io); kmem_free((caddr_t)parse, sizeof(parsestream_t)); @@ -602,7 +602,7 @@ parsersvc( ) { mblk_t *mp; - + while ((mp = getq(q))) { if (canput(q->q_next) || (mp->b_datap->db_type > QPCTL)) @@ -635,15 +635,15 @@ parsewput( register mblk_t *datap; register struct iocblk *iocp; parsestream_t *parse = (parsestream_t *)(void *)q->q_ptr; - + parseprintf(DD_WPUT,("parse: parsewput\n")); - + switch (mp->b_datap->db_type) { default: putnext(q, mp); break; - + case M_IOCTL: iocp = (struct iocblk *)(void *)mp->b_rptr; switch (iocp->ioc_cmd) @@ -676,7 +676,7 @@ parsewput( iocp->ioc_count = sizeof(struct ppsclockev); qreply(q, mp); break; - + case PARSEIOC_ENABLE: case PARSEIOC_DISABLE: { @@ -694,7 +694,7 @@ parsewput( } qreply(q, mp); break; - } + } case PARSEIOC_TIMECODE: case PARSEIOC_SETFMT: @@ -710,7 +710,7 @@ parsewput( parseprintf(DD_WPUT,("parse: parsewput - PARSEIOC_TIMECODE\n")); ok = parse_timecode(dct, &parse->parse_io); break; - + case PARSEIOC_SETFMT: parseprintf(DD_WPUT,("parse: parsewput - PARSEIOC_SETFMT\n")); ok = parse_setfmt(dct, &parse->parse_io); @@ -757,7 +757,7 @@ rdchar( else { register mblk_t *mmp = *mp; - + *mp = (*mp)->b_cont; freeb(mmp); } @@ -775,7 +775,7 @@ parserput( ) { unsigned char type; - + switch (type = mp->b_datap->db_type) { default: @@ -791,7 +791,7 @@ parserput( else putq(q, mp); break; - + case M_BREAK: case M_DATA: { @@ -844,7 +844,7 @@ parserput( if (nmp) freemsg(nmp); parse_iodone(&parse->parse_io); } - } + } } else { @@ -883,7 +883,7 @@ parserput( register int status = cd_invert ^ (type == M_UNHANGUP); uniqtime(&ctime.tv); - + parseprintf(DD_RPUT,("parse: parserput - M_%sHANGUP\n", (type == M_HANGUP) ? "" : "UN")); if ((parse->parse_status & PARSE_ENABLE) && @@ -908,7 +908,7 @@ parserput( } else putq(q, mp); - + if (status) { parse->parse_ppsclockev.tv = ctime.tv; @@ -919,8 +919,8 @@ parserput( return 0; } -static int init_zs_linemon P((queue_t *, queue_t *)); /* handle line monitor for "zs" driver */ -static void close_zs_linemon P((queue_t *, queue_t *)); +static int init_zs_linemon (queue_t *, queue_t *); /* handle line monitor for "zs" driver */ +static void close_zs_linemon (queue_t *, queue_t *); /*-------------------- CD isr status monitor ---------------*/ @@ -930,7 +930,7 @@ init_linemon( ) { register queue_t *dq; - + dq = WR(q); /* * we ARE doing very bad things down here (basically stealing ISR @@ -1010,8 +1010,8 @@ struct savedzsops }; struct zsops *emergencyzs; -extern void zsopinit P((struct zscom *, struct zsops *)); -static int zs_xsisr P((struct zscom *)); /* zs external status interupt handler */ +extern void zsopinit (struct zscom *, struct zsops *); +static int zs_xsisr (struct zscom *); /* zs external status interupt handler */ static int init_zs_linemon( @@ -1038,7 +1038,7 @@ init_zs_linemon( else { unsigned long s; - + /* * we do a direct replacement, in case others fiddle also * if somebody else grabs our hook and we disconnect @@ -1064,9 +1064,9 @@ init_zs_linemon( szs->zsops.zsop_xsint = zs_xsisr; /* place our bastard */ szs->oldzsops = zs->zs_ops; emergencyzs = zs->zs_ops; - + zsopinit(zs, &szs->zsops); /* hook it up */ - + (void) splx(s); parseprintf(DD_INSTALL, ("init_zs_linemon: CD monitor installed\n")); @@ -1099,11 +1099,11 @@ close_zs_linemon( else { register struct savedzsops *szs = (struct savedzsops *)parsestream->parse_data; - + zsopinit(zs, szs->oldzsops); /* reset to previous handler functions */ kmem_free((caddr_t)szs, sizeof (struct savedzsops)); - + parseprintf(DD_INSTALL, ("close_zs_linemon: CD monitor deleted\n")); return; } @@ -1112,7 +1112,7 @@ close_zs_linemon( #define MAXDEPTH 50 /* maximum allowed stream crawl */ #ifdef PPS_SYNC -extern void hardpps P((struct timeval *, long)); +extern void hardpps (struct timeval *, long); #ifdef PPS_NEW extern struct timeval timestamp; #else @@ -1148,7 +1148,7 @@ zs_xsisr( { timestamp_t cdevent; register int status; - + za->za_rr0 = (za->za_rr0 & ~(cdmask)) | (zsstatus & (cdmask)); #ifdef PPS_SYNC @@ -1163,7 +1163,7 @@ zs_xsisr( * time stamp */ uniqtime(&cdevent.tv); - + #ifdef PPS_SYNC (void)splx(s); #endif @@ -1190,7 +1190,7 @@ zs_xsisr( * ok - now the hard part - find ourself */ loopcheck = MAXDEPTH; - + while (q) { if (q->q_qinfo && q->q_qinfo->qi_minfo) @@ -1218,7 +1218,7 @@ zs_xsisr( */ parse_iodone(&((parsestream_t *)(void *)q->q_ptr)->parse_io); } - + if (status) { ((parsestream_t *)(void *)q->q_ptr)->parse_ppsclockev.tv = cdevent.tv; @@ -1251,13 +1251,13 @@ zs_xsisr( zsaddr->zscc_control = ZSWR0_RESET_STATUS; /* might kill other conditions here */ return 0; } - } + } if (zsstatus & cdmask) /* fake CARRIER status */ za->za_flags |= ZAS_CARR_ON; else za->za_flags &= ~ZAS_CARR_ON; - + /* * we are now gathered here to process some unusual external status * interrupts. @@ -1271,7 +1271,7 @@ zs_xsisr( q = za->za_ttycommon.t_readq; loopcheck = MAXDEPTH; - + /* * the real thing for everything else ... */ @@ -1282,8 +1282,8 @@ zs_xsisr( dname = q->q_qinfo->qi_minfo->mi_idname; if (!Strcmp(dname, parseinfo.st_rdinit->qi_minfo->mi_idname)) { - register int (*zsisr) P((struct zscom *)); - + register int (*zsisr) (struct zscom *); + /* * back home - phew (hopping along stream queues might * prove dangerous to your health) @@ -1292,7 +1292,7 @@ zs_xsisr( return zsisr(zs); else panic("zs_xsisr: unable to locate original ISR"); - + parseprintf(DD_ISR, ("zs_xsisr: non CD event was processed for \"%s\"\n", dname)); /* * now back to our program ... @@ -1314,7 +1314,7 @@ zs_xsisr( * corrupted TTY structures */ printf("zs_zsisr: looking for \"%s\" - found \"%s\" - taking EMERGENCY path\n", parseinfo.st_rdinit->qi_minfo->mi_idname, dname ? dname : "-NIL-"); - + if (emergencyzs && emergencyzs->zsop_xsint) emergencyzs->zsop_xsint(zs); else diff --git a/contrib/ntp/libparse/trim_info.c b/contrib/ntp/libparse/trim_info.c index 8fdc4f6..4178209 100644 --- a/contrib/ntp/libparse/trim_info.c +++ b/contrib/ntp/libparse/trim_info.c @@ -6,7 +6,7 @@ * $Created: Sun Aug 2 20:20:34 1998 $ * * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> - * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,6 +33,7 @@ * SUCH DAMAGE. * */ +#include <config.h> #include "ntp_types.h" #include "trimble.h" |