summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2014-12-02 09:01:21 +0000
committer <>2014-12-04 16:11:25 +0000
commitbdab5265fcbf3f472545073a23f8999749a9f2b9 (patch)
treec6018dd03dea906f8f1fb5f105f05b71a7dc250a /scripts
downloadntp-bdab5265fcbf3f472545073a23f8999749a9f2b9.tar.gz
Imported from /home/lorry/working-area/delta_ntp/ntp-dev-4.2.7p482.tar.gz.ntp-dev-4.2.7p482
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.am174
-rw-r--r--scripts/Makefile.in1025
-rw-r--r--scripts/README31
-rw-r--r--scripts/build/Makefile.am17
-rw-r--r--scripts/build/Makefile.in550
-rwxr-xr-xscripts/build/UpdatePoint331
-rwxr-xr-xscripts/build/VersionName61
-rwxr-xr-xscripts/build/check--help22
-rwxr-xr-xscripts/build/checkChangeLog29
-rwxr-xr-xscripts/build/checkHtmlFileDates16
-rwxr-xr-xscripts/build/fixautomakedepsmagic28
-rwxr-xr-xscripts/build/genCommitLog16
-rwxr-xr-xscripts/build/genver96
-rw-r--r--scripts/build/mkver.in38
-rwxr-xr-xscripts/build/updateBEDate53
-rw-r--r--scripts/calc_tickadj/Makefile.am104
-rw-r--r--scripts/calc_tickadj/Makefile.in865
-rw-r--r--scripts/calc_tickadj/calc_tickadj-opts60
-rw-r--r--scripts/calc_tickadj/calc_tickadj-opts.def60
-rw-r--r--scripts/calc_tickadj/calc_tickadj.1calc_tickadjman108
-rw-r--r--scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc84
-rw-r--r--scripts/calc_tickadj/calc_tickadj.html166
-rw-r--r--scripts/calc_tickadj/calc_tickadj.in59
-rw-r--r--scripts/calc_tickadj/calc_tickadj.man.in108
-rw-r--r--scripts/calc_tickadj/calc_tickadj.mdoc.in84
-rw-r--r--scripts/calc_tickadj/calc_tickadj.texi37
-rw-r--r--scripts/calc_tickadj/invoke-calc_tickadj.menu1
-rw-r--r--scripts/calc_tickadj/invoke-calc_tickadj.texi102
-rw-r--r--scripts/deprecated/freq_adj.in97
-rwxr-xr-xscripts/deprecated/hpadjtime.sh18
-rwxr-xr-xscripts/deprecated/html2man.in234
-rwxr-xr-xscripts/deprecated/ntp-close8
-rwxr-xr-xscripts/deprecated/ntp-groper95
-rwxr-xr-xscripts/deprecated/ntp-restart10
-rwxr-xr-xscripts/deprecated/ntp-status45
-rw-r--r--scripts/invoke-plot_summary.menu1
-rw-r--r--scripts/invoke-plot_summary.texi121
-rw-r--r--scripts/invoke-summary.menu1
-rw-r--r--scripts/invoke-summary.texi103
-rw-r--r--scripts/lib/Makefile.am5
-rw-r--r--scripts/lib/Makefile.in583
-rw-r--r--scripts/lib/NTP/Util.pm137
-rw-r--r--scripts/monitoring/README158
-rw-r--r--scripts/monitoring/loopwatch.config.SAMPLE89
-rw-r--r--scripts/monitoring/lr.pl151
-rw-r--r--scripts/monitoring/ntp.pl506
-rw-r--r--scripts/monitoring/ntploopstat458
-rw-r--r--scripts/monitoring/ntploopwatch1667
-rw-r--r--scripts/monitoring/ntptrap465
-rw-r--r--scripts/monitoring/timelocal.pl77
-rw-r--r--scripts/ntp-wait/Makefile.am96
-rw-r--r--scripts/ntp-wait/Makefile.in879
-rw-r--r--scripts/ntp-wait/invoke-ntp-wait.menu1
-rw-r--r--scripts/ntp-wait/invoke-ntp-wait.texi114
-rw-r--r--scripts/ntp-wait/ntp-wait-opts62
-rw-r--r--scripts/ntp-wait/ntp-wait-opts.def109
-rw-r--r--scripts/ntp-wait/ntp-wait.1ntp-waitman122
-rw-r--r--scripts/ntp-wait/ntp-wait.1ntp-waitmdoc95
-rw-r--r--scripts/ntp-wait/ntp-wait.html208
-rw-r--r--scripts/ntp-wait/ntp-wait.in66
-rw-r--r--scripts/ntp-wait/ntp-wait.man.in122
-rw-r--r--scripts/ntp-wait/ntp-wait.mdoc.in95
-rw-r--r--scripts/ntp-wait/ntp-wait.texi52
-rw-r--r--scripts/ntpsweep/Makefile.am102
-rw-r--r--scripts/ntpsweep/Makefile.in885
-rw-r--r--scripts/ntpsweep/invoke-ntpsweep.menu1
-rw-r--r--scripts/ntpsweep/invoke-ntpsweep.texi118
-rw-r--r--scripts/ntpsweep/ntpsweep-opts67
-rw-r--r--scripts/ntpsweep/ntpsweep-opts.def66
-rw-r--r--scripts/ntpsweep/ntpsweep.1ntpsweepman97
-rw-r--r--scripts/ntpsweep/ntpsweep.1ntpsweepmdoc75
-rw-r--r--scripts/ntpsweep/ntpsweep.html201
-rw-r--r--scripts/ntpsweep/ntpsweep.in204
-rw-r--r--scripts/ntpsweep/ntpsweep.man.in97
-rw-r--r--scripts/ntpsweep/ntpsweep.mdoc.in75
-rw-r--r--scripts/ntpsweep/ntpsweep.texi43
-rw-r--r--scripts/ntptrace/Makefile.am95
-rw-r--r--scripts/ntptrace/Makefile.in878
-rw-r--r--scripts/ntptrace/invoke-ntptrace.menu1
-rw-r--r--scripts/ntptrace/invoke-ntptrace.texi109
-rw-r--r--scripts/ntptrace/ntptrace-opts62
-rw-r--r--scripts/ntptrace/ntptrace-opts.def69
-rw-r--r--scripts/ntptrace/ntptrace.1ntptraceman114
-rw-r--r--scripts/ntptrace/ntptrace.1ntptracemdoc91
-rw-r--r--scripts/ntptrace/ntptrace.html180
-rwxr-xr-xscripts/ntptrace/ntptrace.in80
-rw-r--r--scripts/ntptrace/ntptrace.man.in114
-rw-r--r--scripts/ntptrace/ntptrace.mdoc.in91
-rw-r--r--scripts/ntptrace/ntptrace.texi40
-rw-r--r--scripts/ntpver.in7
-rw-r--r--scripts/plot_summary-opts73
-rw-r--r--scripts/plot_summary-opts.def83
-rw-r--r--scripts/plot_summary.1plot_summaryman114
-rw-r--r--scripts/plot_summary.1plot_summarymdoc88
-rw-r--r--scripts/plot_summary.html207
-rw-r--r--scripts/plot_summary.in329
-rw-r--r--scripts/plot_summary.man.in114
-rw-r--r--scripts/plot_summary.mdoc.in88
-rw-r--r--scripts/plot_summary.texi40
-rw-r--r--scripts/rc/README13
-rw-r--r--scripts/rc/ntpd88
-rw-r--r--scripts/rc/ntpwait15
-rw-r--r--scripts/rc/rc.d/TIMESYNC8
-rw-r--r--scripts/rc/rc.d/ntpd32
-rw-r--r--scripts/rc/rc.d/ntpwait21
-rw-r--r--scripts/stats/README39
-rw-r--r--scripts/stats/README.stats246
-rw-r--r--scripts/stats/README.timecodes149
-rwxr-xr-xscripts/stats/clock.awk431
-rwxr-xr-xscripts/stats/dupe.awk8
-rwxr-xr-xscripts/stats/ensemble.S5
-rwxr-xr-xscripts/stats/ensemble.awk17
-rwxr-xr-xscripts/stats/etf.S15
-rwxr-xr-xscripts/stats/etf.awk19
-rwxr-xr-xscripts/stats/itf.S5
-rwxr-xr-xscripts/stats/itf.awk19
-rwxr-xr-xscripts/stats/loop.S7
-rwxr-xr-xscripts/stats/loop.awk45
-rwxr-xr-xscripts/stats/loop_summary2
-rwxr-xr-xscripts/stats/peer.awk68
-rwxr-xr-xscripts/stats/psummary.awk82
-rwxr-xr-xscripts/stats/summary.sh88
-rwxr-xr-xscripts/stats/tdata.S5
-rwxr-xr-xscripts/stats/tdata.awk45
-rw-r--r--scripts/summary-opts69
-rw-r--r--scripts/summary-opts.def82
-rw-r--r--scripts/summary.1summaryman123
-rw-r--r--scripts/summary.1summarymdoc98
-rw-r--r--scripts/summary.html182
-rw-r--r--scripts/summary.in369
-rw-r--r--scripts/summary.man.in123
-rw-r--r--scripts/summary.mdoc.in98
-rw-r--r--scripts/summary.texi40
133 files changed, 19129 insertions, 0 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
new file mode 100644
index 0000000..7ddf424
--- /dev/null
+++ b/scripts/Makefile.am
@@ -0,0 +1,174 @@
+NULL=
+SUBDIRS= \
+ build \
+ calc_tickadj \
+ ntp-wait \
+ ntpsweep \
+ ntptrace \
+ lib \
+ $(NULL)
+
+man1_MANS=
+man8_MANS=
+
+DISTCLEANFILES= config.log $(man_MANS)
+
+run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+noinst_SCRIPTS = \
+ ntpver \
+ plot_summary \
+ summary \
+ $(NULL)
+
+install-data-local: install-html
+
+EXTRA_DIST = \
+ deprecated \
+ monitoring \
+ invoke-plot_summary.texi \
+ invoke-plot_summary.menu \
+ plot_summary.1plot_summaryman \
+ plot_summary.1plot_summarymdoc \
+ plot_summary.mdoc.in \
+ plot_summary.man.in \
+ plot_summary.texi \
+ plot_summary.html \
+ plot_summary-opts \
+ plot_summary-opts.def \
+ rc \
+ invoke-summary.texi \
+ invoke-summary.menu \
+ summary.1summaryman \
+ summary.1summarymdoc \
+ summary.mdoc.in \
+ summary.man.in \
+ summary.texi \
+ summary.html \
+ summary-opts \
+ summary-opts.def \
+ stats \
+ $(NULL)
+
+noinst_DATA = \
+ invoke-plot_summary.texi \
+ invoke-plot_summary.menu \
+ plot_summary.1plot_summaryman \
+ plot_summary.1plot_summarymdoc \
+ plot_summary.mdoc.in \
+ plot_summary.man.in \
+ plot_summary.texi \
+ plot_summary.html \
+ invoke-summary.texi \
+ invoke-summary.menu \
+ summary.1summaryman \
+ summary.1summarymdoc \
+ summary.mdoc.in \
+ summary.man.in \
+ summary.texi \
+ summary.html \
+ $(NULL)
+
+#OPTTPL = ../sntp/ag-tpl/perlopt.tpl
+OPTTPL = $(std_def_list)
+
+##
+
+plot_summary: $(srcdir)/plot_summary-opts
+
+$(srcdir)/plot_summary-opts: plot_summary-opts.def $(OPTTPL)
+ $(run_ag) plot_summary-opts.def
+
+### Nroff
+
+$(srcdir)/plot_summary.1plot_summaryman: $(srcdir)/plot_summary-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1plot_summaryman -Tagman-cmd.tpl plot_summary-opts.def
+
+$(srcdir)/plot_summary.man.in: $(srcdir)/plot_summary.1plot_summaryman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/plot_summary.1plot_summaryman > $(srcdir)/plot_summary.man.in+
+ mv $(srcdir)/plot_summary.man.in+ $(srcdir)/plot_summary.man.in
+
+### Mdoc
+
+$(srcdir)/plot_summary.1plot_summarymdoc: $(srcdir)/plot_summary-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1plot_summarymdoc -Tagmdoc-cmd.tpl plot_summary-opts.def
+
+$(srcdir)/plot_summary.mdoc.in: $(srcdir)/plot_summary.1plot_summarymdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/plot_summary.1plot_summarymdoc > $(srcdir)/plot_summary.mdoc.in+
+ mv $(srcdir)/plot_summary.mdoc.in+ $(srcdir)/plot_summary.mdoc.in
+
+### Manpage (local)
+
+plot_summary.1: $(srcdir)/plot_summary.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=plot_summary.1+:$(srcdir)/plot_summary.$(MANTAGFMT).in
+ mv plot_summary.1+ plot_summary.1
+
+### Texinfo
+
+$(srcdir)/invoke-plot_summary.menu: $(srcdir)/invoke-plot_summary.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-plot_summary.texi: plot_summary-opts $(srcdir)/plot_summary-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section plot_summary-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/plot_summary.html: $(srcdir)/invoke-plot_summary.menu $(srcdir)/invoke-plot_summary.texi $(srcdir)/plot_summary.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o plot_summary.html plot_summary.texi || true )
+
+
+##
+
+summary: $(srcdir)/summary-opts
+
+$(srcdir)/summary-opts: summary-opts.def $(OPTTPL)
+ $(run_ag) summary-opts.def
+
+### Nroff
+
+$(srcdir)/summary.1summaryman: $(srcdir)/summary-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1summaryman -Tagman-cmd.tpl summary-opts.def
+
+$(srcdir)/summary.man.in: $(srcdir)/summary.1summaryman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/summary.1summaryman > $(srcdir)/summary.man.in+
+ mv $(srcdir)/summary.man.in+ $(srcdir)/summary.man.in
+
+### Mdoc
+
+$(srcdir)/summary.1summarymdoc: $(srcdir)/summary-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1summarymdoc -Tagmdoc-cmd.tpl summary-opts.def
+
+$(srcdir)/summary.mdoc.in: $(srcdir)/summary.1summarymdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/summary.1summarymdoc > $(srcdir)/summary.mdoc.in+
+ mv $(srcdir)/summary.mdoc.in+ $(srcdir)/summary.mdoc.in
+
+### Manpage (local)
+
+summary.1: $(srcdir)/summary.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=summary.1+:$(srcdir)/summary.$(MANTAGFMT).in
+ mv summary.1+ summary.1
+
+### Texinfo
+
+$(srcdir)/invoke-summary.menu: $(srcdir)/invoke-summary.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-summary.texi: summary-opts $(srcdir)/summary-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section summary-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/summary.html: $(srcdir)/invoke-summary.menu $(srcdir)/invoke-summary.texi $(srcdir)/summary.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o summary.html summary.texi || true )
+
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
new file mode 100644
index 0000000..336c6c4
--- /dev/null
+++ b/scripts/Makefile.in
@@ -0,0 +1,1025 @@
+# Makefile.in generated by automake 1.11.1 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.
+# 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = scripts
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/ntpver.in $(srcdir)/plot_summary.in \
+ $(srcdir)/summary.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.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_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_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.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)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = ntpver plot_summary summary
+CONFIG_CLEAN_VPATH_FILES =
+SCRIPTS = $(noinst_SCRIPTS)
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+man1dir = $(mandir)/man1
+am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)"
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(man1_MANS) $(man8_MANS)
+DATA = $(noinst_DATA)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+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@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+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_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@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+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@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+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@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+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_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+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@
+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@
+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@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+NULL =
+SUBDIRS = \
+ build \
+ calc_tickadj \
+ ntp-wait \
+ ntpsweep \
+ ntptrace \
+ lib \
+ $(NULL)
+
+man1_MANS =
+man8_MANS =
+DISTCLEANFILES = config.log $(man_MANS)
+run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
+
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+noinst_SCRIPTS = \
+ ntpver \
+ plot_summary \
+ summary \
+ $(NULL)
+
+EXTRA_DIST = \
+ deprecated \
+ monitoring \
+ invoke-plot_summary.texi \
+ invoke-plot_summary.menu \
+ plot_summary.1plot_summaryman \
+ plot_summary.1plot_summarymdoc \
+ plot_summary.mdoc.in \
+ plot_summary.man.in \
+ plot_summary.texi \
+ plot_summary.html \
+ plot_summary-opts \
+ plot_summary-opts.def \
+ rc \
+ invoke-summary.texi \
+ invoke-summary.menu \
+ summary.1summaryman \
+ summary.1summarymdoc \
+ summary.mdoc.in \
+ summary.man.in \
+ summary.texi \
+ summary.html \
+ summary-opts \
+ summary-opts.def \
+ stats \
+ $(NULL)
+
+noinst_DATA = \
+ invoke-plot_summary.texi \
+ invoke-plot_summary.menu \
+ plot_summary.1plot_summaryman \
+ plot_summary.1plot_summarymdoc \
+ plot_summary.mdoc.in \
+ plot_summary.man.in \
+ plot_summary.texi \
+ plot_summary.html \
+ invoke-summary.texi \
+ invoke-summary.menu \
+ summary.1summaryman \
+ summary.1summarymdoc \
+ summary.mdoc.in \
+ summary.man.in \
+ summary.texi \
+ summary.html \
+ $(NULL)
+
+
+#OPTTPL = ../sntp/ag-tpl/perlopt.tpl
+OPTTPL = $(std_def_list)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign scripts/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+ntpver: $(top_builddir)/config.status $(srcdir)/ntpver.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+plot_summary: $(top_builddir)/config.status $(srcdir)/plot_summary.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+summary: $(top_builddir)/config.status $(srcdir)/summary.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-man1: $(man1_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+install-man8: $(man8_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man8:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+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: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ 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; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(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; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(SCRIPTS) $(MANS) $(DATA)
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+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
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-data-local install-man
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man: install-man1 install-man8
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-man
+
+uninstall-man: uninstall-man1 uninstall-man8
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
+ install-am install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic clean-libtool \
+ ctags ctags-recursive distclean 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-data-local install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-man1 \
+ install-man8 install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am uninstall-man uninstall-man1 \
+ uninstall-man8
+
+
+install-data-local: install-html
+
+plot_summary: $(srcdir)/plot_summary-opts
+
+$(srcdir)/plot_summary-opts: plot_summary-opts.def $(OPTTPL)
+ $(run_ag) plot_summary-opts.def
+
+### Nroff
+
+$(srcdir)/plot_summary.1plot_summaryman: $(srcdir)/plot_summary-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1plot_summaryman -Tagman-cmd.tpl plot_summary-opts.def
+
+$(srcdir)/plot_summary.man.in: $(srcdir)/plot_summary.1plot_summaryman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/plot_summary.1plot_summaryman > $(srcdir)/plot_summary.man.in+
+ mv $(srcdir)/plot_summary.man.in+ $(srcdir)/plot_summary.man.in
+
+### Mdoc
+
+$(srcdir)/plot_summary.1plot_summarymdoc: $(srcdir)/plot_summary-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1plot_summarymdoc -Tagmdoc-cmd.tpl plot_summary-opts.def
+
+$(srcdir)/plot_summary.mdoc.in: $(srcdir)/plot_summary.1plot_summarymdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/plot_summary.1plot_summarymdoc > $(srcdir)/plot_summary.mdoc.in+
+ mv $(srcdir)/plot_summary.mdoc.in+ $(srcdir)/plot_summary.mdoc.in
+
+### Manpage (local)
+
+plot_summary.1: $(srcdir)/plot_summary.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=plot_summary.1+:$(srcdir)/plot_summary.$(MANTAGFMT).in
+ mv plot_summary.1+ plot_summary.1
+
+### Texinfo
+
+$(srcdir)/invoke-plot_summary.menu: $(srcdir)/invoke-plot_summary.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-plot_summary.texi: plot_summary-opts $(srcdir)/plot_summary-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section plot_summary-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/plot_summary.html: $(srcdir)/invoke-plot_summary.menu $(srcdir)/invoke-plot_summary.texi $(srcdir)/plot_summary.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o plot_summary.html plot_summary.texi || true )
+
+summary: $(srcdir)/summary-opts
+
+$(srcdir)/summary-opts: summary-opts.def $(OPTTPL)
+ $(run_ag) summary-opts.def
+
+### Nroff
+
+$(srcdir)/summary.1summaryman: $(srcdir)/summary-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1summaryman -Tagman-cmd.tpl summary-opts.def
+
+$(srcdir)/summary.man.in: $(srcdir)/summary.1summaryman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/summary.1summaryman > $(srcdir)/summary.man.in+
+ mv $(srcdir)/summary.man.in+ $(srcdir)/summary.man.in
+
+### Mdoc
+
+$(srcdir)/summary.1summarymdoc: $(srcdir)/summary-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1summarymdoc -Tagmdoc-cmd.tpl summary-opts.def
+
+$(srcdir)/summary.mdoc.in: $(srcdir)/summary.1summarymdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/summary.1summarymdoc > $(srcdir)/summary.mdoc.in+
+ mv $(srcdir)/summary.mdoc.in+ $(srcdir)/summary.mdoc.in
+
+### Manpage (local)
+
+summary.1: $(srcdir)/summary.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=summary.1+:$(srcdir)/summary.$(MANTAGFMT).in
+ mv summary.1+ summary.1
+
+### Texinfo
+
+$(srcdir)/invoke-summary.menu: $(srcdir)/invoke-summary.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-summary.texi: summary-opts $(srcdir)/summary-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section summary-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/summary.html: $(srcdir)/invoke-summary.menu $(srcdir)/invoke-summary.texi $(srcdir)/summary.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o summary.html summary.texi || true )
+
+# 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/scripts/README b/scripts/README
new file mode 100644
index 0000000..9f70a63
--- /dev/null
+++ b/scripts/README
@@ -0,0 +1,31 @@
+README file for directory ./scripts of the NTP Version 4 distribution
+
+This directory contains shell and perl script files for the configuration,
+monitoring and support of NTP installations. See the README and RELNOTES
+files in the parent directory for directions on how to use these files.
+
+calc_tickadj Calculates "optimal" value for tick given ntp.drift file
+
+monitoring directory containing perl scripts useful for monitoring
+ operations
+
+rc start/stop scripts for NTP
+
+ntp-wait Blocks until ntpd is in state 4 (synchronized).
+ Useful at boot time, to delay the boot sequence
+ until after "ntpd -g" has set the time.
+
+ntpsweep prints per host given in <file> the NTP stratum level, the
+ clock offset in seconds, the daemon version, the operating
+ system and the processor.
+
+ntptrace Trace ntp peers of a server up to stratum 1.
+
+stats directory containing awk and shell scripts useful for
+ maintaining statistics summaries of clockstats, loopstats
+ and peerstats files
+
+summary Generate summary files out of stat files produced by NTP
+ daemon.
+
+plot_summary Plot summaries generated by summary script.
diff --git a/scripts/build/Makefile.am b/scripts/build/Makefile.am
new file mode 100644
index 0000000..51a1bbc
--- /dev/null
+++ b/scripts/build/Makefile.am
@@ -0,0 +1,17 @@
+run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../sntp/include -L ../sntp/ag-tpl
+
+noinst_SCRIPTS = mkver
+
+NULL=
+EXTRA_DIST = \
+ check--help \
+ checkChangeLog \
+ checkHtmlFileDates \
+ fixautomakedepsmagic \
+ genCommitLog \
+ genver \
+ updateBEDate \
+ UpdatePoint \
+ VersionName \
+ $(NULL)
diff --git a/scripts/build/Makefile.in b/scripts/build/Makefile.in
new file mode 100644
index 0000000..212d26b
--- /dev/null
+++ b/scripts/build/Makefile.in
@@ -0,0 +1,550 @@
+# Makefile.in generated by automake 1.11.1 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.
+# 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = scripts/build
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/mkver.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.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_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_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.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)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = mkver
+CONFIG_CLEAN_VPATH_FILES =
+SCRIPTS = $(noinst_SCRIPTS)
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+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@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+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_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@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+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@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+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@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+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_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+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@
+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@
+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@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../sntp/include -L ../sntp/ag-tpl
+
+noinst_SCRIPTS = mkver
+NULL =
+EXTRA_DIST = \
+ check--help \
+ checkChangeLog \
+ checkHtmlFileDates \
+ fixautomakedepsmagic \
+ genCommitLog \
+ genver \
+ updateBEDate \
+ UpdatePoint \
+ VersionName \
+ $(NULL)
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/build/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign scripts/build/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+mkver: $(top_builddir)/config.status $(srcdir)/mkver.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-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
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool 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-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
+
+
+# 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/scripts/build/UpdatePoint b/scripts/build/UpdatePoint
new file mode 100755
index 0000000..e3c5957
--- /dev/null
+++ b/scripts/build/UpdatePoint
@@ -0,0 +1,331 @@
+#! /bin/sh
+
+# showusage is set to 1 on any command-line syntax error
+showusage=0
+# are we playing by stable or dev rules?
+repo=
+# test is set to 1 if -t/--test is given to prevent modifications
+test=0
+
+case "$#" in
+ 1) repo=$1
+ ;;
+ 2) repo=$2
+ case $1 in
+ -t|--test)
+ test=1
+ ;;
+ *)
+ showusage=1
+ ;;
+ esac
+ ;;
+ *) showusage=1
+ ;;
+esac
+
+case "$repo" in
+ dev|stable)
+ ;;
+ '')
+ showusage=1
+ ;;
+ *) echo "Unexpected repo type: <$repo>!"
+ showusage=1
+ ;;
+esac
+
+case "$showusage" in
+ 1) echo "Usage: $0 [-t] <stable|dev>"
+ echo "No changes are made to packageinfo.sh if -t is given."
+ exit 1
+ ;;
+esac
+
+
+set -e
+
+. ./packageinfo.sh
+
+case "$repotype" in
+ $repo)
+ ;;
+ *) echo "You indicated repo type <$repo> but packageinfo.sh"
+ echo "indicates <$repotype>."
+ exit 1
+ ;;
+esac
+
+ver_repo_mismatch=1
+
+case "$minor" in
+ 1|3|5|7|9)
+ case "$repo" in
+ dev)
+ ver_repo_mismatch=0
+ ;;
+ stable)
+ ;;
+ esac
+ ;;
+ 0|2|4|6|8)
+ case "$repo" in
+ dev)
+ ;;
+ stable)
+ ver_repo_mismatch=0
+ ;;
+ esac
+ ;;
+esac
+
+case "$ver_repo_mismatch" in
+ 1) echo "Minor version <$minor> mismatches repotype <$repo>."
+ exit 1
+ ;;
+esac
+
+# Do we want to bump the point?
+bp=1
+# Do we want to bump the beta point?
+bbp=0
+# Do we want to change the RC point? (n=no, z=empty rcpoint and zero
+# betapoint, i=incr)
+crcp=n
+# Do we want to change the prerelease value?
+setpr=0
+
+# for stable:
+# if we are not in a beta or RC state, enter beta unless point is NEW.
+# if we are in a beta state:
+# - bump the beta point
+# else if we are in an RC state:
+# - if rcpoint is GO:
+# - - set rcpoint= (empty)
+# - - set prerelease= (empty)
+# - - set betapoint=0
+# - else
+# - - if rcpoint==(empty)
+# - - - (bump-point) and set rcpoint to 0 (and fall thru, so -RC1 is first)
+# - - bump the RC point
+
+# for dev, we only want to bump-point and possibly clear prerelease,
+# but we do not modify rcpoint nor betapoint.
+
+case "$repo" in
+ dev)
+ case "$point" in
+ [Nn][Ee][Ww])
+ crcp=z
+ ;;
+ *)
+ # crcp=n
+ ;;
+ esac
+ # bp=1
+ ;;
+ stable)
+ case "$prerelease" in
+ '')
+ case "$betapoint::$rcpoint::$point" in
+ *::*::NEW)
+ # new minor release (no p)
+ crcp=z
+ # bp=1
+ ;;
+ 0::::*)
+ # start of first beta cycle for the next point release
+ setpr=1
+ newpr=beta
+ # bp=1
+ bbp=1
+ ;;
+ 0::[Gg][Oo]::*)
+ # skip all -beta and -RC prereleases to the next point.
+ crcp=z
+ setpr=1
+ newpr=
+ # bp=1
+ # bbp=0
+ ;;
+ *) echo "betapoint is <$betapoint>, rcpoint is <$rcpoint>"
+ echo "betapoint must be 0 and rcpoint must be empty to start the"
+ echo "beta cycle."
+ exit 1
+ ;;
+ esac
+ ;;
+ beta)
+ case "$betapoint::$rcpoint" in
+ [1-9]*::*)
+ bp=0
+ bbp=1
+ ;;
+ 0::) echo "betapoint is 0, rcpoint emtpy, and prerelease is beta."
+ echo "You probably intended prerelease= (that is, empty). It"
+ echo "will then be changed to beta by this script, starting the"
+ echo "first beta for the next point release."
+ exit 1
+ ;;
+ *)
+ bp=0
+ bbp=1
+ ;;
+ esac
+ case "$rcpoint" in
+ [Gg][Oo])
+ echo "prerelease is beta, rcpoint is GO, disallowed."
+ echo "rcpoint GO is allowed only when prerelease is RC or empty."
+ exit 1
+ ;;
+ esac
+ ;;
+ rc|RC)
+ case "$rcpoint" in
+ '')
+ case "$betapoint" in
+ 0) # bp=1
+ ;;
+ *) bp=0
+ ;;
+ esac
+ crcp=i
+ ;;
+ [1-9]*)
+ bp=0
+ crcp=i
+ ;;
+ [Gg][Oo])
+ bp=0
+ crcp=z
+ setpr=1
+ newpr=
+ ;;
+ *) echo "Unexpected value for 'rcpoint' <$rcpoint>!"
+ exit 1
+ ;;
+ esac
+ ;;
+ *)
+ echo "prerelease <$prerelease> unexpected"
+ exit 1
+ ;;
+ esac
+ ;;
+ *) echo "impossible: repo <$repo>!"
+ exit 1
+ ;;
+esac
+
+case "$bp::$point" in
+ 0::*)
+ newpoint=$point
+ ;;
+ 1::[1-9]*)
+ newpoint=`expr $point + 1`
+ ;;
+ 1::)
+ newpoint=1
+ ;;
+ 1::[Nn][Ee][Ww])
+ newpoint=
+ ;;
+ *) echo "Unexpected value for 'point' <$point>!"
+ exit 1
+ ;;
+esac
+
+case "$bbp::$betapoint" in
+ 0::*)
+ newbetapoint=$betapoint
+ ;;
+ 1::[0-9]*)
+ newbetapoint=`expr $betapoint + 1`
+ ;;
+ *) echo "Unexpected value for 'betapoint' <$betapoint>!"
+ exit 1
+ ;;
+esac
+
+case "$crcp::$rcpoint" in
+ n::*)
+ newrcpoint=$rcpoint
+ ;;
+ i::)
+ newrcpoint=1
+ ;;
+ i::[0-9]*)
+ newrcpoint=`expr $rcpoint + 1`
+ ;;
+ z::*)
+ newrcpoint=
+ newbetapoint=0
+ ;;
+ *) echo "Unexpected value for 'crcp::rcpoint' <$crcp::$rcpoint>!"
+ exit 1
+ ;;
+esac
+
+case "$setpr" in
+ 0)
+ newpr=$prerelease
+esac
+
+# display results
+printf "prerelease $prerelease"
+case "$newpr" in
+ $prerelease)
+ printf "\n"
+ ;;
+ *) printf " -> $newpr\n"
+ ;;
+esac
+printf "point $point"
+case "$newpoint" in
+ $point)
+ printf "\n"
+ ;;
+ *) printf " -> $newpoint\n"
+ ;;
+esac
+printf "betapoint $betapoint"
+case "$newbetapoint" in
+ $betapoint)
+ printf "\n"
+ ;;
+ *) printf " -> $newbetapoint\n"
+ ;;
+esac
+printf "rcpoint $rcpoint"
+case "$newrcpoint" in
+ $rcpoint)
+ printf "\n"
+ ;;
+ *) printf " -> $newrcpoint\n"
+ ;;
+esac
+
+printf "Previous version: "
+scripts/build/VersionName
+
+# apply packageinfo.sh changes
+
+sed -e "s/^point=.*/point=$newpoint/" \
+ -e "s/^betapoint=.*/betapoint=$newbetapoint/" \
+ -e "s/^rcpoint=.*/rcpoint=$newrcpoint/" \
+ -e "s/^prerelease=.*/prerelease=$newpr/" \
+ < packageinfo.sh \
+ > packageinfo.sh+
+
+case "$test" in
+ 0)
+ mv packageinfo.sh+ packageinfo.sh
+ printf "Updated version: "
+ scripts/build/VersionName
+ ;;
+ *)
+ printf "Next version would be: "
+ scripts/build/VersionName -p ./packageinfo.sh+
+ rm packageinfo.sh+
+ ;;
+esac
diff --git a/scripts/build/VersionName b/scripts/build/VersionName
new file mode 100755
index 0000000..71e31a9
--- /dev/null
+++ b/scripts/build/VersionName
@@ -0,0 +1,61 @@
+#! /bin/sh
+
+packageinfo='./packageinfo.sh'
+case "$#" in
+ 2)
+ case "$1" in
+ -p|--packageinfo)
+ packageinfo="$2"
+ esac
+ ;;
+ 0)
+ ;;
+ *) echo "Usage: $0 [-p packageinfo.sh]"
+ exit 1
+ ;;
+esac
+
+# This script must be executed from the TLD of the source tree...
+. "$packageinfo"
+
+NAME="$version"
+case $point in
+ [1-9]*)
+ case "${proto}.${major}" in
+ 4.[012])
+ NAME="${NAME}p${point}"
+ ;;
+ *) NAME="${NAME}.${point}"
+ ;;
+ esac
+ ;;
+ NEW) ;;
+ '') ;;
+ *) echo "Unexpected value for 'point' <$point>!"
+ exit 1
+ ;;
+esac
+
+case $special in
+ '') ;;
+ *) NAME="${NAME}-${special}" ;;
+esac
+
+case "$prerelease::$repotype" in
+ ''::*)
+ ;;
+ beta::stable)
+ NAME="${NAME}-beta${betapoint}"
+ ;;
+ rc::dev|RC::dev)
+ NAME="${NAME}-RC"
+ ;;
+ rc::stable|RC::stable)
+ NAME="${NAME}-RC${rcpoint}"
+ ;;
+ *) echo "Unexpected value for 'prerelease::repotype' <$prerelease::$repotype>!"
+ exit 1
+ ;;
+esac
+
+echo "$NAME"
diff --git a/scripts/build/check--help b/scripts/build/check--help
new file mode 100755
index 0000000..1524675
--- /dev/null
+++ b/scripts/build/check--help
@@ -0,0 +1,22 @@
+#! /bin/sh
+
+# Look at the file specified in $1 to see if it contains 'no --help'.
+# If it does:
+# - Squawk
+# - rename the file to ($1)-
+# - exit with a non-zero status.
+# otherwise:
+# - exit with a 0 status.
+
+if test ! -f $1
+then
+ echo "$0: $1 is not a regular file!" 2>&3
+ exit 1
+fi
+
+if grep -q 'no --help' $1
+then
+ echo "$0: $1 contains 'no --help'!" 2>&3
+ mv ${1} ${1}-
+ exit 1
+fi
diff --git a/scripts/build/checkChangeLog b/scripts/build/checkChangeLog
new file mode 100755
index 0000000..46c56c4
--- /dev/null
+++ b/scripts/build/checkChangeLog
@@ -0,0 +1,29 @@
+#! /bin/sh
+
+. ./packageinfo.sh
+
+# HMS: Irix doesn't have 'head'...
+cl1=`head -1 ChangeLog || sed -e 1q ChangeLog`
+
+case "$repotype" in
+ dev) ;;
+ stable) ;;
+ *) echo "Unexpected repotype <$repotype>"
+ exit 1
+ ;;
+esac
+
+case "$repotype$cl1" in
+ dev---)
+ echo "Dev repo ChangeLog must not begin with '---'!"
+ exit 1
+ ;;
+ dev*)
+ ;;
+ stable---)
+ ;;
+ stable*)
+ echo "Stable repo Changelog must begin with '---'!"
+ exit 1
+ ;;
+esac
diff --git a/scripts/build/checkHtmlFileDates b/scripts/build/checkHtmlFileDates
new file mode 100755
index 0000000..9d9a2f2
--- /dev/null
+++ b/scripts/build/checkHtmlFileDates
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+bk version > /dev/null 2>&1 || exit 0
+
+for i in `find * -type f -name '*.html' -print | grep -v SCCS/`
+do
+ # echo $i
+ set `bk diffs $i | wc -l`
+ lines=$1
+ case "$lines" in
+ 0) ;;
+ *) echo "Processing <$i>"
+ ../scripts/build/updateBEDate $i
+ ;;
+ esac
+done
diff --git a/scripts/build/fixautomakedepsmagic b/scripts/build/fixautomakedepsmagic
new file mode 100755
index 0000000..ec82bba
--- /dev/null
+++ b/scripts/build/fixautomakedepsmagic
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+prog=`basename $0`
+
+
+t=/tmp/$prog.$$
+
+trap 'rm -f ${t} ; exit 1' 1 3 15
+
+while [ $# -gt 0 ]; do
+ f=$1
+ shift
+ sed -e '/^DEPS_MAGIC :=/,/^-include \$/s/^/#/' $f > $t
+ c="diff $f $t"
+ echo $c
+ $c
+ tstatus=$?
+ if [ $tstatus = 0 ]; then
+ echo "$prog":" $f not modified"
+ elif [ ! -w $f ]; then
+ echo "$prog":" $f not not writable"
+ else
+ c="cp $t $f"
+ echo $c
+ $c
+ fi
+ rm -f $t
+done
diff --git a/scripts/build/genCommitLog b/scripts/build/genCommitLog
new file mode 100755
index 0000000..318e286
--- /dev/null
+++ b/scripts/build/genCommitLog
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+set -e
+
+GCL_REMOVEWRITE=0
+. ./packageinfo.sh
+if [ ! -w . ] ; then
+ GCL_REMOVEWRITE=1
+ chmod u+w .
+ [ -f CommitLog -a ! -w CommitLog ] && chmod u+w CommitLog
+fi
+bk changes -v -m -r${CLTAG}.. > CommitLog.new
+mv CommitLog.new CommitLog
+case "$GCL_REMOVEWRITE" in
+ 1) chmod a-w CommitLog .
+esac
diff --git a/scripts/build/genver b/scripts/build/genver
new file mode 100755
index 0000000..c073243
--- /dev/null
+++ b/scripts/build/genver
@@ -0,0 +1,96 @@
+#! /bin/sh
+
+# possible usage: $0 [-f] [version.m4] [version.def]
+#
+# -f would be 'force the update'
+
+force=0
+outputs=
+for i in $*
+do
+ case "$i" in
+ -f)
+ force=1
+ ;;
+ *version.m4)
+ outputs="m4/version.m4 $outputs"
+ ;;
+ *version.def)
+ outputs="include/version.def $outputs"
+ ;;
+ *version.texi)
+ outputs="include/version.texi $outputs"
+ ;;
+ *) echo "Unrecognized option: $i"
+ exit 1
+ ;;
+ esac
+done
+
+case "$outputs" in
+ '') outputs="m4/version.m4 include/version.def include/version.texi" ;;
+esac
+
+set -e
+
+. ../packageinfo.sh
+
+dversion=`../scripts/build/VersionName -p ../packageinfo.sh`
+
+set +e
+
+# Create intermediate files in $TEMPDIR defaulting it to /tmp
+# if not set. This avoids races when multiple builds run in
+# parallel on shared source.
+
+TEMPDIR=${TEMPDIR=/tmp}
+
+case "$outputs" in
+ *version.m4*)
+ echo "m4_define([VERSION_NUMBER],[${dversion}])" > "${TEMPDIR}/version.m4+"
+ cmp -s "${TEMPDIR}/version.m4+" m4/version.m4
+ rc=$?
+ case "$force$rc" in
+ 00)
+ rm -f "${TEMPDIR}/version.m4+"
+ ;;
+ *)
+ mv "${TEMPDIR}/version.m4+" m4/version.m4
+ ;;
+ esac
+ ;;
+esac
+
+case "$outputs" in
+ *version.def*)
+ echo "version = '${dversion}';" > "${TEMPDIR}/version.def+"
+ cmp -s "${TEMPDIR}/version.def+" include/version.def
+ rc=$?
+ case "$force$rc" in
+ 00)
+ rm -f "${TEMPDIR}/version.def+"
+ ;;
+ *)
+ mv "${TEMPDIR}/version.def+" include/version.def
+ ;;
+ esac
+ ;;
+esac
+
+case "$outputs" in
+ *version.texi*)
+ echo "@set UPDATED `date +'%d %B %Y'`" > "${TEMPDIR}/version.texi+"
+ echo "@set EDITION $dversion" >> "${TEMPDIR}/version.texi+"
+ echo "@set VERSION $dversion" >> "${TEMPDIR}/version.texi+"
+ cmp -s "${TEMPDIR}/version.texi+" include/version.texi
+ rc=$?
+ case "$force$rc" in
+ 00)
+ rm -f "${TEMPDIR}/version.texi+"
+ ;;
+ *)
+ mv "${TEMPDIR}/version.texi+" include/version.texi
+ ;;
+ esac
+ ;;
+esac
diff --git a/scripts/build/mkver.in b/scripts/build/mkver.in
new file mode 100644
index 0000000..3aef1c8
--- /dev/null
+++ b/scripts/build/mkver.in
@@ -0,0 +1,38 @@
+#!@CONFIG_SHELL@
+PROG=${1-UNKNOWN}
+
+ConfStr="$PROG"
+
+ConfStr="$ConfStr @VERSION@"
+
+case "$CSET" in
+ '') ;;
+ *) ConfStr="$ConfStr@$CSET" ;;
+esac
+
+case "@VER_SUFFIX@" in
+ '') ;;
+ *) ConfStr="${ConfStr}-@VER_SUFFIX@" ;;
+esac
+
+ConfStr="$ConfStr `LC_TIME=C TZ=UTC date`"
+
+if [ ! -f .version ]; then
+ echo 0 > .version
+fi
+RUN="`cat .version`"
+RUN="`expr $RUN + 1`"
+echo $RUN > .version
+
+ConfStr="$ConfStr (${RUN})"
+
+echo "Version <${ConfStr}>";
+
+rm -f version.c
+cat > version.c << -EoF-
+/*
+ * version file for $PROG
+ */
+#include <config.h>
+const char * Version = "${ConfStr}";
+-EoF-
diff --git a/scripts/build/updateBEDate b/scripts/build/updateBEDate
new file mode 100755
index 0000000..467e707
--- /dev/null
+++ b/scripts/build/updateBEDate
@@ -0,0 +1,53 @@
+#! /usr/bin/env perl
+use warnings;
+use strict;
+
+# for each filename on the command line
+# get the modtime
+# make a backup of the file
+# - error if there is already a backup?
+# flush the live version(?)
+# start a line-by-line copy of the backup to the new file,
+# doing the BeginDate/EndDate substitution
+
+# <!-- #BeginDate format:En1m -->3-oct-11 18:20<!-- #EndDate -->
+# <!-- #BeginDate format:En2m -->01-Aug-2011 17:56<!-- #EndDate -->
+# without the 'm' no minutes are included.
+
+my $i;
+my $mod_time;
+my $stamp;
+my @m_abbr = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
+
+foreach ( @ARGV ) {
+ $i = $_;
+ $mod_time = (stat ($i))[9];
+ $stamp = localtime($mod_time);
+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
+ localtime($mod_time);
+ $year += 1900;
+
+ # print "<$i> at <$stamp>\n";
+
+ open(my $IFILE, "<", $i) or die "Cannot open < $i: $!";
+ open(my $OFILE, ">", $i.".new") or die "Cannot open > $i.new: $!";
+ while(<$IFILE>) {
+ if (/(.*<!--\s*#BeginDate\s*format:)(\S*)(\s*-->).*(<!--\s*#EndDate\s*-->.*)/) {
+ # print "Got: $_";
+ # print "as: <$1><$2><$3>...<$4>\n";
+ print { $OFILE } $1,$2,$3;
+ printf { $OFILE } "%s-%s-%s %02d:%02d", $mday,$m_abbr[$mon],$year,$hour,$min;
+ print { $OFILE } $4,"\n";
+ }
+ else {
+ print { $OFILE } $_;
+ }
+ }
+ close($IFILE);
+ close($OFILE);
+ #
+ utime(time, $mod_time, "$i.new") || die "touch $i.new failed: $!";
+ #
+ rename $i,"$i.old" || die "rename $i,$i.old failed: $!";
+ rename "$i.new",$i || die "rename $i.new,$i failed: $!";
+}
diff --git a/scripts/calc_tickadj/Makefile.am b/scripts/calc_tickadj/Makefile.am
new file mode 100644
index 0000000..b98bc87
--- /dev/null
+++ b/scripts/calc_tickadj/Makefile.am
@@ -0,0 +1,104 @@
+NULL=
+run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../../sntp/include -L ../../sntp/ag-tpl \
+ --writable
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+
+bin_SCRIPTS= $(CALC_TICKADJ_DB)
+libexec_SCRIPTS= $(CALC_TICKADJ_DL)
+sbin_SCRIPTS= $(CALC_TICKADJ_DS)
+EXTRA_SCRIPTS= calc_tickadj
+
+man1_MANS=
+man8_MANS=
+manpage_HACK=
+if WANT_CALC_TICKADJ_MS
+man_MANS= calc_tickadj.$(CALC_TICKADJ_MS)
+else
+manpage_HACK+= calc_tickadj.
+# Note that if we don't WANT_CALC_TICKADJ then CALC_TICKADJ_MS will
+# be empty. But we still need the .texi and other files to be built, as
+# they are general prerequisites.
+# The manpage_HACK is listed in noinst_DATA so that takes care of these.
+endif
+
+DISTCLEANFILES = config.log $(man_MANS) calc_tickadj.
+
+EXTRA_DIST = \
+ calc_tickadj.in \
+ calc_tickadj.1calc_tickadjman \
+ calc_tickadj.1calc_tickadjmdoc \
+ calc_tickadj.man.in \
+ calc_tickadj.mdoc.in \
+ calc_tickadj.texi \
+ calc_tickadj.html \
+ calc_tickadj-opts.def \
+ calc_tickadj-opts \
+ invoke-calc_tickadj.texi \
+ invoke-calc_tickadj.menu \
+ $(NULL)
+
+noinst_DATA = \
+ calc_tickadj.1calc_tickadjman \
+ calc_tickadj.1calc_tickadjmdoc \
+ calc_tickadj.man.in \
+ calc_tickadj.mdoc.in \
+ calc_tickadj.texi \
+ calc_tickadj.html \
+ calc_tickadj-opts.def \
+ calc_tickadj-opts \
+ invoke-calc_tickadj.texi \
+ invoke-calc_tickadj.menu \
+ $(manpage_HACK) \
+ $(NULL)
+
+calc_tickadj: $(srcdir)/calc_tickadj-opts
+
+$(srcdir)/calc_tickadj-opts: $(srcdir)/calc_tickadj-opts.def
+ $(run_ag) calc_tickadj-opts.def
+
+### Nroff
+
+$(srcdir)/calc_tickadj.1calc_tickadjman: $(srcdir)/calc_tickadj-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1calc_tickadjman -Tagman-cmd.tpl calc_tickadj-opts.def
+
+$(srcdir)/calc_tickadj.man.in: $(srcdir)/calc_tickadj.1calc_tickadjman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/calc_tickadj.1calc_tickadjman > $(srcdir)/calc_tickadj.man.in+
+ mv $(srcdir)/calc_tickadj.man.in+ $(srcdir)/calc_tickadj.man.in
+
+### Mdoc
+
+$(srcdir)/calc_tickadj.1calc_tickadjmdoc: $(srcdir)/calc_tickadj-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1calc_tickadjmdoc -Tagmdoc-cmd.tpl calc_tickadj-opts.def
+
+$(srcdir)/calc_tickadj.mdoc.in: $(srcdir)/calc_tickadj.1calc_tickadjmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/calc_tickadj.1calc_tickadjmdoc > $(srcdir)/calc_tickadj.mdoc.in+
+ mv $(srcdir)/calc_tickadj.mdoc.in+ $(srcdir)/calc_tickadj.mdoc.in
+
+### Manpage
+
+calc_tickadj.$(CALC_TICKADJ_MS): $(srcdir)/calc_tickadj.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=calc_tickadj.$(CALC_TICKADJ_MS)+:$(srcdir)/calc_tickadj.$(MANTAGFMT).in
+ mv calc_tickadj.$(CALC_TICKADJ_MS)+ calc_tickadj.$(CALC_TICKADJ_MS)
+
+### Texinfo
+
+$(srcdir)/invoke-calc_tickadj.menu: $(srcdir)/invoke-calc_tickadj.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-calc_tickadj.texi: $(srcdir)/calc_tickadj-opts $(srcdir)/calc_tickadj-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section calc_tickadj-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/calc_tickadj.html: $(srcdir)/invoke-calc_tickadj.menu $(srcdir)/invoke-calc_tickadj.texi $(srcdir)/calc_tickadj.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o calc_tickadj.html calc_tickadj.texi || true )
diff --git a/scripts/calc_tickadj/Makefile.in b/scripts/calc_tickadj/Makefile.in
new file mode 100644
index 0000000..4e5b34f
--- /dev/null
+++ b/scripts/calc_tickadj/Makefile.in
@@ -0,0 +1,865 @@
+# Makefile.in generated by automake 1.11.1 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.
+# 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@WANT_CALC_TICKADJ_MS_FALSE@am__append_1 = calc_tickadj.
+subdir = scripts/calc_tickadj
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/calc_tickadj.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.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_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_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.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)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = calc_tickadj
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \
+ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \
+ "$(DESTDIR)$(man8dir)"
+SCRIPTS = $(bin_SCRIPTS) $(libexec_SCRIPTS) $(sbin_SCRIPTS)
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+man1dir = $(mandir)/man1
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(man1_MANS) $(man8_MANS) $(man_MANS)
+DATA = $(noinst_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+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@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+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_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@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+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@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+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@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+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_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+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@
+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@
+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@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+NULL =
+run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../../sntp/include -L ../../sntp/ag-tpl \
+ --writable
+
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+bin_SCRIPTS = $(CALC_TICKADJ_DB)
+libexec_SCRIPTS = $(CALC_TICKADJ_DL)
+sbin_SCRIPTS = $(CALC_TICKADJ_DS)
+EXTRA_SCRIPTS = calc_tickadj
+man1_MANS =
+man8_MANS =
+manpage_HACK = $(am__append_1)
+@WANT_CALC_TICKADJ_MS_TRUE@man_MANS = calc_tickadj.$(CALC_TICKADJ_MS)
+# Note that if we don't WANT_CALC_TICKADJ then CALC_TICKADJ_MS will
+# be empty. But we still need the .texi and other files to be built, as
+# they are general prerequisites.
+# The manpage_HACK is listed in noinst_DATA so that takes care of these.
+DISTCLEANFILES = config.log $(man_MANS) calc_tickadj.
+EXTRA_DIST = \
+ calc_tickadj.in \
+ calc_tickadj.1calc_tickadjman \
+ calc_tickadj.1calc_tickadjmdoc \
+ calc_tickadj.man.in \
+ calc_tickadj.mdoc.in \
+ calc_tickadj.texi \
+ calc_tickadj.html \
+ calc_tickadj-opts.def \
+ calc_tickadj-opts \
+ invoke-calc_tickadj.texi \
+ invoke-calc_tickadj.menu \
+ $(NULL)
+
+noinst_DATA = \
+ calc_tickadj.1calc_tickadjman \
+ calc_tickadj.1calc_tickadjmdoc \
+ calc_tickadj.man.in \
+ calc_tickadj.mdoc.in \
+ calc_tickadj.texi \
+ calc_tickadj.html \
+ calc_tickadj-opts.def \
+ calc_tickadj-opts \
+ invoke-calc_tickadj.texi \
+ invoke-calc_tickadj.menu \
+ $(manpage_HACK) \
+ $(NULL)
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/calc_tickadj/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign scripts/calc_tickadj/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+calc_tickadj: $(top_builddir)/config.status $(srcdir)/calc_tickadj.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+install-libexecSCRIPTS: $(libexec_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
+ @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-libexecSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+install-sbinSCRIPTS: $(sbin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+ @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-sbinSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+install-man8: $(man8_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man8:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS) $(MANS) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-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
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binSCRIPTS install-libexecSCRIPTS \
+ install-sbinSCRIPTS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1 install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binSCRIPTS uninstall-libexecSCRIPTS \
+ uninstall-man uninstall-sbinSCRIPTS
+
+uninstall-man: uninstall-man1 uninstall-man8
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binSCRIPTS 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-libexecSCRIPTS install-man install-man1 install-man8 \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-sbinSCRIPTS install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am uninstall uninstall-am uninstall-binSCRIPTS \
+ uninstall-libexecSCRIPTS uninstall-man uninstall-man1 \
+ uninstall-man8 uninstall-sbinSCRIPTS
+
+
+calc_tickadj: $(srcdir)/calc_tickadj-opts
+
+$(srcdir)/calc_tickadj-opts: $(srcdir)/calc_tickadj-opts.def
+ $(run_ag) calc_tickadj-opts.def
+
+### Nroff
+
+$(srcdir)/calc_tickadj.1calc_tickadjman: $(srcdir)/calc_tickadj-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1calc_tickadjman -Tagman-cmd.tpl calc_tickadj-opts.def
+
+$(srcdir)/calc_tickadj.man.in: $(srcdir)/calc_tickadj.1calc_tickadjman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/calc_tickadj.1calc_tickadjman > $(srcdir)/calc_tickadj.man.in+
+ mv $(srcdir)/calc_tickadj.man.in+ $(srcdir)/calc_tickadj.man.in
+
+### Mdoc
+
+$(srcdir)/calc_tickadj.1calc_tickadjmdoc: $(srcdir)/calc_tickadj-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1calc_tickadjmdoc -Tagmdoc-cmd.tpl calc_tickadj-opts.def
+
+$(srcdir)/calc_tickadj.mdoc.in: $(srcdir)/calc_tickadj.1calc_tickadjmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/calc_tickadj.1calc_tickadjmdoc > $(srcdir)/calc_tickadj.mdoc.in+
+ mv $(srcdir)/calc_tickadj.mdoc.in+ $(srcdir)/calc_tickadj.mdoc.in
+
+### Manpage
+
+calc_tickadj.$(CALC_TICKADJ_MS): $(srcdir)/calc_tickadj.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=calc_tickadj.$(CALC_TICKADJ_MS)+:$(srcdir)/calc_tickadj.$(MANTAGFMT).in
+ mv calc_tickadj.$(CALC_TICKADJ_MS)+ calc_tickadj.$(CALC_TICKADJ_MS)
+
+### Texinfo
+
+$(srcdir)/invoke-calc_tickadj.menu: $(srcdir)/invoke-calc_tickadj.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-calc_tickadj.texi: $(srcdir)/calc_tickadj-opts $(srcdir)/calc_tickadj-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section calc_tickadj-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/calc_tickadj.html: $(srcdir)/invoke-calc_tickadj.menu $(srcdir)/invoke-calc_tickadj.texi $(srcdir)/calc_tickadj.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o calc_tickadj.html calc_tickadj.texi || true )
+
+# 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/scripts/calc_tickadj/calc_tickadj-opts b/scripts/calc_tickadj/calc_tickadj-opts
new file mode 100644
index 0000000..c8a8c0d
--- /dev/null
+++ b/scripts/calc_tickadj/calc_tickadj-opts
@@ -0,0 +1,60 @@
+# EDIT THIS FILE WITH CAUTION (calc_tickadj-opts)
+#
+# It has been AutoGen-ed August 31, 2014 at 04:52:46 AM by AutoGen 5.18.4
+# From the definitions calc_tickadj-opts.def
+# and the template file perlopt
+
+use Getopt::Long qw(GetOptionsFromArray);
+Getopt::Long::Configure(qw(no_auto_abbrev no_ignore_case_always));
+
+my $usage;
+
+sub usage {
+ my ($ret) = @_;
+ print STDERR $usage;
+ exit $ret;
+}
+
+sub paged_usage {
+ my ($ret) = @_;
+ my $pager = $ENV{PAGER} || '(less || more)';
+
+ open STDOUT, "| $pager" or die "Can't fork a pager: $!";
+ print $usage;
+
+ exit $ret;
+}
+
+sub processOptions {
+ my $args = shift;
+
+ my $opts = {
+ 'drift-file' => '/etc/ntp/drift',
+ 'tick' => '',
+ 'help' => '', 'more-help' => ''
+ };
+ my $argument = '';
+ my $ret = GetOptionsFromArray($args, $opts, (
+ 'drift-file|d=s', 'tick|t=i',
+ 'help|?', 'more-help'));
+
+ $usage = <<'USAGE';
+calc_tickadj - Calculates "optimal" value for tick given ntp drift file. - Ver. 4.2.7p467
+USAGE: calc_tickadj [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
+
+ -d, --drift-file=str Ntp drift file to use
+ -t, --tick=num Tick value of this host
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+USAGE
+
+ usage(0) if $opts->{'help'};
+ paged_usage(0) if $opts->{'more-help'};
+ $_[0] = $opts;
+ return $ret;
+}
+
+END { close STDOUT };
diff --git a/scripts/calc_tickadj/calc_tickadj-opts.def b/scripts/calc_tickadj/calc_tickadj-opts.def
new file mode 100644
index 0000000..cdb50ef
--- /dev/null
+++ b/scripts/calc_tickadj/calc_tickadj-opts.def
@@ -0,0 +1,60 @@
+/* -*- Mode: Text -*- */
+AutoGen Definitions perlopt;
+
+#include autogen-version.def
+
+prog-name = calc_tickadj;
+prog-title = 'Calculates "optimal" value for tick given ntp drift file.';
+package = ntp;
+#include version.def
+
+long-opts;
+gnu-usage;
+
+flag = {
+ name = drift-file;
+ value = d;
+ arg-type = string;
+ arg-default = '/etc/ntp/drift';
+ descrip = 'Ntp drift file to use';
+ doc = 'Use the specified drift file for calculations';
+};
+
+flag = {
+ name = tick;
+ value = t;
+ arg-type = number;
+ descrip = 'Tick value of this host';
+ doc = 'The current tick which to adjustment will be calculated';
+};
+
+doc-section = {
+ ds-type = 'DESCRIPTION';
+ ds-format = 'texi';
+ ds-text = <<- _EndOfDoc
+The @code{calc_tickadj} script uses provided ntp drift file to generate optimal
+tick value. Generally, ntpd can do better job if the drift value is the
+smallest possible number.
+
+The example output of
+@example
+$ ./calc_tickadj
+81.699 (drift)
+9999 usec; 9999779 nsec
+$ cat /etc/ntp/drift
+-23.159
+@end example
+
+means the following. If tick on that box is 10,000, by making the value 9999
+we'll shift the box from its current drift of -23.159 to a drift of 81.699, and
+in doing so we'll speed the clock up a little every second instead of slowing
+the clock down a little.
+
+If 'tick' on that box is 10,000,000 then by setting it to 9999779 the drift
+value will be somewhere around 0.0.
+
+@code{calc_tickadj} tries to determine the the tick value by using
+@code{tickadj} program from ntp package. If this doesn't work you can specify
+current tick manually on command line.
+ _EndOfDoc;
+};
diff --git a/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman b/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman
new file mode 100644
index 0000000..18e2310
--- /dev/null
+++ b/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman
@@ -0,0 +1,108 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH calc_tickadj 1calc_tickadjman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-yLaGPB/ag-LLaOOB)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:04 AM by AutoGen 5.18.5pre4
+.\" From the definitions calc_tickadj-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]calc_tickadj\fP
+\- Calculates optimal value for tick given ntp drift file.
+.SH SYNOPSIS
+\f\*[B-Font]calc_tickadj\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+The \fBcalc_tickadj\fP script uses provided ntp drift file to generate optimal
+tick value. Generally, ntpd can do better job if the drift value is the
+smallest possible number.
+.sp
+The example output of
+.br
+.in +4
+.nf
+$ ./calc_tickadj
+81.699 (drift)
+9999 usec; 9999779 nsec
+$ cat /etc/ntp/drift
+-23.159
+.in -4
+.fi
+.sp
+means the following. If tick on that box is 10,000, by making the value 9999
+we'll shift the box from its current drift of \-23.159 to a drift of 81.699, and
+in doing so we'll speed the clock up a little every second instead of slowing
+the clock down a little.
+.sp
+If 'tick' on that box is 10,000,000 then by setting it to 9999779 the drift
+value will be somewhere around 0.0.
+.sp
+\fBcalc_tickadj\fP tries to determine the the tick value by using
+\fBtickadj\fP program from ntp package. If this doesn't work you can specify
+current tick manually on command line.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-d\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-drift\-file\f[]=\f\*[I-Font]string\f[]
+Ntp drift file to use.
+The default
+\f\*[I-Font]string\f[]
+for this option is:
+.ti +4
+ /etc/ntp/drift
+.sp
+Use the specified drift file for calculations
+.TP
+.NOP \f\*[B-Font]\-t\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-tick\f[]=\f\*[I-Font]number\f[]
+Tick value of this host.
+This option takes an integer number as its argument.
+.sp
+The current tick which to adjustment will be calculated
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-v\f[] [{\f\*[I-Font]v|c|n\f[] \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBcalc_tickadj\fP
+option definitions.
diff --git a/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc b/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc
new file mode 100644
index 0000000..265ec39
--- /dev/null
+++ b/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc
@@ -0,0 +1,84 @@
+.Dd December 2 2014
+.Dt CALC_TICKADJ 1calc_tickadjmdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (calc_tickadj-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:08 AM by AutoGen 5.18.5pre4
+.\" From the definitions calc_tickadj-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm calc_tickadj
+.Nd Calculates "optimal" value for tick given ntp drift file.
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+The \fBcalc_tickadj\fP script uses provided ntp drift file to generate optimal
+tick value. Generally, ntpd can do better job if the drift value is the
+smallest possible number.
+.sp
+The example output of
+.Bd -literal -offset indent
+$ ./calc_tickadj
+81.699 (drift)
+9999 usec; 9999779 nsec
+$ cat /etc/ntp/drift
+-23.159
+.Ed
+.sp
+means the following. If tick on that box is 10,000, by making the value 9999
+we'll shift the box from its current drift of \-23.159 to a drift of 81.699, and
+in doing so we'll speed the clock up a little every second instead of slowing
+the clock down a little.
+.sp
+If 'tick' on that box is 10,000,000 then by setting it to 9999779 the drift
+value will be somewhere around 0.0.
+.sp
+\fBcalc_tickadj\fP tries to determine the the tick value by using
+\fBtickadj\fP program from ntp package. If this doesn't work you can specify
+current tick manually on command line.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl d Ar string , Fl \-drift\-file Ns = Ns Ar string
+Ntp drift file to use.
+The default
+.Ar string
+for this option is:
+.ti +4
+ /etc/ntp/drift
+.sp
+Use the specified drift file for calculations
+.It Fl t Ar number , Fl \-tick Ns = Ns Ar number
+Tick value of this host.
+This option takes an integer number as its argument.
+.sp
+The current tick which to adjustment will be calculated
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl v Op Brq Ar v|c|n Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBcalc_tickadj\fP
+option definitions.
diff --git a/scripts/calc_tickadj/calc_tickadj.html b/scripts/calc_tickadj/calc_tickadj.html
new file mode 100644
index 0000000..0d42d6f
--- /dev/null
+++ b/scripts/calc_tickadj/calc_tickadj.html
@@ -0,0 +1,166 @@
+<html lang="en">
+<head>
+<title>calc_tickadj User's Manual</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="calc_tickadj User's Manual">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+ span.sc { font-variant:small-caps }
+ span.roman { font-family: serif; font-weight: normal; }
+--></style>
+</head>
+<body>
+<h1 class="settitle">calc_tickadj User's Manual</h1>
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#calc_005ftickadj-Description">calc_tickadj Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+<h2 class="unnumbered">calc_tickadj User's Manual</h2>
+
+<p>This document describes the use of the NTP Project's <code>calc_tickadj</code> program.
+This document applies to version 4.2.7p482 of <code>calc_tickadj</code>.
+
+ <div class="shortcontents">
+<h2>Short Contents</h2>
+<ul>
+<a href="#Top">calc_tickadj User's Manual</a>
+</ul>
+</div>
+
+<ul class="menu">
+<li><a accesskey="1" href="#calc_005ftickadj-Description">calc_tickadj Description</a>: Description
+<li><a accesskey="2" href="#calc_005ftickadj-Invocation">calc_tickadj Invocation</a>: Invoking calc_tickadj
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="calc_005ftickadj-Invocation"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#calc_005ftickadj-Description">calc_tickadj Description</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<h3 class="section">Invoking calc_tickadj</h3>
+
+<p><a name="index-calc_005ftickadj-1"></a><a name="index-Calculates-_0022optimal_0022-value-for-tick-given-ntp-drift-file_002e-2"></a>
+The <code>calc_tickadj</code> script uses provided ntp drift file to generate optimal
+tick value. Generally, ntpd can do better job if the drift value is the
+smallest possible number.
+
+ <p>The example output of
+<pre class="example"> $ ./calc_tickadj
+ 81.699 (drift)
+ 9999 usec; 9999779 nsec
+ $ cat /etc/ntp/drift
+ -23.159
+</pre>
+ <p>means the following. If tick on that box is 10,000, by making the value 9999
+we'll shift the box from its current drift of -23.159 to a drift of 81.699, and
+in doing so we'll speed the clock up a little every second instead of slowing
+the clock down a little.
+
+ <p>If 'tick' on that box is 10,000,000 then by setting it to 9999779 the drift
+value will be somewhere around 0.0.
+
+ <p><code>calc_tickadj</code> tries to determine the the tick value by using
+<code>tickadj</code> program from ntp package. If this doesn't work you can specify
+current tick manually on command line.
+
+ <p>This section was generated by <strong>AutoGen</strong>,
+using the <code>agtexi-cmd</code> template and the option descriptions for the <code>calc_tickadj</code> program.
+
+<ul class="menu">
+<li><a accesskey="1" href="#calc_005ftickadj-usage">calc_tickadj usage</a>: calc_tickadj help/usage (<span class="option">--help</span>)
+<li><a accesskey="2" href="#calc_005ftickadj-drift_002dfile">calc_tickadj drift-file</a>: drift-file option (-d)
+<li><a accesskey="3" href="#calc_005ftickadj-tick">calc_tickadj tick</a>: tick option (-t)
+<li><a accesskey="4" href="#calc_005ftickadj-exit-status">calc_tickadj exit status</a>: exit status
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="calc_005ftickadj-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#calc_005ftickadj-drift_002dfile">calc_tickadj drift-file</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#calc_005ftickadj-Invocation">calc_tickadj Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">calc_tickadj help/usage (<span class="option">--help</span>)</h4>
+
+<p><a name="index-calc_005ftickadj-help-3"></a>
+This is the automatically generated usage text for calc_tickadj.
+
+ <p>The text printed is the same whether selected with the <code>help</code> option
+(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
+the usage text by passing it through a pager program.
+<code>more-help</code> is disabled on platforms without a working
+<code>fork(2)</code> function. The <code>PAGER</code> environment variable is
+used to select the program, defaulting to <span class="file">more</span>. Both will exit
+with a status code of 0.
+
+<pre class="example">calc_tickadj - Calculates "optimal" value for tick given ntp drift file. - Ver. 4.2.7p467
+USAGE: calc_tickadj [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
+
+ -d, --drift-file=str Ntp drift file to use
+ -t, --tick=num Tick value of this host
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+</pre>
+ <div class="node">
+<p><hr>
+<a name="calc_005ftickadj-drift_002dfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#calc_005ftickadj-tick">calc_tickadj tick</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#calc_005ftickadj-usage">calc_tickadj usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#calc_005ftickadj-Invocation">calc_tickadj Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">drift-file option (-d)</h4>
+
+<p><a name="index-calc_005ftickadj_002ddrift_002dfile-4"></a>
+This is the &ldquo;ntp drift file to use&rdquo; option.
+This option takes a string argument.
+Use the specified drift file for calculations
+<div class="node">
+<p><hr>
+<a name="calc_005ftickadj-tick"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#calc_005ftickadj-exit-status">calc_tickadj exit status</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#calc_005ftickadj-drift_002dfile">calc_tickadj drift-file</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#calc_005ftickadj-Invocation">calc_tickadj Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">tick option (-t)</h4>
+
+<p><a name="index-calc_005ftickadj_002dtick-5"></a>
+This is the &ldquo;tick value of this host&rdquo; option.
+This option takes a number argument.
+The current tick which to adjustment will be calculated
+<div class="node">
+<p><hr>
+<a name="calc_005ftickadj-exit-status"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#calc_005ftickadj-tick">calc_tickadj tick</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#calc_005ftickadj-Invocation">calc_tickadj Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">calc_tickadj exit status</h4>
+
+<p>One of the following exit values will be returned:
+ <dl>
+<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
+<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
+</dl>
+
+</body></html>
+
diff --git a/scripts/calc_tickadj/calc_tickadj.in b/scripts/calc_tickadj/calc_tickadj.in
new file mode 100644
index 0000000..38b826e
--- /dev/null
+++ b/scripts/calc_tickadj/calc_tickadj.in
@@ -0,0 +1,59 @@
+#! @PATH_PERL@ -w
+#
+# drift of 104.8576 -> +1 tick. Base of 10000 ticks.
+#
+# 970306 HMS Deal with nanoseconds. Fix sign of adjustments.
+package calc_tickadj;
+use strict;
+
+exit run(@ARGV) unless caller;
+
+sub run {
+ my $opts;
+ if (!processOptions(\@_, $opts)) {
+ usage(1);
+ };
+ my $drift_file = $opts->{'drift-file'};
+ my $tick = $opts->{'tick'};
+
+ if (!$tick) {
+ my ($fl) = `tickadj`;
+ if (defined $fl && $fl =~ /(?:KERNEL|PRESET)?\s*tick\s+=\s+(\d+)/) {
+ $tick = $1;
+ }
+ else {
+ die "Could not get tick value, try manually with -t/--tick\n";
+ }
+ }
+
+ # Drift file is in PPM where Milion is actually 2**20
+ my $cvt = (2 ** 20) / $tick;
+ my $drift = 0.;
+
+ open my $dfh, $drift_file or die "Could not open $drift_file: $!\n";
+
+ $drift = <$dfh>;
+
+ close $dfh;
+ die "Invalid drift file value <$drift>" if $drift !~ /[+-]?\d+\.?[0-9]+/;
+
+ while ($drift < 0) {
+ $drift += $cvt;
+ $tick--;
+ }
+
+ while ($drift > $cvt) {
+ $drift -= $cvt;
+ $tick++;
+ }
+
+ printf "%.3f (drift)\n", $drift;
+ printf "%d usec; %d nsec\n", $tick, ($tick + ($drift/$cvt)) * 1000;
+
+ return 0;
+}
+
+@calc_tickadj_opts@
+
+1;
+__END__
diff --git a/scripts/calc_tickadj/calc_tickadj.man.in b/scripts/calc_tickadj/calc_tickadj.man.in
new file mode 100644
index 0000000..18e2310
--- /dev/null
+++ b/scripts/calc_tickadj/calc_tickadj.man.in
@@ -0,0 +1,108 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH calc_tickadj 1calc_tickadjman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-yLaGPB/ag-LLaOOB)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:04 AM by AutoGen 5.18.5pre4
+.\" From the definitions calc_tickadj-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]calc_tickadj\fP
+\- Calculates optimal value for tick given ntp drift file.
+.SH SYNOPSIS
+\f\*[B-Font]calc_tickadj\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+The \fBcalc_tickadj\fP script uses provided ntp drift file to generate optimal
+tick value. Generally, ntpd can do better job if the drift value is the
+smallest possible number.
+.sp
+The example output of
+.br
+.in +4
+.nf
+$ ./calc_tickadj
+81.699 (drift)
+9999 usec; 9999779 nsec
+$ cat /etc/ntp/drift
+-23.159
+.in -4
+.fi
+.sp
+means the following. If tick on that box is 10,000, by making the value 9999
+we'll shift the box from its current drift of \-23.159 to a drift of 81.699, and
+in doing so we'll speed the clock up a little every second instead of slowing
+the clock down a little.
+.sp
+If 'tick' on that box is 10,000,000 then by setting it to 9999779 the drift
+value will be somewhere around 0.0.
+.sp
+\fBcalc_tickadj\fP tries to determine the the tick value by using
+\fBtickadj\fP program from ntp package. If this doesn't work you can specify
+current tick manually on command line.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-d\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-drift\-file\f[]=\f\*[I-Font]string\f[]
+Ntp drift file to use.
+The default
+\f\*[I-Font]string\f[]
+for this option is:
+.ti +4
+ /etc/ntp/drift
+.sp
+Use the specified drift file for calculations
+.TP
+.NOP \f\*[B-Font]\-t\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-tick\f[]=\f\*[I-Font]number\f[]
+Tick value of this host.
+This option takes an integer number as its argument.
+.sp
+The current tick which to adjustment will be calculated
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-v\f[] [{\f\*[I-Font]v|c|n\f[] \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBcalc_tickadj\fP
+option definitions.
diff --git a/scripts/calc_tickadj/calc_tickadj.mdoc.in b/scripts/calc_tickadj/calc_tickadj.mdoc.in
new file mode 100644
index 0000000..265ec39
--- /dev/null
+++ b/scripts/calc_tickadj/calc_tickadj.mdoc.in
@@ -0,0 +1,84 @@
+.Dd December 2 2014
+.Dt CALC_TICKADJ 1calc_tickadjmdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (calc_tickadj-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:08 AM by AutoGen 5.18.5pre4
+.\" From the definitions calc_tickadj-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm calc_tickadj
+.Nd Calculates "optimal" value for tick given ntp drift file.
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+The \fBcalc_tickadj\fP script uses provided ntp drift file to generate optimal
+tick value. Generally, ntpd can do better job if the drift value is the
+smallest possible number.
+.sp
+The example output of
+.Bd -literal -offset indent
+$ ./calc_tickadj
+81.699 (drift)
+9999 usec; 9999779 nsec
+$ cat /etc/ntp/drift
+-23.159
+.Ed
+.sp
+means the following. If tick on that box is 10,000, by making the value 9999
+we'll shift the box from its current drift of \-23.159 to a drift of 81.699, and
+in doing so we'll speed the clock up a little every second instead of slowing
+the clock down a little.
+.sp
+If 'tick' on that box is 10,000,000 then by setting it to 9999779 the drift
+value will be somewhere around 0.0.
+.sp
+\fBcalc_tickadj\fP tries to determine the the tick value by using
+\fBtickadj\fP program from ntp package. If this doesn't work you can specify
+current tick manually on command line.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl d Ar string , Fl \-drift\-file Ns = Ns Ar string
+Ntp drift file to use.
+The default
+.Ar string
+for this option is:
+.ti +4
+ /etc/ntp/drift
+.sp
+Use the specified drift file for calculations
+.It Fl t Ar number , Fl \-tick Ns = Ns Ar number
+Tick value of this host.
+This option takes an integer number as its argument.
+.sp
+The current tick which to adjustment will be calculated
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl v Op Brq Ar v|c|n Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBcalc_tickadj\fP
+option definitions.
diff --git a/scripts/calc_tickadj/calc_tickadj.texi b/scripts/calc_tickadj/calc_tickadj.texi
new file mode 100644
index 0000000..d15b428
--- /dev/null
+++ b/scripts/calc_tickadj/calc_tickadj.texi
@@ -0,0 +1,37 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename calc_tickadj.info
+@settitle calc_tickadj User's Manual
+@include ../../sntp/include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of @code{calc_tickadj}, a program from the NTP
+Project, that is used calculate optimal tick value based on given drift file.
+@end ifinfo
+
+@direntry
+* calc_tickadj: (calc_tickadj). Calculate optimal tick value from a drift file.
+@end direntry
+
+@titlepage
+@title calc_tickadj User's Manual
+@subtitle calc_tickadj, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@node Top, calc_tickadj Description, (dir), (dir)
+@top calc_tickadj User's Manual
+
+This document describes the use of the NTP Project's @code{calc_tickadj} program.
+This document applies to version @value{VERSION} of @code{calc_tickadj}.
+
+@shortcontents
+
+@menu
+* calc_tickadj Description:: Description
+* calc_tickadj Invocation:: Invoking calc_tickadj
+@end menu
+
+@include invoke-calc_tickadj.texi
diff --git a/scripts/calc_tickadj/invoke-calc_tickadj.menu b/scripts/calc_tickadj/invoke-calc_tickadj.menu
new file mode 100644
index 0000000..865a0d7
--- /dev/null
+++ b/scripts/calc_tickadj/invoke-calc_tickadj.menu
@@ -0,0 +1 @@
+* calc_tickadj Invocation:: Invoking calc_tickadj
diff --git a/scripts/calc_tickadj/invoke-calc_tickadj.texi b/scripts/calc_tickadj/invoke-calc_tickadj.texi
new file mode 100644
index 0000000..c274279
--- /dev/null
+++ b/scripts/calc_tickadj/invoke-calc_tickadj.texi
@@ -0,0 +1,102 @@
+@node calc_tickadj Invocation
+@section Invoking calc_tickadj
+@pindex calc_tickadj
+@cindex Calculates "optimal" value for tick given ntp drift file.
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION (invoke-calc_tickadj.texi)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:10 AM by AutoGen 5.18.5pre4
+# From the definitions calc_tickadj-opts.def
+# and the template file agtexi-cmd.tpl
+@end ignore
+
+The @code{calc_tickadj} script uses provided ntp drift file to generate optimal
+tick value. Generally, ntpd can do better job if the drift value is the
+smallest possible number.
+
+The example output of
+@example
+$ ./calc_tickadj
+81.699 (drift)
+9999 usec; 9999779 nsec
+$ cat /etc/ntp/drift
+-23.159
+@end example
+
+means the following. If tick on that box is 10,000, by making the value 9999
+we'll shift the box from its current drift of -23.159 to a drift of 81.699, and
+in doing so we'll speed the clock up a little every second instead of slowing
+the clock down a little.
+
+If 'tick' on that box is 10,000,000 then by setting it to 9999779 the drift
+value will be somewhere around 0.0.
+
+@code{calc_tickadj} tries to determine the the tick value by using
+@code{tickadj} program from ntp package. If this doesn't work you can specify
+current tick manually on command line.
+
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{calc_tickadj} program.
+
+@menu
+* calc_tickadj usage:: calc_tickadj help/usage (@option{--help})
+* calc_tickadj drift-file:: drift-file option (-d)
+* calc_tickadj tick:: tick option (-t)
+* calc_tickadj exit status:: exit status
+@end menu
+
+@node calc_tickadj usage
+@subsection calc_tickadj help/usage (@option{--help})
+@cindex calc_tickadj help
+
+This is the automatically generated usage text for calc_tickadj.
+
+The text printed is the same whether selected with the @code{help} option
+(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function. The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}. Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+calc_tickadj - Calculates "optimal" value for tick given ntp drift file. - Ver. 4.2.7p467
+USAGE: calc_tickadj [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
+
+ -d, --drift-file=str Ntp drift file to use
+ -t, --tick=num Tick value of this host
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+@end example
+@exampleindent 4
+
+@node calc_tickadj drift-file
+@subsection drift-file option (-d)
+@cindex calc_tickadj-drift-file
+
+This is the ``ntp drift file to use'' option.
+This option takes a string argument.
+Use the specified drift file for calculations
+@node calc_tickadj tick
+@subsection tick option (-t)
+@cindex calc_tickadj-tick
+
+This is the ``tick value of this host'' option.
+This option takes a number argument.
+The current tick which to adjustment will be calculated
+@node calc_tickadj exit status
+@subsection calc_tickadj exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@end table
diff --git a/scripts/deprecated/freq_adj.in b/scripts/deprecated/freq_adj.in
new file mode 100644
index 0000000..88eb390
--- /dev/null
+++ b/scripts/deprecated/freq_adj.in
@@ -0,0 +1,97 @@
+#! @PATH_PERL@ -w
+
+die "perl5 needed\n" unless ($] > 5);
+
+use Getopt::Std;
+use vars qw($opt_n);
+
+getopts('d:nt:');
+
+#chop($ncpu = `sysctl -n hw.ncpu`);
+#die "Found $ncpu CPUs; can only be run on systems with 1 CPU.\n" if ($ncpu > 1);
+
+$driftfile = "/etc/ntp.drift";
+$driftfile = $opt_d if defined($opt_d);
+
+chop($timer = `sysctl -n kern.timecounter.hardware 2> /dev/null`);
+
+$timer =~ tr/\U/\L/;
+
+if ($timer eq '') {
+ open(DM, "/var/run/dmesg.boot");
+ while(<DM>) {
+ # Timecounter "i8254" frequency 1193182 Hz
+ if (/^Timecounter "(\w+)"\s+/) {
+ $timer = $1;
+ last;
+ }
+ }
+ close(DM);
+}
+
+$opt_t = $timer if !defined($opt_t);
+
+if ($timer ne '') { # $timer found...
+ if ($opt_t ne '') { # - and $opt_t found
+ if ($timer ne $opt_t) { # - - and they differ
+ warn "You specified a $opt_t timer but I detected a $timer timer.\n";
+ usage();
+ exit 1;
+ } else { # - - and they are the same
+ ;
+ }
+ } else { # - but no $opt_t specified; this is OK
+ ;
+ }
+} else { # No $timer found...
+ if ($opt_t ne '') { # - but $opt_t was specified
+ $timer = $opt_t; # - - so use it.
+ } else { # - and neither was $opt_t
+ warn "I can't tell what timer you have. Please specify one.\n";
+ usage();
+ exit 1;
+ }
+}
+
+open(DF, $driftfile) || die "Can't open driftfile ($driftfile): $!\n";
+while(<DF>) {
+ chop;
+ if (/^(-?\d+\.\d+)(\s\d)?$/) {
+ $drift = $1;
+ } else {
+ die "Bogus value in driftfile $driftfile: <$_>\n";
+ }
+}
+close(DF);
+
+print "NTP drift is <$drift>\n";
+
+# Convert from NTP's idea of PPM to a decimal equivalent
+$freq_adj = int ( $drift * ( 10 ** 6 / 2 ** 20) );
+print "normalized freq_adj is <$freq_adj>\n";
+
+$freq_adj = int ( ( $freq_adj - 1 ) / 2 );
+print "Applying freq_adj of <".-$freq_adj.">\n";
+
+$sysctl = "machdep.".$timer."_freq";
+
+chop($mach_freq = `sysctl -n $sysctl`);
+
+print "$sysctl is <$mach_freq>\n";
+
+$n_mach_freq = $mach_freq - $freq_adj;
+
+if (defined($opt_n)) {
+ print "$sysctl $mach_freq -> $n_mach_freq\n";
+} else {
+ print "i8254: ".`sysctl -w $sysctl=$n_mach_freq`;
+}
+
+sub usage {
+ print STDERR <<EOUsage
+Usage: $0 [-d drift_file] [-n] [-t timer]
+where "drift_file" defaults to /etc/ntp.drift
+and "timer" is usually "tsc" or "i8254"
+and "-n" says "don't really change anything, just say what would happen".
+EOUsage
+}
diff --git a/scripts/deprecated/hpadjtime.sh b/scripts/deprecated/hpadjtime.sh
new file mode 100755
index 0000000..3de2a40
--- /dev/null
+++ b/scripts/deprecated/hpadjtime.sh
@@ -0,0 +1,18 @@
+#! /bin/sh
+val=1
+if [ -f /bin/uname -o -f /usr/bin/uname ]; then
+ set `uname -a | tr '[A-Z]' '[a-z]'`
+ case "$1" in
+ hp-ux) case "$3" in
+ *.10.*) val=1 ;;
+ *.09.03 | *.09.10) case "$5" in
+ 9000/3*) val=1 ;;
+ *) val=0 ;;
+ esac ;;
+ *) val=0 ;;
+ esac
+ ;;
+ *)
+ esac
+fi
+exit $val
diff --git a/scripts/deprecated/html2man.in b/scripts/deprecated/html2man.in
new file mode 100755
index 0000000..adc4848
--- /dev/null
+++ b/scripts/deprecated/html2man.in
@@ -0,0 +1,234 @@
+#! @PATH_PERL@ -w
+#
+# html2man: Converts the NTP HTML documentation to man page format
+#
+# This file require the Perl HTML::TokeParser module:
+# http://search.cpan.org/search?module=HTML::TokeParser
+#
+# Depending on where this is run from, you might need to modify $MANDIR below.
+#
+# Hacked together by Peter Boettcher <boettcher@ll.mit.edu>
+# Last modified: <Mon Jan 28 17:24:38 2002 by pwb>
+
+require HTML::TokeParser;
+
+# use strict; # I can dream...
+
+$MANDIR = "./man";
+
+# HTML files to convert. Also include per-file info here:
+# name of man page, man section, 'see also' section
+%manfiles = (
+ 'ntpd' => ['ntpd', @NTPD_MS@, 'ntp.conf(5), ntpq(@NTPQ_MS@), ntpdc(@NTPDC_MS@)'],
+ 'ntpq' => ['ntpq', @NTPQ_MS@, 'ntp_decode(5), ntpd(@NTPD_MS@), ntpdc(@NTPDC_MS@)'],
+ 'ntpdate' => ['ntpdate', @NTPDATE_MS@, 'ntpd(@NTPD_MS@)'],
+ 'ntpdc' => ['ntpdc', @NTPDC_MS@, 'ntpd(@NTPD_MS@)'],
+ 'ntptime' => ['ntptime', @NTPTIME_MS@, 'ntpd(@NTPD_MS@), ntpdate(@NTPDATE_MS@)'],
+ 'ntptrace' => ['ntptrace', @NTPTRACE_MS@, 'ntpd(@NTPD_MS@)'],
+ 'ntp-wait' => ['ntp-wait', @NTP_WAIT_MS@, 'ntpd(@NTPD_MS@)'],
+ 'keygen' => ['ntp-keygen', @NTP_KEYGEN_MS@, 'ntpd(@NTPD_MS@), ntp_auth(5)'],
+ 'tickadj' => ['tickadj', @TICKADJ_MS@, 'ntpd(@NTPD_MS@)'],
+ 'confopt' => ['ntp.conf', 5, 'ntpd(@NTPD_MS@), ntp_auth(5), ntp_mon(5), ntp_acc(5), ntp_clock(5), ntp_misc(5)'],
+ 'authopt' => ['ntp_auth', 5, 'ntp.conf(5), ntpd(@NTPD_MS@)'],
+ 'monopt' => ['ntp_mon', 5, 'ntp.conf(5), ntp_decode(5)'],
+ 'accopt' => ['ntp_acc', 5, 'ntp.conf(5)'],
+ 'clockopt' => ['ntp_clock', 5, 'ntp.conf(5)'],
+ 'decode' => ['ntp_decode', 5, 'ntpq(@NTPQ_MS@), ntp_mon(5)'],
+ 'miscopt' => ['ntp_misc', 5, 'ntp.conf(5)']);
+
+%table_headers = (
+ 'ntpd' => 'l l l l.',
+ 'ntpq' => 'l l.',
+ 'monopt' => 'l l l.',
+ 'decode' => 'l l l l.',
+ 'authopt' => 'c c c c c c.'
+);
+
+# Disclaimer to go in SEE ALSO section of the man page
+$seealso_disclaimer = "The official HTML documentation.\n\n" .
+ "This file was automatically generated from HTML source.\n";
+
+mkdir $MANDIR, 0777;
+mkdir "$MANDIR/man8", 0777;
+mkdir "$MANDIR/man5", 0777;
+
+# Do the actual processing
+foreach $file (keys %manfiles) {
+ process($file);
+}
+# End of main function
+
+
+
+# Do the real work
+sub process {
+ my($filename) = @_;
+ $fileinfo = $manfiles{$filename};
+
+ $p = HTML::TokeParser->new("$filename.html") || die "Can't open $filename.html: $!";
+ $fileout = "$MANDIR/man$fileinfo->[1]/$fileinfo->[0].$fileinfo->[1]";
+ open(MANOUT, ">$fileout")
+ || die "Can't open: $!";
+
+ $p->get_tag("title");
+ $name = $p->get_text("/title");
+ $p->get_tag("hr"); # Skip past image and quote, hopefully
+
+ # Setup man header
+ print MANOUT ".TH " . $fileinfo->[0] . " " . $fileinfo->[1] . "\n";
+ print MANOUT ".SH NAME\n";
+ $pat = $fileinfo->[0];
+ if ($name =~ /$pat/) {
+ } else {
+ # Add the manpage name, if not in the HTML title already
+ print MANOUT "$fileinfo->[0] - ";
+ }
+ print MANOUT "$name\n.SH \\ \n\n";
+
+ @fontstack = ();
+ $deflevel = 0;
+ $pre = 0;
+ $ignore = 0;
+ $first_td = 1;
+ # Now start scanning. We basically print everything after translating some tags.
+ # $token->[0] has "T", "S", "E" for Text, Start, End
+ # $token->[1] has the tag name, or text (for "T" case)
+ # Theres lots more in the world of tokens, but who cares?
+ while (my $token = $p->get_token) {
+ if($token->[0] eq "T") {
+ my $text = $token->[1];
+ if (!$pre) {
+ if($tag) {
+ $text =~ s/^[\n\t ]*//;
+ }
+ $text =~ s/^[\n\t ][\n\t ]+$//;
+ $text =~ s/[\n\t ]+/ /g;
+ $text =~ s/&nbsp\;/ /g;
+ $text =~ s/&gt\;/>/g;
+ $text =~ s/&lt\;/</g;
+ $text =~ s/&quot\;/"/g;
+ $text =~ s/&amp\;/&/g;
+ $text =~ s/^\./\\[char46]/;
+ }
+ print MANOUT "$text";
+ $tag = 0;
+ }
+ if($token->[0] eq "S") {
+ if($token->[1] eq "h4") {
+ my $text = uc($p->get_trimmed_text("/h4"));
+ # ignore these sections in ntpd.html
+ if ($filename eq "ntpd" &&
+ ($text eq "CONFIGURATION OPTIONS")) {
+ $ignore = 1;
+ close(MANOUT);
+ open(MANOUT, ">/dev/null");
+ } elsif ($ignore) {
+ $ignore = 0;
+ close(MANOUT);
+ open(MANOUT, ">>$fileout");
+ }
+ print MANOUT "\n\n.SH $text\n";
+ }
+ if($token->[1] eq "tt") {
+ push @fontstack, "tt";
+ print MANOUT "\\fB";
+ }
+ if($token->[1] eq "i") {
+ push @fontstack, "i";
+ print MANOUT "\\fI";
+ }
+ if($token->[1] eq "address") {
+ my $text = $p->get_trimmed_text("/address");
+ print MANOUT "\n.SH AUTHOR\n$text\n";
+ }
+ if($token->[1] eq "dt" || $token->[1] eq "br" && $deflevel > 0) {
+ print MANOUT "\n.TP 8\n";
+ $tag = 1;
+ }
+ if($token->[1] eq "dd") {
+ print MANOUT "\n";
+ $tag = 1;
+ }
+ if($token->[1] eq "dl") {
+ $deflevel+=1;
+ if ($deflevel > 0) {
+ print MANOUT "\n.RS ", $deflevel > 1 ? 8 : 0;
+ }
+ }
+ if($token->[1] eq "p") {
+ print MANOUT "\n";
+ }
+ if($token->[1] eq "pre") {
+ print MANOUT "\n.nf";
+ $pre = 1;
+ }
+ if($token->[1] eq "table") {
+ print MANOUT "\n.TS\n";
+ print MANOUT "expand allbox tab(%);\n";
+ print MANOUT $table_headers{$filename};
+ print MANOUT "\n";
+ }
+ if($token->[1] eq "td") {
+ if ($first_td == 0) {
+ print MANOUT " % ";
+ }
+ $first_td = 0;
+ }
+ }
+ elsif($token->[0] eq "E") {
+ if($token->[1] eq "h4") {
+ $tag = 1;
+ }
+ if($token->[1] eq "tt") {
+ $f = pop @fontstack;
+ if($f ne "tt") {
+ warn "Oops, mismatched font! Trying to continue\n";
+ }
+ if ($#fontstack < 0) { $fontswitch = "\\fR"; }
+ elsif ($fontstack[$#fontstack] eq "tt") { $fontswitch = "\\fB"; }
+ else { $fontswitch = "\\fI"; }
+ print MANOUT "$fontswitch";
+ }
+ if($token->[1] eq "i") {
+ $f = pop @fontstack;
+ if($f ne "i") {
+ warn "Oops, mismatched font! Trying to continue\n";
+ }
+ if ($#fontstack < 0) { $fontswitch = "\\fR"; }
+ elsif ($fontstack[$#fontstack] eq "tt") { $fontswitch = "\\fB"; }
+ else { $fontswitch = "\\fI"; }
+ print MANOUT "$fontswitch";
+ }
+ if($token->[1] eq "dl") {
+ if ($deflevel > 0) {
+ print MANOUT "\n.RE";
+ }
+ print MANOUT "\n";
+ $deflevel-=1;
+ }
+ if($token->[1] eq "p") {
+ print MANOUT "\n";
+ $tag = 1;
+ }
+ if($token->[1] eq "pre") {
+ print MANOUT "\n.fi";
+ $pre = 0;
+ }
+ if($token->[1] eq "table") {
+ print MANOUT ".TE\n";
+ }
+ if($token->[1] eq "tr") {
+ print MANOUT "\n";
+ $first_td = 1;
+ }
+ }
+ }
+ if ($ignore) {
+ close(MANOUT);
+ open(MANOUT, ">>$fileout");
+ }
+ print MANOUT "\n.SH SEE ALSO\n\n";
+ print MANOUT "$fileinfo->[2]\n\n";
+ print MANOUT "$seealso_disclaimer\n";
+ close(MANOUT);
+}
diff --git a/scripts/deprecated/ntp-close b/scripts/deprecated/ntp-close
new file mode 100755
index 0000000..b5077e6
--- /dev/null
+++ b/scripts/deprecated/ntp-close
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+lynx -source http://www.eecis.udel.edu/~mills/ntp/clock2.htm |
+ sed -n -e 's,).*,,' -e' /([0-9.]*$/s/.*(//p' |
+ xargs ntpdate -q |
+ sort -n +7 > /tmp/ntp-close
+
+# From: Neal McBurnett <neal@bcn.boulder.co.us>
diff --git a/scripts/deprecated/ntp-groper b/scripts/deprecated/ntp-groper
new file mode 100755
index 0000000..1fd0cfe
--- /dev/null
+++ b/scripts/deprecated/ntp-groper
@@ -0,0 +1,95 @@
+#!/bin/sh
+#
+# ntpgroper host ...
+#
+# This script checks each hostname given as an argument to see if
+# it is running NTP. It reports one of the following messages (assume
+# the host is named "dumbo.hp.com":
+#
+# dumbo.hp.com not registered in DNS
+# dumbo.hp.com not responding to ping
+# dumbo.hp.com refused ntpq connection
+# dumbo.hp.com not responding to NTP
+# dumbo.hp.com answers NTP version 2, stratum: 3, ref: telford.nsa.hp.com
+# dumbo.hp.com answers NTP version 3, stratum: 3, ref: telford.nsa.hp.com
+#
+# It ain't pretty, but it is kinda useful.
+#
+# Walter Underwood, 11 Feb 1993, wunder@hpl.hp.com
+#
+# converted to /bin/sh from /bin/ksh by scott@ee.udel.edu 24 Mar 1993
+
+PATH="/usr/local/etc:$PATH" export PATH
+
+verbose=1
+logfile=/tmp/cntp-log$$
+ntpqlog=/tmp/cntp-ntpq$$
+
+# I wrap the whole thing in parens so that it is possible to redirect
+# all the output somewhere, if desired.
+(
+for host in $*
+do
+ # echo "Trying $host."
+
+ gethost $host > /dev/null 2>&1
+ if [ $? -ne 0 ]
+ then
+ echo "$host not registered in DNS"
+ continue
+ fi
+
+ ping $host 64 1 > /dev/null 2>&1
+ if [ $? -ne 0 ]
+ then
+ echo "$host not responding to ping"
+ continue
+ fi
+
+ # Attempt to contact with version 3 ntp, then try version 2.
+ for version in 3 2
+ do
+
+ ntpq -c "ntpversion $version" -p $host > $ntpqlog 2>&1
+
+ if fgrep -s 'Connection refused' $ntpqlog
+ then
+ echo "$host refused ntpq connection"
+ break
+ fi
+
+ responding=1
+ fgrep -s 'timed out, nothing received' $ntpqlog > /dev/null && responding=0
+
+ if [ $responding -eq 1 ]
+ then
+ ntpq -c "ntpversion $version" -c rl $host > $ntpqlog
+
+ # First we extract the reference ID (usually a host or a clock)
+ synchost=`fgrep "refid=" $ntpqlog`
+ #synchost=${synchost##*refid=} # strip off the beginning of the line
+ #synchost=${synchost%%,*} # strip off the end
+ synchost=`expr "$synchost" : '.*refid=\([^,]*\),.*'`
+
+ # Next, we get the stratum
+ stratum=`fgrep "stratum=" $ntpqlog`
+ #stratum=${stratum##*stratum=}
+ #stratum=${stratum%%,*}
+ stratum=`expr "$stratum" : '.*stratum=\([^,]*\),.*'`
+
+ echo "$host answers NTP version $version, stratum: $stratum, ref: $synchost"
+ break;
+ fi
+
+ if [ $version -eq 2 -a $responding -eq 0 ]
+ then
+ echo "$host not responding to NTP"
+ fi
+ done
+done
+)
+# ) >> $logfile
+
+if [ -f $ntpqlog ]; then
+ rm $ntpqlog
+fi
diff --git a/scripts/deprecated/ntp-restart b/scripts/deprecated/ntp-restart
new file mode 100755
index 0000000..0a1d58a
--- /dev/null
+++ b/scripts/deprecated/ntp-restart
@@ -0,0 +1,10 @@
+#!/bin/sh
+#
+# This script can be used to kill and restart the NTP daemon. Edit the
+# /usr/local/bin/ntpd line to fit.
+#
+kill -INT `ps -ax | egrep "ntpd" | egrep -v "egrep" | sed 's/^\([ 0-9]*\) .*/\1'/`
+sleep 10
+/usr/local/bin/ntpd -g
+/usr/local/bin/ntp-wait
+exit 0
diff --git a/scripts/deprecated/ntp-status b/scripts/deprecated/ntp-status
new file mode 100755
index 0000000..4109124
--- /dev/null
+++ b/scripts/deprecated/ntp-status
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# From: Marc Brett <Marc.Brett@westgeo.com>
+
+# Here's a quick hack which can give you the stratum, delay, offset
+# for any number of ntp servers.
+
+NTPDATE=/usr/local/bin/ntpdate
+NSLOOKUP=/usr/sbin/nslookup
+EGREP=/bin/egrep
+AWK=/bin/awk
+RM=/bin/rm
+FILE=/tmp/ntp.$$
+
+USAGE="Usage: $0 hostname [hostname ...]"
+
+if [ $# -le 0 ]
+then
+ echo $USAGE 2>&1
+ exit 1
+fi
+
+trap '$RM -f $FILE; exit' 1 2 3 4 13 15
+
+for HOST in $*
+do
+ HOSTNAME=`$NSLOOKUP $HOST | $EGREP "Name:" | $AWK '{print $2}'`
+ if [ -n "$HOSTNAME" ]
+ then
+ $NTPDATE -d $HOST 2>/dev/null | $EGREP '^stratum|^delay|^offset|^originate' > $FILE
+ STRATUM=`$EGREP '^stratum' $FILE | $AWK '{print $2}'`
+ OFFSET=`$EGREP '^offset' $FILE | $AWK '{print $2}'`
+ DELAY=`$EGREP '^delay' $FILE | $AWK '{print $2}'`
+ TIMESTAMP=`$EGREP '^originate' $FILE | $AWK '{print $4 " " $5 " " $6 " " $7 " " $8}'`
+ if [ "$STRATUM" -ne 0 ]
+ then
+ echo "$HOSTNAME: stratum:$STRATUM delay:$DELAY offset:$OFFSET $TIMESTAMP"
+ else
+ echo $HOSTNAME: Not running NTP
+ fi
+ fi
+
+done
+
+$RM -f $FILE
diff --git a/scripts/invoke-plot_summary.menu b/scripts/invoke-plot_summary.menu
new file mode 100644
index 0000000..b287f20
--- /dev/null
+++ b/scripts/invoke-plot_summary.menu
@@ -0,0 +1 @@
+* plot_summary Invocation:: Invoking plot_summary
diff --git a/scripts/invoke-plot_summary.texi b/scripts/invoke-plot_summary.texi
new file mode 100644
index 0000000..64930ed
--- /dev/null
+++ b/scripts/invoke-plot_summary.texi
@@ -0,0 +1,121 @@
+@node plot_summary Invocation
+@section Invoking plot_summary
+@pindex plot_summary
+@cindex plot statistics generated by summary script
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION (invoke-plot_summary.texi)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:45 AM by AutoGen 5.18.5pre4
+# From the definitions plot_summary-opts.def
+# and the template file agtexi-cmd.tpl
+@end ignore
+
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{plot_summary} program.
+
+@menu
+* plot_summary usage:: plot_summary help/usage (@option{--help})
+* plot_summary directory:: directory option
+* plot_summary identifier:: identifier option
+* plot_summary peer:: peer option
+* plot_summary plot-term:: plot-term option
+* plot_summary output-file:: output-file option
+* plot_summary exit status:: exit status
+@end menu
+
+@node plot_summary usage
+@subsection plot_summary help/usage (@option{--help})
+@cindex plot_summary help
+
+This is the automatically generated usage text for plot_summary.
+
+The text printed is the same whether selected with the @code{help} option
+(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function. The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}. Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+plot_summary - plot statistics generated by summary script - Ver. 4.2.7p482
+USAGE: plot_summary [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
+
+ --directory=str Where the summary files are
+ --identifier=str Origin of the data
+ --offset-limit=float Limit of absolute offset
+ --peer=str Peers to generate plots for
+ - may appear multiple times
+ --plot-term=str Gnuplot terminal
+ --output-file=str Output file
+ --dont-wait Don't wait for keystroke between plots
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+@end example
+@exampleindent 4
+
+@node plot_summary directory
+@subsection directory option
+@cindex plot_summary-directory
+
+This is the ``where the summary files are'' option.
+This option takes a string argument.
+ The directory where the @code{plot_summary} will search for the
+ *_summary files generated by @code{summary} script.
+@node plot_summary identifier
+@subsection identifier option
+@cindex plot_summary-identifier
+
+This is the ``origin of the data'' option.
+This option takes a string argument.
+ Where does the plotted data come from, default to string "host" plus
+ current hostname
+@node plot_summary peer
+@subsection peer option
+@cindex plot_summary-peer
+
+This is the ``peers to generate plots for'' option.
+This option takes a string argument.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@end itemize
+
+ By default the peer_summary plots are not generated. Use this option to
+ specify list of peers if you want to generate plots for them.
+@node plot_summary plot-term
+@subsection plot-term option
+@cindex plot_summary-plot-term
+
+This is the ``gnuplot terminal'' option.
+This option takes a string argument.
+ This is string is passed directly to the @code{gnuplot set terminal}
+ command. Default is @code{x11} if @code{DISPLAY} is set and
+ @code{dumb} is it's not'. See output from @code(gnuplot -e "set
+ terminal") for the list of avalaible options.
+@node plot_summary output-file
+@subsection output-file option
+@cindex plot_summary-output-file
+
+This is the ``output file'' option.
+This option takes a str argument.
+ Output file for @code{gnuplot}, default to stdout.
+@node plot_summary exit status
+@subsection plot_summary exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@end table
diff --git a/scripts/invoke-summary.menu b/scripts/invoke-summary.menu
new file mode 100644
index 0000000..f6adfe1
--- /dev/null
+++ b/scripts/invoke-summary.menu
@@ -0,0 +1 @@
+* summary Invocation:: Invoking summary
diff --git a/scripts/invoke-summary.texi b/scripts/invoke-summary.texi
new file mode 100644
index 0000000..3ee25d3
--- /dev/null
+++ b/scripts/invoke-summary.texi
@@ -0,0 +1,103 @@
+@node summary Invocation
+@section Invoking summary
+@pindex summary
+@cindex compute various stastics from NTP stat files
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION (invoke-summary.texi)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:50 AM by AutoGen 5.18.5pre4
+# From the definitions summary-opts.def
+# and the template file agtexi-cmd.tpl
+@end ignore
+
+
+
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{summary} program.
+
+@menu
+* summary usage:: summary help/usage (@option{--help})
+* summary directory:: directory option
+* summary end-date:: end-date option
+* summary output-directory:: output-directory option
+* summary start-date:: start-date option
+* summary exit status:: exit status
+@end menu
+
+@node summary usage
+@subsection summary help/usage (@option{--help})
+@cindex summary help
+
+This is the automatically generated usage text for summary.
+
+The text printed is the same whether selected with the @code{help} option
+(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function. The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}. Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+summary - compute various stastics from NTP stat files - Ver. 4.2.7p482
+USAGE: summary [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
+
+ --directory=str Directory containing stat files
+ --end-date=num End date
+ --output-directory=str Output directory
+ --peer-dist-limit=float Peer dist limit
+ --skip-time-steps=float Ignore time offsets larger that this
+ --start-date=num Start date
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+@end example
+@exampleindent 4
+
+@node summary directory
+@subsection directory option
+@cindex summary-directory
+
+This is the ``directory containing stat files'' option.
+This option takes a string argument.
+ The directory where @code{ntpd} will search for .stat files generated
+ by @code{ntpd}.
+@node summary end-date
+@subsection end-date option
+@cindex summary-end-date
+
+This is the ``end date'' option.
+This option takes a number argument.
+ Process all files with the date suffix less or equal to value of this
+ option. Defaults to today minus one day (Use @code{date -u +%Y%m%d})
+ to get the timestamp.
+@node summary output-directory
+@subsection output-directory option
+@cindex summary-output-directory
+
+This is the ``output directory'' option.
+This option takes a str argument.
+ The output directory @code{summary} will write all output files to.
+@node summary start-date
+@subsection start-date option
+@cindex summary-start-date
+
+This is the ``start date'' option.
+This option takes a num argument.
+ Process all files with the date suffix more or equal to value of
+ this option. Defaults to 197000101.
+@node summary exit status
+@subsection summary exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@end table
diff --git a/scripts/lib/Makefile.am b/scripts/lib/Makefile.am
new file mode 100644
index 0000000..d7c0c0e
--- /dev/null
+++ b/scripts/lib/Makefile.am
@@ -0,0 +1,5 @@
+perllibdir = @PERLLIBDIR@
+
+nobase_perllib_DATA = NTP/Util.pm
+
+EXTRA_DIST = ${nobase_perllib_DATA}
diff --git a/scripts/lib/Makefile.in b/scripts/lib/Makefile.in
new file mode 100644
index 0000000..1afcf7d
--- /dev/null
+++ b/scripts/lib/Makefile.in
@@ -0,0 +1,583 @@
+# Makefile.in generated by automake 1.11.1 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.
+# 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = scripts/lib
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.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_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_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.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)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(perllibdir)"
+DATA = $(nobase_perllib_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+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@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+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_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@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+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@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+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@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+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_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+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@
+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@
+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@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+perllibdir = @PERLLIBDIR@
+nobase_perllib_DATA = NTP/Util.pm
+EXTRA_DIST = ${nobase_perllib_DATA}
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/lib/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign scripts/lib/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-nobase_perllibDATA: $(nobase_perllib_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(perllibdir)" || $(MKDIR_P) "$(DESTDIR)$(perllibdir)"
+ @list='$(nobase_perllib_DATA)'; test -n "$(perllibdir)" || list=; \
+ $(am__nobase_list) | while read dir files; do \
+ xfiles=; for file in $$files; do \
+ if test -f "$$file"; then xfiles="$$xfiles $$file"; \
+ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
+ test -z "$$xfiles" || { \
+ test "x$$dir" = x. || { \
+ echo "$(MKDIR_P) '$(DESTDIR)$(perllibdir)/$$dir'"; \
+ $(MKDIR_P) "$(DESTDIR)$(perllibdir)/$$dir"; }; \
+ echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(perllibdir)/$$dir'"; \
+ $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(perllibdir)/$$dir" || exit $$?; }; \
+ done
+
+uninstall-nobase_perllibDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(nobase_perllib_DATA)'; test -n "$(perllibdir)" || list=; \
+ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(perllibdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(perllibdir)" && rm -f $$files
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(perllibdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-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
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-nobase_perllibDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-nobase_perllibDATA
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool 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-nobase_perllibDATA install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-nobase_perllibDATA
+
+
+# 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/scripts/lib/NTP/Util.pm b/scripts/lib/NTP/Util.pm
new file mode 100644
index 0000000..66f2453
--- /dev/null
+++ b/scripts/lib/NTP/Util.pm
@@ -0,0 +1,137 @@
+package NTP::Util;
+use strict;
+use warnings;
+use Exporter 'import';
+use Carp;
+use version 0.77;
+
+our @EXPORT_OK = qw(ntp_read_vars do_dns ntp_peers ntp_sntp_line);
+
+my $ntpq_path = 'ntpq';
+my $sntp_path = 'sntp';
+
+our $IP_AGNOSTIC;
+
+BEGIN {
+ require Socket;
+ if (version->parse($Socket::VERSION) >= version->parse(1.94)) {
+ Socket->import(qw(getaddrinfo getnameinfo SOCK_RAW AF_INET));
+ $IP_AGNOSTIC = 1;
+ }
+ else {
+ Socket->import(qw(inet_aton SOCK_RAW AF_INET));
+ }
+}
+
+my %obsolete_vars = (
+ phase => 'offset',
+ rootdispersion => 'rootdisp',
+);
+
+sub ntp_read_vars {
+ my ($peer, $vars, $host) = @_;
+ my $do_all = !@$vars;
+ my %out_vars = map {; $_ => undef } @$vars;
+
+ $out_vars{status_line} = {} if $do_all;
+
+ my $cmd = "$ntpq_path -n -c 'rv $peer ".(join ',', @$vars)."'";
+ $cmd .= " $host" if defined $host;
+ $cmd .= " |";
+
+ open my $fh, $cmd or croak "Could not start ntpq: $!";
+
+ while (<$fh>) {
+ return undef if /Connection refused/;
+
+ if (/^asso?c?id=0 status=(\S{4}) (\S+), (\S+),/gi) {
+ $out_vars{status_line}{status} = $1;
+ $out_vars{status_line}{leap} = $2;
+ $out_vars{status_line}{sync} = $3;
+ }
+
+ while (/(\w+)=([^,]+),?\s/g) {
+ my ($var, $val) = ($1, $2);
+ $val =~ s/^"([^"]+)"$/$1/;
+ $var = $obsolete_vars{$var} if exists $obsolete_vars{$var};
+ if ($do_all) {
+ $out_vars{$var} = $val
+ }
+ else {
+ $out_vars{$var} = $val if exists $out_vars{$var};
+ }
+ }
+ }
+
+ close $fh or croak "running ntpq failed: $! (exit status $?)";
+ return \%out_vars;
+}
+
+sub do_dns {
+ my ($host) = @_;
+
+ if ($IP_AGNOSTIC) {
+ my ($err, $res);
+
+ ($err, $res) = getaddrinfo($host, '', {socktype => SOCK_RAW});
+ die "getaddrinfo failed: $err\n" if $err;
+
+ ($err, $res) = getnameinfo($res->{addr}, 0);
+ die "getnameinfo failed: $err\n" if $err;
+
+ return $res;
+ }
+ # Too old perl, do only ipv4
+ elsif ($host =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/) {
+ return gethostbyaddr inet_aton($host), AF_INET;
+ }
+ else {
+ return;
+ }
+}
+
+sub ntp_peers {
+ my ($host) = @_;
+
+ my $cmd = "$ntpq_path -np $host |";
+
+ open my $fh, $cmd or croak "Could not start ntpq: $!";
+
+ <$fh> for 1 .. 2;
+
+ my @columns = qw(remote refid st t when poll reach delay offset jitter);
+ my @peers;
+ while (<$fh>) {
+ if (/(?:[\w\.\*-]+\s*){10}/) {
+ my $col = 0;
+ push @peers, { map {; $columns[ $col++ ] => $_ } split /(?<=.)\s+/ };
+ }
+ else {
+ #TODO return error (but not needed anywhere now)
+ warn "ERROR: $_";
+ }
+ }
+
+ close $fh or croak "running ntpq failed: $! (exit status $?)";
+ return \@peers;
+}
+
+# TODO: we don't need this but it would be nice to have all the line parsed
+sub ntp_sntp_line {
+ my ($host) = @_;
+
+ my $cmd = "$sntp_path $host |";
+ open my $fh, $cmd or croak "Could not start sntp: $!";
+
+ my ($offset, $stratum);
+ while (<$fh>) {
+ next if !/^\d{4}-\d\d-\d\d/;
+ chomp;
+ my @output = split / /;
+
+ $offset = $output[3];
+ ($stratum = pop @output) =~ s/s(\d{1,2})/$1/;
+ }
+ close $fh or croak "running sntp failed: $! (exit status $?)";
+ return ($offset, $stratum);
+}
diff --git a/scripts/monitoring/README b/scripts/monitoring/README
new file mode 100644
index 0000000..f8eb0a9
--- /dev/null
+++ b/scripts/monitoring/README
@@ -0,0 +1,158 @@
+This directory contains support for monitoring the local clock of xntp daemons.
+
+WARNING: The scripts and routines contained in this directory are beta
+ release! Do not depend on their correct operation. They are,
+ however, in regular use at University of Erlangen-Nuernberg.
+ No severe problems are known for this code.
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+PLEASE THINK TWICE BEFORE STARTING MONITORING REMOTE XNTP DEAMONS !!!!
+MONITORING MAY INCREASE THE LOAD OF THE DEAMON MONITORED AND MAY
+INCREASE THE NETWORK LOAD SIGNIFICANTLY
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+
+Files are:
+
+README:
+ This file
+
+ntptrap:
+ perl script to log ntp mode 6 trap messages.
+
+ It sends a set_trap request to each server given and dumps the
+ trap messages received. It handles refresh of set_trap.
+ Currently it handles only NTP V2, however the NTP V3 servers
+ also accept v2 requests. It will not interpret v3 system and
+ peer stati correctly.
+
+ usage:
+ ntptrap [-n] [-p <port>] [-l <debug-output>] servers...
+
+ -n: do not send set_trap requests
+
+ port: port to listen for responses
+ useful if you have a configured trap
+
+ debug-output: file to write trace output to (for debugging)
+
+ This script convinced me that ntp trap messages are only of
+ little use.
+
+ntploopstat:
+ perl script to gather loop info statistics from xntpd via mode 7
+ LOOP_INFO requests.
+
+ This script collects data to allow monitoring of remote xntp servers
+ where it is not possible to directly access the loopstats file
+ produced by xntpd itself. Of course, it can be used to sample
+ a local server if it is not configured to produce a loopstats file.
+
+ Please note, this program poses a high load on the server as
+ a communication takes place every delay seconds ! USE WITH CARE !
+
+ usage:
+ ntploopstat [-d<delay>] [-t<timeout>] [-l <logfile>] [-v] [ntpserver]
+
+ delay: number of seconds to wait between samples
+ default: 60 seconds
+ timeout: number of seconds to wait for reply
+ default 12 seconds
+ logfile: file to log samples to
+ default: loopstats:<ntpserver>:
+ (note the trailing colon)
+ This name actually is a prefix.
+ The file name is dynamically derived by appending
+ the name of the month the sample belongs to.
+ Thus all samples of a month end up in the same file.
+
+ the format of the files generated is identical to the format used by
+ xntpd with the loopstats file:
+ MJD <seconds since midnight UTC> offset frequency compliance
+
+ if a timeout occurs the next sample is tried after delay/2 seconds
+
+ The script will terminate after MAX_FAIL (currently 60)
+ consecutive errors.
+
+ Errors are counted for:
+ - error on send call
+ - error on select call
+ - error on recv call
+ - short packet received
+ - bad packet
+ - error on open for logfile
+
+ntploopwatch:
+ perl script to display loop filter statistics collected by ntploopstat
+ or dumped directly by xntpd.
+
+ Gnuplot is used to produce a graphical representation of the sample
+ values, that have been preprocessed and analysed by this script.
+
+ It can either be called to produce a printout of specific data set or
+ used to continously monitor the values. Monitoring is achieved by
+ periodically reprocessing the logfiles, which are updated regularly
+ either by a running ntploopstat process or by the running xntpd.
+
+ usage:
+ to watch statistics permanently:
+ ntploopwatch [-v[<level>]] [-c <config-file>] [-d <working-dir>]
+
+ to get a single print out specify also
+ -P<printer> [-s<samples>]
+ [-S <start-time>] [-E <end-time>]
+ [-O <MaxOffs>] [-o <MinOffs>]
+
+ level: level of verbosity for debugging
+ config-file: file to read configurable settings from
+ On each iteration it is checked and reread
+ if it has been changed
+ default: loopwatch.config
+ working-dir: specify working directory for process, affects
+ interpretation of relative file names
+
+ All other flags are only useful with printing plots, as otherwise
+ command line values would be replaced by settings from the config file.
+
+ printer: specify printer to print plot
+ BSD print systems semantics apply; if printer
+ is omitted the name "ps" is used; plots are
+ prepared using PostScript, thus the printer
+ should best accept postscript input
+
+ For the following see also the comments in loopwatch.config.SAMPLE
+
+ samples: use last # samples from input data
+ start-time: ignore input samples before this date
+ end-time: ignore input samples after this date
+ if both start-time and end-time are specified
+ a given samples value is ignored
+ MaxOffs:
+ MinOffs: restrict value range
+
+loopwatch.config.SAMPLE:
+ sample config file for ntploopwatch
+ each configurable option is explained there
+
+lr.pl:
+ linear regression package used by ntploopwatch to compute
+ linear approximations for frequency and offset values
+ within display range
+
+timelocal.pl:
+
+ used during conversion of ISO_DATE_TIME values specified in
+ loopwatch config files to unix epoch values (seconds since
+ 1970-01-01_00:00_00 UTC)
+
+ A version of this file is distributed with perl-4.x, however,
+ it has a bug related to dates crossing 1970, causing endless loops..
+ The version contained here has been fixed.
+
+ntp.pl:
+ perl support for ntp v2 mode 6 message handling
+ WARNING: This code is beta level - it triggers a memory leak;
+ as for now it is not quite clear, wether this is caused by a
+ bug in perl or by bad usage of perl within this script.
+
diff --git a/scripts/monitoring/loopwatch.config.SAMPLE b/scripts/monitoring/loopwatch.config.SAMPLE
new file mode 100644
index 0000000..8cefea3
--- /dev/null
+++ b/scripts/monitoring/loopwatch.config.SAMPLE
@@ -0,0 +1,89 @@
+# sample configuration and control file for ntploowatch
+#
+# delay: sampling interval in seconds
+delay=60
+# samples: use only last # samples
+samples=600
+# DO NOT USE srcprefix in shared config files
+# srcprefix: name of file to read samples from
+# current time suffix (month name) is appended
+# defaults to "./var@$STATHOST/loopstats."
+# The string "$STATHOST"is replaced by the name of the host
+# being monitored
+#srcprefix=./var@$STATHOST/loopstats.
+#
+# showoffs: yes/no control display of offset values
+showoffs=yes
+#
+# showfreq: yes/no control display of frequency values
+showfreq=yes
+#
+# showcmpl: yes/no control display of compliance values
+showcmpl=no
+#
+# showoreg: yes/no control display of linear regression of offset values
+showoreg=no
+#
+# showfreg: yes/no control display of linear regression of frequency values
+showfreg=no
+#
+# timebase: dynamic/ISO_DATE_TIME point of zero for linear regression
+# ISO_DATE_TIME: yyyy-mm-dd_hh:mm:ss.ms
+# values are interpreted using local time zone
+# parts omitted from front default to current date/time
+# parts omitted from end default to lowest permitted values
+# to get aa:bb being interpreted as minutes:seconds use aa:bb.0
+# for dynamic '00:00:00.0 of current day' is used
+timebase=dynamic
+#
+# freqbase: dynamic/<baseval>
+# if a number is given, subtract this from sampling values for display
+# if dynamic is selected, freqbase is adjusted to fit into the range of
+# offset values
+freqbase=dynamic
+#
+# cmplscale: dynamic/<scaling>
+# if a number is given, the sampling values are divided by this number
+# if dynamic is selected, cmplscale is adjusted to fit into the range of
+# offset values
+cmplscale=dynamic
+#
+# DumbScale: 0/1
+# 0 enables dynamic adjust of value ranges for freqbase and cmplscale
+# timescale is labeled with human readable times
+# 1 only uses explicit scaling for numbers
+# timescale is labeled with hours relative to timebase
+DumbScale=0
+#
+# StartTime: none/ISO_DATE_TIME
+# ignore any samples before the specified date
+StartTime=none
+#
+# EndTime: none/ISO_DATE_TIME
+# ignore any samples after the specified date
+#
+# if both StartTime and EndTime are specified
+# the value specified for samples is ignored
+EndTime=none
+#
+# MaxOffs: none/<number>
+# limit display (y-axis) to values not larger than <number>
+MaxOffset=none
+#
+# MinOffs: none/<number>
+# limit display (y-axis) to values not smaller than <number>
+MinOffset=none
+
+#
+# verbose: <number>
+# specify level for debugging
+# default is 0 for printing and 1 for monitoring
+# level 1 will just print a timestamp for any display update
+# (this is every delay seconds)
+verbose=1
+#
+# deltaT: <seconds>
+# mark `holes' in the sample data grater than <seconds>
+# by a break in the plot
+# default: 512 seconds
+deltaT=512
diff --git a/scripts/monitoring/lr.pl b/scripts/monitoring/lr.pl
new file mode 100644
index 0000000..1ab3e3f
--- /dev/null
+++ b/scripts/monitoring/lr.pl
@@ -0,0 +1,151 @@
+;#
+;# lr.pl,v 3.1 1993/07/06 01:09:08 jbj Exp
+;#
+;#
+;# Linear Regression Package for perl
+;# to be 'required' from perl
+;#
+;# Copyright (c) 1992
+;# Frank Kardel, Rainer Pruy
+;# Friedrich-Alexander Universitaet Erlangen-Nuernberg
+;#
+;# Copyright (c) 1997 by
+;# Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
+;# (Converted to a PERL 5.004 package)
+;#
+;#############################################################
+
+package lr;
+
+##
+## y = A + Bx
+##
+## B = (n * Sum(xy) - Sum(x) * Sum(y)) / (n * Sum(x^2) - Sum(x)^2)
+##
+## A = (Sum(y) - B * Sum(x)) / n
+##
+
+##
+## interface
+##
+;# init(tag); initialize data set for tag
+;# sample(x, y, tag); enter sample
+;# Y(x, tag); compute y for given x
+;# X(y, tag); compute x for given y
+;# r(tag); regression coefficient
+;# cov(tag); covariance
+;# A(tag);
+;# B(tag);
+;# sigma(tag); standard deviation
+;# mean(tag);
+#########################
+
+sub init
+{
+ my $self = shift;
+
+ $self->{n} = 0;
+ $self->{sx} = 0.0;
+ $self->{sx2} = 0.0;
+ $self->{sxy} = 0.0;
+ $self->{sy} = 0.0;
+ $self->{sy2} = 0.0;
+}
+
+sub sample($$)
+{
+ my $self = shift;
+ my($_x, $_y) = @_;
+
+ ++($self->{n});
+ $self->{sx} += $_x;
+ $self->{sy} += $_y;
+ $self->{sxy} += $_x * $_y;
+ $self->{sx2} += $_x**2;
+ $self->{sy2} += $_y**2;
+}
+
+sub B()
+{
+ my $self = shift;
+
+ return 1 unless ($self->{n} * $self->{sx2} - $self->{sx}**2);
+ return ($self->{n} * $self->{sxy} - $self->{sx} * $self->{sy})
+ / ($self->{n} * $self->{sx2} - $self->{sx}**2);
+}
+
+sub A()
+{
+ my $self = shift;
+
+ return ($self->{sy} - B() * $self->{sx}) / $self->{n};
+}
+
+sub Y()
+{
+ my $self = shift;
+
+ return A() + B() * $_[$[];
+}
+
+sub X()
+{
+ my $self = shift;
+
+ return ($_[$[] - A()) / B();
+}
+
+sub r()
+{
+ my $self = shift;
+
+ my $s = ($self->{n} * $self->{sx2} - $self->{sx}**2)
+ * ($self->{n} * $self->{sy2} - $self->{sy}**2);
+
+ return 1 unless $s;
+
+ return ($self->{n} * $self->{sxy} - $self->{sx} * $self->{sy}) / sqrt($s);
+}
+
+sub cov()
+{
+ my $self = shift;
+
+ return ($self->{sxy} - $self->{sx} * $self->{sy} / $self->{n})
+ / ($self->{n} - 1);
+}
+
+sub sigma()
+{
+ my $self = shift;
+
+ return 0 if $self->{n} <= 1;
+ return sqrt(($self->{sy2} - ($self->{sy} * $self->{sy}) / $self->{n})
+ / ($self->{n}));
+}
+
+sub mean()
+{
+ my $self = shift;
+
+ return 0 if $self->{n} <= 0;
+ return $self->{sy} / $self->{n};
+}
+
+sub new
+{
+ my $class = shift;
+ my $self = {
+ (n => undef,
+ sx => undef,
+ sx2 => undef,
+ sxy => undef,
+ sy => undef,
+ sy2 => undef)
+ };
+ bless $self, $class;
+ init($self);
+ return $self;
+}
+
+1;
diff --git a/scripts/monitoring/ntp.pl b/scripts/monitoring/ntp.pl
new file mode 100644
index 0000000..3478f71
--- /dev/null
+++ b/scripts/monitoring/ntp.pl
@@ -0,0 +1,506 @@
+#!/usr/bin/perl -w
+;#
+;# ntp.pl,v 3.1 1993/07/06 01:09:09 jbj Exp
+;#
+;# process loop filter statistics file and either
+;# - show statistics periodically using gnuplot
+;# - or print a single plot
+;#
+;# Copyright (c) 1992
+;# Rainer Pruy Friedrich-Alexander Universitaet Erlangen-Nuernberg
+;#
+;#
+;#############################################################
+
+package ntp;
+
+$NTP_version = 2;
+$ctrl_mode=6;
+
+$byte1 = (($NTP_version & 0x7)<< 3) & 0x34 | ($ctrl_mode & 0x7);
+$MAX_DATA = 468;
+
+$sequence = 0; # initial sequence number incred before used
+$pad=4;
+$do_auth=0; # no possibility today
+$keyid=0;
+;#list if known keys (passwords)
+%KEYS = ( 0, "\200\200\200\200\200\200\200\200",
+ );
+
+;#-----------------------------------------------------------------------------
+;# access routines for ntp control packet
+ ;# NTP control message format
+ ;# C LI|VN|MODE LI 2bit=00 VN 3bit=2(3) MODE 3bit=6 : $byte1
+ ;# C R|E|M|Op R response E error M more Op opcode
+ ;# n sequence
+ ;# n status
+ ;# n associd
+ ;# n offset
+ ;# n count
+ ;# a+ data (+ padding)
+ ;# optional authentication data
+ ;# N key
+ ;# N2 checksum
+
+;# first byte of packet
+sub pkt_LI { return ($_[$[] >> 6) & 0x3; }
+sub pkt_VN { return ($_[$[] >> 3) & 0x7; }
+sub pkt_MODE { return ($_[$[] ) & 0x7; }
+
+;# second byte of packet
+sub pkt_R { return ($_[$[] & 0x80) == 0x80; }
+sub pkt_E { return ($_[$[] & 0x40) == 0x40; }
+sub pkt_M { return ($_[$[] & 0x20) == 0x20; }
+sub pkt_OP { return $_[$[] & 0x1f; }
+
+;#-----------------------------------------------------------------------------
+
+sub setkey
+{
+ local($id,$key) = @_;
+
+ $KEYS{$id} = $key if (defined($key));
+ if (! defined($KEYS{$id}))
+ {
+ warn "Key $id not yet specified - key not changed\n";
+ return undef;
+ }
+ return ($keyid,$keyid = $id)[$[];
+}
+
+;#-----------------------------------------------------------------------------
+sub numerical { $a <=> $b; }
+
+;#-----------------------------------------------------------------------------
+
+sub send #'
+{
+ local($fh,$opcode, $associd, $data,$address) = @_;
+ $fh = caller(0)."'$fh";
+
+ local($junksize,$junk,$packet,$offset,$ret);
+ $offset = 0;
+
+ $sequence++;
+ while(1)
+ {
+ $junksize = length($data);
+ $junksize = $MAX_DATA if $junksize > $MAX_DATA;
+
+ ($junk,$data) = $data =~ /^(.{$junksize})(.*)$/;
+ $packet
+ = pack("C2n5a".(($junk eq "") ? 0 : &pad($junksize+12,$pad)-12),
+ $byte1,
+ ($opcode & 0x1f) | ($data ? 0x20 : 0),
+ $sequence,
+ 0, $associd,
+ $offset, $junksize, $junk);
+ if ($do_auth)
+ {
+ ;# not yet
+ }
+ $offset += $junksize;
+
+ if (defined($address))
+ {
+ $ret = send($fh, $packet, 0, $address);
+ }
+ else
+ {
+ $ret = send($fh, $packet, 0);
+ }
+
+ if (! defined($ret))
+ {
+ warn "send failed: $!\n";
+ return undef;
+ }
+ elsif ($ret != length($packet))
+ {
+ warn "send failed: sent only $ret from ".length($packet). "bytes\n";
+ return undef;
+ }
+ return $sequence unless $data;
+ }
+}
+
+;#-----------------------------------------------------------------------------
+;# status interpretation
+;#
+sub getval
+{
+ local($val,*list) = @_;
+
+ return $list{$val} if defined($list{$val});
+ return sprintf("%s#%d",$list{"-"},$val) if defined($list{"-"});
+ return "unknown-$val";
+}
+
+;#---------------------------------
+;# system status
+;#
+;# format: |LI|CS|SECnt|SECode| LI=2bit CS=6bit SECnt=4bit SECode=4bit
+sub ssw_LI { return ($_[$[] >> 14) & 0x3; }
+sub ssw_CS { return ($_[$[] >> 8) & 0x3f; }
+sub ssw_SECnt { return ($_[$[] >> 4) & 0xf; }
+sub ssw_SECode { return $_[$[] & 0xf; }
+
+%LI = ( 0, "leap_none", 1, "leap_add_sec", 2, "leap_del_sec", 3, "sync_alarm", "-", "leap");
+%ClockSource = (0, "sync_unspec",
+ 1, "sync_pps",
+ 2, "sync_lf_clock",
+ 3, "sync_hf_clock",
+ 4, "sync_uhf_clock",
+ 5, "sync_local_proto",
+ 6, "sync_ntp",
+ 7, "sync_udp/time",
+ 8, "sync_wristwatch",
+ 9, "sync_telephone",
+ "-", "ClockSource",
+ );
+
+%SystemEvent = (0, "event_unspec",
+ 1, "event_freq_not_set",
+ 2, "event_freq_set",
+ 3, "event_spike_detect",
+ 4, "event_freq_mode",
+ 5, "event_clock_sync",
+ 6, "event_restart",
+ 7, "event_panic_stop",
+ 8, "event_no_sys_peer",
+ 9, "event_leap_armed",
+ 10, "event_leap_disarmed",
+ 11, "event_leap_event",
+ 12, "event_clock_step",
+ 13, "event_kern",
+ 14, "event_loaded_leaps",
+ 15, "event_stale_leaps",
+ "-", "event",
+ );
+sub LI
+{
+ &getval(&ssw_LI($_[$[]),*LI);
+}
+sub ClockSource
+{
+ &getval(&ssw_CS($_[$[]),*ClockSource);
+}
+
+sub SystemEvent
+{
+ &getval(&ssw_SECode($_[$[]),*SystemEvent);
+}
+
+sub system_status
+{
+ return sprintf("%s, %s, %d event%s, %s", &LI($_[$[]), &ClockSource($_[$[]),
+ &ssw_SECnt($_[$[]), ((&ssw_SECnt($_[$[])==1) ? "" : "s"),
+ &SystemEvent($_[$[]));
+}
+;#---------------------------------
+;# peer status
+;#
+;# format: |PStat|PSel|PCnt|PCode| Pstat=6bit PSel=2bit PCnt=4bit PCode=4bit
+sub psw_PStat_config { return ($_[$[] & 0x8000) == 0x8000; }
+sub psw_PStat_authenable { return ($_[$[] & 0x4000) == 0x4000; }
+sub psw_PStat_authentic { return ($_[$[] & 0x2000) == 0x2000; }
+sub psw_PStat_reach { return ($_[$[] & 0x1000) == 0x1000; }
+sub psw_PStat_bcast { return ($_[$[] & 0x0800) == 0x0800; }
+sub psw_PStat { return ($_[$[] >> 10) & 0x3f; }
+sub psw_PSel { return ($_[$[] >> 8) & 0x3; }
+sub psw_PCnt { return ($_[$[] >> 4) & 0xf; }
+sub psw_PCode { return $_[$[] & 0xf; }
+
+%PeerSelection = (0, "sel_reject",
+ 1, "sel_falsetick",
+ 2, "sel_excess",
+ 3, "sel_outlier",
+ 4, "sel_candidate",
+ 5, "sel_backup",
+ 6, "sel_sys.peer",
+ 6, "sel_pps.peer",
+ "-", "PeerSel",
+ );
+%PeerEvent = (0, "event_unspec",
+ 1, "event_mobilize",
+ 2, "event_demobilize",
+ 3, "event_unreach",
+ 4, "event_reach",
+ 5, "event_restart",
+ 6, "event_no_reply",
+ 7, "event_rate_exceed",
+ 8, "event_denied",
+ 9, "event_leap_armed",
+ 10, "event_sys_peer",
+ 11, "event_clock_event",
+ 12, "event_bad_auth",
+ 13, "event_popcorn",
+ 14, "event_intlv_mode",
+ 15, "event_intlv_err",
+ "-", "event",
+ );
+
+sub PeerSelection
+{
+ &getval(&psw_PSel($_[$[]),*PeerSelection);
+}
+
+sub PeerEvent
+{
+ &getval(&psw_PCode($_[$[]),*PeerEvent);
+}
+
+sub peer_status
+{
+ local($x) = ("");
+ $x .= "config," if &psw_PStat_config($_[$[]);
+ $x .= "authenable," if &psw_PStat_authenable($_[$[]);
+ $x .= "authentic," if &psw_PStat_authentic($_[$[]);
+ $x .= "reach," if &psw_PStat_reach($_[$[]);
+ $x .= "bcast," if &psw_PStat_bcast($_[$[]);
+
+ $x .= sprintf(" %s, %d event%s, %s", &PeerSelection($_[$[]),
+ &psw_PCnt($_[$[]), ((&psw_PCnt($_[$[]) == 1) ? "" : "s"),
+ &PeerEvent($_[$[]));
+ return $x;
+}
+
+;#---------------------------------
+;# clock status
+;#
+;# format: |CStat|CEvnt| CStat=8bit CEvnt=8bit
+sub csw_CStat { return ($_[$[] >> 8) & 0xff; }
+sub csw_CEvnt { return $_[$[] & 0xff; }
+
+%ClockStatus = (0, "clk_nominal",
+ 1, "clk_timeout",
+ 2, "clk_badreply",
+ 3, "clk_fault",
+ 4, "clk_badsig",
+ 5, "clk_baddate",
+ 6, "clk_badtime",
+ "-", "clk",
+ );
+
+sub clock_status
+{
+ return sprintf("%s, last %s",
+ &getval(&csw_CStat($_[$[]),*ClockStatus),
+ &getval(&csw_CEvnt($_[$[]),*ClockStatus));
+}
+
+;#---------------------------------
+;# error status
+;#
+;# format: |Err|reserved| Err=8bit
+;#
+sub esw_Err { return ($_[$[] >> 8) & 0xff; }
+
+%ErrorStatus = (0, "err_unspec",
+ 1, "err_auth_fail",
+ 2, "err_invalid_fmt",
+ 3, "err_invalid_opcode",
+ 4, "err_unknown_assoc",
+ 5, "err_unknown_var",
+ 6, "err_invalid_value",
+ 7, "err_adm_prohibit",
+ );
+
+sub error_status
+{
+ return sprintf("%s", &getval(&esw_Err($_[$[]),*ErrorStatus));
+}
+
+;#-----------------------------------------------------------------------------
+;#
+;# cntrl op name translation
+
+%CntrlOpName = (0, "reserved",
+ 1, "read_status",
+ 2, "read_variables",
+ 3, "write_variables",
+ 4, "read_clock_variables",
+ 5, "write_clock_variables",
+ 6, "set_trap",
+ 7, "trap_response",
+ 8, "configure",
+ 9, "saveconf",
+ 10, "read_mru",
+ 11, "read_ordlist",
+ 12, "rqst_nonce",
+ 31, "unset_trap", # !!! unofficial !!!
+ "-", "cntrlop",
+ );
+
+sub cntrlop_name
+{
+ return &getval($_[$[],*CntrlOpName);
+}
+
+;#-----------------------------------------------------------------------------
+
+$STAT_short_pkt = 0;
+$STAT_pkt = 0;
+
+;# process a NTP control message (response) packet
+;# returns a list ($ret,$data,$status,$associd,$op,$seq,$auth_keyid)
+;# $ret: undef --> not yet complete
+;# "" --> complete packet received
+;# "ERROR" --> error during receive, bad packet, ...
+;# else --> error packet - list may contain useful info
+
+
+sub handle_packet
+{
+ local($pkt,$from) = @_; # parameters
+ local($len_pkt) = (length($pkt));
+;# local(*FRAGS,*lastseen);
+ local($li_vn_mode,$r_e_m_op,$seq,$status,$associd,$offset,$count,$data);
+ local($autch_keyid,$auth_cksum);
+
+ $STAT_pkt++;
+ if ($len_pkt < 12)
+ {
+ $STAT_short_pkt++;
+ return ("ERROR","short packet received");
+ }
+
+ ;# now break packet apart
+ ($li_vn_mode,$r_e_m_op,$seq,$status,$associd,$offset,$count,$data) =
+ unpack("C2n5a".($len_pkt-12),$pkt);
+ $data=substr($data,$[,$count);
+ if ((($len_pkt - 12) - &pad($count,4)) >= 12)
+ {
+ ;# looks like an authenticator
+ ($auth_keyid,$auth_cksum) =
+ unpack("Na8",substr($pkt,$len_pkt-12+$[,12));
+ $STAT_auth++;
+ ;# no checking of auth_cksum (yet ?)
+ }
+
+ if (&pkt_VN($li_vn_mode) != $NTP_version)
+ {
+ $STAT_bad_version++;
+ return ("ERROR","version ".&pkt_VN($li_vn_mode)."packet ignored");
+ }
+
+ if (&pkt_MODE($li_vn_mode) != $ctrl_mode)
+ {
+ $STAT_bad_mode++;
+ return ("ERROR", "mode ".&pkt_MODE($li_vn_mode)." packet ignored");
+ }
+
+ ;# handle single fragment fast
+ if ($offset == 0 && &pkt_M($r_e_m_op) == 0)
+ {
+ $STAT_single_frag++;
+ if (&pkt_E($r_e_m_op))
+ {
+ $STAT_err_pkt++;
+ return (&error_status($status),
+ $data,$status,$associd,&pkt_OP($r_e_m_op),$seq,
+ $auth_keyid);
+ }
+ else
+ {
+ return ("",
+ $data,$status,$associd,&pkt_OP($r_e_m_op),$seq,
+ $auth_keyid);
+ }
+ }
+ else
+ {
+ ;# fragment - set up local name space
+ $id = "$from$seq".&pkt_OP($r_e_m_op);
+ $ID{$id} = 1;
+ *FRAGS = "$id FRAGS";
+ *lastseen = "$id lastseen";
+
+ $STAT_frag++;
+
+ $lastseen = 1 if !&pkt_M($r_e_m_op);
+ if (!%FRAGS)
+ {
+ print((&pkt_M($r_e_m_op) ? " more" : "")."\n");
+ $FRAGS{$offset} = $data;
+ ;# save other info
+ @FRAGS = ($status,$associd,&pkt_OP($r_e_m_op),$seq,$auth_keyid,$r_e_m_op);
+ }
+ else
+ {
+ print((&pkt_M($r_e_m_op) ? " more" : "")."\n");
+ ;# add frag to previous - combine on the fly
+ if (defined($FRAGS{$offset}))
+ {
+ $STAT_dup_frag++;
+ return ("ERROR","duplicate fragment at $offset seq=$seq");
+ }
+
+ $FRAGS{$offset} = $data;
+
+ undef($loff);
+ foreach $off (sort numerical keys(%FRAGS))
+ {
+ next unless defined($FRAGS{$off});
+ if (defined($loff) &&
+ ($loff + length($FRAGS{$loff})) == $off)
+ {
+ $FRAGS{$loff} .= $FRAGS{$off};
+ delete $FRAGS{$off};
+ last;
+ }
+ $loff = $off;
+ }
+
+ ;# return packet if all frags arrived
+ ;# at most two frags with possible padding ???
+ if ($lastseen && defined($FRAGS{0}) &&
+ (((scalar(@x=sort numerical keys(%FRAGS)) == 2) &&
+ (length($FRAGS{0}) + 8) > $x[$[+1]) ||
+ (scalar(@x=sort numerical keys(%FRAGS)) < 2)))
+ {
+ @x=((&pkt_E($r_e_m_op) ? &error_status($status) : ""),
+ $FRAGS{0},@FRAGS);
+ &pkt_E($r_e_m_op) ? $STAT_err_frag++ : $STAT_frag_all++;
+ undef(%FRAGS);
+ undef(@FRAGS);
+ undef($lastseen);
+ delete $ID{$id};
+ &main'clear_timeout($id);
+ return @x;
+ }
+ else
+ {
+ &main'set_timeout($id,time+$timeout,"&ntp'handle_packet_timeout(\"".unpack("H*",$id)."\");"); #'";
+ }
+ }
+ return (undef);
+ }
+}
+
+sub handle_packet_timeout
+{
+ local($id) = @_;
+ local($r_e_m_op,*FRAGS,*lastseen,@x) = (@FRAGS[$[+5]);
+
+ *FRAGS = "$id FRAGS";
+ *lastseen = "$id lastseen";
+
+ @x=((&pkt_E($r_e_m_op) ? &error_status($status) : "TIMEOUT"),
+ $FRAGS{0},@FRAGS[$[ .. $[+4]);
+ $STAT_frag_timeout++;
+ undef(%FRAGS);
+ undef(@FRAGS);
+ undef($lastseen);
+ delete $ID{$id};
+ return @x;
+}
+
+
+sub pad
+{
+ return $_[$[+1] * int(($_[$[] + $_[$[+1] - 1) / $_[$[+1]);
+}
+
+1;
diff --git a/scripts/monitoring/ntploopstat b/scripts/monitoring/ntploopstat
new file mode 100644
index 0000000..7583c7c
--- /dev/null
+++ b/scripts/monitoring/ntploopstat
@@ -0,0 +1,458 @@
+#!/usr/bin/perl -w
+# --*-perl-*-
+;#
+;# ntploopstat,v 3.1 1993/07/06 01:09:11 jbj Exp
+;#
+;# Poll NTP server using NTP mode 7 loopinfo request.
+;# Log info and timestamp to file for processing by ntploopwatch.
+;#
+;#
+;# Copyright (c) 1992
+;# Rainer Pruy Friedrich-Alexander Universitaet Erlangen-Nuernberg
+;#
+;#################################################################
+;#
+;# The format written to the logfile is the same as used by xntpd
+;# for the loopstats file.
+;# This script however allows to gather loop filter statistics from
+;# remote servers where you do not have access to the loopstats logfile.
+;#
+;# Please note: Communication delays affect the accuracy of the
+;# timestamps recorded. Effects from these delays will probably
+;# not show up, as timestamps are recorded to the second only.
+;# (Should have implemented &gettimeofday()..)
+;#
+
+$0 =~ s!^.*/([^/]+)$!$1!; # beautify script name
+
+$ntpserver = 'localhost'; # default host to poll
+$delay = 60; # default sampling rate
+ ;# keep it shorter than minpoll (=64)
+ ;# to get all values
+
+require "ctime.pl";
+;# handle bug in early ctime distributions
+$ENV{'TZ'} = 'MET' unless defined($ENV{'TZ'}) || $] > 4.010;
+
+if (defined(@ctime'MoY))
+{
+ *MonthName = *ctime'MoY;
+}
+else
+{
+ @MonthName = ('Jan','Feb','Mar','Apr','May','Jun',
+ 'Jul','Aug','Sep','Oct','Nov','Dec');
+}
+
+;# this routine can be redefined to point to syslog if necessary
+sub msg
+{
+ return unless $verbose;
+
+ print STDERR "$0: ";
+ printf STDERR @_;
+}
+
+;#############################################################
+;#
+;# process command line
+$usage = <<"E-O-S";
+
+usage:
+ $0 [-d<delay>] [-t<timeout>] [-l <logfile>] [-v] [ntpserver]
+E-O-S
+
+while($_ = shift)
+{
+ /^-v(\d*)$/ && ($verbose=($1 eq '') ? 1 : $1,1) && next;
+ /^-d(\d*)$/ &&
+ do {
+ ($1 ne '') && ($delay = $1,1) && next;
+ @ARGV || die("$0: delay value missing after -d\n$usage");
+ $delay = shift;
+ ($delay >= 0) || die("$0: bad delay value \"$delay\"\n$usage");
+ next;
+ };
+ /^-l$/ &&
+ do {
+ @ARGV || die("$0: logfile missing after -l\n$usage");
+ $logfile = shift;
+ next;
+ };
+ /^-t(\d*(\.\d*)?)$/ &&
+ do {
+ ($1 ne '') && ($timeout = $1,1) && next;
+ @ARGV || die("$0: timeout value missing after -t\n$usage\n");
+ $timeout = shift;
+ ($timeout > 0) ||
+ die("$0: bad timeout value \"$timeout\"\n$usage");
+ next;
+ };
+
+ /^-/ && die("$0: unknown option \"$_\"\n$usage");
+
+ ;# any other argument is server to poll
+ $ntpserver = $_;
+ last;
+}
+
+if (@ARGV)
+{
+ warn("unexpected arguments: ".join(" ",@ARGV).".\n");
+ die("$0: too many servers specified\n$usage");
+}
+
+;# logfile defaults to include server name
+;# The name of the current month is appended and
+;# the file is opened and closed for each sample.
+;#
+$logfile = "loopstats:$ntpserver." unless defined($logfile);
+$timeout = 12.0 unless defined($timeout); # wait $timeout seconds for reply
+
+$MAX_FAIL = 60; # give up after $MAX_FAIL failed polls
+
+
+$MJD_1970 = 40587;
+
+if (eval 'require "syscall.ph";')
+{
+ if (defined(&SYS_gettimeofday))
+ {
+ ;# assume standard
+ ;# gettimeofday(struct timeval *tp,struct timezone *tzp)
+ ;# syntax for gettimeofday syscall
+ ;# tzp = NULL -> undef
+ ;# tp = (long,long)
+ eval 'sub time { local($tz) = pack("LL",0,0);
+ (&msg("gettimeofday failed: $!\n"),
+ return (time))
+ unless syscall(&SYS_gettimeofday,$tz,undef) == 0;
+ local($s,$us) = unpack("LL",$tz);
+ return $s + $us/1000000; }';
+ local($t1,$t2,$t3);
+ $t1 = time;
+ eval '$t2 = &time;';
+ $t3 = time;
+ die("$0: gettimeofday failed: $@.\n") if defined($@) && $@;
+ die("$0: gettimeofday inconsistency time=$t1,gettimeofday=$t2,time=$t2\n")
+ if (int($t1) != int($t2) && int($t3) != int($t2));
+ &msg("Using gettimeofday for timestamps\n");
+ }
+ else
+ {
+ warn("No gettimeofday syscall found - using time builtin for timestamps\n");
+ eval 'sub time { return time; }';
+ }
+}
+else
+{
+ warn("No syscall.ph file found - using time builtin for timestamps\n");
+ eval 'sub time { return time; }';
+}
+
+
+;#------------------+
+;# from ntp_request.h
+;#------------------+
+
+;# NTP mode 7 packet format:
+;# Byte 1: ResponseBit MoreBit Version(3bit) Mode(3bit)==7
+;# Byte 2: AuthBit Sequence # - 0 - 127 see MoreBit
+;# Byte 3: Implementation #
+;# Byte 4: Request Code
+;#
+;# Short 1: Err(3bit) NumItems(12bit)
+;# Short 2: MBZ(3bit)=0 DataItemSize(12bit)
+;# 0 - 500 byte Data
+;# if AuthBit is set:
+;# Long: KeyId
+;# 2xLong: AuthCode
+
+;#
+$IMPL_XNTPD = 2;
+$REQ_LOOP_INFO = 8;
+
+
+;# request packet for REQ_LOOP_INFO:
+;# B1: RB=0 MB=0 V=2 M=7
+;# B2: S# = 0
+;# B3: I# = IMPL_XNTPD
+;# B4: RC = REQ_LOOP_INFO
+;# S1: E=0 NI=0
+;# S2: MBZ=0 DIS=0
+;# data: 32 byte 0 padding
+;# 8byte timestamp if encryption, 0 padding otherwise
+$loopinfo_reqpkt =
+ pack("CCCC nn x32 x8", 0x17, 0, $IMPL_XNTPD, $REQ_LOOP_INFO, 0, 0);
+
+;# ignore any auth data in packets
+$loopinfo_response_size =
+ 1+1+1+1+2+2 # header size like request pkt
+ + 8 # l_fp last_offset
+ + 8 # l_fp drift_comp
+ + 4 # u_long compliance
+ + 4 # u_long watchdog_timer
+ ;
+$loopinfo_response_fmt = "C4n2N2N2NN";
+$loopinfo_response_fmt_v2 = "C4n2N2N2N2N";
+
+;#
+;# prepare connection to server
+;#
+
+;# workaround for broken socket.ph on dynix_ptx
+eval 'sub INTEL {1;}' unless defined(&INTEL);
+eval 'sub ATT {1;}' unless defined(&ATT);
+
+require "sys/socket.ph";
+
+require 'netinet/in.ph';
+
+;# if you do not have netinet/in.ph enable the following lines
+;#eval 'sub INADDR_ANY { 0x00000000; }' unless defined(&INADDR_ANY);
+;#eval 'sub IPPRORO_UDP { 17; }' unless defined(&IPPROTO_UDP);
+
+if ($ntpserver =~ /^((0x?)?\w+)\.((0x?)?\w+)\.((0x?)?\w+)\.((0x?)?\w+)$/)
+{
+ local($a,$b,$c,$d) = ($1,$3,$5,$7);
+ $a = oct($a) if defined($2);
+ $b = oct($b) if defined($4);
+ $c = oct($c) if defined($6);
+ $d = oct($d) if defined($8);
+ $server_addr = pack("C4", $a,$b,$c,$d);
+
+ $server_mainname
+ = (gethostbyaddr($server_addr,&AF_INET))[$[] || $ntpserver;
+}
+else
+{
+ ($server_mainname,$server_addr)
+ = (gethostbyname($ntpserver))[$[,$[+4];
+
+ die("$0: host \"$ntpserver\" is unknown\n")
+ unless defined($server_addr);
+}
+&msg ("Address of server \"$ntpserver\" is \"%d.%d.%d.%d\"\n",
+ unpack("C4",$server_addr));
+
+$proto_udp = (getprotobyname('udp'))[$[+2] || &IPPROTO_UDP;
+
+$ntp_port =
+ (getservbyname('ntp','udp'))[$[+2] ||
+ (warn "Could not get port number for service \"ntp/udp\" using 123\n"),
+ ($ntp_port=123);
+
+;#
+0 && &SOCK_DGRAM; # satisfy perl -w ...
+socket(S, &AF_INET, &SOCK_DGRAM, $proto_udp) ||
+ die("Cannot open socket: $!\n");
+
+bind(S, pack("S n N x8", &AF_INET, 0, &INADDR_ANY)) ||
+ die("Cannot bind: $!\n");
+
+($my_port, $my_addr) = (unpack("S n a4 x8",getsockname(S)))[$[+1,$[+2];
+
+&msg("Listening at address %d.%d.%d.%d port %d\n",
+ unpack("C4",$my_addr), $my_port);
+
+$server_inaddr = pack("Sna4x8", &AF_INET, $ntp_port, $server_addr);
+
+;############################################################
+;#
+;# the main loop:
+;# send request
+;# get reply
+;# wait til next sample time
+
+undef($lasttime);
+$lostpacket = 0;
+
+while(1)
+{
+ $stime = &time;
+
+ &msg("Sending request $stime...\n");
+
+ $ret = send(S,$loopinfo_reqpkt,0,$server_inaddr);
+
+ if (! defined($ret) || $ret < length($loopinfo_reqpkt))
+ {
+ warn("$0: send failed ret=($ret): $!\n");
+ $fail++;
+ next;
+ }
+
+ &msg("Waiting for reply...\n");
+
+ $mask = ""; vec($mask,fileno(S),1) = 1;
+ $ret = select($mask,undef,undef,$timeout);
+
+ if (! defined($ret))
+ {
+ warn("$0: select failed: $!\n");
+ $fail++;
+ next;
+ }
+ elsif ($ret == 0)
+ {
+ warn("$0: request to $ntpserver timed out ($timeout seconds)\n");
+ ;# do not count this event as failure
+ ;# it usually this happens due to dropped udp packets on noisy and
+ ;# havily loaded lines, so just try again;
+ $lostpacket = 1;
+ next;
+ }
+
+ &msg("Receiving reply...\n");
+
+ $len = 520; # max size of a mode 7 packet
+ $reply = ""; # just make it defined for -w
+ $ret = recv(S,$reply,$len,0);
+
+ if (!defined($ret))
+ {
+ warn("$0: recv failed: $!\n");
+ $fail++;
+ next;
+ }
+
+ $etime = &time;
+ &msg("Received at\t$etime\n");
+
+ ;#$time = ($stime + $etime) / 2; # symmetric delay assumed
+ $time = $etime; # the above assumption breaks for X25
+ ;# so taking etime makes timestamps be a
+ ;# little late, but keeps them increasing
+ ;# monotonously
+
+ &msg(sprintf("Reply from %d.%d.%d.%d took %f seconds\n",
+ (unpack("SnC4",$ret))[$[+2 .. $[+5], ($etime - $stime)));
+
+ if ($len < $loopinfo_response_size)
+ {
+ warn("$0: short packet ($len bytes) received ($loopinfo_response_size bytes expected\n");
+ $fail++;
+ next;
+ }
+
+ ($b1,$b2,$b3,$b4,$s1,$s2,
+ $offset_i,$offset_f,$drift_i,$drift_f,$compl,$watchdog)
+ = unpack($loopinfo_response_fmt,$reply);
+
+ ;# check reply
+ if (($s1 >> 12) != 0) # error !
+ {
+ die("$0: got error reply ".($s1>>12)."\n");
+ }
+ if (($b1 != 0x97 && $b1 != 0x9f) || # Reply NotMore V=2 M=7
+ ($b2 != 0 && $b2 != 0x80) || # S=0 Auth no/yes
+ $b3 != $IMPL_XNTPD || # ! IMPL_XNTPD
+ $b4 != $REQ_LOOP_INFO || # Ehh.. not loopinfo reply ?
+ $s1 != 1 || # ????
+ ($s2 != 24 && $s2 != 28) #
+ )
+ {
+ warn("$0: Bad/unexpected reply from server:\n");
+ warn(" \"".unpack("H*",$reply)."\"\n");
+ warn(" ".sprintf("b1=%x b2=%x b3=%x b4=%x s1=%d s2=%d\n",
+ $b1,$b2,$b3,$b4,$s1,$s2));
+ $fail++;
+ next;
+ }
+ elsif ($s2 == 28)
+ {
+ ;# seems to be a version 2 xntpd
+ ($b1,$b2,$b3,$b4,$s1,$s2,
+ $offset_i,$offset_f,$drift_i,$drift_f,$compl_i,$compl_f,$watchdog)
+ = unpack($loopinfo_response_fmt_v2,$reply);
+ $compl = &lfptoa($compl_i, $compl_f);
+ }
+
+ $time -= $watchdog;
+
+ $offset = &lfptoa($offset_i, $offset_f);
+ $drift = &lfptoa($drift_i, $drift_f);
+
+ &log($time,$offset,$drift,$compl) && ($fail = 0);;
+}
+continue
+{
+ die("$0: Too many failures - terminating\n") if $fail > $MAX_FAIL;
+ &msg("Sleeping " . ($lostpacket ? ($delay / 2) : $delay) . " seconds...\n");
+
+ sleep($lostpacket ? ($delay / 2) : $delay);
+ $lostpacket = 0;
+}
+
+sub log
+{
+ local($time,$offs,$freq,$cmpl) = @_;
+ local($y,$m,$d);
+ local($fname,$suff) = ($logfile);
+
+
+ ;# silently drop sample if distance to last sample is too low
+ if (defined($lasttime) && ($lasttime + 2) >= $time)
+ {
+ &msg("Dropped packet - old sample\n");
+ return 1;
+ }
+
+ ;# $suff determines which samples end up in the same file
+ ;# could have used $year (;-) or WeekOfYear, DayOfYear,....
+ ;# Change it to your suit...
+
+ ($d,$m,$y) = (localtime($time))[$[+3 .. $[+5];
+ $suff = sprintf("%04d%02d%02d",$y+1900,$m+1,$d);
+ $fname .= $suff;
+ if (!open(LOG,">>$fname"))
+ {
+ warn("$0: open($fname) failed: $!\n");
+ $fail++;
+ return 0;
+ }
+ else
+ {
+ ;# file format
+ ;# MJD seconds offset drift compliance
+ printf LOG ("%d %.3lf %.8lf %.7lf %d\n",
+ int($time/86400)+$MJD_1970,
+ $time - int($time/86400) * 86400,
+ $offs,$freq,$cmpl);
+ close(LOG);
+ $lasttime = $time;
+ }
+ return 1;
+}
+
+;# see ntp_fp.h to understand this
+sub lfptoa
+{
+ local($i,$f) = @_;
+ local($sign) = 1;
+
+
+ if ($i & 0x80000000)
+ {
+ if ($f == 0)
+ {
+ $i = -$i;
+ }
+ else
+ {
+ $f = -$f;
+ $i = ~$i;
+ $i += 1; # 2s complement
+ }
+ $sign = -1;
+ ;#print "NEG: $i $f\n";
+ }
+ else
+ {
+ ;#print "POS: $i $f\n";
+ }
+ ;# unlike xntpd I have perl do the dirty work.
+ ;# Using floats here may affect precision, but
+ ;# currently these bits aren't significant anyway
+ return $sign * ($i + $f/2**32);
+}
diff --git a/scripts/monitoring/ntploopwatch b/scripts/monitoring/ntploopwatch
new file mode 100644
index 0000000..a94695c
--- /dev/null
+++ b/scripts/monitoring/ntploopwatch
@@ -0,0 +1,1667 @@
+#!/usr/bin/perl -w
+;# --*-perl-*--
+;#
+;# /src/NTP/ntp4-dev/scripts/monitoring/ntploopwatch,v 4.7 2004/11/14 16:11:05 kardel RELEASE_20050508_A
+;#
+;# process loop filter statistics file and either
+;# - show statistics periodically using gnuplot
+;# - or print a single plot
+;#
+;# Copyright (c) 1992-1998
+;# Rainer Pruy, Friedrich-Alexander Universität Erlangen-Nürnberg
+;#
+;#
+;#############################################################
+$0 =~ s!^.*/([^/]+)$!$1!;
+$F = ' ' x length($0);
+$|=1;
+
+$ENV{'SHELL'} = '/bin/sh'; # use bourne shell
+
+undef($config);
+undef($workdir);
+undef($PrintIt);
+undef($samples);
+undef($StartTime);
+undef($EndTime);
+($a,$b) if 0; # keep -w happy
+$usage = <<"E-O-P";
+usage:
+ to watch statistics permanently:
+ $0 [-v[<level>]] [-c <config-file>] [-d <working-dir>]
+ $F [-h <hostname>]
+
+ to get a single print out specify also
+ $F -P[<printer>] [-s<samples>]
+ $F [-S <start-time>] [-E <end-time>]
+ $F [-Y <MaxOffs>] [-y <MinOffs>]
+
+If You like long option names, You can use:
+ -help
+ -c +config
+ -d +directory
+ -h +host
+ -v +verbose[=<level>]
+ -P +printer[=<printer>]
+ -s +samples[=<samples>]
+ -S +starttime
+ -E +endtime
+ -Y +maxy
+ -y +miny
+
+If <printer> contains a '/' (slash character) output is directed to
+a file of this name instead of delivered to a printer.
+E-O-P
+
+;# add directory to look for lr.pl and timelocal.pl (in front of current list)
+unshift(@INC,".");
+
+require "lr.pl"; # linear regresion routines
+
+$MJD_1970 = 40587; # from ntp.h (V3)
+$RecordSize = 48; # usually a line fits into 42 bytes
+$MinClip = 1; # clip Y scales with greater range than this
+
+;# largest extension of Y scale from mean value, factor for standart deviation
+$FuzzLow = 2.2; # for side closer to zero
+$FuzzBig = 1.8; # for side farther from zero
+
+require "ctime.pl";
+require "timelocal.pl";
+;# early distributions of ctime.pl had a bug
+$ENV{'TZ'} = 'MET' unless defined $ENV{'TZ'} || $[ > 4.010;
+if (defined(@ctime'MoY))
+{
+ *Month=*ctime'MoY;
+ *Day=*ctime'DoW;
+} # ' re-sync emacs fontification
+else
+{
+ @Month = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
+ @Day = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
+}
+print @ctime'DoW if 0; # ' re-sync emacs fontification
+
+;# max number of days per month
+@MaxNumDaysPerMonth = (31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
+
+;# config settable parameters
+$delay = 60;
+$srcprefix = "./var\@\$STATHOST/loopstats.";
+$showoffs = 1;
+$showfreq = 1;
+$showcmpl = 0;
+$showoreg = 0;
+$showfreg = 0;
+undef($timebase);
+undef($freqbase);
+undef($cmplscale);
+undef($MaxY);
+undef($MinY);
+$deltaT = 512; # indicate sample data gaps greater than $deltaT seconds
+$verbose = 1;
+
+while($_ = shift(@ARGV))
+{
+ (/^[+-]help$/) && die($usage);
+
+ (/^-c$/ || /^\+config$/) &&
+ (@ARGV || die($usage), $config = shift(@ARGV), next);
+
+ (/^-d$/ || /^\+directory$/) &&
+ (@ARGV || die($usage), $workdir = shift(@ARGV), next);
+
+ (/^-h$/ || /^\+host$/) &&
+ (@ARGV || die($usage), $STATHOST = shift, next);
+
+ (/^-v(\d*)$/ || /^\+verbose=?(\d*)$/) &&
+ ($verbose=($1 eq "") ? 1 : $1, next);
+
+ (/^-P(\S*)$/ || /^\+[Pp]rinter=?(\S*)$/) &&
+ ($PrintIt = $1, $verbose==1 && ($verbose = 0), next);
+
+ (/^-s(\d*)$/ || /^\+samples=?(\d*)$/) &&
+ (($samples = ($1 eq "") ? (shift || die($usage)): $1), next);
+
+ (/^-S$/ || /^\+[Ss]tart[Tt]ime$/) &&
+ (@ARGV || die($usage), $StartTime=&date_time_spec2seconds(shift),next);
+
+ (/^-E$/ || /^\+[Ee]nd[Tt]ime$/) &&
+ (@ARGV || die($usage), $EndTime = &date_time_spec2seconds(shift),next);
+
+ (/^-Y$/ || /^\+[Mm]ax[Yy]$/) &&
+ (@ARGV || die($usage), $MaxY = shift, next);
+
+ (/^-y$/ || /^\+[Mm]in[Yy]$/) &&
+ (@ARGV || die($usage), $MinY = shift, next);
+
+ die("$0: unexpected argument \"$_\"\n$usage");
+}
+
+if (defined($workdir))
+{
+ chdir($workdir) ||
+ die("$0: failed to change working dir to \"$workdir\": $!\n");
+}
+
+$PrintIt = "ps" if defined($PrintIt) && $PrintIt eq "";
+
+if (!defined($PrintIt))
+{
+ defined($samples) &&
+ print "WARNING: your samples value may be shadowed by config file settings\n";
+ defined($StartTime) &&
+ print "WARNING: your StartTime value may be shadowed by config file settings\n";
+ defined($EndTime) &&
+ print "WARNING: your EndTime value may be shadowed by config file settings\n";
+ defined($MaxY) &&
+ print "WARNING: your MaxY value may be shadowed by config file settings\n";
+ defined($MinY) &&
+ print "WARNING: your MinY value may be shadowed by config file settings\n";
+
+ ;# check operating environment
+ ;#
+ ;# gnuplot usually has X support
+ ;# I vaguely remember there was one with sunview support
+ ;#
+ ;# If Your plotcmd can display graphics using some other method
+ ;# (Tek window,..) fix the following test
+ ;# (or may be, just disable it)
+ ;#
+ !(defined($ENV{'DISPLAY'}) || defined($ENV{'WINDOW_PARENT'})) &&
+ die("Need window system to monitor statistics\n");
+}
+
+;# configuration file
+$config = "loopwatch.config" unless defined($config);
+($STATHOST = $config) =~ s!.*loopwatch\.config.([^/\.]*)$!$1!
+ unless defined($STATHOST);
+($STATTAG = $STATHOST) =~ s/^([^\.\*\s]+)\..*$/$1/;
+
+$srcprefix =~ s/\$STATHOST/$STATHOST/g;
+
+;# plot command
+@plotcmd=("gnuplot",
+ '-title', "Ntp loop filter statistics $STATHOST",
+ '-name', "NtpLoopWatch_$STATTAG");
+$tmpfile = "/tmp/ntpstat.$$";
+
+;# other variables
+$doplot = ""; # assembled command for @plotcmd to display plot
+undef($laststat);
+
+;# plot value ranges
+undef($mintime);
+undef($maxtime);
+undef($minoffs);
+undef($maxoffs);
+undef($minfreq);
+undef($maxfreq);
+undef($mincmpl);
+undef($maxcmpl);
+undef($miny);
+undef($maxy);
+
+;# stop operation if plot command dies
+sub sigchld
+{
+ local($pid) = wait;
+ unlink($tmpfile);
+ warn(sprintf("%s: %s died: exit status: %d signal %d\n",
+ $0,
+ (defined($Plotpid) && $Plotpid == $pid)
+ ? "plotcmd" : "unknown child $pid",
+ $?>>8,$? & 0xff)) if $?;
+ exit(1) if $? && defined($Plotpid) && $pid == $Plotpid;
+}
+&sigchld if 0;
+$SIG{'CHLD'} = "sigchld";
+$SIG{'CLD'} = "sigchld";
+
+sub abort
+{
+ unlink($tmpfile);
+ defined($Plotpid) && kill('TERM',$Plotpid);
+ die("$0: received signal SIG$_[$[] - exiting\n");
+}
+&abort if 0; # make -w happy - &abort IS used
+$SIG{'INT'} = $SIG{'HUP'} = $SIG{'QUIT'} = $SIG{'TERM'} = $SIG{'PIPE'} = "abort";
+
+;#
+sub abs
+{
+ ($_[$[] < 0) ? -($_[$[]) : $_[$[];
+}
+
+sub boolval
+{
+ local($v) = ($_[$[]);
+
+ return 1 if ($v eq 'yes') || ($v eq 'y');
+ return 1 if ($v =~ /^[0-9]*$/) && ($v != 0);
+ return 0;
+}
+
+;#####################
+;# start of real work
+
+print "starting plot command (" . join(" ",@plotcmd) . ")\n" if $verbose > 1;
+
+$Plotpid = open(PLOT,"|-");
+select((select(PLOT),$|=1)[$[]); # make PLOT line bufferd
+
+defined($Plotpid) ||
+ die("$0: failed to start plot command: $!\n");
+
+unless ($Plotpid)
+{
+ ;# child == plot command
+ close(STDOUT);
+ open(STDOUT,">&STDERR") ||
+ die("$0: failed to redirect STDOUT of plot command: $!\n");
+
+ print STDOUT "plot command running as $$\n";
+
+ exec @plotcmd;
+ die("$0: failed to exec (@plotcmd): $!\n");
+ exit(1); # in case ...
+}
+
+sub read_config
+{
+ local($at) = (stat($config))[$[+9];
+ local($_,$c,$v);
+
+ (undef($laststat),(print("stat $config failed: $!\n")),return) if ! defined($at);
+ return if (defined($laststat) && ($laststat == $at));
+ $laststat = $at;
+
+ print "reading configuration from \"$config\"\n" if $verbose;
+
+ open(CF,"<$config") ||
+ (warn("$0: failed to read \"$config\" - using old settings ($!)\n"),
+ return);
+ while(<CF>)
+ {
+ chop;
+ s/^([^\#]*[^\#\s]?)\s*\#.*$//;
+ next if /^\s*$/;
+
+ s/^\s*([^=\s]*)\s*=\s*(.*\S)\s*$/$1=$2/;
+
+ ($c,$v) = split(/=/,$_,2);
+ print "processing \"$c=$v\"\n" if $verbose > 3;
+ ($c eq "delay") && ($delay = $v,1) && next;
+ ($c eq 'samples') && (!defined($PrintIt) || !defined($samples)) &&
+ ($samples = $v,1) && next;
+ ($c eq 'srcprefix') && (($srcprefix=$v)=~s/\$STATHOST/$STATHOST/g,1)
+ && next;
+ ($c eq 'showoffs') &&
+ ($showoffs = boolval($v),1) && next;
+ ($c eq 'showfreq') &&
+ ($showfreq = boolval($v),1) && next;
+ ($c eq 'showcmpl') &&
+ ($showcmpl = boolval($v),1) && next;
+ ($c eq 'showoreg') &&
+ ($showoreg = boolval($v),1) && next;
+ ($c eq 'showfreg') &&
+ ($showfreg = boolval($v),1) && next;
+
+ ($c eq 'exit') && (unlink($tmpfile),die("$0: exit by config request\n"));
+
+ ($c eq 'freqbase' ||
+ $c eq 'cmplscale') &&
+ do {
+ if (! defined($v) || $v eq "" || $v eq 'dynamic')
+ {
+ eval "undef(\$$c);";
+ }
+ else
+ {
+ eval "\$$c = \$v;";
+ }
+ next;
+ };
+ ($c eq 'timebase') &&
+ do {
+ if (! defined($v) || $v eq "" || $v eq "dynamic")
+ {
+ undef($timebase);
+ }
+ else
+ {
+ $timebase=&date_time_spec2seconds($v);
+ }
+ };
+ ($c eq 'EndTime') &&
+ do {
+ next if defined($EndTime) && defined($PrintIt);
+ if (! defined($v) || $v eq "" || $v eq "none")
+ {
+ undef($EndTime);
+ }
+ else
+ {
+ $EndTime=&date_time_spec2seconds($v);
+ }
+ };
+ ($c eq 'StartTime') &&
+ do {
+ next if defined($StartTime) && defined($PrintIt);
+ if (! defined($v) || $v eq "" || $v eq "none")
+ {
+ undef($StartTime);
+ }
+ else
+ {
+ $StartTime=&date_time_spec2seconds($v);
+ }
+ };
+
+ ($c eq 'MaxY') &&
+ do {
+ next if defined($MaxY) && defined($PrintIt);
+ if (! defined($v) || $v eq "" || $v eq "none")
+ {
+ undef($MaxY);
+ }
+ else
+ {
+ $MaxY=$v;
+ }
+ };
+
+ ($c eq 'MinY') &&
+ do {
+ next if defined($MinY) && defined($PrintIt);
+ if (! defined($v) || $v eq "" || $v eq "none")
+ {
+ undef($MinY);
+ }
+ else
+ {
+ $MinY=$v;
+ }
+ };
+
+ ($c eq 'deltaT') &&
+ do {
+ if (!defined($v) || $v eq "")
+ {
+ undef($deltaT);
+ }
+ else
+ {
+ $deltaT = $v;
+ }
+ next;
+ };
+ ($c eq 'verbose') && ! defined($PrintIt) &&
+ do {
+ if (!defined($v) || $v == 0)
+ {
+ $verbose = 0;
+ }
+ else
+ {
+ $verbose = $v;
+ }
+ next;
+ };
+ ;# otherwise: silently ignore unrecognized config line
+ }
+ close(CF);
+ ;# set show defaults when nothing selected
+ $showoffs = $showfreq = $showcmpl = 1
+ unless $showoffs || $showfreq || $showcmpl;
+ if ($verbose > 3)
+ {
+ print "new configuration:\n";
+ print " delay\t= $delay\n";
+ print " samples\t= $samples\n";
+ print " srcprefix\t= $srcprefix\n";
+ print " showoffs\t= $showoffs\n";
+ print " showfreq\t= $showfreq\n";
+ print " showcmpl\t= $showcmpl\n";
+ print " showoreg\t= $showoreg\n";
+ print " showfreg\t= $showfreg\n";
+ printf " timebase\t= %s",defined($timebase)?&ctime($timebase):"dynamic\n";
+ printf " freqbase\t= %s\n",defined($freqbase) ?"$freqbase":"dynamic";
+ printf " cmplscale\t= %s\n",defined($cmplscale)?"$cmplscale":"dynamic";
+ printf " StartTime\t= %s",defined($StartTime)?&ctime($StartTime):"none\n";
+ printf " EndTime\t= %s", defined($EndTime) ? &ctime($EndTime):"none\n";
+ printf " MaxY\t= %s",defined($MaxY)? $MaxY :"none\n";
+ printf " MinY\t= %s",defined($MinY)? $MinY :"none\n";
+ print " verbose\t= $verbose\n";
+ }
+print "configuration file read\n" if $verbose > 2;
+}
+
+sub make_doplot($$)
+{
+ my($lo, $lf) = @_;
+ local($c) = ("");
+ local($fmt)
+ = ("%s \"%s\" using 1:%d title '%s <%lf %lf> %6s' with lines");
+ local($regfmt)
+ = ("%s ((%lf * x) + %lf) title 'lin. approx. %s (%f t[h]) %s %f <%f> %6s' with lines");
+
+ $doplot = " set title 'NTP loopfilter statistics for $STATHOST " .
+ "(last $LastCnt samples from $srcprefix*)'\n";
+
+ local($xts,$xte,$i,$t);
+
+ local($s,$c) = ("");
+
+ ;# number of integral seconds to get at least 12 tic marks on x axis
+ $t = int(($maxtime - $mintime) / 12 + 0.5);
+ $t = 1 unless $t; # prevent $t to be zero
+ foreach $i (30,
+ 60,5*60,15*60,30*60,
+ 60*60,2*60*60,6*60*60,12*60*60,
+ 24*60*60,48*60*60)
+ {
+ last if $t < $i;
+ $t = $t - ($t % $i);
+ }
+ print "time label resolution: $t seconds\n" if $verbose > 1;
+
+ ;# make gnuplot use wall clock time labels instead of NTP seconds
+ for ($c="", $i = $mintime - ($mintime % $t);
+ $i <= $maxtime + $t;
+ $i += $t, $c=",")
+ {
+ $s .= $c;
+ ((int($i / $t) % 2) &&
+ ($s .= sprintf("'' %lf",($i - $LastTimeBase)/3600))) ||
+ (($t <= 60) &&
+ ($s .= sprintf("'%d:%02d:%02d' %lf",
+ (localtime($i))[$[+2,$[+1,$[+0],
+ ($i - $LastTimeBase)/3600)))
+ || (($t <= 2*60*60) &&
+ ($s .= sprintf("'%d:%02d' %lf",
+ (localtime($i))[$[+2,$[+1],
+ ($i - $LastTimeBase)/3600)))
+ || (($t <= 12*60*60) &&
+ ($s .= sprintf("'%s %d:00' %lf",
+ $Day[(localtime($i))[$[+6]],
+ (localtime($i))[$[+2],
+ ($i - $LastTimeBase)/3600)))
+ || ($s .= sprintf("'%d.%d-%d:00' %lf",
+ (localtime($i))[$[+3,$[+4,$[+2],
+ ($i - $LastTimeBase)/3600));
+ }
+ $doplot .= "set xtics ($s)\n";
+
+ chop($xts = &ctime($mintime));
+ chop($xte = &ctime($maxtime));
+ $doplot .= "set xlabel 'Start: $xts -- Time Scale -- End: $xte'\n";
+ $doplot .= "set yrange [" ;
+ $doplot .= defined($MinY) ? sprintf("%lf", $MinY) : $miny;
+ $doplot .= ':';
+ $doplot .= defined($MaxY) ? sprintf("%lf", $MaxY) : $maxy;
+ $doplot .= "]\n";
+
+ $doplot .= " plot";
+ $c = "";
+ $showoffs &&
+ ($doplot .= sprintf($fmt,$c,$tmpfile,2,
+ "offset",
+ $minoffs,$maxoffs,
+ "[ms]"),
+ $c = ",");
+ $LastCmplScale = 1 if ! defined($LastCmplScale);
+ $showcmpl &&
+ ($doplot .= sprintf($fmt,$c,$tmpfile,4,
+ "compliance" .
+ (&abs($LastCmplScale) > 1
+ ? " / $LastCmplScale"
+ : (&abs($LastCmplScale) == 1 ? "" : " * ".(1/$LastCmplScale))),
+ $mincmpl/$LastCmplScale,$maxcmpl/$LastCmplScale,
+ ""),
+ $c = ",");
+ $LastFreqBase = 0 if ! defined($LastFreqBase);
+ $LastFreqBaseString = "?" if ! defined($LastFreqBaseString);
+ $FreqScale = 1 if ! defined($FreqScale);
+ $FreqScaleInv = 1 if ! defined($FreqScaleInv);
+ $showfreq &&
+ ($doplot .= sprintf($fmt,$c,$tmpfile,3,
+ "frequency" .
+ ($LastFreqBase > 0
+ ? " - $LastFreqBaseString"
+ : ($LastFreqBase == 0 ? "" : " + $LastFreqBaseString")),
+ $minfreq * $FreqScale - $LastFreqBase,
+ $maxfreq * $FreqScale - $LastFreqBase,
+ "[${FreqScaleInv}ppm]"),
+ $c = ",");
+ $showoreg && $showoffs &&
+ ($doplot .= sprintf($regfmt, $c,
+ $lo->B(),$lo->A(),
+ "offset ",
+ $lo->B(),
+ (($lo->A()) < 0 ? '-' : '+'),
+ &abs($lo->A()), $lo->r(),
+ "[ms]"),
+ $c = ",");
+ $showfreg && $showfreq &&
+ ($doplot .= sprintf($regfmt, $c,
+ $lf->B() * $FreqScale,
+ ($lf->A() + $minfreq) * $FreqScale - $LastFreqBase,
+ "frequency",
+ $lf->B() * $FreqScale,
+ (($lf->A() + $minfreq) * $FreqScale - $LastFreqBase) < 0 ? '-' : '+',
+ &abs(($lf->A() + $minfreq) * $FreqScale - $LastFreqBase),
+ $lf->r(),
+ "[${FreqScaleInv}ppm]"),
+ $c = ",");
+ $doplot .= "\n";
+}
+
+%F_key = ();
+%F_name = ();
+%F_size = ();
+%F_mtime = ();
+%F_first = ();
+%F_last = ();
+
+sub genfile
+{
+ local($cnt,$in,$out,$lo,$lf,@fpos) = @_;
+
+ local(@F,@t,$t,$lastT) = ();
+ local(@break,@time,@offs,@freq,@cmpl,@loffset,@filekey) = ();
+ local($lm,$l,@f);
+
+ local($sdir,$sname);
+
+ ;# allocate some storage for the tables
+ ;# otherwise realloc may get into troubles
+ if (defined($StartTime) && defined($EndTime))
+ {
+ $l = ($EndTime-$StartTime) -$[+1 +1; # worst case: 1 sample per second
+ }
+ else
+ {
+ $l = $cnt + 10;
+ }
+ print "preextending arrays to $l entries\n" if $verbose > 2;
+ $#break = $l; for ($i=$[; $i<=$l;$i++) { $break[$i] = 0; }
+ $#time = $l; for ($i=$[; $i<=$l;$i++) { $time[$i] = 0; }
+ $#offs = $l; for ($i=$[; $i<=$l;$i++) { $offs[$i] = 0; }
+ $#freq = $l; for ($i=$[; $i<=$l;$i++) { $freq[$i] = 0; }
+ $#cmpl = $l; for ($i=$[; $i<=$l;$i++) { $cmpl[$i] = 0; }
+ $#loffset = $l; for ($i=$[; $i<=$l;$i++) { $loffset[$i] = 0; }
+ $#filekey = $l; for ($i=$[; $i<=$l;$i++) { $filekey[$i] = 0; }
+ ;# now reduce size again
+ $#break = $[ - 1;
+ $#time = $[ - 1;
+ $#offs = $[ - 1;
+ $#freq = $[ - 1;
+ $#cmpl = $[ - 1;
+ $#loffset = $[ - 1;
+ $#filekey = $[ - 1;
+ print "memory allocation ready\n" if $verbose > 2;
+ sleep(3) if $verbose > 1;
+
+ $fpos[$[] = '' if !defined($fpos[$[]);
+
+ if (index($in,"/") < $[)
+ {
+ $sdir = ".";
+ $sname = $in;
+ }
+ else
+ {
+ ($sdir,$sname) = ($in =~ m!^(.*)/([^/]*)!);
+ $sname = "" unless defined($sname);
+ }
+
+ $Ltime = -1 if ! defined($Ltime);
+ if (!defined($Lsdir) || $Lsdir ne $sdir || $Ltime != (stat($sdir))[$[+9] ||
+ grep($F_mtime{$_} != (stat($F_name{$_}))[$[+9], @F_files))
+
+ {
+ print "rescanning directory \"$sdir\" for files \"$sname*\"\n"
+ if $verbose > 1;
+
+ ;# rescan directory on changes
+ $Lsdir = $sdir;
+ $Ltime = (stat($sdir))[$[+9];
+ </X{> if 0; # dummy line - calm down my formatter
+ local(@newfiles) = < ${in}*[0-9] >;
+ local($st_dev,$st_ino,$st_mtime,$st_size,$name,$key,$modified);
+
+ foreach $name (@newfiles)
+ {
+ ($st_dev,$st_ino,$st_size,$st_mtime) =
+ (stat($name))[$[,$[+1,$[+7,$[+9];
+ $modified = 0;
+ $key = sprintf("%lx|%lu", $st_dev, $st_ino);
+
+ print "candidate file \"$name\"",
+ (defined($st_dev) ? "" : " failed: $!"),"\n"
+ if $verbose > 2;
+
+ if (! defined($F_key{$name}) || $F_key{$name} ne $key)
+ {
+ $F_key{$name} = $key;
+ $modified++;
+ }
+ if (!defined($F_name{$key}) || $F_name{$key} ne $name)
+ {
+ $F_name{$key} = $name;
+ $modified++;
+ }
+ if (!defined($F_size{$key}) || $F_size{$key} != $st_size)
+ {
+ $F_size{$key} = $st_size;
+ $modified++;
+ }
+ if (!defined($F_mtime{$key}) || $F_mtime{$key} != $st_mtime)
+ {
+ $F_mtime{$key} = $st_mtime;
+ $modified++;
+ }
+ if ($modified)
+ {
+ print "new data \"$name\" key: $key;\n" if $verbose > 1;
+ print " size: $st_size; mtime: $st_mtime;\n"
+ if $verbose > 1;
+ $F_last{$key} = $F_first{$key} = $st_mtime;
+ $F_first{$key}--; # prevent zero divide later on
+ ;# now compute derivated attributes
+ open(IN, "<$name") ||
+ do {
+ warn "$0: failed to open \"$name\": $!";
+ next;
+ };
+
+ while(<IN>)
+ {
+ @F = split;
+ next if @F < 5;
+ next if $F[$[] eq "";
+ $t = ($F[$[] - $MJD_1970) * 24 * 60 * 60;
+ $t += $F[$[+1];
+ $F_first{$key} = $t;
+ print "\tfound first entry: $t ",&ctime($t)
+ if $verbose > 4;
+ last;
+ }
+ seek(IN,
+ ($st_size > 4*$RecordSize) ? $st_size - 4*$RecordSize : 0,
+ 0);
+ while(<IN>)
+ {
+ @F = split;
+ next if @F < 5;
+ next if $F[$[] eq "";
+ $t = ($F[$[] - $MJD_1970) * 24 * 60 * 60;
+ $t += $F[$[+1];
+ $F_last{$key} = $t;
+ $_ = <IN>;
+ print "\tfound last entry: $t ", &ctime($t)
+ if $verbose > 4 && ! defined($_);
+ last unless defined($_);
+ redo;
+ ;# Ok, calm down...
+ ;# using $_ = <IN> in conjunction with redo
+ ;# is semantically equivalent to the while loop, but
+ ;# I needed a one line look ahead and this solution
+ ;# was what I thought of first
+ ;# and.. If you do not like it dont look
+ }
+ close(IN);
+ print(" first: ",$F_first{$key},
+ " last: ",$F_last{$key},"\n") if $verbose > 1;
+ }
+ }
+ ;# now reclaim memory used for files no longer referenced ...
+ local(%Names);
+ grep($Names{$_} = 1,@newfiles);
+ foreach (keys %F_key)
+ {
+ next if defined($Names{$_});
+ delete $F_key{$_};
+ $verbose > 2 && print "no longer referenced: \"$_\"\n";
+ }
+ %Names = ();
+
+ grep($Names{$_} = 1,values(%F_key));
+ foreach (keys %F_name)
+ {
+ next if defined($Names{$_});
+ delete $F_name{$_};
+ $verbose > 2 && print "unref name($_)= $F_name{$_}\n";
+ }
+ foreach (keys %F_size)
+ {
+ next if defined($Names{$_});
+ delete $F_size{$_};
+ $verbose > 2 && print "unref size($_)\n";
+ }
+ foreach (keys %F_mtime)
+ {
+ next if defined($Names{$_});
+ delete $F_mtime{$_};
+ $verbose > 2 && print "unref mtime($_)\n";
+ }
+ foreach (keys %F_first)
+ {
+ next if defined($Names{$_});
+ delete $F_first{$_};
+ $verbose > 2 && print "unref first($_)\n";
+ }
+ foreach (keys %F_last)
+ {
+ next if defined($Names{$_});
+ delete $F_last{$_};
+ $verbose > 2 && print "unref last($_)\n";
+ }
+ ;# create list sorted by time
+ @F_files = sort {$F_first{$a} <=> $F_first{$b}; } keys(%F_name);
+ if ($verbose > 1)
+ {
+ print "Resulting file list:\n";
+ foreach (@F_files)
+ {
+ print "\t$_\t$F_name{$_}\n";
+ }
+ }
+ }
+
+ printf("processing %s; output \"$out\" (%d input files)\n",
+ ((defined($StartTime) && defined($EndTime))
+ ? "time range"
+ : (defined($StartTime) ? "$cnt samples from StartTime" :
+ (defined($EndTime) ? "$cnt samples to EndTime" :
+ "last $cnt samples"))),
+ scalar(@F_files))
+ if $verbose > 1;
+
+ ;# open output file - will be input for plotcmd
+ open(OUT,">$out") ||
+ do {
+ warn("$0: cannot create \"$out\": $!\n");
+ };
+
+ @f = @F_files;
+ if (defined($StartTime))
+ {
+ while (@f && ($F_last{$f[$[]} < $StartTime))
+ {
+ print("shifting ", $F_name{$f[$[]},
+ " last: ", $F_last{$f[$[]},
+ " < StartTime: $StartTime\n")
+ if $verbose > 3;
+ shift(@f);
+ }
+
+
+ }
+ if (defined($EndTime))
+ {
+ while (@f && ($F_first{$f[$#f]} > $EndTime))
+ {
+ print("popping ", $F_name{$f[$#f]},
+ " first: ", $F_first{$f[$#f]},
+ " > EndTime: $EndTime\n")
+ if $verbose > 3;
+ pop(@f);
+ }
+ }
+
+ if (@f)
+ {
+ if (defined($StartTime))
+ {
+ print "guess start according to StartTime ($StartTime)\n"
+ if $verbose > 3;
+
+ if ($fpos[$[] eq 'start')
+ {
+ if (grep($_ eq $fpos[$[+1],@f))
+ {
+ shift(@f) while @f && $f[$[] ne $fpos[$[+1];
+ }
+ else
+ {
+ @fpos = ('start', $f[$[], undef);
+ }
+ }
+ else
+ {
+ @fpos = ('start' , $f[$[], undef);
+ }
+
+ if (!defined($fpos[$[+2]))
+ {
+ if ($StartTime <= $F_first{$f[$[]})
+ {
+ $fpos[$[+2] = 0;
+ }
+ else
+ {
+ $fpos[$[+2] =
+ int($F_size{$f[$[]} *
+ (($StartTime - $F_first{$f[$[]})/
+ ($F_last{$f[$[]} - $F_first{$f[$[]})));
+ $fpos[$[+2] = ($fpos[$[+2] <= 2 * $RecordSize)
+ ? 0 : $fpos[$[+2] - 2 * $RecordSize;
+ ;# anyway as the data may contain "time holes"
+ ;# our heuristics may baldly fail
+ ;# so just start at 0
+ $fpos[$[+2] = 0;
+ }
+ }
+ }
+ elsif (defined($EndTime))
+ {
+ print "guess starting point according to EndTime ($EndTime)\n"
+ if $verbose > 3;
+
+ if ($fpos[$[] eq 'end')
+ {
+ if (grep($_ eq $fpos[$[+1],@f))
+ {
+ shift(@f) while @f && $f[$[] ne $fpos[$[+1];
+ }
+ else
+ {
+ @fpos = ('end', $f[$[], undef);
+ }
+ }
+ else
+ {
+ @fpos = ('end', $f[$[], undef);
+ }
+
+ if (!defined($fpos[$[+2]))
+ {
+ local(@x) = reverse(@f);
+ local($s,$c) = (0,$cnt);
+ if ($EndTime < $F_last{$x[$[]})
+ {
+ ;# last file will only be used partially
+ $s = int($F_size{$x[$[]} *
+ (($EndTime - $F_first{$x[$[]}) /
+ ($F_last{$x[$[]} - $F_first{$x[$[]})));
+ $s = int($s/$RecordSize);
+ $c -= $s - 1;
+ if ($c <= 0)
+ {
+ ;# start is in the same file
+ $fpos[$[+1] = $x[$[];
+ $fpos[$[+2] = ($c >=-2) ? 0 : (-$c - 2) * $RecordSize;
+ shift(@f) while @f && ($f[$[] ne $x[$[]);
+ }
+ else
+ {
+ shift(@x);
+ }
+ }
+
+ if (!defined($fpos[$[+2]))
+ {
+ local($_);
+ while($_ = shift(@x))
+ {
+ $s = int($F_size{$_}/$RecordSize);
+ $c -= $s - 1;
+ if ($c <= 0)
+ {
+ $fpos[$[+1] = $_;
+ $fpos[$[+2] = ($c>-2) ? 0 : (-$c - 2) * $RecordSize;
+ shift(@f) while @f && ($f[$[] ne $_);
+ last;
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ print "guessing starting point according to count ($cnt)\n"
+ if $verbose > 3;
+ ;# guess offset to get last available $cnt samples
+ if ($fpos[$[] eq 'cnt')
+ {
+ if (grep($_ eq $fpos[$[+1],@f))
+ {
+ print "old positioning applies\n" if $verbose > 3;
+ shift(@f) while @f && $f[$[] ne $fpos[$[+1];
+ }
+ else
+ {
+ @fpos = ('cnt', $f[$[], undef);
+ }
+ }
+ else
+ {
+ @fpos = ('cnt', $f[$[], undef);
+ }
+
+ if (!defined($fpos[$[+2]))
+ {
+ local(@x) = reverse(@f);
+ local($s,$c) = (0,$cnt);
+
+ local($_);
+ while($_ = shift(@x))
+ {
+ print "examing \"$_\" $c samples still needed\n"
+ if $verbose > 4;
+ $s = int($F_size{$_}/$RecordSize);
+ $c -= $s - 1;
+ if ($c <= 0)
+ {
+ $fpos[$[+1] = $_;
+ $fpos[$[+2] = ($c>-2) ? 0 : (-$c - 2) * $RecordSize;
+ shift(@f) while @f && ($f[$[] ne $_);
+ last;
+ }
+ }
+ if (!defined($fpos[$[+2]))
+ {
+ print "no starting point yet - using start of data\n"
+ if $verbose > 2;
+ $fpos[$[+2] = 0;
+ }
+ }
+ }
+ }
+ print "Ooops, no suitable input file ??\n"
+ if $verbose > 1 && @f <= 0;
+
+ printf("Starting at (%s) \"%s\" offset %ld using %d files\n",
+ $fpos[$[+1],
+ $F_name{$fpos[$[+1]},
+ $fpos[$[+2],
+ scalar(@f))
+ if $verbose > 2;
+
+ $lm = 1;
+ $l = 0;
+ foreach $key (@f)
+ {
+ $file = $F_name{$key};
+ print "processing file \"$file\"\n" if $verbose > 2;
+
+ open(IN,"<$file") ||
+ (warn("$0: cannot read \"$file\": $!\n"), next);
+
+ ;# try to seek to a position nearer to the start of the interesting lines
+ ;# should always affect only first item in @f
+ ($key eq $fpos[$[+1]) &&
+ (($verbose > 1) &&
+ print("Seeking to offset $fpos[$[+2]\n"),
+ seek(IN,$fpos[$[+2],0) ||
+ warn("$0: seek(\"$F_name{$key}\" failed: $|\n"));
+
+ while(<IN>)
+ {
+ $l++;
+ ($verbose > 3) &&
+ (($l % $lm) == 0 && print("\t$l lines read\n") &&
+ (($l == 2) && ($lm = 10) ||
+ ($l == 100) && ($lm = 100) ||
+ ($l == 500) && ($lm = 500) ||
+ ($l == 1000) && ($lm = 1000) ||
+ ($l == 5000) && ($lm = 5000) ||
+ ($l == 10000) && ($lm = 10000)));
+
+ @F = split;
+
+ next if @F < 6; # no valid input line is this short
+ next if $F[$[] eq "";
+ next if ($F[$[] !~ /^\d+$/);
+ ($F[$[] !~ /^\d+$/) && # A 'never should have happend' error
+ die("$0: unexpected input line: >$_<\n");
+
+ ;# modified Julian to UNIX epoch
+ $t = ($F[$[] - $MJD_1970) * 24 * 60 * 60;
+ $t += $F[$[+1]; # add seconds + fraction
+
+ ;# multiply offset by 1000 to get ms - try to avoid float op
+ (($F[$[+2] =~ s/(\d*)\.(\d{3})(\d*)/$1$2.$3/) &&
+ $F[$[+2] =~ s/0+([\d\.])/($1 eq '.') ? '0.' : $1/e) # strip leading zeros
+ || ($F[$[+2] *= 1000);
+
+
+ ;# skip samples out of specified time range
+ next if (defined($StartTime) && $StartTime > $t);
+ next if (defined($EndTime) && $EndTime < $t);
+
+ next if defined($lastT) && $t < $lastT; # backward in time ??
+
+ push(@offs,$F[$[+2]);
+ push(@freq,$F[$[+3] * (2**20/10**6));
+ push(@cmpl,$F[$[+5]);
+
+ push(@break, (defined($lastT) && ($t - $lastT > $deltaT)));
+ $lastT = $t;
+ push(@time,$t);
+ push(@loffset, tell(IN) - length($_));
+ push(@filekey, $key);
+
+ shift(@break),shift(@time),shift(@offs),
+ shift(@freq), shift(@cmpl),shift(@loffset),
+ shift(@filekey)
+ if @time > $cnt &&
+ ! (defined($StartTime) && defined($EndTime));
+
+ last if @time >= $cnt && defined($StartTime) && !defined($EndTime);
+ }
+ close(IN);
+ last if @time >= $cnt && defined($StartTime) && !defined($EndTime);
+ }
+ print "input scanned ($l lines/",scalar(@time)," samples)\n"
+ if $verbose > 1;
+
+ if (@time)
+ {
+ local($_,@F);
+
+ local($timebase) unless defined($timebase);
+ local($freqbase) unless defined($freqbase);
+ local($cmplscale) unless defined($cmplscale);
+
+ undef $mintime;
+ undef $maxtime;
+ undef $minoffs;
+ undef $maxoffs;
+ undef $minfreq;
+ undef $maxfreq;
+ undef $mincmpl;
+ undef $maxcmpl;
+ undef $miny;
+ undef $maxy ;
+
+ print "computing ranges\n" if $verbose > 2;
+
+ $LastCnt = @time;
+
+ ;# @time is in ascending order (;-)
+ $mintime = $time[$[];
+ $maxtime = $time[$#time];
+ unless (defined($timebase))
+ {
+ local($time,@X) = (time);
+ @X = localtime($time);
+
+ ;# compute today 00:00:00
+ $timebase = $time - ((($X[$[+2]*60)+$X[$[+1])*60+$X[$[]);
+
+ }
+ $LastTimeBase = $timebase;
+
+ if ($showoffs)
+ {
+ local($i,$m,$f);
+
+ $minoffs = &min(@offs);
+ $maxoffs = &max(@offs);
+
+ ;# I know, it is not perl style using indices to access arrays,
+ ;# but I have to proccess two arrays in sync, non-destructively
+ ;# (otherwise a (shift(@a1),shift(a2)) would do),
+ ;# I dont like to make copies of these arrays as they may be huge
+ $i = $[;
+ $lo->sample(($time[$i]-$timebase)/3600,$offs[$i]),$i++
+ while $i <= $#time;
+
+ ($minoffs == $maxoffs) && ($minoffs -= 0.1,$maxoffs += 0.1);
+
+ $i = $lo->sigma();
+ $m = $lo->mean();
+
+ print "mean offset: $m sigma: $i\n" if $verbose > 2;
+
+ if (($maxoffs - $minoffs) > $MinClip)
+ {
+ $f = (&abs($minoffs) < &abs($maxoffs)) ? $FuzzLow : $FuzzBig;
+ $miny = (($m - $minoffs) <= ($f * $i))
+ ? $minoffs : ($m - $f * $i);
+ $f = ($f == $FuzzLow) ? $FuzzBig : $FuzzLow;
+ $maxy = (($maxoffs - $m) <= ($f * $i))
+ ? $maxoffs : ($m + $f * $i);
+ }
+ else
+ {
+ $miny = $minoffs;
+ $maxy = $maxoffs;
+ }
+ ($maxy-$miny) == 0 &&
+ (($maxy,$miny)
+ = (($maxoffs - $minoffs) > 0)
+ ? ($maxoffs,$minoffs) : ($MinClip,-$MinClip));
+
+ $maxy = $MaxY if defined($MaxY) && $MaxY < $maxy;
+ $miny = $MinY if defined($MinY) && $MinY > $miny;
+
+ print "offset min clipped from $minoffs to $miny\n"
+ if $verbose > 2 && $minoffs != $miny;
+ print "offset max clipped from $maxoffs to $maxy\n"
+ if $verbose > 2 && $maxoffs != $maxy;
+ }
+
+ if ($showfreq)
+ {
+ local($i,$m);
+
+ $minfreq = &min(@freq);
+ $maxfreq = &max(@freq);
+
+ $i = $[;
+ $lf->sample(($time[$i]-$timebase)/3600,$freq[$i]-$minfreq),
+ $i++
+ while $i <= $#time;
+
+ $i = $lf->sigma();
+ $m = $lf->mean() + $minfreq;
+
+ print "mean frequency: $m sigma: $i\n" if $verbose > 2;
+
+ if (defined($maxy))
+ {
+ local($s) =
+ ($maxfreq - $minfreq)
+ ? ($maxy - $miny) / ($maxfreq - $minfreq) : 1;
+
+ if (defined($freqbase))
+ {
+ $FreqScale = 1;
+ $FreqScaleInv = "";
+ }
+ else
+ {
+ $FreqScale = 1;
+ $FreqScale = 10 ** int(log($s)/log(10) - 0.9999);
+ $FreqScaleInv =
+ ("$FreqScale" =~ /^10(0*)$/) ? "0.${1}1" :
+ ($FreqScale == 1 ? "" : (1/$FreqScale));
+
+ $freqbase = ($maxfreq + $minfreq)/ 2 * $FreqScale; #$m * $FreqScale;
+ $freqbase -= ($maxy + $miny) / 2; #$lf->mean();
+
+ ;# round resulting freqbase
+ ;# to precision of min max difference
+ $s = -12;
+ $s = int(log(($maxfreq-$minfreq)*$FreqScale)/log(10))-1
+ unless ($maxfreq-$minfreq) < 1e-12;
+ $s = 10 ** $s;
+ $freqbase = int($freqbase / $s) * $s;
+ }
+ }
+ else
+ {
+ $FreqScale = 1;
+ $FreqScaleInv = "";
+ $freqbase = $m unless defined($freqbase);
+ if (($maxfreq - $minfreq) > $MinClip)
+ {
+ $f = (&abs($minfreq) < &abs($maxfreq))
+ ? $FuzzLow : $FuzzBig;
+ $miny = (($freqbase - $minfreq) <= ($f * $i))
+ ? ($minfreq-$freqbase) : (- $f * $i);
+ $f = ($f == $FuzzLow) ? $FuzzBig : $FuzzLow;
+ $maxy = (($maxfreq - $freqbase) <= ($f * $i))
+ ? ($maxfreq-$freqbase) : ($f * $i);
+ }
+ else
+ {
+ $miny = $minfreq - $freqbase;
+ $maxy = $maxfreq - $freqbase;
+ }
+ ($maxy - $miny) == 0 &&
+ (($maxy,$miny) =
+ (($maxfreq - $minfreq) > 0)
+ ? ($maxfreq-$freqbase,$minfreq-$freqbase) : (0.5,-0.5));
+
+ $maxy = $MaxY if defined($MaxY) && $MaxY < $maxy;
+ $miny = $MinY if defined($MinY) && $MinY > $miny;
+
+ print("frequency min clipped from ",$minfreq-$freqbase,
+ " to $miny\n")
+ if $verbose > 2 && $miny != ($minfreq - $freqbase);
+ print("frequency max clipped from ",$maxfreq-$freqbase,
+ " to $maxy\n")
+ if $verbose > 2 && $maxy != ($maxfreq - $freqbase);
+ }
+ $LastFreqBaseString =
+ sprintf("%g",$freqbase >= 0 ? $freqbase : -$freqbase);
+ $LastFreqBase = $freqbase;
+ print "LastFreqBaseString now \"$LastFreqBaseString\"\n"
+ if $verbose > 5;
+ }
+ else
+ {
+ $FreqScale = 1;
+ $FreqScaleInv = "";
+ $LastFreqBase = 0;
+ $LastFreqBaseString = "";
+ }
+
+ if ($showcmpl)
+ {
+ $mincmpl = &min(@cmpl);
+ $maxcmpl = &max(@cmpl);
+
+ if (!defined($cmplscale))
+ {
+ if (defined($maxy))
+ {
+ local($cmp)
+ = (&abs($miny) > &abs($maxy)) ? &abs($miny) : $maxy;
+ $cmplscale = $cmp == $maxy ? 1 : -1;
+
+ foreach (0.01, 0.02, 0.05,
+ 0.1, 0.2, 0.25, 0.4, 0.5,
+ 1, 2, 4, 5,
+ 10, 20, 25, 50,
+ 100, 200, 250, 500, 1000)
+ {
+ $cmplscale *= $_, last if $maxcmpl/$_ <= $cmp;
+ }
+ }
+ else
+ {
+ $cmplscale = 1;
+ $miny = $mincmpl ? 0 : -$MinClip;
+ $maxy = $maxcmpl+$MinClip;
+ }
+ }
+ $LastCmplScale = $cmplscale;
+ }
+ else
+ {
+ $LastCmplScale = 1;
+ }
+
+ print "creating plot command input file\n" if $verbose > 2;
+
+
+ print OUT ("# preprocessed NTP statistics file for $STATHOST\n");
+ print OUT ("# timebase is: ",&ctime($LastTimeBase))
+ if defined($LastTimeBase);
+ print OUT ("# frequency is offset by ",
+ ($LastFreqBase >= 0 ? "+" : "-"),
+ "$LastFreqBaseString [${FreqScaleInv}ppm]\n");
+ print OUT ("# compliance is scaled by $LastCmplScale\n");
+ print OUT ("# time [h]\toffset [ms]\tfrequency [${FreqScaleInv}ppm]\tcompliance\n");
+
+ printf OUT ("%s%lf\t%lf\t%lf\t%lf\n",
+ (shift(@break) ? "\n" : ""),
+ (shift(@time) - $LastTimeBase)/3600,
+ shift(@offs),
+ shift(@freq) * $FreqScale - $LastFreqBase,
+ shift(@cmpl) / $LastCmplScale)
+ while(@time);
+ }
+ else
+ {
+ ;# prevent plotcmd from processing empty file
+ print "Creating plot command dummy...\n" if $verbose > 2;
+ print OUT "# dummy samples\n0 1 2 3\n1 1 2 3\n";
+ $lo->sample(0,1);
+ $lo->sample(1,1);
+ $lf->sample(0,2);
+ $lf->sample(1,2);
+ @time = (0, 1); $maxtime = 1; $mintime = 0;
+ @offs = (1, 1); $maxoffs = 1; $minoffs = 1;
+ @freq = (2, 2); $maxfreq = 2; $minfreq = 2;
+ @cmpl = (3, 3); $maxcmpl = 3; $mincmpl = 3;
+ $LastCnt = 2;
+ $LastFreqBase = 0;
+ $LastCmplScale = 1;
+ $LastTimeBase = 0;
+ $miny = -$MinClip;
+ $maxy = 3 + $MinClip;
+ }
+ close(OUT);
+
+ print "plot command input file created\n"
+ if $verbose > 2;
+
+
+ if (($fpos[$[] eq 'cnt' && scalar(@loffset) >= $cnt) ||
+ ($fpos[$[] eq 'start' && $mintime <= $StartTime) ||
+ ($fpos[$[] eq 'end'))
+ {
+ return ($fpos[$[],$filekey[$[],$loffset[$[]);
+ }
+ else # found to few lines - next time start search earlier in file
+ {
+ if ($fpos[$[] eq 'start')
+ {
+ ;# the timestamps we got for F_first and F_last guaranteed
+ ;# that no file is left out
+ ;# the only thing that could happen is:
+ ;# we guessed the starting point wrong
+ ;# compute a new guess from the first record found
+ ;# if this equals our last guess use data of first record
+ ;# otherwise try new guess
+
+ if ($fpos[$[+1] eq $filekey[$[] && $loffset[$[] > $fpos[$[+2])
+ {
+ local($noff);
+ $noff = $loffset[$[] - ($cnt - @loffset + 1) * $RecordSize;
+ $noff = 0 if $noff < 0;
+
+ return (@fpos[$[,$[+1], ($noff == $fpos[$[+2]) ? $loffset[$[] : $noff);
+ }
+ return ($fpos[$[],$filekey[$[],$loffset[$[]);
+ }
+ elsif ($fpos[$[] eq 'end' || $fpos[$[] eq 'cnt')
+ {
+ ;# try to start earlier in file
+ ;# if we already started at the beginning
+ ;# try to use previous file
+ ;# this assumes distance to better starting point is at most one file
+ ;# the primary guess at top of genfile() should usually allow this
+ ;# assumption
+ ;# if the offset of the first sample used is within
+ ;# a different file than we guessed it must have occurred later
+ ;# in the sequence of files
+ ;# this only can happen if our starting file did not contain
+ ;# a valid sample from the starting point we guessed
+ ;# however this does not invalidate our assumption, no check needed
+ local($noff,$key);
+ if ($fpos[$[+2] > 0)
+ {
+ $noff = $fpos[$[+2] - $RecordSize * ($cnt - @loffset + 1);
+ $noff = 0 if $noff < 0;
+ return (@fpos[$[,$[+1],$noff);
+ }
+ else
+ {
+ if ($fpos[$[+1] eq $F_files[$[])
+ {
+ ;# first file - and not enough samples
+ ;# use data of first sample
+ return ($fpos[$[], $filekey[$[], $loffset[$[]);
+ }
+ else
+ {
+ ;# search key of previous file
+ $key = $F_files[$[];
+ @F = reverse(@F_files);
+ while ($_ = shift(@F))
+ {
+ if ($_ eq $fpos[$[+1])
+ {
+ $key = shift(@F) if @F;
+ last;
+ }
+ }
+ $noff = int($F_size{$key} / $RecordSize);
+ $noff -= $cnt - @loffset;
+ $noff = 0 if $noff < 0;
+ $noff *= $RecordSize;
+ return ($fpos[$[], $key, $noff);
+ }
+ }
+ }
+ else
+ {
+ return ();
+ }
+
+ return 0 if @loffset <= 1 || ($loffset[$#loffset] - $loffset[$[]) <= 1;
+
+ ;# EOF - 1.1 * avg(line) * $cnt
+ local($val) = $loffset[$#loffset]
+ - $cnt * 11 * (($loffset[$#loffset] - $loffset[$[]) / @loffset) / 10;
+ return ($val < 0) ? 0 : $val;
+ }
+}
+
+$Ltime = -1 if ! defined($Ltime);
+$LastFreqBase = 0;
+$LastFreqBaseString = "??";
+
+;# initial setup of plot
+print "initialize plotting\n" if $verbose;
+if (defined($PrintIt))
+{
+ if ($PrintIt =~ m,/,)
+ {
+ print "Saving plot to file $PrintIt\n";
+ print PLOT "set output '$PrintIt'\n";
+ }
+ else
+ {
+ print "Printing plot on printer $PrintIt\n";
+ print PLOT "set output '| lpr -P$PrintIt -h'\n";
+ }
+ print PLOT "set terminal postscript landscape color solid 'Helvetica' 10\n";
+}
+print PLOT "set grid\n";
+print PLOT "set tics out\n";
+print PLOT "set format y '%g '\n";
+printf PLOT "set time 47\n" unless defined($PrintIt);
+
+@filepos =();
+while(1)
+{
+ print &ctime(time) if $verbose;
+
+ ;# update diplay characteristics
+ &read_config;# unless defined($PrintIt);
+
+ unlink($tmpfile);
+ my $lo = lr->new();
+ my $lf = lr->new();
+
+ @filepos = &genfile($samples,$srcprefix,$tmpfile,$lo,$lf,@filepos);
+
+ ;# make plotcmd display samples
+ make_doplot($lo, $lf);
+ print "Displaying plot...\n" if $verbose > 1;
+ print "command for plot sub process:\n$doplot----\n" if $verbose > 3;
+ print PLOT $doplot;
+}
+continue
+{
+ if (defined($PrintIt))
+ {
+ delete $SIG{'CHLD'};
+ print PLOT "quit\n";
+ close(PLOT);
+ if ($PrintIt =~ m,/,)
+ {
+ print "Plot saved to file $PrintIt\n";
+ }
+ else
+ {
+ print "Plot spooled to printer $PrintIt\n";
+ }
+ unlink($tmpfile);
+ exit(0);
+ }
+ ;# wait $delay seconds
+ print "waiting $delay seconds ..." if $verbose > 2;
+ sleep($delay);
+ print " continuing\n" if $verbose > 2;
+ undef($LastFreqBaseString);
+}
+
+
+sub date_time_spec2seconds
+{
+ local($_) = @_;
+ ;# a date_time_spec consistes of:
+ ;# YYYY-MM-DD_HH:MM:SS.ms
+ ;# values can be omitted from the beginning and default than to
+ ;# values of current date
+ ;# values omitted from the end default to lowest possible values
+
+ local($time) = time;
+ local($sec,$min,$hour,$mday,$mon,$year)
+ = localtime($time);
+
+ local($last) = ();
+
+ s/^\D*(.*\d)\D*/$1/; # strip off garbage
+
+ PARSE:
+ {
+ if (s/^(\d{4})(-|$)//)
+ {
+ if ($1 < 1970)
+ {
+ warn("$0: can not handle years before 1970 - year $1 ignored\n");
+ return undef;
+ }
+ elsif ( $1 >= 2070)
+ {
+ warn("$0: can not handle years past 2070 - year $1 ignored\n");
+ return undef;
+ }
+ else
+ {
+ $year = $1 % 100; # 0<= $year < 100
+ ;# - interpreted 70 .. 99,00 .. 69
+ }
+ $last = $[ + 5;
+ last PARSE if $_ eq '';
+ warn("$0: bad date_time_spec: \"$_\" found after YEAR\n"),
+ return(undef)
+ if $2 eq '';
+ }
+
+ if (s/^(\d{1,2})(-|$)//)
+ {
+ warn("$0: implausible month $1\n"),return(undef)
+ if $1 < 1 || $1 > 12;
+ $mon = $1 - 1;
+ $last = $[ + 4;
+ last PARSE if $_ eq '';
+ warn("$0: bad date_time_spec: \"$_\" found after MONTH\n"),
+ return(undef)
+ if $2 eq '';
+ }
+ else
+ {
+ warn("$0: bad date_time_spec \"$_\"\n"),return(undef)
+ if defined($last);
+
+ }
+
+ if (s/^(\d{1,2})([_ ]|$)//)
+ {
+ warn("$0: implausible month day $1 for month ".($mon+1)." (".
+ $MaxNumDaysPerMonth[$mon].")$mon\n"),
+ return(undef)
+ if $1 < 1 || $1 > $MaxNumDaysPerMonth[$mon];
+ $mday = $1;
+ $last = $[ + 3;
+ last PARSE if $_ eq '';
+ warn("$0: bad date_time_spec \"$_\" found after MDAY\n"),
+ return(undef)
+ if $2 eq '';
+ }
+ else
+ {
+ warn("$0: bad date_time_spec \"$_\"\n"), return undef
+ if defined($last);
+ }
+
+ ;# now we face a problem:
+ ;# if ! defined($last) a prefix of "07:"
+ ;# can be either 07:MM or 07:ss
+ ;# to get the second interpretation make the user add
+ ;# a msec fraction part and check for this special case
+ if (! defined($last) && s/^(\d{1,2}):(\d{1,2}\.\d+)//)
+ {
+ warn("$0: implausible minute $1\n"), return undef
+ if $1 < 0 || $1 >= 60;
+ warn("$0: implausible second $1\n"), return undef
+ if $2 < 0 || $2 >= 60;
+ $min = $1;
+ $sec = $2;
+ $last = $[ + 1;
+ last PARSE if $_ eq '';
+ warn("$0: bad date_time_spec \"$_\" after SECONDS\n");
+ return undef;
+ }
+
+ if (s/^(\d{1,2})(:|$)//)
+ {
+ warn("$0: implausible hour $1\n"), return undef
+ if $1 < 0 || $1 > 24;
+ $hour = $1;
+ $last = $[ + 2;
+ last PARSE if $_ eq '';
+ warn("$0: bad date_time_spec found \"$_\" after HOUR\n"),
+ return undef
+ if $2 eq '';
+ }
+ else
+ {
+ warn("$0: bad date_time_spec \"$_\"\n"), return undef
+ if defined($last);
+ }
+
+ if (s/^(\d{1,2})(:|$)//)
+ {
+ warn("$0: implausible minute $1\n"), return undef
+ if $1 < 0 || $1 >=60;
+ $min = $1;
+ $last = $[ + 1;
+ last PARSE if $_ eq '';
+ warn("$0: bad date_time_spec found \"$_\" after MINUTE\n"),
+ return undef
+ if $2 eq '';
+ }
+ else
+ {
+ warn("$0: bad date_time_spec \"$_\"\n"), return undef
+ if defined($last);
+ }
+
+ if (s/^(\d{1,2}(\.\d+)?)//)
+ {
+ warn("$0: implausible second $1\n"), return undef
+ if $1 < 0 || $1 >=60;
+ $sec = $1;
+ $last = $[;
+ last PARSE if $_ eq '';
+ warn("$0: bad date_time_spec found \"$_\" after SECOND\n");
+ return undef;
+ }
+ }
+
+ return $time unless defined($last);
+
+ $sec = 0 if $last > $[;
+ $min = 0 if $last > $[ + 1;
+ $hour = 0 if $last > $[ + 2;
+ $mday = 1 if $last > $[ + 3;
+ $mon = 0 if $last > $[ + 4;
+ local($rtime) = &timelocal($sec,$min,$hour,$mday,$mon,$year, 0,0, 0);
+
+ ;# $rtime may be off if daylight savings time is in effect at given date
+ return $rtime + ($sec - int($sec))
+ if $hour == (localtime($rtime))[$[+2];
+ return
+ &timelocal($sec,$min,$hour,$mday,$mon,$year, 0,0, 1)
+ + ($sec - int($sec));
+}
+
+
+sub min
+{
+ local($m) = shift;
+
+ grep((($m > $_) && ($m = $_),0),@_);
+ $m;
+}
+
+sub max
+{
+ local($m) = shift;
+
+ grep((($m < $_) && ($m = $_),0),@_);
+ $m;
+}
diff --git a/scripts/monitoring/ntptrap b/scripts/monitoring/ntptrap
new file mode 100644
index 0000000..f2abef9
--- /dev/null
+++ b/scripts/monitoring/ntptrap
@@ -0,0 +1,465 @@
+#!/local/bin/perl --*-perl-*-
+;#
+;# ntptrap,v 3.1 1993/07/06 01:09:15 jbj Exp
+;#
+;# a client for the xntp mode 6 trap mechanism
+;#
+;# Copyright (c) 1992
+;# Rainer Pruy Friedrich-Alexander Universitaet Erlangen-Nuernberg
+;#
+;#
+;#############################################################
+$0 =~ s!^.*/([^/]+)$!$1!; # strip to filename
+;# enforce STDOUT and STDERR to be line buffered
+$| = 1;
+select((select(STDERR),$|=1)[$[]);
+
+;#######################################
+;# load utility routines and definitions
+;#
+require('ntp.pl'); # implementation of the NTP protocol
+use Socket;
+
+#eval { require('sys/socket.ph'); require('netinet/in.ph') unless defined(&INADDR_ANY); } ||
+#do {
+ #die("$0: $@") unless $[ == index($@, "Can't locate ");
+ #warn "$0: $@";
+ #warn "$0: supplying some default definitions\n";
+ #eval 'sub INADDR_ANY { 0; } sub AF_INET {2;} sub SOCK_DGRAM {2;} 1;' || die "$0: $@";
+#};
+require('getopts.pl'); # option parsing
+require('ctime.pl'); # date/time formatting
+
+;######################################
+;# define some global constants
+;#
+$BASE_TIMEOUT=10;
+$FRAG_TIMEOUT=10;
+$MAX_TRY = 5;
+$REFRESH_TIME=60*15; # 15 minutes (server uses 1 hour)
+$ntp'timeout = $FRAG_TIMEOUT; #';
+$ntp'timeout if 0;
+
+;######################################
+;# now process options
+;#
+sub usage
+{
+ die("usage: $0 [-p <port>] [-l <logfile>] [host] ...\n");
+}
+
+&usage unless &Getopts('l:p:');
+&Getopts if 0; # make -w happy
+
+$opt_l = "/dev/null" # where to write debug messages to
+ if (!$opt_l);
+$opt_p = 0 # port to use locally - (0 does mean: will be chosen by kernel)
+ if (!$opt_p);
+
+@Hosts = ($#ARGV < $[) ? ("localhost") : @ARGV;
+
+;# setup for debug output
+$DEBUGFILE=$opt_l;
+$DEBUGFILE="&STDERR" if $DEBUGFILE eq '-';
+
+open(DEBUG,">>$DEBUGFILE") || die("Cannot open \"$DEBUGFILE\": $!\n");
+select((select(DEBUG),$|=1)[$[]);
+
+;# &log prints a single trap record (adding a (local) time stamp)
+sub log
+{
+ chop($date=&ctime(time));
+ print "$date ",@_,"\n";
+}
+
+sub debug
+{
+ print DEBUG @_,"\n";
+}
+;#
+$proto_udp = (getprotobyname('udp'))[$[+2] ||
+ (warn("$0: Could not get protocoll number for 'udp' using 17"), 17);
+
+$ntp_port = (getservbyname('ntp','udp'))[$[+2] ||
+ (warn("$0: Could not get port number for service ntp/udp using 123"), 123);
+
+;#
+socket(S, &AF_INET, &SOCK_DGRAM, $proto_udp) || die("Cannot open socket: $!\n");
+
+;#
+bind(S, pack("S n a4 x8", &AF_INET, $opt_p, &INADDR_ANY)) ||
+ die("Cannot bind: $!\n");
+
+($my_port, $my_addr) = (unpack("S n a4 x8",getsockname(S)))[$[+1,$[+2];
+&log(sprintf("Listening at address %d.%d.%d.%d port %d",
+ unpack("C4",$my_addr), $my_port));
+
+;# disregister with all servers in case of termination
+sub cleanup
+{
+ &log("Aborted by signal \"$_[$[]\"") if defined($_[$[]);
+
+ foreach (@Hosts)
+ {
+ if ( ! defined($Host{$_}) )
+ {
+ print "no info for host '$_'\n";
+ next;
+ }
+ &ntp'send(S,31,0,"",pack("Sna4x8",&AF_INET,$ntp_port,$Host{$_})); #';
+ }
+ close(S);
+ exit(2);
+}
+
+$SIG{'HUP'} = 'cleanup';
+$SIG{'INT'} = 'cleanup';
+$SIG{'QUIT'} = 'cleanup';
+$SIG{'TERM'} = 'cleanup';
+
+0 && $a && $b;
+sub timeouts # sort timeout id array
+{
+ $TIMEOUTS{$a} <=> $TIMEOUTS{$b};
+}
+
+;# a Request element looks like: pack("a4SC",addr,associd,op)
+@Requests= ();
+
+;# compute requests for set trap control msgs to each host given
+{
+ local($name,$addr);
+
+ foreach (@Hosts)
+ {
+ if (/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/)
+ {
+ ($name,$addr) =
+ (gethostbyaddr(pack("C4",$1,$2,$3,$4),&AF_INET))[$[,$[+4];
+ unless (defined($name))
+ {
+ $name = sprintf("[[%d.%d.%d.%d]]",$1,$2,$3,$4);
+ $addr = pack("C4",$1,$2,$3,$4);
+ }
+ }
+ else
+ {
+ ($name,$addr) = (gethostbyname($_))[$[,$[+4];
+ unless (defined($name))
+ {
+ warn "$0: unknown host \"$_\" - ignored\n";
+ next;
+ }
+ }
+ next if defined($Host{$name});
+ $Host{$name} = $addr;
+ $Host{$_} = $addr;
+ push(@Requests,pack("a4SC",$addr,0,6)); # schedule a set trap request for $name
+ }
+}
+
+sub hostname
+{
+ local($addr) = @_;
+ return $HostName{$addr} if defined($HostName{$addr});
+ local($name) = gethostbyaddr($addr,&AF_INET);
+ &debug(sprintf("hostname(%d.%d.%d.%d) = \"%s\"",unpack("C4",$addr),$name))
+ if defined($name);
+ defined($name) && ($HostName{$addr} = $name) && (return $name);
+ &debug(sprintf("Failed to get name for %d.%d.%d.%d",unpack("C4",$addr)));
+ return sprintf("[%d.%d.%d.%d]",unpack("C4",$addr));
+}
+
+;# when no hosts were given on the commandline no requests have been scheduled
+&usage unless (@Requests);
+
+&debug(sprintf("%d request(s) scheduled",scalar(@Requests)));
+grep(&debug(" - ".$_),keys(%Host));
+
+;# allocate variables;
+$addr="";
+$assoc=0;
+$op = 0;
+$timeout = 0;
+$ret="";
+%TIMEOUTS = ();
+%TIMEOUT_PROCS = ();
+@TIMEOUTS = ();
+
+$len = 512;
+$buf = " " x $len;
+
+while (1)
+{
+ if (@Requests || @TIMEOUTS) # if there is some work pending
+ {
+ if (@Requests)
+ {
+ ($addr,$assoc,$op) = unpack("a4SC",($req = shift(@Requests)));
+ &debug(sprintf("Request: %s: %s(%d)",&hostname($addr), &ntp'cntrlop_name($op), $assoc)); #';))
+ $ret = &ntp'send(S,$op,$assoc,"", #'(
+ pack("Sna4x8",&AF_INET,$ntp_port,$addr));
+ &set_timeout("retry-".unpack("H*",$req),time+$BASE_TIMEOUT,
+ sprintf("&retry(\"%s\");",unpack("H*",$req)));
+
+ last unless (defined($ret)); # warn called by ntp'send();
+
+ ;# if there are more requests just have a quick look for new messages
+ ;# otherwise grant server time for a response
+ $timeout = @Requests ? 0 : $BASE_TIMEOUT;
+ }
+ if ($timeout && @TIMEOUTS)
+ {
+ ;# ensure not to miss a timeout
+ if ($timeout + time > $TIMEOUTS{$TIMEOUTS[$[]})
+ {
+ $timeout = $TIMEOUTS{$TIMEOUTS[$[]} - time;
+ $timeout = 0 if $timeout < 0;
+ }
+ }
+ }
+ else
+ {
+ ;# no work yet - wait for some messages dropping in
+ ;# usually this will not hapen as the refresh semantic will
+ ;# always have a pending timeout
+ undef($timeout);
+ }
+
+ vec($mask="",fileno(S),1) = 1;
+ $ret = select($mask,undef,undef,$timeout);
+
+ warn("$0: select: $!\n"),last if $ret < 0; # give up on error return from select
+
+ if ($ret == 0)
+ {
+ ;# timeout
+ if (@TIMEOUTS && time > $TIMEOUTS{$TIMEOUTS[$[]})
+ {
+ ;# handle timeout
+ $timeout_proc =
+ (delete $TIMEOUT_PROCS{$TIMEOUTS[$[]},
+ delete $TIMEOUTS{shift(@TIMEOUTS)})[$[];
+ eval $timeout_proc;
+ die "timeout eval (\"$timeout_proc\"): $@\n" if $@;
+ }
+ ;# else: there may be something to be sent
+ }
+ else
+ {
+ ;# data avail
+ $from = recv(S,$buf,$len,0);
+ ;# give up on error return from recv
+ warn("$0: recv: $!\n"), last unless (defined($from));
+
+ $from = (unpack("Sna4",$from))[$[+2]; # keep host addr only
+ ;# could check for ntp_port - but who cares
+ &debug("-Packet from ",&hostname($from));
+
+ ;# stuff packet into ntp mode 6 receive machinery
+ ($ret,$data,$status,$associd,$op,$seq,$auth_keyid) =
+ &ntp'handle_packet($buf,$from); # ';
+ &debug(sprintf("%s uses auth_keyid %d",&hostname($from),$auth_keyid)) if defined($auth_keyid);
+ next unless defined($ret);
+
+ if ($ret eq "")
+ {
+ ;# handle packet
+ ;# simple trap response messages have neither timeout nor retries
+ &clear_timeout("retry-".unpack("H*",pack("a4SC",$from,$associd,$op))) unless $op == 7;
+ delete $RETRY{pack("a4SC",$from,$associd,$op)} unless $op == 7;
+
+ &process_response($from,$ret,$data,$status,$associd,$op,$seq,$auth_keyid);
+ }
+ else
+ {
+ ;# some kind of error
+ &log(sprintf("%50s: %s: %s",(gethostbyaddr($from,&AF_INET))[$[],$ret,$data));
+ if ($ret ne "TIMEOUT" && $ret ne "ERROR")
+ {
+ &clear_timeout("retry-".unpack("H*",pack("a4SC",$from,$associd,$op)));
+ }
+ }
+ }
+
+}
+
+warn("$0: terminating\n");
+&cleanup;
+exit 0;
+
+;##################################################
+;# timeout support
+;#
+sub set_timeout
+{
+ local($id,$time,$proc) = @_;
+
+ $TIMEOUTS{$id} = $time;
+ $TIMEOUT_PROCS{$id} = $proc;
+ @TIMEOUTS = sort timeouts keys(%TIMEOUTS);
+ chop($date=&ctime($time));
+ &debug(sprintf("Schedule timeout \"%s\" for %s", $id, $date));
+}
+
+sub clear_timeout
+{
+ local($id) = @_;
+ delete $TIMEOUTS{$id};
+ delete $TIMEOUT_PROCS{$id};
+ @TIMEOUTS = sort timeouts keys(%TIMEOUTS);
+ &debug("Clear timeout \"$id\"");
+}
+
+0 && &refresh;
+sub refresh
+{
+ local($addr) = @_[$[];
+ $addr = pack("H*",$addr);
+ &debug(sprintf("Refreshing trap for %s", &hostname($addr)));
+ push(@Requests,pack("a4SC",$addr,0,6));
+}
+
+0 && &retry;
+sub retry
+{
+ local($tag) = @_;
+ $tag = pack("H*",$tag);
+ $RETRY{$tag} = 0 if (!defined($RETRY{$tag}));
+
+ if (++$RETRY{$tag} > $MAX_TRY)
+ {
+ &debug(sprintf("Retry failed: %s assoc %5d op %d",
+ &hostname(substr($tag,$[,4)),
+ unpack("x4SC",$tag)));
+ return;
+ }
+ &debug(sprintf("Retrying: %s assoc %5d op %d",
+ &hostname(substr($tag,$[,4)),
+ unpack("x4SC",$tag)));
+ push(@Requests,$tag);
+}
+
+sub process_response
+{
+ local($from,$ret,$data,$status,$associd,$op,$seq,$auth_keyid) = @_;
+
+ $msg="";
+ if ($op == 7) # trap response
+ {
+ $msg .= sprintf("%40s trap#%-5d",
+ &hostname($from),$seq);
+ &debug (sprintf("\nTrap %d associd %d:\n%s\n===============\n",$seq,$associd,$data));
+ if ($associd == 0) # system event
+ {
+ $msg .= " SYSTEM ";
+ $evnt = &ntp'SystemEvent($status); #';
+ $msg .= "$evnt ";
+ ;# for special cases add additional info
+ ($stratum) = ($data =~ /stratum=(\d+)/);
+ ($refid) = ($data =~ /refid=([\w\.]+)/);
+ $msg .= "stratum=$stratum refid=$refid";
+ if ($refid =~ /\[?(\d+)\.(\d+)\.(\d+)\.(\d+)/)
+ {
+ local($x) = (gethostbyaddr(pack("C4",$1,$2,$3,$4),&AF_INET));
+ $msg .= " " . $x if defined($x)
+ }
+ if ($evnt eq "event_sync_chg")
+ {
+ $msg .= sprintf("%s %s ",
+ &ntp'LI($status), #',
+ &ntp'ClockSource($status) #'
+ );
+ }
+ elsif ($evnt eq "event_sync/strat_chg")
+ {
+ ($peer) = ($data =~ /peer=([0-9]+)/);
+ $msg .= " peer=$peer";
+ }
+ elsif ($evnt eq "event_clock_excptn")
+ {
+ if (($device) = ($data =~ /device=\"([^\"]+)\"/))
+ {
+ ($cstatus) = ($data =~ /refclockstatus=0?x?([\da-fA-F]+)/);
+ $Cstatus = hex($cstatus);
+ $msg .= sprintf("- %-32s",&ntp'clock_status($Cstatus)); #');
+ ($timecode) = ($data =~ /timecode=\"([^\"]+)\"/);
+ $msg .= " \"$device\" \"$timecode\"";
+ }
+ else
+ {
+ push(@Requests,pack("a4SC",$from, $associd, 4));
+ }
+ }
+ }
+ else # peer event
+ {
+ $msg .= sprintf("peer %5d ",$associd);
+ ($srcadr) = ($data =~ /srcadr=\[?([\d\.]+)/);
+ $msg .= sprintf("%-18s %40s ", "[$srcadr]",
+ &hostname(pack("C4",split(/\./,$srcadr))));
+ $evnt = &ntp'PeerEvent($status); #';
+ $msg .= "$evnt ";
+ ;# for special cases include additional info
+ if ($evnt eq "event_clock_excptn")
+ {
+ if (($device) = ($data =~ /device=\"([^\"]+)\"/))
+ {
+ ;#&debug("----\n$data\n====\n");
+ ($cstatus) = ($data =~ /refclockstatus=0?x?([\da-fA-F]+)/);
+ $Cstatus = hex($cstatus);
+ $msg .= sprintf("- %-32s",&ntp'clock_status($Cstatus)); #');
+ ($timecode) = ($data =~ /timecode=\"([^\"]+)\"/);
+ $msg .= " \"$device\" \"$timecode\"";
+ }
+ else
+ {
+ ;# no clockvars included - post a cv request
+ push(@Requests,pack("a4SC",$from, $associd, 4));
+ }
+ }
+ elsif ($evnt eq "event_stratum_chg")
+ {
+ ($stratum) = ($data =~ /stratum=(\d+)/);
+ $msg .= "new stratum $stratum";
+ }
+ }
+ }
+ elsif ($op == 6) # set trap resonse
+ {
+ &debug("Set trap ok from ",&hostname($from));
+ &set_timeout("refresh-".unpack("H*",$from),time+$REFRESH_TIME,
+ sprintf("&refresh(\"%s\");",unpack("H*",$from)));
+ return;
+ }
+ elsif ($op == 4) # read clock variables response
+ {
+ ;# status of clock
+ $msg .= sprintf(" %40s ", &hostname($from));
+ if ($associd == 0)
+ {
+ $msg .= "system clock status: ";
+ }
+ else
+ {
+ $msg .= sprintf("peer %5d clock",$associd);
+ }
+ $msg .= sprintf("%-32s",&ntp'clock_status($status)); #');
+ ($device) = ($data =~ /device=\"([^\"]+)\"/);
+ ($timecode) = ($data =~ /timecode=\"([^\"]+)\"/);
+ $msg .= " \"$device\" \"$timecode\"";
+ }
+ elsif ($op == 31) # unset trap response (UNOFFICIAL op)
+ {
+ ;# clear timeout
+ &debug("Clear Trap ok from ",&hostname($from));
+ &clear_timeout("refresh-".unpack("H*",$from));
+ return;
+ }
+ else # unexpected response
+ {
+ $msg .= "unexpected response to op $op assoc=$associd";
+ $msg .= sprintf(" status=%04x",$status);
+ }
+ &log($msg);
+}
diff --git a/scripts/monitoring/timelocal.pl b/scripts/monitoring/timelocal.pl
new file mode 100644
index 0000000..d0f73a2
--- /dev/null
+++ b/scripts/monitoring/timelocal.pl
@@ -0,0 +1,77 @@
+;# timelocal.pl
+;#
+;# Usage:
+;# $time = timelocal($sec,$min,$hours,$mday,$mon,$year,$junk,$junk,$isdst);
+;# $time = timegm($sec,$min,$hours,$mday,$mon,$year);
+
+;# These routines are quite efficient and yet are always guaranteed to agree
+;# with localtime() and gmtime(). We manage this by caching the start times
+;# of any months we've seen before. If we know the start time of the month,
+;# we can always calculate any time within the month. The start times
+;# themselves are guessed by successive approximation starting at the
+;# current time, since most dates seen in practice are close to the
+;# current date. Unlike algorithms that do a binary search (calling gmtime
+;# once for each bit of the time value, resulting in 32 calls), this algorithm
+;# calls it at most 6 times, and usually only once or twice. If you hit
+;# the month cache, of course, it doesn't call it at all.
+
+;# timelocal is implemented using the same cache. We just assume that we're
+;# translating a GMT time, and then fudge it when we're done for the timezone
+;# and daylight savings arguments. The timezone is determined by examining
+;# the result of localtime(0) when the package is initialized. The daylight
+;# savings offset is currently assumed to be one hour.
+
+CONFIG: {
+ package timelocal;
+
+ @epoch = localtime(0);
+ $tzmin = $epoch[2] * 60 + $epoch[1]; # minutes east of GMT
+ if ($tzmin > 0) {
+ $tzmin = 24 * 60 - $tzmin; # minutes west of GMT
+ $tzmin -= 24 * 60 if $epoch[5] == 70; # account for the date line
+ }
+
+ $SEC = 1;
+ $MIN = 60 * $SEC;
+ $HR = 60 * $MIN;
+ $DAYS = 24 * $HR;
+ $YearFix = ((gmtime(946684800))[5] == 100) ? 100 : 0;
+}
+
+sub timegm {
+ package timelocal;
+
+ $ym = pack(C2, @_[5,4]);
+ $cheat = $cheat{$ym} || &cheat;
+ $cheat + $_[0] * $SEC + $_[1] * $MIN + $_[2] * $HR + ($_[3]-1) * $DAYS;
+}
+
+sub timelocal {
+ package timelocal;
+
+ $ym = pack(C2, @_[5,4]);
+ $cheat = $cheat{$ym} || &cheat;
+ $cheat + $_[0] * $SEC + $_[1] * $MIN + $_[2] * $HR + ($_[3]-1) * $DAYS
+ + $tzmin * $MIN - 60 * 60 * ($_[8] != 0);
+}
+
+package timelocal;
+
+sub cheat {
+ $year = $_[5];
+ $month = $_[4];
+ $guess = $^T;
+ @g = gmtime($guess);
+ $year += $YearFix if $year < $epoch[5];
+ while ($diff = $year - $g[5]) {
+ $guess += $diff * (364 * $DAYS);
+ @g = gmtime($guess);
+ }
+ while ($diff = $month - $g[4]) {
+ $guess += $diff * (28 * $DAYS);
+ @g = gmtime($guess);
+ }
+ $g[3]--;
+ $guess -= $g[0] * $SEC + $g[1] * $MIN + $g[2] * $HR + $g[3] * $DAYS;
+ $cheat{$ym} = $guess;
+}
diff --git a/scripts/ntp-wait/Makefile.am b/scripts/ntp-wait/Makefile.am
new file mode 100644
index 0000000..b819329
--- /dev/null
+++ b/scripts/ntp-wait/Makefile.am
@@ -0,0 +1,96 @@
+NULL=
+
+bin_SCRIPTS = $(NTP_WAIT_DB)
+libexec_SCRIPTS = $(NTP_WAIT_DL)
+sbin_SCRIPTS = $(NTP_WAIT_DS)
+
+man1_MANS=
+man8_MANS=
+man_MANS= ntp-wait.$(NTP_WAIT_MS)
+
+run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" PERL5LIB="$(abs_top_srcdir)/scripts/lib" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../../sntp/include -L ../../sntp/ag-tpl \
+ --writable
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+EXTRA_SCRIPTS = ntp-wait
+
+DISTCLEANFILES = config.log $(man_MANS)
+EXTRA_DIST = \
+ ntp-wait.in \
+ ntp-wait.1ntp-waitman \
+ ntp-wait.1ntp-waitmdoc \
+ ntp-wait.man.in \
+ ntp-wait.mdoc.in \
+ ntp-wait.texi \
+ ntp-wait.html \
+ ntp-wait-opts.def \
+ ntp-wait-opts \
+ invoke-ntp-wait.texi \
+ invoke-ntp-wait.menu \
+ $(NULL)
+
+html_DATA = $(srcdir)/ntp-wait.html
+
+noinst_DATA = \
+ ntp-wait.1ntp-waitman \
+ ntp-wait.1ntp-waitmdoc \
+ ntp-wait.man.in \
+ ntp-wait.mdoc.in \
+ ntp-wait.texi \
+ ntp-wait.html \
+ ntp-wait-opts.def \
+ ntp-wait-opts \
+ invoke-ntp-wait.texi \
+ invoke-ntp-wait.menu \
+ $(NULL)
+
+ntp-wait: $(srcdir)/ntp-wait-opts
+
+$(srcdir)/ntp-wait-opts: $(srcdir)/ntp-wait-opts.def $(std_def_list)
+ $(run_ag) ntp-wait-opts.def
+
+### Nroff
+
+$(srcdir)/ntp-wait.1ntp-waitman: $(srcdir)/ntp-wait-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntp-waitman -Tagman-cmd.tpl ntp-wait-opts.def
+
+$(srcdir)/ntp-wait.man.in: $(srcdir)/ntp-wait.1ntp-waitman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp-wait.1ntp-waitman > $(srcdir)/ntp-wait.man.in+
+ mv $(srcdir)/ntp-wait.man.in+ $(srcdir)/ntp-wait.man.in
+
+### Mdoc
+
+$(srcdir)/ntp-wait.1ntp-waitmdoc: $(srcdir)/ntp-wait-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntp-waitmdoc -Tagmdoc-cmd.tpl ntp-wait-opts.def
+
+$(srcdir)/ntp-wait.mdoc.in: $(srcdir)/ntp-wait.1ntp-waitmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp-wait.1ntp-waitmdoc > $(srcdir)/ntp-wait.mdoc.in+
+ mv $(srcdir)/ntp-wait.mdoc.in+ $(srcdir)/ntp-wait.mdoc.in
+
+### Manpage
+
+ntp-wait.$(NTP_WAIT_MS): $(srcdir)/ntp-wait.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntp-wait.$(NTP_WAIT_MS)+:$(srcdir)/ntp-wait.$(MANTAGFMT).in
+ mv ntp-wait.$(NTP_WAIT_MS)+ ntp-wait.$(NTP_WAIT_MS)
+
+### Texinfo
+
+$(srcdir)/invoke-ntp-wait.menu: $(srcdir)/invoke-ntp-wait.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntp-wait.texi: ntp-wait-opts $(srcdir)/ntp-wait-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntp-wait-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/ntp-wait.html: $(srcdir)/invoke-ntp-wait.menu $(srcdir)/invoke-ntp-wait.texi $(srcdir)/ntp-wait.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntp-wait.html ntp-wait.texi || true )
diff --git a/scripts/ntp-wait/Makefile.in b/scripts/ntp-wait/Makefile.in
new file mode 100644
index 0000000..bb2eae7
--- /dev/null
+++ b/scripts/ntp-wait/Makefile.in
@@ -0,0 +1,879 @@
+# Makefile.in generated by automake 1.11.1 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.
+# 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = scripts/ntp-wait
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/ntp-wait.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.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_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_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.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)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = ntp-wait
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \
+ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \
+ "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"
+SCRIPTS = $(bin_SCRIPTS) $(libexec_SCRIPTS) $(sbin_SCRIPTS)
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+man1dir = $(mandir)/man1
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(man1_MANS) $(man8_MANS) $(man_MANS)
+DATA = $(html_DATA) $(noinst_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+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@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+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_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@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+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@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+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@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+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_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+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@
+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@
+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@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+NULL =
+bin_SCRIPTS = $(NTP_WAIT_DB)
+libexec_SCRIPTS = $(NTP_WAIT_DL)
+sbin_SCRIPTS = $(NTP_WAIT_DS)
+man1_MANS =
+man8_MANS =
+man_MANS = ntp-wait.$(NTP_WAIT_MS)
+run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" PERL5LIB="$(abs_top_srcdir)/scripts/lib" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../../sntp/include -L ../../sntp/ag-tpl \
+ --writable
+
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+EXTRA_SCRIPTS = ntp-wait
+DISTCLEANFILES = config.log $(man_MANS)
+EXTRA_DIST = \
+ ntp-wait.in \
+ ntp-wait.1ntp-waitman \
+ ntp-wait.1ntp-waitmdoc \
+ ntp-wait.man.in \
+ ntp-wait.mdoc.in \
+ ntp-wait.texi \
+ ntp-wait.html \
+ ntp-wait-opts.def \
+ ntp-wait-opts \
+ invoke-ntp-wait.texi \
+ invoke-ntp-wait.menu \
+ $(NULL)
+
+html_DATA = $(srcdir)/ntp-wait.html
+noinst_DATA = \
+ ntp-wait.1ntp-waitman \
+ ntp-wait.1ntp-waitmdoc \
+ ntp-wait.man.in \
+ ntp-wait.mdoc.in \
+ ntp-wait.texi \
+ ntp-wait.html \
+ ntp-wait-opts.def \
+ ntp-wait-opts \
+ invoke-ntp-wait.texi \
+ invoke-ntp-wait.menu \
+ $(NULL)
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/ntp-wait/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign scripts/ntp-wait/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+ntp-wait: $(top_builddir)/config.status $(srcdir)/ntp-wait.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+install-libexecSCRIPTS: $(libexec_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
+ @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-libexecSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+install-sbinSCRIPTS: $(sbin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+ @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-sbinSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+install-man8: $(man8_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man8:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+install-htmlDATA: $(html_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
+ done
+
+uninstall-htmlDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(htmldir)" && rm -f $$files
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS) $(MANS) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-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
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-htmlDATA install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binSCRIPTS install-libexecSCRIPTS \
+ install-sbinSCRIPTS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1 install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binSCRIPTS uninstall-htmlDATA \
+ uninstall-libexecSCRIPTS uninstall-man uninstall-sbinSCRIPTS
+
+uninstall-man: uninstall-man1 uninstall-man8
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binSCRIPTS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-htmlDATA install-info install-info-am \
+ install-libexecSCRIPTS install-man install-man1 install-man8 \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-sbinSCRIPTS install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am uninstall uninstall-am uninstall-binSCRIPTS \
+ uninstall-htmlDATA uninstall-libexecSCRIPTS uninstall-man \
+ uninstall-man1 uninstall-man8 uninstall-sbinSCRIPTS
+
+
+ntp-wait: $(srcdir)/ntp-wait-opts
+
+$(srcdir)/ntp-wait-opts: $(srcdir)/ntp-wait-opts.def $(std_def_list)
+ $(run_ag) ntp-wait-opts.def
+
+### Nroff
+
+$(srcdir)/ntp-wait.1ntp-waitman: $(srcdir)/ntp-wait-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntp-waitman -Tagman-cmd.tpl ntp-wait-opts.def
+
+$(srcdir)/ntp-wait.man.in: $(srcdir)/ntp-wait.1ntp-waitman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp-wait.1ntp-waitman > $(srcdir)/ntp-wait.man.in+
+ mv $(srcdir)/ntp-wait.man.in+ $(srcdir)/ntp-wait.man.in
+
+### Mdoc
+
+$(srcdir)/ntp-wait.1ntp-waitmdoc: $(srcdir)/ntp-wait-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntp-waitmdoc -Tagmdoc-cmd.tpl ntp-wait-opts.def
+
+$(srcdir)/ntp-wait.mdoc.in: $(srcdir)/ntp-wait.1ntp-waitmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp-wait.1ntp-waitmdoc > $(srcdir)/ntp-wait.mdoc.in+
+ mv $(srcdir)/ntp-wait.mdoc.in+ $(srcdir)/ntp-wait.mdoc.in
+
+### Manpage
+
+ntp-wait.$(NTP_WAIT_MS): $(srcdir)/ntp-wait.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntp-wait.$(NTP_WAIT_MS)+:$(srcdir)/ntp-wait.$(MANTAGFMT).in
+ mv ntp-wait.$(NTP_WAIT_MS)+ ntp-wait.$(NTP_WAIT_MS)
+
+### Texinfo
+
+$(srcdir)/invoke-ntp-wait.menu: $(srcdir)/invoke-ntp-wait.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntp-wait.texi: ntp-wait-opts $(srcdir)/ntp-wait-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntp-wait-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/ntp-wait.html: $(srcdir)/invoke-ntp-wait.menu $(srcdir)/invoke-ntp-wait.texi $(srcdir)/ntp-wait.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntp-wait.html ntp-wait.texi || true )
+
+# 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/scripts/ntp-wait/invoke-ntp-wait.menu b/scripts/ntp-wait/invoke-ntp-wait.menu
new file mode 100644
index 0000000..bb51936
--- /dev/null
+++ b/scripts/ntp-wait/invoke-ntp-wait.menu
@@ -0,0 +1 @@
+* ntp-wait Invocation:: Invoking ntp-wait
diff --git a/scripts/ntp-wait/invoke-ntp-wait.texi b/scripts/ntp-wait/invoke-ntp-wait.texi
new file mode 100644
index 0000000..f329985
--- /dev/null
+++ b/scripts/ntp-wait/invoke-ntp-wait.texi
@@ -0,0 +1,114 @@
+@node ntp-wait Invocation
+@section Invoking ntp-wait
+@pindex ntp-wait
+@cindex Wait for ntpd to stabilize the system clock
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION (invoke-ntp-wait.texi)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:18 AM by AutoGen 5.18.5pre4
+# From the definitions ntp-wait-opts.def
+# and the template file agtexi-cmd.tpl
+@end ignore
+
+
+
+@code{ntp-wait}
+will send at most
+@kbd{num-tries}
+queries to
+@code{ntpd(8)},
+sleeping for
+@kbd{secs-between-tries}
+after each status return that says
+@code{ntpd(8)}
+has not yet produced a synchronized and stable system clock.
+
+@code{ntp-wait}
+will do this quietly, unless the
+@code{-v}
+flag is provided.
+This can be useful at boot time, to delay the boot sequence until after
+@kbd{ntpd} @kbd{-g}
+has set the time.
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{ntp-wait} program.
+
+@menu
+* ntp-wait usage:: ntp-wait help/usage (@option{--help})
+* ntp-wait tries:: tries option (-n)
+* ntp-wait sleep:: sleep option (-s)
+* ntp-wait verbose:: verbose option (-v)
+* ntp-wait exit status:: exit status
+* ntp-wait Authors:: Authors
+* ntp-wait Notes:: Notes
+@end menu
+
+@node ntp-wait usage
+@subsection ntp-wait help/usage (@option{--help})
+@cindex ntp-wait help
+
+This is the automatically generated usage text for ntp-wait.
+
+The text printed is the same whether selected with the @code{help} option
+(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function. The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}. Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.7p482
+USAGE: ntp-wait [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
+
+ -n, --tries=num Number of times to check ntpd
+ -s, --sleep=num How long to sleep between tries
+ -v, --verbose Be verbose
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+@end example
+@exampleindent 4
+
+@node ntp-wait tries
+@subsection tries option (-n)
+@cindex ntp-wait-tries
+
+This is the ``number of times to check ntpd'' option.
+This option takes a number argument.
+ The maximum number of times we will check @code{ntpd} to see if
+ it has been able to synchronize and stabilize the system clock.
+@node ntp-wait sleep
+@subsection sleep option (-s)
+@cindex ntp-wait-sleep
+
+This is the ``how long to sleep between tries'' option.
+This option takes a number argument @file{secs-between-tries}.
+ We will sleep for @file{secs-between-tries} after each query
+ of @code{ntpd} that returns "the time is not yet stable".
+@node ntp-wait verbose
+@subsection verbose option (-v)
+@cindex ntp-wait-verbose
+
+This is the ``be verbose'' option.
+ By default, @code{ntp-wait} is silent.
+ With this option, @code{ntp-wait} will provide status information.
+@node ntp-wait exit status
+@subsection ntp-wait exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@end table
+@node ntp-wait Authors
+@subsection ntp-wait Authors
+@node ntp-wait Notes
+@subsection ntp-wait Notes
diff --git a/scripts/ntp-wait/ntp-wait-opts b/scripts/ntp-wait/ntp-wait-opts
new file mode 100644
index 0000000..73be46b
--- /dev/null
+++ b/scripts/ntp-wait/ntp-wait-opts
@@ -0,0 +1,62 @@
+# EDIT THIS FILE WITH CAUTION (ntp-wait-opts)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:12 AM by AutoGen 5.18.5pre4
+# From the definitions ntp-wait-opts.def
+# and the template file perlopt
+
+use Getopt::Long qw(GetOptionsFromArray);
+Getopt::Long::Configure(qw(no_auto_abbrev no_ignore_case_always));
+
+my $usage;
+
+sub usage {
+ my ($ret) = @_;
+ print STDERR $usage;
+ exit $ret;
+}
+
+sub paged_usage {
+ my ($ret) = @_;
+ my $pager = $ENV{PAGER} || '(less || more)';
+
+ open STDOUT, "| $pager" or die "Can't fork a pager: $!";
+ print $usage;
+
+ exit $ret;
+}
+
+sub processOptions {
+ my $args = shift;
+
+ my $opts = {
+ 'tries' => '100',
+ 'sleep' => '6',
+ 'verbose' => '',
+ 'help' => '', 'more-help' => ''
+ };
+ my $argument = '';
+ my $ret = GetOptionsFromArray($args, $opts, (
+ 'tries|n=i', 'sleep|s=i', 'verbose|v',
+ 'help|?', 'more-help'));
+
+ $usage = <<'USAGE';
+ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.7p482
+USAGE: ntp-wait [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
+
+ -n, --tries=num Number of times to check ntpd
+ -s, --sleep=num How long to sleep between tries
+ -v, --verbose Be verbose
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+USAGE
+
+ usage(0) if $opts->{'help'};
+ paged_usage(0) if $opts->{'more-help'};
+ $_[0] = $opts;
+ return $ret;
+}
+
+END { close STDOUT };
diff --git a/scripts/ntp-wait/ntp-wait-opts.def b/scripts/ntp-wait/ntp-wait-opts.def
new file mode 100644
index 0000000..14eebbc
--- /dev/null
+++ b/scripts/ntp-wait/ntp-wait-opts.def
@@ -0,0 +1,109 @@
+/* -*- Mode: Text -*- */
+AutoGen Definitions perlopt;
+
+#include autogen-version.def
+
+prog-name = "ntp-wait";
+prog-title = "Wait for ntpd to stabilize the system clock";
+package = ntp;
+#include version.def
+
+long-opts;
+gnu-usage;
+
+flag = {
+ name = tries;
+ value = n;
+ arg-type = number;
+ arg-default = 100;
+ descrip = "Number of times to check ntpd";
+ doc = <<- _EndOfDoc_
+ The maximum number of times we will check @code{ntpd} to see if
+ it has been able to synchronize and stabilize the system clock.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = sleep;
+ value = s;
+ arg-type = number;
+ arg-name = "secs-between-tries";
+ arg-default = 6;
+ descrip = "How long to sleep between tries";
+ doc = <<- _EndOfDoc_
+ We will sleep for @file{secs-between-tries} after each query
+ of @code{ntpd} that returns "the time is not yet stable".
+ _EndOfDoc_;
+};
+
+flag = {
+ name = verbose;
+ value = v;
+ descrip = "Be verbose";
+ doc = <<- _EndOfDoc_
+ By default, @code{ntp-wait} is silent.
+ With this option, @code{ntp-wait} will provide status information.
+ _EndOfDoc_;
+};
+
+explain = <<- _END_EXPLAIN
+ _END_EXPLAIN;
+
+doc-section = {
+ ds-type = 'DESCRIPTION';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_PROG_MDOC_DESCRIP
+.Nm
+will send at most
+.Ar num-tries
+queries to
+.Xr ntpd 8 ,
+sleeping for
+.Ar secs-between-tries
+after each status return that says
+.Xr ntpd 8
+has not yet produced a synchronized and stable system clock.
+.Pp
+.Nm
+will do this quietly, unless the
+.Fl v
+flag is provided.
+This can be useful at boot time, to delay the boot sequence until after
+.Ar ntpd -g
+has set the time.
+ _END_PROG_MDOC_DESCRIP;
+};
+
+/*
+doc-section = {
+ ds-type = 'USAGE';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_USAGE
+ _END_MDOC_USAGE;
+};
+*/
+
+doc-section = {
+ ds-type = 'AUTHORS';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_AUTH
+.An "Harlan Stenn"
+ _END_MDOC_AUTH;
+};
+
+doc-section = {
+ ds-type = 'NOTES';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_NOTES
+This document corresponds to version @VERSION@ of NTP.
+ _END_MDOC_NOTES;
+};
+
+/*
+doc-section = {
+ ds-type = 'BUGS';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_BUGS
+ _END_MDOC_BUGS;
+};
+*/
diff --git a/scripts/ntp-wait/ntp-wait.1ntp-waitman b/scripts/ntp-wait/ntp-wait.1ntp-waitman
new file mode 100644
index 0000000..1eef06c
--- /dev/null
+++ b/scripts/ntp-wait/ntp-wait.1ntp-waitman
@@ -0,0 +1,122 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntp-wait 1ntp-waitman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-DfaOdD/ag-PfaWcD)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:14 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntp-wait-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntp-wait\fP
+\- Wait for ntpd to stabilize the system clock
+.SH SYNOPSIS
+\f\*[B-Font]ntp-wait\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+\f\*[B-Font]ntp-wait\fP
+will send at most
+\f\*[I-Font]num-tries\f[]
+queries to
+\fCntpd\fR(8)\f[],
+sleeping for
+\f\*[I-Font]secs-between-tries\f[]
+after each status return that says
+\fCntpd\fR(8)\f[]
+has not yet produced a synchronized and stable system clock.
+.sp \n(Ppu
+.ne 2
+
+\f\*[B-Font]ntp-wait\fP
+will do this quietly, unless the
+\f\*[B-Font]\-v\f[]
+flag is provided.
+This can be useful at boot time, to delay the boot sequence until after
+\f\*[I-Font]ntpd\f[] \f\*[I-Font]\-g\f[]
+has set the time.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-n\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-tries\f[]=\f\*[I-Font]number\f[]
+Number of times to check ntpd.
+This option takes an integer number as its argument.
+The default
+\f\*[I-Font]number\f[]
+for this option is:
+.ti +4
+ 100
+.sp
+ The maximum number of times we will check \fBntpd\fP to see if
+ it has been able to synchronize and stabilize the system clock.
+.TP
+.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]secs\-between\-tries\f[], \f\*[B-Font]\-\-sleep\f[]=\f\*[I-Font]secs\-between\-tries\f[]
+How long to sleep between tries.
+This option takes an integer number as its argument.
+The default
+\f\*[I-Font]secs\-between\-tries\f[]
+for this option is:
+.ti +4
+ 6
+.sp
+ We will sleep for \fIsecs-between-tries\fP after each query
+ of \fBntpd\fP that returns "the time is not yet stable".
+.TP
+.NOP \f\*[B-Font]\-v\f[], \f\*[B-Font]\-\-verbose\f[]
+Be verbose.
+.sp
+ By default, \fBntp-wait\fP is silent.
+ With this option, \fBntp-wait\fP will provide status information.
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-v\f[] [{\f\*[I-Font]v|c|n\f[] \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH AUTHORS
+.NOP "Harlan Stenn"
+.br
+.SH NOTES
+This document corresponds to version @VERSION@ of NTP.
+.sp \n(Ppu
+.ne 2
+
+This manual page was \fIAutoGen\fP-erated from the \fBntp-wait\fP
+option definitions.
diff --git a/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc b/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc
new file mode 100644
index 0000000..911452c
--- /dev/null
+++ b/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc
@@ -0,0 +1,95 @@
+.Dd December 2 2014
+.Dt NTP_WAIT 1ntp-waitmdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntp-wait-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:21 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntp-wait-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntp-wait
+.Nd Wait for ntpd to stabilize the system clock
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+.Nm
+will send at most
+.Ar num\-tries
+queries to
+.Xr ntpd 8 ,
+sleeping for
+.Ar secs\-between\-tries
+after each status return that says
+.Xr ntpd 8
+has not yet produced a synchronized and stable system clock.
+.Pp
+.Nm
+will do this quietly, unless the
+.Fl v
+flag is provided.
+This can be useful at boot time, to delay the boot sequence until after
+.Ar ntpd \-g
+has set the time.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl n Ar number , Fl \-tries Ns = Ns Ar number
+Number of times to check ntpd.
+This option takes an integer number as its argument.
+The default
+.Ar number
+for this option is:
+.ti +4
+ 100
+.sp
+ The maximum number of times we will check \fBntpd\fP to see if
+ it has been able to synchronize and stabilize the system clock.
+.It Fl s Ar secs\-between\-tries , Fl \-sleep Ns = Ns Ar secs\-between\-tries
+How long to sleep between tries.
+This option takes an integer number as its argument.
+The default
+.Ar secs\-between\-tries
+for this option is:
+.ti +4
+ 6
+.sp
+ We will sleep for \fIsecs\-between\-tries\fP after each query
+ of \fBntpd\fP that returns "the time is not yet stable".
+.It Fl v , Fl \-verbose
+Be verbose.
+.sp
+ By default, \fBntp\-wait\fP is silent.
+ With this option, \fBntp\-wait\fP will provide status information.
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl v Op Brq Ar v|c|n Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh AUTHORS
+.An "Harlan Stenn"
+.Sh NOTES
+This document corresponds to version @VERSION@ of NTP.
+.Pp
+This manual page was \fIAutoGen\fP\-erated from the \fBntp\-wait\fP
+option definitions.
diff --git a/scripts/ntp-wait/ntp-wait.html b/scripts/ntp-wait/ntp-wait.html
new file mode 100644
index 0000000..a0cc721
--- /dev/null
+++ b/scripts/ntp-wait/ntp-wait.html
@@ -0,0 +1,208 @@
+<html lang="en">
+<head>
+<title>Ntp-wait User's Manual</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="Ntp-wait User's Manual">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+ span.sc { font-variant:small-caps }
+ span.roman { font-family: serif; font-weight: normal; }
+--></style>
+</head>
+<body>
+<h1 class="settitle">Ntp-wait User's Manual</h1>
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-Description">ntp-wait Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+ <p>This document describes the use of the NTP Project's <code>ntp-wait</code> program.
+
+ <p>If there are time-sensitive applications,
+the proper sequence of events is to
+run <code>ntpd -g</code> as early as possible,
+then invoke all of the non-time-sensitive process,
+run <code>ntp-wait</code> to block
+until the system's time has stabilized and synchronized,
+and only then start any applicaitons (like database servers) that require
+accurate and stable time.
+
+ <p>This document applies to version 4.2.7p482 of <code>ntp-wait</code>.
+
+<div class="shortcontents">
+<h2>Short Contents</h2>
+<ul>
+</ul>
+</div>
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntp_002dwait-Description">ntp-wait Description</a>: Description
+<li><a accesskey="2" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>: Invoking ntp-wait
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntp_002dwait-Invocation"></a>
+<br>
+</div>
+
+<h3 class="section">0.1 Invoking ntp-wait</h3>
+
+<p><a name="index-ntp_002dwait-1"></a><a name="index-Wait-for-ntpd-to-stabilize-the-system-clock-2"></a>
+
+ <p><code>ntp-wait</code>
+will send at most
+<kbd>num-tries</kbd>
+queries to
+<code>ntpd(8)</code>,
+sleeping for
+<kbd>secs-between-tries</kbd>
+after each status return that says
+<code>ntpd(8)</code>
+has not yet produced a synchronized and stable system clock.
+
+ <p><code>ntp-wait</code>
+will do this quietly, unless the
+<code>-v</code>
+flag is provided.
+This can be useful at boot time, to delay the boot sequence until after
+<kbd>ntpd</kbd> <kbd>-g</kbd>
+has set the time.
+
+ <p>This section was generated by <strong>AutoGen</strong>,
+using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntp-wait</code> program.
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntp_002dwait-usage">ntp-wait usage</a>: ntp-wait help/usage (<span class="option">--help</span>)
+<li><a accesskey="2" href="#ntp_002dwait-tries">ntp-wait tries</a>: tries option (-n)
+<li><a accesskey="3" href="#ntp_002dwait-sleep">ntp-wait sleep</a>: sleep option (-s)
+<li><a accesskey="4" href="#ntp_002dwait-verbose">ntp-wait verbose</a>: verbose option (-v)
+<li><a accesskey="5" href="#ntp_002dwait-exit-status">ntp-wait exit status</a>: exit status
+<li><a accesskey="6" href="#ntp_002dwait-Authors">ntp-wait Authors</a>: Authors
+<li><a accesskey="7" href="#ntp_002dwait-Notes">ntp-wait Notes</a>: Notes
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntp_002dwait-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-tries">ntp-wait tries</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.1 ntp-wait help/usage (<span class="option">--help</span>)</h4>
+
+<p><a name="index-ntp_002dwait-help-3"></a>
+This is the automatically generated usage text for ntp-wait.
+
+ <p>The text printed is the same whether selected with the <code>help</code> option
+(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
+the usage text by passing it through a pager program.
+<code>more-help</code> is disabled on platforms without a working
+<code>fork(2)</code> function. The <code>PAGER</code> environment variable is
+used to select the program, defaulting to <span class="file">more</span>. Both will exit
+with a status code of 0.
+
+<pre class="example">ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.7p482
+USAGE: ntp-wait [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
+
+ -n, --tries=num Number of times to check ntpd
+ -s, --sleep=num How long to sleep between tries
+ -v, --verbose Be verbose
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+</pre>
+ <div class="node">
+<p><hr>
+<a name="ntp_002dwait-tries"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-sleep">ntp-wait sleep</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dwait-usage">ntp-wait usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.2 tries option (-n)</h4>
+
+<p><a name="index-ntp_002dwait_002dtries-4"></a>
+This is the &ldquo;number of times to check ntpd&rdquo; option.
+This option takes a number argument.
+ The maximum number of times we will check <code>ntpd</code> to see if
+ it has been able to synchronize and stabilize the system clock.
+<div class="node">
+<p><hr>
+<a name="ntp_002dwait-sleep"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-verbose">ntp-wait verbose</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dwait-tries">ntp-wait tries</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.3 sleep option (-s)</h4>
+
+<p><a name="index-ntp_002dwait_002dsleep-5"></a>
+This is the &ldquo;how long to sleep between tries&rdquo; option.
+This option takes a number argument <span class="file">secs-between-tries</span>.
+ We will sleep for <span class="file">secs-between-tries</span> after each query
+ of <code>ntpd</code> that returns "the time is not yet stable".
+<div class="node">
+<p><hr>
+<a name="ntp_002dwait-verbose"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-exit-status">ntp-wait exit status</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dwait-sleep">ntp-wait sleep</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.4 verbose option (-v)</h4>
+
+<p><a name="index-ntp_002dwait_002dverbose-6"></a>
+This is the &ldquo;be verbose&rdquo; option.
+ By default, <code>ntp-wait</code> is silent.
+ With this option, <code>ntp-wait</code> will provide status information.
+<div class="node">
+<p><hr>
+<a name="ntp_002dwait-exit-status"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-Authors">ntp-wait Authors</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dwait-verbose">ntp-wait verbose</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.5 ntp-wait exit status</h4>
+
+<p>One of the following exit values will be returned:
+ <dl>
+<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
+<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
+</dl>
+ <div class="node">
+<p><hr>
+<a name="ntp_002dwait-Authors"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-Notes">ntp-wait Notes</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dwait-exit-status">ntp-wait exit status</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.6 ntp-wait Authors</h4>
+
+<div class="node">
+<p><hr>
+<a name="ntp_002dwait-Notes"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dwait-Authors">ntp-wait Authors</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.7 ntp-wait Notes</h4>
+
+</body></html>
+
diff --git a/scripts/ntp-wait/ntp-wait.in b/scripts/ntp-wait/ntp-wait.in
new file mode 100644
index 0000000..b35828a
--- /dev/null
+++ b/scripts/ntp-wait/ntp-wait.in
@@ -0,0 +1,66 @@
+#! @PATH_PERL@
+
+package ntp_wait;
+use 5.006_000;
+use strict;
+use warnings;
+use lib "@PERLLIBDIR@";
+use NTP::Util qw(ntp_read_vars);
+
+exit run(@ARGV) unless caller;
+
+sub run {
+ my $opts;
+ if (!processOptions(\@_, $opts)) {
+ usage(1);
+ };
+
+ my $tries = $opts->{tries}; # How many tries before we give up? (10 min+)
+ my $sleep = $opts->{sleep}; # Seconds to sleep between tries (6s = 10/min)
+ my $verbose = $opts->{verbose}; # Be verbose?
+
+ # Autoflush stdout
+ $| = 1;
+
+ print "Waiting for ntpd to synchronize... " if $verbose;
+
+ for my $i (1 .. $tries) {
+ my $info = ntp_read_vars(0, []);
+
+ if (!defined $info) {
+ print "\bntpd is not running!\n" if $verbose;
+ return 1;
+ }
+
+ if (!exists $info->{status_line}{leap}) {
+ print "\bLeap status not avalaible\n";
+ return 1;
+ }
+
+ my $leap = $info->{status_line}{leap};
+ my $sync = $info->{status_line}{sync};
+
+ if ($leap =~ /(sync|leap)_alarm/) {
+ print "\b".(substr "*+:.", $i % 4, 1) if $verbose;
+ sleep $sleep if $i < $tries;
+ next;
+ }
+
+ if ($leap =~ /leap_(none|((add|del)_sec))/) {
+ # We could check $sync here to make sure we like the source...
+ print "\bOK!\n" if $verbose;
+ return 0;
+ }
+
+ print "\bUnexpected 'leap' status <$leap>\n";
+ return 1;
+ }
+
+ print "\bNo!\nntpd did not synchronize.\n" if $verbose;
+ return 1;
+}
+
+@ntp_wait_opts@
+
+1;
+__END__
diff --git a/scripts/ntp-wait/ntp-wait.man.in b/scripts/ntp-wait/ntp-wait.man.in
new file mode 100644
index 0000000..971e7f2
--- /dev/null
+++ b/scripts/ntp-wait/ntp-wait.man.in
@@ -0,0 +1,122 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntp-wait @NTP_WAIT_MS@ "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-DfaOdD/ag-PfaWcD)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:14 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntp-wait-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntp-wait\fP
+\- Wait for ntpd to stabilize the system clock
+.SH SYNOPSIS
+\f\*[B-Font]ntp-wait\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+\f\*[B-Font]ntp-wait\fP
+will send at most
+\f\*[I-Font]num-tries\f[]
+queries to
+\fCntpd\fR(8)\f[],
+sleeping for
+\f\*[I-Font]secs-between-tries\f[]
+after each status return that says
+\fCntpd\fR(8)\f[]
+has not yet produced a synchronized and stable system clock.
+.sp \n(Ppu
+.ne 2
+
+\f\*[B-Font]ntp-wait\fP
+will do this quietly, unless the
+\f\*[B-Font]\-v\f[]
+flag is provided.
+This can be useful at boot time, to delay the boot sequence until after
+\f\*[I-Font]ntpd\f[] \f\*[I-Font]\-g\f[]
+has set the time.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-n\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-tries\f[]=\f\*[I-Font]number\f[]
+Number of times to check ntpd.
+This option takes an integer number as its argument.
+The default
+\f\*[I-Font]number\f[]
+for this option is:
+.ti +4
+ 100
+.sp
+ The maximum number of times we will check \fBntpd\fP to see if
+ it has been able to synchronize and stabilize the system clock.
+.TP
+.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]secs\-between\-tries\f[], \f\*[B-Font]\-\-sleep\f[]=\f\*[I-Font]secs\-between\-tries\f[]
+How long to sleep between tries.
+This option takes an integer number as its argument.
+The default
+\f\*[I-Font]secs\-between\-tries\f[]
+for this option is:
+.ti +4
+ 6
+.sp
+ We will sleep for \fIsecs-between-tries\fP after each query
+ of \fBntpd\fP that returns "the time is not yet stable".
+.TP
+.NOP \f\*[B-Font]\-v\f[], \f\*[B-Font]\-\-verbose\f[]
+Be verbose.
+.sp
+ By default, \fBntp-wait\fP is silent.
+ With this option, \fBntp-wait\fP will provide status information.
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-v\f[] [{\f\*[I-Font]v|c|n\f[] \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH AUTHORS
+.NOP "Harlan Stenn"
+.br
+.SH NOTES
+This document corresponds to version @VERSION@ of NTP.
+.sp \n(Ppu
+.ne 2
+
+This manual page was \fIAutoGen\fP-erated from the \fBntp-wait\fP
+option definitions.
diff --git a/scripts/ntp-wait/ntp-wait.mdoc.in b/scripts/ntp-wait/ntp-wait.mdoc.in
new file mode 100644
index 0000000..23afeb7
--- /dev/null
+++ b/scripts/ntp-wait/ntp-wait.mdoc.in
@@ -0,0 +1,95 @@
+.Dd December 2 2014
+.Dt NTP_WAIT @NTP_WAIT_MS@ User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntp-wait-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:21 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntp-wait-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntp-wait
+.Nd Wait for ntpd to stabilize the system clock
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+.Nm
+will send at most
+.Ar num\-tries
+queries to
+.Xr ntpd 8 ,
+sleeping for
+.Ar secs\-between\-tries
+after each status return that says
+.Xr ntpd 8
+has not yet produced a synchronized and stable system clock.
+.Pp
+.Nm
+will do this quietly, unless the
+.Fl v
+flag is provided.
+This can be useful at boot time, to delay the boot sequence until after
+.Ar ntpd \-g
+has set the time.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl n Ar number , Fl \-tries Ns = Ns Ar number
+Number of times to check ntpd.
+This option takes an integer number as its argument.
+The default
+.Ar number
+for this option is:
+.ti +4
+ 100
+.sp
+ The maximum number of times we will check \fBntpd\fP to see if
+ it has been able to synchronize and stabilize the system clock.
+.It Fl s Ar secs\-between\-tries , Fl \-sleep Ns = Ns Ar secs\-between\-tries
+How long to sleep between tries.
+This option takes an integer number as its argument.
+The default
+.Ar secs\-between\-tries
+for this option is:
+.ti +4
+ 6
+.sp
+ We will sleep for \fIsecs\-between\-tries\fP after each query
+ of \fBntpd\fP that returns "the time is not yet stable".
+.It Fl v , Fl \-verbose
+Be verbose.
+.sp
+ By default, \fBntp\-wait\fP is silent.
+ With this option, \fBntp\-wait\fP will provide status information.
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl v Op Brq Ar v|c|n Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh AUTHORS
+.An "Harlan Stenn"
+.Sh NOTES
+This document corresponds to version @VERSION@ of NTP.
+.Pp
+This manual page was \fIAutoGen\fP\-erated from the \fBntp\-wait\fP
+option definitions.
diff --git a/scripts/ntp-wait/ntp-wait.texi b/scripts/ntp-wait/ntp-wait.texi
new file mode 100644
index 0000000..208639b
--- /dev/null
+++ b/scripts/ntp-wait/ntp-wait.texi
@@ -0,0 +1,52 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename ntp-wait.info
+@settitle Ntp-wait User's Manual
+@include ../../sntp/include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of @code{ntp-wait},
+a program from
+the NTP Project,
+that is used to wait until @code{ntpd} has been able to
+synchronize and stabilize the time on the current host.
+@end ifinfo
+
+@direntry
+* ntp-wait: (ntp-wait). Wait for ntpd to synchronize and stabilize the system clock.
+@end direntry
+
+@titlepage
+@title ntp-wait User's Manual
+@subtitle ntp-wait, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@c @page
+@c @vskip 0pt plus 1filll
+
+@node Top, ntp-wait Description, (dir), (dir)
+
+This document describes the use of the NTP Project's @code{ntp-wait} program.
+
+If there are time-sensitive applications,
+the proper sequence of events is to
+run @code{ntpd -g} as early as possible,
+then invoke all of the non-time-sensitive process,
+run @code{ntp-wait} to block
+until the system's time has stabilized and synchronized,
+and only then start any applicaitons (like database servers) that require
+accurate and stable time.
+
+This document applies to version @value{VERSION} of @code{ntp-wait}.
+
+@shortcontents
+
+@menu
+* ntp-wait Description:: Description
+* ntp-wait Invocation:: Invoking ntp-wait
+@end menu
+
+@include invoke-ntp-wait.texi
diff --git a/scripts/ntpsweep/Makefile.am b/scripts/ntpsweep/Makefile.am
new file mode 100644
index 0000000..7ecc23b
--- /dev/null
+++ b/scripts/ntpsweep/Makefile.am
@@ -0,0 +1,102 @@
+NULL=
+run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" PERL5LIB="$(abs_top_srcdir)/scripts/lib" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../../sntp/include -L ../../sntp/ag-tpl \
+ --writable
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+bin_SCRIPTS= $(NTPSWEEP_DB)
+sbin_SCRIPTS= $(NTPSWEEP_DS)
+libexec_SCRIPTS= $(NTPSWEEP_DL)
+noinst_SCRIPTS= $(NTPSWEEP_NI)
+EXTRA_SCRIPTS= ntpsweep
+
+man1_MANS=
+man8_MANS=
+if INSTALL_NTPSWEEP
+man_MANS= ntpsweep.$(NTPSWEEP_MS)
+else
+noinst_MANS= ntpsweep.$(NTPSWEEP_MS)
+endif
+
+EXTRA_DIST = \
+ ntpsweep.in \
+ ntpsweep.1ntpsweepman \
+ ntpsweep.1ntpsweepmdoc \
+ ntpsweep.man.in \
+ ntpsweep.mdoc.in \
+ ntpsweep.texi \
+ ntpsweep.html \
+ ntpsweep-opts.def \
+ ntpsweep-opts \
+ invoke-ntpsweep.texi \
+ invoke-ntpsweep.menu \
+ $(NULL)
+
+html_DATA = ntpsweep.html
+
+CLEANFILES = ntpsweep.1
+DISTCLEANFILES = config.log $(man_MANS) $(noinst_MANS)
+
+noinst_DATA = \
+ ntpsweep.1 \
+ ntpsweep.1ntpsweepman \
+ ntpsweep.1ntpsweepmdoc \
+ ntpsweep.man.in \
+ ntpsweep.mdoc.in \
+ ntpsweep.texi \
+ ntpsweep.html \
+ ntpsweep-opts.def \
+ ntpsweep-opts \
+ invoke-ntpsweep.texi \
+ invoke-ntpsweep.menu \
+ $(NULL)
+
+ntpsweep: $(srcdir)/ntpsweep-opts
+
+$(srcdir)/ntpsweep-opts: ntpsweep-opts.def $(std_def_list)
+ $(run_ag) ntpsweep-opts.def
+
+### Nroff
+
+$(srcdir)/ntpsweep.1ntpsweepman: ntpsweep-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpsweepman -Tagman-cmd.tpl ntpsweep-opts.def
+
+$(srcdir)/ntpsweep.man.in: ntpsweep.1ntpsweepman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsweep.1ntpsweepman > $(srcdir)/ntpsweep.man.in+
+ mv $(srcdir)/ntpsweep.man.in+ $(srcdir)/ntpsweep.man.in
+
+### Mdoc
+
+$(srcdir)/ntpsweep.1ntpsweepmdoc: ntpsweep-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpsweepmdoc -Tagmdoc-cmd.tpl ntpsweep-opts.def
+
+$(srcdir)/ntpsweep.mdoc.in: ntpsweep.1ntpsweepmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsweep.1ntpsweepmdoc > $(srcdir)/ntpsweep.mdoc.in+
+ mv $(srcdir)/ntpsweep.mdoc.in+ $(srcdir)/ntpsweep.mdoc.in
+
+### Manpage
+
+ntpsweep.1: ntpsweep.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntpsweep.1+:$(srcdir)/ntpsweep.$(MANTAGFMT).in
+ mv ntpsweep.1+ ntpsweep.1
+
+### Texinfo
+
+$(srcdir)/invoke-ntpsweep.menu: invoke-ntpsweep.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntpsweep.texi: ntpsweep-opts ntpsweep-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpsweep-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/ntpsweep.html: invoke-ntpsweep.menu invoke-ntpsweep.texi ntpsweep.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntpsweep.html ntpsweep.texi || true )
diff --git a/scripts/ntpsweep/Makefile.in b/scripts/ntpsweep/Makefile.in
new file mode 100644
index 0000000..f264ada
--- /dev/null
+++ b/scripts/ntpsweep/Makefile.in
@@ -0,0 +1,885 @@
+# Makefile.in generated by automake 1.11.1 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.
+# 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = scripts/ntpsweep
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/ntpsweep.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.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_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_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.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)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = ntpsweep
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \
+ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \
+ "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"
+SCRIPTS = $(bin_SCRIPTS) $(libexec_SCRIPTS) $(noinst_SCRIPTS) \
+ $(sbin_SCRIPTS)
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+man1dir = $(mandir)/man1
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(man1_MANS) $(man8_MANS) $(man_MANS)
+DATA = $(html_DATA) $(noinst_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+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@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+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_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@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+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@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+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@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+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_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+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@
+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@
+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@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+NULL =
+run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" PERL5LIB="$(abs_top_srcdir)/scripts/lib" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../../sntp/include -L ../../sntp/ag-tpl \
+ --writable
+
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+bin_SCRIPTS = $(NTPSWEEP_DB)
+sbin_SCRIPTS = $(NTPSWEEP_DS)
+libexec_SCRIPTS = $(NTPSWEEP_DL)
+noinst_SCRIPTS = $(NTPSWEEP_NI)
+EXTRA_SCRIPTS = ntpsweep
+man1_MANS =
+man8_MANS =
+@INSTALL_NTPSWEEP_TRUE@man_MANS = ntpsweep.$(NTPSWEEP_MS)
+@INSTALL_NTPSWEEP_FALSE@noinst_MANS = ntpsweep.$(NTPSWEEP_MS)
+EXTRA_DIST = \
+ ntpsweep.in \
+ ntpsweep.1ntpsweepman \
+ ntpsweep.1ntpsweepmdoc \
+ ntpsweep.man.in \
+ ntpsweep.mdoc.in \
+ ntpsweep.texi \
+ ntpsweep.html \
+ ntpsweep-opts.def \
+ ntpsweep-opts \
+ invoke-ntpsweep.texi \
+ invoke-ntpsweep.menu \
+ $(NULL)
+
+html_DATA = ntpsweep.html
+CLEANFILES = ntpsweep.1
+DISTCLEANFILES = config.log $(man_MANS) $(noinst_MANS)
+noinst_DATA = \
+ ntpsweep.1 \
+ ntpsweep.1ntpsweepman \
+ ntpsweep.1ntpsweepmdoc \
+ ntpsweep.man.in \
+ ntpsweep.mdoc.in \
+ ntpsweep.texi \
+ ntpsweep.html \
+ ntpsweep-opts.def \
+ ntpsweep-opts \
+ invoke-ntpsweep.texi \
+ invoke-ntpsweep.menu \
+ $(NULL)
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/ntpsweep/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign scripts/ntpsweep/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+ntpsweep: $(top_builddir)/config.status $(srcdir)/ntpsweep.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+install-libexecSCRIPTS: $(libexec_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
+ @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-libexecSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+install-sbinSCRIPTS: $(sbin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+ @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-sbinSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+install-man8: $(man8_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man8:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+install-htmlDATA: $(html_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
+ done
+
+uninstall-htmlDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(htmldir)" && rm -f $$files
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS) $(MANS) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-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
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-htmlDATA install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binSCRIPTS install-libexecSCRIPTS \
+ install-sbinSCRIPTS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1 install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binSCRIPTS uninstall-htmlDATA \
+ uninstall-libexecSCRIPTS uninstall-man uninstall-sbinSCRIPTS
+
+uninstall-man: uninstall-man1 uninstall-man8
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binSCRIPTS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-htmlDATA install-info install-info-am \
+ install-libexecSCRIPTS install-man install-man1 install-man8 \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-sbinSCRIPTS install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am uninstall uninstall-am uninstall-binSCRIPTS \
+ uninstall-htmlDATA uninstall-libexecSCRIPTS uninstall-man \
+ uninstall-man1 uninstall-man8 uninstall-sbinSCRIPTS
+
+
+ntpsweep: $(srcdir)/ntpsweep-opts
+
+$(srcdir)/ntpsweep-opts: ntpsweep-opts.def $(std_def_list)
+ $(run_ag) ntpsweep-opts.def
+
+### Nroff
+
+$(srcdir)/ntpsweep.1ntpsweepman: ntpsweep-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpsweepman -Tagman-cmd.tpl ntpsweep-opts.def
+
+$(srcdir)/ntpsweep.man.in: ntpsweep.1ntpsweepman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsweep.1ntpsweepman > $(srcdir)/ntpsweep.man.in+
+ mv $(srcdir)/ntpsweep.man.in+ $(srcdir)/ntpsweep.man.in
+
+### Mdoc
+
+$(srcdir)/ntpsweep.1ntpsweepmdoc: ntpsweep-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpsweepmdoc -Tagmdoc-cmd.tpl ntpsweep-opts.def
+
+$(srcdir)/ntpsweep.mdoc.in: ntpsweep.1ntpsweepmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsweep.1ntpsweepmdoc > $(srcdir)/ntpsweep.mdoc.in+
+ mv $(srcdir)/ntpsweep.mdoc.in+ $(srcdir)/ntpsweep.mdoc.in
+
+### Manpage
+
+ntpsweep.1: ntpsweep.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntpsweep.1+:$(srcdir)/ntpsweep.$(MANTAGFMT).in
+ mv ntpsweep.1+ ntpsweep.1
+
+### Texinfo
+
+$(srcdir)/invoke-ntpsweep.menu: invoke-ntpsweep.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntpsweep.texi: ntpsweep-opts ntpsweep-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpsweep-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/ntpsweep.html: invoke-ntpsweep.menu invoke-ntpsweep.texi ntpsweep.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntpsweep.html ntpsweep.texi || true )
+
+# 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/scripts/ntpsweep/invoke-ntpsweep.menu b/scripts/ntpsweep/invoke-ntpsweep.menu
new file mode 100644
index 0000000..6a1faea
--- /dev/null
+++ b/scripts/ntpsweep/invoke-ntpsweep.menu
@@ -0,0 +1 @@
+* ntpsweep Invocation:: Invoking ntpsweep
diff --git a/scripts/ntpsweep/invoke-ntpsweep.texi b/scripts/ntpsweep/invoke-ntpsweep.texi
new file mode 100644
index 0000000..f5dbf32
--- /dev/null
+++ b/scripts/ntpsweep/invoke-ntpsweep.texi
@@ -0,0 +1,118 @@
+@node ntpsweep Invocation
+@section Invoking ntpsweep
+@pindex ntpsweep
+@cindex Print various informations about given ntp servers
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION (invoke-ntpsweep.texi)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:25 AM by AutoGen 5.18.5pre4
+# From the definitions ntpsweep-opts.def
+# and the template file agtexi-cmd.tpl
+@end ignore
+
+@code{ntpsweep}
+prints per host the NTP stratum level, the clock offset in seconds, the daemon
+version, the operating system and the processor. Optionally recursing through
+all peers.
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{ntpsweep} program.
+
+@menu
+* ntpsweep usage:: ntpsweep help/usage (@option{--help})
+* ntpsweep host-list:: host-list option (-l)
+* ntpsweep peers:: peers option (-p)
+* ntpsweep maxlevel:: maxlevel option (-m)
+* ntpsweep strip:: strip option (-s)
+* ntpsweep host:: host option (-h)
+* ntpsweep exit status:: exit status
+@end menu
+
+@node ntpsweep usage
+@subsection ntpsweep help/usage (@option{--help})
+@cindex ntpsweep help
+
+This is the automatically generated usage text for ntpsweep.
+
+The text printed is the same whether selected with the @code{help} option
+(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function. The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}. Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+ntpsweep - Print various informations about given ntp servers - Ver. 4.2.7p482
+USAGE: ntpsweep [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [hostfile]
+
+ -l, --host-list=str Host to execute actions on
+ - may appear multiple times
+ -p, --peers Recursively list all peers a host synchronizes to
+ -m, --maxlevel=num Traverse peers up to this level (4 is a reasonable number)
+ -s, --strip=str Strip this string from hostnames
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+@end example
+@exampleindent 4
+
+@node ntpsweep host-list
+@subsection host-list option (-l)
+@cindex ntpsweep-host-list
+
+This is the ``host to execute actions on'' option.
+This option takes a string argument.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@end itemize
+
+ Use this option to specify the host on which this script operates.
+ May appear multiple times.
+@node ntpsweep peers
+@subsection peers option (-p)
+@cindex ntpsweep-peers
+
+This is the ``recursively list all peers a host synchronizes to'' option.
+This option has no @samp{doc} documentation.
+@node ntpsweep maxlevel
+@subsection maxlevel option (-m)
+@cindex ntpsweep-maxlevel
+
+This is the ``traverse peers up to this level (4 is a reasonable number)'' option.
+This option takes a number argument.
+This option has no @samp{doc} documentation.
+@node ntpsweep strip
+@subsection strip option (-s)
+@cindex ntpsweep-strip
+
+This is the ``strip this string from hostnames'' option.
+This option takes a string argument.
+This option has no @samp{doc} documentation.
+@node ntpsweep host
+@subsection host option (-h)
+@cindex ntpsweep-host
+
+This is the ``specify a single host'' option.
+This option takes a string argument.
+This option has no @samp{doc} documentation.
+
+@strong{NOTE}@strong{: THIS OPTION IS DEPRECATED}
+@node ntpsweep exit status
+@subsection ntpsweep exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@end table
diff --git a/scripts/ntpsweep/ntpsweep-opts b/scripts/ntpsweep/ntpsweep-opts
new file mode 100644
index 0000000..d29f194
--- /dev/null
+++ b/scripts/ntpsweep/ntpsweep-opts
@@ -0,0 +1,67 @@
+# EDIT THIS FILE WITH CAUTION (ntpsweep-opts)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:23 AM by AutoGen 5.18.5pre4
+# From the definitions ntpsweep-opts.def
+# and the template file perlopt
+
+use Getopt::Long qw(GetOptionsFromArray);
+Getopt::Long::Configure(qw(no_auto_abbrev no_ignore_case_always));
+
+my $usage;
+
+sub usage {
+ my ($ret) = @_;
+ print STDERR $usage;
+ exit $ret;
+}
+
+sub paged_usage {
+ my ($ret) = @_;
+ my $pager = $ENV{PAGER} || '(less || more)';
+
+ open STDOUT, "| $pager" or die "Can't fork a pager: $!";
+ print $usage;
+
+ exit $ret;
+}
+
+sub processOptions {
+ my $args = shift;
+
+ my $opts = {
+ 'host-list' => [],
+ 'peers' => '',
+ 'maxlevel' => '',
+ 'strip' => '',
+ 'host' => '',
+ 'help' => '', 'more-help' => ''
+ };
+ my $argument = '[hostfile]';
+ my $ret = GetOptionsFromArray($args, $opts, (
+ 'host-list|l=s', 'peers|p', 'maxlevel|m=i',
+ 'strip|s=s', 'host|h=s',
+ 'help|?', 'more-help'));
+
+ $usage = <<'USAGE';
+ntpsweep - Print various informations about given ntp servers - Ver. 4.2.7p482
+USAGE: ntpsweep [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [hostfile]
+
+ -l, --host-list=str Host to execute actions on
+ - may appear multiple times
+ -p, --peers Recursively list all peers a host synchronizes to
+ -m, --maxlevel=num Traverse peers up to this level (4 is a reasonable number)
+ -s, --strip=str Strip this string from hostnames
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+USAGE
+
+ usage(0) if $opts->{'help'};
+ paged_usage(0) if $opts->{'more-help'};
+ $_[0] = $opts;
+ return $ret;
+}
+
+END { close STDOUT };
diff --git a/scripts/ntpsweep/ntpsweep-opts.def b/scripts/ntpsweep/ntpsweep-opts.def
new file mode 100644
index 0000000..23dc020
--- /dev/null
+++ b/scripts/ntpsweep/ntpsweep-opts.def
@@ -0,0 +1,66 @@
+/* -*- Mode: Text -*- */
+autogen definitions perlopt;
+
+#include autogen-version.def
+
+prog-name = 'ntpsweep';
+prog-title = 'Print various informations about given ntp servers';
+package = ntp;
+#include version.def
+
+argument = '[hostfile]';
+long-opts;
+gnu-usage;
+
+flag = {
+ name = host-list;
+ value = l;
+ arg-type = string;
+ max = NOLIMIT;
+ stack-arg;
+ descrip = 'Host to execute actions on';
+ doc = <<- _EndOfDoc_
+ Use this option to specify the host on which this script operates.
+ May appear multiple times.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = peers;
+ value = p;
+ descrip = 'Recursively list all peers a host synchronizes to';
+};
+
+flag = {
+ name = maxlevel;
+ value = m;
+ arg-type = number;
+ descrip = 'Traverse peers up to this level (4 is a reasonable number)';
+};
+
+flag = {
+ name = strip;
+ value = s;
+ arg-type = string;
+ descrip = 'Strip this string from hostnames';
+};
+
+/* Deprecated options */
+flag = {
+ name = host;
+ value = h;
+ arg-type = string;
+ descrip = 'Specify a single host';
+ deprecated;
+};
+
+doc-section = {
+ ds-type = 'DESCRIPTION';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_PROG_MDOC_DESCRIP
+.Nm
+prints per host the NTP stratum level, the clock offset in seconds, the daemon
+version, the operating system and the processor. Optionally recursing through
+all peers.
+ _END_PROG_MDOC_DESCRIP;
+};
diff --git a/scripts/ntpsweep/ntpsweep.1ntpsweepman b/scripts/ntpsweep/ntpsweep.1ntpsweepman
new file mode 100644
index 0000000..5695469
--- /dev/null
+++ b/scripts/ntpsweep/ntpsweep.1ntpsweepman
@@ -0,0 +1,97 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntpsweep 1ntpsweepman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-_ja4FE/ag-mkaaFE)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:27 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpsweep-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntpsweep\fP
+\- Print various informations about given ntp servers
+.SH SYNOPSIS
+\f\*[B-Font]ntpsweep\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+[hostfile]
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+\f\*[B-Font]ntpsweep\fP
+prints per host the NTP stratum level, the clock offset in seconds, the daemon
+version, the operating system and the processor. Optionally recursing through
+all peers.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-l\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-host\-list\f[]=\f\*[I-Font]string\f[]
+Host to execute actions on.
+This option may appear an unlimited number of times.
+.sp
+ Use this option to specify the host on which this script operates.
+ May appear multiple times.
+.TP
+.NOP \f\*[B-Font]\-p\f[], \f\*[B-Font]\-\-peers\f[]
+Recursively list all peers a host synchronizes to.
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-m\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-maxlevel\f[]=\f\*[I-Font]number\f[]
+Traverse peers up to this level (4 is a reasonable number).
+This option takes an integer number as its argument.
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-strip\f[]=\f\*[I-Font]string\f[]
+Strip this string from hostnames.
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-h\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-host\f[]=\f\*[I-Font]string\f[]
+Specify a single host.
+.sp
+This option has not been fully documented.
+.sp
+.B
+NOTE: THIS OPTION IS DEPRECATED
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-v\f[] [{\f\*[I-Font]v|c|n\f[] \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBntpsweep\fP
+option definitions.
diff --git a/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc b/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc
new file mode 100644
index 0000000..a522052
--- /dev/null
+++ b/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc
@@ -0,0 +1,75 @@
+.Dd December 2 2014
+.Dt NTPSWEEP 1ntpsweepmdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntpsweep-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:30 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpsweep-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntpsweep
+.Nd Print various informations about given ntp servers
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+[hostfile]
+.Pp
+.Sh DESCRIPTION
+.Nm
+prints per host the NTP stratum level, the clock offset in seconds, the daemon
+version, the operating system and the processor. Optionally recursing through
+all peers.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl l Ar string , Fl \-host\-list Ns = Ns Ar string
+Host to execute actions on.
+This option may appear an unlimited number of times.
+.sp
+ Use this option to specify the host on which this script operates.
+ May appear multiple times.
+.It Fl p , Fl \-peers
+Recursively list all peers a host synchronizes to.
+.sp
+This option has not been fully documented.
+.It Fl m Ar number , Fl \-maxlevel Ns = Ns Ar number
+Traverse peers up to this level (4 is a reasonable number).
+This option takes an integer number as its argument.
+.sp
+This option has not been fully documented.
+.It Fl s Ar string , Fl \-strip Ns = Ns Ar string
+Strip this string from hostnames.
+.sp
+This option has not been fully documented.
+.It Fl h Ar string , Fl \-host Ns = Ns Ar string
+Specify a single host.
+.sp
+This option has not been fully documented.
+.sp
+.B
+NOTE: THIS OPTION IS DEPRECATED
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl v Op Brq Ar v|c|n Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBntpsweep\fP
+option definitions.
diff --git a/scripts/ntpsweep/ntpsweep.html b/scripts/ntpsweep/ntpsweep.html
new file mode 100644
index 0000000..291f434
--- /dev/null
+++ b/scripts/ntpsweep/ntpsweep.html
@@ -0,0 +1,201 @@
+<html lang="en">
+<head>
+<title>ntpsweep User's Manual</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="ntpsweep User's Manual">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+ span.sc { font-variant:small-caps }
+ span.roman { font-family: serif; font-weight: normal; }
+--></style>
+</head>
+<body>
+<h1 class="settitle">ntpsweep User's Manual</h1>
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpsweep-Description">ntpsweep Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+ <p>This document describes the use of the NTP Project's <code>ntpsweep</code> program.
+
+ <p>This document applies to version 4.2.7p482 of <code>ntpsweep</code>.
+
+ <div class="shortcontents">
+<h2>Short Contents</h2>
+<ul>
+</ul>
+</div>
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntpsweep-Description">ntpsweep Description</a>: Description
+<li><a accesskey="2" href="#ntpsweep-Invocation">ntpsweep Invocation</a>: Invoking ntpsweep
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntpsweep-Invocation"></a>
+<br>
+</div>
+
+<h3 class="section">0.1 Invoking ntpsweep</h3>
+
+<p><a name="index-ntpsweep-1"></a><a name="index-Print-various-informations-about-given-ntp-servers-2"></a>
+<code>ntpsweep</code>
+prints per host the NTP stratum level, the clock offset in seconds, the daemon
+version, the operating system and the processor. Optionally recursing through
+all peers.
+
+ <p>This section was generated by <strong>AutoGen</strong>,
+using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntpsweep</code> program.
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntpsweep-usage">ntpsweep usage</a>: ntpsweep help/usage (<span class="option">--help</span>)
+<li><a accesskey="2" href="#ntpsweep-host_002dlist">ntpsweep host-list</a>: host-list option (-l)
+<li><a accesskey="3" href="#ntpsweep-peers">ntpsweep peers</a>: peers option (-p)
+<li><a accesskey="4" href="#ntpsweep-maxlevel">ntpsweep maxlevel</a>: maxlevel option (-m)
+<li><a accesskey="5" href="#ntpsweep-strip">ntpsweep strip</a>: strip option (-s)
+<li><a accesskey="6" href="#ntpsweep-host">ntpsweep host</a>: host option (-h)
+<li><a accesskey="7" href="#ntpsweep-exit-status">ntpsweep exit status</a>: exit status
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntpsweep-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpsweep-host_002dlist">ntpsweep host-list</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpsweep-Invocation">ntpsweep Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.1 ntpsweep help/usage (<span class="option">--help</span>)</h4>
+
+<p><a name="index-ntpsweep-help-3"></a>
+This is the automatically generated usage text for ntpsweep.
+
+ <p>The text printed is the same whether selected with the <code>help</code> option
+(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
+the usage text by passing it through a pager program.
+<code>more-help</code> is disabled on platforms without a working
+<code>fork(2)</code> function. The <code>PAGER</code> environment variable is
+used to select the program, defaulting to <span class="file">more</span>. Both will exit
+with a status code of 0.
+
+<pre class="example">ntpsweep - Print various informations about given ntp servers - Ver. 4.2.7p482
+USAGE: ntpsweep [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [hostfile]
+
+ -l, --host-list=str Host to execute actions on
+ - may appear multiple times
+ -p, --peers Recursively list all peers a host synchronizes to
+ -m, --maxlevel=num Traverse peers up to this level (4 is a reasonable number)
+ -s, --strip=str Strip this string from hostnames
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+</pre>
+ <div class="node">
+<p><hr>
+<a name="ntpsweep-host_002dlist"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpsweep-peers">ntpsweep peers</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpsweep-usage">ntpsweep usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpsweep-Invocation">ntpsweep Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.2 host-list option (-l)</h4>
+
+<p><a name="index-ntpsweep_002dhost_002dlist-4"></a>
+This is the &ldquo;host to execute actions on&rdquo; option.
+This option takes a string argument.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>may appear an unlimited number of times.
+</ul>
+
+ <p>Use this option to specify the host on which this script operates.
+ May appear multiple times.
+<div class="node">
+<p><hr>
+<a name="ntpsweep-peers"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpsweep-maxlevel">ntpsweep maxlevel</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpsweep-host_002dlist">ntpsweep host-list</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpsweep-Invocation">ntpsweep Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.3 peers option (-p)</h4>
+
+<p><a name="index-ntpsweep_002dpeers-5"></a>
+This is the &ldquo;recursively list all peers a host synchronizes to&rdquo; option.
+This option has no <span class="samp">doc</span> documentation.
+<div class="node">
+<p><hr>
+<a name="ntpsweep-maxlevel"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpsweep-strip">ntpsweep strip</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpsweep-peers">ntpsweep peers</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpsweep-Invocation">ntpsweep Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.4 maxlevel option (-m)</h4>
+
+<p><a name="index-ntpsweep_002dmaxlevel-6"></a>
+This is the &ldquo;traverse peers up to this level (4 is a reasonable number)&rdquo; option.
+This option takes a number argument.
+This option has no <span class="samp">doc</span> documentation.
+<div class="node">
+<p><hr>
+<a name="ntpsweep-strip"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpsweep-host">ntpsweep host</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpsweep-maxlevel">ntpsweep maxlevel</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpsweep-Invocation">ntpsweep Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.5 strip option (-s)</h4>
+
+<p><a name="index-ntpsweep_002dstrip-7"></a>
+This is the &ldquo;strip this string from hostnames&rdquo; option.
+This option takes a string argument.
+This option has no <span class="samp">doc</span> documentation.
+<div class="node">
+<p><hr>
+<a name="ntpsweep-host"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpsweep-exit-status">ntpsweep exit status</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpsweep-strip">ntpsweep strip</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpsweep-Invocation">ntpsweep Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.6 host option (-h)</h4>
+
+<p><a name="index-ntpsweep_002dhost-8"></a>
+This is the &ldquo;specify a single host&rdquo; option.
+This option takes a string argument.
+This option has no <span class="samp">doc</span> documentation.
+
+ <p><strong>NOTE</strong><strong>: THIS OPTION IS DEPRECATED</strong>
+<div class="node">
+<p><hr>
+<a name="ntpsweep-exit-status"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpsweep-host">ntpsweep host</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpsweep-Invocation">ntpsweep Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.7 ntpsweep exit status</h4>
+
+<p>One of the following exit values will be returned:
+ <dl>
+<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
+<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
+</dl>
+
+</body></html>
+
diff --git a/scripts/ntpsweep/ntpsweep.in b/scripts/ntpsweep/ntpsweep.in
new file mode 100644
index 0000000..fed35d1
--- /dev/null
+++ b/scripts/ntpsweep/ntpsweep.in
@@ -0,0 +1,204 @@
+#! @PATH_PERL@ -w
+#
+# $Id$
+#
+# DISCLAIMER
+#
+# Copyright (C) 1999,2000 Hans Lambermont and Origin B.V.
+#
+# Permission to use, copy, modify and distribute this software and its
+# documentation for any purpose and without fee is hereby granted,
+# provided that the above copyright notice appears in all copies and
+# that both the copyright notice and this permission notice appear in
+# supporting documentation. This software is supported as is and without
+# any express or implied warranties, including, without limitation, the
+# implied warranties of merchantability and fitness for a particular
+# purpose. The name Origin B.V. must not be used to endorse or promote
+# products derived from this software without prior written permission.
+#
+# Hans Lambermont <ntpsweep@lambermont.dyndns.org>
+
+package ntpsweep;
+use 5.006_000;
+use strict;
+use lib "@PERLLIBDIR@";
+use NTP::Util qw(do_dns ntp_read_vars ntp_peers ntp_sntp_line);
+
+(my $program = $0) =~ s%.*/(.+?)(.pl)?$%$1%;
+my ($showpeers, $maxlevel, $strip);
+my (%known_host_info, %known_host_peers);
+
+exit run(@ARGV) unless caller;
+
+sub run {
+ my $opts;
+ if (!processOptions(\@_, $opts) ||
+ (((@_ != 1) && !$opts->{host} && !@{$opts->{'host-list'}}))) {
+ usage(1);
+ };
+
+ # no STDOUT buffering
+ $| = 1;
+ ($showpeers, $maxlevel, $strip) =
+ ($opts->{peers}, $opts->{maxlevel}, $opts->{strip});
+
+ my $hostsfile = shift;
+
+ # Main program
+
+ my @hosts;
+
+ if ($opts->{host}) {
+ push @hosts, $opts->{host};
+ }
+ else {
+ @hosts = read_hosts($hostsfile) if $hostsfile;
+ push @hosts, @{$opts->{'host-list'}};
+ }
+
+ # Print header
+ print <<EOF;
+Host st offset(s) version system processor
+--------------------------------+--+---------+-----------+------------+---------
+EOF
+
+ %known_host_info = ();
+ %known_host_peers = ();
+ scan_hosts(@hosts);
+
+ return 0;
+}
+
+sub scan_hosts {
+ my (@hosts) = @_;
+
+ my $host;
+ for $host (@hosts) {
+ scan_host($host, 0, $host => 1);
+ }
+}
+
+sub read_hosts {
+ my ($hostsfile) = @_;
+ my @hosts;
+
+ open my $hosts, $hostsfile
+ or die "$program: FATAL: unable to read $hostsfile: $!\n";
+
+ while (<$hosts>) {
+ next if /^\s*(#|$)/; # comment/empty
+ chomp;
+ push @hosts, $_;
+ }
+
+ close $hosts;
+ return @hosts;
+}
+
+sub scan_host {
+ my ($host, $level, %trace) = @_;
+ my $stratum = 0;
+ my $offset = 0;
+ my $daemonversion = "";
+ my $system = "";
+ my $processor = "";
+ my @peers;
+ my $known_host = 0;
+
+ if (exists $known_host_info{$host}) {
+ $known_host = 1;
+ }
+ else {
+ ($offset, $stratum) = ntp_sntp_line($host);
+
+ # got answers ? If so, go on.
+ if ($stratum) {
+ my $vars = ntp_read_vars(0, [qw(processor system daemon_version)], $host) || {};
+ $daemonversion = $vars->{daemon_version};
+ $system = $vars->{system};
+ $processor = $vars->{processor};
+
+ # Shorten daemon_version string.
+ $daemonversion =~ s/(;|Mon|Tue|Wed|Thu|Fri|Sat|Sun).*$//;
+ $daemonversion =~ s/version=//;
+ $daemonversion =~ s/(x|)ntpd //;
+ $daemonversion =~ s/(\(|\))//g;
+ $daemonversion =~ s/beta/b/;
+ $daemonversion =~ s/multicast/mc/;
+
+ # Shorten system string
+ $system =~ s/UNIX\///;
+ $system =~ s/RELEASE/r/;
+ $system =~ s/CURRENT/c/;
+
+ # Shorten processor string
+ $processor =~ s/unknown//;
+ }
+
+ # got answers ? If so, go on.
+ if ($daemonversion) {
+ if ($showpeers) {
+ my @peers_tmp = ntp_peers($host);
+ for (@peers_tmp) {
+ $_->{remote} =~ s/^(?: |x|\.|-|\+|#|\*|o)([^ ]+)/$1/;
+ push @peers, $_->{remote};
+ }
+ }
+ }
+
+ # Add scanned host to known_hosts array
+ #push @known_hosts, $host;
+ if ($stratum) {
+ $known_host_info{$host} = sprintf "%2d %9.3f %-11s %-12s %s",
+ $stratum, $offset, (substr $daemonversion, 0, 11),
+ (substr $system, 0, 12), (substr $processor, 0, 9);
+ }
+ else {
+ # Stratum level 0 is consider invalid
+ $known_host_info{$host} = " ?";
+ }
+ $known_host_peers{$host} = [@peers];
+ }
+
+ if ($stratum || $known_host) { # Valid or known host
+ my $printhost = ' ' x $level . (do_dns($host) || $host);
+ # Shorten host string
+ if ($strip) {
+ $printhost =~ s/$strip//;
+ }
+ # append number of peers in brackets if requested and valid
+ if ($showpeers && ($known_host_info{$host} ne " ?")) {
+ $printhost .= " (" . @{$known_host_peers{$host}} . ")";
+ }
+ # Finally print complete host line
+ printf "%-32s %s\n",
+ (substr $printhost, 0, 32), $known_host_info{$host};
+ if ($showpeers && ($maxlevel ? $level < $maxlevel : 1)) {
+ $trace{$host} = 1;
+ # Loop through peers
+ foreach my $peer (@{$known_host_peers{$host}}) {
+ if (exists $trace{$peer}) {
+ # we've detected a loop !
+ $printhost = ' ' x ($level + 1) . "= " . $peer;
+ # Shorten host string
+ $printhost =~ s/$strip// if $strip;
+ printf "%-32s\n", substr $printhost, 0, 32;
+ } else {
+ if ((substr $peer, 0, 3) ne "127") {
+ scan_host($peer, $level + 1, %trace);
+ }
+ }
+ }
+ }
+ }
+ else { # We did not get answers from this host
+ my $printhost = ' ' x $level . (do_dns($host) || $host);
+ $printhost =~ s/$strip// if $strip;
+ printf "%-32s ?\n", substr $printhost, 0, 32;
+ }
+}
+
+@ntpsweep_opts@
+
+1;
+__END__
diff --git a/scripts/ntpsweep/ntpsweep.man.in b/scripts/ntpsweep/ntpsweep.man.in
new file mode 100644
index 0000000..5695469
--- /dev/null
+++ b/scripts/ntpsweep/ntpsweep.man.in
@@ -0,0 +1,97 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntpsweep 1ntpsweepman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-_ja4FE/ag-mkaaFE)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:27 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpsweep-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntpsweep\fP
+\- Print various informations about given ntp servers
+.SH SYNOPSIS
+\f\*[B-Font]ntpsweep\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+[hostfile]
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+\f\*[B-Font]ntpsweep\fP
+prints per host the NTP stratum level, the clock offset in seconds, the daemon
+version, the operating system and the processor. Optionally recursing through
+all peers.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-l\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-host\-list\f[]=\f\*[I-Font]string\f[]
+Host to execute actions on.
+This option may appear an unlimited number of times.
+.sp
+ Use this option to specify the host on which this script operates.
+ May appear multiple times.
+.TP
+.NOP \f\*[B-Font]\-p\f[], \f\*[B-Font]\-\-peers\f[]
+Recursively list all peers a host synchronizes to.
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-m\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-maxlevel\f[]=\f\*[I-Font]number\f[]
+Traverse peers up to this level (4 is a reasonable number).
+This option takes an integer number as its argument.
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-strip\f[]=\f\*[I-Font]string\f[]
+Strip this string from hostnames.
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-h\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-host\f[]=\f\*[I-Font]string\f[]
+Specify a single host.
+.sp
+This option has not been fully documented.
+.sp
+.B
+NOTE: THIS OPTION IS DEPRECATED
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-v\f[] [{\f\*[I-Font]v|c|n\f[] \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBntpsweep\fP
+option definitions.
diff --git a/scripts/ntpsweep/ntpsweep.mdoc.in b/scripts/ntpsweep/ntpsweep.mdoc.in
new file mode 100644
index 0000000..a522052
--- /dev/null
+++ b/scripts/ntpsweep/ntpsweep.mdoc.in
@@ -0,0 +1,75 @@
+.Dd December 2 2014
+.Dt NTPSWEEP 1ntpsweepmdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntpsweep-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:30 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpsweep-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntpsweep
+.Nd Print various informations about given ntp servers
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+[hostfile]
+.Pp
+.Sh DESCRIPTION
+.Nm
+prints per host the NTP stratum level, the clock offset in seconds, the daemon
+version, the operating system and the processor. Optionally recursing through
+all peers.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl l Ar string , Fl \-host\-list Ns = Ns Ar string
+Host to execute actions on.
+This option may appear an unlimited number of times.
+.sp
+ Use this option to specify the host on which this script operates.
+ May appear multiple times.
+.It Fl p , Fl \-peers
+Recursively list all peers a host synchronizes to.
+.sp
+This option has not been fully documented.
+.It Fl m Ar number , Fl \-maxlevel Ns = Ns Ar number
+Traverse peers up to this level (4 is a reasonable number).
+This option takes an integer number as its argument.
+.sp
+This option has not been fully documented.
+.It Fl s Ar string , Fl \-strip Ns = Ns Ar string
+Strip this string from hostnames.
+.sp
+This option has not been fully documented.
+.It Fl h Ar string , Fl \-host Ns = Ns Ar string
+Specify a single host.
+.sp
+This option has not been fully documented.
+.sp
+.B
+NOTE: THIS OPTION IS DEPRECATED
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl v Op Brq Ar v|c|n Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBntpsweep\fP
+option definitions.
diff --git a/scripts/ntpsweep/ntpsweep.texi b/scripts/ntpsweep/ntpsweep.texi
new file mode 100644
index 0000000..e408065
--- /dev/null
+++ b/scripts/ntpsweep/ntpsweep.texi
@@ -0,0 +1,43 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename ntpsweep.info
+@settitle ntpsweep User's Manual
+@include ../../sntp/include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of @code{ntpsweep},
+a program from
+the NTP Project,
+that is used to wait until @code{ntpd} has been able to
+synchronize and stabilize the time on the current host.
+@end ifinfo
+
+@direntry
+* ntpsweep: (ntpsweep). Wait for ntpd to synchronize and stabilize the system clock.
+@end direntry
+
+@titlepage
+@title ntpsweep User's Manual
+@subtitle ntpsweep, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@c @page
+@c @vskip 0pt plus 1filll
+
+@node Top, ntpsweep Description, (dir), (dir)
+
+This document describes the use of the NTP Project's @code{ntpsweep} program.
+
+This document applies to version @value{VERSION} of @code{ntpsweep}.
+
+@shortcontents
+
+@menu
+* ntpsweep Description:: Description
+* ntpsweep Invocation:: Invoking ntpsweep
+@end menu
+
+@include invoke-ntpsweep.texi
diff --git a/scripts/ntptrace/Makefile.am b/scripts/ntptrace/Makefile.am
new file mode 100644
index 0000000..19300e8
--- /dev/null
+++ b/scripts/ntptrace/Makefile.am
@@ -0,0 +1,95 @@
+NULL=
+man1_MANS=
+man8_MANS=
+man_MANS= ntptrace.$(NTPTRACE_MS)
+
+bin_SCRIPTS = $(NTPTRACE_DB)
+libexec_SCRIPTS = $(NTPTRACE_DL)
+sbin_SCRIPTS = $(NTPTRACE_DS)
+
+run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" PERL5LIB="$(abs_top_srcdir)/scripts/lib" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../../sntp/include -L ../../sntp/ag-tpl \
+ --writable
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+EXTRA_SCRIPTS = ntptrace
+
+EXTRA_DIST = \
+ ntptrace.1ntptraceman \
+ ntptrace.1ntptracemdoc \
+ ntptrace.mdoc.in \
+ ntptrace.man.in \
+ ntptrace.texi \
+ ntptrace.html \
+ ntptrace-opts.def \
+ ntptrace-opts \
+ invoke-ntptrace.texi \
+ invoke-ntptrace.menu \
+ $(NULL)
+
+DISTCLEANFILES = config.log $(man_MANS)
+
+html_DATA = $(srcdir)/ntptrace.html
+
+noinst_DATA = \
+ ntptrace.1ntptraceman \
+ ntptrace.1ntptracemdoc \
+ ntptrace.mdoc.in \
+ ntptrace.man.in \
+ ntptrace.texi \
+ ntptrace.html \
+ ntptrace-opts.def \
+ ntptrace-opts \
+ invoke-ntptrace.texi \
+ invoke-ntptrace.menu \
+ $(NULL)
+
+ntptrace: $(srcdir)/ntptrace-opts
+
+$(srcdir)/ntptrace-opts: $(srcdir)/ntptrace-opts.def $(std_def_list)
+ $(run_ag) ntptrace-opts.def
+
+### Nroff
+
+$(srcdir)/ntptrace.1ntptraceman: $(srcdir)/ntptrace-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntptraceman -Tagman-cmd.tpl ntptrace-opts.def
+
+$(srcdir)/ntptrace.man.in: $(srcdir)/ntptrace.1ntptraceman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntptrace.1ntptraceman > $(srcdir)/ntptrace.man.in+
+ mv $(srcdir)/ntptrace.man.in+ $(srcdir)/ntptrace.man.in
+
+### Mdoc
+
+$(srcdir)/ntptrace.1ntptracemdoc: $(srcdir)/ntptrace-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntptracemdoc -Tagmdoc-cmd.tpl ntptrace-opts.def
+
+$(srcdir)/ntptrace.mdoc.in: $(srcdir)/ntptrace.1ntptracemdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntptrace.1ntptracemdoc > $(srcdir)/ntptrace.mdoc.in+
+ mv $(srcdir)/ntptrace.mdoc.in+ $(srcdir)/ntptrace.mdoc.in
+
+### Manpage (local)
+
+ntptrace.$(NTPTRACE_MS): $(srcdir)/ntptrace.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntptrace.$(NTPTRACE_MS)+:$(srcdir)/ntptrace.$(MANTAGFMT).in
+ mv ntptrace.$(NTPTRACE_MS)+ ntptrace.$(NTPTRACE_MS)
+
+### Texinfo
+
+$(srcdir)/invoke-ntptrace.menu: $(srcdir)/invoke-ntptrace.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntptrace.texi: ntptrace-opts $(srcdir)/ntptrace-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntptrace-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/ntptrace.html: $(srcdir)/invoke-ntptrace.menu $(srcdir)/invoke-ntptrace.texi $(srcdir)/ntptrace.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntptrace.html ntptrace.texi || true )
diff --git a/scripts/ntptrace/Makefile.in b/scripts/ntptrace/Makefile.in
new file mode 100644
index 0000000..825a390
--- /dev/null
+++ b/scripts/ntptrace/Makefile.in
@@ -0,0 +1,878 @@
+# Makefile.in generated by automake 1.11.1 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.
+# 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = scripts/ntptrace
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/ntptrace.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.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_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_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.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)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = ntptrace
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \
+ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \
+ "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"
+SCRIPTS = $(bin_SCRIPTS) $(libexec_SCRIPTS) $(sbin_SCRIPTS)
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+man1dir = $(mandir)/man1
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(man1_MANS) $(man8_MANS) $(man_MANS)
+DATA = $(html_DATA) $(noinst_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+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@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+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_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@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+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@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+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@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+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_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+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@
+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@
+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@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+NULL =
+man1_MANS =
+man8_MANS =
+man_MANS = ntptrace.$(NTPTRACE_MS)
+bin_SCRIPTS = $(NTPTRACE_DB)
+libexec_SCRIPTS = $(NTPTRACE_DL)
+sbin_SCRIPTS = $(NTPTRACE_DS)
+run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" PERL5LIB="$(abs_top_srcdir)/scripts/lib" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../../sntp/include -L ../../sntp/ag-tpl \
+ --writable
+
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+EXTRA_SCRIPTS = ntptrace
+EXTRA_DIST = \
+ ntptrace.1ntptraceman \
+ ntptrace.1ntptracemdoc \
+ ntptrace.mdoc.in \
+ ntptrace.man.in \
+ ntptrace.texi \
+ ntptrace.html \
+ ntptrace-opts.def \
+ ntptrace-opts \
+ invoke-ntptrace.texi \
+ invoke-ntptrace.menu \
+ $(NULL)
+
+DISTCLEANFILES = config.log $(man_MANS)
+html_DATA = $(srcdir)/ntptrace.html
+noinst_DATA = \
+ ntptrace.1ntptraceman \
+ ntptrace.1ntptracemdoc \
+ ntptrace.mdoc.in \
+ ntptrace.man.in \
+ ntptrace.texi \
+ ntptrace.html \
+ ntptrace-opts.def \
+ ntptrace-opts \
+ invoke-ntptrace.texi \
+ invoke-ntptrace.menu \
+ $(NULL)
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/ntptrace/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign scripts/ntptrace/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+ntptrace: $(top_builddir)/config.status $(srcdir)/ntptrace.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+install-libexecSCRIPTS: $(libexec_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
+ @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-libexecSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+install-sbinSCRIPTS: $(sbin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+ @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-sbinSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+install-man8: $(man8_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man8:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+install-htmlDATA: $(html_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
+ done
+
+uninstall-htmlDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(htmldir)" && rm -f $$files
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS) $(MANS) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-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
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-htmlDATA install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binSCRIPTS install-libexecSCRIPTS \
+ install-sbinSCRIPTS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1 install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binSCRIPTS uninstall-htmlDATA \
+ uninstall-libexecSCRIPTS uninstall-man uninstall-sbinSCRIPTS
+
+uninstall-man: uninstall-man1 uninstall-man8
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binSCRIPTS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-htmlDATA install-info install-info-am \
+ install-libexecSCRIPTS install-man install-man1 install-man8 \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-sbinSCRIPTS install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am uninstall uninstall-am uninstall-binSCRIPTS \
+ uninstall-htmlDATA uninstall-libexecSCRIPTS uninstall-man \
+ uninstall-man1 uninstall-man8 uninstall-sbinSCRIPTS
+
+
+ntptrace: $(srcdir)/ntptrace-opts
+
+$(srcdir)/ntptrace-opts: $(srcdir)/ntptrace-opts.def $(std_def_list)
+ $(run_ag) ntptrace-opts.def
+
+### Nroff
+
+$(srcdir)/ntptrace.1ntptraceman: $(srcdir)/ntptrace-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntptraceman -Tagman-cmd.tpl ntptrace-opts.def
+
+$(srcdir)/ntptrace.man.in: $(srcdir)/ntptrace.1ntptraceman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntptrace.1ntptraceman > $(srcdir)/ntptrace.man.in+
+ mv $(srcdir)/ntptrace.man.in+ $(srcdir)/ntptrace.man.in
+
+### Mdoc
+
+$(srcdir)/ntptrace.1ntptracemdoc: $(srcdir)/ntptrace-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntptracemdoc -Tagmdoc-cmd.tpl ntptrace-opts.def
+
+$(srcdir)/ntptrace.mdoc.in: $(srcdir)/ntptrace.1ntptracemdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntptrace.1ntptracemdoc > $(srcdir)/ntptrace.mdoc.in+
+ mv $(srcdir)/ntptrace.mdoc.in+ $(srcdir)/ntptrace.mdoc.in
+
+### Manpage (local)
+
+ntptrace.$(NTPTRACE_MS): $(srcdir)/ntptrace.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntptrace.$(NTPTRACE_MS)+:$(srcdir)/ntptrace.$(MANTAGFMT).in
+ mv ntptrace.$(NTPTRACE_MS)+ ntptrace.$(NTPTRACE_MS)
+
+### Texinfo
+
+$(srcdir)/invoke-ntptrace.menu: $(srcdir)/invoke-ntptrace.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntptrace.texi: ntptrace-opts $(srcdir)/ntptrace-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntptrace-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/ntptrace.html: $(srcdir)/invoke-ntptrace.menu $(srcdir)/invoke-ntptrace.texi $(srcdir)/ntptrace.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntptrace.html ntptrace.texi || true )
+
+# 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/scripts/ntptrace/invoke-ntptrace.menu b/scripts/ntptrace/invoke-ntptrace.menu
new file mode 100644
index 0000000..bea3b8b
--- /dev/null
+++ b/scripts/ntptrace/invoke-ntptrace.menu
@@ -0,0 +1 @@
+* ntptrace Invocation:: Invoking ntptrace
diff --git a/scripts/ntptrace/invoke-ntptrace.texi b/scripts/ntptrace/invoke-ntptrace.texi
new file mode 100644
index 0000000..3f7a53b
--- /dev/null
+++ b/scripts/ntptrace/invoke-ntptrace.texi
@@ -0,0 +1,109 @@
+@node ntptrace Invocation
+@section Invoking ntptrace
+@pindex ntptrace
+@cindex Trace peers of an NTP server
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION (invoke-ntptrace.texi)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:37 AM by AutoGen 5.18.5pre4
+# From the definitions ntptrace-opts.def
+# and the template file agtexi-cmd.tpl
+@end ignore
+
+@code{ntptrace} is a perl script that uses the ntpq utility program to follow
+the chain of NTP servers from a given host back to the primary time source. For
+ntptrace to work properly, each of these servers must implement the NTP Control
+and Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets.
+
+If given no arguments, ntptrace starts with localhost. Here is an example of
+the output from ntptrace:
+
+@example
+% ntptrace localhost: stratum 4, offset 0.0019529, synch distance 0.144135
+server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784 usndh.edu:
+stratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
+@end example
+
+On each line, the fields are (left to right): the host name, the host stratum,
+the time offset between that host and the local host (as measured by
+@code{ntptrace}; this is why it is not always zero for "localhost"), the host
+synchronization distance, and (only for stratum-1 servers) the reference clock
+ID. All times are given in seconds. Note that the stratum is the server hop
+count to the primary source, while the synchronization distance is the
+estimated error relative to the primary source. These terms are precisely
+defined in RFC-1305.
+
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{ntptrace} program.
+
+@menu
+* ntptrace usage:: ntptrace help/usage (@option{--help})
+* ntptrace numeric:: numeric option (-n)
+* ntptrace max-hosts:: max-hosts option (-m)
+* ntptrace host:: host option (-r)
+* ntptrace exit status:: exit status
+@end menu
+
+@node ntptrace usage
+@subsection ntptrace help/usage (@option{--help})
+@cindex ntptrace help
+
+This is the automatically generated usage text for ntptrace.
+
+The text printed is the same whether selected with the @code{help} option
+(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function. The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}. Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+ntptrace - Trace peers of an NTP server - Ver. 4.2.7p482
+USAGE: ntptrace [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [host]
+
+ -n, --numeric Print IP addresses instead of hostnames
+ -m, --max-hosts=num Maximum number of peers to trace
+ -r, --host=str Single remote host
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+@end example
+@exampleindent 4
+
+@node ntptrace numeric
+@subsection numeric option (-n)
+@cindex ntptrace-numeric
+
+This is the ``print ip addresses instead of hostnames'' option.
+Output hosts as dotted-quad numeric format rather than converting to
+the canonical host names.
+@node ntptrace max-hosts
+@subsection max-hosts option (-m)
+@cindex ntptrace-max-hosts
+
+This is the ``maximum number of peers to trace'' option.
+This option takes a number argument.
+This option has no @samp{doc} documentation.
+@node ntptrace host
+@subsection host option (-r)
+@cindex ntptrace-host
+
+This is the ``single remote host'' option.
+This option takes a string argument.
+This option has no @samp{doc} documentation.
+@node ntptrace exit status
+@subsection ntptrace exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@end table
diff --git a/scripts/ntptrace/ntptrace-opts b/scripts/ntptrace/ntptrace-opts
new file mode 100644
index 0000000..36c8e1e
--- /dev/null
+++ b/scripts/ntptrace/ntptrace-opts
@@ -0,0 +1,62 @@
+# EDIT THIS FILE WITH CAUTION (ntptrace-opts)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:32 AM by AutoGen 5.18.5pre4
+# From the definitions ntptrace-opts.def
+# and the template file perlopt
+
+use Getopt::Long qw(GetOptionsFromArray);
+Getopt::Long::Configure(qw(no_auto_abbrev no_ignore_case_always));
+
+my $usage;
+
+sub usage {
+ my ($ret) = @_;
+ print STDERR $usage;
+ exit $ret;
+}
+
+sub paged_usage {
+ my ($ret) = @_;
+ my $pager = $ENV{PAGER} || '(less || more)';
+
+ open STDOUT, "| $pager" or die "Can't fork a pager: $!";
+ print $usage;
+
+ exit $ret;
+}
+
+sub processOptions {
+ my $args = shift;
+
+ my $opts = {
+ 'numeric' => '',
+ 'max-hosts' => '99',
+ 'host' => '127.0.0.1',
+ 'help' => '', 'more-help' => ''
+ };
+ my $argument = '[host]';
+ my $ret = GetOptionsFromArray($args, $opts, (
+ 'numeric|n', 'max-hosts|m=i', 'host|r=s',
+ 'help|?', 'more-help'));
+
+ $usage = <<'USAGE';
+ntptrace - Trace peers of an NTP server - Ver. 4.2.7p482
+USAGE: ntptrace [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [host]
+
+ -n, --numeric Print IP addresses instead of hostnames
+ -m, --max-hosts=num Maximum number of peers to trace
+ -r, --host=str Single remote host
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+USAGE
+
+ usage(0) if $opts->{'help'};
+ paged_usage(0) if $opts->{'more-help'};
+ $_[0] = $opts;
+ return $ret;
+}
+
+END { close STDOUT };
diff --git a/scripts/ntptrace/ntptrace-opts.def b/scripts/ntptrace/ntptrace-opts.def
new file mode 100644
index 0000000..81ddda3
--- /dev/null
+++ b/scripts/ntptrace/ntptrace-opts.def
@@ -0,0 +1,69 @@
+/* -*- Mode: Text -*- */
+AutoGen Definitions perlopt;
+
+//#include copyright.def
+#include autogen-version.def
+
+prog-name = 'ntptrace';
+prog-title = 'Trace peers of an NTP server';
+package = ntp;
+#include version.def
+argument = '[host]';
+
+long-opts;
+gnu-usage;
+
+flag = {
+ name = numeric;
+ value = n;
+ descrip = 'Print IP addresses instead of hostnames';
+ doc = <<- _EndOfDoc_
+ Output hosts as dotted-quad numeric format rather than converting to
+ the canonical host names.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = max-hosts;
+ value = m;
+ arg-type = number;
+ arg-default = 99;
+ descrip = 'Maximum number of peers to trace';
+};
+
+flag = {
+ name = host;
+ value = r;
+ arg-type = string;
+ arg-default = '127.0.0.1';
+ descrip = 'Single remote host';
+};
+
+doc-section = {
+ ds-type = 'DESCRIPTION';
+ ds-format = 'texi';
+ ds-text = <<- _END_PROG_MDOC_DESCRIP
+@code{ntptrace} is a perl script that uses the ntpq utility program to follow
+the chain of NTP servers from a given host back to the primary time source. For
+ntptrace to work properly, each of these servers must implement the NTP Control
+and Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets.
+
+If given no arguments, ntptrace starts with localhost. Here is an example of
+the output from ntptrace:
+
+@example
+% ntptrace localhost: stratum 4, offset 0.0019529, synch distance 0.144135
+server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784 usndh.edu:
+stratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
+@end example
+
+On each line, the fields are (left to right): the host name, the host stratum,
+the time offset between that host and the local host (as measured by
+@code{ntptrace}; this is why it is not always zero for "localhost"), the host
+synchronization distance, and (only for stratum-1 servers) the reference clock
+ID. All times are given in seconds. Note that the stratum is the server hop
+count to the primary source, while the synchronization distance is the
+estimated error relative to the primary source. These terms are precisely
+defined in RFC-1305.
+ _END_PROG_MDOC_DESCRIP;
+};
diff --git a/scripts/ntptrace/ntptrace.1ntptraceman b/scripts/ntptrace/ntptrace.1ntptraceman
new file mode 100644
index 0000000..c5fc935
--- /dev/null
+++ b/scripts/ntptrace/ntptrace.1ntptraceman
@@ -0,0 +1,114 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntptrace 1ntptraceman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-S1aqYF/ag-51ayXF)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:34 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntptrace-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntptrace\fP
+\- Trace peers of an NTP server
+.SH SYNOPSIS
+\f\*[B-Font]ntptrace\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+[host]
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+\fBntptrace\fP is a perl script that uses the ntpq utility program to follow
+the chain of NTP servers from a given host back to the primary time source. For
+ntptrace to work properly, each of these servers must implement the NTP Control
+and Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets.
+.sp
+If given no arguments, ntptrace starts with localhost. Here is an example of
+the output from ntptrace:
+.sp
+.br
+.in +4
+.nf
+% ntptrace localhost: stratum 4, offset 0.0019529, synch distance 0.144135
+server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784 usndh.edu:
+stratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
+.in -4
+.fi
+.sp
+On each line, the fields are (left to right): the host name, the host stratum,
+the time offset between that host and the local host (as measured by
+\fBntptrace\fP; this is why it is not always zero for "localhost"), the host
+synchronization distance, and (only for stratum\-1 servers) the reference clock
+ID. All times are given in seconds. Note that the stratum is the server hop
+count to the primary source, while the synchronization distance is the
+estimated error relative to the primary source. These terms are precisely
+defined in RFC\-1305.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-n\f[], \f\*[B-Font]\-\-numeric\f[]
+Print IP addresses instead of hostnames.
+.sp
+Output hosts as dotted-quad numeric format rather than converting to
+the canonical host names.
+.TP
+.NOP \f\*[B-Font]\-m\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-max\-hosts\f[]=\f\*[I-Font]number\f[]
+Maximum number of peers to trace.
+This option takes an integer number as its argument.
+The default
+\f\*[I-Font]number\f[]
+for this option is:
+.ti +4
+ 99
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-r\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-host\f[]=\f\*[I-Font]string\f[]
+Single remote host.
+The default
+\f\*[I-Font]string\f[]
+for this option is:
+.ti +4
+ 127.0.0.1
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-v\f[] [{\f\*[I-Font]v|c|n\f[] \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBntptrace\fP
+option definitions.
diff --git a/scripts/ntptrace/ntptrace.1ntptracemdoc b/scripts/ntptrace/ntptrace.1ntptracemdoc
new file mode 100644
index 0000000..f67e471
--- /dev/null
+++ b/scripts/ntptrace/ntptrace.1ntptracemdoc
@@ -0,0 +1,91 @@
+.Dd December 2 2014
+.Dt NTPTRACE 1ntptracemdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntptrace-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:39 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntptrace-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntptrace
+.Nd Trace peers of an NTP server
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+[host]
+.Pp
+.Sh DESCRIPTION
+\fBntptrace\fP is a perl script that uses the ntpq utility program to follow
+the chain of NTP servers from a given host back to the primary time source. For
+ntptrace to work properly, each of these servers must implement the NTP Control
+and Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets.
+.sp
+If given no arguments, ntptrace starts with localhost. Here is an example of
+the output from ntptrace:
+.sp
+.Bd -literal -offset indent
+% ntptrace localhost: stratum 4, offset 0.0019529, synch distance 0.144135
+server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784 usndh.edu:
+stratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
+.Ed
+.sp
+On each line, the fields are (left to right): the host name, the host stratum,
+the time offset between that host and the local host (as measured by
+\fBntptrace\fP; this is why it is not always zero for "localhost"), the host
+synchronization distance, and (only for stratum\-1 servers) the reference clock
+ID. All times are given in seconds. Note that the stratum is the server hop
+count to the primary source, while the synchronization distance is the
+estimated error relative to the primary source. These terms are precisely
+defined in RFC\-1305.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl n , Fl \-numeric
+Print IP addresses instead of hostnames.
+.sp
+Output hosts as dotted\-quad numeric format rather than converting to
+the canonical host names.
+.It Fl m Ar number , Fl \-max\-hosts Ns = Ns Ar number
+Maximum number of peers to trace.
+This option takes an integer number as its argument.
+The default
+.Ar number
+for this option is:
+.ti +4
+ 99
+.sp
+This option has not been fully documented.
+.It Fl r Ar string , Fl \-host Ns = Ns Ar string
+Single remote host.
+The default
+.Ar string
+for this option is:
+.ti +4
+ 127.0.0.1
+.sp
+This option has not been fully documented.
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl v Op Brq Ar v|c|n Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBntptrace\fP
+option definitions.
diff --git a/scripts/ntptrace/ntptrace.html b/scripts/ntptrace/ntptrace.html
new file mode 100644
index 0000000..8d45462
--- /dev/null
+++ b/scripts/ntptrace/ntptrace.html
@@ -0,0 +1,180 @@
+<html lang="en">
+<head>
+<title>Ntptrace User's Manual</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="Ntptrace User's Manual">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+ span.sc { font-variant:small-caps }
+ span.roman { font-family: serif; font-weight: normal; }
+--></style>
+</head>
+<body>
+<h1 class="settitle">Ntptrace User's Manual</h1>
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntptrace-Description">ntptrace Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+<h2 class="unnumbered">Simple Network Time Protocol User Manual</h2>
+
+<p>This document describes the use of the NTP Project's <code>ntptrace</code> program.
+This document applies to version 4.2.7p482 of <code>ntptrace</code>.
+
+ <div class="shortcontents">
+<h2>Short Contents</h2>
+<ul>
+<a href="#Top">Simple Network Time Protocol User Manual</a>
+</ul>
+</div>
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntptrace-Description">ntptrace Description</a>: Description
+<li><a accesskey="2" href="#ntptrace-Invocation">ntptrace Invocation</a>: Invoking ntptrace
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntptrace-Invocation"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntptrace-Description">ntptrace Description</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<h3 class="section">Invoking ntptrace</h3>
+
+<p><a name="index-ntptrace-1"></a><a name="index-Trace-peers-of-an-NTP-server-2"></a>
+<code>ntptrace</code> is a perl script that uses the ntpq utility program to follow
+the chain of NTP servers from a given host back to the primary time source. For
+ntptrace to work properly, each of these servers must implement the NTP Control
+and Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets.
+
+ <p>If given no arguments, ntptrace starts with localhost. Here is an example of
+the output from ntptrace:
+
+<pre class="example"> % ntptrace localhost: stratum 4, offset 0.0019529, synch distance 0.144135
+ server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784 usndh.edu:
+ stratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
+</pre>
+ <p>On each line, the fields are (left to right): the host name, the host stratum,
+the time offset between that host and the local host (as measured by
+<code>ntptrace</code>; this is why it is not always zero for "localhost"), the host
+synchronization distance, and (only for stratum-1 servers) the reference clock
+ID. All times are given in seconds. Note that the stratum is the server hop
+count to the primary source, while the synchronization distance is the
+estimated error relative to the primary source. These terms are precisely
+defined in RFC-1305.
+
+ <p>This section was generated by <strong>AutoGen</strong>,
+using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntptrace</code> program.
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntptrace-usage">ntptrace usage</a>: ntptrace help/usage (<span class="option">--help</span>)
+<li><a accesskey="2" href="#ntptrace-numeric">ntptrace numeric</a>: numeric option (-n)
+<li><a accesskey="3" href="#ntptrace-max_002dhosts">ntptrace max-hosts</a>: max-hosts option (-m)
+<li><a accesskey="4" href="#ntptrace-host">ntptrace host</a>: host option (-r)
+<li><a accesskey="5" href="#ntptrace-exit-status">ntptrace exit status</a>: exit status
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntptrace-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntptrace-numeric">ntptrace numeric</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntptrace-Invocation">ntptrace Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntptrace help/usage (<span class="option">--help</span>)</h4>
+
+<p><a name="index-ntptrace-help-3"></a>
+This is the automatically generated usage text for ntptrace.
+
+ <p>The text printed is the same whether selected with the <code>help</code> option
+(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
+the usage text by passing it through a pager program.
+<code>more-help</code> is disabled on platforms without a working
+<code>fork(2)</code> function. The <code>PAGER</code> environment variable is
+used to select the program, defaulting to <span class="file">more</span>. Both will exit
+with a status code of 0.
+
+<pre class="example">ntptrace - Trace peers of an NTP server - Ver. 4.2.7p482
+USAGE: ntptrace [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [host]
+
+ -n, --numeric Print IP addresses instead of hostnames
+ -m, --max-hosts=num Maximum number of peers to trace
+ -r, --host=str Single remote host
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+</pre>
+ <div class="node">
+<p><hr>
+<a name="ntptrace-numeric"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntptrace-max_002dhosts">ntptrace max-hosts</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntptrace-usage">ntptrace usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntptrace-Invocation">ntptrace Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">numeric option (-n)</h4>
+
+<p><a name="index-ntptrace_002dnumeric-4"></a>
+This is the &ldquo;print ip addresses instead of hostnames&rdquo; option.
+Output hosts as dotted-quad numeric format rather than converting to
+the canonical host names.
+<div class="node">
+<p><hr>
+<a name="ntptrace-max_002dhosts"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntptrace-host">ntptrace host</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntptrace-numeric">ntptrace numeric</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntptrace-Invocation">ntptrace Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">max-hosts option (-m)</h4>
+
+<p><a name="index-ntptrace_002dmax_002dhosts-5"></a>
+This is the &ldquo;maximum number of peers to trace&rdquo; option.
+This option takes a number argument.
+This option has no <span class="samp">doc</span> documentation.
+<div class="node">
+<p><hr>
+<a name="ntptrace-host"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntptrace-exit-status">ntptrace exit status</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntptrace-max_002dhosts">ntptrace max-hosts</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntptrace-Invocation">ntptrace Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">host option (-r)</h4>
+
+<p><a name="index-ntptrace_002dhost-6"></a>
+This is the &ldquo;single remote host&rdquo; option.
+This option takes a string argument.
+This option has no <span class="samp">doc</span> documentation.
+<div class="node">
+<p><hr>
+<a name="ntptrace-exit-status"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntptrace-host">ntptrace host</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntptrace-Invocation">ntptrace Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntptrace exit status</h4>
+
+<p>One of the following exit values will be returned:
+ <dl>
+<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
+<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
+</dl>
+
+</body></html>
+
diff --git a/scripts/ntptrace/ntptrace.in b/scripts/ntptrace/ntptrace.in
new file mode 100755
index 0000000..7cc5ce7
--- /dev/null
+++ b/scripts/ntptrace/ntptrace.in
@@ -0,0 +1,80 @@
+#! @PATH_PERL@ -w
+# John Hay -- John.Hay@icomtek.csir.co.za / jhay@FreeBSD.org
+
+package ntptrace;
+use 5.006_000;
+use strict;
+use lib "@PERLLIBDIR@";
+use NTP::Util qw(ntp_read_vars do_dns);
+
+exit run(@ARGV) unless caller;
+
+sub run {
+ my $opts;
+ if (!processOptions(\@_, $opts)) {
+ usage(1);
+ };
+
+ my $dodns = $opts->{numeric} ? 0 : 1;
+ my $max_hosts = $opts->{'max-hosts'};
+ my $host = shift || $opts->{host};
+ my $nb_host = 0;
+
+ for (;;) {
+ $nb_host++;
+
+ my %info = get_info($host);
+ last if not %info;
+
+ my $dhost = $host;
+ if ($dodns) {
+ my $name = do_dns($host);
+ $dhost = $name if defined $name;
+ }
+
+ printf "%s: stratum %d, offset %f, synch distance %f",
+ $dhost, $info{stratum}, $info{offset}, $info{syncdistance};
+ printf ", refid '%s'", $info{refid} if $info{stratum} == 1;
+ print "\n";
+
+ last if $info{stratum} == 0 || $info{stratum} == 1 ||
+ $info{stratum} == 16;
+ last if $info{refid} =~ /^127\.127\.\d{1,3}\.\d{1,3}$/;
+ last if $nb_host == $max_hosts;
+
+ my $next_host = get_next_host($info{peer}, $host);
+ last if $next_host eq '';
+ last if $next_host =~ /^127\.127\.\d{1,3}\.\d{1,3}$/;
+
+ $host = $next_host;
+ }
+ return 0;
+}
+
+sub get_info {
+ my ($host) = @_;
+ my ($rootdelay, $rootdisp, $info) = (0, 0);
+
+ $info = ntp_read_vars(0, [], $host);
+ return if not defined $info;
+ return if not exists $info->{stratum};
+
+ $info->{offset} /= 1000;
+ $info->{syncdistance} = ($info->{rootdisp} + ($info->{rootdelay} / 2)) / 1000;
+
+ return %$info;
+}
+
+
+sub get_next_host {
+ my ($peer, $host) = @_;
+
+ my $info = ntp_read_vars($peer, [qw(srcadr)], $host);
+ return if not defined $info;
+ return $info->{srcadr};
+}
+
+@ntptrace_opts@
+
+1;
+__END__
diff --git a/scripts/ntptrace/ntptrace.man.in b/scripts/ntptrace/ntptrace.man.in
new file mode 100644
index 0000000..b0f531f
--- /dev/null
+++ b/scripts/ntptrace/ntptrace.man.in
@@ -0,0 +1,114 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntptrace @NTPTRACE_MS@ "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-S1aqYF/ag-51ayXF)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:34 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntptrace-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntptrace\fP
+\- Trace peers of an NTP server
+.SH SYNOPSIS
+\f\*[B-Font]ntptrace\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+[host]
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+\fBntptrace\fP is a perl script that uses the ntpq utility program to follow
+the chain of NTP servers from a given host back to the primary time source. For
+ntptrace to work properly, each of these servers must implement the NTP Control
+and Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets.
+.sp
+If given no arguments, ntptrace starts with localhost. Here is an example of
+the output from ntptrace:
+.sp
+.br
+.in +4
+.nf
+% ntptrace localhost: stratum 4, offset 0.0019529, synch distance 0.144135
+server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784 usndh.edu:
+stratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
+.in -4
+.fi
+.sp
+On each line, the fields are (left to right): the host name, the host stratum,
+the time offset between that host and the local host (as measured by
+\fBntptrace\fP; this is why it is not always zero for "localhost"), the host
+synchronization distance, and (only for stratum\-1 servers) the reference clock
+ID. All times are given in seconds. Note that the stratum is the server hop
+count to the primary source, while the synchronization distance is the
+estimated error relative to the primary source. These terms are precisely
+defined in RFC\-1305.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-n\f[], \f\*[B-Font]\-\-numeric\f[]
+Print IP addresses instead of hostnames.
+.sp
+Output hosts as dotted-quad numeric format rather than converting to
+the canonical host names.
+.TP
+.NOP \f\*[B-Font]\-m\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-max\-hosts\f[]=\f\*[I-Font]number\f[]
+Maximum number of peers to trace.
+This option takes an integer number as its argument.
+The default
+\f\*[I-Font]number\f[]
+for this option is:
+.ti +4
+ 99
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-r\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-host\f[]=\f\*[I-Font]string\f[]
+Single remote host.
+The default
+\f\*[I-Font]string\f[]
+for this option is:
+.ti +4
+ 127.0.0.1
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-v\f[] [{\f\*[I-Font]v|c|n\f[] \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBntptrace\fP
+option definitions.
diff --git a/scripts/ntptrace/ntptrace.mdoc.in b/scripts/ntptrace/ntptrace.mdoc.in
new file mode 100644
index 0000000..c952d6d
--- /dev/null
+++ b/scripts/ntptrace/ntptrace.mdoc.in
@@ -0,0 +1,91 @@
+.Dd December 2 2014
+.Dt NTPTRACE @NTPTRACE_MS@ User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntptrace-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:39 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntptrace-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntptrace
+.Nd Trace peers of an NTP server
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+[host]
+.Pp
+.Sh DESCRIPTION
+\fBntptrace\fP is a perl script that uses the ntpq utility program to follow
+the chain of NTP servers from a given host back to the primary time source. For
+ntptrace to work properly, each of these servers must implement the NTP Control
+and Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets.
+.sp
+If given no arguments, ntptrace starts with localhost. Here is an example of
+the output from ntptrace:
+.sp
+.Bd -literal -offset indent
+% ntptrace localhost: stratum 4, offset 0.0019529, synch distance 0.144135
+server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784 usndh.edu:
+stratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
+.Ed
+.sp
+On each line, the fields are (left to right): the host name, the host stratum,
+the time offset between that host and the local host (as measured by
+\fBntptrace\fP; this is why it is not always zero for "localhost"), the host
+synchronization distance, and (only for stratum\-1 servers) the reference clock
+ID. All times are given in seconds. Note that the stratum is the server hop
+count to the primary source, while the synchronization distance is the
+estimated error relative to the primary source. These terms are precisely
+defined in RFC\-1305.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl n , Fl \-numeric
+Print IP addresses instead of hostnames.
+.sp
+Output hosts as dotted\-quad numeric format rather than converting to
+the canonical host names.
+.It Fl m Ar number , Fl \-max\-hosts Ns = Ns Ar number
+Maximum number of peers to trace.
+This option takes an integer number as its argument.
+The default
+.Ar number
+for this option is:
+.ti +4
+ 99
+.sp
+This option has not been fully documented.
+.It Fl r Ar string , Fl \-host Ns = Ns Ar string
+Single remote host.
+The default
+.Ar string
+for this option is:
+.ti +4
+ 127.0.0.1
+.sp
+This option has not been fully documented.
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl v Op Brq Ar v|c|n Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBntptrace\fP
+option definitions.
diff --git a/scripts/ntptrace/ntptrace.texi b/scripts/ntptrace/ntptrace.texi
new file mode 100644
index 0000000..b1851f2
--- /dev/null
+++ b/scripts/ntptrace/ntptrace.texi
@@ -0,0 +1,40 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename ntptrace.info
+@settitle Ntptrace User's Manual
+@include ../../sntp/include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of @code{ntptrace},
+a program from the NTP Project
+@end ifinfo
+
+@direntry
+* ntptrace: (ntptrace). Trace the ntp server to the primary time source.
+@end direntry
+
+@titlepage
+@title ntptrace User's Manual
+@subtitle ntptrace, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@c @page
+@c @vskip 0pt plus 1filll
+
+@node Top, ntptrace Description, (dir), (dir)
+@top Simple Network Time Protocol User Manual
+
+This document describes the use of the NTP Project's @code{ntptrace} program.
+This document applies to version @value{VERSION} of @code{ntptrace}.
+
+@shortcontents
+
+@menu
+* ntptrace Description:: Description
+* ntptrace Invocation:: Invoking ntptrace
+@end menu
+
+@include invoke-ntptrace.texi
diff --git a/scripts/ntpver.in b/scripts/ntpver.in
new file mode 100644
index 0000000..9615e66
--- /dev/null
+++ b/scripts/ntpver.in
@@ -0,0 +1,7 @@
+#!@CONFIG_SHELL@
+# print version string of NTP daemon
+# Copyright (c) 1997 by Ulrich Windl
+# Modified 970318: Harlan Stenn: rewritten...
+# usage: ntpver hostname
+
+ntpq -c "rv 0 daemon_version" $* | @AWK@ '/daemon_version/ { print $2 }'
diff --git a/scripts/plot_summary-opts b/scripts/plot_summary-opts
new file mode 100644
index 0000000..f574baf
--- /dev/null
+++ b/scripts/plot_summary-opts
@@ -0,0 +1,73 @@
+# EDIT THIS FILE WITH CAUTION (plot_summary-opts)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:41 AM by AutoGen 5.18.5pre4
+# From the definitions plot_summary-opts.def
+# and the template file perlopt
+
+use Getopt::Long qw(GetOptionsFromArray);
+Getopt::Long::Configure(qw(no_auto_abbrev no_ignore_case_always));
+
+my $usage;
+
+sub usage {
+ my ($ret) = @_;
+ print STDERR $usage;
+ exit $ret;
+}
+
+sub paged_usage {
+ my ($ret) = @_;
+ my $pager = $ENV{PAGER} || '(less || more)';
+
+ open STDOUT, "| $pager" or die "Can't fork a pager: $!";
+ print $usage;
+
+ exit $ret;
+}
+
+sub processOptions {
+ my $args = shift;
+
+ my $opts = {
+ 'directory' => '/tmp',
+ 'identifier' => '',
+ 'offset-limit' => '0.128',
+ 'peer' => [],
+ 'plot-term' => '',
+ 'output-file' => '',
+ 'dont-wait' => '',
+ 'help' => '', 'more-help' => ''
+ };
+ my $argument = '';
+ my $ret = GetOptionsFromArray($args, $opts, (
+ 'directory=s', 'identifier=s', 'offset-limit=f',
+ 'peer=s', 'plot-term=s', 'output-file=s',
+ 'dont-wait',
+ 'help|?', 'more-help'));
+
+ $usage = <<'USAGE';
+plot_summary - plot statistics generated by summary script - Ver. 4.2.7p482
+USAGE: plot_summary [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
+
+ --directory=str Where the summary files are
+ --identifier=str Origin of the data
+ --offset-limit=float Limit of absolute offset
+ --peer=str Peers to generate plots for
+ - may appear multiple times
+ --plot-term=str Gnuplot terminal
+ --output-file=str Output file
+ --dont-wait Don't wait for keystroke between plots
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+USAGE
+
+ usage(0) if $opts->{'help'};
+ paged_usage(0) if $opts->{'more-help'};
+ $_[0] = $opts;
+ return $ret;
+}
+
+END { close STDOUT };
diff --git a/scripts/plot_summary-opts.def b/scripts/plot_summary-opts.def
new file mode 100644
index 0000000..61f028b
--- /dev/null
+++ b/scripts/plot_summary-opts.def
@@ -0,0 +1,83 @@
+/* -*- Mode: Text -*- */
+AutoGen Definitions perlopt;
+
+#include autogen-version.def
+
+prog-name = 'plot_summary';
+prog-title = 'plot statistics generated by summary script';
+package = ntp;
+#include version.def
+
+long-opts;
+gnu-usage;
+
+flag = {
+ name = directory;
+ arg-type = string;
+ arg-default = '/tmp';
+ descrip = 'Where the summary files are';
+ doc = <<- _EndOfDoc_
+ The directory where the @code{plot_summary} will search for the
+ *_summary files generated by @code{summary} script.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = identifier;
+ arg-type = string;
+ descrip = 'Origin of the data';
+ doc = <<- _EndOfDoc_
+ Where does the plotted data come from, default to string "host" plus
+ current hostname
+ _EndOfDoc_;
+};
+
+flag = {
+ name = offset-limit;
+ arg-type = string;
+ arg-name = float;
+ arg-default = "0.128";
+ descrip = 'Limit of absolute offset';
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+flag = {
+ name = peer;
+ arg-type = string;
+ stack-arg;
+ max = NOLIMIT;
+ descrip = 'Peers to generate plots for';
+ doc = <<- _EndOfDoc_
+ By default the peer_summary plots are not generated. Use this option to
+ specify list of peers if you want to generate plots for them.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = plot-term;
+ arg-type = string;
+ descrip = 'Gnuplot terminal';
+ doc = <<- _EndOfDoc_
+ This is string is passed directly to the @code{gnuplot set terminal}
+ command. Default is @code{x11} if @code{DISPLAY} is set and
+ @code{dumb} is it's not'. See output from @code(gnuplot -e "set
+ terminal") for the list of avalaible options.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = output-file;
+ arg-type = str;
+ descrip = 'Output file';
+ doc = <<- _EndOfDoc_
+ Output file for @code{gnuplot}, default to stdout.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = dont-wait;
+ descrip = "Don't wait for keystroke between plots";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
diff --git a/scripts/plot_summary.1plot_summaryman b/scripts/plot_summary.1plot_summaryman
new file mode 100644
index 0000000..c2394fa
--- /dev/null
+++ b/scripts/plot_summary.1plot_summaryman
@@ -0,0 +1,114 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH plot_summary 1plot_summaryman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-L.aO0H/ag-X.aWZH)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:47 AM by AutoGen 5.18.5pre4
+.\" From the definitions plot_summary-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]plot_summary\fP
+\- plot statistics generated by summary script
+.SH SYNOPSIS
+\f\*[B-Font]plot_summary\fP
+[\f\*[B-Font]\-\-option-name\f[]]
+[\f\*[B-Font]\-\-option-name\f[] \f\*[I-Font]value\f[]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH "DESCRIPTION"
+There is no description for this command.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-\-directory\f[]=\f\*[I-Font]string\f[]
+Where the summary files are.
+The default
+\f\*[I-Font]string\f[]
+for this option is:
+.ti +4
+ /tmp
+.sp
+ The directory where the \fBplot_summary\fP will search for the
+ *_summary files generated by \fBsummary\fP script.
+.TP
+.NOP \f\*[B-Font]\-\-identifier\f[]=\f\*[I-Font]string\f[]
+Origin of the data.
+.sp
+ Where does the plotted data come from, default to string "host" plus
+ current hostname
+.TP
+.NOP \f\*[B-Font]\-\-offset\-limit\f[]=\f\*[I-Font]float\f[]
+Limit of absolute offset.
+The default
+\f\*[I-Font]float\f[]
+for this option is:
+.ti +4
+ 0.128
+.sp
+.TP
+.NOP \f\*[B-Font]\-\-peer\f[]=\f\*[I-Font]string\f[]
+Peers to generate plots for.
+This option may appear an unlimited number of times.
+.sp
+ By default the peer_summary plots are not generated. Use this option to
+ specify list of peers if you want to generate plots for them.
+.TP
+.NOP \f\*[B-Font]\-\-plot\-term\f[]=\f\*[I-Font]string\f[]
+Gnuplot terminal.
+.sp
+ This is string is passed directly to the \fBgnuplot set terminal\fP
+ command. Default is \fBx11\fP if \fBDISPLAY\fP is set and
+ \fBdumb\fP is it's not'. See output from @code(gnuplot \-e "set
+ terminal") for the list of avalaible options.
+.TP
+.NOP \f\*[B-Font]\-\-output\-file\f[]=\f\*[I-Font]str\f[]
+Output file.
+.sp
+ Output file for \fBgnuplot\fP, default to stdout.
+.TP
+.NOP \f\*[B-Font]\-\-dont\-wait\f[]
+Don't wait for keystroke between plots.
+.sp
+.TP
+.NOP \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBplot_summary\fP
+option definitions.
diff --git a/scripts/plot_summary.1plot_summarymdoc b/scripts/plot_summary.1plot_summarymdoc
new file mode 100644
index 0000000..583994a
--- /dev/null
+++ b/scripts/plot_summary.1plot_summarymdoc
@@ -0,0 +1,88 @@
+.Dd December 2 2014
+.Dt PLOT_SUMMARY 1plot_summarymdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (plot_summary-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:48 AM by AutoGen 5.18.5pre4
+.\" From the definitions plot_summary-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm plot_summary
+.Nd plot statistics generated by summary script
+.Sh SYNOPSIS
+.Nm
+.Op Fl \-option\-name
+.Op Fl \-option\-name Ar value
+.Pp
+All arguments must be options.
+.Pp
+.Sh "DESCRIPTION"
+There is no description for this command.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl \-directory Ns = Ns Ar string
+Where the summary files are.
+The default
+.Ar string
+for this option is:
+.ti +4
+ /tmp
+.sp
+ The directory where the \fBplot_summary\fP will search for the
+ *_summary files generated by \fBsummary\fP script.
+.It Fl \-identifier Ns = Ns Ar string
+Origin of the data.
+.sp
+ Where does the plotted data come from, default to string "host" plus
+ current hostname
+.It Fl \-offset\-limit Ns = Ns Ar float
+Limit of absolute offset.
+The default
+.Ar float
+for this option is:
+.ti +4
+ 0.128
+.sp
+.It Fl \-peer Ns = Ns Ar string
+Peers to generate plots for.
+This option may appear an unlimited number of times.
+.sp
+ By default the peer_summary plots are not generated. Use this option to
+ specify list of peers if you want to generate plots for them.
+.It Fl \-plot\-term Ns = Ns Ar string
+Gnuplot terminal.
+.sp
+ This is string is passed directly to the \fBgnuplot set terminal\fP
+ command. Default is \fBx11\fP if \fBDISPLAY\fP is set and
+ \fBdumb\fP is it's not'. See output from @code(gnuplot \-e "set
+ terminal") for the list of avalaible options.
+.It Fl \-output\-file Ns = Ns Ar str
+Output file.
+.sp
+ Output file for \fBgnuplot\fP, default to stdout.
+.It Fl \-dont\-wait
+Don't wait for keystroke between plots.
+.sp
+.It Fl \-help
+Display usage information and exit.
+.It Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBplot_summary\fP
+option definitions.
diff --git a/scripts/plot_summary.html b/scripts/plot_summary.html
new file mode 100644
index 0000000..8de508b
--- /dev/null
+++ b/scripts/plot_summary.html
@@ -0,0 +1,207 @@
+<html lang="en">
+<head>
+<title>Plot_summary User's Manual</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="Plot_summary User's Manual">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+ span.sc { font-variant:small-caps }
+ span.roman { font-family: serif; font-weight: normal; }
+--></style>
+</head>
+<body>
+<h1 class="settitle">Plot_summary User's Manual</h1>
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#plot_005fsummary-Description">plot_summary Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+<h2 class="unnumbered">Plot_summary User Manual</h2>
+
+<p>This document describes the use of the NTP Project's <code>plot_summary</code> program.
+This document applies to version 4.2.7p482 of <code>plot_summary</code>.
+
+ <div class="shortcontents">
+<h2>Short Contents</h2>
+<ul>
+<a href="#Top">Plot_summary User Manual</a>
+</ul>
+</div>
+
+<ul class="menu">
+<li><a accesskey="1" href="#plot_005fsummary-Description">plot_summary Description</a>: Description
+<li><a accesskey="2" href="#plot_005fsummary-Invocation">plot_summary Invocation</a>: Invoking plot_summary
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="plot_005fsummary-Invocation"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#plot_005fsummary-Description">plot_summary Description</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<h3 class="section">Invoking plot_summary</h3>
+
+<p><a name="index-plot_005fsummary-1"></a><a name="index-plot-statistics-generated-by-summary-script-2"></a>
+
+ <p>This section was generated by <strong>AutoGen</strong>,
+using the <code>agtexi-cmd</code> template and the option descriptions for the <code>plot_summary</code> program.
+
+<ul class="menu">
+<li><a accesskey="1" href="#plot_005fsummary-usage">plot_summary usage</a>: plot_summary help/usage (<span class="option">--help</span>)
+<li><a accesskey="2" href="#plot_005fsummary-directory">plot_summary directory</a>: directory option
+<li><a accesskey="3" href="#plot_005fsummary-identifier">plot_summary identifier</a>: identifier option
+<li><a accesskey="4" href="#plot_005fsummary-peer">plot_summary peer</a>: peer option
+<li><a accesskey="5" href="#plot_005fsummary-plot_002dterm">plot_summary plot-term</a>: plot-term option
+<li><a accesskey="6" href="#plot_005fsummary-output_002dfile">plot_summary output-file</a>: output-file option
+<li><a accesskey="7" href="#plot_005fsummary-exit-status">plot_summary exit status</a>: exit status
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="plot_005fsummary-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#plot_005fsummary-directory">plot_summary directory</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#plot_005fsummary-Invocation">plot_summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">plot_summary help/usage (<span class="option">--help</span>)</h4>
+
+<p><a name="index-plot_005fsummary-help-3"></a>
+This is the automatically generated usage text for plot_summary.
+
+ <p>The text printed is the same whether selected with the <code>help</code> option
+(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
+the usage text by passing it through a pager program.
+<code>more-help</code> is disabled on platforms without a working
+<code>fork(2)</code> function. The <code>PAGER</code> environment variable is
+used to select the program, defaulting to <span class="file">more</span>. Both will exit
+with a status code of 0.
+
+<pre class="example">plot_summary - plot statistics generated by summary script - Ver. 4.2.7p482
+USAGE: plot_summary [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
+
+ --directory=str Where the summary files are
+ --identifier=str Origin of the data
+ --offset-limit=float Limit of absolute offset
+ --peer=str Peers to generate plots for
+ - may appear multiple times
+ --plot-term=str Gnuplot terminal
+ --output-file=str Output file
+ --dont-wait Don't wait for keystroke between plots
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+</pre>
+ <div class="node">
+<p><hr>
+<a name="plot_005fsummary-directory"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#plot_005fsummary-identifier">plot_summary identifier</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#plot_005fsummary-usage">plot_summary usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#plot_005fsummary-Invocation">plot_summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">directory option</h4>
+
+<p><a name="index-plot_005fsummary_002ddirectory-4"></a>
+This is the &ldquo;where the summary files are&rdquo; option.
+This option takes a string argument.
+ The directory where the <code>plot_summary</code> will search for the
+ *_summary files generated by <code>summary</code> script.
+<div class="node">
+<p><hr>
+<a name="plot_005fsummary-identifier"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#plot_005fsummary-peer">plot_summary peer</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#plot_005fsummary-directory">plot_summary directory</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#plot_005fsummary-Invocation">plot_summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">identifier option</h4>
+
+<p><a name="index-plot_005fsummary_002didentifier-5"></a>
+This is the &ldquo;origin of the data&rdquo; option.
+This option takes a string argument.
+ Where does the plotted data come from, default to string "host" plus
+ current hostname
+<div class="node">
+<p><hr>
+<a name="plot_005fsummary-peer"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#plot_005fsummary-plot_002dterm">plot_summary plot-term</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#plot_005fsummary-identifier">plot_summary identifier</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#plot_005fsummary-Invocation">plot_summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">peer option</h4>
+
+<p><a name="index-plot_005fsummary_002dpeer-6"></a>
+This is the &ldquo;peers to generate plots for&rdquo; option.
+This option takes a string argument.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>may appear an unlimited number of times.
+</ul>
+
+ <p>By default the peer_summary plots are not generated. Use this option to
+ specify list of peers if you want to generate plots for them.
+<div class="node">
+<p><hr>
+<a name="plot_005fsummary-plot_002dterm"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#plot_005fsummary-output_002dfile">plot_summary output-file</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#plot_005fsummary-peer">plot_summary peer</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#plot_005fsummary-Invocation">plot_summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">plot-term option</h4>
+
+<p><a name="index-plot_005fsummary_002dplot_002dterm-7"></a>
+This is the &ldquo;gnuplot terminal&rdquo; option.
+This option takes a string argument.
+ This is string is passed directly to the <code>gnuplot set terminal</code>
+ command. Default is <code>x11</code> if <code>DISPLAY</code> is set and
+ <code>dumb</code> is it's not'. See output from -e "set
+ terminal") for the list of avalaible options.
+<div class="node">
+<p><hr>
+<a name="plot_005fsummary-output_002dfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#plot_005fsummary-exit-status">plot_summary exit status</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#plot_005fsummary-plot_002dterm">plot_summary plot-term</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#plot_005fsummary-Invocation">plot_summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">output-file option</h4>
+
+<p><a name="index-plot_005fsummary_002doutput_002dfile-8"></a>
+This is the &ldquo;output file&rdquo; option.
+This option takes a str argument.
+ Output file for <code>gnuplot</code>, default to stdout.
+<div class="node">
+<p><hr>
+<a name="plot_005fsummary-exit-status"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#plot_005fsummary-output_002dfile">plot_summary output-file</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#plot_005fsummary-Invocation">plot_summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">plot_summary exit status</h4>
+
+<p>One of the following exit values will be returned:
+ <dl>
+<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
+<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
+</dl>
+
+</body></html>
+
diff --git a/scripts/plot_summary.in b/scripts/plot_summary.in
new file mode 100644
index 0000000..3401b0d
--- /dev/null
+++ b/scripts/plot_summary.in
@@ -0,0 +1,329 @@
+#! @PATH_PERL@ -w
+# $Id$
+#
+# Use Gnuplot to display data in summary files produced by summary.pl.
+# This script requires GNUPLOT 3.7!
+#
+# Copyright (c) 1997, 1999 by Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+package plot_summary;
+use 5.006_000;
+use strict;
+use Time::Local;
+
+my ($identifier, $offset_limit, $gnuplot_terminal, $wait_after_plot,
+ $output_file, $output_file_number);
+
+exit run(@ARGV) unless caller;
+
+sub run {
+ my $opts;
+ if (!processOptions(\@_, $opts)) {
+ usage(1);
+ }
+
+ $identifier = $opts->{'identifier'};
+ if (!$identifier) {
+ $identifier = "host".`hostname`;
+ chomp $identifier;
+ }
+ $offset_limit = $opts->{'offset-limit'};
+ $output_file = $opts->{'output-file'};
+ $output_file_number = 1;
+ $gnuplot_terminal = $opts->{'plot-terminal'}
+ || ( $ENV{DISPLAY} ? "x11" : "dumb" );
+ $wait_after_plot = !$opts->{'dont-wait'};
+
+ die "illegal offset-limit: $offset_limit" unless $offset_limit > 0.0;
+ $offset_limit *= 1e6; # scale to microseconds
+
+ my $summary_dir = $opts->{'directory'};
+
+ my $loop_summary ="$summary_dir/loop_summary";
+ my $peer_summary ="$summary_dir/peer_summary";
+ my $clock_summary="$summary_dir/clock_summary";
+
+ my @peer_list = @{$opts->{'peer'}};
+
+ do_loop($loop_summary);
+ do_peer($peer_summary, $_) for @peer_list;
+}
+
+# return the smallest value in the given list
+sub min
+{
+ my ($result, @rest) = @_;
+ map { $result = $_ if ($_ < $result) } @rest;
+ return($result);
+}
+
+# return the largest value in the given list
+sub max
+{
+ my ($result, @rest) = @_;
+ map { $result = $_ if ($_ > $result) } @rest;
+ return($result);
+}
+
+# maybe open alternate output file
+sub open_output
+{
+ my $file;
+ if ($output_file) {
+ while ( -r ($file = "$output_file$output_file_number") ) {
+ ++$output_file_number;
+ }
+ open TOUCH, ">$file" and close TOUCH or die "$file: $!";
+ print "set output \"$file\"\n";
+ }
+}
+
+# make Gnuplot wait
+sub maybe_add_pause
+{
+ print "pause -1 \"Press key to continue...\"\n" if $wait_after_plot;
+}
+
+# plot data from loop summary
+sub do_loop
+{
+ my $fname = shift;
+ my $line;
+ my $out_file = "/tmp/tempdata$$";
+ my $cmd_file = "/tmp/tempcmd$$";
+ my ($first_day, $day_out) = ("", 0);
+ my ($lower_bound, $upper_bound, $rms);
+ my ($min_offs, $max_offs) = (1e9, -1e9);
+ my ($min_rms, $max_rms) = (1e9, -1e9);
+ open INPUT, "$fname" or die "$fname: $!";
+ open OUTPUT, ">$out_file" or die "$out_file: $!";
+ my @Fld;
+ while (<INPUT>) {
+ chop; # strip record separator
+ @Fld = split;
+ if ($#Fld == 0) {
+# loops.19960405
+ $_ = $Fld[0]; s/.*([12]\d{3}[01]\d[0-3]\d)$/$1/;
+ m/(\d{4})(\d{2})(\d{2})/;
+ $line = timegm(59, 59, 23, $3, $2 - 1, $1 - 1900, 0, 0, 0);
+ $line = int $line / 86400; # days relative to 1970
+ $first_day = "$1-$2-$3 ($line)" unless $day_out;
+ next;
+ }
+ if ($#Fld != 8) {
+ warn "Illegal number of fields in file $fname, line $.";
+ next;
+ }
+# loop 216, 856106+/-874041.5, rms 117239.8, freq 67.52+/-10.335, var 4.850
+ $_ = $Fld[1]; s/,/ /; $line .= " $_";
+ $_ = $Fld[2]; m:(.+?)\+/-(.+),:;
+ $lower_bound = $1 - $2;
+ $upper_bound = $1 + $2;
+ $line .= "$1 $lower_bound $upper_bound";
+ $min_offs = min($min_offs, $lower_bound);
+ $max_offs = max($max_offs, $upper_bound);
+ $_ = $Fld[4]; s/,/ /; $rms = $_;
+ $min_rms = min($min_rms, $rms);
+ $max_rms = max($max_rms, $rms);
+ $line .= " $rms";
+ $_ = $Fld[6]; m:(.+?)\+/-(.+),:;
+ $line .= " $1 " . ($1-$2) . " " . ($1+$2);
+ $line .= " $Fld[8]";
+ print OUTPUT "$line\n";
+ $day_out = 1;
+# 9621 216 856106 -17935.5 1730147.5 117239.8 67.52 57.185 77.855 4.850
+ }
+ close INPUT;
+ close OUTPUT or die "close failed on $out_file: $!";
+ my $ylimit = "[";
+ if ($min_offs < -$offset_limit) {
+ $ylimit .= "-$offset_limit";
+ }
+ $ylimit .= ":";
+ if ($max_offs > $offset_limit) {
+ $ylimit .= "$offset_limit";
+ }
+ if ( $ylimit eq "[:" ) {
+ $ylimit = "";
+ } else {
+ $ylimit = "[] $ylimit]";
+ }
+# build command file for GNUplot
+ open OUTPUT, "> $cmd_file" or die "$cmd_file: $!";
+ my $oldfh = select OUTPUT;
+ print "set term $gnuplot_terminal\n";
+ open_output;
+ print "set grid\n";
+ print "set title \"Loop Summary for $identifier: " .
+ "Daily mean values since $first_day\\n" .
+ "(Offset limit is $offset_limit microseconds)\"\n";
+ print "set ylabel \"[us]\"\n";
+ print "set style data yerrorbars\n";
+ print "set multiplot\n";
+ print "set size 1, 0.5\n";
+ print "set lmargin 8\n";
+ print "set origin 0, 0.5\n";
+ print "plot $ylimit \"$out_file\"" .
+ " using 1:3:4:5 title \"mean offset\", ";
+ print "\"$out_file\" using 1:(\$3-\$6/2) " .
+ "title \"(sigma low)\" with lines, ";
+ print "\"$out_file\" using 1:3 smooth bezier " .
+ "title \"(Bezier med)\" with lines, ";
+ print "\"$out_file\" using 1:(\$3+\$6/2) " .
+ "title \"(sigma high)\" with lines\n";
+ print "set ylabel \"[ppm]\"\n";
+ print "set origin 0, 0.0\n";
+ print "set title\n";
+ print "set xlabel \"Days relative to 1970\"\n";
+ print "plot \"$out_file\" using 1:7:8:9 title \"mean frequency\", ";
+ print "\"$out_file\" using 1:(\$7-\$10/2) " .
+ "title \"(sigma low)\" with lines, ";
+ print "\"$out_file\" using 1:7 smooth bezier " .
+ "title \"(Bezier med)\" with lines, ";
+ print "\"$out_file\" using 1:(\$7+\$10/2) " .
+ "title \"(sigma high)\" with lines\n";
+ print "set nomultiplot\n";
+ maybe_add_pause;
+
+ $ylimit = "[";
+ if ($min_rms < -$offset_limit) {
+ $ylimit .= "-$offset_limit";
+ }
+ $ylimit .= ":";
+ if ($max_rms > $offset_limit) {
+ $ylimit .= "$offset_limit";
+ }
+ if ( $ylimit eq "[:" ) {
+ $ylimit ="";
+ } else {
+ $ylimit = "[] $ylimit]";
+ }
+
+ open_output;
+ print "set title \"Loop Summary for $identifier: " .
+ "Standard deviation since $first_day\\n" .
+ "(Offset limit is $offset_limit microseconds)\"\n";
+ print "set xlabel\n";
+ print "set ylabel \"[us]\"\n";
+ print "set origin 0, 0.5\n";
+ print "set style data linespoints\n";
+ print "set multiplot\n";
+ print "plot $ylimit \"$out_file\" using 1:6 title \"Offset\", ";
+ print "\"$out_file\" using 1:6 smooth bezier " .
+ "title \"(Bezier)\" with lines\n";
+ print "set title\n";
+ print "set origin 0, 0.0\n";
+ print "set xlabel \"Days relative to 1970\"\n";
+ print "set ylabel \"[ppm]\"\n";
+ print "plot \"$out_file\" using 1:10 title \"Frequency\", ";
+ print "\"$out_file\" using 1:10 smooth bezier " .
+ "title \"(Bezier)\" with lines\n";
+ print "set nomultiplot\n";
+ maybe_add_pause;
+
+ close OUTPUT or die "close failed on $cmd_file: $!";
+ select $oldfh;
+ print `gnuplot $cmd_file`;
+ unlink $cmd_file;
+ unlink $out_file;
+}
+
+# plot data form peer summary
+sub do_peer
+{
+ my $fname = shift;
+ my $peer = shift;
+ my $out_file = "/tmp/tempdata$$";
+ my $cmd_file = "/tmp/tempcmd$$";
+ my $line;
+ my ($first_day, $day_out) = ("", 0);
+ open INPUT, "$fname" or die "$fname: $!";
+ open OUTPUT, ">$out_file" or die "$out_file: $!";
+ my @Fld;
+ while (<INPUT>) {
+ chop; # strip record separator
+ @Fld = split;
+ if ($#Fld == 0) {
+# peers.19960405
+ $_ = $Fld[0]; s/.*([12]\d{3}[01]\d[0-3]\d)$/$1/;
+ m/(\d{4})(\d{2})(\d{2})/ or next;
+ $line = timegm(59, 59, 23, $3, $2 - 1, $1 - 1900, 0, 0, 0);
+ $line = int $line / 86400; # days relative to 1970
+ $first_day = "$1-$2-$3 ($line)" unless $day_out;
+ next;
+ }
+ if ($#Fld != 7) {
+ warn "Illegal number of fields in file $fname, line $.";
+ next;
+ }
+ next if ($Fld[0] ne $peer);
+# ident cnt mean rms max delay dist disp
+# 127.127.8.1 38 30.972 189.867 1154.607 0.000 879.760 111.037
+ $Fld[0] = $line;
+ print OUTPUT join(' ', @Fld) . "\n";
+# 9969 38 30.972 189.867 1154.607 0.000 879.760 111.037
+ $day_out = 1;
+ }
+ close INPUT;
+ close OUTPUT or die "close failed on $out_file: $!";
+ die "no data found for peer $peer" if !$day_out;
+ open OUTPUT, "> $cmd_file" or die "$cmd_file: $!";
+ my $oldfh = select OUTPUT;
+ print "set term $gnuplot_terminal\n";
+ open_output;
+ print "set grid\n";
+ print "set multiplot\n";
+ print "set lmargin 8\n";
+ print "set size 1, 0.34\n";
+ print "set origin 0, 0.66\n";
+ print "set title " .
+ "\"Peer Summary for $peer on $identifier since $first_day\"\n";
+ print "set style data linespoints\n";
+ print "set ylabel \"[us]\"\n";
+ print "plot \"$out_file\" using 1:3 title \"mean offset\", ";
+ print "\"$out_file\" using 1:3 smooth bezier " .
+ "title \"(Bezier)\" with lines, ";
+ print "\"$out_file\" using 1:(\$3-\$7/2) " .
+ "title \"(sigma low)\" with lines, ";
+ print "\"$out_file\" using 1:(\$3+\$7/2) " .
+ "title \"(sigma high)\" with lines\n";
+ print "set title\n";
+ print "set origin 0, 0.34\n";
+ print "set size 1, 0.32\n";
+ print "set ylabel\n";
+ print "plot \"$out_file\" using 1:7 title \"dist\", ";
+ print "\"$out_file\" using 1:7 smooth bezier " .
+ "title \"(Bezier)\" with lines\n";
+ print "set origin 0, 0.00\n";
+ print "set size 1, 0.35\n";
+ print "set xlabel \"Days relative to 1970\"\n";
+ print "plot \"$out_file\" using 1:8 title \"disp\", ";
+ print "\"$out_file\" using 1:8 smooth bezier " .
+ "title \"(Bezier)\" with lines\n";
+ print "set nomultiplot\n";
+ maybe_add_pause;
+
+ select $oldfh;
+ close OUTPUT or die "close failed on $cmd_file: $!";
+ print `gnuplot $cmd_file`;
+ unlink $cmd_file;
+ unlink $out_file;
+}
+
+@plot_summary_opts@
+
+1;
+__END__
diff --git a/scripts/plot_summary.man.in b/scripts/plot_summary.man.in
new file mode 100644
index 0000000..c2394fa
--- /dev/null
+++ b/scripts/plot_summary.man.in
@@ -0,0 +1,114 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH plot_summary 1plot_summaryman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-L.aO0H/ag-X.aWZH)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:47 AM by AutoGen 5.18.5pre4
+.\" From the definitions plot_summary-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]plot_summary\fP
+\- plot statistics generated by summary script
+.SH SYNOPSIS
+\f\*[B-Font]plot_summary\fP
+[\f\*[B-Font]\-\-option-name\f[]]
+[\f\*[B-Font]\-\-option-name\f[] \f\*[I-Font]value\f[]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH "DESCRIPTION"
+There is no description for this command.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-\-directory\f[]=\f\*[I-Font]string\f[]
+Where the summary files are.
+The default
+\f\*[I-Font]string\f[]
+for this option is:
+.ti +4
+ /tmp
+.sp
+ The directory where the \fBplot_summary\fP will search for the
+ *_summary files generated by \fBsummary\fP script.
+.TP
+.NOP \f\*[B-Font]\-\-identifier\f[]=\f\*[I-Font]string\f[]
+Origin of the data.
+.sp
+ Where does the plotted data come from, default to string "host" plus
+ current hostname
+.TP
+.NOP \f\*[B-Font]\-\-offset\-limit\f[]=\f\*[I-Font]float\f[]
+Limit of absolute offset.
+The default
+\f\*[I-Font]float\f[]
+for this option is:
+.ti +4
+ 0.128
+.sp
+.TP
+.NOP \f\*[B-Font]\-\-peer\f[]=\f\*[I-Font]string\f[]
+Peers to generate plots for.
+This option may appear an unlimited number of times.
+.sp
+ By default the peer_summary plots are not generated. Use this option to
+ specify list of peers if you want to generate plots for them.
+.TP
+.NOP \f\*[B-Font]\-\-plot\-term\f[]=\f\*[I-Font]string\f[]
+Gnuplot terminal.
+.sp
+ This is string is passed directly to the \fBgnuplot set terminal\fP
+ command. Default is \fBx11\fP if \fBDISPLAY\fP is set and
+ \fBdumb\fP is it's not'. See output from @code(gnuplot \-e "set
+ terminal") for the list of avalaible options.
+.TP
+.NOP \f\*[B-Font]\-\-output\-file\f[]=\f\*[I-Font]str\f[]
+Output file.
+.sp
+ Output file for \fBgnuplot\fP, default to stdout.
+.TP
+.NOP \f\*[B-Font]\-\-dont\-wait\f[]
+Don't wait for keystroke between plots.
+.sp
+.TP
+.NOP \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBplot_summary\fP
+option definitions.
diff --git a/scripts/plot_summary.mdoc.in b/scripts/plot_summary.mdoc.in
new file mode 100644
index 0000000..583994a
--- /dev/null
+++ b/scripts/plot_summary.mdoc.in
@@ -0,0 +1,88 @@
+.Dd December 2 2014
+.Dt PLOT_SUMMARY 1plot_summarymdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (plot_summary-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:48 AM by AutoGen 5.18.5pre4
+.\" From the definitions plot_summary-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm plot_summary
+.Nd plot statistics generated by summary script
+.Sh SYNOPSIS
+.Nm
+.Op Fl \-option\-name
+.Op Fl \-option\-name Ar value
+.Pp
+All arguments must be options.
+.Pp
+.Sh "DESCRIPTION"
+There is no description for this command.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl \-directory Ns = Ns Ar string
+Where the summary files are.
+The default
+.Ar string
+for this option is:
+.ti +4
+ /tmp
+.sp
+ The directory where the \fBplot_summary\fP will search for the
+ *_summary files generated by \fBsummary\fP script.
+.It Fl \-identifier Ns = Ns Ar string
+Origin of the data.
+.sp
+ Where does the plotted data come from, default to string "host" plus
+ current hostname
+.It Fl \-offset\-limit Ns = Ns Ar float
+Limit of absolute offset.
+The default
+.Ar float
+for this option is:
+.ti +4
+ 0.128
+.sp
+.It Fl \-peer Ns = Ns Ar string
+Peers to generate plots for.
+This option may appear an unlimited number of times.
+.sp
+ By default the peer_summary plots are not generated. Use this option to
+ specify list of peers if you want to generate plots for them.
+.It Fl \-plot\-term Ns = Ns Ar string
+Gnuplot terminal.
+.sp
+ This is string is passed directly to the \fBgnuplot set terminal\fP
+ command. Default is \fBx11\fP if \fBDISPLAY\fP is set and
+ \fBdumb\fP is it's not'. See output from @code(gnuplot \-e "set
+ terminal") for the list of avalaible options.
+.It Fl \-output\-file Ns = Ns Ar str
+Output file.
+.sp
+ Output file for \fBgnuplot\fP, default to stdout.
+.It Fl \-dont\-wait
+Don't wait for keystroke between plots.
+.sp
+.It Fl \-help
+Display usage information and exit.
+.It Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBplot_summary\fP
+option definitions.
diff --git a/scripts/plot_summary.texi b/scripts/plot_summary.texi
new file mode 100644
index 0000000..33fa1fd
--- /dev/null
+++ b/scripts/plot_summary.texi
@@ -0,0 +1,40 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename plot_summary.info
+@settitle Plot_summary User's Manual
+@include ../sntp/include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of @code{plot_summary},
+a program from the NTP Project
+@end ifinfo
+
+@direntry
+* plot_summary: (plot_summary). Summarize (something)
+@end direntry
+
+@titlepage
+@title plot_summary User's Manual
+@subtitle plot_summary, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@c @page
+@c @vskip 0pt plus 1filll
+
+@node Top, plot_summary Description, (dir), (dir)
+@top Plot_summary User Manual
+
+This document describes the use of the NTP Project's @code{plot_summary} program.
+This document applies to version @value{VERSION} of @code{plot_summary}.
+
+@shortcontents
+
+@menu
+* plot_summary Description:: Description
+* plot_summary Invocation:: Invoking plot_summary
+@end menu
+
+@include invoke-plot_summary.texi
diff --git a/scripts/rc/README b/scripts/rc/README
new file mode 100644
index 0000000..f5b82bc
--- /dev/null
+++ b/scripts/rc/README
@@ -0,0 +1,13 @@
+This directory contains some example rc scripts for ntpd.
+
+In general, ntpd should be started as soon as possible in the boot process. If
+any services require stable system clock, the ntpwait script should be run
+before them as late as possible.
+
+The rc.d contains scripts for systems using rc.d init system (originated in
+NetBSD). If a service requires stable system time, indicate it with TIMESYNC
+dependency and set ntpwait_enable to YES.
+
+For SysV init systems, you'll have to create links as /etc/rc2.d/S20ntpd and
+/etc/rc2.d/S80ntpwait yourself. (The numbers are just examples, try to give
+ntpd as much time as possible to synchronize before running ntpwait).
diff --git a/scripts/rc/ntpd b/scripts/rc/ntpd
new file mode 100644
index 0000000..9896247
--- /dev/null
+++ b/scripts/rc/ntpd
@@ -0,0 +1,88 @@
+#!/bin/sh
+
+NTPD=/usr/sbin/ntpd
+PIDFILE=/var/run/ntpd.pid
+USER=ntp
+GROUP=ntp
+NTPD_OPTS="-g -u $USER:$GROUP -p $PIDFILE"
+
+ntpd_start() {
+ if [ -r $PIDFILE ]; then
+ echo "ntpd seems to be already running under pid `cat $PIDFILE`."
+ echo "Delete $PIDFILE if this is not the case.";
+ return 1;
+ fi
+ echo -n "Starting NTP daemon... "
+
+ $NTPD $NTPD_OPTS
+
+ # You can't always rely on the ntpd exit code, see Bug #2420
+ # case "$?" in
+ # 0) echo "OK!"
+ # return 0;;
+ # *) echo "FAILED!"
+ # return 1;;
+ # esac
+
+ sleep 1
+
+ if ps -Ao args|grep -q "^$NTPD $NTPD_OPTS"; then
+ echo "OK!"
+ return 0
+ else
+ echo "FAILED!"
+ [ -e $PIDFILE ] && rm $PIDFILE
+ return 1
+ fi
+}
+
+ntpd_stop() {
+ if [ ! -r $PIDFILE ]; then
+ echo "ntpd doesn't seem to be running, cannot read the pid file."
+ return 1;
+ fi
+ echo -n "Stopping NTP daemon...";
+ PID=`cat $PIDFILE`
+
+ if kill -TERM $PID 2> /dev/null;then
+ # Give ntp 15 seconds to exit
+ for i in `seq 1 15`; do
+ if [ -n "`ps -p $PID|grep -v PID`" ]; then
+ echo -n .
+ sleep 1
+ else
+ echo " OK!"
+ rm $PIDFILE
+ return 0
+ fi
+ done
+ fi
+
+ echo " FAILED! ntpd is still running";
+ return 1
+}
+
+ntpd_status() {
+ if [ -r $PIDFILE ]; then
+ echo "NTP daemon is running as `cat $PIDFILE`"
+ else
+ echo "NTP daemon is not running"
+ fi
+}
+
+case "$1" in
+ 'start')
+ ntpd_start
+ ;;
+ 'stop')
+ ntpd_stop
+ ;;
+ 'restart')
+ ntpd_stop && ntpd_start
+ ;;
+ 'status')
+ ntpd_status
+ ;;
+ *)
+ echo "Usage: $0 (start|stop|restart|status)"
+esac
diff --git a/scripts/rc/ntpwait b/scripts/rc/ntpwait
new file mode 100644
index 0000000..2542b2a
--- /dev/null
+++ b/scripts/rc/ntpwait
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+NTPWAIT=/usr/sbin/ntpwait
+
+ntpwait_start() {
+ $NTPWAIT -v
+}
+
+case "$1" in
+ 'start')
+ ntpwait_start
+ ;;
+ *)
+ echo "Usage: $0 (start)"
+esac
diff --git a/scripts/rc/rc.d/TIMESYNC b/scripts/rc/rc.d/TIMESYNC
new file mode 100644
index 0000000..a8c074f
--- /dev/null
+++ b/scripts/rc/rc.d/TIMESYNC
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# PROVIDE: TIMESYNC
+# REQUIRE: LOGIN ntpwait
+
+# This depedency ensures that all services which require stable system clock
+# are run after ntpd is synchronized. It's run as late as possible, if you need
+# stable clock before login use BEFORE: LOGIN
diff --git a/scripts/rc/rc.d/ntpd b/scripts/rc/rc.d/ntpd
new file mode 100644
index 0000000..ea33458
--- /dev/null
+++ b/scripts/rc/rc.d/ntpd
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# PROVIDE: ntpd
+# REQUIRE: syslogd cleanvar devfs
+# BEFORE: SERVERS
+
+. /etc/rc.subr
+
+name="ntpd"
+rcvar="ntpd_enable"
+command="/usr/sbin/${name}"
+pidfile="/var/run/${name}.pid"
+start_precmd="ntpd_precmd"
+
+load_rc_config $name
+
+ntpd_precmd()
+{
+ rc_flags="-c ${ntpd_config} ${ntpd_flags}"
+
+ if checkyesno ntpd_sync_on_start; then
+ rc_flags="-g $rc_flags"
+ fi
+
+ if [ -z "$ntpd_chrootdir" ]; then
+ return 0;
+ fi
+
+ rc_flags="-u ntpd:ntpd -i ${ntpd_chrootdir} $rc_flags"
+}
+
+run_rc_command "$1"
diff --git a/scripts/rc/rc.d/ntpwait b/scripts/rc/rc.d/ntpwait
new file mode 100644
index 0000000..891d0db
--- /dev/null
+++ b/scripts/rc/rc.d/ntpwait
@@ -0,0 +1,21 @@
+#!/bin/sh
+# This script, when run, runs ntp-wait if ntpd is enabled.
+
+# PROVIDE: ntpwait
+
+. /etc/rc.subr
+
+name="ntpwait"
+rcvar="ntpwait_enable"
+start_cmd="ntpwait_start"
+ntp_wait="/usr/sbin/ntp-wait"
+
+load_rc_config "$name"
+
+ntpwait_start() {
+ if checkyesno ntpd_enable; then
+ $ntp_wait -v
+ fi
+}
+
+run_rc_command "$1"
diff --git a/scripts/stats/README b/scripts/stats/README
new file mode 100644
index 0000000..6808963
--- /dev/null
+++ b/scripts/stats/README
@@ -0,0 +1,39 @@
+Statistics processing scripts (README)
+
+This directory contains a number of scripts for use with the filegen
+facility. Those files ending in .awk are for the Unix awk utility, while
+those ending in .sh are for the csh utility. Normally, the summary.sh
+script is called from a cron job once per day. This script processes the
+daily loopstats, peerstats and clockstats files produced by the daemon,
+updates the loop_summary, peer_summary and clock_summary archive files,
+and deletes the daily files.
+
+In the case of the Austron 2201A GPS receiver, the clockstats file
+contains a wealth of additional monitoring data. These data are summarized
+and writted to the clock_summary file, then a series of special files are
+constructed for later processing by the S utility.
+
+The summary.sh script invokes a number of awk scripts to actually produce
+the data. This may result in multiple scans of the same input file.
+The input file is deleted after processing. In fact, the shell scripts will
+process all input files found of the correct type in chronological order,
+deleting each one as it is scanned, except the current day file.
+
+The summary.sh script can produce input files for the S utility, if it
+is found on the search path. This utility makes PostScript graphs of the
+loopstats data for each day, as well as various statistics produced by
+the Austorn 220aA GPS receiver. The S utility is automatically run
+as a background job. Its control files have the .S extension.
+
+The psummary.awk script can be used to scan the peer_summary file and
+construct an historical reprise of the daily summaries.
+
+The file formats are documented in the README.stats file and in the
+scripts themselves. Further detail on the radio clock ASCII timecode
+formats and related data are in the README.timecode file.
+
+David L. Mills
+University of Delaware
+mills@udel.edu
+1 November 1993
+Revised 12 April 1994
diff --git a/scripts/stats/README.stats b/scripts/stats/README.stats
new file mode 100644
index 0000000..aa8e77f
--- /dev/null
+++ b/scripts/stats/README.stats
@@ -0,0 +1,246 @@
+Statistics file formats (README.stats)
+
+The xntp3 daemon can produce a variety of statistics files which are
+useful for maintenance, evaluation and retrospective calibration
+purposes. See the xntpd.8 man page for instructions on how to configure
+this feature. Since these files can become rather large and cumbersome,
+they are ordinarily reduced to summary form by running the summary.sh
+shell script once per day, week or month, as appropriate. There are
+three file collections presently defined: peerstats, loopstats and
+clockstats, each of which is described in this note.
+
+peerstats
+
+The following data are collected in the peerstats files. The files are
+reduced to summary data using the peer.sh shell script. See the peer.awk
+script for further information. A line in the file is produced upon
+reception of each valid update from a configured peer.
+
+ 49236 30.756 140.173.96.1 9474 0.000603 0.37532
+
+ 49236 modified Julian day number
+ 30.756 time of day (s) past midnight UTC
+ 140.173.96.1 peer identifier (IP address or receiver identifier)
+ 9474 peer status word (hex) (see NTP specification)
+ 0.000603 offset (s)
+ 0.08929 delay (s)
+ 0.37532 dispersion (s)
+
+loopstats
+
+The following data are collected in the loopstats files. The files are
+reduced to summary data using the loop.sh shell script. See the loop.awk
+script for further information. A line in the file is produced at each
+valid update of the local clock.
+
+ 49236 11.897 -0.000004 -35.9384 0
+
+ 49236 modified Julian day number
+ 11.897 time of day (s) past midnight UTC
+ -0.000004 time offset (s)
+ -35.9384 frequency offset (ppm)
+ 0 phase-lock loop time constant
+
+clockstats
+
+The following data are collected in the clockstats files. The files are
+reduced to summary data using the clock.sh shell script, which also
+updates the ensemble, etf, itf and tdata data files as well. See the
+clock.awk, ensemble.awk, etf.awk, itf.awk and tdta.awk scripts for
+further information. A line in the file is produced at each valid update
+received from a configured radio clock. Data are at present recorded for
+several radios. The first part of each data line is similar for all
+radios, e.g.:
+
+ 49234 60517.826 127.127.4.1 93 247 16:48:21.814
+
+ 49234 modified Julian day number
+ 60517.826 time of day (s) past midnight UTC
+ 127.127.4.1 receiver identifier (Spectracom 8170/Netclock-2)
+ 93 247 16:48:21.814 timecode (format varies)
+
+In the case of the Austron GPS receiver, a good deal of additional
+information is extracted from the radio, as described below. The formats
+shown consist of one line with all the fields shown in order. The
+timecode formats specific to each radio follow. See the file
+README.timecodes for detailed information on the timecode formats used
+by these radios.
+
+Spectracom 8170/Netclock-2 WWVB receiver
+
+ 49234 60517.826 127.127.4.1 ?A93 247 16:48:21.814
+
+ The '?' and 'A' characters are present only when the receiver is
+ unsynchronized; otherwise, they are replaced by space ' ' characters.
+
+IRIG audio decoder
+
+ 49234 60517.826 127.127.6.0 247 16:48:21?
+
+ The '?' character is present only when the receiver is unsynchronized.
+
+Austron 2200A/2201A GPS receiver
+
+ 49234 60580.843 127.127.10.1 93:247:16:49:24.814?
+
+ The '?' character is present only when the receiver is unsynchronized.
+
+Depending on the installed options, the Austron 2200A/2201A recognizes a
+number of special commands that report various data items. See the
+refclock_as2201.c source module for a list of the commands used. These
+data are collected only if the following line is included in the
+configuration file ntp.conf:
+
+ fudge 127.127.10.1 flag4 1 # enable extended statistics collection
+
+The format of each data line returned is summarized in the following
+list.
+
+External time/frequency data (requires input buffer option IN)
+
+These data determine the deviations of external time/frequency inputs
+relative to receiver oscillator time. The following data are typical
+using an external cesium oscillator PPS and 5-MHz outputs.
+
+ 49234 60580.843 127.127.10.1 93:247:16:49:24.814 ETF
+
+ -85.9 time interval (ns)
+ -89.0 average time interval (ns)
+ 4.0 time interval sigma (ns)
+ +1.510E-11 time interval rate
+ -4.500E-11 deltaf/f
+ +1.592E-11 average deltaf/f
+ 5.297E-13 sigma deltaf/f
+ 500 number of samples
+
+Model and option identifiers
+
+These data show the receiver model number and option configuration.
+
+ 49234 60708.848 127.127.10.1 93:247:16:51:32.817 ID;OPT;VER
+
+ GPS 2201A model ident (must be "GPS 2200A" or "GPS 2201A")
+ TTY1 rs232 option present (required)
+ TC1 IRIG option present (optional)
+ LORAN LORAN assist option present (optional)
+ IN input buffer option present (optional)
+ OUT1 output buffer option present (required)
+ B.00 data processor software version ("B.00" or later)
+ B.00 signal processor software version ("B.00" or later)
+ 28-Apr-93 software version date ("28-Apr-93" or later)
+
+Internal time/frequency data
+
+These data determine the deviations of the receiver oscillator with
+respect to satellite time.
+
+ 49234 60564.846 127.127.10.1 93:247:16:49:08.816 ITF
+
+ COCO current mode (must be "COCO")
+ 0 code coast mode (must be zero)
+ +6.6152E-08 code sigma (s)
+ -3.5053E-08 code delta t (s)
+ -4.0361E-11 deltat/t
+ -6.4746E-11 oscillator ageing rate
+ 500.00 loop time constant
+ 4.984072 electrical tuning (V)
+
+GPS/LORAN ensemble data (requires LORAN assist option LORAN)
+
+These data determine the deviations and weights to calculate ensemble
+time from GPS and LORAN data.
+
+ 49234 60596.852 127.127.10.1 93:247:16:49:40.812 LORAN ENSEMBLE
+
+ +9.06E-08 GPS t (s)
+ +3.53E-08 GPS sigma (s)
+ .532 GPS weight
+ +3.71E-08 LORAN t (s)
+ +3.76E-08 LORAN sigma (s)
+ .468 LORAN weight
+ +6.56E-08 ensemble t
+ +6.94E-08 ensemble sigma (s)
+
+LORAN stationkeeping data (requires LORAN assist option LORAN)
+
+These data determine which stations of the LORAN chain are being
+tracked, together with individual signal/noise ratios, deviations and
+weights.
+
+ 49234 60532.850 127.127.10.1 93:247:16:48:36.820 LORAN TDATA
+
+ M station identifier; data follows
+ OK status (must be "OK" for tracking)
+ 0 cw flag
+ 0 sw flag
+ 1162.17 time of arrival
+ -4.6 snr (-30.0 if not "OK" status)
+ 1.67E-07 2-sample phase-time deviation
+ .507 weight (included only if "OK" status)
+ W AQ 0 0 3387.80 -31.0 station identifier and data
+ X OK 0 0 1740.27 -11.2 2.20E-07 .294 station identifier and data
+ Y OK 0 0 2180.71 -4.6 2.68E-07 .198 station identifier and data
+ Z CV 0 0 3392.94 -30.0 station identifier and data
+
+Oscillator status and environment
+
+These data determine the receiver oscillator type, mode, status and
+environment. Nominal operating conditions are shown below.
+
+ 49234 60628.847 127.127.10.1 93:247:16:50:12.817 OSC;ET;TEMP
+
+ 1121 Software Control oscillator model and mode (must be
+ "Software Control")
+ Locked status (must be "Locked")
+ 4.979905 electrical tuning (V)
+ 44.81 oscillator cavity temperature
+
+Receiver position, status and offsets
+
+These data determine the receiver position and elevation, together with
+programmable delay corrections for the antenna cable and receiver.
+
+ 49234 60788.847 127.127.10.1 93:247:16:52:52.817 POS;PPS;PPSOFF
+
+ +39:40:48.425 receiver latitude (N)
+ -075:45:02.392 receiver longitude (E)
+ +74.09 receiver elevation (m)
+ Stored position status (must be "Stored")
+ UTC PPS/PPM alignment (must be "UTC")
+ 0 receiver delay (ns) (should be zero for calibrated
+ receiver)
+ 200 cable delay (ns)
+ 0 user time bias (ns) (must be zero)
+
+Satellite tracking status
+
+These data determine how many satellites are being tracked. At the
+present state of constellation development, there should be at least
+three visible satellites in view. Much of the time the maximum of
+seven are being tracked; rarely this number drops to two.
+
+ 49234 60612.850 127.127.10.1 93:247:16:49:56.820 TRSTAT
+
+ 24 T satellite prn and status (T = track, A = acquire)
+ 16 A 13 T 20 T 18 T 07 T 12 T list continued
+
+UTC leap-second information
+
+These data determine when the next leap second is to occur. The exact
+method to use is obscure.
+
+ 49234 60548.847 127.127.10.1 93:247:16:48:52.818 UTC
+
+ -1.2107E-08 A0 term (s)
+ -1.2790E-13 A1 term (s)
+ +9.0000E+00 current leap seconds (s)
+ +2.0480E+05 time for leap seconds (s)
+ +2.0100E+02 week number for delta leap (weeks)
+ +1.9100E+02 week number for future leap (weeks)
+ +4.0000E+00 day number for future leap (days)
+ +9.0000E+00 future leap seconds (s)
+
+David L. Mills
+University of Delaware
+mills@udel.edu
+23 October 1993
diff --git a/scripts/stats/README.timecodes b/scripts/stats/README.timecodes
new file mode 100644
index 0000000..00b5ba5
--- /dev/null
+++ b/scripts/stats/README.timecodes
@@ -0,0 +1,149 @@
+Radio Timecode Formats (README.timecodes)
+
+Following are examples of the serial timecode formats used by various
+timecode receivers as given in the instruction manuals. These examples
+are intended only for illustration and not as the basis of system
+design. The following symbols are used to identify the timecode
+character that begins a subfield. The values given after this symbol
+represent the character offset from the beginning of the timecode string
+as edited to remove control characters.
+
+C on-time character (start bit)
+Y year of century
+T time of day
+D day of year or month/day
+A alarm indicator (format specific)
+Q quality indicator (format specific)
+<LF> ASCII line feed (hex 0a)
+<CR> ASCII carriage return (hex 0d)
+<SP> ASCII space (hex 20)
+
+In order to promote uniform behavior in the various implementations, it
+is useful to have a common interpretation of alarm conditions and signal
+quality. When the alarm indicator it on, the receiver is not operating
+correctly or has never synchronized to the broadcast signal. When the
+alarm indicator is off and the quality indicator is on, the receiver has
+synchronized to the broadcast signal, then lost the signal and is
+coasting on its internal oscillator.
+
+In the following uppercase letters, punctuation marks and spaces <SP>
+stand for themselves; lowercase letters stand for fields as described.
+Special characters other than <LF>, <CR> and <SP> are preceded by ^.
+
+Spectracom 8170 and Netclock/2 WWV Synchonized Clock (format 0)
+
+"<CR><LF>i ddd hh:mm:ss TZ=zz<CR><LF>"
+ C A D T
+
+ poll: ?; offsets: Y = none, D = 3, T = 7, A = 0, Q = none
+ i = synchronization flag (<SP> = in synch, ? = out synch)
+ ddd = day of year
+ hh:mm:ss = hours, minutes, seconds
+ zz = timezone offset (hours from UTC)
+
+ Note: alarm condition is indicated by other than <SP> at A, which
+ occurs during initial synchronization and when received signal has
+ been lost for about ten hours
+
+ example: " 216 15:36:43 TZ=0"
+ A D T
+
+Netclock/2 WWV Synchonized Clock (format 2)
+
+"<CR><LF>iqyy ddd hh:mm:ss.fff ld"
+ C AQY D T
+
+ poll: ?; offsets: Y = 2, D = 5, T = 9, A = 0, Q = 1
+ i = synchronization flag (<SP> = in synch, ? = out synch)
+ q = quality indicator (<SP> < 1ms, A < 10 ms, B < 100 ms, C < 500
+ ms, D > 500 ms)
+ yy = year (as broadcast)
+ ddd = day of year
+ hh:mm:ss.fff = hours, minutes, seconds, milliseconds of day
+ l = leap-second warning (L indicates leap at end of month)
+ d = standard/daylight time indicator (<SP> standard, D daylight)
+
+ Note: alarm condition is indicated by other than <SP> at A, which
+ occurs during initial synchronization and when received signal has
+ been lost for about ten hours; unlock condition is indicated by
+ other than <SP> at Q, with time since last lock indicated by the
+ letter code A < 13 min, B < 1.5 hr, C < 7 hr, D > 7 hr.
+
+ example: " 92 216 15:36:43.640 D"
+ AQ D T
+
+TrueTime 468-DC Satellite Synchronized Clock (and other TrueTime
+receivers)
+
+"<CR><LF><^A>ddd:hh:mm:ssq<CR>"
+ D T QC
+
+ poll: none; offsets: Y = none, D = 0, T = 4, A = 12, Q = 12
+ hh:mm:ss = hours, minutes, seconds
+ q = quality/alarm indicator (<SP> = locked, ? = alarm)
+
+ Note: alarm condition is indicated by ? at A, which occurs during
+ initial synchronization and when received signal is lost for an
+ extended period; unlock condition is indicated by other than <SP>
+ at Q
+
+ example: "216:15:36:43 "
+ D T Q
+
+Heath GC-1000 Most Accurate Clock (WWV/H)
+
+"<CR>hh:mm:ss.f dd/mm/yy<CR>"
+ C T A D
+
+ poll: none; offsets: Y = none, D = 15, T = 0, A = 9, Q = none
+ hh:mm:ss = hours, minutes, seconds
+ f = deciseconds (? when out of spec)
+ dd/mm = day, month
+ yy = year of century (from DIPswitches)
+
+ Note: 0?:??:??.? is displayed before synch is first established and
+ hh:mm:ss.? once synch is established and then lost again for about
+ a day.
+
+ example: "15:36:43.6 04/08/91"
+ T A D Y
+
+PST/Traconex 1020 Time Source (WWV/H) (firmware revision V4.01)
+
+"frdzycchhSSFTttttuuxx<CR>" "ahh:mm:ss.fffs<CR>" "yy/dd/mm/ddd<CR>"
+ A Q T Y D
+
+ poll: "QMQDQT"; offsets: Y = 0, D = 3 T = 1,, A = 11, Q = 13
+ f = frequency enable (O = all frequencies enabled)
+ r = baud rate (3 = 1200, 6 = 9600)
+ d = features indicator (@ = month/day display enabled)
+ z = time zone (0 = UTC)
+ y = year (5 = 1991)
+ cc = WWV propagation delay (52 = 22 ms)
+ hh = WWVH propagation delay (81 = 33 ms)
+ SS = status (80 or 82 = operating correctly)
+ F = current receive frequency (1-5 = 2.5, 5, 10, 15, 20 MHz)
+ T = transmitter (C = WWV, H = WWVH)
+ tttt = time since last update (minutes)
+ uu = flush character (03 = ^C)
+ xx = 94 (unknown) (firmware revision X4.01.999 only)
+
+ a = AM/PM indicator (A = AM, P = PM, <SP> - 24-hour format)
+ hh:mm:ss.fff = hours, minutes, seconds, milliseconds of day
+ s = daylight-saving indicator (<SP> standard, D daylight)
+
+ yy = year of century (from DIPswitches)
+ dd/mm/ddd = day of month, month of year, day of year
+
+ Note: The alarm condition is indicated by other than ? at A, which
+ occurs during initial synchronization and when received signal is
+ lost for an extended period. A receiver unlock condition is
+ indicated by other than "0000" in the tttt subfield at Q.
+
+ example: "O3@055281824C00000394 91/08/04/216 15:36:43.640"
+ T Y D T
+
+David L. Mills
+University of Delaware
+mills@udel.edu
+23 October 1993
diff --git a/scripts/stats/clock.awk b/scripts/stats/clock.awk
new file mode 100755
index 0000000..ef62da9
--- /dev/null
+++ b/scripts/stats/clock.awk
@@ -0,0 +1,431 @@
+# awk program to scan clockstat files and report errors/statistics
+#
+# usage: awk -f check.awk clockstats
+#
+# This program works for the following radios:
+# PST/Traconex 1020 WWV reciever
+# Arbiter 1088 GPS receiver
+# Spectracom 8170/Netclock-2 WWVB receiver
+# IRIG audio decoder
+# Austron 2200A/2201A GPS receiver (see README.austron file)
+#
+BEGIN {
+ etf_min = osc_vmin = osc_tmin = 1e9
+ etf_max = osc_vmax = osc_tmax = -1e9
+}
+#
+# scan all records in file
+#
+{
+ #
+ # select PST/Traconex WWV records
+ # 00:00:37.234 96/07/08/190 O6@0:5281825C07510394
+ #
+ if (NF >= 4 && $3 == "127.127.3.1") {
+ if (substr($6, 14, 4) > "0010")
+ wwv_sync++
+ if (substr($6, 13, 1) == "C")
+ wwv_wwv++
+ if (substr($6, 13, 1) == "H")
+ wwv_wwvh++
+ x = substr($6, 12, 1)
+ if (x == "1")
+ wwv_2.5++
+ else if (x == "2")
+ wwv_5++
+ else if (x == "3")
+ wwv_10++
+ else if (x == "4")
+ wwv_15++
+ else if (x == "5")
+ wwv_20++
+ continue
+ }
+ #
+ # select Arbiter GPS records
+ # 96 190 00:00:37.000 0 V=08 S=44 T=3 P=10.6 E=00
+ # N39:42:00.951 W075:46:54.880 210.55 2.50 0.00
+ #
+ if (NF >= 4 && $3 == "127.127.11.1") {
+ if (NF > 8) {
+ arb_count++
+ if ($7 != 0)
+ arb_sync++
+ x = substr($10, 3, 1)
+ if (x == "0")
+ arb_0++
+ else if (x == "1")
+ arb_1++
+ else if (x == "2")
+ arb_2++
+ else if (x == "3")
+ arb_3++
+ else if (x == "4")
+ arb_4++
+ else if (x == "5")
+ arb_5++
+ else if (x == "6")
+ arb_6++
+ } else if (NF == 8) {
+ arbn++
+ arb_mean += $7
+ arb_rms += $7 * $7
+ if (arbn > 0) {
+ x = $7 - arb_val
+ arb_var += x * x
+ }
+ arb_val = $7
+ }
+ continue
+ }
+ #
+ # select Spectracom WWVB records
+ # see summary for decode
+ # 96 189 23:59:32.248 D
+ #
+ if (NF >= 4 && $3 == "127.127.4.1") {
+ if ($4 == "SIGNAL" || NF > 7)
+ printf "%s\n", $0
+ else {
+ wwvb_count++
+ if ($4 ~ /\?/)
+ wwvb_x++
+ else if ($4 ~ /A/)
+ wwvb_a++
+ else if ($4 ~ /B/)
+ wwvb_b++
+ else if ($4 ~ /C/)
+ wwvb_c++
+ else if ($4 ~ /D/)
+ wwvb_d++
+ }
+ continue
+ }
+ #
+ # select IRIG audio decoder records
+ # see summary for decode
+ #
+ if (NF >= 4 && $3 == "127.127.6.0") {
+ irig_count++
+ if ($5 ~ /\?/)
+ irig_error++
+ continue
+ }
+ #
+ # select Austron GPS LORAN ENSEMBLE records
+ # see summary for decode
+ #
+ else if (NF >= 13 && $6 == "ENSEMBLE") {
+ ensemble_count++
+ if ($9 <= 0)
+ ensemble_badgps++
+ else if ($12 <= 0)
+ ensemble_badloran++
+ else {
+ if ($13 > 200e-9 || $13 < -200e-9)
+ ensemble_200++
+ else if ($13 > 100e-9 || $13 < -100e-9)
+ ensemble_100++
+ ensemble_mean += $13
+ ensemble_rms += $13 * $13
+ }
+ continue
+ }
+ #
+ # select Austron LORAN TDATA records
+ # see summary for decode; note that signal quality log is simply
+ # copied to output
+ #
+ else if (NF >= 7 && $6 == "TDATA") {
+ tdata_count++
+ for (i = 7; i < NF; i++) {
+ if ($i == "M" && $(i+1) == "OK") {
+ i += 5
+ m += $i
+ tdata_m++
+ }
+ else if ($i == "W" && $(i+1) == "OK") {
+ i += 5
+ w += $i
+ tdata_w++
+ }
+ else if ($i == "X" && $(i+1) == "OK") {
+ i += 5
+ x += $i
+ tdata_x++
+ }
+ else if ($i == "Y" && $(i+1) == "OK") {
+ i += 5
+ y += $i
+ tdata_y++
+ }
+ else if ($i == "Z" && $(i+1) == "OK") {
+ i += 5
+ z += $i
+ tdata_z++
+ }
+ }
+ continue
+ }
+ #
+ # select Austron ITF records
+ # see summary for decode
+ #
+ else if (NF >= 13 && $5 == "ITF" && $12 >= 100) {
+ itf_count++
+ if ($9 > 200e-9 || $9 < -200e-9)
+ itf_200++
+ else if ($9 > 100e-9 || $9 < -100e-9)
+ itf_100++
+ itf_mean += $9
+ itf_rms += $9 * $9
+ itf_var += $10 * $10
+ continue
+ }
+ #
+ # select Austron ETF records
+ # see summary for decode
+ #
+ else if (NF >= 13 && $5 == "ETF" && $13 >= 100) {
+ etf_count++
+ if ($6 > etf_max)
+ etf_max = $6
+ else if ($6 < etf_min)
+ etf_min = $6
+ etf_mean += $6
+ etf_rms += $6 * $6
+ etf_var += $9 * $9
+ continue
+ }
+ #
+ # select Austron TRSTAT records
+ # see summary for decode
+ #
+ else if (NF >= 5 && $5 == "TRSTAT") {
+ trstat_count++
+ j = 0
+ for (i = 6; i <= NF; i++)
+ if ($i == "T")
+ j++
+ trstat_sat[j]++
+ continue
+ }
+ #
+ # select Austron ID;OPT;VER records
+ #
+ # config GPS 2201A TTY1 TC1 LORAN IN OUT1 B.00 B.00 28-Apr-93
+ #
+ # GPS 2201A receiver model
+ # TTY1 rs232 moduel
+ # TC1 IRIG module
+ # LORAN LORAN assist module
+ # IN input module
+ # OUT1 output module
+ # B.00 B.00 firmware revision
+ # 28-Apr-9 firmware date3
+ #
+ else if (NF >= 5 && $5 == "ID;OPT;VER") {
+ id_count++
+ id_temp = ""
+ for (i = 6; i <= NF; i++)
+ id_temp = id_temp " " $i
+ if (id_string != id_temp)
+ printf "config%s\n", id_temp
+ id_string = id_temp
+ continue
+ }
+ #
+ # select Austron POS;PPS;PPSOFF records
+ #
+ # position +39:40:48.425 -075:45:02.392 +74.09 Stored UTC 0 200 0
+ #
+ # +39:40:48.425 position north latitude
+ # -075:45:02.392 position east longitude
+ # +74.09 elevation (meters)
+ # Stored position is stored
+ # UTC time is relative to UTC
+ # 0 200 0 PPS offsets
+ #
+ else if (NF >= 5 && $5 == "POS;PPS;PPSOFF") {
+ pos_count++
+ pos_temp = ""
+ for (i = 6; i <= NF; i++)
+ pos_temp = pos_temp " " $i
+ if (pos_string != pos_temp)
+ printf "position%s\n", pos_temp
+ pos_string = pos_temp
+ continue
+ }
+ #
+ # select Austron OSC;ET;TEMP records
+ #
+ # loop 1121 Software Control Locked
+ #
+ # 1121 oscillator type
+ # Software Control loop is under software control
+ # Locked loop is locked
+ #
+ else if (NF >= 5 && $5 == "OSC;ET;TEMP") {
+ osc_count++
+ osc_temp = $6 " " $7 " " $8 " " $9
+ if (osc_status != osc_temp)
+ printf "loop %s\n", osc_temp
+ osc_status = osc_temp
+ if ($10 > osc_vmax)
+ osc_vmax = $10
+ if ($10 < osc_vmin)
+ osc_vmin = $10
+ if ($11 > osc_tmax)
+ osc_tmax = $11
+ if ($11 < osc_tmin)
+ osc_tmin = $11
+ continue
+ }
+ #
+ # select Austron UTC records
+ # these ain't ready yet
+ #
+ else if (NF >= 5 && $5 == "UTC") {
+ utc_count++
+ utc_temp = ""
+ for (i = 6; i <= NF; i++)
+ utc_temp = utc_temp " " $i
+ if (utc_string != utc_temp)
+# printf "utc%s\n", utc_temp
+ utc_string = utc_temp
+ continue
+ }
+} END {
+#
+# PST/Traconex WWV summary data
+#
+ if (wwv_wwv + wwv_wwvh > 0)
+ printf "wwv %d, wwvh %d, err %d, MHz (2.5) %d, (5) %d, (10) %d, (15) %d, (20) %d\n", wwv_wwv, wwv_wwvh, wwv_sync, wwv_2.5, wwv_5, wwv_10, wwv_15, wwv_20
+#
+# Arbiter 1088 summary data
+#
+# gps record count
+# err error count
+# sats(0-6) satellites tracked
+# mean 1 PPS mean (us)
+# rms 1 PPS rms error (us)
+# var 1 PPS Allan variance
+#
+ if (arb_count > 0) {
+ printf "gps %d, err %d, sats(0-6) %d %d %d %d %d %d %d", arb_count, arb_sync, arb_0, arb_1, arb_2, arb_3, arb_4, arb_5, arb_6
+ if (arbn > 1) {
+ arb_mean /= arbn
+ arb_rms = sqrt(arb_rms / arbn - arb_mean * arb_mean)
+ arb_var = sqrt(arb_var / (2 * (arbn - 1)))
+ printf ", mean %.2f, rms %.2f, var %.2e\n", arb_mean, arb_rms, arb_var * 1e-6
+ } else {
+ printf "\n"
+ }
+ }
+#
+# ensemble summary data
+#
+# ensemble record count
+# badgps gps data unavailable
+# badloran loran data unavailable
+# rms ensemble rms error (ns)
+# >200 ensemble error >200 ns
+# >100 100 ns < ensemble error < 200 ns
+#
+ if (ensemble_count > 0) {
+ ensemble_mean /= ensemble_count
+ ensemble_rms = sqrt(ensemble_rms / ensemble_count - ensemble_mean * ensemble_mean) * 1e9
+ printf "ensemble %d, badgps %d, badloran %d, rms %.1f, >200 %d, >100 %d\n", ensemble_count, ensemble_badgps, ensemble_badloran, ensemble_rms, ensemble_200, ensemble_100
+ }
+#
+# wwvb summary data
+#
+# wwvb record count
+# ? unsynchronized
+# >1 error > 1 ms
+# >10 error > 10 ms
+# >100 error > 100 ms
+# >500 error > 500 ms
+#
+ if (wwvb_count > 0)
+ printf "wwvb %d, ? %d, >1 %d, >10 %d, >100 %d, >500 %d\n", wwvb_count, wwvb_x, wwvb_a, wwvb_b, wwvb_c, wwvb_d
+#
+# irig summary data
+#
+# irig record count
+# err error count
+#
+ if (irig_count > 0)
+ printf "irig %d, err %d\n", irig_count, irig_error
+#
+# tdata summary data
+#
+# tdata record count
+# m M master OK-count, mean level (dB)
+# w W slave OK-count, mean level (dB)
+# x X slave OK-count, mean level (dB)
+# y Y slave OK-count, mean level (dB)
+# z Z slave OK-count, mean level (dB)
+#
+ if (tdata_count > 0 ) {
+ if (tdata_m > 0)
+ m /= tdata_count
+ if (tdata_x > 0)
+ w /= tdata_count
+ if (tdata_x > 0)
+ x /= tdata_count
+ if (tdata_y > 0)
+ y /= tdata_count
+ if (tdata_z > 0)
+ z /= tdata_count
+ printf "tdata %d, m %d %.1f, w %d %.1f, x %d %.1f, y %d %.1f, z %d %.1f\n", tdata_count, tdata_m, m, tdata_w, w, tdata_x, x, tdata_y, y, tdata_z, z
+ }
+#
+# itf summary data
+#
+# itf record count
+# rms itf rms error (ns)
+# >200 itf error > 200 ns
+# >100 itf error > 100 ns
+# var Allan variance
+#
+ if (itf_count > 1) {
+ itf_mean /= itf_count
+ itf_rms = sqrt(itf_rms / itf_count - itf_mean * itf_mean) * 1e9
+ itf_var = sqrt(itf_var / (2 * (itf_count - 1)))
+ printf "itf %d, rms %.1f, >200 %d, >100 %d, var %.2e\n", itf_count, itf_rms, itf_200, itf_100, itf_var
+ }
+#
+# etf summary data
+#
+# etf record count
+# mean etf mean (ns)
+# rms etf rms error (ns)
+# max etf maximum (ns)
+# min etf minimum (ns)
+# var Allan variance
+#
+ if (etf_count > 0) {
+ etf_mean /= etf_count
+ etf_rms = sqrt(etf_rms / etf_count - etf_mean * etf_mean)
+ etf_var = sqrt(etf_var / (2 * (etf_count - 1)))
+ printf "etf %d, mean %.1f, rms %.1f, max %d, min %d, var %.2e\n", etf_count, etf_mean, etf_rms, etf_max, etf_min, etf_var
+ }
+#
+# trstat summary data
+#
+# trstat record count
+# sat histogram of tracked satellites (0 - 7)
+#
+ if (trstat_count > 0)
+ printf "trstat %d, sat %d %d %d %d %d %d %d %d\n", trstat_count, trstat_sat[0], trstat_sat[1], trstat_sat[2], trstat_sat[2], trstat_sat[3], trstat_sat[4], trstat_sat[5], trstat_sat[6], trstat_sat[7]
+#
+# osc summary data
+#
+# osc record count
+# control control midrange (V) +/- deviation (mV)
+# temp oven temperature midrange +/- deviation (deg C)
+#
+ if (osc_count > 0)
+ printf "osc %d, control %.3f+/-%.3f, temp %.1f+/-%.2f\n", osc_count, (osc_vmax + osc_vmin) / 2, (osc_vmax - osc_vmin) / 2 * 1e3, (osc_tmax + osc_tmin) / 2, (osc_tmax - osc_tmin) / 2
+}
diff --git a/scripts/stats/dupe.awk b/scripts/stats/dupe.awk
new file mode 100755
index 0000000..317c2a4
--- /dev/null
+++ b/scripts/stats/dupe.awk
@@ -0,0 +1,8 @@
+#
+# delete duplicate lines
+#
+{
+ if (old != $0)
+ printf "%s\n", $0
+ old = $0
+}
diff --git a/scripts/stats/ensemble.S b/scripts/stats/ensemble.S
new file mode 100755
index 0000000..32a4dba
--- /dev/null
+++ b/scripts/stats/ensemble.S
@@ -0,0 +1,5 @@
+ensemble <- scan(file1, list(day=0, sec=0, gps=0, gpsw=0, loran=0, loranw=0, ensemble=0, std=0))
+str <- paste("eps/", file1, ".eps", sep="")
+postscript(str, , , , 5, pointsize=18)
+par(mgp=c(1, 0, 0), tck = 0.03, mar = c(2, 2, 1, 1))
+plot(ensemble$sec, ensemble$ensemble, type="l", xlab=paste("MJD", ensemble$day, "Time (s)"), ylab="Ensemble Offset (ns)", ylim=c(-400, 400))
diff --git a/scripts/stats/ensemble.awk b/scripts/stats/ensemble.awk
new file mode 100755
index 0000000..136b33d
--- /dev/null
+++ b/scripts/stats/ensemble.awk
@@ -0,0 +1,17 @@
+# program to produce loran ensemble statistics from clockstats files
+#
+# usage: awk -f ensemble.awk clockstats
+#
+# format of input record (time values in seconds)
+# 49165 8.628 127.127.10.1 93:178:00:00:07.241 LORAN ENSEMBLE
+# -6.43E-08 +5.02E-08 .091 +5.98E-08 +1.59E-08 .909 +4.85E-08 +3.52E-08
+#
+# format of output record (time values in nanoseconds)
+# MJD sec GPS wgt LORAN wgt avg sigma
+# 49165 8.628 -64.3 0.091 59.8 0.909 48.5 35.2
+#
+# select LORAN ENSEMBLE records with valid format and weights
+{
+ if (NF >= 14 && $6 == "ENSEMBLE" && $9 > 0 && $12 > 0)
+ printf "%5s %9.3f %7.1f %6.3f %7.1f %6.3f %7.1f %7.1f\n", $1, $2, $7*1e9, $9, $10*1e9, $12, $13*1e9, $14*1e9
+}
diff --git a/scripts/stats/etf.S b/scripts/stats/etf.S
new file mode 100755
index 0000000..9b9c68b
--- /dev/null
+++ b/scripts/stats/etf.S
@@ -0,0 +1,15 @@
+options(digits=4)
+file2 <- "etf_summary"
+etf <- scan(file1, list(day=0, sec=0, offset=0, stab=0))
+r <- lsfit(etf$sec, etf$offset)
+count<-length(etf$sec)
+mean<-r$coef[[1]]
+std<-sqrt(var(r$residuals))
+slope<-r$coef[[2]] * 1000
+cat("\n", file=file2 , append=TRUE, fill=FALSE, sep="")
+cat(file1, "\n", file=file2, append=TRUE, fill=FALSE, sep="")
+cat("etf1 ", count, ", T ", mean, " ns, R ", slope, " ps/s, std ", std, " us\n", file=file2, append=TRUE, fill=FALSE, sep="")
+str <- paste("eps/", file1, ".eps", sep="")
+postscript(str, , , , 5, pointsize=18)
+par(mgp=c(1, 0, 0), tck=0.03, mar=c(2, 2, 1, 1))
+plot(etf$sec, etf$offset, type="l", xlab=paste("MJD", etf$day, "Time (s)"), ylab="External Offset (ns)", ylim=c(-400, 400))
diff --git a/scripts/stats/etf.awk b/scripts/stats/etf.awk
new file mode 100755
index 0000000..8e6e334
--- /dev/null
+++ b/scripts/stats/etf.awk
@@ -0,0 +1,19 @@
+# program to produce external time/frequence statistics from clockstats files
+#
+# usage: awk -f etf.awk clockstats
+#
+# format of input record
+# 49165 40.473 127.127.10.1 93:178:00:00:39.238 ETF
+# +175.0 +176.8 2.0 +3.729E-11 +1.000E-10 +3.511E-11 4.005E-13 500
+#
+# format of output record (time values in nanoseconds)
+# MJD sec time freq
+# 49165 40.473 175.0 3.729e-11
+#
+# select ETF records with valid format
+{
+ if (NF >= 9 && $5 == "ETF") {
+ printf "%5s %9.3f %7.1f %10.3e\n", $1, $2, $6, $9
+ }
+}
+
diff --git a/scripts/stats/itf.S b/scripts/stats/itf.S
new file mode 100755
index 0000000..56c8c8d
--- /dev/null
+++ b/scripts/stats/itf.S
@@ -0,0 +1,5 @@
+itf <- scan(file1, list(day=0, sec=0, offset=0, stab=0))
+str <- paste("eps/", file1, ".eps", sep="")
+postscript(str, , , , 5, pointsize=18)
+par(mgp=c(1, 0, 0), tck=0.03, mar=c(2, 2, 1, 1))
+plot(itf$sec, itf$offset, type="l", xlab=paste("MJD", itf$day, "Time (s)"), ylab="Internal Offset (ns)", ylim=c(-400, 400))
diff --git a/scripts/stats/itf.awk b/scripts/stats/itf.awk
new file mode 100755
index 0000000..2b21c5b
--- /dev/null
+++ b/scripts/stats/itf.awk
@@ -0,0 +1,19 @@
+# program to produce intewrnal time/frequence statistics from clockstats files
+#
+# usage: awk -f itf.awk clockstats
+#
+# format of input record
+# 49227 67.846 127.127.10.1 93:240:00:00:51.816 ITF
+# COCO 0 +2.0579E-07 -3.1037E-08 -7.7723E-11 +6.5455E-10 500.00 4.962819
+#
+# format of output record (time values in nanoseconds)
+# MJD sec time freq
+# 49227 67.846 +2.0579E-07 -7.7723E-11
+#
+# select ITF records with valid format
+{
+ if (NF >= 10 && $5 == "ITF") {
+ printf "%5s %9.3f %7.1f %10.3e\n", $1, $2, $8 * 1e9, $10
+ }
+}
+
diff --git a/scripts/stats/loop.S b/scripts/stats/loop.S
new file mode 100755
index 0000000..8e564b6
--- /dev/null
+++ b/scripts/stats/loop.S
@@ -0,0 +1,7 @@
+options(digits=4)
+loop <- scan(file1, list(day=0, sec=0, offset=0, freq=0, tc=0))
+loop$offset <- loop$offset * 1e6
+str <- paste("eps/", file1, ".eps", sep="")
+postscript(str, , , , 5, pointsize=18)
+par(mgp=c(1, 0, 0), tck=0.03, mar=c(2, 2, 1, 1))
+plot(loop$sec, loop$offset, type="l", xlab=paste("MJD", loop$day, "Time (s)"), ylab="PLL Offset (us)", ylim=c(-400, 400))
diff --git a/scripts/stats/loop.awk b/scripts/stats/loop.awk
new file mode 100755
index 0000000..bac90db
--- /dev/null
+++ b/scripts/stats/loop.awk
@@ -0,0 +1,45 @@
+# awk program to scan loopstats files and report errors/statistics
+#
+# usage: awk -f loop.awk loopstats
+#
+# format of loopstats record
+# MJD sec time (s) freq (ppm) poll
+# 49235 3.943 0.000016 22.4716 6
+#
+# format of output dataset (time values in milliseconds, freq in ppm)
+# loopstats.19960706
+# loop 1180, 0+/-11.0, rms 2.3, freq -24.45+/-0.045, var 0.019
+#
+BEGIN {
+ loop_tmax = loop_fmax = -1e9
+ loop_tmin = loop_fmin = 1e9
+}
+#
+# scan all records in file
+#
+{
+ if (NF >= 5) {
+ loop_count++
+ if ($3 > loop_tmax)
+ loop_tmax = $3
+ if ($3 < loop_tmin)
+ loop_tmin = $3
+ if ($4 > loop_fmax)
+ loop_fmax = $4
+ if ($4 < loop_fmin)
+ loop_fmin = $4
+ loop_time += $3
+ loop_time_rms += $3 * $3
+ loop_freq += $4
+ loop_freq_rms += $4 * $4
+ }
+} END {
+ if (loop_count > 0) {
+ loop_time /= loop_count
+ loop_time_rms = sqrt(loop_time_rms / loop_count - loop_time * loop_time)
+ loop_freq /= loop_count
+ loop_freq_rms = sqrt(loop_freq_rms / loop_count - loop_freq * loop_freq)
+ printf "loop %d, %.0f+/-%.1f, rms %.1f, freq %.2f+/-%0.3f, var %.3f\n", loop_count, (loop_tmax + loop_tmin) / 2 * 1e6, (loop_tmax - loop_tmin) / 2 * 1e6, loop_time_rms * 1e6, (loop_fmax + loop_fmin) / 2, (loop_fmax - loop_fmin) / 2, loop_freq_rms
+ }
+}
+
diff --git a/scripts/stats/loop_summary b/scripts/stats/loop_summary
new file mode 100755
index 0000000..35479ec
--- /dev/null
+++ b/scripts/stats/loop_summary
@@ -0,0 +1,2 @@
+
+loopstats.[1-9]
diff --git a/scripts/stats/peer.awk b/scripts/stats/peer.awk
new file mode 100755
index 0000000..5fe260e
--- /dev/null
+++ b/scripts/stats/peer.awk
@@ -0,0 +1,68 @@
+# awk program to scan peerstats files and report errors/statistics
+#
+# usage: awk -f peer.awk peerstats
+#
+# format of peerstats record
+# MJD sec ident stat offset (s) delay (s) disp (s)
+# 49235 11.632 128.4.2.7 f414 -0.000041 0.21910 0.00084
+#
+# format of output dataset (time values in milliseconds)
+# peerstats.19960706
+# ident cnt mean rms max delay dist disp
+# ==========================================================================
+# 140.173.112.2 85 -0.509 1.345 4.606 80.417 49.260 1.092
+# 128.4.1.20 1364 0.058 0.364 4.465 3.712 10.540 1.101
+# 140.173.16.1 1415 -0.172 0.185 1.736 3.145 5.020 0.312
+#...
+#
+BEGIN {
+ n = 0
+ MAXDISTANCE = 1.0
+}
+#
+# scan all records in file
+#
+# we toss out all distances greater than one second on the assumption the
+# peer is in initial acquisition
+#
+{
+ if (NF >= 7 && ($7 + $6 / 2) < MAXDISTANCE) {
+ i = n
+ for (j = 0; j < n; j++) {
+ if ($3 == peer_ident[j])
+ i = j
+ }
+ if (i == n) {
+ peer_ident[i] = $3
+ peer_tmax[i] = peer_dist[i] = -1e9
+ peer_tmin[i] = 1e9
+ n++
+ }
+ peer_count[i]++
+ if ($5 > peer_tmax[i])
+ peer_tmax[i] = $5
+ if ($5 < peer_tmin[i])
+ peer_tmin[i] = $5
+ dist = $7 + $6 / 2
+ if (dist > peer_dist[i])
+ peer_dist[i] = dist
+ peer_time[i] += $5
+ peer_time_rms[i] += $5 * $5
+ peer_delay[i] += $6
+ peer_disp[i] += $7
+ }
+} END {
+ printf " ident cnt mean rms max delay dist disp\n"
+ printf "==========================================================================\n"
+ for (i = 0; i < n; i++) {
+ peer_time[i] /= peer_count[i]
+ peer_time_rms[i] = sqrt(peer_time_rms[i] / peer_count[i] - peer_time[i] * peer_time[i])
+ peer_delay[i] /= peer_count[i]
+ peer_disp[i] /= peer_count[i]
+ peer_tmax[i] = peer_tmax[i] - peer_time[i]
+ peer_tmin[i] = peer_time[i] - peer_tmin[i]
+ if (peer_tmin[i] > peer_tmax[i])
+ peer_tmax[i] = peer_tmin[i]
+ printf "%-15s%5d%9.3f%9.3f%9.3f%9.3f%9.3f%9.3f\n", peer_ident[i], peer_count[i], peer_time[i] * 1e3, peer_time_rms[i] * 1e3, peer_tmax[i] * 1e3, peer_delay[i] * 1e3, peer_dist[i] * 1e3, peer_disp[i] * 1e3
+ }
+}
diff --git a/scripts/stats/psummary.awk b/scripts/stats/psummary.awk
new file mode 100755
index 0000000..ec06b0c
--- /dev/null
+++ b/scripts/stats/psummary.awk
@@ -0,0 +1,82 @@
+# program to scan peer_summary file and produce summary of daily summaries
+#
+# usage: awk -f psummary.awk peer_summary
+#
+# format of input records
+# peerstats.19960706
+# ident cnt mean rms max delay dist disp
+# ==========================================================================
+# 140.173.112.2 85 -0.509 1.345 4.606 80.417 49.260 1.092
+# 128.4.1.20 1364 0.058 0.364 4.465 3.712 10.540 1.101
+# ...
+#
+# format of output records (actual data from rackety.udel.edu)
+# host days mean rms max >1 >5 >10 >50
+# ==================================================================
+# 127.127.22.1 1090 0.001 0.401 99.800 19 14 13 10
+# 127.0.0.1 1188 0.060 1.622 105.004 78 65 51 32
+# 127.127.4.1 586 0.000 0.000 0.000 0 0 0 0
+# 140.173.64.1 975 -0.010 2.552 257.595 399 192 114 8
+# 128.175.1.3 1121 0.447 8.637 204.123 479 460 397 147
+# 140.173.16.1 1106 0.027 1.014 267.857 242 38 31 23
+# 128.4.1.4 1119 0.023 1.037 267.748 223 41 34 23
+# 128.4.1.2 850 1.202 1.654 267.704 196 53 45 34
+# 128.4.1.20 1101 0.088 1.139 268.322 430 111 83 16
+# 140.173.32.1 979 -0.949 2.344 257.671 396 217 136 7
+# 140.173.112.2 1066 0.040 2.111 152.969 442 315 152 16
+# 140.173.80.1 1059 0.019 1.858 87.690 438 348 150 9
+# 140.173.96.1 1015 0.110 2.007 266.744 399 314 170 17
+# 140.173.128.1 1103 -0.002 2.600 257.672 465 262 132 13
+# 140.222.135.1 347 -4.626 8.804 196.394 135 135 134 95
+# 140.173.128.2 1081 -0.046 2.967 261.448 463 342 172 17
+# 140.222.141.1 354 0.820 8.809 195.333 142 141 139 100
+# 140.173.144.2 1058 -0.107 2.805 270.498 448 341 163 17
+# 140.222.134.1 354 -0.056 8.479 172.458 142 141 141 100
+# 140.222.144.1 415 -1.456 9.964 191.684 161 161 161 123
+# 140.222.136.1 234 0.902 7.707 182.431 62 62 62 48
+# 128.175.1.1 774 0.890 4.838 266.799 358 291 200 83
+# 127.127.10.1 1086 -0.002 1.462 231.128 240 239 60 57
+# 140.173.48.2 576 0.016 4.092 350.512 213 126 88 16
+# 128.4.1.11 3 0.000 0.000 0.000 0 0 0 0
+# 128.4.1.26 386 -1.363 20.251 341.284 164 164 161 132
+#
+# select table beginning with "ident"
+{
+ if (NF < 8 || $1 == "ident")
+ continue
+ i = n
+ for (j = 0; j < n; j++) {
+ if ($1 == peer_ident[j])
+ i = j
+ }
+ if (i == n) {
+ peer_ident[i] = $1
+ n++
+ }
+ peer_count[i]++
+ if (($7 - $6 / 2) < 400) {
+ peer_count[i]++
+ peer_mean[i] += $3
+ peer_var[i] += $4 * $4
+ if ($5 > peer_max[i])
+ peer_max[i] = $5
+ if ($5 > 1)
+ peer_1[i]++
+ if ($5 > 5)
+ peer_2[i]++
+ if ($5 > 10)
+ peer_3[i]++
+ if ($5 > 50)
+ peer_4[i]++
+ }
+} END {
+ printf " host days mean rms max >1 >5 >10 >50\n"
+ printf "==================================================================\n"
+ for (i = 0; i < n; i++) {
+ if (peer_count[i] <= 0)
+ continue
+ peer_mean[i] /= peer_count[i]
+ peer_var[i] = sqrt(peer_var[i] / peer_count[i])
+ printf "%-15s%4d%10.3f%10.3f%10.3f%4d%4d%4d%4d\n", peer_ident[i], peer_count[i], peer_mean[i], peer_var[i], peer_max[i], peer_1[i], peer_2[i], peer_3[i], peer_4[i]
+ }
+}
diff --git a/scripts/stats/summary.sh b/scripts/stats/summary.sh
new file mode 100755
index 0000000..dffdb0b
--- /dev/null
+++ b/scripts/stats/summary.sh
@@ -0,0 +1,88 @@
+#!/bin/sh
+#
+# Script to summarize ipeerstats, loopstats and clockstats files
+#
+# This script can be run from a cron job once per day, week or month. It
+# runs the file-specific summary script and appends the summary data to
+# designated files.
+#
+DATE=`date +20%y%m%d`
+S=/usr/local/bin/S
+SIN=S.in
+SOUT=S.out
+LOOP=loop_summary
+PEER=peer_summary
+CLOCK=clock_summary
+
+rm -f $SIN $SOUT
+
+#
+# Summarize loopstats files
+#
+for f in loopstats.[12][0-9][0-9][0-9][0-1][0-9][0-3][0-9]; do
+ d=`echo $f | cut -f2 -d.`
+ if [ -f $f ] && [ $DATE != $d ]; then
+ echo " " >>$LOOP
+ echo $f >>$LOOP
+ awk -f loop.awk $f >>$LOOP
+ if [ -f $S ]; then
+ echo "file1<-"\"${f}\" >>$SIN
+ echo "source("\""loop.S"\"")" >>$SIN
+ echo "unix("\""rm ${f}"\"")" >>$SIN
+ else
+ rm -f $f
+ fi
+ fi
+done
+
+#
+# Summarize peerstats files
+#
+for f in peerstats.199[4-9][0-1][0-9][0-3][0-9]; do
+ d=`echo $f | cut -f2 -d.`
+ if [ -f $f ] && [ $DATE != $d ]; then
+ echo " " >>$PEER
+ echo $f >>$PEER
+ awk -f peer.awk $f >>$PEER
+ rm -f $f
+ fi
+done
+
+#
+# Summarize clockstats files
+#
+for f in clockstats.199[4-9][0-1][0-9][0-3][0-9]; do
+ d=`echo $f | cut -f2 -d.`
+ if [ -f $f ] && [ $DATE != $d ]; then
+ echo " " >>$CLOCK
+ echo $f >>$CLOCK
+ awk -f clock.awk $f >>$CLOCK
+ if [ -f /dev/gps[0-9] ]; then
+ awk -f itf.awk $f >itf.$d
+ awk -f etf.awk $f >etf.$d
+ awk -f ensemble.awk $f >ensemble.$d
+ awk -f tdata.awk $f >tdata.$d
+ fi
+ rm -f $f
+ fi
+done
+
+#
+# Process clockstat files with S and generate PostScript plots
+#
+for f in itf etf ensemble tdata; do
+ for d in ${f}.199[4-9][0-1][0-9][0-3][0-9]; do
+ if [ -f $d ]; then
+ if [ -f $S ]; then
+ echo "file1<-"\"${d}\" >>$SIN
+ echo "source("\"${f}.S\"")" >>$SIN
+ echo "unix("\""rm ${d}"\"")" >>$SIN
+ else
+ rm -f $d
+ fi
+ fi
+ done
+done
+if [ -f $SIN ]; then
+ $S BATCH $SIN $SOUT
+fi
diff --git a/scripts/stats/tdata.S b/scripts/stats/tdata.S
new file mode 100755
index 0000000..f360a24
--- /dev/null
+++ b/scripts/stats/tdata.S
@@ -0,0 +1,5 @@
+tdata <- scan(file1, list(day=0, sec=0, m=0, w=0, x=0, y=0, z=0))
+str <- paste("eps/", file1, ".eps", sep="")
+postscript(str, , , , 5, pointsize=18)
+par(mgp=c(1, 0, 0), tck=0.03, mar=c(2, 2, 1, 1))
+plot(tdata$sec, tdata$m, type="l", xlab=paste("MJD", tdata$day, "Time (s)"), ylab="LORAN-M SNR (dB)")
diff --git a/scripts/stats/tdata.awk b/scripts/stats/tdata.awk
new file mode 100755
index 0000000..5be9c04
--- /dev/null
+++ b/scripts/stats/tdata.awk
@@ -0,0 +1,45 @@
+# program to produce loran tdata statistics from clockstats files
+#
+# usage: awk -f tdata.awk clockstats
+#
+# format of input record (missing replaced by -40.0)
+# 49228 36.852 127.127.10.1 93:241:00:00:20.812 LORAN TDATA
+# M OK 0 0 1169.14 -7.4 3.16E-07 .424
+# W CV 0 0 3329.30 -16.4 1.81E-06
+# X OK 0 0 1737.19 -10.5 3.44E-07 .358
+# Y OK 0 0 2182.07 -9.0 4.41E-07 .218
+#
+# format of output record (time in nanoseconds, signal values in dB)
+# MJD sec time M W X Y Z
+# 49228 36.852 175.0 -7.4 -16.4 -10.5 -9.0
+#
+# select LORAN TDATA records with valid format
+{
+ if (NF >= 7 && $6 == "TDATA") {
+ m = w = x = y = z = -40.0
+ for (i = 7; i < NF - 5; i++) {
+ if ($i == "M" && $(i+1) == "OK") {
+ i += 5
+ m = $i
+ }
+ else if ($i == "W" && $(i+1) == "OK") {
+ i += 5
+ w = $i
+ }
+ else if ($i == "X" && $(i+1) == "OK") {
+ i += 5
+ x = $i
+ }
+ else if ($i == "Y" && $(i+1) == "OK") {
+ i += 5
+ y = $i
+ }
+ else if ($i == "Z" && $(i+1) == "OK") {
+ i += 5
+ z = $i
+ }
+ }
+ printf "%5s %9.3f %6.1f %6.1f %6.1f %6.1f %6.1f\n", $1, $2, m, w, x, y, z
+ }
+}
+
diff --git a/scripts/summary-opts b/scripts/summary-opts
new file mode 100644
index 0000000..b8b5399
--- /dev/null
+++ b/scripts/summary-opts
@@ -0,0 +1,69 @@
+# EDIT THIS FILE WITH CAUTION (summary-opts)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:43 AM by AutoGen 5.18.5pre4
+# From the definitions summary-opts.def
+# and the template file perlopt
+
+use Getopt::Long qw(GetOptionsFromArray);
+Getopt::Long::Configure(qw(no_auto_abbrev no_ignore_case_always));
+
+my $usage;
+
+sub usage {
+ my ($ret) = @_;
+ print STDERR $usage;
+ exit $ret;
+}
+
+sub paged_usage {
+ my ($ret) = @_;
+ my $pager = $ENV{PAGER} || '(less || more)';
+
+ open STDOUT, "| $pager" or die "Can't fork a pager: $!";
+ print $usage;
+
+ exit $ret;
+}
+
+sub processOptions {
+ my $args = shift;
+
+ my $opts = {
+ 'directory' => '/var/log/ntp',
+ 'end-date' => '',
+ 'output-directory' => '/tmp',
+ 'peer-dist-limit' => '400',
+ 'skip-time-steps' => '3600',
+ 'start-date' => '19700101',
+ 'help' => '', 'more-help' => ''
+ };
+ my $argument = '';
+ my $ret = GetOptionsFromArray($args, $opts, (
+ 'directory=s', 'end-date=i', 'output-directory=s',
+ 'peer-dist-limit=f', 'skip-time-steps=f', 'start-date=i',
+ 'help|?', 'more-help'));
+
+ $usage = <<'USAGE';
+summary - compute various stastics from NTP stat files - Ver. 4.2.7p482
+USAGE: summary [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
+
+ --directory=str Directory containing stat files
+ --end-date=num End date
+ --output-directory=str Output directory
+ --peer-dist-limit=float Peer dist limit
+ --skip-time-steps=float Ignore time offsets larger that this
+ --start-date=num Start date
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+USAGE
+
+ usage(0) if $opts->{'help'};
+ paged_usage(0) if $opts->{'more-help'};
+ $_[0] = $opts;
+ return $ret;
+}
+
+END { close STDOUT };
diff --git a/scripts/summary-opts.def b/scripts/summary-opts.def
new file mode 100644
index 0000000..82c31eb
--- /dev/null
+++ b/scripts/summary-opts.def
@@ -0,0 +1,82 @@
+/* -*- Mode: Text -*- */
+AutoGen Definitions perlopt;
+
+#include autogen-version.def
+
+prog-name = 'summary';
+prog-title = 'compute various stastics from NTP stat files';
+package = ntp;
+#include version.def
+
+long-opts;
+gnu-usage;
+
+flag = {
+ name = directory;
+ arg-type = string;
+ arg-default = '/var/log/ntp';
+ descrip = 'Directory containing stat files';
+ doc = <<- _EndOfDoc_
+ The directory where @code{ntpd} will search for .stat files generated
+ by @code{ntpd}.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = end-date;
+ arg-type = number;
+ descrip = 'End date';
+ doc = <<- _EndOfDoc_
+ Process all files with the date suffix less or equal to value of this
+ option. Defaults to today minus one day (Use @code{date -u +%Y%m%d})
+ to get the timestamp.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = output-directory;
+ arg-type = str;
+ arg-default = '/tmp';
+ descrip = 'Output directory';
+ doc = <<- _EndOfDoc_
+ The output directory @code{summary} will write all output files to.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = peer-dist-limit;
+ arg-type = string;
+ arg-name = float;
+ arg-default = 400;
+ descrip = 'Peer dist limit';
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+flag = {
+ name = skip-time-steps;
+ arg-type = string;
+ arg-name = float;
+ arg-default = 3600;
+ descrip = 'Ignore time offsets larger that this';
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+flag = {
+ name = start-date;
+ arg-type = num;
+ arg-default = 19700101;
+ descrip = 'Start date';
+ doc = <<- _EndOfDoc_
+ Process all files with the date suffix more or equal to value of
+ this option. Defaults to 197000101.
+ _EndOfDoc_;
+};
+
+doc-section = {
+ ds-type = 'DESCRIPTION';
+ ds-format = 'texi';
+ ds-text = <<- _EndOfDoc
+ _EndOfDoc;
+};
diff --git a/scripts/summary.1summaryman b/scripts/summary.1summaryman
new file mode 100644
index 0000000..2b10936
--- /dev/null
+++ b/scripts/summary.1summaryman
@@ -0,0 +1,123 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH summary 1summaryman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-hqaqcI/ag-uqaybI)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:52 AM by AutoGen 5.18.5pre4
+.\" From the definitions summary-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]summary\fP
+\- compute various stastics from NTP stat files
+.SH SYNOPSIS
+\f\*[B-Font]summary\fP
+[\f\*[B-Font]\-\-option-name\f[]]
+[\f\*[B-Font]\-\-option-name\f[] \f\*[I-Font]value\f[]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+.sp
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-\-directory\f[]=\f\*[I-Font]string\f[]
+Directory containing stat files.
+The default
+\f\*[I-Font]string\f[]
+for this option is:
+.ti +4
+ /var/log/ntp
+.sp
+ The directory where \fBntpd\fP will search for .stat files generated
+ by \fBntpd\fP.
+.TP
+.NOP \f\*[B-Font]\-\-end\-date\f[]=\f\*[I-Font]number\f[]
+End date.
+This option takes an integer number as its argument.
+.sp
+ Process all files with the date suffix less or equal to value of this
+ option. Defaults to today minus one day (Use \fBdate \-u +%Y%m%d\fP)
+ to get the timestamp.
+.TP
+.NOP \f\*[B-Font]\-\-output\-directory\f[]=\f\*[I-Font]str\f[]
+Output directory.
+The default
+\f\*[I-Font]str\f[]
+for this option is:
+.ti +4
+ /tmp
+.sp
+ The output directory \fBsummary\fP will write all output files to.
+.TP
+.NOP \f\*[B-Font]\-\-peer\-dist\-limit\f[]=\f\*[I-Font]float\f[]
+Peer dist limit.
+The default
+\f\*[I-Font]float\f[]
+for this option is:
+.ti +4
+ 400
+.sp
+.TP
+.NOP \f\*[B-Font]\-\-skip\-time\-steps\f[]=\f\*[I-Font]float\f[]
+Ignore time offsets larger that this.
+The default
+\f\*[I-Font]float\f[]
+for this option is:
+.ti +4
+ 3600
+.sp
+.TP
+.NOP \f\*[B-Font]\-\-start\-date\f[]=\f\*[I-Font]num\f[]
+Start date.
+This option takes an integer number as its argument.
+The default
+\f\*[I-Font]num\f[]
+for this option is:
+.ti +4
+ 19700101
+.sp
+ Process all files with the date suffix more or equal to value of
+ this option. Defaults to 197000101.
+.TP
+.NOP \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBsummary\fP
+option definitions.
diff --git a/scripts/summary.1summarymdoc b/scripts/summary.1summarymdoc
new file mode 100644
index 0000000..6ec7cc2
--- /dev/null
+++ b/scripts/summary.1summarymdoc
@@ -0,0 +1,98 @@
+.Dd December 2 2014
+.Dt SUMMARY 1summarymdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (summary-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:54 AM by AutoGen 5.18.5pre4
+.\" From the definitions summary-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm summary
+.Nd compute various stastics from NTP stat files
+.Sh SYNOPSIS
+.Nm
+.Op Fl \-option\-name
+.Op Fl \-option\-name Ar value
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+.sp
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl \-directory Ns = Ns Ar string
+Directory containing stat files.
+The default
+.Ar string
+for this option is:
+.ti +4
+ /var/log/ntp
+.sp
+ The directory where \fBntpd\fP will search for .stat files generated
+ by \fBntpd\fP.
+.It Fl \-end\-date Ns = Ns Ar number
+End date.
+This option takes an integer number as its argument.
+.sp
+ Process all files with the date suffix less or equal to value of this
+ option. Defaults to today minus one day (Use \fBdate \-u +%Y%m%d\fP)
+ to get the timestamp.
+.It Fl \-output\-directory Ns = Ns Ar str
+Output directory.
+The default
+.Ar str
+for this option is:
+.ti +4
+ /tmp
+.sp
+ The output directory \fBsummary\fP will write all output files to.
+.It Fl \-peer\-dist\-limit Ns = Ns Ar float
+Peer dist limit.
+The default
+.Ar float
+for this option is:
+.ti +4
+ 400
+.sp
+.It Fl \-skip\-time\-steps Ns = Ns Ar float
+Ignore time offsets larger that this.
+The default
+.Ar float
+for this option is:
+.ti +4
+ 3600
+.sp
+.It Fl \-start\-date Ns = Ns Ar num
+Start date.
+This option takes an integer number as its argument.
+The default
+.Ar num
+for this option is:
+.ti +4
+ 19700101
+.sp
+ Process all files with the date suffix more or equal to value of
+ this option. Defaults to 197000101.
+.It Fl \-help
+Display usage information and exit.
+.It Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBsummary\fP
+option definitions.
diff --git a/scripts/summary.html b/scripts/summary.html
new file mode 100644
index 0000000..31cc825
--- /dev/null
+++ b/scripts/summary.html
@@ -0,0 +1,182 @@
+<html lang="en">
+<head>
+<title>Summary User's Manual</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="Summary User's Manual">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+ span.sc { font-variant:small-caps }
+ span.roman { font-family: serif; font-weight: normal; }
+--></style>
+</head>
+<body>
+<h1 class="settitle">Summary User's Manual</h1>
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#summary-Description">summary Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+<h2 class="unnumbered">Summary User Manual</h2>
+
+<p>This document describes the use of the NTP Project's <code>summary</code> program.
+This document applies to version 4.2.7p482 of <code>summary</code>.
+
+ <div class="shortcontents">
+<h2>Short Contents</h2>
+<ul>
+<a href="#Top">Summary User Manual</a>
+</ul>
+</div>
+
+<ul class="menu">
+<li><a accesskey="1" href="#summary-Description">summary Description</a>: Description
+<li><a accesskey="2" href="#summary-Invocation">summary Invocation</a>: Invoking summary
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="summary-Invocation"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#summary-Description">summary Description</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<h3 class="section">Invoking summary</h3>
+
+<p><a name="index-summary-1"></a><a name="index-compute-various-stastics-from-NTP-stat-files-2"></a>
+
+ <p>This section was generated by <strong>AutoGen</strong>,
+using the <code>agtexi-cmd</code> template and the option descriptions for the <code>summary</code> program.
+
+<ul class="menu">
+<li><a accesskey="1" href="#summary-usage">summary usage</a>: summary help/usage (<span class="option">--help</span>)
+<li><a accesskey="2" href="#summary-directory">summary directory</a>: directory option
+<li><a accesskey="3" href="#summary-end_002ddate">summary end-date</a>: end-date option
+<li><a accesskey="4" href="#summary-output_002ddirectory">summary output-directory</a>: output-directory option
+<li><a accesskey="5" href="#summary-start_002ddate">summary start-date</a>: start-date option
+<li><a accesskey="6" href="#summary-exit-status">summary exit status</a>: exit status
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="summary-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#summary-directory">summary directory</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#summary-Invocation">summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">summary help/usage (<span class="option">--help</span>)</h4>
+
+<p><a name="index-summary-help-3"></a>
+This is the automatically generated usage text for summary.
+
+ <p>The text printed is the same whether selected with the <code>help</code> option
+(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
+the usage text by passing it through a pager program.
+<code>more-help</code> is disabled on platforms without a working
+<code>fork(2)</code> function. The <code>PAGER</code> environment variable is
+used to select the program, defaulting to <span class="file">more</span>. Both will exit
+with a status code of 0.
+
+<pre class="example">summary - compute various stastics from NTP stat files - Ver. 4.2.7p482
+USAGE: summary [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
+
+ --directory=str Directory containing stat files
+ --end-date=num End date
+ --output-directory=str Output directory
+ --peer-dist-limit=float Peer dist limit
+ --skip-time-steps=float Ignore time offsets larger that this
+ --start-date=num Start date
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+</pre>
+ <div class="node">
+<p><hr>
+<a name="summary-directory"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#summary-end_002ddate">summary end-date</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#summary-usage">summary usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#summary-Invocation">summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">directory option</h4>
+
+<p><a name="index-summary_002ddirectory-4"></a>
+This is the &ldquo;directory containing stat files&rdquo; option.
+This option takes a string argument.
+ The directory where <code>ntpd</code> will search for .stat files generated
+ by <code>ntpd</code>.
+<div class="node">
+<p><hr>
+<a name="summary-end_002ddate"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#summary-output_002ddirectory">summary output-directory</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#summary-directory">summary directory</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#summary-Invocation">summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">end-date option</h4>
+
+<p><a name="index-summary_002dend_002ddate-5"></a>
+This is the &ldquo;end date&rdquo; option.
+This option takes a number argument.
+ Process all files with the date suffix less or equal to value of this
+ option. Defaults to today minus one day (Use <code>date -u +%Y%m%d</code>)
+ to get the timestamp.
+<div class="node">
+<p><hr>
+<a name="summary-output_002ddirectory"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#summary-start_002ddate">summary start-date</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#summary-end_002ddate">summary end-date</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#summary-Invocation">summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">output-directory option</h4>
+
+<p><a name="index-summary_002doutput_002ddirectory-6"></a>
+This is the &ldquo;output directory&rdquo; option.
+This option takes a str argument.
+ The output directory <code>summary</code> will write all output files to.
+<div class="node">
+<p><hr>
+<a name="summary-start_002ddate"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#summary-exit-status">summary exit status</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#summary-output_002ddirectory">summary output-directory</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#summary-Invocation">summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">start-date option</h4>
+
+<p><a name="index-summary_002dstart_002ddate-7"></a>
+This is the &ldquo;start date&rdquo; option.
+This option takes a num argument.
+ Process all files with the date suffix more or equal to value of
+ this option. Defaults to 197000101.
+<div class="node">
+<p><hr>
+<a name="summary-exit-status"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#summary-start_002ddate">summary start-date</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#summary-Invocation">summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">summary exit status</h4>
+
+<p>One of the following exit values will be returned:
+ <dl>
+<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
+<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
+</dl>
+
+</body></html>
+
diff --git a/scripts/summary.in b/scripts/summary.in
new file mode 100644
index 0000000..a99f8df
--- /dev/null
+++ b/scripts/summary.in
@@ -0,0 +1,369 @@
+#! @PATH_PERL@ -w
+# $Id$
+# Perl version of (summary.sh, loop.awk, peer.awk):
+# Create summaries from xntpd's loop and peer statistics.
+#
+# Copyright (c) 1997, 1999 by Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+package summary;
+use 5.006_000;
+use strict;
+
+my ($log_date_pattern, $statsdir, $outputdir, $skip_time_steps, $startdate,
+ $enddate, $peer_dist_limit);
+
+exit run(@ARGV) unless caller;
+
+sub run {
+ my $opts;
+ if (!processOptions(\@ARGV, $opts)) {
+ usage(1);
+ };
+
+ $log_date_pattern = '[12]\d{3}[01]\d[0-3]\d';
+ $statsdir = $opts->{directory};
+ $outputdir = $opts->{'output-directory'};
+ $skip_time_steps = $opts->{'skip-time-steps'};
+ $startdate = $opts->{'start-date'};
+ $enddate = $opts->{'end-date'};
+ if (!$enddate){
+ $enddate = `date -u +%Y%m%d`;
+ chomp $enddate;
+ --$enddate;
+ }
+ $peer_dist_limit = $opts->{'peer-dist-limit'};
+
+ # check possibly current values of options
+ die "$statsdir: no such directory" unless (-d $statsdir);
+ die "$outputdir: no such directory" unless (-d $outputdir);
+ die "$skip_time_steps: skip-time-steps must be positive"
+ unless ($skip_time_steps >= 0.0);
+ die "$startdate: invalid start date|$`|$&|$'"
+ unless ($startdate =~ m/.*$log_date_pattern$/);
+ die "$enddate: invalid end date"
+ unless ($enddate =~ m/.*$log_date_pattern$/);
+
+ $skip_time_steps = 0.128 if ($skip_time_steps == 0);
+
+ my $loop_summary="$outputdir/loop_summary";
+ my $peer_summary="$outputdir/peer_summary";
+ my $clock_summary="$outputdir/clock_summary";
+ my (@loopfiles, @peerfiles, @clockfiles);
+
+ print STDERR "Creating summaries from $statsdir ($startdate to $enddate)\n";
+
+ opendir SDIR, $statsdir or die "directory ${statsdir}: $!";
+ rewinddir SDIR;
+ @loopfiles=sort grep /loop.*$log_date_pattern/, readdir SDIR;
+ rewinddir SDIR;
+ @peerfiles=sort grep /peer.*$log_date_pattern/, readdir SDIR;
+ rewinddir SDIR;
+ @clockfiles=sort grep /clock.*$log_date_pattern/, readdir SDIR;
+ closedir SDIR;
+
+ # remove old summary files
+ for ($loop_summary, $peer_summary, $clock_summary) { unlink $_ if -f $_ };
+
+ my $date;
+ for (@loopfiles) {
+ $date = $_; $date =~ s/.*($log_date_pattern)$/$1/;
+ if ($date ge $startdate && $date le $enddate) {
+ do_loop($statsdir, $_, $loop_summary);
+ }
+ }
+
+ for (@peerfiles) {
+ $date = $_; $date =~ s/.*($log_date_pattern)$/$1/;
+ if ($date ge $startdate && $date le $enddate) {
+ do_peer($statsdir, $_, $peer_summary);
+ }
+ }
+
+ for (@clockfiles) {
+ $date = $_; $date =~ s/.*($log_date_pattern)$/$1/;
+ if ($date ge $startdate && $date le $enddate) {
+ do_clock($statsdir, $_, $clock_summary);
+ }
+ }
+
+ print STDERR "Creating peer summary with limit $peer_dist_limit\n";
+ peer_summary($peer_summary) if (-f $peer_summary);
+}
+
+sub min
+{
+ my ($result, @rest) = @_;
+ map { $result = $_ if ($_ < $result) } @rest;
+ return($result);
+}
+
+sub max
+{
+ my ($result, @rest) = @_;
+ map { $result = $_ if ($_ > $result) } @rest;
+ return($result);
+}
+
+# calculate mean, range, and standard deviation for offset and frequency
+sub do_loop
+{
+ my ($directory, $fname, $out_file) = @_;
+ print "$directory/$fname\n";
+ open INPUT, "$directory/$fname" or warn "can't open $directory/$fname: $!";
+ open OUTPUT, ">>$out_file" or die "can't open $out_file: $!";
+ print OUTPUT "$fname\n";
+ my ($loop_tmax, $loop_fmax) = (-1e9, -1e9);
+ my ($loop_tmin, $loop_fmin) = (1e9, 1e9);
+ my ($loop_time_rms, $loop_freq_rms) = (0, 0);
+ my $loop_count = 0;
+ my $loop_time = 0;
+ my $loop_freq = 0;
+ my ($freq, $offs);
+ my @Fld;
+ while (<INPUT>) {
+ chop; # strip record separator
+ @Fld = split;
+ next if ($#Fld < 4);
+#NTPv3: 50529 74356.259 -0.000112 16.1230 8
+#NTPv3: day, sec.msec, offset, drift_comp, sys_poll
+#NTPv4: 51333 54734.582 0.000001648 16.981964 0.000001094 0.020938 6
+#NTPv4: day, sec.msec, offset, drift_comp, sys_error, clock_stabil, sys_poll
+ if ($Fld[2] > $skip_time_steps || $Fld[2] < -$skip_time_steps) {
+ warn "ignoring loop offset $Fld[2] (file $fname, line $.)\n";
+ next
+ }
+ $loop_count++;
+ ($offs, $freq) = ($Fld[2], $Fld[3]);
+ $loop_tmax = max($loop_tmax, $offs);
+ $loop_tmin = min($loop_tmin, $offs);
+ $loop_fmax = max($loop_fmax, $freq);
+ $loop_fmin = min($loop_fmin, $freq);
+ $loop_time += $offs;
+ $loop_time_rms += $offs * $offs;
+ $loop_freq += $freq;
+ $loop_freq_rms += $freq * $freq;
+ }
+ close INPUT;
+ if ($loop_count > 1) {
+ $loop_time /= $loop_count;
+ $loop_time_rms = $loop_time_rms / $loop_count - $loop_time * $loop_time;
+ if ($loop_time_rms < 0) {
+ warn "loop_time_rms: $loop_time_rms < 0";
+ $loop_time_rms = 0;
+ }
+ $loop_time_rms = sqrt($loop_time_rms);
+ $loop_freq /= $loop_count;
+ $loop_freq_rms = $loop_freq_rms / $loop_count - $loop_freq * $loop_freq;
+ if ($loop_freq_rms < 0) {
+ warn "loop_freq_rms: $loop_freq_rms < 0";
+ $loop_freq_rms = 0;
+ }
+ $loop_freq_rms = sqrt($loop_freq_rms);
+ printf OUTPUT
+ ("loop %d, %.0f+/-%.1f, rms %.1f, freq %.2f+/-%0.3f, var %.3f\n",
+ $loop_count, ($loop_tmax + $loop_tmin) / 2 * 1e6,
+ ($loop_tmax - $loop_tmin) / 2 * 1e6, $loop_time_rms * 1e6,
+ ($loop_fmax + $loop_fmin) / 2, ($loop_fmax - $loop_fmin) / 2,
+ $loop_freq_rms);
+ }
+ else {
+ warn "no valid lines in $directory/$fname";
+ }
+ close OUTPUT
+}
+
+# calculate mean, standard deviation, maximum offset, mean dispersion,
+# and maximum distance for each peer
+sub do_peer
+{
+ my ($directory, $fname, $out_file) = @_;
+ print "$directory/$fname\n";
+ open INPUT, "$directory/$fname" or warn "can't open $directory/$fname: $!";
+ open OUTPUT, ">>$out_file" or die "can't open $out_file: $!";
+ print OUTPUT "$fname\n";
+# we toss out all distances greater than one second on the assumption the
+# peer is in initial acquisition
+ my ($n, $MAXDISTANCE) = (0, 1.0);
+ my %peer_time;
+ my %peer_time_rms;
+ my %peer_count;
+ my %peer_delay;
+ my %peer_disp;
+ my %peer_dist;
+ my %peer_ident;
+ my %peer_tmin;
+ my %peer_tmax;
+ my @Fld;
+ my ($i, $j);
+ my ($dist, $offs);
+ while (<INPUT>) {
+ chop; # strip record separator
+ @Fld = split;
+ next if ($#Fld < 6);
+#NTPv3: 50529 83316.249 127.127.8.1 9674 0.008628 0.00000 0.00700
+#NTPv3: day, sec.msec, addr, status, offset, delay, dispersion
+#NTPv4: 51333 56042.037 127.127.8.1 94f5 -0.000014657 0.000000000 0.000000000 0.000013214
+#NTPv4: day, sec.msec, addr, status, offset, delay, dispersion, skew
+
+ $dist = $Fld[6] + $Fld[5] / 2;
+ next if ($dist > $MAXDISTANCE);
+ $offs = $Fld[4];
+ if ($offs > $skip_time_steps || $offs < -$skip_time_steps) {
+ warn "ignoring peer offset $offs (file $fname, line $.)\n";
+ next
+ }
+ $i = $n;
+ for ($j = 0; $j < $n; $j++) {
+ if ($Fld[2] eq $peer_ident{$j}) {
+ $i = $j; # peer found
+ last;
+ }
+ }
+ if ($i == $n) { # add new peer
+ $peer_ident{$i} = $Fld[2];
+ $peer_tmax{$i} = $peer_dist{$i} = -1e9;
+ $peer_tmin{$i} = 1e9;
+ $peer_time{$i} = $peer_time_rms{$i} = 0;
+ $peer_delay{$i} = $peer_disp{$i} = 0;
+ $peer_count{$i} = 0;
+ $n++;
+ }
+ $peer_count{$i}++;
+ $peer_tmax{$i} = max($peer_tmax{$i}, $offs);
+ $peer_tmin{$i} = min($peer_tmin{$i}, $offs);
+ $peer_dist{$i} = max($peer_dist{$i}, $dist);
+ $peer_time{$i} += $offs;
+ $peer_time_rms{$i} += $offs * $offs;
+ $peer_delay{$i} += $Fld[5];
+ $peer_disp{$i} += $Fld[6];
+ }
+ close INPUT;
+ print OUTPUT
+" ident cnt mean rms max delay dist disp\n";
+ print OUTPUT
+"==========================================================================\n";
+ my @lines = ();
+ for ($i = 0; $i < $n; $i++) {
+ next if $peer_count{$i} < 2;
+ $peer_time{$i} /= $peer_count{$i};
+ eval { $peer_time_rms{$i} = sqrt($peer_time_rms{$i} / $peer_count{$i} -
+ $peer_time{$i} * $peer_time{$i}); };
+ $peer_time_rms{$i} = 0, warn $@ if $@;
+ $peer_delay{$i} /= $peer_count{$i};
+ $peer_disp{$i} /= $peer_count{$i};
+ $peer_tmax{$i} = $peer_tmax{$i} - $peer_time{$i};
+ $peer_tmin{$i} = $peer_time{$i} - $peer_tmin{$i};
+ if ($peer_tmin{$i} > $peer_tmax{$i}) { # can this happen at all?
+ $peer_tmax{$i} = $peer_tmin{$i};
+ }
+ push @lines, sprintf
+ "%-15s %4d %8.3f %8.3f %8.3f %8.3f %8.3f %8.3f\n",
+ $peer_ident{$i}, $peer_count{$i}, $peer_time{$i} * 1e3,
+ $peer_time_rms{$i} * 1e3, $peer_tmax{$i} * 1e3,
+ $peer_delay{$i} * 1e3, $peer_dist{$i} * 1e3, $peer_disp{$i} * 1e3;
+ }
+ print OUTPUT sort @lines;
+ close OUTPUT;
+}
+
+sub do_clock
+{
+ my ($directory, $fname, $out_file) = @_;
+ print "$directory/$fname\n";
+ open INPUT, "$directory/$fname";
+ open OUTPUT, ">>$out_file" or die "can't open $out_file: $!";
+ print OUTPUT "$fname\n";
+ close INPUT;
+ close OUTPUT;
+}
+
+sub peer_summary
+{
+ my $in_file = shift;
+ my ($i, $j, $n);
+ my (%peer_ident, %peer_count, %peer_mean, %peer_var, %peer_max);
+ my (%peer_1, %peer_2, %peer_3, %peer_4);
+ my $dist;
+ my $max;
+ open INPUT, "<$in_file" or die "can't open $in_file: $!";
+ my @Fld;
+ $n = 0;
+ while (<INPUT>) {
+ chop; # strip record separator
+ @Fld = split;
+ next if ($#Fld < 7 || $Fld[0] eq 'ident');
+ $i = $n;
+ for ($j = 0; $j < $n; $j++) {
+ if ($Fld[0] eq $peer_ident{$j}) {
+ $i = $j;
+ last; # peer found
+ }
+ }
+ if ($i == $n) { # add new peer
+ $peer_count{$i} = $peer_mean{$i} = $peer_var{$i} = 0;
+ $peer_max{$i} = 0;
+ $peer_1{$i} = $peer_2{$i} = $peer_3{$i} = $peer_4{$i} = 0;
+ $peer_ident{$i} = $Fld[0];
+ ++$n;
+ }
+ $dist = $Fld[6] - $Fld[5] / 2;
+ if ($dist < $peer_dist_limit) {
+ $peer_count{$i}++;
+ $peer_mean{$i} += $Fld[2];
+ $peer_var{$i} += $Fld[3] * $Fld[3];
+ $max = $Fld[4];
+ $peer_max{$i} = max($peer_max{$i}, $max);
+ if ($max > 1) {
+ $peer_1{$i}++;
+ if ($max > 5) {
+ $peer_2{$i}++;
+ if ($max > 10) {
+ $peer_3{$i}++;
+ if ($max > 50) {
+ $peer_4{$i}++;
+ }
+ }
+ }
+ }
+ }
+ else {
+ warn "dist exceeds limit: $dist (file $in_file, line $.)\n";
+ }
+ }
+ close INPUT;
+ my @lines = ();
+ print
+ " host days mean rms max >1 >5 >10 >50\n";
+ print
+ "==================================================================\n";
+ for ($i = 0; $i < $n; $i++) {
+ next if ($peer_count{$i} < 2);
+ $peer_mean{$i} /= $peer_count{$i};
+ eval { $peer_var{$i} = sqrt($peer_var{$i} / $peer_count{$i} -
+ $peer_mean{$i} * $peer_mean{$i}); };
+ $peer_var{$i} = 0, warn $@ if $@;
+ push @lines, sprintf
+ "%-15s %3d %9.3f% 9.3f %9.3f %3d %3d %3d %3d\n",
+ $peer_ident{$i}, $peer_count{$i}, $peer_mean{$i}, $peer_var{$i},
+ $peer_max{$i}, $peer_1{$i}, $peer_2{$i}, $peer_3{$i}, $peer_4{$i};
+ }
+ print sort @lines;
+}
+
+@summary_opts@
+
+1;
+__END__
diff --git a/scripts/summary.man.in b/scripts/summary.man.in
new file mode 100644
index 0000000..2b10936
--- /dev/null
+++ b/scripts/summary.man.in
@@ -0,0 +1,123 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH summary 1summaryman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-hqaqcI/ag-uqaybI)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:52 AM by AutoGen 5.18.5pre4
+.\" From the definitions summary-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]summary\fP
+\- compute various stastics from NTP stat files
+.SH SYNOPSIS
+\f\*[B-Font]summary\fP
+[\f\*[B-Font]\-\-option-name\f[]]
+[\f\*[B-Font]\-\-option-name\f[] \f\*[I-Font]value\f[]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+.sp
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-\-directory\f[]=\f\*[I-Font]string\f[]
+Directory containing stat files.
+The default
+\f\*[I-Font]string\f[]
+for this option is:
+.ti +4
+ /var/log/ntp
+.sp
+ The directory where \fBntpd\fP will search for .stat files generated
+ by \fBntpd\fP.
+.TP
+.NOP \f\*[B-Font]\-\-end\-date\f[]=\f\*[I-Font]number\f[]
+End date.
+This option takes an integer number as its argument.
+.sp
+ Process all files with the date suffix less or equal to value of this
+ option. Defaults to today minus one day (Use \fBdate \-u +%Y%m%d\fP)
+ to get the timestamp.
+.TP
+.NOP \f\*[B-Font]\-\-output\-directory\f[]=\f\*[I-Font]str\f[]
+Output directory.
+The default
+\f\*[I-Font]str\f[]
+for this option is:
+.ti +4
+ /tmp
+.sp
+ The output directory \fBsummary\fP will write all output files to.
+.TP
+.NOP \f\*[B-Font]\-\-peer\-dist\-limit\f[]=\f\*[I-Font]float\f[]
+Peer dist limit.
+The default
+\f\*[I-Font]float\f[]
+for this option is:
+.ti +4
+ 400
+.sp
+.TP
+.NOP \f\*[B-Font]\-\-skip\-time\-steps\f[]=\f\*[I-Font]float\f[]
+Ignore time offsets larger that this.
+The default
+\f\*[I-Font]float\f[]
+for this option is:
+.ti +4
+ 3600
+.sp
+.TP
+.NOP \f\*[B-Font]\-\-start\-date\f[]=\f\*[I-Font]num\f[]
+Start date.
+This option takes an integer number as its argument.
+The default
+\f\*[I-Font]num\f[]
+for this option is:
+.ti +4
+ 19700101
+.sp
+ Process all files with the date suffix more or equal to value of
+ this option. Defaults to 197000101.
+.TP
+.NOP \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBsummary\fP
+option definitions.
diff --git a/scripts/summary.mdoc.in b/scripts/summary.mdoc.in
new file mode 100644
index 0000000..6ec7cc2
--- /dev/null
+++ b/scripts/summary.mdoc.in
@@ -0,0 +1,98 @@
+.Dd December 2 2014
+.Dt SUMMARY 1summarymdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (summary-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:54 AM by AutoGen 5.18.5pre4
+.\" From the definitions summary-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm summary
+.Nd compute various stastics from NTP stat files
+.Sh SYNOPSIS
+.Nm
+.Op Fl \-option\-name
+.Op Fl \-option\-name Ar value
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+.sp
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl \-directory Ns = Ns Ar string
+Directory containing stat files.
+The default
+.Ar string
+for this option is:
+.ti +4
+ /var/log/ntp
+.sp
+ The directory where \fBntpd\fP will search for .stat files generated
+ by \fBntpd\fP.
+.It Fl \-end\-date Ns = Ns Ar number
+End date.
+This option takes an integer number as its argument.
+.sp
+ Process all files with the date suffix less or equal to value of this
+ option. Defaults to today minus one day (Use \fBdate \-u +%Y%m%d\fP)
+ to get the timestamp.
+.It Fl \-output\-directory Ns = Ns Ar str
+Output directory.
+The default
+.Ar str
+for this option is:
+.ti +4
+ /tmp
+.sp
+ The output directory \fBsummary\fP will write all output files to.
+.It Fl \-peer\-dist\-limit Ns = Ns Ar float
+Peer dist limit.
+The default
+.Ar float
+for this option is:
+.ti +4
+ 400
+.sp
+.It Fl \-skip\-time\-steps Ns = Ns Ar float
+Ignore time offsets larger that this.
+The default
+.Ar float
+for this option is:
+.ti +4
+ 3600
+.sp
+.It Fl \-start\-date Ns = Ns Ar num
+Start date.
+This option takes an integer number as its argument.
+The default
+.Ar num
+for this option is:
+.ti +4
+ 19700101
+.sp
+ Process all files with the date suffix more or equal to value of
+ this option. Defaults to 197000101.
+.It Fl \-help
+Display usage information and exit.
+.It Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBsummary\fP
+option definitions.
diff --git a/scripts/summary.texi b/scripts/summary.texi
new file mode 100644
index 0000000..5f1548a
--- /dev/null
+++ b/scripts/summary.texi
@@ -0,0 +1,40 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename summary.info
+@settitle Summary User's Manual
+@include ../sntp/include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of @code{summary},
+a program from the NTP Project
+@end ifinfo
+
+@direntry
+* summary: (summary). Summarize (something)
+@end direntry
+
+@titlepage
+@title summary User's Manual
+@subtitle summary, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@c @page
+@c @vskip 0pt plus 1filll
+
+@node Top, summary Description, (dir), (dir)
+@top Summary User Manual
+
+This document describes the use of the NTP Project's @code{summary} program.
+This document applies to version @value{VERSION} of @code{summary}.
+
+@shortcontents
+
+@menu
+* summary Description:: Description
+* summary Invocation:: Invoking summary
+@end menu
+
+@include invoke-summary.texi