AUTOMAKE_OPTIONS = util/ansi2knr foreign 1.5
ACLOCAL_AMFLAGS= -I m4
-include $(srcdir)/libopts/MakeDefs.inc
+#include $(srcdir)/sntp/libopts/MakeDefs.inc
SUBDIRS=
if NEED_LIBOPTS
-SUBDIRS+= libopts
+SUBDIRS+= sntp/libopts
endif
SUBDIRS+= \
scripts \
ElectricFence \
arlib \
libntp \
- libopts \
libparse \
ntpd \
ntpdate \
clockstuff \
kernel \
sntp \
+ sntp/libopts \
util
DISTCHECK_CONFIGURE_FLAGS= --with-arlib --with-sntp
AMU_OS_CFLAGS
-AC_CONFIG_SUBDIRS(libopts)
LIBOPTS_CHECK
AC_MSG_CHECKING(for bin subdirectory)
+dnl -*- buffer-read-only: t -*- vi: set ro:
dnl
-dnl EDIT THIS FILE WITH CAUTION (libopts.m4)
+dnl DO NOT EDIT THIS FILE (libopts.m4)
dnl
-dnl It has been AutoGen-ed Sunday January 9, 2005 at 06:06:21 AM EST
-dnl From the definitions stdin
+dnl It has been AutoGen-ed Thursday July 28, 2005 at 04:18:42 PM PDT
+dnl From the definitions libopts.def
dnl and the template file conftest.tpl
dnl
dnl @synopsis INVOKE_LIBOPTS_MACROS
dnl
-dnl This macro will invoke the AutoConf macros specified in stdin
+dnl This macro will invoke the AutoConf macros specified in libopts.def
dnl that have not been disabled with "omit-invocation".
dnl
AC_DEFUN([LIBOPTS_WITH_REGEX_HEADER],[
]) # end of AC_DEFUN of LIBOPTS_RUN_PATHFIND
+AC_DEFUN([LIBOPTS_RUN_REALPATH],[
+ AC_MSG_CHECKING([whether we have a functional realpath(3C)])
+ AC_CACHE_VAL([libopts_cv_run_realpath],[
+ AC_TRY_RUN([@%:@include <limits.h>
+@%:@include <stdlib.h>
+int main (int argc, char** argv) {
+@%:@ifndef PATH_MAX
+choke me!!
+@%:@else
+ char zPath@<:@PATH_MAX+1@:>@;
+@%:@endif
+ char *pz = realpath(argv@<:@0@:>@, zPath);
+ return (pz == zPath) ? 0 : 1;
+}],
+ [libopts_cv_run_realpath=yes],[libopts_cv_run_realpath=no],[libopts_cv_run_realpath=no]
+ ) # end of TRY_RUN
+ ]) # end of AC_CACHE_VAL for libopts_cv_run_realpath
+ AC_MSG_RESULT([${libopts_cv_run_realpath}])
+
+ if test "X${libopts_cv_run_realpath}" != Xno
+ then
+ AC_DEFINE([HAVE_REALPATH],[1],
+ [Define this if we have a functional realpath(3C)])
+ fi
+
+]) # end of AC_DEFUN of LIBOPTS_RUN_REALPATH
+
+
AC_DEFUN([LIBOPTS_RUN_STRFTIME],[
AC_MSG_CHECKING([whether strftime() works])
AC_CACHE_VAL([libopts_cv_run_strftime],[
# Check to see if pathfind(3) works.
LIBOPTS_RUN_PATHFIND
+ # Check to see if we have a functional realpath(3C).
+ LIBOPTS_RUN_REALPATH
+
# Check to see if strftime() works.
LIBOPTS_RUN_STRFTIME
# Check to see if fopen accepts "t" mode.
LIBOPTS_RUN_FOPEN_TEXT
+ # ----------------------------------------------------------------------
+ # Check for standard headers.
+ # ----------------------------------------------------------------------
+ # =================
+ # AC_HEADER_STDC
+ # =================
+ AC_HEADER_STDC
+ # =================
+ # AC_HEADER_DIRENT
+ # =================
+ AC_HEADER_DIRENT
+
+ # ----------------------------------------------------------------------
+ # AC_CHECK_HEADERS Check for list of headers.
+ # ----------------------------------------------------------------------
+ AC_CHECK_HEADERS(dlfcn.h errno.h fcntl.h libgen.h memory.h netinet/in.h \
+ setjmp.h sys/mman.h sys/param.h sys/poll.h sys/procset.h sys/select.h \
+ sys/socket.h sys/stropts.h sys/time.h sys/un.h sys/wait.h unistd.h)
+
+ # --------------------------------------------
+ # Verify certain entries from AC_CHECK_HEADERS
+ # --------------------------------------------
+ for f in sys_types sys_mman sys_param sys_stat sys_wait \
+ string errno stdlib memory setjmp
+ do eval as_ac_var=\${ac_cv_header_${f}_h+set}
+ test "${as_ac_var}" = set || \
+ AC_MSG_ERROR([You must have ${f}.h on your system])
+ done
+
+ # =================
+ # AC_CHECK_HEADERS: stdarg.h is present define HAVE_STDARG_H, otherwise
+ # if varargs.h is present define HAVE_VARARGS_H.
+ # =================
+ AC_CHECK_HEADERS(stdarg.h varargs.h, break)
+ if test `eval echo '${'$as_ac_Header'}'` != yes; then
+ AC_MSG_ERROR([You must have stdarg.h or varargs.h on your system])
+ fi
+
+ # =================
+ # Similarly for the string.h and strings.h headers
+ # =================
+ AC_CHECK_HEADERS(string.h strings.h, break)
+ if test `eval echo '${'$as_ac_Header'}'` != yes; then
+ AC_MSG_ERROR([You must have string.h or strings.h on your system])
+ fi
+
+ # =================
+ # ...and limits headers
+ # =================
+ AC_CHECK_HEADERS(limits.h sys/limits.h values.h, break)
+ if test `eval echo '${'$as_ac_Header'}'` != yes; then
+ AC_MSG_ERROR([You must have one of limits.h, sys/limits.h or values.h])
+ fi
+
+ # =================
+ # ...and int types headers
+ # =================
+ AC_CHECK_HEADERS(stdint.h inttypes.h, break)
+ if test `eval echo '${'$as_ac_Header'}'` != yes; then
+ AC_MSG_ERROR([You must have stdint.h or inttypes.h on your system])
+ fi
+
+ # ----------------------------------------------------------------------
+ # AC_CHECK_LIB for SVR4 libgen, and use it if it defines pathfind.
+ # ----------------------------------------------------------------------
+ AC_CHECK_LIB(gen, pathfind)
+ AC_CHECK_FUNCS(mmap canonicalize_file_name)
]) # end AC_DEFUN of INVOKE_LIBOPTS_MACROS
dnl @synopsis LIBOPTS_CHECK
dnl
dnl If autoopts-config works, add the linking information to LIBS.
-dnl Otherwise, add ``libopts-23.1.14''
+dnl Otherwise, add \`\`libopts-${ao_rev}''
dnl to SUBDIRS and run all the config tests that the library needs.
dnl
+dnl Default to system libopts
+NEED_LIBOPTS_DIR=''
+
AC_DEFUN([LIBOPTS_CHECK],[
-# Check for standard headers.
-# ----------------------------------------------------------------------
-# =================
-# AC_HEADER_STDC
-# =================
-AC_HEADER_STDC
-# =================
-# AC_HEADER_DIRENT
-# =================
-AC_HEADER_DIRENT
-
-# ----------------------------------------------------------------------
-# AC_CHECK_HEADERS Check for list of headers.
-# ----------------------------------------------------------------------
-AC_CHECK_HEADERS(dlfcn.h errno.h fcntl.h libgen.h memory.h netinet/in.h \
- setjmp.h sys/mman.h sys/param.h sys/poll.h sys/procset.h sys/select.h \
- sys/socket.h sys/stropts.h sys/time.h sys/un.h sys/wait.h unistd.h)
+ AC_ARG_ENABLE([local-libopts],
+ AC_HELP_STRING([--enable-local-libopts],
+ [Force using the supplied libopts tearoff code]),[
+ if test x$enableval = xyes ; then
+ AC_MSG_NOTICE([Using supplied libopts tearoff])
+ LIBOPTS_LDADD='$(top_builddir)/sntp/libopts/libopts.la'
+ LIBOPTS_CFLAGS='-I$(top_srcdir)/sntp/libopts'
+ INVOKE_LIBOPTS_MACROS
+ NEED_LIBOPTS_DIR=true
+ fi])
+
+ if test -z "${NEED_LIBOPTS_DIR}" ; then
+ AC_MSG_CHECKING([whether autoopts-config can be found])
+ AC_ARG_WITH([autoopts-config],
+ AC_HELP_STRING([--with-autoopts-config],
+ [specify the config-info script]),
+ [lo_cv_with_autoopts_config=${with_autoopts_config}],
+ AC_CACHE_CHECK([whether autoopts-config is specified],
+ lo_cv_with_autoopts_config,
+ lo_cv_with_autoopts_config=autoopts-config)
+ ) # end of AC_ARG_WITH
+ AC_CACHE_VAL([lo_cv_test_autoopts],[
+ aoconfig=${lo_cv_with_autoopts_config}
+ lo_cv_test_autoopts=`${aoconfig} --libs` 2> /dev/null
+ if test $? -ne 0 -o -z "${lo_cv_test_autoopts}"
+ then lo_cv_test_autoopts=no ; fi
+ ]) # end of CACHE_VAL
+ AC_MSG_RESULT([${lo_cv_test_autoopts}])
+
+ if test "X${lo_cv_test_autoopts}" != Xno
+ then
+ LIBOPTS_LDADD="${lo_cv_test_autoopts}"
+ LIBOPTS_CFLAGS="`${aoconfig} --cflags`"
+ else
+ LIBOPTS_LDADD='$(top_builddir)/sntp/libopts/libopts.la'
+ LIBOPTS_CFLAGS='-I$(top_srcdir)/sntp/libopts'
+ INVOKE_LIBOPTS_MACROS
+ NEED_LIBOPTS_DIR=true
+ fi
+ fi # end of if test -z "${NEED_LIBOPTS_DIR}"
-# --------------------------------------------
-# Verify certain entries from AC_CHECK_HEADERS
-# --------------------------------------------
-for f in sys_types sys_mman sys_param sys_stat sys_wait \
- string errno stdlib memory setjmp
-do eval as_ac_var=\${ac_cv_header_${f}_h+set}
- test "${as_ac_var}" = set || \
- AC_MSG_ERROR([You must have ${f}.h on your system])
-done
-
-# =================
-# AC_CHECK_HEADERS: stdarg.h is present define HAVE_STDARG_H, otherwise
-# if varargs.h is present define HAVE_VARARGS_H.
-# =================
-AC_CHECK_HEADERS(stdarg.h varargs.h, break)
-if test `eval echo '${'$as_ac_Header'}'` != yes; then
- AC_MSG_ERROR([You must have either stdarg.h or varargs.h on your system])
-fi
-
-# =================
-# Similarly for the string.h and strings.h headers
-# =================
-AC_CHECK_HEADERS(string.h strings.h, break)
-if test `eval echo '${'$as_ac_Header'}'` != yes; then
- AC_MSG_ERROR([You must have either string.h or strings.h on your system])
-fi
-
-# =================
-# ...and limits headers
-# =================
-AC_CHECK_HEADERS(limits.h sys/limits.h values.h, break)
-if test `eval echo '${'$as_ac_Header'}'` != yes; then
- AC_MSG_ERROR([You must have limits.h, sys/limits.h or values.h on your system])
-fi
-
-# =================
-# ...and directory read headers
-# =================
-AC_CHECK_HEADERS(dirent.h ndir.h sys/ndir.h, break)
-
-# ----------------------------------------------------------------------
-# AC_CHECK_LIB for SVR4 libgen, and use it if it defines pathfind.
-# ----------------------------------------------------------------------
-AC_CHECK_LIB(gen, pathfind)
- AC_MSG_CHECKING([whether autoopts-config can be found])
- AC_ARG_WITH([autoopts-config],
- AC_HELP_STRING([--with-autoopts-config],
- [specify the config-info script]),
- [lo_cv_with_autoopts_config=${with_autoopts_config}],
- AC_CACHE_CHECK([whether autoopts-config is specified],
- lo_cv_with_autoopts_config,
- lo_cv_with_autoopts_config=autoopts-config)
- ) # end of AC_ARG_WITH
- AC_CACHE_VAL([lo_cv_test_autoopts],[
- aoconfig=${lo_cv_with_autoopts_config}
- lo_cv_test_autoopts=`${aoconfig} --libs` 2> /dev/null
- if test $? -ne 0 -o -z "$lo_cv_test_autoopts"
- then lo_cv_test_autoopts=no; fi
- ]) # end of CACHE_VAL
- AC_MSG_RESULT([${lo_cv_test_autoopts}])
-
- if test "X${lo_cv_test_autoopts}" != Xno
- then
- LIBOPTS_LDADD="${lo_cv_test_autoopts}"
- LIBOPTS_CFLAGS="`${aoconfig} --cflags`"
- NEED_LIBOPTS_DIR=''
- else
- LIBOPTS_LDADD='$(top_builddir)/libopts/libopts.la'
- LIBOPTS_CFLAGS='-I$(top_srcdir)/libopts'
- INVOKE_LIBOPTS_MACROS
- NEED_LIBOPTS_DIR=true
- fi
AM_CONDITIONAL([NEED_LIBOPTS], [test -n "${NEED_LIBOPTS_DIR}"])
AC_SUBST(LIBOPTS_LDADD)
AC_SUBST(LIBOPTS_CFLAGS)
- AC_CONFIG_FILES([libopts/Makefile])
+ AC_CONFIG_FILES([sntp/libopts/Makefile])
]) # end of AC_DEFUN of LIBOPTS_CHECK
--- /dev/null
+/* -*- Mode: Text -*- */
+
+autogen definitions options;
+
+/*
+ * $Id: opts.def,v 3.34 2004/10/15 01:48:34 bkorb Exp $
+ *
+ * NTP copyright 1970-2004 Someone
+ *
+ * NTP is free software.
+ * You may redistribute it and/or modify it under the terms of the
+ * GNU General Public License, as published by the Free Software
+ * Foundation; either version 2, or (at your option) any later version.
+ *
+ * AutoGen is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with AutoGen. See the file "COPYING". If not,
+ * write to: The Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+copyright = {
+ date = "1970-2004";
+ owner = "ntp.org";
+ eaddr = "http://bugs.ntp.isc.org, bugs@ntp.org";
+ type = bsd;
+};
+
+prog-name = "ntpd";
+prog-title = "NTP daemon program";
+homerc = $HOME, ".";
+long-opts;
+
+#include ntpdbase-opts.def
+
+detail = <<- _END_DETAIL
+ _END_DETAIL;
--- /dev/null
+
+#ifndef __windows__
+rcfile = ".ntprc";
+#else
+rcfile = "ntp.ini";
+#endif
+
+environrc;
+
+version = `
+eval VERSION=\`sed -e 's/.*,\\[//' -e 's/\\].*//' < ../version.m4\`
+[ -z "${VERSION}" ] && echo "Cannot determine VERSION" && kill -TERM $AG_pid
+echo $VERSION`;
+
+test-main;
+
+flag = {
+ name = ipv4;
+ value = 4;
+ equivalence = ipv4;
+ descrip = "Force IPv4 DNS name resolution";
+ doc = <<- _EndOfDoc_
+ Force DNS resolution of following host names on the command line
+ to the IPv4 namespace.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = ipv6;
+ value = 6;
+ equivalence = ipv4;
+ descrip = "Force IPv6 DNS name resolution";
+ doc = <<- _EndOfDoc_
+ Force DNS resolution of following host names on the command line
+ to the IPv6 namespace.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = authreq;
+ value = a;
+ descrip = "Require crypto authentication";
+ flags-cant = authnoreq;
+ doc = <<- _EndOfDoc_
+ Require cryptographic authentication for broadcast client,
+ multicast client and symmetric passive associations.
+ This is the default.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = authnoreq;
+ value = A;
+ descrip = "Do not require crypto authentication";
+ flags-cant = authreq;
+ doc = <<- _EndOfDoc_
+ Do not require cryptographic authentication for broadcast client,
+ multicast client and symmetric passive associations.
+ This is almost never a good idea.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = bcastsync;
+ value = b;
+ descrip = "Allow us to sync to broadcast servers";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+#ifdef SIM
+flag = {
+ name = simbroadcastdelay;
+ value = B;
+ arg-type = string;
+ descrip = "Simulator broadcast delay";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+#endif
+
+flag = {
+ name = configfile;
+ value = c;
+ arg-type = string;
+ descrip = "configuration file name";
+ doc = <<- _EndOfDoc_
+ The name and path of the configuration file,
+ /etc/ntp.conf
+ by default.
+ _EndOfDoc_;
+};
+
+#ifdef SIM
+flag = {
+ name = phasenoise;
+ value = C;
+ arg-type = string;
+ descrip = "Phase noise level";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+#endif
+
+flag = {
+ name = debug-level;
+ value = d;
+ max = NOLIMIT;
+ descrip = "Increase output debug message level";
+ doc = <<- _EndOfDoc_
+ Increase the debugging message output level. Can be supplied multiple times.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = set-debug-level;
+ value = D;
+ max = NOLIMIT;
+ descrip = "Set the output debug message level";
+ arg-type = string;
+ flag-code = <<- _EOS_
+ DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );
+ _EOS_;
+ doc = <<- _EndOfDoc_
+ Set the output debugging level. Can be supplied multiple times,
+ but each overrides the previous value(s).
+ _EndOfDoc_;
+};
+
+flag = {
+ name = driftfile;
+ value = f;
+ arg-type = string;
+ descrip = "frequency drift file name";
+ doc = <<- _EndOfDoc_
+ The name and path of the frequency file,
+ /etc/ntp.drift
+ by default.
+ This is the same operation as the
+ driftfile driftfile
+ configuration specification in the
+ /etc/ntp.conf
+ file.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = panicgate;
+ value = g;
+ descrip = "Allow the first adjustment to be Big";
+ doc = <<- _EndOfDoc_
+ Normally,
+ ntpd
+ exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that,
+ ntpd
+ will exit with a message to the system log. This option can be used with the
+ -q
+ and
+ -x
+ options.
+ See the
+ tinker
+ configuration file directive for other options.
+ _EndOfDoc_;
+};
+
+#ifdef SIM
+flag = {
+ name = simslew;
+ value = H;
+ arg-type = string;
+ descrip = "Simuator slew";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+#endif
+
+flag = {
+ name = jaildir;
+ value = i;
+ arg-type = string;
+ descrip = "Jail directory";
+ doc = <<- _EndOfDoc_
+ Chroot the server to the directory
+ jaildir
+ .
+ This option also implies that the server attempts to drop root privileges at startup (otherwise, chroot gives very little additional security), and it is only available if the OS supports to run the server without full root privileges.
+ You may need to also specify a
+ -u
+ option.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = interface;
+ value = I;
+ arg-type = string;
+ descrip = "Listen on interface";
+ max = NOLIMIT;
+ arg-name = iface;
+ stack-arg;
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+flag = {
+ name = keyfile;
+ value = k;
+ arg-type = string;
+ descrip = "path to symmetric keys";
+ doc = <<- _EndOfDoc_
+ Specify the name and path of the symmetric key file.
+ /etc/ntp.keys
+ is the default.
+ This is the same operation as the
+ keys keyfile
+ configuration file directive.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = logfile;
+ value = l;
+ arg-type = string;
+ descrip = "path to the log file";
+ doc = <<- _EndOfDoc_
+ Specify the name and path of the log file.
+ The default is the system log file.
+ This is the same operation as the
+ logfile logfile
+ configuration file directive.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = novirtualips;
+ value = L;
+ descrip = "Do not listen to virtual IPs";
+ doc = <<- _EndOfDoc_
+ Do not listen to virtual IPs. The default is to listen.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = nofork;
+ value = n;
+ descrip = "Do not fork";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+flag = {
+ name = nice;
+ value = N;
+ descrip = "Run at high priority";
+ doc = <<- _EndOfDoc_
+ To the extent permitted by the operating system, run
+ ntpd
+ at the highest priority.
+ _EndOfDoc_;
+};
+
+#ifdef SIM
+flag = {
+ name = servertime;
+ value = O;
+ arg-type = string;
+ descrip = "Server time";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+#endif
+
+flag = {
+ name = pidfile;
+ value = p;
+ arg-type = string;
+ descrip = "path to the PID file";
+ doc = <<- _EndOfDoc_
+ Specify the name and path of the file used to record
+ ntpd's
+ process ID.
+ This is the same operation as the
+ pidfile pidfile
+ configuration file directive.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = priority;
+ value = P;
+ arg-type = number;
+ descrip = "Process priority";
+ doc = <<- _EndOfDoc_
+ To the extent permitted by the operating system, run
+ ntpd
+ at the specified
+ sched_setscheduler(SCHED_FIFO)
+ priority.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = quit;
+ value = q;
+ descrip = "Set the time and quit";
+ doc = <<- _EndOfDoc_
+ ntpd
+ will exit just after the first time the clock is set. This behavior mimics that of the
+ ntpdate
+ program, which is to be retired.
+ The
+ -g
+ and
+ -x
+ options can be used with this option.
+ Note: The kernel time discipline is disabled with this option.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = propagationdelay;
+ value = r;
+ arg-type = string;
+ descrip = "Broadcast/propagation delay";
+ doc = <<- _EndOfDoc_
+ Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = statsdir;
+ value = s;
+ arg-type = string;
+ descrip = "Statistics file location";
+ doc = <<- _EndOfDoc_
+ Specify the directory path for files created by the statistics facility.
+ This is the same operation as the
+ statsdir statsdir
+ configuration file directive.
+ _EndOfDoc_;
+};
+
+#ifdef SIM
+flag = {
+ name = endsimtime;
+ value = S;
+ arg-type = string;
+ descrip = "Simulation end time";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+#endif
+
+flag = {
+ name = trustedkey;
+ value = t;
+ arg-type = string;
+ descrip = "Trusted key number";
+ max = NOLIMIT;
+ arg-name = tkey;
+ stack-arg;
+ doc = <<- _EndOfDoc_
+ Add a key number to the trusted key list.
+ _EndOfDoc_;
+};
+
+#ifdef SIM
+flag = {
+ name = freqerr;
+ value = T;
+ arg-type = string;
+ descrip = "Simulation frequency error";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+#endif
+
+#ifdef SIM
+flag = {
+ name = walknoise;
+ value = W;
+ arg-type = string;
+ descrip = "Simulation random walk noise";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+#endif
+
+flag = {
+ name = user;
+ value = u;
+ arg-type = string;
+ descrip = "Run as userid (or userid:groupid)";
+ doc = <<- _EndOfDoc_
+ Specify a user, and optionally a group, to switch to.
+ This option is only available if the OS supports to run the server without full root privileges.
+ Currently, this option is supported under NetBSD (configure with
+ --enable-clockctl
+ ) and Linux (configure with
+ --enable-linuxcaps
+ ).
+ _EndOfDoc_;
+};
+
+flag = {
+ name = var;
+ value = v;
+ arg-type = string;
+ descrip = "make ARG an ntp variable (RW)";
+ max = NOLIMIT;
+ arg-name = nvar;
+ stack-arg;
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+flag = {
+ name = dvar;
+ value = V;
+ arg-type = string;
+ descrip = "make ARG an ntp variable (RW|DEF)";
+ max = NOLIMIT;
+ arg-name = ndvar;
+ stack-arg;
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+flag = {
+ name = slew;
+ value = x;
+ arg-type = string;
+ descrip = "Slew up to 600 seconds";
+ doc = <<- _EndOfDoc_
+ Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold.
+ This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually.
+ Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s.
+ Thus, an adjustment as much as 600 s will take almost 14 days to complete.
+ This option can be used with the
+ -g
+ and
+ -q
+ options.
+ See the
+ tinker
+ configuration file directive for other options.
+ Note: The kernel time discipline is disabled with this option.
+ _EndOfDoc_;
+};
+
+#ifdef SIM
+flag = {
+ name = ndelay;
+ value = Y;
+ arg-type = string;
+ descrip = "Simulation network delay";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+#endif
+
+#ifdef SIM
+flag = {
+ name = pdelay;
+ value = Z;
+ arg-type = string;
+ descrip = "Simulation processing delay";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+#endif
--- /dev/null
+/* -*- Mode: Text -*- */
+
+autogen definitions options;
+
+/*
+ * $Id: opts.def,v 3.34 2004/10/15 01:48:34 bkorb Exp $
+ *
+ * NTP copyright 1970-2004 Someone
+ *
+ * NTP is free software.
+ * You may redistribute it and/or modify it under the terms of the
+ * GNU General Public License, as published by the Free Software
+ * Foundation; either version 2, or (at your option) any later version.
+ *
+ * AutoGen is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with AutoGen. See the file "COPYING". If not,
+ * write to: The Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+copyright = {
+ date = "1970-2004";
+ owner = "ntp.org";
+ eaddr = "http://bugs.ntp.isc.org, bugs@ntp.org";
+ type = bsd;
+};
+
+prog-name = "ntpdsim";
+prog-title = "NTP daemon simulation program";
+homerc = $HOME, ".";
+long-opts;
+
+#define SIM
+#include ntpdbase-opts.def
+
+detail = <<- _END_DETAIL
+ _END_DETAIL;
--- /dev/null
+dnl -*- buffer-read-only: t -*- vi: set ro:
+dnl
+dnl DO NOT EDIT THIS FILE (libopts.m4)
+dnl
+dnl It has been AutoGen-ed Thursday July 28, 2005 at 04:18:42 PM PDT
+dnl From the definitions libopts.def
+dnl and the template file conftest.tpl
+dnl
+dnl @synopsis INVOKE_LIBOPTS_MACROS
+dnl
+dnl This macro will invoke the AutoConf macros specified in libopts.def
+dnl that have not been disabled with "omit-invocation".
+dnl
+AC_DEFUN([LIBOPTS_WITH_REGEX_HEADER],[
+ AC_ARG_WITH([regex-header],
+ AC_HELP_STRING([--with-regex-header], [a reg expr header is specified]),
+ [libopts_cv_with_regex_header=${with_regex_header}],
+ AC_CACHE_CHECK([whether a reg expr header is specified], libopts_cv_with_regex_header,
+ libopts_cv_with_regex_header=no)
+ ) # end of AC_ARG_WITH
+
+ if test "X${libopts_cv_with_regex_header}" != Xno
+ then
+ AC_DEFINE_UNQUOTED([REGEX_HEADER],[<${libopts_cv_with_regex_header}>])
+ else
+ AC_DEFINE([REGEX_HEADER],[<regex.h>],[name of regex header file])
+ fi
+
+]) # end of AC_DEFUN of LIBOPTS_WITH_REGEX_HEADER
+
+
+AC_DEFUN([LIBOPTS_WITHLIB_REGEX],[
+ AC_ARG_WITH([libregex],
+ AC_HELP_STRING([--with-libregex], [libregex installation prefix]),
+ [libopts_cv_with_libregex_root=${with_libregex}],
+ AC_CACHE_CHECK([whether with-libregex was specified], libopts_cv_with_libregex_root,
+ libopts_cv_with_libregex_root=no)
+ ) # end of AC_ARG_WITH libregex
+
+ if test "${with_libguile+set}" = set && \
+ test "${withval}" = no
+ then ## disabled by request
+ libopts_cv_with_libregex_root=no
+ libopts_cv_with_libregex_cflags=no
+ libopts_cv_with_libregex_libs=no
+ else
+
+ AC_ARG_WITH([libregex-cflags],
+ AC_HELP_STRING([--with-libregex-cflags], [libregex compile flags]),
+ [libopts_cv_with_libregex_cflags=${with_regex_cflags}],
+ AC_CACHE_CHECK([whether with-libregex-cflags was specified], libopts_cv_with_libregex_cflags,
+ libopts_cv_with_libregex_cflags=no)
+ ) # end of AC_ARG_WITH libregex-cflags
+
+ AC_ARG_WITH([libregex-libs],
+ AC_HELP_STRING([--with-libregex-libs], [libregex link command arguments]),
+ [libopts_cv_with_libregex_libs=${with_regex_libs}],
+ AC_CACHE_CHECK([whether with-libregex-libs was specified], libopts_cv_with_libregex_libs,
+ libopts_cv_with_libregex_libs=no)
+ ) # end of AC_ARG_WITH libregex-libs
+
+ case "X${libopts_cv_with_libregex_cflags}" in
+ Xyes|Xno|X )
+ case "X${libopts_cv_with_libregex_root}" in
+ Xyes|Xno|X ) libopts_cv_with_libregex_cflags=no ;;
+ * ) libopts_cv_with_libregex_cflags=-I${libopts_cv_with_libregex_root}/include ;;
+ esac
+ esac
+ case "X${libopts_cv_with_libregex_libs}" in
+ Xyes|Xno|X )
+ case "X${libopts_cv_with_libregex_root}" in
+ Xyes|Xno|X ) libopts_cv_with_libregex_libs=no ;;
+ * ) libopts_cv_with_libregex_libs="-L${libopts_cv_with_libregex_root}/lib -lregex";;
+ esac
+ esac
+ libopts_save_CPPFLAGS="${CPPFLAGS}"
+ libopts_save_LIBS="${LIBS}"
+ fi ## disabled by request
+
+ case "X${libopts_cv_with_libregex_cflags}" in
+ Xyes|Xno|X )
+ libopts_cv_with_libregex_cflags="" ;;
+ * ) CPPFLAGS="${CPPFLAGS} ${libopts_cv_with_libregex_cflags}" ;;
+ esac
+ case "X${libopts_cv_with_libregex_libs}" in
+ Xyes|Xno|X )
+ libopts_cv_with_libregex_libs="" ;;
+ * )
+ LIBS="${LIBS} ${libopts_cv_with_libregex_libs}" ;;
+ esac
+ LIBREGEX_CFLAGS=""
+ LIBREGEX_LIBS=""
+ AC_MSG_CHECKING([whether libregex functions properly])
+ AC_CACHE_VAL([libopts_cv_with_libregex],[
+ AC_TRY_RUN([@%:@include <stdio.h>
+@%:@include <stdlib.h>
+@%:@include <sys/types.h>
+@%:@include REGEX_HEADER
+static regex_t re;
+void comp_re( const char* pzPat ) {
+ int res = regcomp( &re, pzPat, REG_EXTENDED|REG_ICASE|REG_NEWLINE );
+ if (res == 0) return;
+ exit( res ); }
+int main() {
+ regmatch_t m@<:@2@:>@;
+ comp_re( "^.*\@S|@" );
+ comp_re( "()|no.*" );
+ comp_re( "." );
+ if (regexec( &re, "X", 2, m, 0 ) != 0) return 1;
+ if ((m@<:@0@:>@.rm_so != 0) || (m@<:@0@:>@.rm_eo != 1)) {
+ fputs( "error: regex -->.<-- did not match\n", stderr );
+ return 1;
+ }
+ return 0; }],
+ [libopts_cv_with_libregex=yes], [libopts_cv_with_libregex=no],
+ [libopts_cv_with_libregex=no]) # end of AC_TRY_RUN
+ ]) # end of AC_CACHE_VAL for libopts_cv_with_libregex
+ AC_MSG_RESULT([${libopts_cv_with_libregex}])
+
+ if test "X${libopts_cv_with_libregex}" = Xno
+ then
+ CPPFLAGS="${libopts_save_CPPFLAGS}"
+ LIBS="${libopts_save_LIBS}"
+ cat >&2 <<'_EOF_'
+I cannot detect POSIX compliant regcomp/regexec routines.
+These are required for AutoGen to work correctly. If you have
+such a library present on your system, you must specify it by
+setting the LIBS environment variable, e.g., "LIBS='-lregex'".
+If you do not have such a library on your system, then you should
+download and install, for example, the one from:
+ ftp://ftp.gnu.org/gnu/rx/
+_EOF_
+AC_MSG_ERROR([Cannot find working POSIX regex library])
+ fi
+
+]) # end of AC_DEFUN of LIBOPTS_WITHLIB_REGEX
+
+
+AC_DEFUN([LIBOPTS_RUN_PATHFIND],[
+ AC_MSG_CHECKING([whether pathfind(3) works])
+ AC_CACHE_VAL([libopts_cv_run_pathfind],[
+ AC_TRY_RUN([@%:@include <string.h>
+@%:@include <stdlib.h>
+int main (int argc, char** argv) {
+ char* pz = pathfind( getenv( "PATH" ), "sh", "x" );
+ return (pz == 0) ? 1 : 0;
+}],
+ [libopts_cv_run_pathfind=yes],[libopts_cv_run_pathfind=no],[libopts_cv_run_pathfind=no]
+ ) # end of TRY_RUN
+ ]) # end of AC_CACHE_VAL for libopts_cv_run_pathfind
+ AC_MSG_RESULT([${libopts_cv_run_pathfind}])
+
+ if test "X${libopts_cv_run_pathfind}" != Xno
+ then
+ AC_DEFINE([HAVE_PATHFIND],[1],
+ [Define this if pathfind(3) works])
+ fi
+
+]) # end of AC_DEFUN of LIBOPTS_RUN_PATHFIND
+
+
+AC_DEFUN([LIBOPTS_RUN_REALPATH],[
+ AC_MSG_CHECKING([whether we have a functional realpath(3C)])
+ AC_CACHE_VAL([libopts_cv_run_realpath],[
+ AC_TRY_RUN([@%:@include <limits.h>
+@%:@include <stdlib.h>
+int main (int argc, char** argv) {
+@%:@ifndef PATH_MAX
+choke me!!
+@%:@else
+ char zPath@<:@PATH_MAX+1@:>@;
+@%:@endif
+ char *pz = realpath(argv@<:@0@:>@, zPath);
+ return (pz == zPath) ? 0 : 1;
+}],
+ [libopts_cv_run_realpath=yes],[libopts_cv_run_realpath=no],[libopts_cv_run_realpath=no]
+ ) # end of TRY_RUN
+ ]) # end of AC_CACHE_VAL for libopts_cv_run_realpath
+ AC_MSG_RESULT([${libopts_cv_run_realpath}])
+
+ if test "X${libopts_cv_run_realpath}" != Xno
+ then
+ AC_DEFINE([HAVE_REALPATH],[1],
+ [Define this if we have a functional realpath(3C)])
+ fi
+
+]) # end of AC_DEFUN of LIBOPTS_RUN_REALPATH
+
+
+AC_DEFUN([LIBOPTS_RUN_STRFTIME],[
+ AC_MSG_CHECKING([whether strftime() works])
+ AC_CACHE_VAL([libopts_cv_run_strftime],[
+ AC_TRY_RUN([@%:@include <time.h>
+@%:@include <string.h>
+char t_buf@<:@ 64 @:>@;
+int main() {
+ static const char z@<:@@:>@ = "Thursday Aug 28 240";
+ struct tm tm;
+ tm.tm_sec = 36; /* seconds after the minute @<:@0, 61@:>@ */
+ tm.tm_min = 44; /* minutes after the hour @<:@0, 59@:>@ */
+ tm.tm_hour = 12; /* hour since midnight @<:@0, 23@:>@ */
+ tm.tm_mday = 28; /* day of the month @<:@1, 31@:>@ */
+ tm.tm_mon = 7; /* months since January @<:@0, 11@:>@ */
+ tm.tm_year = 86; /* years since 1900 */
+ tm.tm_wday = 4; /* days since Sunday @<:@0, 6@:>@ */
+ tm.tm_yday = 239; /* days since January 1 @<:@0, 365@:>@ */
+ tm.tm_isdst = 1; /* flag for daylight savings time */
+ strftime( t_buf, sizeof( t_buf ), "%A %b %d %j", &tm );
+ return (strcmp( t_buf, z ) != 0); }],
+ [libopts_cv_run_strftime=yes],[libopts_cv_run_strftime=no],[libopts_cv_run_strftime=no]
+ ) # end of TRY_RUN
+ ]) # end of AC_CACHE_VAL for libopts_cv_run_strftime
+ AC_MSG_RESULT([${libopts_cv_run_strftime}])
+
+ if test "X${libopts_cv_run_strftime}" != Xno
+ then
+ AC_DEFINE([HAVE_STRFTIME],[1],
+ [Define this if strftime() works])
+ fi
+
+]) # end of AC_DEFUN of LIBOPTS_RUN_STRFTIME
+
+
+AC_DEFUN([LIBOPTS_RUN_FOPEN_BINARY],[
+ AC_MSG_CHECKING([whether fopen accepts "b" mode])
+ AC_CACHE_VAL([libopts_cv_run_fopen_binary],[
+ AC_TRY_RUN([@%:@include <stdio.h>
+int main (int argc, char** argv) {
+FILE* fp = fopen("conftest.@S|@ac_ext", "rb");
+return (fp == NULL) ? 1 : fclose(fp); }],
+ [libopts_cv_run_fopen_binary=yes],[libopts_cv_run_fopen_binary=no],[libopts_cv_run_fopen_binary=no]
+ ) # end of TRY_RUN
+ ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_binary
+ AC_MSG_RESULT([${libopts_cv_run_fopen_binary}])
+
+ if test "X${libopts_cv_run_fopen_binary}" != Xno
+ then
+ AC_DEFINE([FOPEN_BINARY_FLAG],"b",
+ [fopen(3) accepts a 'b' in the mode flag])
+ else
+ AC_DEFINE([FOPEN_BINARY_FLAG],"",
+ [fopen(3) accepts a 'b' in the mode flag])
+ fi
+
+]) # end of AC_DEFUN of LIBOPTS_RUN_FOPEN_BINARY
+
+
+AC_DEFUN([LIBOPTS_RUN_FOPEN_TEXT],[
+ AC_MSG_CHECKING([whether fopen accepts "t" mode])
+ AC_CACHE_VAL([libopts_cv_run_fopen_text],[
+ AC_TRY_RUN([@%:@include <stdio.h>
+int main (int argc, char** argv) {
+FILE* fp = fopen("conftest.@S|@ac_ext", "rt");
+return (fp == NULL) ? 1 : fclose(fp); }],
+ [libopts_cv_run_fopen_text=yes],[libopts_cv_run_fopen_text=no],[libopts_cv_run_fopen_text=no]
+ ) # end of TRY_RUN
+ ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_text
+ AC_MSG_RESULT([${libopts_cv_run_fopen_text}])
+
+ if test "X${libopts_cv_run_fopen_text}" != Xno
+ then
+ AC_DEFINE([FOPEN_TEXT_FLAG],"t",
+ [fopen(3) accepts a 't' in the mode flag])
+ else
+ AC_DEFINE([FOPEN_TEXT_FLAG],"",
+ [fopen(3) accepts a 't' in the mode flag])
+ fi
+
+]) # end of AC_DEFUN of LIBOPTS_RUN_FOPEN_TEXT
+
+
+AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
+ # Check to see if a reg expr header is specified.
+ LIBOPTS_WITH_REGEX_HEADER
+
+ # Check to see if a working libregex can be found.
+ LIBOPTS_WITHLIB_REGEX
+
+ # Check to see if pathfind(3) works.
+ LIBOPTS_RUN_PATHFIND
+
+ # Check to see if we have a functional realpath(3C).
+ LIBOPTS_RUN_REALPATH
+
+ # Check to see if strftime() works.
+ LIBOPTS_RUN_STRFTIME
+
+ # Check to see if fopen accepts "b" mode.
+ LIBOPTS_RUN_FOPEN_BINARY
+
+ # Check to see if fopen accepts "t" mode.
+ LIBOPTS_RUN_FOPEN_TEXT
+
+ # ----------------------------------------------------------------------
+ # Check for standard headers.
+ # ----------------------------------------------------------------------
+ # =================
+ # AC_HEADER_STDC
+ # =================
+ AC_HEADER_STDC
+ # =================
+ # AC_HEADER_DIRENT
+ # =================
+ AC_HEADER_DIRENT
+
+ # ----------------------------------------------------------------------
+ # AC_CHECK_HEADERS Check for list of headers.
+ # ----------------------------------------------------------------------
+ AC_CHECK_HEADERS(dlfcn.h errno.h fcntl.h libgen.h memory.h netinet/in.h \
+ setjmp.h sys/mman.h sys/param.h sys/poll.h sys/procset.h sys/select.h \
+ sys/socket.h sys/stropts.h sys/time.h sys/un.h sys/wait.h unistd.h)
+
+ # --------------------------------------------
+ # Verify certain entries from AC_CHECK_HEADERS
+ # --------------------------------------------
+ for f in sys_types sys_mman sys_param sys_stat sys_wait \
+ string errno stdlib memory setjmp
+ do eval as_ac_var=\${ac_cv_header_${f}_h+set}
+ test "${as_ac_var}" = set || \
+ AC_MSG_ERROR([You must have ${f}.h on your system])
+ done
+
+ # =================
+ # AC_CHECK_HEADERS: stdarg.h is present define HAVE_STDARG_H, otherwise
+ # if varargs.h is present define HAVE_VARARGS_H.
+ # =================
+ AC_CHECK_HEADERS(stdarg.h varargs.h, break)
+ if test `eval echo '${'$as_ac_Header'}'` != yes; then
+ AC_MSG_ERROR([You must have stdarg.h or varargs.h on your system])
+ fi
+
+ # =================
+ # Similarly for the string.h and strings.h headers
+ # =================
+ AC_CHECK_HEADERS(string.h strings.h, break)
+ if test `eval echo '${'$as_ac_Header'}'` != yes; then
+ AC_MSG_ERROR([You must have string.h or strings.h on your system])
+ fi
+
+ # =================
+ # ...and limits headers
+ # =================
+ AC_CHECK_HEADERS(limits.h sys/limits.h values.h, break)
+ if test `eval echo '${'$as_ac_Header'}'` != yes; then
+ AC_MSG_ERROR([You must have one of limits.h, sys/limits.h or values.h])
+ fi
+
+ # =================
+ # ...and int types headers
+ # =================
+ AC_CHECK_HEADERS(stdint.h inttypes.h, break)
+ if test `eval echo '${'$as_ac_Header'}'` != yes; then
+ AC_MSG_ERROR([You must have stdint.h or inttypes.h on your system])
+ fi
+
+ # ----------------------------------------------------------------------
+ # AC_CHECK_LIB for SVR4 libgen, and use it if it defines pathfind.
+ # ----------------------------------------------------------------------
+ AC_CHECK_LIB(gen, pathfind)
+ AC_CHECK_FUNCS(mmap canonicalize_file_name)
+]) # end AC_DEFUN of INVOKE_LIBOPTS_MACROS
+
+dnl @synopsis LIBOPTS_CHECK
+dnl
+dnl If autoopts-config works, add the linking information to LIBS.
+dnl Otherwise, add \`\`libopts-${ao_rev}''
+dnl to SUBDIRS and run all the config tests that the library needs.
+dnl
+dnl Default to system libopts
+NEED_LIBOPTS_DIR=''
+
+AC_DEFUN([LIBOPTS_CHECK],[
+ AC_ARG_ENABLE([local-libopts],
+ AC_HELP_STRING([--enable-local-libopts],
+ [Force using the supplied libopts tearoff code]),[
+ if test x$enableval = xyes ; then
+ AC_MSG_NOTICE([Using supplied libopts tearoff])
+ LIBOPTS_LDADD='$(top_builddir)/libopts/libopts.la'
+ LIBOPTS_CFLAGS='-I$(top_srcdir)/libopts'
+ INVOKE_LIBOPTS_MACROS
+ NEED_LIBOPTS_DIR=true
+ fi])
+
+ if test -z "${NEED_LIBOPTS_DIR}" ; then
+ AC_MSG_CHECKING([whether autoopts-config can be found])
+ AC_ARG_WITH([autoopts-config],
+ AC_HELP_STRING([--with-autoopts-config],
+ [specify the config-info script]),
+ [lo_cv_with_autoopts_config=${with_autoopts_config}],
+ AC_CACHE_CHECK([whether autoopts-config is specified],
+ lo_cv_with_autoopts_config,
+ lo_cv_with_autoopts_config=autoopts-config)
+ ) # end of AC_ARG_WITH
+ AC_CACHE_VAL([lo_cv_test_autoopts],[
+ aoconfig=${lo_cv_with_autoopts_config}
+ lo_cv_test_autoopts=`${aoconfig} --libs` 2> /dev/null
+ if test $? -ne 0 -o -z "${lo_cv_test_autoopts}"
+ then lo_cv_test_autoopts=no ; fi
+ ]) # end of CACHE_VAL
+ AC_MSG_RESULT([${lo_cv_test_autoopts}])
+
+ if test "X${lo_cv_test_autoopts}" != Xno
+ then
+ LIBOPTS_LDADD="${lo_cv_test_autoopts}"
+ LIBOPTS_CFLAGS="`${aoconfig} --cflags`"
+ else
+ LIBOPTS_LDADD='$(top_builddir)/libopts/libopts.la'
+ LIBOPTS_CFLAGS='-I$(top_srcdir)/libopts'
+ INVOKE_LIBOPTS_MACROS
+ NEED_LIBOPTS_DIR=true
+ fi
+ fi # end of if test -z "${NEED_LIBOPTS_DIR}"
+
+ AM_CONDITIONAL([NEED_LIBOPTS], [test -n "${NEED_LIBOPTS_DIR}"])
+ AC_SUBST(LIBOPTS_LDADD)
+ AC_SUBST(LIBOPTS_CFLAGS)
+ AC_CONFIG_FILES([libopts/Makefile])
+]) # end of AC_DEFUN of LIBOPTS_CHECK
--- /dev/null
+/* -*- Mode: Text -*- */
+
+autogen definitions options;
+
+/*
+ * $Id: opts.def,v 3.34 2004/10/15 01:48:34 bkorb Exp $
+ *
+ * NTP copyright 1970-2004 Someone
+ *
+ * NTP is free software.
+ * You may redistribute it and/or modify it under the terms of the
+ * GNU General Public License, as published by the Free Software
+ * Foundation; either version 2, or (at your option) any later version.
+ *
+ * AutoGen is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with AutoGen. See the file "COPYING". If not,
+ * write to: The Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+copyright = {
+ date = "1970-2005";
+ owner = "ntp.org";
+ eaddr = "http://bugs.ntp.isc.org, bugs@ntp.org";
+ type = bsd;
+};
+
+
+prog-name = "sntp";
+prog-title = "standard SNTP program";
+homerc = $HOME, ".";
+long-opts;
+
+#ifndef __windows__
+rcfile = ".ntprc";
+#else
+rcfile = "ntp.ini";
+#endif
+
+environrc;
+
+version = `
+eval VERSION=\`sed -e 's/.*,\\[//' -e 's/\\].*//' < ../version.m4\`
+[ -z "${VERSION}" ] && echo "Cannot determine VERSION" && kill -TERM $AG_pid
+echo $VERSION`;
+
+test-main;
+
+flag = {
+ name = ipv4;
+ value = 4;
+ equivalence = ipv4;
+ descrip = "Force IPv4 DNS name resolution";
+ doc = <<- _EndOfDoc_
+ Force DNS resolution of following host names on the command line
+ to the IPv4 namespace.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = ipv6;
+ value = 6;
+ equivalence = ipv4;
+ descrip = "Force IPv6 DNS name resolution";
+ doc = <<- _EndOfDoc_
+ Force DNS resolution of following host names on the command line
+ to the IPv6 namespace.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = normalverbose;
+ value = v;
+ flags-cant = extraverbose, megaverbose;
+ descrip = "Slightly verbose";
+ doc = <<- _EndOfDoc_
+ Diagnostic messages for non-fatal errors and a limited amount of
+ tracing should be written to standard error. Fatal ones always
+ produce a diagnostic. This option should be set when there is a
+ suspected problem with the server, network or the source.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = extraverbose;
+ value = V;
+ flags-cant = normalverbose, megaverbose;
+ descrip = "Extra verbose";
+ doc = <<- _EndOfDoc_
+ Produce more and less comprehensible output, mainly for investigating
+ problems with apparently inconsistent timestamps. This option should
+ be set when the program fails with a message indicating that is the
+ trouble.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = megaverbose;
+ value = W;
+ flags-cant = normalverbose, extraverbose;
+ descrip = "Mega verbose";
+ doc = <<- _EndOfDoc_
+ Very verbose debugging output that will interfere with the timing
+ when writing to the terminal (because of line buffered output from C).
+ Note that the times produced by this are the corrections needed, and
+ not the error in the local clock. This option should be set only when
+ debugging the source.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = settimeofday;
+ value = r;
+ flags-cant = adjtime;
+ descrip = "Set (step) the time with settimeofday()";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+flag = {
+ name = adjtime;
+ value = a;
+ flags-cant = settimeofday;
+ descrip = "Set (slew) the time with adjtime()";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+detail = <<- _END_DETAIL
+.I sntp
+can be used as a SNTP client to query a NTP or SNTP server and either display
+the time or set the local system's time (given suitable privilege). It can be
+run as an interactive command, in a
+.I cron
+job or as a daemon. It can be run as a daemon to provide a SNTP server for
+other clients. NTP is the Network Time Protocol (RFC 1305) and SNTP is the
+Simple Network Time Protocol (RFC 2030, which supersedes RFC 1769).
+.SS Options
+.PP
+.I sntp
+recognizes the following options:
+.TP
+.B \-v
+indicates that diagnostic messages for non-fatal errors and a limited amount of
+tracing should be written to standard error. Fatal ones always produce a
+diagnostic. This option should be set when there is a suspected problem with
+the server, network or the source.
+.TP
+.B \-V
+requests more and less comprehensible output, mainly for investigating problems
+with apparently inconsistent timestamps. This option should be set when the
+program fails with a message indicating that is the trouble.
+.TP
+.B \-W
+requests very verbose debugging output, and will interfere with the timing
+when writing to the terminal (because of line buffered output from C). Note
+that the times produced by this are the corrections needed, and not the error
+in the local clock. This option should be set only when debugging the source.
+.TP
+.B \-q
+indicates that it should query a daemon save file being maintained by it.
+This needs no privilege and will change neither the save file nor the clock.
+.PP
+The default is that it should behave as a client, and the following options
+are then relevant:
+.TP
+.B \-r
+indicates that the system clock should be reset by
+.IR settimeofday .
+Naturally, this will work only if the user has enough privilege.
+.TP
+.B \-a
+indicates that the system clock should be reset by
+.IR adjtime .
+Naturally, this will work only if the user has enough privilege.
+.PP
+The default is to write the estimated correct local date and time (i.e. not
+UTC) to the standard output in a format like
+.BR "'1996 Oct 15 20:17:25.123 + 4.567 +/- 0.089 secs'" ,
+where the
+.B "'+ 4.567 +/- 0.089 secs'"
+indicates the estimated error in the time on the local system. In daemon mode,
+it will add drift information in a format like
+.BR "' + 1.3 +/- 0.1 ppm'" ,
+and display this at roughly
+.I separation
+intervals (see under the
+.B \-x
+option for details).
+.TP
+.BI \-l " lockfile"
+sets the name of the lock file to ensure that there is only
+one copy of
+.I sntp
+running at once. The default is installation-dependent, but will usually be
+.IR /etc/sntp.pid .
+.TP
+.BI \-e " minerr"
+sets the maximum ignorable variation between the clocks to
+.IR minerr .
+Acceptable values are from 0.001 to 1, and the default is 0.1 if a NTP host is
+is specified and 0.5 otherwise.
+.TP
+.BI \-E " maxerr"
+sets the maximum value of various delays that are deemed acceptable to
+.IR maxerr .
+Acceptable values are from 1 to 60, and the default is 5. It should sometimes
+be increased if there are problems with the network, NTP server or system
+clock, but take care.
+.TP
+.BI \-P " prompt"
+sets the maximum clock change that will be made automatically to
+.IR maxerr .
+Acceptable values are from 1 to 3600 or
+.IR no ,
+and the default is 30. If the program is being run interactively in ordinary
+client mode, and the system clock is to be changed, larger corrections will
+prompt the user for confirmation. Specifying
+.I no
+will disable this and the correction will be made regardless.
+.TP
+.BI \-c " count"
+sets the maximum number of NTP packets required to
+.IR count .
+Acceptable values are from 1 to 25 if a NTP host is specified and from 5 to 25
+otherwise, and the default is 5. If the maximum isn't enough, the system needs
+a better consistency algorithm than this program uses.
+.TP
+.BI \-d " delay"
+sets a rough limit on the total running time to
+.I delay
+seconds. Acceptable values are from 1 to 3600, and the default is 15 if a NTP
+host is specified and 300 otherwise.
+.TP
+.BI \-x " separation"
+causes the program to run as a daemon (i.e. forever), and to estimate and
+correct for the clock drift.
+.I separation
+sets the minimum time between calls to the server in minutes if a NTP host is
+specified, and between broadcast packets if not. Acceptable values are from 1
+to 1440 (a day), and the default (if
+.B \-x
+is specified but
+.I separation
+is omitted) is 300.
+.TP
+.BI \-f " savefile"
+may be used with the
+.B \-x
+option to store a record of previous packets, which speeds up recalculating
+the drift after
+.I sntp
+has to be restarted (e.g. because of network or server outages). In order to
+restart the data,
+.I sntp
+must be restarted reasonably soon after it died (within a few times the value of
+.IR separation ),
+with the same value of the
+.B \-c
+option, the same value of
+.IR separation ,
+in the same mode (i.e. broadcast or client), though the NTP servers need not
+be the same for client mode, and with compatible values of other settings.
+Note that the file will be created with the default ownerships and permissions,
+using standard C facilities. The default is installation-dependent, but will
+usually be
+.IR /etc/sntp.state .
+.TP
+.B -4
+force IPv4 DNS resolution.
+.TP
+.B -6
+force IPv6 DNS resolution.
+.PP
+.B address(es)
+are the DNS names or IP numbers of hosts to use for the challenge and response
+protocol; if no names are given, the program waits for broadcasts. Polling a
+server is vastly more reliable than listening to broadcasts. Note that a
+single component numeric address is not allowed, to avoid ambiguities. If
+more than one name is give, they will be used in a round-robin fashion.
+.PP
+Constraints:
+.IP
+.B minerr
+must be less than
+.B maxerr
+which must be less than
+.B delay
+(or, if a NTP host is not specified
+.BR delay / count "),"
+and
+.B count
+must be less than half of
+.BR delay .
+.IP
+In update mode,
+.B maxerr
+must be less than
+.BR prompt.
+.IP
+In daemon mode (i.e. when
+.B \-x
+is specified),
+.B minerr
+must be less than
+.B maxerr
+which must be less than
+.B separation
+(note that this is in minutes, not seconds, but the numeric value is compared).
+.PP
+Note that none of the above values are closely linked to the limits described
+in the NTP protocol (RFC 1305).
+.SH USAGE
+The simplest use of this program is as an unprivileged command to check the
+current time and error in the local clock. For example:
+.IP
+.B sntp ntpserver.somewhere
+.PP
+It can be run as a unprivileged background process to check on the clock drift
+as well as the current error; this will probably fail if the local clock is
+reset while it is running. For example:
+.IP
+.B sntp -x ntpserver.somewhere > output 2>\&1 \&
+.PP
+With suitable privilege, it can be run as a command or in a
+.I cron
+job to reset the local clock from a reliable server, like the
+.I ntpdate
+and
+.I rdate
+commands. For example:
+.IP
+.B sntp -a ntpserver.somewhere
+.PP
+It can also be run as a daemon to keep the local clock in step. For example:
+.IP
+.B sntp -a -x ntpserver.somewhere > output 2>\&1 \&
+.PP
+More information on how to use this utility is given in the
+.I README
+file in the distribution. In particular, this
+.I man
+page does not describe how to set it up as a server, which needs special care
+to avoid propagating misinformation.
+.SH RETURN VALUE
+When used as a client in non-daemon mode, the program returns a zero exit
+status for success, and a non-zero one otherwise. When used as a daemon
+(either client or server), it does not return except after a serious error.
+.SH BUGS
+The program implements the SNTP protocol, and does not provide all NTP
+facilities. In particular, it contains no checks against any form of spoofing.
+If this is a serious concern, some network security mechanism (like a firewall
+or even just
+.IR tcpwrappers )
+should be installed.
+.PP
+There are some errors, ambiguities and inconsistencies in the RFCs, and this
+code may not interwork with all other NTP implementations. Any unreasonable
+restrictions should be reported as bugs to whoever is responsible. It may
+be difficult to find out who that is.
+.PP
+The program will stop as soon as it feels that things have got out of control.
+In client daemon mode, it will usually fail during an extended period of
+network or server inaccessibility or excessively slow performance, or when the
+local clock is reset by another process. It will then need restarting
+manually. Experienced system administrators can write a shell script, a
+.I cron
+job or put it in
+.IR inittab ,
+to do this automatically.
+.PP
+The error cannot be estimated reliably with broadcast packets or for the drift
+in daemon mode (even with client-server packets), and the guess made by the
+program may be wrong (possibly even very wrong). If this is a problem, then
+setting the
+.B \-c
+option to a larger value may help. Or it may not.
+.SH AUTHOR
+.I sntp
+was developed by N.M. Maclaren of the University of Cambridge Computing
+Service.
+ _END_DETAIL;