diff options
author | roberto <roberto@FreeBSD.org> | 2000-01-28 14:55:50 +0000 |
---|---|---|
committer | roberto <roberto@FreeBSD.org> | 2000-01-28 14:55:50 +0000 |
commit | b5b40f9e420899251189775800d9f74092925299 (patch) | |
tree | 98efdf1b74d6ecb7828bb502a0350116eeb2fd3c /contrib/ntp/ntpq | |
parent | ef64b99e8412f2273dd2e8b3291c2f78ffc4667f (diff) | |
download | FreeBSD-src-b5b40f9e420899251189775800d9f74092925299.zip FreeBSD-src-b5b40f9e420899251189775800d9f74092925299.tar.gz |
Virgin import of ntpd 4.0.99b
Diffstat (limited to 'contrib/ntp/ntpq')
-rw-r--r-- | contrib/ntp/ntpq/Makefile.in | 95 | ||||
-rw-r--r-- | contrib/ntp/ntpq/ntpq.c | 2 | ||||
-rw-r--r-- | contrib/ntp/ntpq/ntpq_ops.c | 20 |
3 files changed, 68 insertions, 49 deletions
diff --git a/contrib/ntp/ntpq/Makefile.in b/contrib/ntp/ntpq/Makefile.in index 549840a..d84dd67 100644 --- a/contrib/ntp/ntpq/Makefile.in +++ b/contrib/ntp/ntpq/Makefile.in @@ -63,15 +63,18 @@ host_alias = @host_alias@ host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ +AMDEP = @AMDEP@ AMTAR = @AMTAR@ -AMTARFLAGS = @AMTARFLAGS@ AWK = @AWK@ CC = @CC@ CFLAGS = @CFLAGS@ CHUTEST = @CHUTEST@ CLKTEST = @CLKTEST@ CPP = @CPP@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ DCFD = @DCFD@ +DEPDIR = @DEPDIR@ LDFLAGS = @LDFLAGS@ LIBPARSE = @LIBPARSE@ LIBRSAREF = @LIBRSAREF@ @@ -93,6 +96,7 @@ RSAREF = @RSAREF@ TESTDCF = @TESTDCF@ U = @U@ VERSION = @VERSION@ +install_sh = @install_sh@ #AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies @@ -136,6 +140,8 @@ DIST_COMMON = README $(noinst_HEADERS) Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) GZIP_ENV = --best +depcomp = $(SHELL) $(top_srcdir)/depcomp +DEP_FILES = @AMDEP@ $(DEPDIR)/ntpq$U.Po $(DEPDIR)/ntpq_ops$U.Po SOURCES = $(ntpq_SOURCES) OBJECTS = $(am_ntpq_OBJECTS) @@ -143,9 +149,9 @@ all: all-redirect .SUFFIXES: .SUFFIXES: .c .o $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps ntpq/Makefile + cd $(top_srcdir) && $(AUTOMAKE) --gnu ntpq/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -178,9 +184,6 @@ uninstall-binPROGRAMS: rm -f $(DESTDIR)$(bindir)/$$f; \ done -.c.o: - $(COMPILE) -c $< - mostlyclean-compile: -rm -f *.o core *.core @@ -205,8 +208,6 @@ clean-kr: distclean-kr: maintainer-clean-kr: -ntpq$U.o: -ntpq_ops$U.o: ntpq: $(ntpq_OBJECTS) $(ntpq_DEPENDENCIES) @rm -f ntpq @@ -219,23 +220,27 @@ ntpq_.o ntpq_ops_.o : $(ANSI2KNR) tags: TAGS -ID: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - ${AWK:-awk} ' { files[$$0] = 1; } \ +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(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; } \ END { for (i in files) print i; }'`; \ - here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $$unique $(LISP) + mkid -f$$here/ID $$unique $(LISP) -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - ${AWK:-awk} ' { files[$$0] = 1; } \ + list='$(SOURCES) $(HEADERS) $(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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ - || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) mostlyclean-tags: @@ -252,25 +257,33 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ + 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 -ntpq.o: ntpq.c ntpq.h ../include/ntp_fp.h ../include/ntp_types.h \ - ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \ - ../include/ntp.h ../include/ntp_control.h \ - ../include/ntp_string.h ../include/ntp_malloc.h \ - ../include/ntp_unixtime.h ../include/ntp_calendar.h \ - ../include/ntp_io.h ../include/ntp_select.h \ - ../include/ntp_stdlib.h ../include/l_stdlib.h -ntpq_ops.o: ntpq_ops.c ntpq.h ../include/ntp_fp.h ../include/ntp_types.h \ - ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \ - ../include/ntp.h ../include/ntp_control.h \ - ../include/ntp_string.h ../include/ntp_malloc.h \ - ../include/ntp_stdlib.h ../include/l_stdlib.h + +@AMDEP@include $(DEPDIR)/ntpq$U.Po +@AMDEP@include $(DEPDIR)/ntpq_ops$U.Po + +mostlyclean-depend: + +clean-depend: + +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 $@ $< info-am: info: info-am @@ -309,25 +322,28 @@ distclean-generic: -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: + -rm -f Makefile.in mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \ - mostlyclean-kr mostlyclean-tags mostlyclean-generic + mostlyclean-kr mostlyclean-tags mostlyclean-depend \ + mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-binPROGRAMS clean-compile clean-kr clean-tags \ - clean-generic mostlyclean-am + clean-depend clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-binPROGRAMS distclean-compile distclean-kr \ - distclean-tags distclean-generic clean-am + distclean-tags distclean-depend distclean-generic \ + clean-am distclean: distclean-am maintainer-clean-am: maintainer-clean-binPROGRAMS \ maintainer-clean-compile maintainer-clean-kr \ - maintainer-clean-tags maintainer-clean-generic \ - distclean-am + 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." @@ -338,8 +354,9 @@ 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 info-am info dvi-am dvi check check-am \ -installcheck-am installcheck install-exec-am install-exec \ +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 \ diff --git a/contrib/ntp/ntpq/ntpq.c b/contrib/ntp/ntpq/ntpq.c index 3361e2b..4d8c4b8 100644 --- a/contrib/ntp/ntpq/ntpq.c +++ b/contrib/ntp/ntpq/ntpq.c @@ -336,7 +336,7 @@ struct xcmd builtins[] = { #define DEFTIMEOUT (5) /* 5 second time out */ #define DEFSTIMEOUT (2) /* 2 second time out after first */ #define DEFDELAY 0x51EB852 /* 20 milliseconds, l_fp fraction */ -#define DEFHOST "localhost" /* default host name */ +#define DEFHOST "127.0.0.1" /* default host name */ #define LENHOSTNAME 256 /* host name is 256 characters long */ #define MAXCMDS 100 /* maximum commands on cmd line */ #define MAXHOSTS 200 /* maximum hosts on cmd line */ diff --git a/contrib/ntp/ntpq/ntpq_ops.c b/contrib/ntp/ntpq/ntpq_ops.c index d43d228..8827a84 100644 --- a/contrib/ntp/ntpq/ntpq_ops.c +++ b/contrib/ntp/ntpq/ntpq_ops.c @@ -1319,7 +1319,7 @@ doprintpeers( l_fp rec; l_fp ts; u_char havevar[MAXHAVE]; - u_long poll; + u_long poll_sec; char type = '?'; char refid_string[10]; char whenbuf[8], pollbuf[8]; @@ -1442,7 +1442,7 @@ doprintpeers( /* * Got everything, format the line */ - poll = 1<<max(min3(ppoll, hpoll, NTP_MAXPOLL), NTP_MINPOLL); + poll_sec = 1<<max(min3(ppoll, hpoll, NTP_MAXPOLL), NTP_MINPOLL); if (pktversion > NTP_OLDVERSION) c = flash3[CTL_PEER_STATVAL(rstatus) & 0x7]; else @@ -1453,7 +1453,7 @@ doprintpeers( "%c%-15.15s %-15.15s %2ld %c %4.4s %4.4s %3lo %7.7s %8.7s %7.7s\n", c, nntohost(srcadr), dstadr_refid, stratum, type, prettyinterval(whenbuf, when(&ts, &rec, &reftime)), - prettyinterval(pollbuf, (int)poll), reach, + prettyinterval(pollbuf, (int)poll_sec), reach, lfptoms(&estdelay, 3), lfptoms(&estoffset, 3), havevar[HAVE_JITTER] ? lfptoms(&estjitter, 3) : lfptoms(&estdisp, 3)); @@ -1535,13 +1535,15 @@ dopeers( if (!dogetassoc(fp)) return; - for (i = 0; i < numhosts; ++i) - { if(getnetnum(chosts[i],&netnum,fullname)) - if ((int)strlen(fullname) > maxhostlen) - maxhostlen = strlen(fullname); - } - if (numhosts > 1) + maxhostlen = 0; + if (numhosts > 1) { + for (i = 0; i < numhosts; ++i) + { if(getnetnum(chosts[i],&netnum,fullname)) + if ((int)strlen(fullname) > maxhostlen) + maxhostlen = strlen(fullname); + } (void) fprintf(fp, "%-*.*s ", maxhostlen, maxhostlen, "host"); + } (void) fprintf(fp, " remote refid st t when poll reach delay offset jitter\n"); if (numhosts > 1) |