aboutsummaryrefslogtreecommitdiff
path: root/contrib/ntp/ntpq
diff options
context:
space:
mode:
authorOllivier Robert <roberto@FreeBSD.org>2001-08-29 14:35:15 +0000
committerOllivier Robert <roberto@FreeBSD.org>2001-08-29 14:35:15 +0000
commit224ba2bd37e182b64f7d78defef8a6cacaad3415 (patch)
tree3cfb63f1a112ee17469b17fc1593a88d004ddda6 /contrib/ntp/ntpq
parent1c80946020d06ca926154926c7c890d211708395 (diff)
downloadsrc-224ba2bd37e182b64f7d78defef8a6cacaad3415.tar.gz
src-224ba2bd37e182b64f7d78defef8a6cacaad3415.zip
Virgin import of ntpd 4.1.0
Notes
Notes: svn path=/vendor/ntp/dist/; revision=82498
Diffstat (limited to 'contrib/ntp/ntpq')
-rw-r--r--contrib/ntp/ntpq/Makefile.am2
-rw-r--r--contrib/ntp/ntpq/Makefile.in282
-rw-r--r--contrib/ntp/ntpq/ntpq.c52
-rw-r--r--contrib/ntp/ntpq/ntpq_ops.c16
4 files changed, 183 insertions, 169 deletions
diff --git a/contrib/ntp/ntpq/Makefile.am b/contrib/ntp/ntpq/Makefile.am
index aced16938c6a..90f4c398b754 100644
--- a/contrib/ntp/ntpq/Makefile.am
+++ b/contrib/ntp/ntpq/Makefile.am
@@ -4,7 +4,7 @@ bin_PROGRAMS = ntpq
INCLUDES = -I$(top_srcdir)/include
# LDADD might need RESLIB and ADJLIB
LDADD = version.o ../libntp/libntp.a @LIBRSAREF@
-DISTCLEANFILES = .version
+DISTCLEANFILES = .version version.c
noinst_HEADERS = ntpq.h
#EXTRA_DIST = ntpq.mak
ETAGS_ARGS = Makefile.am
diff --git a/contrib/ntp/ntpq/Makefile.in b/contrib/ntp/ntpq/Makefile.in
index d84dd6760369..2de95b7b0ecb 100644
--- a/contrib/ntp/ntpq/Makefile.in
+++ b/contrib/ntp/ntpq/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
@@ -106,109 +122,94 @@ bin_PROGRAMS = ntpq
INCLUDES = -I$(top_srcdir)/include
# LDADD might need RESLIB and ADJLIB
LDADD = version.o ../libntp/libntp.a @LIBRSAREF@
-DISTCLEANFILES = .version
+DISTCLEANFILES = .version version.c
noinst_HEADERS = ntpq.h
#EXTRA_DIST = ntpq.mak
ETAGS_ARGS = Makefile.am
ntpq_SOURCES = ntpq.c ntpq_ops.c
+EXEEXT =
+OBJEXT = o
subdir = ntpq
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 = ntpq$(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
-am_ntpq_OBJECTS = ntpq$U.o ntpq_ops$U.o
-ntpq_OBJECTS = $(am_ntpq_OBJECTS)
+am_ntpq_OBJECTS = ntpq$U.$(OBJEXT) ntpq_ops$U.$(OBJEXT)
+ntpq_OBJECTS = $(am_ntpq_OBJECTS)
ntpq_LDADD = $(LDADD)
-ntpq_DEPENDENCIES = version.o ../libntp/libntp.a
+ntpq_DEPENDENCIES = version.o ../libntp/libntp.a
ntpq_LDFLAGS =
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-DIST_SOURCES = $(ntpq_SOURCES)
-HEADERS = $(noinst_HEADERS)
-
-DIST_COMMON = README $(noinst_HEADERS) Makefile.am Makefile.in
-
-
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+DIST_SOURCES = $(ntpq_SOURCES)
+HEADERS = $(noinst_HEADERS)
-GZIP_ENV = --best
depcomp = $(SHELL) $(top_srcdir)/depcomp
-DEP_FILES = @AMDEP@ $(DEPDIR)/ntpq$U.Po $(DEPDIR)/ntpq_ops$U.Po
+@AMDEP@DEP_FILES = $(DEPDIR)/ntpq$U.Po $(DEPDIR)/ntpq_ops$U.Po
+DIST_COMMON = README $(noinst_HEADERS) Makefile.am Makefile.in
+
SOURCES = $(ntpq_SOURCES)
OBJECTS = $(am_ntpq_OBJECTS)
-all: all-redirect
-.SUFFIXES:
-.SUFFIXES: .c .o
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu ntpq/Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-
-mostlyclean-binPROGRAMS:
-
-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 ntpq/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:
-
ntpq: $(ntpq_OBJECTS) $(ntpq_DEPENDENCIES)
@rm -f ntpq
$(LINK) $(ntpq_LDFLAGS) $(ntpq_OBJECTS) $(ntpq_LDADD) $(LIBS)
@@ -216,7 +217,7 @@ ntpq_.c: ntpq.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ntpq.c; then echo $(srcdir)/ntpq.c; else echo ntpq.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ntpq_.c
ntpq_ops_.c: ntpq_ops.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ntpq_ops.c; then echo $(srcdir)/ntpq_ops.c; else echo ntpq_ops.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ntpq_ops_.c
-ntpq_.o ntpq_ops_.o : $(ANSI2KNR)
+ntpq_.$(OBJEXT) ntpq_ops_.$(OBJEXT) : $(ANSI2KNR)
tags: TAGS
@@ -227,9 +228,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`; \
@@ -242,75 +243,72 @@ 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)/ntpq$U.Po
-@AMDEP@include $(DEPDIR)/ntpq_ops$U.Po
-
-mostlyclean-depend:
-
-clean-depend:
+@AMDEP@@_am_include@ $(DEPDIR)/ntpq$U.Po
+@AMDEP@@_am_include@ $(DEPDIR)/ntpq_ops$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:
@@ -322,45 +320,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/ntpq/ntpq.c b/contrib/ntp/ntpq/ntpq.c
index 4d8c4b867137..f529d61743a3 100644
--- a/contrib/ntp/ntpq/ntpq.c
+++ b/contrib/ntp/ntpq/ntpq.c
@@ -1,12 +1,19 @@
/*
* ntpq - query an NTP server using mode 6 commands
*/
+
#include <stdio.h>
+
+#include "ntpq.h"
+#include "ntp_unixtime.h"
+#include "ntp_calendar.h"
+#include "ntp_io.h"
+#include "ntp_select.h"
+#include "ntp_stdlib.h"
+
#include <ctype.h>
#include <signal.h>
#include <setjmp.h>
-#include <sys/types.h>
-#include <sys/time.h>
#include <netdb.h>
#ifdef SYS_WINNT
# include <io.h>
@@ -14,13 +21,6 @@
#define closesocket close
#endif /* SYS_WINNT */
-#include "ntpq.h"
-#include "ntp_unixtime.h"
-#include "ntp_calendar.h"
-#include "ntp_io.h"
-#include "ntp_select.h"
-#include "ntp_stdlib.h"
-
#ifdef SYS_VXWORKS
/* vxWorks needs mode flag -casey*/
#define open(name, flags) open(name, flags, 0777)
@@ -107,13 +107,15 @@ struct ctl_var sys_var[] = {
{ CS_POLL, UI, "poll" }, /* 8 */
{ CS_PEERID, UI, "peer" }, /* 9 */
{ CS_STATE, UI, "state" }, /* 10 */
- { CS_OFFSET, FL, "phase" }, /* 11 */
+ { CS_OFFSET, FL, "offset" }, /* 11 */
{ CS_DRIFT, FS, "frequency" }, /* 12 */
- { CS_COMPLIANCE, FU, "jitter" }, /* 13 */
+ { CS_JITTER, FU, "jitter" }, /* 13 */
{ CS_CLOCK, TS, "clock" }, /* 14 */
{ CS_PROCESSOR, ST, "processor" }, /* 15 */
{ CS_SYSTEM, ST, "system" }, /* 16 */
- { CS_STABIL, FS, "stability" }, /* 17 */
+ { CS_VERSION, ST, "version" }, /* 17 */
+ { CS_STABIL, FS, "stability" }, /* 18 */
+ { CS_VARLIST, ST, "sys_var_list" }, /* 19 */
{ 0, EOV, "" }
};
@@ -158,7 +160,8 @@ struct ctl_var peer_var[] = {
{ CP_SENT, UI, "sent" }, /* 33 */
{ CP_FILTERROR, AR, "filtdisp" }, /* 34 */
{ CP_FLASH, FX, "flash" }, /* 35 */
- { CP_DISP, FU, "disp" }, /* 36 */
+ { CP_TTL, UI, "ttl" }, /* 36 */
+ { CP_TTLMAX, UI, "ttlmax" }, /* 37 */
/*
* These are duplicate entries so that we can
* process deviant version of the ntp protocol.
@@ -199,14 +202,15 @@ struct ctl_var clock_var[] = {
static const char *tstflagnames[] = {
"dup_pkt", /* TEST1 */
"bogus_pkt", /* TEST2 */
- "proto_sync", /* TEST3 */
- "peer_bounds", /* TEST4 */
- "auth", /* TEST5 */
- "peer_sync", /* TEST6 */
+ "proto_unsync", /* TEST3 */
+ "no_access", /* TEST4 */
+ "bad_auth", /* TEST5 */
+ "peer_unsync", /* TEST6 */
"peer_stratum", /* TEST7 */
"root_bounds", /* TEST8 */
- "peer_auth", /* TEST9 */
- "access" /* TEST10 */
+ "peer_bounds", /* TEST9 */
+ "bad_autokey", /* TEST10 */
+ "not_proventic" /* TEST11*/
};
@@ -667,7 +671,7 @@ sendpkt(
printf("Sending %d octets\n", xdatalen);
- if (send(sockfd, xdata, xdatalen, 0) == -1) {
+ if (send(sockfd, xdata, (size_t)xdatalen, 0) == -1) {
warning("write to %s failed", currenthost, "");
return -1;
}
@@ -1904,9 +1908,9 @@ help(
cmdsort[n++] = xcp->keyword;
#ifdef QSORT_USES_VOID_P
- qsort(cmdsort, (unsigned)n, sizeof(char *), helpsort);
+ qsort(cmdsort, (size_t)n, sizeof(char *), helpsort);
#else
- qsort((char *)cmdsort, n, sizeof(char *), helpsort);
+ qsort((char *)cmdsort, (size_t)n, sizeof(char *), helpsort);
#endif
maxlength = 0;
@@ -2837,7 +2841,7 @@ tstflags(
cb += strlen(cb);
} else {
*cb++ = ' ';
- for (i = 0; i < 10; i++) {
+ for (i = 0; i < 11; i++) {
if (val & 0x1) {
sprintf(cb, "%s%s", sep, tstflagnames[i]);
sep = ", ";
@@ -3055,7 +3059,7 @@ sortassoc(void)
#else
(char *)
#endif
- assoc_cache, (unsigned)numassoc,
+ assoc_cache, (size_t)numassoc,
sizeof(struct association), assoccmp);
}
diff --git a/contrib/ntp/ntpq/ntpq_ops.c b/contrib/ntp/ntpq/ntpq_ops.c
index 8827a8436444..c90750304066 100644
--- a/contrib/ntp/ntpq/ntpq_ops.c
+++ b/contrib/ntp/ntpq/ntpq_ops.c
@@ -1,15 +1,15 @@
/*
* ntpdc_ops.c - subroutines which are called to perform operations by ntpdc
*/
+
#include <stdio.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <netdb.h>
#include "ntpq.h"
#include "ntp_stdlib.h"
+#include <ctype.h>
+#include <netdb.h>
+
extern char * chosts[];
extern char currenthost[];
extern int numhosts;
@@ -940,7 +940,7 @@ printassoc(
conf = "yes";
else
conf = "no";
- if (statval & CTL_PST_REACH) {
+ if (statval & CTL_PST_REACH || 1) {
reach = "yes";
if (statval & CTL_PST_AUTHENABLE) {
if (statval & CTL_PST_AUTHENTIC)
@@ -1544,8 +1544,8 @@ dopeers(
}
(void) fprintf(fp, "%-*.*s ", maxhostlen, maxhostlen, "host");
}
- (void) fprintf(fp,
- " remote refid st t when poll reach delay offset jitter\n");
+ fprintf(fp,
+ " remote refid st t when poll reach delay offset jitter\n");
if (numhosts > 1)
for (i = 0; i <= maxhostlen; ++i)
(void) fprintf(fp, "=");
@@ -1610,6 +1610,8 @@ doopeers(
(void) fprintf(fp,
" remote local st t when poll reach delay offset disp\n");
(void) fprintf(fp,
+ " (s) (s) (ms) (ms) (ms)\n");
+ (void) fprintf(fp,
"==============================================================================\n");
for (i = 0; i < numassoc; i++) {