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/ntpdc | |
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/ntpdc')
-rw-r--r-- | contrib/ntp/ntpdc/Makefile.in | 280 | ||||
-rw-r--r-- | contrib/ntp/ntpdc/ntpdc.c | 44 | ||||
-rw-r--r-- | contrib/ntp/ntpdc/ntpdc_ops.c | 32 |
3 files changed, 192 insertions, 164 deletions
diff --git a/contrib/ntp/ntpdc/Makefile.in b/contrib/ntp/ntpdc/Makefile.in index a796bc4..ce9683a 100644 --- a/contrib/ntp/ntpdc/Makefile.in +++ b/contrib/ntp/ntpdc/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 @@ -112,103 +128,88 @@ noinst_HEADERS = ntpdc.h ETAGS_ARGS = Makefile.am ntpdc_SOURCES = ntpdc.c ntpdc_ops.c +EXEEXT = +OBJEXT = o subdir = ntpdc 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 = ntpdc$(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_ntpdc_OBJECTS = ntpdc$U.o ntpdc_ops$U.o -ntpdc_OBJECTS = $(am_ntpdc_OBJECTS) +am_ntpdc_OBJECTS = ntpdc$U.$(OBJEXT) ntpdc_ops$U.$(OBJEXT) +ntpdc_OBJECTS = $(am_ntpdc_OBJECTS) ntpdc_LDADD = $(LDADD) -ntpdc_DEPENDENCIES = version.o ../libntp/libntp.a +ntpdc_DEPENDENCIES = version.o ../libntp/libntp.a ntpdc_LDFLAGS = COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(ntpdc_SOURCES) -HEADERS = $(noinst_HEADERS) - -DIST_COMMON = README $(noinst_HEADERS) Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +DIST_SOURCES = $(ntpdc_SOURCES) +HEADERS = $(noinst_HEADERS) -GZIP_ENV = --best depcomp = $(SHELL) $(top_srcdir)/depcomp -DEP_FILES = @AMDEP@ $(DEPDIR)/ntpdc$U.Po $(DEPDIR)/ntpdc_ops$U.Po +@AMDEP@DEP_FILES = $(DEPDIR)/ntpdc$U.Po $(DEPDIR)/ntpdc_ops$U.Po +DIST_COMMON = README $(noinst_HEADERS) Makefile.am Makefile.in + SOURCES = $(ntpdc_SOURCES) OBJECTS = $(am_ntpdc_OBJECTS) -all: all-redirect -.SUFFIXES: -.SUFFIXES: .c .o -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu ntpdc/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 ntpdc/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: - ntpdc: $(ntpdc_OBJECTS) $(ntpdc_DEPENDENCIES) @rm -f ntpdc $(LINK) $(ntpdc_LDFLAGS) $(ntpdc_OBJECTS) $(ntpdc_LDADD) $(LIBS) @@ -216,7 +217,7 @@ ntpdc_.c: ntpdc.c $(ANSI2KNR) $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ntpdc.c; then echo $(srcdir)/ntpdc.c; else echo ntpdc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ntpdc_.c ntpdc_ops_.c: ntpdc_ops.c $(ANSI2KNR) $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ntpdc_ops.c; then echo $(srcdir)/ntpdc_ops.c; else echo ntpdc_ops.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ntpdc_ops_.c -ntpdc_.o ntpdc_ops_.o : $(ANSI2KNR) +ntpdc_.$(OBJEXT) ntpdc_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)/ntpdc$U.Po -@AMDEP@include $(DEPDIR)/ntpdc_ops$U.Po - -mostlyclean-depend: - -clean-depend: +@AMDEP@@_am_include@ $(DEPDIR)/ntpdc$U.Po +@AMDEP@@_am_include@ $(DEPDIR)/ntpdc_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/ntpdc/ntpdc.c b/contrib/ntp/ntpdc/ntpdc.c index a529954..09ba633 100644 --- a/contrib/ntp/ntpdc/ntpdc.c +++ b/contrib/ntp/ntpdc/ntpdc.c @@ -1,25 +1,29 @@ /* * ntpdc - control and monitor your ntpd daemon */ + #include <stdio.h> + +#include "ntpdc.h" +#include "ntp_select.h" +#include "ntp_io.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> +# include <io.h> #else -#define closesocket close +# define closesocket close #endif /* SYS_WINNT */ - -#include "ntpdc.h" -#include "ntp_select.h" -#include "ntp_io.h" -#include "ntp_stdlib.h" +#ifdef HAVE_LIBREADLINE +# include <readline/readline.h> +# include <readline/history.h> +#endif /* HAVE_LIBREADLINE */ #ifdef SYS_VXWORKS /* vxWorks needs mode flag -casey*/ @@ -484,7 +488,7 @@ sendpkt( int 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; } @@ -914,6 +918,16 @@ doquery( static void getcmds(void) { +#ifdef HAVE_LIBREADLINE + char *line; + + for (;;) { + if ((line = readline(interactive?prompt:"")) == NULL) return; + if (*line) add_history(line); + docmd(line); + free(line); + } +#else /* not HAVE_LIBREADLINE */ char line[MAXLINE]; for (;;) { @@ -930,6 +944,7 @@ getcmds(void) docmd(line); } +#endif /* not HAVE_LIBREADLINE */ } @@ -1283,9 +1298,9 @@ help( cmdsort[n++] = xcp->keyword; #ifdef QSORT_USES_VOID_P - qsort(cmdsort, 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; @@ -1528,6 +1543,7 @@ passwd( if (!interactive) { authusekey(info_auth_keyid, info_auth_keytype, (u_char *)pcmd->argval[0].string); + authtrust(info_auth_keyid, 1); } else { pass = getpass((info_auth_keytype == KEY_TYPE_DES) ? "DES Password: " @@ -1535,9 +1551,11 @@ passwd( ); if (*pass == '\0') (void) fprintf(fp, "Password unchanged\n"); - else + else { authusekey(info_auth_keyid, info_auth_keytype, (u_char *)pass); + authtrust(info_auth_keyid, 1); + } } } diff --git a/contrib/ntp/ntpdc/ntpdc_ops.c b/contrib/ntp/ntpdc/ntpdc_ops.c index c4b13e6..0661d53 100644 --- a/contrib/ntp/ntpdc/ntpdc_ops.c +++ b/contrib/ntp/ntpdc/ntpdc_ops.c @@ -7,9 +7,13 @@ #endif #include <stdio.h> + +#include "ntpdc.h" +#include "ntp_control.h" +#include "ntp_refclock.h" +#include "ntp_stdlib.h" + #include <ctype.h> -#include <sys/types.h> -#include <sys/time.h> #ifdef HAVE_SYS_TIMEX_H # include <sys/timex.h> #endif @@ -18,11 +22,6 @@ #include <netinet/in.h> #endif -#include "ntpdc.h" -#include "ntp_control.h" -#include "ntp_refclock.h" -#include "ntp_stdlib.h" - #include <arpa/inet.h> /* @@ -143,12 +142,12 @@ struct xcmd opcmds[] = { "display the server's restrict list" }, { "restrict", new_restrict, { ADD, ADD, NTP_STR, OPT|NTP_STR }, { "address", "mask", - "ntpport|ignore|noserve|notrust|noquery|nomodify|nopeer", + "ntpport|ignore|noserve|notrust|noquery|nomodify|nopeer|version|kod", "..." }, "create restrict entry/add flags to entry" }, { "unrestrict", unrestrict, { ADD, ADD, NTP_STR, OPT|NTP_STR }, { "address", "mask", - "ntpport|ignore|noserve|notrust|noquery|nomodify|nopeer", + "ntpport|ignore|noserve|notrust|noquery|nomodify|nopeer|version|kod", "..." }, "remove flags from a restrict entry" }, { "delrestrict", delrestrict, { ADD, ADD, OPT|NTP_STR, NO }, @@ -470,8 +469,8 @@ printpeer( pp->ppoll, pp->hpoll, (u_long)pp->keyid, pp->version, ntohs(pp->associd)); (void) fprintf(fp, - "valid %d, reach %03o, unreach %d, flash 0x%04x, ", - pp->valid, pp->reach, pp->unreach, pp->flash2); + "reach %03o, unreach %d, flash 0x%04x, ", + pp->reach, pp->unreach, pp->flash2); (void) fprintf(fp, "boffset %s, ttl/mode %d\n", fptoa(NTOHS_FP(pp->estbdelay), 5), pp->ttl); @@ -863,7 +862,7 @@ sysstats( (u_long)ntohl(ss->newversionpkt)); (void) fprintf(fp, "unknown version number: %ld\n", (u_long)ntohl(ss->unknownversion)); - (void) fprintf(fp, "bad packet length: %ld\n", + (void) fprintf(fp, "bad packet format: %ld\n", (u_long)ntohl(ss->badlength)); (void) fprintf(fp, "packets processed: %ld\n", (u_long)ntohl(ss->processed)); @@ -872,7 +871,7 @@ sysstats( if (itemsize != sizeof(struct info_sys_stats)) return; - (void) fprintf(fp, "limitation rejects: %ld\n", + (void) fprintf(fp, "packets rejected: %ld\n", (u_long)ntohl(ss->limitrejected)); } @@ -1257,8 +1256,8 @@ doset( sys.flags = 0; res = 0; for (items = 0; items < pcmd->nargs; items++) { - if (STREQ(pcmd->argval[items].string, "auth")) - sys.flags |= SYS_FLAG_AUTHENTICATE; + if (STREQ(pcmd->argval[items].string, "pps")) + sys.flags |= SYS_FLAG_PPS; else if (STREQ(pcmd->argval[items].string, "bclient")) sys.flags |= SYS_FLAG_BCLIENT; else if (STREQ(pcmd->argval[items].string, "monitor")) @@ -1306,6 +1305,9 @@ static struct resflags resflags[] = { { "notrap", RES_NOTRAP }, { "lptrap", RES_LPTRAP }, { "limited", RES_LIMITED }, + { "version", RES_VERSION }, + { "kod", RES_DEMOBILIZE }, + { "", 0 } }; |