diff options
author | roberto <roberto@FreeBSD.org> | 2001-08-29 14:35:15 +0000 |
---|---|---|
committer | roberto <roberto@FreeBSD.org> | 2001-08-29 14:35:15 +0000 |
commit | 40b8e415eb0f835a9dd7a473ddf134ec67877fd7 (patch) | |
tree | 3cfb63f1a112ee17469b17fc1593a88d004ddda6 /contrib/ntp/ntptrace | |
parent | a5a8dc6136fcee95f261a31609a25669038c3861 (diff) | |
download | FreeBSD-src-40b8e415eb0f835a9dd7a473ddf134ec67877fd7.zip FreeBSD-src-40b8e415eb0f835a9dd7a473ddf134ec67877fd7.tar.gz |
Virgin import of ntpd 4.1.0
Diffstat (limited to 'contrib/ntp/ntptrace')
-rw-r--r-- | contrib/ntp/ntptrace/Makefile.in | 278 | ||||
-rw-r--r-- | contrib/ntp/ntptrace/ntptrace.c | 39 |
2 files changed, 168 insertions, 149 deletions
diff --git a/contrib/ntp/ntptrace/Makefile.in b/contrib/ntp/ntptrace/Makefile.in index 35078e9..f014e02 100644 --- a/contrib/ntp/ntptrace/Makefile.in +++ b/contrib/ntp/ntptrace/Makefile.in @@ -1,6 +1,7 @@ -# Makefile.in generated automatically by automake 1.4a from Makefile.am +# Makefile.in generated automatically by automake 1.4e from Makefile.am. -# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# 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. @@ -31,8 +32,6 @@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include -DESTDIR = - pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -48,7 +47,7 @@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_FLAG = +INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : @@ -57,24 +56,30 @@ 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@ + +@SET_MAKE@ AMDEP = @AMDEP@ AMTAR = @AMTAR@ +AUTOKEY = @AUTOKEY@ AWK = @AWK@ CC = @CC@ CFLAGS = @CFLAGS@ CHUTEST = @CHUTEST@ CLKTEST = @CLKTEST@ CPP = @CPP@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ DCFD = @DCFD@ DEPDIR = @DEPDIR@ +EF_LIBS = @EF_LIBS@ +EF_PROGS = @EF_PROGS@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTALL_STRIP_PROGRAM_ENV = @INSTALL_STRIP_PROGRAM_ENV@ LDFLAGS = @LDFLAGS@ LIBPARSE = @LIBPARSE@ LIBRSAREF = @LIBRSAREF@ @@ -86,16 +91,27 @@ MAKE_LIBPARSE = @MAKE_LIBPARSE@ MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@ MAKE_LIBRSAREF = @MAKE_LIBRSAREF@ MAKE_NTPTIME = @MAKE_NTPTIME@ +MAKE_NTP_GENKEYS = @MAKE_NTP_GENKEYS@ MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@ MAKE_TICKADJ = @MAKE_TICKADJ@ +MAKE_TIMETRIM = @MAKE_TIMETRIM@ +OPENSSL = @OPENSSL@ +OPENSSL_INC = @OPENSSL_INC@ +OPENSSL_LIB = @OPENSSL_LIB@ PACKAGE = @PACKAGE@ +PATH_PERL = @PATH_PERL@ PATH_SH = @PATH_SH@ PROPDELAY = @PROPDELAY@ RANLIB = @RANLIB@ +RSADIR = @RSADIR@ +RSAOBJS = @RSAOBJS@ RSAREF = @RSAREF@ +RSASRCS = @RSASRCS@ +STRIP = @STRIP@ TESTDCF = @TESTDCF@ U = @U@ VERSION = @VERSION@ +_am_include = @_am_include@ install_sh = @install_sh@ #AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies @@ -110,109 +126,94 @@ DISTCLEANFILES = .version version.c noinst_HEADERS = ntptrace.h #EXTRA_DIST = ntptrace.mak README TAGS save ETAGS_ARGS = Makefile.am +EXEEXT = +OBJEXT = o subdir = ntptrace mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../config.h -CONFIG_CLEAN_FILES = -PROGRAMS = $(bin_PROGRAMS) +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +bin_PROGRAMS = ntptrace$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) -DEFS = @DEFS@ -I. -I$(srcdir) -I.. +DEFS = @DEFS@ -I. -I$(srcdir) -I$(top_builddir) CPPFLAGS = @CPPFLAGS@ LIBS = @LIBS@ ANSI2KNR = ../util/ansi2knr ntptrace_SOURCES = ntptrace.c -ntptrace_OBJECTS = ntptrace$U.o +ntptrace_OBJECTS = ntptrace$U.$(OBJEXT) ntptrace_LDADD = $(LDADD) -ntptrace_DEPENDENCIES = version.o ../libntp/libntp.a +ntptrace_DEPENDENCIES = version.o ../libntp/libntp.a ntptrace_LDFLAGS = COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = ntptrace.c -HEADERS = $(noinst_HEADERS) - -DIST_COMMON = README $(noinst_HEADERS) Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +DIST_SOURCES = ntptrace.c +HEADERS = $(noinst_HEADERS) -GZIP_ENV = --best depcomp = $(SHELL) $(top_srcdir)/depcomp -DEP_FILES = @AMDEP@ $(DEPDIR)/ntptrace$U.Po -SOURCES = ntptrace.c -OBJECTS = ntptrace$U.o - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .c .o -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu ntptrace/Makefile +@AMDEP@DEP_FILES = $(DEPDIR)/ntptrace$U.Po +DIST_COMMON = README $(noinst_HEADERS) Makefile.am Makefile.in -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-binPROGRAMS: +SOURCES = ntptrace.c +OBJECTS = ntptrace$U.$(OBJEXT) -clean-binPROGRAMS: - -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +all: all-am -distclean-binPROGRAMS: +.SUFFIXES: +.SUFFIXES: .c .o .obj -maintainer-clean-binPROGRAMS: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu ntptrace/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ - f="`echo $$p|sed -e 's/$(EXEEXT)$$//' -e '$(transform)' -e 's/$$/$(EXEEXT)/'`"; \ - echo " $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(bindir)/$$f"; \ - $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(bindir)/$$f; \ + f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f="`echo $$p|sed -e 's/$(EXEEXT)$$//' -e '$(transform)' -e 's/$$/$(EXEEXT)/'`"; \ + f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done -mostlyclean-compile: - -rm -f *.o core *.core +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) -clean-compile: +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c - -maintainer-clean-compile: -../util/ansi2knr: ../util/ansi2knr.o +../util/ansi2knr: ../util/ansi2knr.$(OBJEXT) cd ../util && $(MAKE) $(AM_MAKEFLAGS) ansi2knr -../util/ansi2knr.o: - cd ../util && $(MAKE) $(AM_MAKEFLAGS) ansi2knr.o +../util/ansi2knr.$(OBJEXT): + cd ../util && $(MAKE) $(AM_MAKEFLAGS) ansi2knr.$(OBJEXT) mostlyclean-kr: -rm -f *_.c -clean-kr: - -distclean-kr: - -maintainer-clean-kr: - ntptrace: $(ntptrace_OBJECTS) $(ntptrace_DEPENDENCIES) @rm -f ntptrace $(LINK) $(ntptrace_LDFLAGS) $(ntptrace_OBJECTS) $(ntptrace_LDADD) $(LIBS) ntptrace_.c: ntptrace.c $(ANSI2KNR) $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ntptrace.c; then echo $(srcdir)/ntptrace.c; else echo ntptrace.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ntptrace_.c -ntptrace_.o : $(ANSI2KNR) +ntptrace_.$(OBJEXT) : $(ANSI2KNR) tags: TAGS @@ -223,9 +224,9 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - mkid -f$$here/ID $$unique $(LISP) + mkid -fID $$unique $(LISP) -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ @@ -238,74 +239,71 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -mostlyclean-tags: - -clean-tags: +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $$here distclean-tags: -rm -f TAGS ID -maintainer-clean-tags: - -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -distdir: $(DISTFILES) - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pR $$d/$$file $(distdir); \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done - -@AMDEP@include $(DEPDIR)/ntptrace$U.Po - -mostlyclean-depend: - -clean-depend: +@AMDEP@@_am_include@ $(DEPDIR)/ntptrace$U.Po distclean-depend: -rm -rf $(DEPDIR) -maintainer-clean-depend: - @AMDEP@CCDEPMODE = @CCDEPMODE@ .c.o: @AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(COMPILE) -c -o $@ $< + $(COMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$< -info-am: -info: info-am -dvi-am: -dvi: dvi-am +.c.obj: +@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c -o $@ `cygpath -w $<` + + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done check-am: all-am check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: install-binPROGRAMS -install-exec: install-exec-am +all-am: Makefile $(PROGRAMS) $(HEADERS) -install-data-am: +installdirs: + $(mkinstalldirs) $(DESTDIR)$(bindir) + +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 -install: install-am -uninstall-am: uninstall-binPROGRAMS -uninstall: uninstall-am -all-am: Makefile $(PROGRAMS) $(HEADERS) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install -installdirs: - $(mkinstalldirs) $(DESTDIR)$(bindir) +installcheck: installcheck-am + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_PROGRAM_ENV='$(INSTALL_STRIP_PROGRAM_ENV)' install mostlyclean-generic: @@ -317,45 +315,55 @@ distclean-generic: -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." -rm -f Makefile.in -mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \ - mostlyclean-kr mostlyclean-tags mostlyclean-depend \ - mostlyclean-generic +clean: clean-am -mostlyclean: mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am -clean-am: clean-binPROGRAMS clean-compile clean-kr clean-tags \ - clean-depend clean-generic mostlyclean-am +distclean: distclean-am -clean: clean-am +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-tags -distclean-am: distclean-binPROGRAMS distclean-compile distclean-kr \ - distclean-tags distclean-depend distclean-generic \ - clean-am +dvi: -distclean: distclean-am +dvi-am: -maintainer-clean-am: maintainer-clean-binPROGRAMS \ - maintainer-clean-compile maintainer-clean-kr \ - maintainer-clean-tags maintainer-clean-depend \ - maintainer-clean-generic distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." +info: + +info-am: + +install-data-am: + +install-exec-am: install-binPROGRAMS + +install-info: + +install-man: + +installcheck-am: maintainer-clean: maintainer-clean-am -.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ -maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile mostlyclean-kr distclean-kr clean-kr \ -maintainer-clean-kr tags mostlyclean-tags distclean-tags clean-tags \ -maintainer-clean-tags distdir mostlyclean-depend distclean-depend \ -clean-depend maintainer-clean-depend info-am info dvi-am dvi check \ -check-am installcheck-am installcheck install-exec-am install-exec \ -install-data-am install-data install-am install uninstall-am uninstall \ -all-redirect all-am all install-strip installdirs mostlyclean-generic \ -distclean-generic clean-generic maintainer-clean-generic clean \ -mostlyclean distclean maintainer-clean +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr + +uninstall-am: uninstall-binPROGRAMS + +.PHONY: all all-am check check-am clean clean-binPROGRAMS clean-generic \ + distclean distclean-compile distclean-depend distclean-generic \ + distclean-tags distdir dvi dvi-am info info-am install \ + install-am install-binPROGRAMS install-data install-data-am \ + install-exec install-exec-am install-info install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-kr tags \ + uninstall uninstall-am uninstall-binPROGRAMS $(PROGRAMS): $(LDADD) diff --git a/contrib/ntp/ntptrace/ntptrace.c b/contrib/ntp/ntptrace/ntptrace.c index d69e2b0..f7106ba 100644 --- a/contrib/ntp/ntptrace/ntptrace.c +++ b/contrib/ntp/ntptrace/ntptrace.c @@ -8,18 +8,9 @@ * * Large portions stolen from ntpdate.c */ -#include <stdio.h> -#include <signal.h> -#include <ctype.h> -#include <netdb.h> -#include <sys/types.h> -#include <sys/signal.h> -#include <sys/ioctl.h> -#include <sys/time.h> -#include <sys/resource.h> -#if defined(SYS_HPUX) -#include <utmp.h> +#ifdef HAVE_CONFIG_H +# include <config.h> #endif #include "ntp_fp.h" @@ -32,6 +23,17 @@ #include "ntp_select.h" #include "ntp_stdlib.h" #include "recvbuff.h" + +#include <stdio.h> +#include <signal.h> +#include <ctype.h> +#include <netdb.h> +#include <sys/signal.h> +#ifdef HAVE_SYS_IOCTL_H +# include <sys/ioctl.h> +#endif +#include <sys/resource.h> + /* * only 16 stratums, so this is more than enough. */ @@ -59,7 +61,7 @@ int sys_retries = 5; /* # of retry attempts per server */ int sys_timeout = 2; /* timeout time, in seconds */ struct server **sys_servers; /* the server list */ int sys_numservers = 0; /* number of servers to poll */ -int sys_maxservers = NTP_MAXSTRATUM+1; /* max number of servers to deal with */ +int sys_maxservers = STRATUM_UNSPEC; /* max number of servers to deal with */ int sys_version = NTP_OLDVERSION; /* version to poll with */ @@ -242,6 +244,15 @@ DoTrace( { int retries = sys_retries; + if (!server->srcadr.sin_addr.s_addr) { + if (nonames) + printf("%s:\t*Not Synchronized*\n", ntoa(&server->srcadr)); + else + printf("%s:\t*Not Synchronized*\n", ntohost(&server->srcadr)); + fflush(stdout); + return; + } + if (!verbose) { if (nonames) printf("%s: ", ntoa(&server->srcadr)); @@ -426,7 +437,7 @@ ReceiveBuf( if ((PKT_MODE(rpkt->li_vn_mode) != MODE_SERVER && PKT_MODE(rpkt->li_vn_mode) != MODE_PASSIVE) - || rpkt->stratum > NTP_MAXSTRATUM) { + || rpkt->stratum >= STRATUM_UNSPEC) { if (debug) printf("receive: mode %d stratum %d\n", PKT_MODE(rpkt->li_vn_mode), rpkt->stratum); @@ -607,7 +618,7 @@ sendpkt( { int cc; - cc = sendto(fd, (char *)pkt, len, 0, (struct sockaddr *)dest, + cc = sendto(fd, (char *)pkt, (size_t)len, 0, (struct sockaddr *)dest, sizeof(struct sockaddr_in)); if (cc == -1) { #ifndef SYS_WINNT |