aboutsummaryrefslogtreecommitdiff
path: root/sntp
diff options
context:
space:
mode:
Diffstat (limited to 'sntp')
-rw-r--r--sntp/COPYRIGHT40
-rw-r--r--sntp/Makefile.am13
-rw-r--r--sntp/Makefile.in9
-rw-r--r--sntp/config.h.in3
-rwxr-xr-xsntp/configure370
-rw-r--r--sntp/configure.ac13
-rw-r--r--sntp/crypto.c4
-rw-r--r--sntp/include/Makefile.in1
-rw-r--r--sntp/include/copyright.def4
-rw-r--r--sntp/include/ntp.lic2
-rw-r--r--sntp/include/version.def2
-rw-r--r--sntp/include/version.texi6
-rw-r--r--sntp/invoke-sntp.texi8
-rw-r--r--sntp/libevent/Makefile.in2
-rw-r--r--sntp/libopts/Makefile.in1
-rw-r--r--sntp/libopts/autoopts.h4
-rw-r--r--sntp/libopts/autoopts/options.h10
-rw-r--r--sntp/libopts/configfile.c12
-rw-r--r--sntp/libopts/enum.c8
-rw-r--r--sntp/libopts/file.c4
-rw-r--r--sntp/libopts/find.c4
-rw-r--r--sntp/libopts/init.c13
-rw-r--r--sntp/libopts/load.c2
-rw-r--r--sntp/libopts/makeshell.c16
-rw-r--r--sntp/libopts/nested.c14
-rw-r--r--sntp/libopts/numeric.c2
-rw-r--r--sntp/libopts/parse-duration.c4
-rw-r--r--sntp/libopts/pgusage.c2
-rw-r--r--sntp/libopts/reset.c2
-rw-r--r--sntp/libopts/save.c20
-rw-r--r--sntp/libopts/tokenize.c2
-rw-r--r--sntp/libopts/usage.c4
-rw-r--r--sntp/loc/netbsd2
-rw-r--r--sntp/m4/hms_search_lib.m44
-rw-r--r--sntp/m4/ntp_compiler.m41
-rw-r--r--sntp/m4/ntp_libevent.m425
-rw-r--r--sntp/m4/ntp_libntp.m46
-rw-r--r--sntp/m4/version.m42
-rw-r--r--sntp/main.c13
-rw-r--r--sntp/networking.c23
-rw-r--r--sntp/scripts/Makefile.in1
-rwxr-xr-xsntp/scripts/cvo.sh8
-rw-r--r--sntp/sntp-opts.c344
-rw-r--r--sntp/sntp-opts.def23
-rw-r--r--sntp/sntp-opts.h10
-rw-r--r--sntp/sntp.1sntpman32
-rw-r--r--sntp/sntp.1sntpmdoc29
-rw-r--r--sntp/sntp.html8
-rw-r--r--sntp/sntp.man.in32
-rw-r--r--sntp/sntp.mdoc.in29
-rw-r--r--sntp/tests/Makefile.in1
51 files changed, 765 insertions, 429 deletions
diff --git a/sntp/COPYRIGHT b/sntp/COPYRIGHT
index 1775a64784a5..9c1a0f839358 100644
--- a/sntp/COPYRIGHT
+++ b/sntp/COPYRIGHT
@@ -4,16 +4,16 @@ This file is automatically generated from html/copyright.html
jpg "Clone me," says Dolly sheepishly.
- Last update: 9-Aug-2014 07:56 UTC
+ Last update: 17-Jan-2015 00:16 UTC
_________________________________________________________________
The following copyright notice applies to all files collectively
called the Network Time Protocol Version 4 Distribution. Unless
- specifically declared otherwise in an individual file, this notice
- applies as if the text was explicitly included in the file.
+ specifically declared otherwise in an individual file, this entire
+ notice applies as if the text was explicitly included in the file.
***********************************************************************
* *
-* Copyright (c) University of Delaware 1992-2014 *
+* Copyright (c) University of Delaware 1992-2015 *
* *
* Permission to use, copy, modify, and distribute this software and *
* its documentation for any purpose with or without fee is hereby *
@@ -29,6 +29,38 @@ This file is automatically generated from html/copyright.html
* *
***********************************************************************
+ Content starting in 2011 from Harlan Stenn, Danny Mayer, and Martin
+ Burnicki is:
+***********************************************************************
+* *
+* Copyright (c) Network Time Foundation 2011-2015 *
+* *
+* All Rights Reserved *
+* *
+* Redistribution and use in source and binary forms, with or without *
+* modification, are permitted provided that the following conditions *
+* are met: *
+* 1. Redistributions of source code must retain the above copyright *
+* notice, this list of conditions and the following disclaimer. *
+* 2. Redistributions in binary form must reproduce the above *
+* copyright notice, this list of conditions and the following *
+* disclaimer in the documentation and/or other materials provided *
+* with the distribution. *
+* *
+* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS *
+* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
+* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE *
+* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE *
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *
+* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
+* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
+* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *
+* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
+* DAMAGE. *
+***********************************************************************
+
The following individuals contributed in part to the Network Time
Protocol Distribution Version 4 and are acknowledged as authors of
this work.
diff --git a/sntp/Makefile.am b/sntp/Makefile.am
index 81a137a3348a..8694ed3e75ca 100644
--- a/sntp/Makefile.am
+++ b/sntp/Makefile.am
@@ -56,21 +56,22 @@ sbin_PROGRAMS = @SNTP_DS@
SUBDIRS = include scripts
DIST_SUBDIRS = include scripts
-if BUILD_SNTP
-noinst_LIBRARIES = libsntp.a
if BUILD_LIBEVENT
SUBDIRS += libevent
DIST_SUBDIRS += libevent
endif
-if GTEST_AVAILABLE
-SUBDIRS += tests
-endif
-endif
if NEED_LIBOPTS
SUBDIRS += libopts
endif
+if BUILD_SNTP
+noinst_LIBRARIES = libsntp.a
+if GTEST_AVAILABLE
+SUBDIRS += tests
+endif
+endif
+
DIST_SUBDIRS += libopts tests
libsntp_a_SOURCES = \
diff --git a/sntp/Makefile.in b/sntp/Makefile.in
index c03abeef7ed7..f58700593da3 100644
--- a/sntp/Makefile.in
+++ b/sntp/Makefile.in
@@ -42,10 +42,10 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
EXTRA_PROGRAMS = sntp$(EXEEXT)
-@BUILD_LIBEVENT_TRUE@@BUILD_SNTP_TRUE@am__append_1 = libevent
-@BUILD_LIBEVENT_TRUE@@BUILD_SNTP_TRUE@am__append_2 = libevent
-@BUILD_SNTP_TRUE@@GTEST_AVAILABLE_TRUE@am__append_3 = tests
-@NEED_LIBOPTS_TRUE@am__append_4 = libopts
+@BUILD_LIBEVENT_TRUE@am__append_1 = libevent
+@BUILD_LIBEVENT_TRUE@am__append_2 = libevent
+@NEED_LIBOPTS_TRUE@am__append_3 = libopts
+@BUILD_SNTP_TRUE@@GTEST_AVAILABLE_TRUE@am__append_4 = tests
DIST_COMMON = $(am__configure_deps) $(noinst_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/config.h.in $(top_srcdir)/bincheck.mf \
@@ -278,6 +278,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDADD_LIBEVENT = @LDADD_LIBEVENT@
LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
LDADD_NTP = @LDADD_NTP@
LDFLAGS = @LDFLAGS@
LDFLAGS_NTP = @LDFLAGS_NTP@
diff --git a/sntp/config.h.in b/sntp/config.h.in
index 122fee502b3e..64279b9fa9f6 100644
--- a/sntp/config.h.in
+++ b/sntp/config.h.in
@@ -835,6 +835,9 @@ typedef unsigned int uintptr_t;
/* What type to use for setsockopt */
#undef TYPEOF_IP_MULTICAST_LOOP
+/* OK to use snprintb()? */
+#undef USE_SNPRINTB
+
/* Can we use SIGPOLL for tty IO? */
#undef USE_TTY_SIGPOLL
diff --git a/sntp/configure b/sntp/configure
index 0592f2245863..b4c66f743b5e 100755
--- a/sntp/configure
+++ b/sntp/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for sntp 4.2.8.
+# Generated by GNU Autoconf 2.68 for sntp 4.2.8p1.
#
# Report bugs to <http://bugs.ntp.org./>.
#
@@ -570,8 +570,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='sntp'
PACKAGE_TARNAME='sntp'
-PACKAGE_VERSION='4.2.8'
-PACKAGE_STRING='sntp 4.2.8'
+PACKAGE_VERSION='4.2.8p1'
+PACKAGE_STRING='sntp 4.2.8p1'
PACKAGE_BUGREPORT='http://bugs.ntp.org./'
PACKAGE_URL='http://www.ntp.org./'
@@ -676,6 +676,7 @@ PTHREADS_TRUE
LIBISC_PTHREADS_NOTHREADS
PTHREAD_LIBS
HAVE_INLINE
+LDADD_LIBUTIL
ALLOCA
LIBM
EDITLINE_LIBS
@@ -1456,7 +1457,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures sntp 4.2.8 to adapt to many kinds of systems.
+\`configure' configures sntp 4.2.8p1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1526,7 +1527,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of sntp 4.2.8:";;
+ short | recursive ) echo "Configuration of sntp 4.2.8p1:";;
esac
cat <<\_ACEOF
@@ -1669,7 +1670,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-sntp configure 4.2.8
+sntp configure 4.2.8p1
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2494,7 +2495,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by sntp $as_me 4.2.8, which was
+It was created by sntp $as_me 4.2.8p1, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -3437,7 +3438,7 @@ fi
# Define the identity of the package.
PACKAGE='sntp'
- VERSION='4.2.8'
+ VERSION='4.2.8p1'
cat >>confdefs.h <<_ACEOF
@@ -5220,6 +5221,183 @@ if test "x$ac_cv_prog_cc_c89" != xno; then :
fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if ${ac_cv_prog_cc_c99+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros. These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+ int x = 1234;
+ int y = 5678;
+ debug ("Flag");
+ debug ("X = %d\n", x);
+ showlist (The first, second, and third items.);
+ report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+ your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+ your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+ int datasize;
+ double data[];
+};
+
+struct named_init {
+ int number;
+ const wchar_t *name;
+ double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+ // See if C++-style comments work.
+ // Iterate through items via the restricted pointer.
+ // Also check for declarations in for loops.
+ for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+ continue;
+ return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ va_list args_copy;
+ va_copy (args_copy, args);
+
+ const char *str;
+ int number;
+ float fnumber;
+
+ while (*format)
+ {
+ switch (*format++)
+ {
+ case 's': // string
+ str = va_arg (args_copy, const char *);
+ break;
+ case 'd': // int
+ number = va_arg (args_copy, int);
+ break;
+ case 'f': // float
+ fnumber = va_arg (args_copy, double);
+ break;
+ default:
+ break;
+ }
+ }
+ va_end (args_copy);
+ va_end (args);
+}
+
+int
+main ()
+{
+
+ // Check bool.
+ _Bool success = false;
+
+ // Check restrict.
+ if (test_restrict ("String literal") == 0)
+ success = true;
+ char *restrict newvar = "Another string";
+
+ // Check varargs.
+ test_varargs ("s, d' f .", "string", 65, 34.234);
+ test_varargs_macros ();
+
+ // Check flexible array members.
+ struct incomplete_array *ia =
+ malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+ ia->datasize = 10;
+ for (int i = 0; i < ia->datasize; ++i)
+ ia->data[i] = i * 1.234;
+
+ // Check named initializers.
+ struct named_init ni = {
+ .number = 34,
+ .name = L"Test wide string",
+ .average = 543.34343,
+ };
+
+ ni.number = 58;
+
+ int dynamic_array[ni.number];
+ dynamic_array[ni.number - 1] = 543;
+
+ // work around unused variable warnings
+ return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+ || dynamic_array[ni.number - 1] != 543);
+
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c99"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+
+fi
+
+
@@ -5953,6 +6131,7 @@ fi
+
CFLAGS_NTP=
CPPFLAGS_NTP=
LDADD_NTP=
@@ -8916,6 +9095,73 @@ fi
done
+# Bug 2713
+LDADD_LIBUTIL=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing snprintb" >&5
+$as_echo_n "checking for library containing snprintb... " >&6; }
+if ${ac_cv_search_snprintb+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char snprintb ();
+int
+main ()
+{
+return snprintb ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' util; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_snprintb=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_snprintb+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_snprintb+:} false; then :
+
+else
+ ac_cv_search_snprintb=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_snprintb" >&5
+$as_echo "$ac_cv_search_snprintb" >&6; }
+ac_res=$ac_cv_search_snprintb
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ case "$ac_cv_search_snprintb" in
+ 'none required') ;;
+ no) ;;
+ *) LDADD_LIBUTIL="$ac_cv_search_snprintb $LDADD_LIBUTIL" ;;
+ esac
+
+$as_echo "#define USE_SNPRINTB 1" >>confdefs.h
+
+fi
+
+
#
for ac_header in errno.h sys/socket.h sys/types.h time.h
do :
@@ -24350,6 +24596,13 @@ $as_echo "#define NO_OPTIONAL_OPT_ARGS 1" >>confdefs.h
# end of AC_DEFUN of LIBOPTS_CHECK
+# From when we only used libevent for sntp:
+#AM_COND_IF(
+# [BUILD_SNTP],
+# [NTP_LIBEVENT_CHECK],
+# [NTP_LIBEVENT_CHECK_NOBUILD]
+#)
+
ntp_pkgconfig_min_version='0.15.0'
@@ -24485,13 +24738,11 @@ fi
- if test -z "$BUILD_SNTP_TRUE"; then :
-
-ntp_libevent_min_version=2.0.9
+ntp_libevent_min_version=2
ntp_libevent_tearoff=libevent
@@ -24601,95 +24852,6 @@ esac
- else
-
-
-ntp_libevent_min_version=2.0.9
-ntp_libevent_tearoff=libevent
-
-
-
-
-case "$ntp_use_local_libevent" in
- yes)
- ;;
- *) # If we have (a good enough) pkg-config, see if it can find libevent
- case "$PKG_CONFIG" in
- /*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libevent $ntp_libevent_min_version or later is installed" >&5
-$as_echo_n "checking if libevent $ntp_libevent_min_version or later is installed... " >&6; }
- if $PKG_CONFIG --atleast-version=$ntp_libevent_min_version libevent
- then
- ntp_use_local_libevent=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: Using the installed libevent" >&5
-$as_echo "$as_me: Using the installed libevent" >&6;}
- CPPFLAGS_LIBEVENT=`$PKG_CONFIG --cflags-only-I libevent`
- # HMS: I hope the following is accurate.
- # We don't need -levent, we only need -levent_core.
- # While we could grab only the -L stuff, there *might* be
- # other flags there we want. Originally we just removed -levent
- # but then somebody decided to install -levent-2.0
- # LDADD_LIBEVENT=`$PKG_CONFIG --libs libevent | sed 's:-levent::'`
- # So now we dance...
- LDADD_LIBEVENT=
- for i in `$PKG_CONFIG --libs libevent`
- do
- case "$i" in
- -levent*) ;;
- *) case "$LDADD_LIBEVENT" in
- '') LDADD_LIBEVENT="$i" ;;
- *) LDADD_LIBEVENT="$LDADD_LIBEVENT $i" ;;
- esac
- ;;
- esac
- done
- case "$LIBISC_PTHREADS_NOTHREADS" in
- pthreads)
- LDADD_LIBEVENT="$LDADD_LIBEVENT -levent_pthreads"
- esac
- LDADD_LIBEVENT="$LDADD_LIBEVENT -levent_core"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- else
- ntp_use_local_libevent=yes
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
- ;;
- *)
- ntp_use_local_libevent=yes
- ;;
- esac
- ;;
-esac
-
-case "$ntp_use_local_libevent" in
- yes)
- { $as_echo "$as_me:${as_lineno-$LINENO}: Using libevent tearoff" >&5
-$as_echo "$as_me: Using libevent tearoff" >&6;}
- CPPFLAGS_LIBEVENT="-I\$(top_builddir)/$ntp_libevent_tearoff/include -I\$(top_srcdir)/$ntp_libevent_tearoff/include"
- case "$LIBISC_PTHREADS_NOTHREADS" in
- pthreads)
- LDADD_LIBEVENT="\$(top_builddir)/$ntp_libevent_tearoff/libevent_pthreads.la \$(top_builddir)/$ntp_libevent_tearoff/libevent_core.la"
- ;;
- *)
- LDADD_LIBEVENT="\$(top_builddir)/$ntp_libevent_tearoff/libevent_core.la"
- esac
-esac
-
- if test "x$ntp_use_local_libevent" = "xyes"; then
- BUILD_LIBEVENT_TRUE=
- BUILD_LIBEVENT_FALSE='#'
-else
- BUILD_LIBEVENT_TRUE='#'
- BUILD_LIBEVENT_FALSE=
-fi
-
-
-
-
- fi
-
# Checks for libraries.
@@ -30051,10 +30213,6 @@ if test -z "${BUILD_LIBEVENT_TRUE}" && test -z "${BUILD_LIBEVENT_FALSE}"; then
as_fn_error $? "conditional \"BUILD_LIBEVENT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${BUILD_LIBEVENT_TRUE}" && test -z "${BUILD_LIBEVENT_FALSE}"; then
- as_fn_error $? "conditional \"BUILD_LIBEVENT\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -30472,7 +30630,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by sntp $as_me 4.2.8, which was
+This file was extended by sntp $as_me 4.2.8p1, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -30539,7 +30697,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-sntp config.status 4.2.8
+sntp config.status 4.2.8p1
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
diff --git a/sntp/configure.ac b/sntp/configure.ac
index e10346849697..172c6b1a1f7d 100644
--- a/sntp/configure.ac
+++ b/sntp/configure.ac
@@ -97,11 +97,14 @@ esac
enable_nls=no
LIBOPTS_CHECK
-AM_COND_IF(
- [BUILD_SNTP],
- [NTP_LIBEVENT_CHECK],
- [NTP_LIBEVENT_CHECK_NOBUILD]
-)
+# From when we only used libevent for sntp:
+#AM_COND_IF(
+# [BUILD_SNTP],
+# [NTP_LIBEVENT_CHECK],
+# [NTP_LIBEVENT_CHECK_NOBUILD]
+#)
+
+NTP_LIBEVENT_CHECK([2])
# Checks for libraries.
diff --git a/sntp/crypto.c b/sntp/crypto.c
index aa8d91dd222a..b178f8c2e157 100644
--- a/sntp/crypto.c
+++ b/sntp/crypto.c
@@ -3,7 +3,7 @@
#include <ctype.h>
struct key *key_ptr;
-int key_cnt = 0;
+size_t key_cnt = 0;
int
make_mac(
@@ -51,7 +51,7 @@ auth_md5(
int authentic;
char digest[20];
- if (mac_size > sizeof(digest))
+ if (mac_size > (int)sizeof(digest))
return 0;
hash_len = make_mac(pkt_data, pkt_size, sizeof(digest), cmp_key,
digest);
diff --git a/sntp/include/Makefile.in b/sntp/include/Makefile.in
index dd0a84be5e80..9f5c92a83a76 100644
--- a/sntp/include/Makefile.in
+++ b/sntp/include/Makefile.in
@@ -133,6 +133,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDADD_LIBEVENT = @LDADD_LIBEVENT@
LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
LDADD_NTP = @LDADD_NTP@
LDFLAGS = @LDFLAGS@
LDFLAGS_NTP = @LDFLAGS_NTP@
diff --git a/sntp/include/copyright.def b/sntp/include/copyright.def
index 317ff6d85987..1cc7ad270886 100644
--- a/sntp/include/copyright.def
+++ b/sntp/include/copyright.def
@@ -1,8 +1,8 @@
/* -*- Mode: Text -*- */
copyright = {
- date = "1970-2014";
- owner = "The University of Delaware";
+ date = "1992-2015";
+ owner = "The University of Delaware and Network Time Foundation";
eaddr = "http://bugs.ntp.org, bugs@ntp.org";
type = ntp;
};
diff --git a/sntp/include/ntp.lic b/sntp/include/ntp.lic
index 0e42503a4912..69af392e1bfc 100644
--- a/sntp/include/ntp.lic
+++ b/sntp/include/ntp.lic
@@ -9,7 +9,7 @@
<PFX>documentation for any purpose with or without fee is hereby granted,
<PFX>provided that the above copyright notice appears in all copies and that
<PFX>both the copyright notice and this permission notice appear in
-<PFX>supporting documentation, and that the name <owner> not be used in
+<PFX>supporting documentation, and that the name The University of Delaware not be used in
<PFX>advertising or publicity pertaining to distribution of the software
<PFX>without specific, written prior permission. <owner> makes no
<PFX>representations about the suitability this software for any purpose. It
diff --git a/sntp/include/version.def b/sntp/include/version.def
index b0f0d07a4ffe..47e57c8c3bbc 100644
--- a/sntp/include/version.def
+++ b/sntp/include/version.def
@@ -1 +1 @@
-version = '4.2.8';
+version = '4.2.8p1';
diff --git a/sntp/include/version.texi b/sntp/include/version.texi
index a43551d2cd01..bc3cc0638b96 100644
--- a/sntp/include/version.texi
+++ b/sntp/include/version.texi
@@ -1,3 +1,3 @@
-@set UPDATED 19 December 2014
-@set EDITION 4.2.8
-@set VERSION 4.2.8
+@set UPDATED 04 February 2015
+@set EDITION 4.2.8p1
+@set VERSION 4.2.8p1
diff --git a/sntp/invoke-sntp.texi b/sntp/invoke-sntp.texi
index 68bfc3827b33..e9be80c17f15 100644
--- a/sntp/invoke-sntp.texi
+++ b/sntp/invoke-sntp.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-sntp.texi)
#
-# It has been AutoGen-ed December 19, 2014 at 07:51:36 AM by AutoGen 5.18.5pre4
+# It has been AutoGen-ed February 4, 2015 at 02:34:17 AM by AutoGen 5.18.5pre4
# From the definitions sntp-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -100,7 +100,7 @@ with a status code of 0.
@exampleindent 0
@example
-sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8
+sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p1
Usage: sntp [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
[ hostname-or-IP ...]
Flg Arg Option-Name Description
@@ -282,7 +282,9 @@ This is the ``adjustments less than @var{steplimit} msec will be slewed'' option
This option takes a number argument.
If the time adjustment is less than @file{steplimit} milliseconds,
slew the amount using @command{adjtime(2)}. Otherwise, step the
-correction using @command{settimeofday(2)}.
+correction using @command{settimeofday(2)}. The default value is 0,
+which means all adjustments will be stepped. This is a feature, as
+different situations demand different values.
@node sntp ntpversion
@subsection ntpversion option (-o)
@cindex sntp-ntpversion
diff --git a/sntp/libevent/Makefile.in b/sntp/libevent/Makefile.in
index 57b43eb7c725..463ae8cb82d8 100644
--- a/sntp/libevent/Makefile.in
+++ b/sntp/libevent/Makefile.in
@@ -79,7 +79,7 @@ DIST_COMMON = README $(am__configure_deps) \
$(srcdir)/test/include.am $(top_srcdir)/configure ChangeLog \
build-aux/compile build-aux/config.guess build-aux/config.sub \
build-aux/depcomp build-aux/install-sh build-aux/ltmain.sh \
- build-aux/missing epoll_sub.c
+ build-aux/missing build-aux/ylwrap epoll_sub.c
@INSTALL_LIBEVENT_FALSE@am__append_5 = $(EVENT2_EXPORT)
@OPENSSL_TRUE@am__append_6 = sample/le-proxy sample/https-client
@OPENSSL_TRUE@am__append_7 = \
diff --git a/sntp/libopts/Makefile.in b/sntp/libopts/Makefile.in
index 111bc0f3a7fd..3b107c7a73e3 100644
--- a/sntp/libopts/Makefile.in
+++ b/sntp/libopts/Makefile.in
@@ -187,6 +187,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDADD_LIBEVENT = @LDADD_LIBEVENT@
LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
LDADD_NTP = @LDADD_NTP@
LDFLAGS = @LDFLAGS@
LDFLAGS_NTP = @LDFLAGS_NTP@
diff --git a/sntp/libopts/autoopts.h b/sntp/libopts/autoopts.h
index ac0a199bfd1e..6987958cd111 100644
--- a/sntp/libopts/autoopts.h
+++ b/sntp/libopts/autoopts.h
@@ -258,7 +258,7 @@ typedef struct {
#define AGALOC(c, w) ao_malloc((size_t)c)
#define AGREALOC(p, c, w) ao_realloc((void*)p, (size_t)c)
-#define AGFREE(_p) free((void *)_p)
+#define AGFREE(p) free((void *)(intptr_t)p)
#define AGDUPSTR(p, s, w) (p = ao_strdup(s))
static void *
@@ -452,7 +452,7 @@ typedef enum { AOFLAG_TABLE } ao_flags_t;
#undef _aof_
static char const zNil[] = "";
-static arg_types_t argTypes = { NULL };
+static arg_types_t argTypes = { 0 };
static char line_fmt_buf[32];
static bool displayEnum = false;
static char const pkgdatadir_default[] = PKGDATADIR;
diff --git a/sntp/libopts/autoopts/options.h b/sntp/libopts/autoopts/options.h
index 0d6f2c371d18..32397eb9a081 100644
--- a/sntp/libopts/autoopts/options.h
+++ b/sntp/libopts/autoopts/options.h
@@ -600,9 +600,17 @@ struct options {
char * pzCurOpt; ///< current option text
/// Public, the full path of the program
+#if AUTOOPTS_INTERNAL
+ char const * pzProgPath;
+#else
char const * const pzProgPath;
+#endif
/// Public, the name of the executable, without any path
+#if AUTOOPTS_INTERNAL
+ char const * pzProgName;
+#else
char const * const pzProgName;
+#endif
/// Public, the upper-cased, shell variable syntax-ed program name
char const * const pzPROGNAME;
/// the name of the "rc file" (configuration file)
@@ -1222,7 +1230,7 @@ extern void optionResetOpt(tOptions*, tOptDesc*);
extern void optionSetMembers(tOptions*, tOptDesc*, char const * const *, unsigned int);
-extern void optionShowRange(tOptions*, tOptDesc*, void *, int);
+extern void optionShowRange(tOptions*, tOptDesc*, const void *, int);
extern void optionStackArg(tOptions*, tOptDesc*);
diff --git a/sntp/libopts/configfile.c b/sntp/libopts/configfile.c
index d4bc4fea2870..040944635658 100644
--- a/sntp/libopts/configfile.c
+++ b/sntp/libopts/configfile.c
@@ -184,7 +184,7 @@ optionFindValue(const tOptDesc * odesc, char const * name, char const * val)
else do {
tArgList* argl = odesc->optCookie;
int argct = argl->useCt;
- void ** poptv = (void**)(argl->apzArgs);
+ void ** poptv = (void**)(intptr_t)(argl->apzArgs);
if (argct == 0) {
errno = ENOENT;
@@ -266,7 +266,7 @@ optionFindNextValue(const tOptDesc * odesc, const tOptionValue * pPrevVal,
else do {
tArgList* argl = odesc->optCookie;
int ct = argl->useCt;
- void** poptv = (void**)argl->apzArgs;
+ void** poptv = (void**)(intptr_t)argl->apzArgs;
while (--ct >= 0) {
tOptionValue* pOV = *(poptv++);
@@ -326,7 +326,7 @@ optionGetValue(tOptionValue const * oov, char const * vname)
if (arg_list->useCt > 0) {
int ct = arg_list->useCt;
- void ** ovlist = (void**)(arg_list->apzArgs);
+ void ** ovlist = (void**)(intptr_t)(arg_list->apzArgs);
if (vname == NULL) {
res = (tOptionValue*)*ovlist;
@@ -385,7 +385,7 @@ optionNextValue(tOptionValue const * ov_list,tOptionValue const * oov )
arg_list = ov_list->v.nestVal;
{
int ct = arg_list->useCt;
- void ** o_list = (void**)(arg_list->apzArgs);
+ void ** o_list = (void**)(intptr_t)(arg_list->apzArgs);
while (ct-- > 0) {
tOptionValue * nov = *(o_list++);
@@ -931,7 +931,7 @@ handle_struct(tOptions * opts, tOptState * ost, char * txt, int dir)
switch (*txt) {
case ' ':
case '\t':
- txt = (void *)parse_attrs(
+ txt = (void *)(intptr_t)parse_attrs(
opts, SPN_WHITESPACE_CHARS(txt), &mode, &valu);
if (txt == NULL)
return txt;
@@ -1138,7 +1138,7 @@ optionFileLoad(tOptions * opts, char const * prog)
*/
{
char const ** pp =
- (char const **)(void *)&(opts->pzProgName);
+ (char const **)(void *)(intptr_t)&(opts->pzProgName);
*pp = prog;
}
diff --git a/sntp/libopts/enum.c b/sntp/libopts/enum.c
index 299ffb12e1e4..e759e8c0a5f0 100644
--- a/sntp/libopts/enum.c
+++ b/sntp/libopts/enum.c
@@ -189,11 +189,11 @@ find_name(char const * name, tOptions * pOpts, tOptDesc * pOD,
* The result gets stashed in a char* pointer.
*/
uintptr_t res = name_ct;
- size_t len = strlen((char*)name);
+ size_t len = strlen((const char*)name);
uintptr_t idx;
if (IS_DEC_DIGIT_CHAR(*name)) {
- char * pz = (char *)(void *)name;
+ char * pz = (char *)(void *)(intptr_t)name;
unsigned long val = strtoul(pz, &pz, 0);
if ((*pz == NUL) && (val < name_ct))
return (uintptr_t)val;
@@ -215,7 +215,7 @@ find_name(char const * name, tOptions * pOpts, tOptDesc * pOD,
* Multiple partial matches means we have an ambiguous match.
*/
for (idx = 0; idx < name_ct; idx++) {
- if (strncmp((char*)paz_names[idx], (char*)name, len) == 0) {
+ if (strncmp((char*)(intptr_t)paz_names[idx], (char*)(intptr_t)name, len) == 0) {
if (paz_names[idx][len] == NUL)
return idx; /* full match */
@@ -521,7 +521,7 @@ optionMemberList(tOptDesc * od)
uintptr_t sv = od->optArg.argIntptr;
char * res;
(*(od->pOptProc))(OPTPROC_RETURN_VALNAME, od);
- res = (void *)od->optArg.argString;
+ res = (void *)(intptr_t)od->optArg.argString;
od->optArg.argIntptr = sv;
return res;
}
diff --git a/sntp/libopts/file.c b/sntp/libopts/file.c
index ec740c5d309d..d5fdb4a98b71 100644
--- a/sntp/libopts/file.c
+++ b/sntp/libopts/file.c
@@ -107,7 +107,7 @@ open_file_fd(tOptions * pOpts, tOptDesc * pOD, tuFileMode mode)
/* NOTREACHED */
if ((pOD->fOptState & OPTST_ALLOC_ARG) != 0)
- pOD->optCookie = (void *)pOD->optArg.argString;
+ pOD->optCookie = (void *)(intptr_t)pOD->optArg.argString;
else
AGDUPSTR(pOD->optCookie, pOD->optArg.argString, "file name");
@@ -131,7 +131,7 @@ fopen_file_fp(tOptions * pOpts, tOptDesc * pOD, tuFileMode mode)
/* NOTREACHED */
if ((pOD->fOptState & OPTST_ALLOC_ARG) != 0)
- pOD->optCookie = (void *)pOD->optArg.argString;
+ pOD->optCookie = (void *)(intptr_t)pOD->optArg.argString;
else
AGDUPSTR(pOD->optCookie, pOD->optArg.argString, "file name");
diff --git a/sntp/libopts/find.c b/sntp/libopts/find.c
index 1ec02e5f6de1..8d4789628cef 100644
--- a/sntp/libopts/find.c
+++ b/sntp/libopts/find.c
@@ -80,7 +80,7 @@ parse_opt(char const ** nm_pp, char ** arg_pp, char * buf, size_t bufsz)
buf[res] = NUL;
*nm_pp = buf;
- *arg_pp = (char *)p;
+ *arg_pp = (char *)(intptr_t)p;
return res;
default:
@@ -711,7 +711,7 @@ find_opt(tOptions * opts, tOptState * o_st)
* strip off the "const" quality of the "default_opt" field.
*/
while (*(++pz) == '-') ;
- def_opt = (void *)&(opts->specOptIdx.default_opt);
+ def_opt = (void *)(intptr_t)&(opts->specOptIdx.default_opt);
def = *def_opt;
*def_opt = NO_EQUIVALENT;
res = opt_find_long(opts, pz, o_st);
diff --git a/sntp/libopts/init.c b/sntp/libopts/init.c
index e038ed74e290..9374528126dc 100644
--- a/sntp/libopts/init.c
+++ b/sntp/libopts/init.c
@@ -101,20 +101,17 @@ validate_struct(tOptions * opts, char const * pname)
*/
if (opts->pzProgName == NULL) {
char const * pz = strrchr(pname, DIRCH);
- char const ** pp =
- (char const **)(void **)&(opts->pzProgName);
if (pz != NULL)
- *pp = pz+1;
+ opts->pzProgName = pz+1;
else
- *pp = pname;
+ opts->pzProgName = pname;
- pz = pathfind(getenv("PATH"), (char *)pname, "rx");
+ pz = pathfind(getenv("PATH"), (char *)(intptr_t)pname, "rx");
if (pz != NULL)
- pname = (void *)pz;
+ pname = (void *)(intptr_t)pz;
- pp = (char const **)(void **)&(opts->pzProgPath);
- *pp = pname;
+ opts->pzProgPath = pname;
/*
* when comparing long names, these are equivalent
diff --git a/sntp/libopts/load.c b/sntp/libopts/load.c
index 5c29d96ecc9a..065449255022 100644
--- a/sntp/libopts/load.c
+++ b/sntp/libopts/load.c
@@ -225,7 +225,7 @@ add_prog_path(char * buf, int b_sz, char const * fname, char const * prg_path)
if (strchr(prg_path, DIRCH) != NULL)
path = prg_path;
else {
- path = pathfind(getenv("PATH"), (char*)prg_path, "rx");
+ path = pathfind(getenv("PATH"), (char*)(intptr_t)prg_path, "rx");
if (path == NULL)
return false;
diff --git a/sntp/libopts/makeshell.c b/sntp/libopts/makeshell.c
index a0bfcacca655..baef8fcb5f79 100644
--- a/sntp/libopts/makeshell.c
+++ b/sntp/libopts/makeshell.c
@@ -396,13 +396,13 @@ emit_usage(tOptions * opts)
/* Copy the program name into the time/name buffer */
for (;;) {
- if ((*pzPN++ = (char)tolower(*pz++)) == NUL)
+ if ((*pzPN++ = (char)tolower((unsigned char)*pz++)) == NUL)
break;
}
- pp = (char **)(void *)&(opts->pzProgPath);
+ pp = (char **)(void *)(intptr_t)&(opts->pzProgPath);
*pp = tm_nm_buf;
- pp = (char **)(void *)&(opts->pzProgName);
+ pp = (char **)(void *)(intptr_t)&(opts->pzProgName);
*pp = tm_nm_buf;
}
@@ -653,7 +653,7 @@ emit_match_expr(char const * name, tOptDesc * cod, tOptions * opts)
* They must not be the same. They cannot be, because it would
* not compile correctly if they were.
*/
- while (toupper(od->pz_Name[match_ct]) == toupper(name[match_ct]))
+ while (toupper((unsigned char)od->pz_Name[match_ct]) == toupper((unsigned char)name[match_ct]))
match_ct++;
if (match_ct > min_match_ct)
@@ -666,8 +666,8 @@ emit_match_expr(char const * name, tOptDesc * cod, tOptions * opts)
continue;
match_ct = 0;
- while ( toupper(od->pz_DisableName[match_ct])
- == toupper(name[match_ct]))
+ while ( toupper((unsigned char)od->pz_DisableName[match_ct])
+ == toupper((unsigned char)name[match_ct]))
match_ct++;
if (match_ct > min_match_ct)
min_match_ct = match_ct;
@@ -901,11 +901,11 @@ genshelloptUsage(tOptions * opts, int exit_cd)
*/
{
char * pz;
- char ** pp = (char **)(void *)&(optionParseShellOptions->pzProgName);
+ char ** pp = (char **)(void *)(intptr_t)&(optionParseShellOptions->pzProgName);
AGDUPSTR(pz, optionParseShellOptions->pzPROGNAME, "prog name");
*pp = pz;
while (*pz != NUL) {
- *pz = (char)tolower(*pz);
+ *pz = (char)tolower((unsigned char)*pz);
pz++;
}
}
diff --git a/sntp/libopts/nested.c b/sntp/libopts/nested.c
index 0ec8f0880661..96e45530fb47 100644
--- a/sntp/libopts/nested.c
+++ b/sntp/libopts/nested.c
@@ -645,7 +645,7 @@ unload_arg_list(tArgList * arg_list)
char const ** pnew_val = arg_list->apzArgs;
while (ct-- > 0) {
- tOptionValue* new_val = (tOptionValue*)(void*)*(pnew_val++);
+ tOptionValue* new_val = (tOptionValue*)(void*)(intptr_t)*(pnew_val++);
if (new_val->valType == OPARG_TYPE_HIERARCHY)
unload_arg_list(new_val->v.nestVal);
AGFREE(new_val);
@@ -675,7 +675,7 @@ optionUnloadNested(tOptionValue const * opt_val)
unload_arg_list(opt_val->v.nestVal);
- AGFREE((void*)opt_val);
+ AGFREE((void*)(intptr_t)opt_val);
}
/**
@@ -694,8 +694,8 @@ sort_list(tArgList * arg_list)
*/
for (ix = 0; ++ix < lm;) {
int iy = ix-1;
- tOptionValue * new_v = C(tOptionValue *, arg_list->apzArgs[ix]);
- tOptionValue * old_v = C(tOptionValue *, arg_list->apzArgs[iy]);
+ tOptionValue * new_v = C(tOptionValue *, (intptr_t)arg_list->apzArgs[ix]);
+ tOptionValue * old_v = C(tOptionValue *, (intptr_t)arg_list->apzArgs[iy]);
/*
* For as long as the new entry precedes the "old" entry,
@@ -704,7 +704,7 @@ sort_list(tArgList * arg_list)
*/
while (strcmp(old_v->pzName, new_v->pzName) > 0) {
arg_list->apzArgs[iy+1] = (void*)old_v;
- old_v = (tOptionValue*)(void*)(arg_list->apzArgs[--iy]);
+ old_v = (tOptionValue*)(void*)(intptr_t)(arg_list->apzArgs[--iy]);
if (iy < 0)
break;
}
@@ -837,7 +837,7 @@ optionNestedVal(tOptions * opts, tOptDesc * od)
av = arg_list->apzArgs;
while (--ct >= 0) {
- void * p = (void *)*(av++);
+ void * p = (void *)(intptr_t)*(av++);
optionUnloadNested((tOptionValue const *)p);
}
@@ -872,7 +872,7 @@ get_special_char(char const ** ppz, int * ct)
base = 16;
pz++;
}
- retch = (int)strtoul(pz, (char **)&pz, base);
+ retch = (int)strtoul(pz, (char **)(intptr_t)&pz, base);
if (*pz != ';')
return '&';
base = (int)(++pz - *ppz);
diff --git a/sntp/libopts/numeric.c b/sntp/libopts/numeric.c
index 9baba65e7ba9..471cb936e1a9 100644
--- a/sntp/libopts/numeric.c
+++ b/sntp/libopts/numeric.c
@@ -42,7 +42,7 @@
* Show information about a numeric option with range constraints.
=*/
void
-optionShowRange(tOptions * pOpts, tOptDesc * pOD, void * rng_table, int rng_ct)
+optionShowRange(tOptions * pOpts, tOptDesc * pOD, const void * rng_table, int rng_ct)
{
const struct {long const rmin, rmax;} * rng = rng_table;
diff --git a/sntp/libopts/parse-duration.c b/sntp/libopts/parse-duration.c
index ff3fe4228f33..2536a06a00f7 100644
--- a/sntp/libopts/parse-duration.c
+++ b/sntp/libopts/parse-duration.c
@@ -60,14 +60,14 @@ typedef enum {
static unsigned long
str_const_to_ul (cch_t * str, cch_t ** ppz, int base)
{
- return strtoul (str, (char **)ppz, base);
+ return strtoul (str, (char **)(intptr_t)ppz, base);
}
/* Wrapper around strtol that does not require a cast. */
static long
str_const_to_l (cch_t * str, cch_t ** ppz, int base)
{
- return strtol (str, (char **)ppz, base);
+ return strtol (str, (char **)(intptr_t)ppz, base);
}
/* Returns BASE + VAL * SCALE, interpreting BASE = BAD_TIME
diff --git a/sntp/libopts/pgusage.c b/sntp/libopts/pgusage.c
index 80a89a713d47..a385b4d999a8 100644
--- a/sntp/libopts/pgusage.c
+++ b/sntp/libopts/pgusage.c
@@ -88,7 +88,7 @@ mk_pager_cmd(char const * fname)
bfsz = strlen(fname) + strlen(pager) + PAGE_USAGE_FMT_LEN;
res = AGALOC(bfsz, "more cmd");
snprintf(res, bfsz, PAGE_USAGE_FMT, pager, fname);
- AGFREE((void*)fname);
+ AGFREE((void*)(intptr_t)fname);
return res;
}
}
diff --git a/sntp/libopts/reset.c b/sntp/libopts/reset.c
index df81cd718a4e..1e959a1e4ce7 100644
--- a/sntp/libopts/reset.c
+++ b/sntp/libopts/reset.c
@@ -113,7 +113,7 @@ optionResetOpt(tOptions * pOpts, tOptDesc * pOD)
assert(0 == 1);
}
} else {
- succ = opt_find_long(pOpts, (char *)pzArg, &opt_state);
+ succ = opt_find_long(pOpts, (char *)(intptr_t)pzArg, &opt_state);
if (! SUCCESSFUL(succ)) {
fprintf(stderr, zIllOptStr, pOpts->pzProgPath, pzArg);
pOpts->pUsageProc(pOpts, EXIT_FAILURE);
diff --git a/sntp/libopts/save.c b/sntp/libopts/save.c
index 19c4c5b8408d..dd51d6055f76 100644
--- a/sntp/libopts/save.c
+++ b/sntp/libopts/save.c
@@ -183,7 +183,7 @@ find_file_name(tOptions * opts, int * p_free_name)
fprintf(stderr, zsave_warn, opts->pzProgName);
fprintf(stderr, zNoStat, errno, strerror(errno), pzDir);
if (free_dir_name)
- AGFREE((void*)pzDir);
+ AGFREE(pzDir);
return NULL;
}
@@ -223,7 +223,7 @@ find_file_name(tOptions * opts, int * p_free_name)
sprintf(pzPath, "%s/%s", pzDir, opts->pzRcName);
#endif
if (free_dir_name)
- AGFREE((void*)pzDir);
+ AGFREE(pzDir);
pzDir = pzPath;
free_dir_name = 1;
}
@@ -237,7 +237,7 @@ find_file_name(tOptions * opts, int * p_free_name)
fprintf(stderr, zsave_warn, opts->pzProgName);
fprintf(stderr, zNoStat, errno, strerror(errno),
pzDir);
- AGFREE((void*)pzDir);
+ AGFREE(pzDir);
return NULL;
}
@@ -255,7 +255,7 @@ find_file_name(tOptions * opts, int * p_free_name)
if (! S_ISREG(stBuf.st_mode)) {
fprintf(stderr, zsave_warn, opts->pzProgName, pzDir);
if (free_dir_name)
- AGFREE((void*)pzDir);
+ AGFREE(pzDir);
return NULL;
}
@@ -377,7 +377,7 @@ prt_value(FILE * fp, int depth, tOptDesc * pOD, tOptionValue const * ovp)
/*
* set membership strings get allocated
*/
- AGFREE((void*)pOD->optArg.argString);
+ AGFREE(pOD->optArg.argString);
}
}
@@ -453,7 +453,7 @@ prt_val_list(FILE * fp, char const * name, tArgList * al)
if (al == NULL)
return;
opt_ct = al->useCt;
- opt_list = (void **)al->apzArgs;
+ opt_list = (void **)(intptr_t)al->apzArgs;
if (opt_ct <= 0) {
fprintf(fp, OPEN_CLOSE_FMT, name);
@@ -488,7 +488,7 @@ prt_nested(FILE * fp, tOptDesc * p)
return;
opt_ct = al->useCt;
- opt_list = (void **)al->apzArgs;
+ opt_list = (void **)(intptr_t)al->apzArgs;
if (opt_ct <= 0)
return;
@@ -534,12 +534,12 @@ open_sv_file(tOptions * opts)
fprintf(stderr, zsave_warn, opts->pzProgName);
fprintf(stderr, zNoCreat, errno, strerror(errno), pzFName);
if (free_name)
- AGFREE((void*) pzFName );
+ AGFREE(pzFName);
return fp;
}
if (free_name)
- AGFREE((void*)pzFName);
+ AGFREE(pzFName);
}
fputs("# ", fp);
@@ -629,7 +629,7 @@ prt_enum_arg(FILE * fp, tOptDesc * od)
* bit flag values back into a string suitable for printing.
*/
(*(od->pOptProc))(OPTPROC_RETURN_VALNAME, od);
- prt_entry(fp, od, (void*)(od->optArg.argString));
+ prt_entry(fp, od, (void*)(intptr_t)(od->optArg.argString));
od->optArg.argEnum = val;
}
diff --git a/sntp/libopts/tokenize.c b/sntp/libopts/tokenize.c
index 34abf836012b..a0db4cb8072a 100644
--- a/sntp/libopts/tokenize.c
+++ b/sntp/libopts/tokenize.c
@@ -57,7 +57,7 @@ copy_cooked(ch_t** ppDest, char const ** ppSrc)
case NUL: *ppSrc = NULL; return;
case '"': goto done;
case '\\':
- pSrc += ao_string_cook_escape_char((char*)pSrc, (char*)&ch, 0x7F);
+ pSrc += ao_string_cook_escape_char((char*)(intptr_t)pSrc, (char*)(intptr_t)&ch, 0x7F);
if (ch == 0x7F)
break;
/* FALLTHROUGH */
diff --git a/sntp/libopts/usage.c b/sntp/libopts/usage.c
index 206235d7afca..bb33b35ac460 100644
--- a/sntp/libopts/usage.c
+++ b/sntp/libopts/usage.c
@@ -435,7 +435,7 @@ print_one_paragraph(char const * text, bool plain, FILE * fp)
else {
char const * t = optionQuoteString(text, LINE_SPLICE);
fprintf(fp, PUTS_FMT, t);
- AGFREE((void *)t);
+ AGFREE(t);
}
}
@@ -546,7 +546,7 @@ optionPrintParagraphs(char const * text, bool plain, FILE * fp)
buf = scan;
}
}
- AGFREE((void *)text);
+ AGFREE(text);
}
/*=export_func optionUsage
diff --git a/sntp/loc/netbsd b/sntp/loc/netbsd
index e84f7899a1c9..fa79340db23e 100644
--- a/sntp/loc/netbsd
+++ b/sntp/loc/netbsd
@@ -11,4 +11,4 @@ ntpsnmpd,sbin,8
ntpsweep,noinst,8
ntptime,sbin,8
ntptrace,sbin,8
-sntp,bin,1
+sntp,sbin,1
diff --git a/sntp/m4/hms_search_lib.m4 b/sntp/m4/hms_search_lib.m4
index e6dd601403b1..d09ea3b74a75 100644
--- a/sntp/m4/hms_search_lib.m4
+++ b/sntp/m4/hms_search_lib.m4
@@ -25,6 +25,6 @@ AC_DEFUN([HMS_SEARCH_LIBS],
no) ;;
*) $1[]="$ac_cv_search_$2[] $[]$1" ;;
esac
- [$4]],
- [$5],
+ $4],
+ $5,
[$6])])
diff --git a/sntp/m4/ntp_compiler.m4 b/sntp/m4/ntp_compiler.m4
index 2b418662b99c..e4c515f27a2e 100644
--- a/sntp/m4/ntp_compiler.m4
+++ b/sntp/m4/ntp_compiler.m4
@@ -2,6 +2,7 @@ dnl ######################################################################
dnl Common m4sh code for compiler stuff
AC_DEFUN([NTP_COMPILER], [
AC_REQUIRE([AC_PROG_CC_C89])
+AC_REQUIRE([AC_PROG_CC_C99])
CFLAGS_NTP=
CPPFLAGS_NTP=
diff --git a/sntp/m4/ntp_libevent.m4 b/sntp/m4/ntp_libevent.m4
index 5f81ae90576c..54174f05a21a 100644
--- a/sntp/m4/ntp_libevent.m4
+++ b/sntp/m4/ntp_libevent.m4
@@ -1,4 +1,25 @@
-dnl NTP_ENABLE_LOCAL_LIBEVENT -*- Autoconf -*-
+# SYNOPSIS -*- Autoconf -*-
+#
+# NTP_ENABLE_LOCAL_LIBEVENT
+# NTP_LIBEVENT_CHECK([MINVERSION [, DIR]])
+# NTP_LIBEVENT_CHECK_NOBUILD([MINVERSION [, DIR]])
+#
+# DESCRIPTION
+#
+# AUTHOR
+#
+# Harlan Stenn
+#
+# LICENSE
+#
+# This file is Copyright (c) 2014 Network Time Foundation
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice,
+# author attribution and this notice are preserved. This file is offered
+# as-is, without any warranty.
+
+dnl NTP_ENABLE_LOCAL_LIBEVENT
dnl
dnl Provide only the --enable-local-libevent command-line option.
dnl
@@ -29,7 +50,7 @@ dnl If NOBUILD is provided as the 3rd argument, do all of the above,
dnl but DO NOT invoke DIR/configure if we are going to use our bundled
dnl version. This may be the case for nested packages.
dnl
-dnl provide --enable-local-libevent .
+dnl provides: --enable-local-libevent
dnl
dnl Examples:
dnl
diff --git a/sntp/m4/ntp_libntp.m4 b/sntp/m4/ntp_libntp.m4
index 13a621d1ceb7..8842c4a81125 100644
--- a/sntp/m4/ntp_libntp.m4
+++ b/sntp/m4/ntp_libntp.m4
@@ -78,6 +78,12 @@ esac
AC_CHECK_FUNCS([getclock stime timegm strlcpy strlcat])
+# Bug 2713
+LDADD_LIBUTIL=
+AC_SUBST([LDADD_LIBUTIL])
+HMS_SEARCH_LIBS([LDADD_LIBUTIL], [snprintb], [util],
+ [AC_DEFINE([USE_SNPRINTB], 1, [OK to use snprintb()?])])
+
dnl HP-UX 11.31 on HPPA has a net/if.h that can't be compiled with gcc4
dnl due to an incomplete type (a union) mpinfou used in an array. gcc3
dnl compiles it without complaint. The mpinfou union is defined later
diff --git a/sntp/m4/version.m4 b/sntp/m4/version.m4
index 602bcab18571..06f967692061 100644
--- a/sntp/m4/version.m4
+++ b/sntp/m4/version.m4
@@ -1 +1 @@
-m4_define([VERSION_NUMBER],[4.2.8])
+m4_define([VERSION_NUMBER],[4.2.8p1])
diff --git a/sntp/main.c b/sntp/main.c
index d60710868f2d..c271c8c457f5 100644
--- a/sntp/main.c
+++ b/sntp/main.c
@@ -659,7 +659,7 @@ xmt(
sockaddr_u * dst = &spkt->addr;
struct timeval tv_xmt;
struct pkt x_pkt;
- int pkt_len;
+ size_t pkt_len;
int sent;
if (0 != gettimeofday(&tv_xmt, NULL)) {
@@ -1248,7 +1248,7 @@ handle_pkt(
if (synch_distance > 0.) {
cnt = snprintf(disptxt, sizeof(disptxt),
" +/- %f", synch_distance);
- if (cnt >= sizeof(disptxt))
+ if ((size_t)cnt >= sizeof(disptxt))
snprintf(disptxt, sizeof(disptxt),
"ERROR %d >= %d", cnt,
(int)sizeof(disptxt));
@@ -1392,7 +1392,7 @@ set_li_vn_mode (
leap = 3;
}
- if (version < 0 || version > 7) {
+ if ((unsigned char)version > 7) {
msyslog(LOG_DEBUG, "set_li_vn_mode: version < 0 or > 7, using 4");
version = 4;
}
@@ -1545,7 +1545,7 @@ gettimeofday_cached(
diff = sub_tval(systemt, latest);
if (debug > 1)
printf("system minus cached %+ld.%06ld\n",
- (long)diff.tv_sec, diff.tv_usec);
+ (long)diff.tv_sec, (long)diff.tv_usec);
if (0 != cgt_rc || labs((long)diff.tv_sec) < 3600) {
/*
* Either use_monotonic == 0, or this libevent
@@ -1557,13 +1557,14 @@ gettimeofday_cached(
diff = sub_tval(latest, mono);
if (debug > 1)
printf("cached minus monotonic %+ld.%06ld\n",
- (long)diff.tv_sec, diff.tv_usec);
+ (long)diff.tv_sec, (long)diff.tv_usec);
if (labs((long)diff.tv_sec) < 3600) {
/* older libevent2 using monotonic */
offset = sub_tval(systemt, mono);
TRACE(1, ("%s: Offsetting libevent CLOCK_MONOTONIC times by %+ld.%06ld\n",
"gettimeofday_cached",
- (long)offset.tv_sec, offset.tv_usec));
+ (long)offset.tv_sec,
+ (long)offset.tv_usec));
}
}
offset_ready = TRUE;
diff --git a/sntp/networking.c b/sntp/networking.c
index 75c2f7140143..bef7352d3a63 100644
--- a/sntp/networking.c
+++ b/sntp/networking.c
@@ -80,7 +80,7 @@ skip_efields(
while ((tail - head) > 6) {
nlen = ntohl(*head++) & 0xffff;
nlen = (nlen + 3) >> 2;
- if (nlen > (tail - head) || nlen < 4)
+ if (nlen > (u_int)(tail - head) || nlen < 4)
return NULL; /* Blooper! Inconsistent! */
head += nlen;
}
@@ -129,8 +129,7 @@ process_pkt (
* extension field is present, so we subtract the length of the
* field and go around again.
*/
- if (pkt_len < LEN_PKT_NOMAC || (pkt_len & 3) != 0) {
-unusable:
+ if (pkt_len < (int)LEN_PKT_NOMAC || (pkt_len & 3) != 0) {
msyslog(LOG_ERR,
"%s: Incredible packet length: %d. Discarding.",
func_name, pkt_len);
@@ -139,8 +138,12 @@ unusable:
/* Note: pkt_len must be a multiple of 4 at this point! */
packet_end = (u_int32*)((char*)rpkt + pkt_len);
exten_end = skip_efields(rpkt->exten, packet_end);
- if (NULL == exten_end)
- goto unusable;
+ if (NULL == exten_end) {
+ msyslog(LOG_ERR,
+ "%s: Missing extension field. Discarding.",
+ func_name);
+ return PACKET_UNUSEABLE;
+ }
/* get size of MAC in cells; can be zero */
exten_len = (u_int)(packet_end - exten_end);
@@ -156,7 +159,10 @@ unusable:
break;
case 3: /* key ID + 3DES MAC -- unsupported! */
- goto unusable;
+ msyslog(LOG_ERR,
+ "%s: Key ID + 3DES MAC is unsupported. Discarding.",
+ func_name);
+ return PACKET_UNUSEABLE;
case 5: /* key ID + MD5 MAC */
case 6: /* key ID + SHA MAC */
@@ -190,7 +196,10 @@ unusable:
break;
default:
- goto unusable;
+ msyslog(LOG_ERR,
+ "%s: Unexpected extension length: %d. Discarding.",
+ func_name, exten_len);
+ return PACKET_UNUSEABLE;
}
switch (is_authentic) {
diff --git a/sntp/scripts/Makefile.in b/sntp/scripts/Makefile.in
index 6dccb2d54519..26c3591bfa33 100644
--- a/sntp/scripts/Makefile.in
+++ b/sntp/scripts/Makefile.in
@@ -130,6 +130,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDADD_LIBEVENT = @LDADD_LIBEVENT@
LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
LDADD_NTP = @LDADD_NTP@
LDFLAGS = @LDFLAGS@
LDFLAGS_NTP = @LDFLAGS_NTP@
diff --git a/sntp/scripts/cvo.sh b/sntp/scripts/cvo.sh
index a8d00ef6cb4f..ecd80922301f 100755
--- a/sntp/scripts/cvo.sh
+++ b/sntp/scripts/cvo.sh
@@ -45,7 +45,13 @@ case "$#" in
set `cat /etc/redhat-release`
case "$1" in
CentOS)
- CVO_OS=centos$3
+ case "$2" in
+ Linux)
+ CVO_OS=centos$4
+ ;;
+ *) CVO_OS=centos$3
+ ;;
+ esac
;;
Fedora)
CVO_OS=fedora$3
diff --git a/sntp/sntp-opts.c b/sntp/sntp-opts.c
index 9e362d1a90f8..a9e36457ad13 100644
--- a/sntp/sntp-opts.c
+++ b/sntp/sntp-opts.c
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (sntp-opts.c)
*
- * It has been AutoGen-ed December 19, 2014 at 07:51:01 AM by AutoGen 5.18.5pre4
+ * It has been AutoGen-ed February 4, 2015 at 02:33:35 AM by AutoGen 5.18.5pre4
* From the definitions sntp-opts.def
* and the template file options
*
@@ -18,7 +18,7 @@
* The sntp program is copyrighted and licensed
* under the following terms:
*
- * Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ * Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
* This is free software. It is licensed for use, modification and
* redistribution under the terms of the NTP License, copies of which
* can be seen at:
@@ -31,7 +31,7 @@
* both the copyright notice and this permission notice appear in
* supporting documentation, and that the name The University of Delaware not be used in
* advertising or publicity pertaining to distribution of the software
- * without specific, written prior permission. The University of Delaware makes no
+ * without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
* representations about the suitability this software for any purpose. It
* is provided "as is" without express or implied warranty.
*/
@@ -51,7 +51,7 @@ extern "C" {
#endif
extern FILE * option_usage_fp;
#define zCopyright (sntp_opt_strs+0)
-#define zLicenseDescrip (sntp_opt_strs+310)
+#define zLicenseDescrip (sntp_opt_strs+340)
/*
* global included definitions
@@ -69,111 +69,112 @@ extern FILE * option_usage_fp;
/**
* static const strings for sntp options
*/
-static char const sntp_opt_strs[2487] =
-/* 0 */ "sntp 4.2.8\n"
- "Copyright (C) 1970-2014 The University of Delaware, all rights reserved.\n"
+static char const sntp_opt_strs[2549] =
+/* 0 */ "sntp 4.2.8p1\n"
+ "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
"This is free software. It is licensed for use, modification and\n"
"redistribution under the terms of the NTP License, copies of which\n"
"can be seen at:\n"
" <http://ntp.org/license>\n"
" <http://opensource.org/licenses/ntp-license.php>\n\0"
-/* 310 */ "Permission to use, copy, modify, and distribute this software and its\n"
+/* 340 */ "Permission to use, copy, modify, and distribute this software and its\n"
"documentation for any purpose with or without fee is hereby granted,\n"
"provided that the above copyright notice appears in all copies and that\n"
"both the copyright notice and this permission notice appear in supporting\n"
"documentation, and that the name The University of Delaware not be used in\n"
"advertising or publicity pertaining to distribution of the software without\n"
- "specific, written prior permission. The University of Delaware makes no\n"
- "representations about the suitability this software for any purpose. It is\n"
- "provided \"as is\" without express or implied warranty.\n\0"
-/* 950 */ "Force IPv4 DNS name resolution\0"
-/* 981 */ "IPV4\0"
-/* 986 */ "ipv4\0"
-/* 991 */ "Force IPv6 DNS name resolution\0"
-/* 1022 */ "IPV6\0"
-/* 1027 */ "ipv6\0"
-/* 1032 */ "Enable authentication with the key auth-keynumber\0"
-/* 1082 */ "AUTHENTICATION\0"
-/* 1097 */ "authentication\0"
-/* 1112 */ "Listen to the address specified for broadcast time sync\0"
-/* 1168 */ "BROADCAST\0"
-/* 1178 */ "broadcast\0"
-/* 1188 */ "Concurrently query all IPs returned for host-name\0"
-/* 1238 */ "CONCURRENT\0"
-/* 1249 */ "concurrent\0"
-/* 1260 */ "Increase debug verbosity level\0"
-/* 1291 */ "DEBUG_LEVEL\0"
-/* 1303 */ "debug-level\0"
-/* 1315 */ "Set the debug verbosity level\0"
-/* 1345 */ "SET_DEBUG_LEVEL\0"
-/* 1361 */ "set-debug-level\0"
-/* 1377 */ "The gap (in milliseconds) between time requests\0"
-/* 1425 */ "GAP\0"
-/* 1429 */ "gap\0"
-/* 1433 */ "KoD history filename\0"
-/* 1454 */ "KOD\0"
-/* 1458 */ "kod\0"
-/* 1462 */ "/var/db/ntp-kod\0"
-/* 1478 */ "Look in this file for the key specified with -a\0"
-/* 1526 */ "KEYFILE\0"
-/* 1534 */ "keyfile\0"
-/* 1542 */ "Log to specified logfile\0"
-/* 1567 */ "LOGFILE\0"
-/* 1575 */ "logfile\0"
-/* 1583 */ "Adjustments less than steplimit msec will be slewed\0"
-/* 1635 */ "STEPLIMIT\0"
-/* 1645 */ "steplimit\0"
-/* 1655 */ "Send int as our NTP protocol version\0"
-/* 1692 */ "NTPVERSION\0"
-/* 1703 */ "ntpversion\0"
-/* 1714 */ "Use the NTP Reserved Port (port 123)\0"
-/* 1751 */ "USERESERVEDPORT\0"
-/* 1767 */ "usereservedport\0"
-/* 1783 */ "OK to 'step' the time with settimeofday(2)\0"
-/* 1826 */ "STEP\0"
-/* 1831 */ "step\0"
-/* 1836 */ "OK to 'slew' the time with adjtime(2)\0"
-/* 1874 */ "SLEW\0"
-/* 1879 */ "slew\0"
-/* 1884 */ "The number of seconds to wait for responses\0"
-/* 1928 */ "TIMEOUT\0"
-/* 1936 */ "timeout\0"
-/* 1944 */ "Wait for pending replies (if not setting the time)\0"
-/* 1995 */ "WAIT\0"
-/* 2000 */ "no-wait\0"
-/* 2008 */ "no\0"
-/* 2011 */ "display extended usage information and exit\0"
-/* 2055 */ "help\0"
-/* 2060 */ "extended usage information passed thru pager\0"
-/* 2105 */ "more-help\0"
-/* 2115 */ "output version information and exit\0"
-/* 2151 */ "version\0"
-/* 2159 */ "save the option state to a config file\0"
-/* 2198 */ "save-opts\0"
-/* 2208 */ "load options from a config file\0"
-/* 2240 */ "LOAD_OPTS\0"
-/* 2250 */ "no-load-opts\0"
-/* 2263 */ "SNTP\0"
-/* 2268 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8\n"
+ "specific, written prior permission. The University of Delaware and Network\n"
+ "Time Foundation makes no representations about the suitability this\n"
+ "software for any purpose. It is provided \"as is\" without express or\n"
+ "implied warranty.\n\0"
+/* 1008 */ "Force IPv4 DNS name resolution\0"
+/* 1039 */ "IPV4\0"
+/* 1044 */ "ipv4\0"
+/* 1049 */ "Force IPv6 DNS name resolution\0"
+/* 1080 */ "IPV6\0"
+/* 1085 */ "ipv6\0"
+/* 1090 */ "Enable authentication with the key auth-keynumber\0"
+/* 1140 */ "AUTHENTICATION\0"
+/* 1155 */ "authentication\0"
+/* 1170 */ "Listen to the address specified for broadcast time sync\0"
+/* 1226 */ "BROADCAST\0"
+/* 1236 */ "broadcast\0"
+/* 1246 */ "Concurrently query all IPs returned for host-name\0"
+/* 1296 */ "CONCURRENT\0"
+/* 1307 */ "concurrent\0"
+/* 1318 */ "Increase debug verbosity level\0"
+/* 1349 */ "DEBUG_LEVEL\0"
+/* 1361 */ "debug-level\0"
+/* 1373 */ "Set the debug verbosity level\0"
+/* 1403 */ "SET_DEBUG_LEVEL\0"
+/* 1419 */ "set-debug-level\0"
+/* 1435 */ "The gap (in milliseconds) between time requests\0"
+/* 1483 */ "GAP\0"
+/* 1487 */ "gap\0"
+/* 1491 */ "KoD history filename\0"
+/* 1512 */ "KOD\0"
+/* 1516 */ "kod\0"
+/* 1520 */ "/var/db/ntp-kod\0"
+/* 1536 */ "Look in this file for the key specified with -a\0"
+/* 1584 */ "KEYFILE\0"
+/* 1592 */ "keyfile\0"
+/* 1600 */ "Log to specified logfile\0"
+/* 1625 */ "LOGFILE\0"
+/* 1633 */ "logfile\0"
+/* 1641 */ "Adjustments less than steplimit msec will be slewed\0"
+/* 1693 */ "STEPLIMIT\0"
+/* 1703 */ "steplimit\0"
+/* 1713 */ "Send int as our NTP protocol version\0"
+/* 1750 */ "NTPVERSION\0"
+/* 1761 */ "ntpversion\0"
+/* 1772 */ "Use the NTP Reserved Port (port 123)\0"
+/* 1809 */ "USERESERVEDPORT\0"
+/* 1825 */ "usereservedport\0"
+/* 1841 */ "OK to 'step' the time with settimeofday(2)\0"
+/* 1884 */ "STEP\0"
+/* 1889 */ "step\0"
+/* 1894 */ "OK to 'slew' the time with adjtime(2)\0"
+/* 1932 */ "SLEW\0"
+/* 1937 */ "slew\0"
+/* 1942 */ "The number of seconds to wait for responses\0"
+/* 1986 */ "TIMEOUT\0"
+/* 1994 */ "timeout\0"
+/* 2002 */ "Wait for pending replies (if not setting the time)\0"
+/* 2053 */ "WAIT\0"
+/* 2058 */ "no-wait\0"
+/* 2066 */ "no\0"
+/* 2069 */ "display extended usage information and exit\0"
+/* 2113 */ "help\0"
+/* 2118 */ "extended usage information passed thru pager\0"
+/* 2163 */ "more-help\0"
+/* 2173 */ "output version information and exit\0"
+/* 2209 */ "version\0"
+/* 2217 */ "save the option state to a config file\0"
+/* 2256 */ "save-opts\0"
+/* 2266 */ "load options from a config file\0"
+/* 2298 */ "LOAD_OPTS\0"
+/* 2308 */ "no-load-opts\0"
+/* 2321 */ "SNTP\0"
+/* 2326 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p1\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n"
"\t\t[ hostname-or-IP ...]\n\0"
-/* 2425 */ "$HOME\0"
-/* 2431 */ ".\0"
-/* 2433 */ ".ntprc\0"
-/* 2440 */ "http://bugs.ntp.org, bugs@ntp.org\0"
-/* 2474 */ "\n\0"
-/* 2476 */ "sntp 4.2.8";
+/* 2485 */ "$HOME\0"
+/* 2491 */ ".\0"
+/* 2493 */ ".ntprc\0"
+/* 2500 */ "http://bugs.ntp.org, bugs@ntp.org\0"
+/* 2534 */ "\n\0"
+/* 2536 */ "sntp 4.2.8p1";
/**
* ipv4 option description with
* "Must also have options" and "Incompatible options":
*/
/** Descriptive text for the ipv4 option */
-#define IPV4_DESC (sntp_opt_strs+950)
+#define IPV4_DESC (sntp_opt_strs+1008)
/** Upper-cased name for the ipv4 option */
-#define IPV4_NAME (sntp_opt_strs+981)
+#define IPV4_NAME (sntp_opt_strs+1039)
/** Name string for the ipv4 option */
-#define IPV4_name (sntp_opt_strs+986)
+#define IPV4_name (sntp_opt_strs+1044)
/** Other options that appear in conjunction with the ipv4 option */
static int const aIpv4CantList[] = {
INDEX_OPT_IPV6, NO_EQUIVALENT };
@@ -185,11 +186,11 @@ static int const aIpv4CantList[] = {
* "Must also have options" and "Incompatible options":
*/
/** Descriptive text for the ipv6 option */
-#define IPV6_DESC (sntp_opt_strs+991)
+#define IPV6_DESC (sntp_opt_strs+1049)
/** Upper-cased name for the ipv6 option */
-#define IPV6_NAME (sntp_opt_strs+1022)
+#define IPV6_NAME (sntp_opt_strs+1080)
/** Name string for the ipv6 option */
-#define IPV6_name (sntp_opt_strs+1027)
+#define IPV6_name (sntp_opt_strs+1085)
/** Other options that appear in conjunction with the ipv6 option */
static int const aIpv6CantList[] = {
INDEX_OPT_IPV4, NO_EQUIVALENT };
@@ -200,11 +201,11 @@ static int const aIpv6CantList[] = {
* authentication option description:
*/
/** Descriptive text for the authentication option */
-#define AUTHENTICATION_DESC (sntp_opt_strs+1032)
+#define AUTHENTICATION_DESC (sntp_opt_strs+1090)
/** Upper-cased name for the authentication option */
-#define AUTHENTICATION_NAME (sntp_opt_strs+1082)
+#define AUTHENTICATION_NAME (sntp_opt_strs+1140)
/** Name string for the authentication option */
-#define AUTHENTICATION_name (sntp_opt_strs+1097)
+#define AUTHENTICATION_name (sntp_opt_strs+1155)
/** Compiled in flag settings for the authentication option */
#define AUTHENTICATION_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@@ -213,11 +214,11 @@ static int const aIpv6CantList[] = {
* broadcast option description:
*/
/** Descriptive text for the broadcast option */
-#define BROADCAST_DESC (sntp_opt_strs+1112)
+#define BROADCAST_DESC (sntp_opt_strs+1170)
/** Upper-cased name for the broadcast option */
-#define BROADCAST_NAME (sntp_opt_strs+1168)
+#define BROADCAST_NAME (sntp_opt_strs+1226)
/** Name string for the broadcast option */
-#define BROADCAST_name (sntp_opt_strs+1178)
+#define BROADCAST_name (sntp_opt_strs+1236)
/** Compiled in flag settings for the broadcast option */
#define BROADCAST_FLAGS (OPTST_DISABLED | OPTST_STACKED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -226,11 +227,11 @@ static int const aIpv6CantList[] = {
* concurrent option description:
*/
/** Descriptive text for the concurrent option */
-#define CONCURRENT_DESC (sntp_opt_strs+1188)
+#define CONCURRENT_DESC (sntp_opt_strs+1246)
/** Upper-cased name for the concurrent option */
-#define CONCURRENT_NAME (sntp_opt_strs+1238)
+#define CONCURRENT_NAME (sntp_opt_strs+1296)
/** Name string for the concurrent option */
-#define CONCURRENT_name (sntp_opt_strs+1249)
+#define CONCURRENT_name (sntp_opt_strs+1307)
/** Compiled in flag settings for the concurrent option */
#define CONCURRENT_FLAGS (OPTST_DISABLED | OPTST_STACKED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -239,11 +240,11 @@ static int const aIpv6CantList[] = {
* debug-level option description:
*/
/** Descriptive text for the debug-level option */
-#define DEBUG_LEVEL_DESC (sntp_opt_strs+1260)
+#define DEBUG_LEVEL_DESC (sntp_opt_strs+1318)
/** Upper-cased name for the debug-level option */
-#define DEBUG_LEVEL_NAME (sntp_opt_strs+1291)
+#define DEBUG_LEVEL_NAME (sntp_opt_strs+1349)
/** Name string for the debug-level option */
-#define DEBUG_LEVEL_name (sntp_opt_strs+1303)
+#define DEBUG_LEVEL_name (sntp_opt_strs+1361)
/** Compiled in flag settings for the debug-level option */
#define DEBUG_LEVEL_FLAGS (OPTST_DISABLED)
@@ -251,11 +252,11 @@ static int const aIpv6CantList[] = {
* set-debug-level option description:
*/
/** Descriptive text for the set-debug-level option */
-#define SET_DEBUG_LEVEL_DESC (sntp_opt_strs+1315)
+#define SET_DEBUG_LEVEL_DESC (sntp_opt_strs+1373)
/** Upper-cased name for the set-debug-level option */
-#define SET_DEBUG_LEVEL_NAME (sntp_opt_strs+1345)
+#define SET_DEBUG_LEVEL_NAME (sntp_opt_strs+1403)
/** Name string for the set-debug-level option */
-#define SET_DEBUG_LEVEL_name (sntp_opt_strs+1361)
+#define SET_DEBUG_LEVEL_name (sntp_opt_strs+1419)
/** Compiled in flag settings for the set-debug-level option */
#define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@@ -264,11 +265,11 @@ static int const aIpv6CantList[] = {
* gap option description:
*/
/** Descriptive text for the gap option */
-#define GAP_DESC (sntp_opt_strs+1377)
+#define GAP_DESC (sntp_opt_strs+1435)
/** Upper-cased name for the gap option */
-#define GAP_NAME (sntp_opt_strs+1425)
+#define GAP_NAME (sntp_opt_strs+1483)
/** Name string for the gap option */
-#define GAP_name (sntp_opt_strs+1429)
+#define GAP_name (sntp_opt_strs+1487)
/** The compiled in default value for the gap option argument */
#define GAP_DFT_ARG ((char const*)50)
/** Compiled in flag settings for the gap option */
@@ -279,13 +280,13 @@ static int const aIpv6CantList[] = {
* kod option description:
*/
/** Descriptive text for the kod option */
-#define KOD_DESC (sntp_opt_strs+1433)
+#define KOD_DESC (sntp_opt_strs+1491)
/** Upper-cased name for the kod option */
-#define KOD_NAME (sntp_opt_strs+1454)
+#define KOD_NAME (sntp_opt_strs+1512)
/** Name string for the kod option */
-#define KOD_name (sntp_opt_strs+1458)
+#define KOD_name (sntp_opt_strs+1516)
/** The compiled in default value for the kod option argument */
-#define KOD_DFT_ARG (sntp_opt_strs+1462)
+#define KOD_DFT_ARG (sntp_opt_strs+1520)
/** Compiled in flag settings for the kod option */
#define KOD_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
@@ -294,11 +295,11 @@ static int const aIpv6CantList[] = {
* keyfile option description:
*/
/** Descriptive text for the keyfile option */
-#define KEYFILE_DESC (sntp_opt_strs+1478)
+#define KEYFILE_DESC (sntp_opt_strs+1536)
/** Upper-cased name for the keyfile option */
-#define KEYFILE_NAME (sntp_opt_strs+1526)
+#define KEYFILE_NAME (sntp_opt_strs+1584)
/** Name string for the keyfile option */
-#define KEYFILE_name (sntp_opt_strs+1534)
+#define KEYFILE_name (sntp_opt_strs+1592)
/** Compiled in flag settings for the keyfile option */
#define KEYFILE_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
@@ -307,11 +308,11 @@ static int const aIpv6CantList[] = {
* logfile option description:
*/
/** Descriptive text for the logfile option */
-#define LOGFILE_DESC (sntp_opt_strs+1542)
+#define LOGFILE_DESC (sntp_opt_strs+1600)
/** Upper-cased name for the logfile option */
-#define LOGFILE_NAME (sntp_opt_strs+1567)
+#define LOGFILE_NAME (sntp_opt_strs+1625)
/** Name string for the logfile option */
-#define LOGFILE_name (sntp_opt_strs+1575)
+#define LOGFILE_name (sntp_opt_strs+1633)
/** Compiled in flag settings for the logfile option */
#define LOGFILE_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
@@ -320,11 +321,11 @@ static int const aIpv6CantList[] = {
* steplimit option description:
*/
/** Descriptive text for the steplimit option */
-#define STEPLIMIT_DESC (sntp_opt_strs+1583)
+#define STEPLIMIT_DESC (sntp_opt_strs+1641)
/** Upper-cased name for the steplimit option */
-#define STEPLIMIT_NAME (sntp_opt_strs+1635)
+#define STEPLIMIT_NAME (sntp_opt_strs+1693)
/** Name string for the steplimit option */
-#define STEPLIMIT_name (sntp_opt_strs+1645)
+#define STEPLIMIT_name (sntp_opt_strs+1703)
/** Compiled in flag settings for the steplimit option */
#define STEPLIMIT_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@@ -333,11 +334,11 @@ static int const aIpv6CantList[] = {
* ntpversion option description:
*/
/** Descriptive text for the ntpversion option */
-#define NTPVERSION_DESC (sntp_opt_strs+1655)
+#define NTPVERSION_DESC (sntp_opt_strs+1713)
/** Upper-cased name for the ntpversion option */
-#define NTPVERSION_NAME (sntp_opt_strs+1692)
+#define NTPVERSION_NAME (sntp_opt_strs+1750)
/** Name string for the ntpversion option */
-#define NTPVERSION_name (sntp_opt_strs+1703)
+#define NTPVERSION_name (sntp_opt_strs+1761)
/** The compiled in default value for the ntpversion option argument */
#define NTPVERSION_DFT_ARG ((char const*)4)
/** Compiled in flag settings for the ntpversion option */
@@ -348,11 +349,11 @@ static int const aIpv6CantList[] = {
* usereservedport option description:
*/
/** Descriptive text for the usereservedport option */
-#define USERESERVEDPORT_DESC (sntp_opt_strs+1714)
+#define USERESERVEDPORT_DESC (sntp_opt_strs+1772)
/** Upper-cased name for the usereservedport option */
-#define USERESERVEDPORT_NAME (sntp_opt_strs+1751)
+#define USERESERVEDPORT_NAME (sntp_opt_strs+1809)
/** Name string for the usereservedport option */
-#define USERESERVEDPORT_name (sntp_opt_strs+1767)
+#define USERESERVEDPORT_name (sntp_opt_strs+1825)
/** Compiled in flag settings for the usereservedport option */
#define USERESERVEDPORT_FLAGS (OPTST_DISABLED)
@@ -360,11 +361,11 @@ static int const aIpv6CantList[] = {
* step option description:
*/
/** Descriptive text for the step option */
-#define STEP_DESC (sntp_opt_strs+1783)
+#define STEP_DESC (sntp_opt_strs+1841)
/** Upper-cased name for the step option */
-#define STEP_NAME (sntp_opt_strs+1826)
+#define STEP_NAME (sntp_opt_strs+1884)
/** Name string for the step option */
-#define STEP_name (sntp_opt_strs+1831)
+#define STEP_name (sntp_opt_strs+1889)
/** Compiled in flag settings for the step option */
#define STEP_FLAGS (OPTST_DISABLED)
@@ -372,11 +373,11 @@ static int const aIpv6CantList[] = {
* slew option description:
*/
/** Descriptive text for the slew option */
-#define SLEW_DESC (sntp_opt_strs+1836)
+#define SLEW_DESC (sntp_opt_strs+1894)
/** Upper-cased name for the slew option */
-#define SLEW_NAME (sntp_opt_strs+1874)
+#define SLEW_NAME (sntp_opt_strs+1932)
/** Name string for the slew option */
-#define SLEW_name (sntp_opt_strs+1879)
+#define SLEW_name (sntp_opt_strs+1937)
/** Compiled in flag settings for the slew option */
#define SLEW_FLAGS (OPTST_DISABLED)
@@ -384,11 +385,11 @@ static int const aIpv6CantList[] = {
* timeout option description:
*/
/** Descriptive text for the timeout option */
-#define TIMEOUT_DESC (sntp_opt_strs+1884)
+#define TIMEOUT_DESC (sntp_opt_strs+1942)
/** Upper-cased name for the timeout option */
-#define TIMEOUT_NAME (sntp_opt_strs+1928)
+#define TIMEOUT_NAME (sntp_opt_strs+1986)
/** Name string for the timeout option */
-#define TIMEOUT_name (sntp_opt_strs+1936)
+#define TIMEOUT_name (sntp_opt_strs+1994)
/** The compiled in default value for the timeout option argument */
#define TIMEOUT_DFT_ARG ((char const*)5)
/** Compiled in flag settings for the timeout option */
@@ -399,13 +400,13 @@ static int const aIpv6CantList[] = {
* wait option description:
*/
/** Descriptive text for the wait option */
-#define WAIT_DESC (sntp_opt_strs+1944)
+#define WAIT_DESC (sntp_opt_strs+2002)
/** Upper-cased name for the wait option */
-#define WAIT_NAME (sntp_opt_strs+1995)
+#define WAIT_NAME (sntp_opt_strs+2053)
/** disablement name for the wait option */
-#define NOT_WAIT_name (sntp_opt_strs+2000)
+#define NOT_WAIT_name (sntp_opt_strs+2058)
/** disablement prefix for the wait option */
-#define NOT_WAIT_PFX (sntp_opt_strs+2008)
+#define NOT_WAIT_PFX (sntp_opt_strs+2066)
/** Name string for the wait option */
#define WAIT_name (NOT_WAIT_name + 3)
/** Compiled in flag settings for the wait option */
@@ -414,11 +415,11 @@ static int const aIpv6CantList[] = {
/*
* Help/More_Help/Version option descriptions:
*/
-#define HELP_DESC (sntp_opt_strs+2011)
-#define HELP_name (sntp_opt_strs+2055)
+#define HELP_DESC (sntp_opt_strs+2069)
+#define HELP_name (sntp_opt_strs+2113)
#ifdef HAVE_WORKING_FORK
-#define MORE_HELP_DESC (sntp_opt_strs+2060)
-#define MORE_HELP_name (sntp_opt_strs+2105)
+#define MORE_HELP_DESC (sntp_opt_strs+2118)
+#define MORE_HELP_name (sntp_opt_strs+2163)
#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
#else
#define MORE_HELP_DESC HELP_DESC
@@ -431,14 +432,14 @@ static int const aIpv6CantList[] = {
# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
#endif
-#define VER_DESC (sntp_opt_strs+2115)
-#define VER_name (sntp_opt_strs+2151)
-#define SAVE_OPTS_DESC (sntp_opt_strs+2159)
-#define SAVE_OPTS_name (sntp_opt_strs+2198)
-#define LOAD_OPTS_DESC (sntp_opt_strs+2208)
-#define LOAD_OPTS_NAME (sntp_opt_strs+2240)
-#define NO_LOAD_OPTS_name (sntp_opt_strs+2250)
-#define LOAD_OPTS_pfx (sntp_opt_strs+2008)
+#define VER_DESC (sntp_opt_strs+2173)
+#define VER_name (sntp_opt_strs+2209)
+#define SAVE_OPTS_DESC (sntp_opt_strs+2217)
+#define SAVE_OPTS_name (sntp_opt_strs+2256)
+#define LOAD_OPTS_DESC (sntp_opt_strs+2266)
+#define LOAD_OPTS_NAME (sntp_opt_strs+2298)
+#define NO_LOAD_OPTS_name (sntp_opt_strs+2308)
+#define LOAD_OPTS_pfx (sntp_opt_strs+2066)
#define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3)
/**
* Declare option callback procedures
@@ -744,24 +745,24 @@ static tOptDesc optDesc[OPTION_CT] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/** Reference to the upper cased version of sntp. */
-#define zPROGNAME (sntp_opt_strs+2263)
+#define zPROGNAME (sntp_opt_strs+2321)
/** Reference to the title line for sntp usage. */
-#define zUsageTitle (sntp_opt_strs+2268)
+#define zUsageTitle (sntp_opt_strs+2326)
/** sntp configuration file name. */
-#define zRcName (sntp_opt_strs+2433)
+#define zRcName (sntp_opt_strs+2493)
/** Directories to search for sntp config files. */
static char const * const apzHomeList[3] = {
- sntp_opt_strs+2425,
- sntp_opt_strs+2431,
+ sntp_opt_strs+2485,
+ sntp_opt_strs+2491,
NULL };
/** The sntp program bug email address. */
-#define zBugsAddr (sntp_opt_strs+2440)
+#define zBugsAddr (sntp_opt_strs+2500)
/** Clarification/explanation of what sntp does. */
-#define zExplain (sntp_opt_strs+2474)
+#define zExplain (sntp_opt_strs+2534)
/** Extra detail explaining what sntp does. */
#define zDetail (NULL)
/** The full version string for sntp. */
-#define zFullVersion (sntp_opt_strs+2476)
+#define zFullVersion (sntp_opt_strs+2536)
/* extracted from optcode.tlib near line 364 */
#if defined(ENABLE_NLS)
@@ -904,7 +905,9 @@ doOptLogfile(tOptions* pOptions, tOptDesc* pOptDesc)
* Code to handle the steplimit option.
* If the time adjustment is less than @file{steplimit} milliseconds,
* slew the amount using @command{adjtime(2)}. Otherwise, step the
- * correction using @command{settimeofday(2)}.
+ * correction using @command{settimeofday(2)}. The default value is 0,
+ * which means all adjustments will be stepped. This is a feature, as
+ * different situations demand different values.
* @param[in] pOptions the sntp options data structure
* @param[in,out] pOptDesc the option descriptor for this option.
*/
@@ -1170,8 +1173,8 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via sntpOptions.pzCopyright */
- puts(_("sntp 4.2.8\n\
-Copyright (C) 1970-2014 The University of Delaware, all rights reserved.\n\
+ puts(_("sntp 4.2.8p1\n\
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
This is free software. It is licensed for use, modification and\n\
redistribution under the terms of the NTP License, copies of which\n\
can be seen at:\n"));
@@ -1185,9 +1188,10 @@ provided that the above copyright notice appears in all copies and that\n\
both the copyright notice and this permission notice appear in supporting\n\
documentation, and that the name The University of Delaware not be used in\n\
advertising or publicity pertaining to distribution of the software without\n\
-specific, written prior permission. The University of Delaware makes no\n\
-representations about the suitability this software for any purpose. It is\n\
-provided \"as is\" without express or implied warranty.\n"));
+specific, written prior permission. The University of Delaware and Network\n\
+Time Foundation makes no representations about the suitability this\n\
+software for any purpose. It is provided \"as is\" without express or\n\
+implied warranty.\n"));
/* referenced via sntpOptions.pOptDesc->pzText */
puts(_("Force IPv4 DNS name resolution"));
@@ -1259,7 +1263,7 @@ provided \"as is\" without express or implied warranty.\n"));
puts(_("load options from a config file"));
/* referenced via sntpOptions.pzUsageTitle */
- puts(_("sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8\n\
+ puts(_("sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p1\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
\t\t[ hostname-or-IP ...]\n"));
@@ -1267,7 +1271,7 @@ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
puts(_("\n"));
/* referenced via sntpOptions.pzFullVersion */
- puts(_("sntp 4.2.8"));
+ puts(_("sntp 4.2.8p1"));
/* referenced via sntpOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
diff --git a/sntp/sntp-opts.def b/sntp/sntp-opts.def
index c32f5e51e47b..c94d5e96e55b 100644
--- a/sntp/sntp-opts.def
+++ b/sntp/sntp-opts.def
@@ -157,7 +157,9 @@ flag = {
doc = <<- _EndOfDoc_
If the time adjustment is less than @file{steplimit} milliseconds,
slew the amount using @command{adjtime(2)}. Otherwise, step the
- correction using @command{settimeofday(2)}.
+ correction using @command{settimeofday(2)}. The default value is 0,
+ which means all adjustments will be stepped. This is a feature, as
+ different situations demand different values.
_EndOfDoc_;
};
@@ -292,14 +294,27 @@ doc-section = {
is the simplest use of this program
and can be run as an unprivileged command
to check the current time and error in the local clock.
-.It Li "sntp -a ntpserver.somewhere"
+.It Li "sntp -Ss -M 128 ntpserver.somewhere"
With suitable privilege,
run as a command
or from a
.Xr cron 8
job,
-.Ic "sntp -a"
-will reset the local clock from a synchronized specified server,
+.Ic "sntp -Ss -M 128 ntpserver.somewhere"
+will request the time from the server,
+and if that server reports that it is synchronized
+then if the offset adjustment is less than 128 milliseconds
+the correction will be slewed,
+and if the correction is more than 128 milliseconds
+the correction will be stepped.
+.It Li "sntp -S ntpserver.somewhere"
+With suitable privilege,
+run as a command
+or from a
+.Xr cron 8
+job,
+.Ic "sntp -S ntpserver.somewhere"
+will set (step) the local clock from a synchronized specified server,
like the (deprecated)
.Xr ntpdate 1ntpdatemdoc ,
or
diff --git a/sntp/sntp-opts.h b/sntp/sntp-opts.h
index a904e18cd0b2..d0407aa8d3d7 100644
--- a/sntp/sntp-opts.h
+++ b/sntp/sntp-opts.h
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (sntp-opts.h)
*
- * It has been AutoGen-ed December 19, 2014 at 07:51:00 AM by AutoGen 5.18.5pre4
+ * It has been AutoGen-ed February 4, 2015 at 02:33:34 AM by AutoGen 5.18.5pre4
* From the definitions sntp-opts.def
* and the template file options
*
@@ -18,7 +18,7 @@
* The sntp program is copyrighted and licensed
* under the following terms:
*
- * Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ * Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
* This is free software. It is licensed for use, modification and
* redistribution under the terms of the NTP License, copies of which
* can be seen at:
@@ -31,7 +31,7 @@
* both the copyright notice and this permission notice appear in
* supporting documentation, and that the name The University of Delaware not be used in
* advertising or publicity pertaining to distribution of the software
- * without specific, written prior permission. The University of Delaware makes no
+ * without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
* representations about the suitability this software for any purpose. It
* is provided "as is" without express or implied warranty.
*/
@@ -91,9 +91,9 @@ typedef enum {
/** count of all options for sntp */
#define OPTION_CT 23
/** sntp version */
-#define SNTP_VERSION "4.2.8"
+#define SNTP_VERSION "4.2.8p1"
/** Full sntp version text */
-#define SNTP_FULL_VERSION "sntp 4.2.8"
+#define SNTP_FULL_VERSION "sntp 4.2.8p1"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
diff --git a/sntp/sntp.1sntpman b/sntp/sntp.1sntpman
index 3d7fa7b00497..36bdfbd42c9f 100644
--- a/sntp/sntp.1sntpman
+++ b/sntp/sntp.1sntpman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH sntp 1sntpman "19 Dec 2014" "4.2.8" "User Commands"
+.TH sntp 1sntpman "04 Feb 2015" "4.2.8p1" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-4dayXk/ag-feaqWk)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-apayaT/ag-zpaq_S)
.\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:51:32 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed February 4, 2015 at 02:34:13 AM by AutoGen 5.18.5pre4
.\" From the definitions sntp-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -188,7 +188,9 @@ greater than or equal to 0
.sp
If the time adjustment is less than \fIsteplimit\fP milliseconds,
slew the amount using \fBadjtime(2)\fP. Otherwise, step the
-correction using \fBsettimeofday(2)\fP.
+correction using \fBsettimeofday(2)\fP. The default value is 0,
+which means all adjustments will be stepped. This is a feature, as
+different situations demand different values.
.TP
.NOP \f\*[B-Font]\-o\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-ntpversion\f[]=\f\*[I-Font]number\f[]
Send \fBint\fP as our NTP protocol version.
@@ -289,14 +291,28 @@ is the simplest use of this program
and can be run as an unprivileged command
to check the current time and error in the local clock.
.TP 7
-.NOP \f[C]sntp \-a ntpserver.somewhere\f[]
+.NOP \f[C]sntp \-Ss \-M 128 ntpserver.somewhere\f[]
With suitable privilege,
run as a command
or from a
\fCcron\fR(8)\f[]
job,
-\f\*[B-Font]sntp \-a\f[]
-will reset the local clock from a synchronized specified server,
+\f\*[B-Font]sntp \-Ss \-M 128 ntpserver.somewhere\f[]
+will request the time from the server,
+and if that server reports that it is synchronized
+then if the offset adjustment is less than 128 milliseconds
+the correction will be slewed,
+and if the correction is more than 128 milliseconds
+the correction will be stepped.
+.TP 7
+.NOP \f[C]sntp \-S ntpserver.somewhere\f[]
+With suitable privilege,
+run as a command
+or from a
+\fCcron\fR(8)\f[]
+job,
+\f\*[B-Font]sntp \-S ntpserver.somewhere\f[]
+will set (step) the local clock from a synchronized specified server,
like the (deprecated)
\fCntpdate\fR(1ntpdatemdoc)\f[],
or
@@ -331,7 +347,7 @@ it to autogen-users@lists.sourceforge.net. Thank you.
.NOP "Dave Hart"
.br
.SH "COPYRIGHT"
-Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
This program is released under the terms of the NTP license, <http://ntp.org/license>.
.SH "BUGS"
Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
diff --git a/sntp/sntp.1sntpmdoc b/sntp/sntp.1sntpmdoc
index b5f343c686c0..26444f5aff2e 100644
--- a/sntp/sntp.1sntpmdoc
+++ b/sntp/sntp.1sntpmdoc
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd February 4 2015
.Dt SNTP 1sntpmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (sntp-opts.mdoc)
.\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:51:38 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed February 4, 2015 at 02:34:20 AM by AutoGen 5.18.5pre4
.\" From the definitions sntp-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -162,7 +162,9 @@ greater than or equal to 0
.sp
If the time adjustment is less than \fIsteplimit\fP milliseconds,
slew the amount using \fBadjtime(2)\fP. Otherwise, step the
-correction using \fBsettimeofday(2)\fP.
+correction using \fBsettimeofday(2)\fP. The default value is 0,
+which means all adjustments will be stepped. This is a feature, as
+different situations demand different values.
.It Fl o Ar number , Fl \-ntpversion Ns = Ns Ar number
Send \fBint\fP as our NTP protocol version.
This option takes an integer number as its argument.
@@ -251,14 +253,27 @@ is searched for within those directories.
is the simplest use of this program
and can be run as an unprivileged command
to check the current time and error in the local clock.
-.It Li "sntp \-a ntpserver.somewhere"
+.It Li "sntp \-Ss \-M 128 ntpserver.somewhere"
With suitable privilege,
run as a command
or from a
.Xr cron 8
job,
-.Ic "sntp \-a"
-will reset the local clock from a synchronized specified server,
+.Ic "sntp \-Ss \-M 128 ntpserver.somewhere"
+will request the time from the server,
+and if that server reports that it is synchronized
+then if the offset adjustment is less than 128 milliseconds
+the correction will be slewed,
+and if the correction is more than 128 milliseconds
+the correction will be stepped.
+.It Li "sntp \-S ntpserver.somewhere"
+With suitable privilege,
+run as a command
+or from a
+.Xr cron 8
+job,
+.Ic "sntp \-S ntpserver.somewhere"
+will set (step) the local clock from a synchronized specified server,
like the (deprecated)
.Xr ntpdate 1ntpdatemdoc ,
or
@@ -287,7 +302,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.An "Harlan Stenn"
.An "Dave Hart"
.Sh "COPYRIGHT"
-Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
This program is released under the terms of the NTP license, <http://ntp.org/license>.
.Sh "BUGS"
Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
diff --git a/sntp/sntp.html b/sntp/sntp.html
index 36d6073187e5..cac641afb391 100644
--- a/sntp/sntp.html
+++ b/sntp/sntp.html
@@ -36,7 +36,7 @@ display the time offset of the system clock relative to the server
clock. Run as root, it can correct the system clock to this offset as
well. It can be run as an interactive command or from a cron job.
- <p>This document applies to version 4.2.8 of <code>sntp</code>.
+ <p>This document applies to version 4.2.8p1 of <code>sntp</code>.
<p>The program implements the SNTP protocol as defined by RFC 5905, the NTPv4
IETF specification.
@@ -175,7 +175,7 @@ the usage text by passing it through a pager program.
used to select the program, defaulting to <span class="file">more</span>. Both will exit
with a status code of 0.
-<pre class="example">sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8
+<pre class="example">sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p1
Usage: sntp [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... \
[ hostname-or-IP ...]
Flg Arg Option-Name Description
@@ -417,7 +417,9 @@ This is the &ldquo;adjustments less than <var>steplimit</var> msec will be slewe
This option takes a number argument.
If the time adjustment is less than <span class="file">steplimit</span> milliseconds,
slew the amount using <span class="command">adjtime(2)</span>. Otherwise, step the
-correction using <span class="command">settimeofday(2)</span>.
+correction using <span class="command">settimeofday(2)</span>. The default value is 0,
+which means all adjustments will be stepped. This is a feature, as
+different situations demand different values.
<div class="node">
<p><hr>
<a name="sntp-ntpversion"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-usereservedport">sntp usereservedport</a>,
diff --git a/sntp/sntp.man.in b/sntp/sntp.man.in
index d97a4e203dd8..3a6f9c5e9539 100644
--- a/sntp/sntp.man.in
+++ b/sntp/sntp.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH sntp @SNTP_MS@ "19 Dec 2014" "4.2.8" "User Commands"
+.TH sntp @SNTP_MS@ "04 Feb 2015" "4.2.8p1" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-4dayXk/ag-feaqWk)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-apayaT/ag-zpaq_S)
.\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:51:32 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed February 4, 2015 at 02:34:13 AM by AutoGen 5.18.5pre4
.\" From the definitions sntp-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -188,7 +188,9 @@ greater than or equal to 0
.sp
If the time adjustment is less than \fIsteplimit\fP milliseconds,
slew the amount using \fBadjtime(2)\fP. Otherwise, step the
-correction using \fBsettimeofday(2)\fP.
+correction using \fBsettimeofday(2)\fP. The default value is 0,
+which means all adjustments will be stepped. This is a feature, as
+different situations demand different values.
.TP
.NOP \f\*[B-Font]\-o\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-ntpversion\f[]=\f\*[I-Font]number\f[]
Send \fBint\fP as our NTP protocol version.
@@ -289,14 +291,28 @@ is the simplest use of this program
and can be run as an unprivileged command
to check the current time and error in the local clock.
.TP 7
-.NOP \f[C]sntp \-a ntpserver.somewhere\f[]
+.NOP \f[C]sntp \-Ss \-M 128 ntpserver.somewhere\f[]
With suitable privilege,
run as a command
or from a
\fCcron\fR(8)\f[]
job,
-\f\*[B-Font]sntp \-a\f[]
-will reset the local clock from a synchronized specified server,
+\f\*[B-Font]sntp \-Ss \-M 128 ntpserver.somewhere\f[]
+will request the time from the server,
+and if that server reports that it is synchronized
+then if the offset adjustment is less than 128 milliseconds
+the correction will be slewed,
+and if the correction is more than 128 milliseconds
+the correction will be stepped.
+.TP 7
+.NOP \f[C]sntp \-S ntpserver.somewhere\f[]
+With suitable privilege,
+run as a command
+or from a
+\fCcron\fR(8)\f[]
+job,
+\f\*[B-Font]sntp \-S ntpserver.somewhere\f[]
+will set (step) the local clock from a synchronized specified server,
like the (deprecated)
\fCntpdate\fR(@NTPDATE_MS@)\f[],
or
@@ -331,7 +347,7 @@ it to autogen-users@lists.sourceforge.net. Thank you.
.NOP "Dave Hart"
.br
.SH "COPYRIGHT"
-Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
This program is released under the terms of the NTP license, <http://ntp.org/license>.
.SH "BUGS"
Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
diff --git a/sntp/sntp.mdoc.in b/sntp/sntp.mdoc.in
index 1ce2e39554b7..9b66208f171b 100644
--- a/sntp/sntp.mdoc.in
+++ b/sntp/sntp.mdoc.in
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd February 4 2015
.Dt SNTP @SNTP_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (sntp-opts.mdoc)
.\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:51:38 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed February 4, 2015 at 02:34:20 AM by AutoGen 5.18.5pre4
.\" From the definitions sntp-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -162,7 +162,9 @@ greater than or equal to 0
.sp
If the time adjustment is less than \fIsteplimit\fP milliseconds,
slew the amount using \fBadjtime(2)\fP. Otherwise, step the
-correction using \fBsettimeofday(2)\fP.
+correction using \fBsettimeofday(2)\fP. The default value is 0,
+which means all adjustments will be stepped. This is a feature, as
+different situations demand different values.
.It Fl o Ar number , Fl \-ntpversion Ns = Ns Ar number
Send \fBint\fP as our NTP protocol version.
This option takes an integer number as its argument.
@@ -251,14 +253,27 @@ is searched for within those directories.
is the simplest use of this program
and can be run as an unprivileged command
to check the current time and error in the local clock.
-.It Li "sntp \-a ntpserver.somewhere"
+.It Li "sntp \-Ss \-M 128 ntpserver.somewhere"
With suitable privilege,
run as a command
or from a
.Xr cron 8
job,
-.Ic "sntp \-a"
-will reset the local clock from a synchronized specified server,
+.Ic "sntp \-Ss \-M 128 ntpserver.somewhere"
+will request the time from the server,
+and if that server reports that it is synchronized
+then if the offset adjustment is less than 128 milliseconds
+the correction will be slewed,
+and if the correction is more than 128 milliseconds
+the correction will be stepped.
+.It Li "sntp \-S ntpserver.somewhere"
+With suitable privilege,
+run as a command
+or from a
+.Xr cron 8
+job,
+.Ic "sntp \-S ntpserver.somewhere"
+will set (step) the local clock from a synchronized specified server,
like the (deprecated)
.Xr ntpdate @NTPDATE_MS@ ,
or
@@ -287,7 +302,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.An "Harlan Stenn"
.An "Dave Hart"
.Sh "COPYRIGHT"
-Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
This program is released under the terms of the NTP license, <http://ntp.org/license>.
.Sh "BUGS"
Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
diff --git a/sntp/tests/Makefile.in b/sntp/tests/Makefile.in
index c1232823a54b..73b78daf6bb9 100644
--- a/sntp/tests/Makefile.in
+++ b/sntp/tests/Makefile.in
@@ -179,6 +179,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDADD_LIBEVENT = @LDADD_LIBEVENT@
LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
LDADD_NTP = @LDADD_NTP@
LDFLAGS = @LDFLAGS@
LDFLAGS_NTP = @LDFLAGS_NTP@