diff options
Diffstat (limited to 'contrib/ntp/scripts')
-rw-r--r-- | contrib/ntp/scripts/Makefile.am | 2 | ||||
-rw-r--r-- | contrib/ntp/scripts/Makefile.in | 211 | ||||
-rwxr-xr-x | contrib/ntp/scripts/ntptrace.in | 60 |
3 files changed, 199 insertions, 74 deletions
diff --git a/contrib/ntp/scripts/Makefile.am b/contrib/ntp/scripts/Makefile.am index b970602..dc41963 100644 --- a/contrib/ntp/scripts/Makefile.am +++ b/contrib/ntp/scripts/Makefile.am @@ -1,4 +1,4 @@ -bin_SCRIPTS = ntp-wait +bin_SCRIPTS = ntp-wait ntptrace noinst_SCRIPTS = calc_tickadj checktime freq_adj mkver ntpsweep ntpver plot_summary summary EXTRA_DIST = fixautomakedepsmagic hpadjtime.sh monitoring ntp-close \ ntp-groper ntp-restart ntp-status rc1 rc2 stats support diff --git a/contrib/ntp/scripts/Makefile.in b/contrib/ntp/scripts/Makefile.in index 110c090..ff2c46b 100644 --- a/contrib/ntp/scripts/Makefile.in +++ b/contrib/ntp/scripts/Makefile.in @@ -1,6 +1,7 @@ -# Makefile.in generated automatically by automake 1.5 from Makefile.am. +# Makefile.in generated by automake 1.7.7 from Makefile.am. +# @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -13,80 +14,79 @@ @SET_MAKE@ -SHELL = @SHELL@ - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ +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@ +transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_alias = @build_alias@ build_triplet = @build@ -host_alias = @host_alias@ host_triplet = @host@ -target_alias = @target_alias@ target_triplet = @target@ +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ -AUTOKEY = @AUTOKEY@ +ARLIB_DIR = @ARLIB_DIR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHUTEST = @CHUTEST@ CLKTEST = @CLKTEST@ CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ DCFD = @DCFD@ +DEFS = @DEFS@ DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ EF_LIBS = @EF_LIBS@ EF_PROGS = @EF_PROGS@ +EGREP = @EGREP@ EXEEXT = @EXEEXT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LCRYPTO = @LCRYPTO@ LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ LIBPARSE = @LIBPARSE@ -LIBRSAREF = @LIBRSAREF@ +LIBS = @LIBS@ LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ MAKE_ADJTIMED = @MAKE_ADJTIMED@ MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@ +MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@ MAKE_LIBPARSE = @MAKE_LIBPARSE@ MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@ -MAKE_LIBRSAREF = @MAKE_LIBRSAREF@ +MAKE_NTPDSIM = @MAKE_NTPDSIM@ MAKE_NTPTIME = @MAKE_NTPTIME@ -MAKE_NTP_GENKEYS = @MAKE_NTP_GENKEYS@ +MAKE_NTP_KEYGEN = @MAKE_NTP_KEYGEN@ MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@ +MAKE_SNTP = @MAKE_SNTP@ MAKE_TICKADJ = @MAKE_TICKADJ@ MAKE_TIMETRIM = @MAKE_TIMETRIM@ OBJEXT = @OBJEXT@ @@ -94,37 +94,80 @@ OPENSSL = @OPENSSL@ OPENSSL_INC = @OPENSSL_INC@ OPENSSL_LIB = @OPENSSL_LIB@ PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_PERL = @PATH_PERL@ +PATH_SEPARATOR = @PATH_SEPARATOR@ PATH_SH = @PATH_SH@ PROPDELAY = @PROPDELAY@ RANLIB = @RANLIB@ -RSADIR = @RSADIR@ -RSAOBJS = @RSAOBJS@ -RSAREF = @RSAREF@ -RSASRCS = @RSASRCS@ +READLINE_LIBS = @READLINE_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ TESTDCF = @TESTDCF@ U = @U@ VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ +am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ install_sh = @install_sh@ - -bin_SCRIPTS = ntp-wait +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +bin_SCRIPTS = ntp-wait ntptrace noinst_SCRIPTS = calc_tickadj checktime freq_adj mkver ntpsweep ntpver plot_summary summary EXTRA_DIST = fixautomakedepsmagic hpadjtime.sh monitoring ntp-close \ ntp-groper ntp-restart ntp-status rc1 rc2 stats support subdir = scripts +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = calc_tickadj checktime freq_adj mkver ntp-wait \ - ntpsweep ntpver plot_summary summary + ntpsweep ntptrace ntpver plot_summary summary SCRIPTS = $(bin_SCRIPTS) $(noinst_SCRIPTS) DIST_SOURCES = -DIST_COMMON = README Makefile.am Makefile.in calc_tickadj.in \ +DIST_COMMON = README $(srcdir)/Makefile.in Makefile.am calc_tickadj.in \ checktime.in freq_adj.in mkver.in ntp-wait.in ntpsweep.in \ - ntpver.in plot_summary.in summary.in + ntptrace.in ntpver.in plot_summary.in summary.in all: all-am .SUFFIXES: @@ -132,45 +175,44 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu scripts/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && \ - CONFIG_HEADERS= CONFIG_LINKS= \ - CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) calc_tickadj: $(top_builddir)/config.status calc_tickadj.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ checktime: $(top_builddir)/config.status checktime.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ freq_adj: $(top_builddir)/config.status freq_adj.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mkver: $(top_builddir)/config.status mkver.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ ntp-wait: $(top_builddir)/config.status ntp-wait.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ ntpsweep: $(top_builddir)/config.status ntpsweep.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +ntptrace: $(top_builddir)/config.status ntptrace.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ ntpver: $(top_builddir)/config.status ntpver.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ plot_summary: $(top_builddir)/config.status plot_summary.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ summary: $(top_builddir)/config.status summary.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +binSCRIPT_INSTALL = $(INSTALL_SCRIPT) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_SCRIPTS)'; for p in $$list; do \ - f="`echo $$p|sed '$(transform)'`"; \ - if test -f $$p; then \ - echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/$$f"; \ - $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/$$f; \ - elif test -f $(srcdir)/$$p; then \ - echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/$$f"; \ - $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/$$f; \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f $$d$$p; then \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f"; \ + $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ - f="`echo $$p|sed '$(transform)'`"; \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done @@ -178,6 +220,8 @@ uninstall-info-am: tags: TAGS TAGS: +ctags: CTAGS +CTAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -185,15 +229,26 @@ top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) - @for file in $(DISTFILES); do \ - if test -f $$file; then d=.; else d=$(srcdir); fi; \ + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - $(mkinstalldirs) "$(distdir)/$$dir"; \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ fi; \ if test -d $$d/$$file; then \ - cp -pR $$d/$$file $(distdir) \ - || exit 1; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ @@ -206,7 +261,6 @@ all-am: Makefile $(SCRIPTS) installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) - install: install-am install-exec: install-exec-am install-data: install-data-am @@ -218,6 +272,7 @@ install-am: all-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: @@ -225,7 +280,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -235,6 +290,7 @@ clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am + -rm -f Makefile distclean-am: clean-am distclean-generic @@ -257,6 +313,7 @@ install-man: installcheck-am: maintainer-clean: maintainer-clean-am + -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -264,6 +321,14 @@ mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + uninstall-am: uninstall-binSCRIPTS uninstall-info-am .PHONY: all all-am check check-am clean clean-generic distclean \ @@ -272,8 +337,8 @@ uninstall-am: uninstall-binSCRIPTS uninstall-info-am install-exec install-exec-am install-info install-info-am \ install-man install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic uninstall uninstall-am \ - uninstall-binSCRIPTS uninstall-info-am + mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ + uninstall-am uninstall-binSCRIPTS uninstall-info-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. diff --git a/contrib/ntp/scripts/ntptrace.in b/contrib/ntp/scripts/ntptrace.in new file mode 100755 index 0000000..8545b2c --- /dev/null +++ b/contrib/ntp/scripts/ntptrace.in @@ -0,0 +1,60 @@ +#! @PATH_PERL@ -w + +# John Hay -- John.Hay@icomtek.csir.co.za / jhay@FreeBSD.org + +use Socket; +use Getopt::Std; +use vars qw($opt_n); + +$ntpq = "ntpq"; + +getopts('n'); + +$dodns = 1; +$dodns = 0 if (defined($opt_n)); + +$host = shift; +$host ||= "127.0.0.1"; + +for (;;) { + $stratum = 255; + $cmd = "$ntpq -n -c rv $host"; + open(PH, $cmd . "|") || die "failed to start command $cmd: $!"; + while (<PH>) { + $stratum = $1 if (/stratum=(\d+)/); + $peer = $1 if (/peer=(\d+)/); + # Very old servers report phase and not offset. + $offset = $1 if (/(?:offset|phase)=([^\s,]+)/); + $rootdelay = $1 if (/rootdelay=([^\s,]+)/); + $refid = $1 if (/refid=([^\s,]+)/); + } + close(PH) || die "$cmd failed"; + last if ($stratum == 255); + $offset /= 1000; + $rootdelay /= 1000; + $dhost = $host; + # Only do lookups of IPv4 addresses. The standard lookup functions + # of perl only do IPv4 and I don't know if we should require extras. + if ($dodns && $host =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/) { + $iaddr = inet_aton($host); + $name = (gethostbyaddr($iaddr, AF_INET))[0]; + $dhost = $name if (defined($name)); + } + printf("%s: stratum %d, offset %f, root distance %f", + $dhost, $stratum, $offset, $rootdelay); + printf(", refid '%s'", $refid) if ($stratum == 1); + printf("\n"); + last if ($stratum == 0 || $stratum == 1 || $stratum == 16); + last if ($refid =~ /^127\.127\.\d{1,3}\.\d{1,3}$/); + + $cmd = "$ntpq -n -c \"pstat $peer\" $host"; + open(PH, $cmd . "|") || die "failed to start command $cmd: $!"; + $thost = ""; + while (<PH>) { + $thost = $1, last if (/srcadr=(\S+),/); + } + close(PH) || die "$cmd failed"; + last if ($thost eq ""); + $host = $thost; +} + |