MFV ntp 4.2.8p2 (r281348)

Reviewed by:    delphij (suggested MFC)
Approved by:	roberto
Security:       CVE-2015-1798, CVE-2015-1799
Security:       VuXML ebd84c96-dd7e-11e4-854e-3c970e169bc2
MFC after:	1 month
This commit is contained in:
Cy Schubert 2015-05-04 04:45:59 +00:00
commit a25439b686
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=282408
307 changed files with 13399 additions and 10067 deletions

View File

@ -1,4 +1,80 @@
---
(4.2.8p2) 2015/04/07 Released by Harlan Stenn <stenn@ntp.org>
(4.2.8p2-RC3) 2015/04/03 Released by Harlan Stenn <stenn@ntp.org>
* [Bug 2763] Fix for different thresholds for forward and backward steps.
---
(4.2.8p2-RC2) 2015/04/03 Released by Harlan Stenn <stenn@ntp.org>
* [Bug 2592] FLAG_TSTAMP_PPS cleanup for refclock_parse.c.
* [Bug 2769] New script: update-leap
* [Bug 2769] cleannup for update-leap
* [Bug 2788] New flag -G (force_step_once).
* [Bug 2794] Clean up kernel clock status reports.
* [Bug 2795] Cannot build without OpenSLL (on Win32).
Provided a Win32 specific wrapper around libevent/arc4random.c.
fixed some minor warnings.
* [Bug 2796] ntp-keygen crashes in 'getclock()' on Win32.
* [Bug 2797] ntp-keygen trapped in endless loop for MD5 keys
on big-endian machines.
* [Bug 2798] sntp should decode and display the leap indicator.
* Simple cleanup to html/build.html
---
(4.2.8p2-RC1) 2015/03/30 Released by Harlan Stenn <stenn@ntp.org>
* [Bug 2794] Don't let reports on normal kernel status changes
look like errors.
* [Bug 2788] New flag -G (force_step_once).
* [Bug 2592] Account for PPS sources which can provide an accurate
absolute time stamp, and status information.
Fixed indention and removed trailing whitespace.
* [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003.
* [Bug 1960] setsockopt IPV6_MULTICAST_IF: Invalid argument.
* [Bug 2346] "graceful termination" signals do not do peer cleanup.
* [Bug 2728] See if C99-style structure initialization works.
* [Bug 2747] Upgrade libevent to 2.1.5-beta.
* [Bug 2749] ntp/lib/NTP/Util.pm needs update for ntpq -w, IPv6, .POOL. .
* [Bug 2751] jitter.h has stale copies of l_fp macros.
* [Bug 2756] ntpd hangs in startup with gcc 3.3.5 on ARM.
* [Bug 2757] Quiet compiler warnings.
* [Bug 2759] Expose nonvolatile/clk_wander_threshold to ntpq.
* [Bug 2763] Allow different thresholds for forward and backward steps.
* [Bug 2766] ntp-keygen output files should not be world-readable.
* [Bug 2767] ntp-keygen -M should symlink to ntp.keys.
* [Bug 2771] nonvolatile value is documented in wrong units.
* [Bug 2773] Early leap announcement from Palisade/Thunderbolt
* [Bug 2774] Unreasonably verbose printout - leap pending/warning
* [Bug 2775] ntp-keygen.c fails to compile under Windows.
* [Bug 2777] Fixed loops and decoding of Meinberg GPS satellite info.
Removed non-ASCII characters from some copyright comments.
Removed trailing whitespace.
Updated definitions for Meinberg clocks from current Meinberg header files.
Now use C99 fixed-width types and avoid non-ASCII characters in comments.
Account for updated definitions pulled from Meinberg header files.
Updated comments on Meinberg GPS receivers which are not only called GPS16x.
Replaced some constant numbers by defines from ntp_calendar.h
Modified creation of parse-specific variables for Meinberg devices
in gps16x_message().
Reworked mk_utcinfo() to avoid printing of ambiguous leap second dates.
Modified mbg_tm_str() which now expexts an additional parameter controlling
if the time status shall be printed.
* [Sec 2779] ntpd accepts unauthenticated packets with symmetric key crypto.
* [Sec 2781] Authentication doesn't protect symmetric associations against
DoS attacks.
* [Bug 2783] Quiet autoconf warnings about missing AC_LANG_SOURCE.
* [Bug 2789] Quiet compiler warnings from libevent.
* [Bug 2790] If ntpd sets the Windows MM timer highest resolution
pause briefly before measuring system clock precision to yield
correct results.
* Comment from Juergen Perlinger in ntp_calendar.c to make the code clearer.
* Use predefined function types for parse driver functions
used to set up function pointers.
Account for changed prototype of parse_inp_fnc_t functions.
Cast parse conversion results to appropriate types to avoid
compiler warnings.
Let ioctl() for Windows accept a (void *) to avoid compiler warnings
when called with pointers to different types.
---
(4.2.8p1) 2015/02/04 Released by Harlan Stenn <stenn@ntp.org>
* Update the NEWS file.

File diff suppressed because it is too large Load Diff

View File

@ -49,8 +49,7 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
$(top_srcdir)/sntp/m4/define_dir.m4 \
$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
$(top_srcdir)/sntp/m4/libtool.m4 \
@ -79,6 +78,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/os_cflags.m4 \
$(top_srcdir)/sntp/m4/snprintf.m4 \
$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@ -347,6 +348,11 @@ TIMETRIM_DL = @TIMETRIM_DL@
TIMETRIM_DS = @TIMETRIM_DS@
TIMETRIM_MS = @TIMETRIM_MS@
TIMETRIM_NI = @TIMETRIM_NI@
UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
VERSION = @VERSION@
VER_SUFFIX = @VER_SUFFIX@
YACC = @YACC@

View File

@ -1,3 +1,144 @@
---
NTP 4.2.8p2 (Harlan Stenn <stenn@ntp.org>, 2015/04/xx)
Focus: Security and Bug fixes, enhancements.
Severity: MEDIUM
In addition to bug fixes and enhancements, this release fixes the
following medium-severity vulnerabilities involving private key
authentication:
* [Sec 2779] ntpd accepts unauthenticated packets with symmetric key crypto.
References: Sec 2779 / CVE-2015-1798 / VU#374268
Affects: All NTP4 releases starting with ntp-4.2.5p99 up to but not
including ntp-4.2.8p2 where the installation uses symmetric keys
to authenticate remote associations.
CVSS: (AV:A/AC:M/Au:N/C:P/I:P/A:P) Base Score: 5.4
Date Resolved: Stable (4.2.8p2) 07 Apr 2015
Summary: When ntpd is configured to use a symmetric key to authenticate
a remote NTP server/peer, it checks if the NTP message
authentication code (MAC) in received packets is valid, but not if
there actually is any MAC included. Packets without a MAC are
accepted as if they had a valid MAC. This allows a MITM attacker to
send false packets that are accepted by the client/peer without
having to know the symmetric key. The attacker needs to know the
transmit timestamp of the client to match it in the forged reply
and the false reply needs to reach the client before the genuine
reply from the server. The attacker doesn't necessarily need to be
relaying the packets between the client and the server.
Authentication using autokey doesn't have this problem as there is
a check that requires the key ID to be larger than NTP_MAXKEY,
which fails for packets without a MAC.
Mitigation:
Upgrade to 4.2.8p2, or later, from the NTP Project Download Page
or the NTP Public Services Project Download Page
Configure ntpd with enough time sources and monitor it properly.
Credit: This issue was discovered by Miroslav Lichvar, of Red Hat.
* [Sec 2781] Authentication doesn't protect symmetric associations against
DoS attacks.
References: Sec 2781 / CVE-2015-1799 / VU#374268
Affects: All NTP releases starting with at least xntp3.3wy up to but
not including ntp-4.2.8p2 where the installation uses symmetric
key authentication.
CVSS: (AV:A/AC:M/Au:N/C:P/I:P/A:P) Base Score: 5.4
Note: the CVSS base Score for this issue could be 4.3 or lower, and
it could be higher than 5.4.
Date Resolved: Stable (4.2.8p2) 07 Apr 2015
Summary: An attacker knowing that NTP hosts A and B are peering with
each other (symmetric association) can send a packet to host A
with source address of B which will set the NTP state variables
on A to the values sent by the attacker. Host A will then send
on its next poll to B a packet with originate timestamp that
doesn't match the transmit timestamp of B and the packet will
be dropped. If the attacker does this periodically for both
hosts, they won't be able to synchronize to each other. This is
a known denial-of-service attack, described at
https://www.eecis.udel.edu/~mills/onwire.html .
According to the document the NTP authentication is supposed to
protect symmetric associations against this attack, but that
doesn't seem to be the case. The state variables are updated even
when authentication fails and the peers are sending packets with
originate timestamps that don't match the transmit timestamps on
the receiving side.
This seems to be a very old problem, dating back to at least
xntp3.3wy. It's also in the NTPv3 (RFC 1305) and NTPv4 (RFC 5905)
specifications, so other NTP implementations with support for
symmetric associations and authentication may be vulnerable too.
An update to the NTP RFC to correct this error is in-process.
Mitigation:
Upgrade to 4.2.8p2, or later, from the NTP Project Download Page
or the NTP Public Services Project Download Page
Note that for users of autokey, this specific style of MITM attack
is simply a long-known potential problem.
Configure ntpd with appropriate time sources and monitor ntpd.
Alert your staff if problems are detected.
Credit: This issue was discovered by Miroslav Lichvar, of Red Hat.
* New script: update-leap
The update-leap script will verify and if necessary, update the
leap-second definition file.
It requires the following commands in order to work:
wget logger tr sed shasum
Some may choose to run this from cron. It needs more portability testing.
Bug Fixes and Improvements:
* [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003.
* [Bug 1960] setsockopt IPV6_MULTICAST_IF: Invalid argument.
* [Bug 2346] "graceful termination" signals do not do peer cleanup.
* [Bug 2728] See if C99-style structure initialization works.
* [Bug 2747] Upgrade libevent to 2.1.5-beta.
* [Bug 2749] ntp/lib/NTP/Util.pm needs update for ntpq -w, IPv6, .POOL. .
* [Bug 2751] jitter.h has stale copies of l_fp macros.
* [Bug 2756] ntpd hangs in startup with gcc 3.3.5 on ARM.
* [Bug 2757] Quiet compiler warnings.
* [Bug 2759] Expose nonvolatile/clk_wander_threshold to ntpq.
* [Bug 2763] Allow different thresholds for forward and backward steps.
* [Bug 2766] ntp-keygen output files should not be world-readable.
* [Bug 2767] ntp-keygen -M should symlink to ntp.keys.
* [Bug 2771] nonvolatile value is documented in wrong units.
* [Bug 2773] Early leap announcement from Palisade/Thunderbolt
* [Bug 2774] Unreasonably verbose printout - leap pending/warning
* [Bug 2775] ntp-keygen.c fails to compile under Windows.
* [Bug 2777] Fixed loops and decoding of Meinberg GPS satellite info.
Removed non-ASCII characters from some copyright comments.
Removed trailing whitespace.
Updated definitions for Meinberg clocks from current Meinberg header files.
Now use C99 fixed-width types and avoid non-ASCII characters in comments.
Account for updated definitions pulled from Meinberg header files.
Updated comments on Meinberg GPS receivers which are not only called GPS16x.
Replaced some constant numbers by defines from ntp_calendar.h
Modified creation of parse-specific variables for Meinberg devices
in gps16x_message().
Reworked mk_utcinfo() to avoid printing of ambiguous leap second dates.
Modified mbg_tm_str() which now expexts an additional parameter controlling
if the time status shall be printed.
* [Sec 2779] ntpd accepts unauthenticated packets with symmetric key crypto.
* [Sec 2781] Authentication doesn't protect symmetric associations against
DoS attacks.
* [Bug 2783] Quiet autoconf warnings about missing AC_LANG_SOURCE.
* [Bug 2789] Quiet compiler warnings from libevent.
* [Bug 2790] If ntpd sets the Windows MM timer highest resolution
pause briefly before measuring system clock precision to yield
correct results.
* Comment from Juergen Perlinger in ntp_calendar.c to make the code clearer.
* Use predefined function types for parse driver functions
used to set up function pointers.
Account for changed prototype of parse_inp_fnc_t functions.
Cast parse conversion results to appropriate types to avoid
compiler warnings.
Let ioctl() for Windows accept a (void *) to avoid compiler warnings
when called with pointers to different types.
---
NTP 4.2.8p1 (Harlan Stenn <stenn@ntp.org>, 2015/02/04)

View File

@ -1132,8 +1132,7 @@ AC_SUBST([am__untar])
m4_include([sntp/libopts/m4/libopts.m4])
m4_include([sntp/libopts/m4/stdnoreturn.m4])
m4_include([sntp/libevent/m4/openldap-thread-check.m4])
m4_include([sntp/libevent/m4/openldap.m4])
m4_include([sntp/m4/ax_c99_struct_init.m4])
m4_include([sntp/m4/define_dir.m4])
m4_include([sntp/m4/hms_search_lib.m4])
m4_include([sntp/m4/libtool.m4])
@ -1162,5 +1161,7 @@ m4_include([sntp/m4/ntp_rlimit.m4])
m4_include([sntp/m4/ntp_sntp.m4])
m4_include([sntp/m4/ntp_ver_suffix.m4])
m4_include([sntp/m4/ntp_vpathhack.m4])
m4_include([sntp/m4/openldap-thread-check.m4])
m4_include([sntp/m4/openldap.m4])
m4_include([sntp/m4/os_cflags.m4])
m4_include([sntp/m4/snprintf.m4])

View File

@ -49,8 +49,7 @@ subdir = adjtimed
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
$(top_srcdir)/sntp/m4/define_dir.m4 \
$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
$(top_srcdir)/sntp/m4/libtool.m4 \
@ -79,6 +78,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/os_cflags.m4 \
$(top_srcdir)/sntp/m4/snprintf.m4 \
$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@ -329,6 +330,11 @@ TIMETRIM_DL = @TIMETRIM_DL@
TIMETRIM_DS = @TIMETRIM_DS@
TIMETRIM_MS = @TIMETRIM_MS@
TIMETRIM_NI = @TIMETRIM_NI@
UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
VERSION = @VERSION@
VER_SUFFIX = @VER_SUFFIX@
YACC = @YACC@

View File

@ -42,8 +42,7 @@ subdir = clockstuff
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
$(top_srcdir)/sntp/m4/define_dir.m4 \
$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
$(top_srcdir)/sntp/m4/libtool.m4 \
@ -72,6 +71,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/os_cflags.m4 \
$(top_srcdir)/sntp/m4/snprintf.m4 \
$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@ -325,6 +326,11 @@ TIMETRIM_DL = @TIMETRIM_DL@
TIMETRIM_DS = @TIMETRIM_DS@
TIMETRIM_MS = @TIMETRIM_MS@
TIMETRIM_NI = @TIMETRIM_NI@
UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
VERSION = @VERSION@
VER_SUFFIX = @VER_SUFFIX@
YACC = @YACC@

View File

@ -1331,6 +1331,10 @@
/* Should we recommend a minimum value for tickadj? */
#undef MIN_REC_TICKADJ
/* Define to 1 if the compiler does not support C99's structure
initialization. */
#undef MISSING_C99_STRUCT_INIT
/* Do we need HPUX adjtime() library support? */
#undef NEED_HPUX_ADJTIME

121
contrib/ntp/configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for ntp 4.2.8p1.
# Generated by GNU Autoconf 2.68 for ntp 4.2.8p2.
#
# Report bugs to <http://bugs.ntp.org./>.
#
@ -570,8 +570,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='ntp'
PACKAGE_TARNAME='ntp'
PACKAGE_VERSION='4.2.8p1'
PACKAGE_STRING='ntp 4.2.8p1'
PACKAGE_VERSION='4.2.8p2'
PACKAGE_STRING='ntp 4.2.8p2'
PACKAGE_BUGREPORT='http://bugs.ntp.org./'
PACKAGE_URL='http://www.ntp.org./'
@ -710,6 +710,13 @@ LD
FGREP
SED
LIBTOOL
INSTALL_UPDATE_LEAP_FALSE
INSTALL_UPDATE_LEAP_TRUE
UPDATE_LEAP_NI
UPDATE_LEAP_MS
UPDATE_LEAP_DS
UPDATE_LEAP_DL
UPDATE_LEAP_DB
TIMETRIM_NI
TIMETRIM_MS
TIMETRIM_DS
@ -1573,7 +1580,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 ntp 4.2.8p1 to adapt to many kinds of systems.
\`configure' configures ntp 4.2.8p2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1643,7 +1650,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of ntp 4.2.8p1:";;
short | recursive ) echo "Configuration of ntp 4.2.8p2:";;
esac
cat <<\_ACEOF
@ -1872,7 +1879,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
ntp configure 4.2.8p1
ntp configure 4.2.8p2
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@ -2697,7 +2704,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 ntp $as_me 4.2.8p1, which was
It was created by ntp $as_me 4.2.8p2, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@ -3644,7 +3651,7 @@ fi
# Define the identity of the package.
PACKAGE='ntp'
VERSION='4.2.8p1'
VERSION='4.2.8p2'
cat >>confdefs.h <<_ACEOF
@ -7780,6 +7787,44 @@ $as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports C99 structure initialization" >&5
$as_echo_n "checking whether the compiler supports C99 structure initialization... " >&6; }
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
struct foo_s {int i1; int i2;};
int main() { struct foo_s foo[] = { { .i1 = 1, .i2 = 1 }, { .i1 = 2, .i2 = 2 }, { .i1 = 0, .i2 = 0 } }; }
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
$as_echo "#define MISSING_C99_STRUCT_INIT 1" >>confdefs.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if we need ylwrap VPATH hack" >&5
$as_echo_n "checking to see if we need ylwrap VPATH hack... " >&6; }
@ -7941,6 +7986,19 @@ fi
if test -z "$UPDATE_LEAP_NI" ; then
INSTALL_UPDATE_LEAP_TRUE=
INSTALL_UPDATE_LEAP_FALSE='#'
else
INSTALL_UPDATE_LEAP_TRUE='#'
INSTALL_UPDATE_LEAP_FALSE=
fi
@ -35326,7 +35384,6 @@ esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should enable NIST lockclock scheme" >&5
$as_echo_n "checking if we should enable NIST lockclock scheme... " >&6; }
# Check whether --enable-nist was given.
if test "${enable_nist+set}" = set; then :
enableval=$enable_nist; ans=$enableval
@ -35348,7 +35405,6 @@ esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want support for Samba's signing daemon" >&5
$as_echo_n "checking if we want support for Samba's signing daemon... " >&6; }
# Check whether --enable-ntp-signd was given.
if test "${enable_ntp_signd+set}" = set; then :
enableval=$enable_ntp_signd; ans=$enableval
@ -36444,33 +36500,35 @@ ac_config_files="$ac_config_files parseutil/Makefile"
ac_config_files="$ac_config_files scripts/Makefile"
ac_config_files="$ac_config_files scripts/lib/Makefile"
ac_config_files="$ac_config_files scripts/calc_tickadj/calc_tickadj"
ac_config_files="$ac_config_files scripts/calc_tickadj/Makefile"
ac_config_files="$ac_config_files scripts/build/Makefile"
ac_config_files="$ac_config_files scripts/build/mkver"
ac_config_files="$ac_config_files scripts/ntp-wait/ntp-wait"
ac_config_files="$ac_config_files scripts/calc_tickadj/Makefile"
ac_config_files="$ac_config_files scripts/calc_tickadj/calc_tickadj"
ac_config_files="$ac_config_files scripts/lib/Makefile"
ac_config_files="$ac_config_files scripts/ntp-wait/Makefile"
ac_config_files="$ac_config_files scripts/ntpsweep/ntpsweep"
ac_config_files="$ac_config_files scripts/ntp-wait/ntp-wait"
ac_config_files="$ac_config_files scripts/ntpsweep/Makefile"
ac_config_files="$ac_config_files scripts/ntptrace/ntptrace"
ac_config_files="$ac_config_files scripts/ntpsweep/ntpsweep"
ac_config_files="$ac_config_files scripts/ntptrace/Makefile"
ac_config_files="$ac_config_files scripts/ntptrace/ntptrace"
ac_config_files="$ac_config_files scripts/ntpver"
ac_config_files="$ac_config_files scripts/plot_summary"
ac_config_files="$ac_config_files scripts/summary"
ac_config_files="$ac_config_files scripts/build/Makefile"
ac_config_files="$ac_config_files scripts/update-leap/Makefile"
ac_config_files="$ac_config_files tests/Makefile"
@ -36664,6 +36722,10 @@ if test -z "${INSTALL_NTPSWEEP_TRUE}" && test -z "${INSTALL_NTPSWEEP_FALSE}"; th
as_fn_error $? "conditional \"INSTALL_NTPSWEEP\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${INSTALL_UPDATE_LEAP_TRUE}" && test -z "${INSTALL_UPDATE_LEAP_FALSE}"; then
as_fn_error $? "conditional \"INSTALL_UPDATE_LEAP\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${GL_GENERATE_STDNORETURN_H_TRUE}" && test -z "${GL_GENERATE_STDNORETURN_H_FALSE}"; then
as_fn_error $? "conditional \"GL_GENERATE_STDNORETURN_H\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@ -37109,7 +37171,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 ntp $as_me 4.2.8p1, which was
This file was extended by ntp $as_me 4.2.8p2, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -37176,7 +37238,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="\\
ntp config.status 4.2.8p1
ntp config.status 4.2.8p2
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
@ -37703,20 +37765,21 @@ do
"ntpsnmpd/Makefile") CONFIG_FILES="$CONFIG_FILES ntpsnmpd/Makefile" ;;
"parseutil/Makefile") CONFIG_FILES="$CONFIG_FILES parseutil/Makefile" ;;
"scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;;
"scripts/lib/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/lib/Makefile" ;;
"scripts/calc_tickadj/calc_tickadj") CONFIG_FILES="$CONFIG_FILES scripts/calc_tickadj/calc_tickadj" ;;
"scripts/calc_tickadj/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/calc_tickadj/Makefile" ;;
"scripts/build/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/build/Makefile" ;;
"scripts/build/mkver") CONFIG_FILES="$CONFIG_FILES scripts/build/mkver" ;;
"scripts/ntp-wait/ntp-wait") CONFIG_FILES="$CONFIG_FILES scripts/ntp-wait/ntp-wait" ;;
"scripts/calc_tickadj/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/calc_tickadj/Makefile" ;;
"scripts/calc_tickadj/calc_tickadj") CONFIG_FILES="$CONFIG_FILES scripts/calc_tickadj/calc_tickadj" ;;
"scripts/lib/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/lib/Makefile" ;;
"scripts/ntp-wait/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/ntp-wait/Makefile" ;;
"scripts/ntpsweep/ntpsweep") CONFIG_FILES="$CONFIG_FILES scripts/ntpsweep/ntpsweep" ;;
"scripts/ntp-wait/ntp-wait") CONFIG_FILES="$CONFIG_FILES scripts/ntp-wait/ntp-wait" ;;
"scripts/ntpsweep/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/ntpsweep/Makefile" ;;
"scripts/ntptrace/ntptrace") CONFIG_FILES="$CONFIG_FILES scripts/ntptrace/ntptrace" ;;
"scripts/ntpsweep/ntpsweep") CONFIG_FILES="$CONFIG_FILES scripts/ntpsweep/ntpsweep" ;;
"scripts/ntptrace/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/ntptrace/Makefile" ;;
"scripts/ntptrace/ntptrace") CONFIG_FILES="$CONFIG_FILES scripts/ntptrace/ntptrace" ;;
"scripts/ntpver") CONFIG_FILES="$CONFIG_FILES scripts/ntpver" ;;
"scripts/plot_summary") CONFIG_FILES="$CONFIG_FILES scripts/plot_summary" ;;
"scripts/summary") CONFIG_FILES="$CONFIG_FILES scripts/summary" ;;
"scripts/build/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/build/Makefile" ;;
"scripts/update-leap/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/update-leap/Makefile" ;;
"tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
"tests/libntp/Makefile") CONFIG_FILES="$CONFIG_FILES tests/libntp/Makefile" ;;
"tests/ntpd/Makefile") CONFIG_FILES="$CONFIG_FILES tests/ntpd/Makefile" ;;
@ -39254,8 +39317,8 @@ _LT_EOF
;;
"ntpd/complete.conf":F) sed -e '/^rlimit$/d' < ntpd/complete.conf > ntpd/complete.conf.new && mv ntpd/complete.conf.new ntpd/complete.conf ;;
"ntpdc/nl.pl":F) chmod +x ntpdc/nl.pl ;;
"scripts/calc_tickadj/calc_tickadj":F) chmod +x scripts/calc_tickadj/calc_tickadj ;;
"scripts/build/mkver":F) chmod +x scripts/build/mkver ;;
"scripts/calc_tickadj/calc_tickadj":F) chmod +x scripts/calc_tickadj/calc_tickadj ;;
"scripts/ntp-wait/ntp-wait":F) chmod +x scripts/ntp-wait/ntp-wait ;;
"scripts/ntpsweep/ntpsweep":F) chmod +x scripts/ntpsweep/ntpsweep ;;
"scripts/ntptrace/ntptrace":F) chmod +x scripts/ntptrace/ntptrace ;;

View File

@ -68,6 +68,7 @@ AC_PROG_CPP
AC_PROG_CXX
AC_PROG_YACC
AC_PROG_CC_C_O
AX_C99_STRUCT_INIT
NTP_VPATH_HACK dnl used only by ntpd/Makefile.am
@ -1499,12 +1500,13 @@ AC_CACHE_CHECK(
;;
*)
AC_PREPROC_IFELSE(
[AC_LANG_SOURCE(
[
#include <sys/syscall.h>
#if !defined(SYS_ntp_gettime) || !defined(SYS_ntp_adjtime)
# error
#endif
],
])],
[ntp_cv_var_ntp_syscalls=kernel]
)
;;
@ -1526,12 +1528,13 @@ AC_CACHE_CHECK(
[if sys/timex.h has STA_FLL],
[ntp_cv_var_sta_fll],
[AC_PREPROC_IFELSE(
[AC_LANG_SOURCE(
[
#include <sys/timex.h>
#ifndef STA_FLL
# error
#endif
],
])],
[ntp_cv_var_sta_fll=yes],
[ntp_cv_var_sta_fll=no]
)]
@ -1586,12 +1589,12 @@ AC_MSG_CHECKING([for TTY PPS ioctl TIOCGPPSEV])
case "$ac_cv_header_termios_h" in
yes)
AC_PREPROC_IFELSE(
[
[AC_LANG_SOURCE([
#include <termios.h>
#ifndef TIOCGPPSEV
# error
#endif
],
])],
[ntp_ok=yes],
[ntp_ok=no]
)
@ -1612,12 +1615,12 @@ AC_MSG_CHECKING([for TTY PPS ioctl TIOCSPPS])
case "$ac_cv_header_termios_h" in
yes)
AC_PREPROC_IFELSE(
[
[AC_LANG_SOURCE([
#include <termios.h>
#ifndef TIOCSPPS
# error
#endif
],
])],
[ntp_ok=yes],
[ntp_ok=no]
)
@ -1638,12 +1641,12 @@ AC_MSG_CHECKING([for TTY PPS ioctl CIOGETEV])
case "$ac_cv_header_sys_ppsclock_h" in
yes)
AC_PREPROC_IFELSE(
[
[AC_LANG_SOURCE([
#include <sys/ppsclock.h>
#ifndef CIOGETEV
# error
#endif
],
])],
[ntp_ok=yes],
[ntp_ok=no]
)
@ -1689,7 +1692,7 @@ case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
yesyes)
AC_MSG_CHECKING([ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG])
AC_PREPROC_IFELSE(
[
[AC_LANG_SOURCE([
#include <sys/time.h>
typedef int u_int;
#include <sys/ppsclock.h>
@ -1710,7 +1713,7 @@ case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
#ifndef CIOGETEV
# error
#endif
],
])],
[ntp_ok=yes],
[ntp_ok=no]
)
@ -4193,7 +4196,6 @@ case "$ans" in
esac
AC_MSG_CHECKING([if we should enable NIST lockclock scheme])
AC_ARG_ENABLE(
[nist],
[AS_HELP_STRING(
@ -4213,7 +4215,6 @@ case "$ans" in
esac
AC_MSG_CHECKING([if we want support for Samba's signing daemon])
AC_ARG_ENABLE(
[ntp-signd],
[AS_HELP_STRING(
@ -4266,14 +4267,14 @@ AC_CACHE_CHECK(
[for interface list sysctl],
[ntp_cv_iflist_sysctl],
[AC_PREPROC_IFELSE(
[
[AC_LANG_SOURCE([
#include <sys/param.h>
#include <sys/sysctl.h>
#include <sys/socket.h>
#ifndef NET_RT_IFLIST
# error
#endif
],
])],
[ntp_cv_iflist_sysctl=yes],
[ntp_cv_iflist_sysctl=no]
)]
@ -4333,20 +4334,21 @@ AC_CONFIG_FILES([ntpq/Makefile])
AC_CONFIG_FILES([ntpsnmpd/Makefile])
AC_CONFIG_FILES([parseutil/Makefile])
AC_CONFIG_FILES([scripts/Makefile])
AC_CONFIG_FILES([scripts/lib/Makefile])
AC_CONFIG_FILES([scripts/calc_tickadj/calc_tickadj], [chmod +x scripts/calc_tickadj/calc_tickadj])
AC_CONFIG_FILES([scripts/calc_tickadj/Makefile])
AC_CONFIG_FILES([scripts/build/Makefile])
AC_CONFIG_FILES([scripts/build/mkver], [chmod +x scripts/build/mkver])
AC_CONFIG_FILES([scripts/ntp-wait/ntp-wait], [chmod +x scripts/ntp-wait/ntp-wait])
AC_CONFIG_FILES([scripts/calc_tickadj/Makefile])
AC_CONFIG_FILES([scripts/calc_tickadj/calc_tickadj], [chmod +x scripts/calc_tickadj/calc_tickadj])
AC_CONFIG_FILES([scripts/lib/Makefile])
AC_CONFIG_FILES([scripts/ntp-wait/Makefile])
AC_CONFIG_FILES([scripts/ntpsweep/ntpsweep], [chmod +x scripts/ntpsweep/ntpsweep])
AC_CONFIG_FILES([scripts/ntp-wait/ntp-wait], [chmod +x scripts/ntp-wait/ntp-wait])
AC_CONFIG_FILES([scripts/ntpsweep/Makefile])
AC_CONFIG_FILES([scripts/ntptrace/ntptrace], [chmod +x scripts/ntptrace/ntptrace])
AC_CONFIG_FILES([scripts/ntpsweep/ntpsweep], [chmod +x scripts/ntpsweep/ntpsweep])
AC_CONFIG_FILES([scripts/ntptrace/Makefile])
AC_CONFIG_FILES([scripts/ntptrace/ntptrace], [chmod +x scripts/ntptrace/ntptrace])
AC_CONFIG_FILES([scripts/ntpver], [chmod +x scripts/ntpver])
AC_CONFIG_FILES([scripts/plot_summary], [chmod +x scripts/plot_summary])
AC_CONFIG_FILES([scripts/summary], [chmod +x scripts/summary])
AC_CONFIG_FILES([scripts/build/Makefile])
AC_CONFIG_FILES([scripts/update-leap/Makefile])
AC_CONFIG_FILES([tests/Makefile])
AC_CONFIG_FILES([tests/libntp/Makefile])
AC_CONFIG_FILES([tests/ntpd/Makefile])

View File

@ -11,7 +11,7 @@
<img src="pic/beaver.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Pogo</i>, Walt Kelly</a>
<p>For putting out compiler fires.</p>
<p>Last update:
<!-- #BeginDate format:En2m -->31-Mar-2014 05:39<!-- #EndDate -->
<!-- #BeginDate format:En2m -->1-Apr-2015 02:57<!-- #EndDate -->
</p>
<br clear="left">
<h4>Related Links</h4>
@ -27,7 +27,7 @@
</ul>
<hr>
<h4 id="build">Building and Installing the Distribution</h4>
<p>It is not possible in a software distribution such as this to support every individual computer and operating system with a common executable, even with the same system but different versions and options. Therefore, it is necessary to configure, build and install for each system and version. In almost all cases, these procedures are completely automatic, The user types <tt>./configure</tt>, <tt>make</tt> and <tt>install</tt> in that order and the autoconfigure system does the rest. There are some exceptions, as noted below and on the <a href="hints.html">Hints and Kinks</a> pages.</p>
<p>It is not possible in a software distribution such as this to support every individual computer and operating system with a common executable, even with the same system but different versions and options. Therefore, it is necessary to configure, build and install for each system and version. In almost all cases, these procedures are completely automatic, The user types <tt>./configure</tt>, and <tt>make install</tt> in that order and the autoconfigure system does the rest. There are some exceptions, as noted below and on the <a href="hints.html">Hints and Kinks</a> pages.</p>
<p>If available, the OpenSSL library from <a href="http://www.openssl.org">http://www.openssl.org</a> is used to support public key cryptography. The library must be built and installed prior to building NTP. The procedures for doing that are included in the OpenSSL documentation. The library is found during the normal NTP configure phase and the interface routines compiled automatically. Only the <tt>libcrypto.a</tt> library file and <tt>openssl</tt> header files are needed. If the library is not available or disabled, this step is not required.</p>
<p>The <a href="config.html">Build Options</a> page describes a number of options that determine whether debug support is included, whether and which reference clock drivers are included and the locations of the executables and library files, if not the default. By default debugging options and all reference clock drivers are included.</p>
<h4 id="unix">Building and Installing for Unix</h4>

View File

@ -10,7 +10,7 @@
<img src="pic/boom3.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a>
<p>We have three, now looking for more.</p>
<p>Last update:
<!-- #BeginDate format:En2m -->31-Jan-2014 06:54<!-- #EndDate -->
<!-- #BeginDate format:En2m -->28-Feb-2015 12:01<!-- #EndDate -->
UTC</p>
<br clear="left">
<h4>Related Links</h4>
@ -90,7 +90,7 @@
</dl>
</dd>
<dt id="nonvolatile"><tt>nonvolatile <i>threshold</i></tt></dt>
<dd>Specify the <i><tt>threshold</tt></i> in PPM to write the frequency file, with default 0.1 PPM. The frequency file is inspected each hour. If the difference between the current frequency and the last value written exceeds the threshold, the file is written and the <tt><em>threshold</em></tt> becomes the new threshold value. If the threshold is not exceeded, it is reduced by half. This is intended to reduce the frequency of unnecessary file writes for embedded systems with nonvolatile memory.</dd>
<dd>Specify the <i><tt>threshold</tt></i> in seconds to write the frequency file, with default of 1e-7 (0.1 PPM). The frequency file is inspected each hour. If the difference between the current frequency and the last value written exceeds the threshold, the file is written and the <tt><em>threshold</em></tt> becomes the new threshold value. If the threshold is not exceeded, it is reduced by half. This is intended to reduce the frequency of unnecessary file writes for embedded systems with nonvolatile memory.</dd>
<dt id="phone"><tt>phone <i>dial</i> ...</tt></dt>
<dd>This command is used in conjunction with the ACTS modem driver (type 18). The arguments consist of a maximum of 10 telephone numbers used to dial USNO, NIST or European time services. The Hayes command ATDT&nbsp;is normally prepended to the number, which can contain other modem control codes as well.</dd>
<dt id="reset"><tt>reset [allpeers] [auth] [ctl] [io] [mem] [sys] [timer]</tt></dt>

View File

@ -11,7 +11,7 @@
<img src="pic/dogsnake.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a>
<p>S is for snakeoil.</p>
<p>Last update:
<!-- #BeginDate format:En2m -->7-Dec-2014 11:09<!-- #EndDate -->
<!-- #BeginDate format:En2m -->1-Apr-2015 11:05<!-- #EndDate -->
UTC</p>
<br clear="left">
<hr>
@ -20,8 +20,8 @@
<h4>Description</h4>
<p>This program is a Simple Network Time Protocol (SNTP) client that can be used to query a Network Time Protocol (NTP) server and 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 script by a <tt>cron</tt> job. The program implements the SNTP client protocol defined in RFC 5905, including the full on-wire protocol but does not provide the sanity checks, access controls, security functions and mitigation algorithms as in the full NTP version 4 specification, also defined in RFC 5905.</p>
<p>By default, <tt>sntp</tt> writes the local date and time (i.e., not UTC) to the standard output in the format</p>
<p><tt>2011-08-04 00:40:36.642222 (+0000) +0.006611 +/- 0.041061 psp-os1 149.20.68.26</tt></p>
<p>where the <tt>+0.006611 +/- 0.041061</tt> indicates the time offset and error bound of the system clock relative to the server clock, in seconds.</p>
<p><tt>2011-08-04 00:40:36.642222 (+0000) +0.006611 +/- 0.041061 psp-os1 149.20.68.26 s3 no-leap</tt></p>
<p>where the <tt>+0.006611 +/- 0.041061</tt> indicates the time offset and error bound of the system clock relative to the server clock, in seconds. The hostname and/or the IP is displayed, as is the stratum of the server. Finally, the leap indicator status is displayed.</p>
<p>If -b <i>bcaddress</i> is not specified, the program sends a single message to each address and waits up to <i>uctimeout</i> (default 5) seconds for a unicast server response. Otherwise, it sends no message and waits up to <i>bctimeout</i> (default 68) seconds for a broadcast NTP message.</p>
<h4>Options</h4>
<p><tt>sntp</tt> recognizes the following options:</p>

View File

@ -40,8 +40,7 @@ DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
$(top_srcdir)/sntp/m4/define_dir.m4 \
$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
$(top_srcdir)/sntp/m4/libtool.m4 \
@ -70,6 +69,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/os_cflags.m4 \
$(top_srcdir)/sntp/m4/snprintf.m4 \
$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@ -327,6 +328,11 @@ TIMETRIM_DL = @TIMETRIM_DL@
TIMETRIM_DS = @TIMETRIM_DS@
TIMETRIM_MS = @TIMETRIM_MS@
TIMETRIM_NI = @TIMETRIM_NI@
UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
VERSION = @VERSION@
VER_SUFFIX = @VER_SUFFIX@
YACC = @YACC@

View File

@ -42,11 +42,21 @@ void put_lsb_short (unsigned char **, long);
long get_lsb_long (unsigned char **);
void put_lsb_long (unsigned char **, long);
#define get_lsb_int16( _x_ ) ((int16_t) get_lsb_short( _x_ ))
#define get_lsb_uint16( _x_ ) ((uint16_t) get_lsb_short( _x_ ))
#define get_lsb_int32( _x_ ) ((int32_t) get_lsb_long( _x_ ))
#define get_lsb_uint32( _x_ ) ((uint32_t) get_lsb_long( _x_ ))
long get_msb_short (unsigned char **);
void put_msb_short (unsigned char **, long);
long get_msb_long (unsigned char **);
void put_msb_long (unsigned char **, long);
#define get_msb_int16( _x_ ) ((int16_t) get_msb_short( _x_ ))
#define get_msb_uint16( _x_ ) ((uint16_t) get_msb_short( _x_ ))
#define get_msb_int32( _x_ ) ((int32_t) get_msb_long( _x_ ))
#define get_msb_uint32( _x_ ) ((uint32_t) get_msb_long( _x_ ))
#endif
/*
* History:

View File

@ -40,8 +40,7 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
$(top_srcdir)/sntp/m4/define_dir.m4 \
$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
$(top_srcdir)/sntp/m4/libtool.m4 \
@ -70,6 +69,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/os_cflags.m4 \
$(top_srcdir)/sntp/m4/snprintf.m4 \
$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@ -289,6 +290,11 @@ TIMETRIM_DL = @TIMETRIM_DL@
TIMETRIM_DS = @TIMETRIM_DS@
TIMETRIM_MS = @TIMETRIM_MS@
TIMETRIM_NI = @TIMETRIM_NI@
UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
VERSION = @VERSION@
VER_SUFFIX = @VER_SUFFIX@
YACC = @YACC@

File diff suppressed because it is too large Load Diff

View File

@ -435,7 +435,7 @@ struct peer {
#define STRATUM_UNSPEC ((u_char)16) /* unspecified */
/*
* Values for peer.flags
* Values for peer.flags (u_int)
*/
#define FLAG_CONFIG 0x0001 /* association was configured */
#define FLAG_PREEMPT 0x0002 /* preemptable association */
@ -453,8 +453,9 @@ struct peer {
#define FLAG_XB 0x2000 /* interleaved broadcast */
#define FLAG_XBOGUS 0x4000 /* interleaved bogus packet */
#ifdef OPENSSL
#define FLAG_ASSOC 0x8000 /* autokey request */
# define FLAG_ASSOC 0x8000 /* autokey request */
#endif /* OPENSSL */
#define FLAG_TSTAMP_PPS 0x10000 /* PPS source provides absolute timestamp */
/*
* Definitions for the clear() routine. We use memset() to clear
@ -713,17 +714,19 @@ struct pkt {
*/
#define LOOP_DRIFTINIT 1 /* iniitialize frequency */
#define LOOP_KERN_CLEAR 2 /* set initial frequency offset */
#define LOOP_MAX 3 /* set step offset */
#define LOOP_PANIC 4 /* set panic offseet */
#define LOOP_PHI 5 /* set dispersion rate */
#define LOOP_MINSTEP 6 /* set step timeout */
#define LOOP_MINPOLL 7 /* set min poll interval (log2 s) */
#define LOOP_ALLAN 8 /* set minimum Allan intercept */
#define LOOP_HUFFPUFF 9 /* set huff-n'-puff filter length */
#define LOOP_FREQ 10 /* set initial frequency */
#define LOOP_CODEC 11 /* set audio codec frequency */
#define LOOP_LEAP 12 /* insert leap after second 23:59 */
#define LOOP_TICK 13 /* sim. low precision clock */
#define LOOP_MAX 3 /* set both step offsets */
#define LOOP_MAX_BACK 4 /* set bacward-step offset */
#define LOOP_MAX_FWD 5 /* set forward-step offset */
#define LOOP_PANIC 6 /* set panic offseet */
#define LOOP_PHI 7 /* set dispersion rate */
#define LOOP_MINSTEP 8 /* set step timeout */
#define LOOP_MINPOLL 9 /* set min poll interval (log2 s) */
#define LOOP_ALLAN 10 /* set minimum Allan intercept */
#define LOOP_HUFFPUFF 11 /* set huff-n'-puff filter length */
#define LOOP_FREQ 12 /* set initial frequency */
#define LOOP_CODEC 13 /* set audio codec frequency */
#define LOOP_LEAP 14 /* insert leap after second 23:59 */
#define LOOP_TICK 15 /* sim. low precision clock */
/*
* Configuration items for the stats printer

View File

@ -83,10 +83,12 @@ extern systime_func_ptr ntpcal_set_timefunc(systime_func_ptr);
#define SECSPERMIN (60) /* seconds per minute */
#define MINSPERHR (60) /* minutes per hour */
#define HRSPERDAY (24) /* hours per day */
#define DAYSPERWEEK (7) /* days per week */
#define DAYSPERYEAR (365) /* days per year */
#define SECSPERHR (SECSPERMIN * MINSPERHR)
#define SECSPERDAY (SECSPERHR * HRSPERDAY)
#define SECSPERWEEK (DAYSPERWEEK * SECSPERDAY)
#define SECSPERYEAR (365 * SECSPERDAY) /* regular year */
#define SECSPERLEAPYEAR (366 * SECSPERDAY) /* leap year */
#define SECSPERAVGYEAR 31556952 /* mean year length over 400yrs */

View File

@ -264,10 +264,13 @@ typedef u_int32 u_fp;
* headers. So far the problem has only been seen with gcc, but it
* may also affect Sun compilers, in which case the defined(__GNUC__)
* term should be removed.
* XSCALE also generates bad code for these, at least with GCC 3.3.5.
* This is unrelated to math.h, but the same solution applies.
*/
#if defined(HAVE_U_INT64) && \
!(defined(__SVR4) && defined(__sun) && \
defined(sparc) && defined(__GNUC__))
defined(sparc) && defined(__GNUC__) || \
defined(__arm__) && defined(__XSCALE__) && defined(__GNUC__))
#include <math.h> /* ldexp() */

View File

@ -24,7 +24,7 @@
typedef MD5_CTX EVP_MD_CTX;
# define EVP_get_digestbynid(t) NULL
# define EVP_md5(v) NULL
# define EVP_md5() NULL
# define EVP_MD_CTX_init(c)
# define EVP_MD_CTX_set_flags(c, f)
# define EVP_DigestInit(c, dt) (MD5Init(c), 1)

View File

@ -188,6 +188,7 @@ extern void unpeer (struct peer *);
extern void clear_all (void);
extern int score_all (struct peer *);
extern struct peer *findmanycastpeer(struct recvbuf *);
extern void peer_cleanup (void);
/* ntp_crypto.c */
#ifdef AUTOKEY
@ -385,7 +386,8 @@ extern endpt * ep_list; /* linked list */
/* ntp_loopfilter.c */
extern double drift_comp; /* clock frequency (s/s) */
extern double clock_stability; /* clock stability (s/s) */
extern double clock_max; /* max offset before step (s) */
extern double clock_max_back; /* max backward offset before step (s) */
extern double clock_max_fwd; /* max forward offset before step (s) */
extern double clock_panic; /* max offset before panic (s) */
extern double clock_phi; /* dispersion rate (s/s) */
extern double clock_minstep; /* step timeout (s) */
@ -403,8 +405,9 @@ extern int kern_enable; /* kernel support enabled */
extern int hardpps_enable; /* kernel PPS discipline enabled */
extern int ext_enable; /* external clock enabled */
extern int cal_enable; /* refclock calibrate enable */
extern int allow_panic; /* allow panic correction */
extern int mode_ntpdate; /* exit on first clock set */
extern int allow_panic; /* allow panic correction (-g) */
extern int force_step_once; /* always step time once at startup (-G) */
extern int mode_ntpdate; /* exit on first clock set (-q) */
extern int peer_ntpdate; /* count of ntpdate peers */
/*

View File

@ -4,7 +4,7 @@
* parse.h,v 4.12 2007/01/14 08:36:03 kardel RELEASE_20070114_A
*
* Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-rnberg, Germany
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -104,6 +104,13 @@ extern unsigned int splclock (void);
#define TIMES10(_X_) (((_X_) << 3) + ((_X_) << 1))
#endif
/*
* some constants useful for GPS time conversion
*/
#define GPSORIGIN 2524953600UL /* NTP origin - GPS origin in seconds */
#define GPSWRAP 990U /* assume week count less than this in the previous epoch */
#define GPSWEEKS 1024U /* number of weeks until the GPS epch rolls over */
/*
* state flags
*/
@ -127,7 +134,7 @@ extern unsigned int splclock (void);
/*
* optional status information
*/
#define PARSEB_ALTERNATE 0x00001000 /* alternate antenna used */
#define PARSEB_CALLBIT 0x00001000 /* "call bit" used to signalize irregularities in the control facilities */
#define PARSEB_POSITION 0x00002000 /* position available */
#define PARSEB_MESSAGE 0x00004000 /* addtitional message data */
/*
@ -145,7 +152,7 @@ extern unsigned int splclock (void);
#define PARSEB_PPS 0x20000000 /* valid PPS sample */
#define PARSE_TCINFO (PARSEB_ANNOUNCE|PARSEB_POWERUP|PARSEB_NOSYNC|PARSEB_DST|\
PARSEB_UTC|PARSEB_LEAPS|PARSEB_ALTERNATE|PARSEB_S_LEAP|\
PARSEB_UTC|PARSEB_LEAPS|PARSEB_CALLBIT|PARSEB_S_LEAP|\
PARSEB_S_LOCATION|PARSEB_TIMECODE|PARSEB_MESSAGE)
#define PARSE_POWERUP(x) ((x) & PARSEB_POWERUP)
@ -156,7 +163,7 @@ extern unsigned int splclock (void);
#define PARSE_UTC(x) ((x) & PARSEB_UTC)
#define PARSE_LEAPADD(x) (PARSE_SYNC(x) && (((x) & PARSEB_LEAPS) == PARSEB_LEAPADD))
#define PARSE_LEAPDEL(x) (PARSE_SYNC(x) && (((x) & PARSEB_LEAPS) == PARSEB_LEAPDEL))
#define PARSE_ALTERNATE(x) ((x) & PARSEB_ALTERNATE)
#define PARSE_CALLBIT(x) ((x) & PARSEB_CALLBIT)
#define PARSE_LEAPSECOND(x) (PARSE_SYNC(x) && ((x) & PARSEB_LEAP_SECOND))
#define PARSE_S_LEAP(x) ((x) & PARSEB_S_LEAP)
@ -337,15 +344,19 @@ typedef struct clocktime clocktime_t;
#define SYNC_ZERO 0x00
#define SYNC_ONE 0x01
typedef u_long parse_inp_fnc_t(parse_t *, char, timestamp_t *);
typedef u_long parse_cvt_fnc_t(unsigned char *, int, struct format *, clocktime_t *, void *);
typedef u_long parse_pps_fnc_t(parse_t *, int, timestamp_t *);
struct clockformat
{
/* special input protocol - implies fixed format */
u_long (*input) (parse_t *, unsigned int, timestamp_t *);
parse_inp_fnc_t *input;
/* conversion routine */
u_long (*convert) (unsigned char *, int, struct format *, clocktime_t *, void *);
parse_cvt_fnc_t *convert;
/* routine for handling RS232 sync events (time stamps) */
/* PPS input routine */
u_long (*syncpps) (parse_t *, int, timestamp_t *);
parse_pps_fnc_t *syncpps;
/* time code synthesizer */
void *data; /* local parameters */
@ -361,7 +372,7 @@ typedef struct clockformat clockformat_t;
*/
extern int parse_ioinit (parse_t *);
extern void parse_ioend (parse_t *);
extern int parse_ioread (parse_t *, unsigned int, timestamp_t *);
extern int parse_ioread (parse_t *, char, timestamp_t *);
extern int parse_iopps (parse_t *, int, timestamp_t *);
extern void parse_iodone (parse_t *);
extern int parse_timecode (parsectl_t *, parse_t *);
@ -369,8 +380,8 @@ extern int parse_getfmt (parsectl_t *, parse_t *);
extern int parse_setfmt (parsectl_t *, parse_t *);
extern int parse_setcs (parsectl_t *, parse_t *);
extern unsigned int parse_restart (parse_t *, unsigned int);
extern unsigned int parse_addchar (parse_t *, unsigned int);
extern unsigned int parse_restart (parse_t *, char);
extern unsigned int parse_addchar (parse_t *, char);
extern unsigned int parse_end (parse_t *);
extern int Strok (const unsigned char *, const unsigned char *);
@ -379,9 +390,9 @@ extern int Stoi (const unsigned char *, long *, int);
extern time_t parse_to_unixtime (clocktime_t *, u_long *);
extern u_long updatetimeinfo (parse_t *, u_long);
extern void syn_simple (parse_t *, timestamp_t *, struct format *, u_long);
extern u_long pps_simple (parse_t *, int, timestamp_t *);
extern u_long pps_one (parse_t *, int, timestamp_t *);
extern u_long pps_zero (parse_t *, int, timestamp_t *);
extern parse_pps_fnc_t pps_simple;
extern parse_pps_fnc_t pps_one;
extern parse_pps_fnc_t pps_zero;
extern int parse_timedout (parse_t *, timestamp_t *, struct timeval *);
#endif

View File

@ -4,7 +4,7 @@
* parse_conf.h,v 4.7 2005/06/25 10:58:45 kardel RELEASE_20050625_A
*
* Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-rnberg, Germany
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -38,8 +38,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
$(top_srcdir)/sntp/m4/define_dir.m4 \
$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
$(top_srcdir)/sntp/m4/libtool.m4 \
@ -68,6 +67,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/os_cflags.m4 \
$(top_srcdir)/sntp/m4/snprintf.m4 \
$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@ -324,6 +325,11 @@ TIMETRIM_DL = @TIMETRIM_DL@
TIMETRIM_DS = @TIMETRIM_DS@
TIMETRIM_MS = @TIMETRIM_MS@
TIMETRIM_NI = @TIMETRIM_NI@
UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
VERSION = @VERSION@
VER_SUFFIX = @VER_SUFFIX@
YACC = @YACC@

View File

@ -40,8 +40,7 @@ DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
$(top_srcdir)/sntp/m4/define_dir.m4 \
$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
$(top_srcdir)/sntp/m4/libtool.m4 \
@ -70,6 +69,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/os_cflags.m4 \
$(top_srcdir)/sntp/m4/snprintf.m4 \
$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@ -289,6 +290,11 @@ TIMETRIM_DL = @TIMETRIM_DL@
TIMETRIM_DS = @TIMETRIM_DS@
TIMETRIM_MS = @TIMETRIM_MS@
TIMETRIM_NI = @TIMETRIM_NI@
UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
VERSION = @VERSION@
VER_SUFFIX = @VER_SUFFIX@
YACC = @YACC@

View File

@ -4,7 +4,7 @@
* parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A
*
* Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-rnberg, Germany
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -135,6 +135,7 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
best.base = -1;
cur.base = -1;
best.len = cur.len = 0;
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
if (words[i] == 0) {
if (cur.base == -1)

View File

@ -1143,7 +1143,7 @@ sync_channellist(isc_logconfig_t *lcfg) {
static isc_result_t
greatest_version(isc_logchannel_t *channel, int *greatestp) {
/* XXXDCL HIGHLY NT */
char *basename, *digit_end;
char *basenam, *digit_end;
const char *dirname;
int version, greatest = -1;
unsigned int basenamelen;
@ -1160,23 +1160,23 @@ greatest_version(isc_logchannel_t *channel, int *greatestp) {
* It is safe to DE_CONST the file.name because it was copied
* with isc_mem_strdup in isc_log_createchannel.
*/
basename = strrchr(FILE_NAME(channel), sep);
basenam = strrchr(FILE_NAME(channel), sep);
#ifdef _WIN32
basename2 = strrchr(FILE_NAME(channel), '\\');
if ((basename != NULL && basename2 != NULL && basename2 > basename) ||
(basename == NULL && basename2 != NULL)) {
basename = basename2;
if ((basenam != NULL && basename2 != NULL && basename2 > basenam) ||
(basenam == NULL && basename2 != NULL)) {
basenam = basename2;
sep = '\\';
}
#endif
if (basename != NULL) {
*basename++ = '\0';
if (basenam != NULL) {
*basenam++ = '\0';
dirname = FILE_NAME(channel);
} else {
DE_CONST(FILE_NAME(channel), basename);
DE_CONST(FILE_NAME(channel), basenam);
dirname = ".";
}
basenamelen = strlen(basename);
basenamelen = strlen(basenam);
isc_dir_init(&dir);
result = isc_dir_open(&dir, dirname);
@ -1184,8 +1184,8 @@ greatest_version(isc_logchannel_t *channel, int *greatestp) {
/*
* Replace the file separator if it was taken out.
*/
if (basename != FILE_NAME(channel))
*(basename - 1) = sep;
if (basenam != FILE_NAME(channel))
*(basenam - 1) = sep;
/*
* Return if the directory open failed.
@ -1195,7 +1195,7 @@ greatest_version(isc_logchannel_t *channel, int *greatestp) {
while (isc_dir_read(&dir) == ISC_R_SUCCESS) {
if (dir.entry.length > basenamelen &&
strncmp(dir.entry.name, basename, basenamelen) == 0 &&
strncmp(dir.entry.name, basenam, basenamelen) == 0 &&
dir.entry.name[basenamelen] == '.') {
version = strtol(&dir.entry.name[basenamelen + 1],

View File

@ -172,7 +172,7 @@ const char *
isc_result_totext(isc_result_t result) {
resulttable *table;
const char *txt, *default_text;
int index;
int idx;
initialize();
@ -183,15 +183,15 @@ isc_result_totext(isc_result_t result) {
table != NULL;
table = ISC_LIST_NEXT(table, link)) {
if (result >= table->base && result <= table->last) {
index = (int)(result - table->base);
default_text = table->text[index];
idx = (int)(result - table->base);
default_text = table->text[idx];
/*
* Note: we use 'index + 1' as the message number
* instead of index because isc_msgcat_get() requires
* Note: we use 'idx + 1' as the message number
* instead of idx because isc_msgcat_get() requires
* the message number to be > 0.
*/
txt = isc_msgcat_get(table->msgcat, table->set,
index + 1, default_text);
idx + 1, default_text);
break;
}
}

View File

@ -508,7 +508,7 @@ isc_file_safecreate(const char *filename, FILE **fp) {
}
isc_result_t
isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirname, char **basename)
isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirnam, char **basenam)
{
char *dir, *file, *slash;
@ -537,8 +537,8 @@ isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirname, char **basename)
return (ISC_R_INVALIDFILE);
}
*dirname = dir;
*basename = file;
*dirnam = dir;
*basenam = file;
return (ISC_R_SUCCESS);
}

View File

@ -212,6 +212,9 @@ internal_current(isc_interfaceiter_t *iter) {
get_addr(family, &iter->current.broadcast, ifa->ifa_broadaddr,
ifa->ifa_name);
#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
iter->current.ifindex = if_nametoindex(iter->current.name);
#endif
return (ISC_R_SUCCESS);
}

View File

@ -109,6 +109,10 @@ struct isc_interfaceiter {
#endif
#endif
/* Silence a warning when this file is #included */
int
isc_ioctl(int fildes, int req, char *arg);
int
isc_ioctl(int fildes, int req, char *arg) {
int trys;
@ -588,6 +592,9 @@ internal_current4(isc_interfaceiter_t *iter) {
}
iter->current.netmask.type.in6.s6_addr[i] = (~0 << bits) & 0xff;
}
#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
iter->current.ifindex = if_nametoindex(iter->current.name);
#endif
return (ISC_R_SUCCESS);
inet:
@ -664,6 +671,9 @@ internal_current4(isc_interfaceiter_t *iter) {
}
get_addr(family, &iter->current.netmask,
(struct sockaddr *)&ifreq.ifr_addr, ifreq.ifr_name);
#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
iter->current.ifindex = if_nametoindex(iter->current.name);
#endif
return (ISC_R_SUCCESS);
}
@ -704,7 +714,6 @@ internal_current6(isc_interfaceiter_t *iter) {
get_addr(family, &iter->current.address,
(struct sockaddr *)&lifreq.lifr_addr, lifreq.lifr_name);
iter->current.ifindex = lifreq.lifr_index;
if (isc_netaddr_islinklocal(&iter->current.address))
isc_netaddr_setzone(&iter->current.address,
(isc_uint32_t)lifreq.lifr_index);
@ -844,7 +853,9 @@ internal_current6(isc_interfaceiter_t *iter) {
iter->current.netmask.type.in6.s6_addr[i / 8] =
(~0 << bits) & 0xff;
}
#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
iter->current.ifindex = if_nametoindex(iter->current.name);
#endif
return (ISC_R_SUCCESS);
}
#endif
@ -867,6 +878,9 @@ internal_current6(isc_interfaceiter_t *iter) {
get_addr(family, &iter->current.netmask,
(struct sockaddr *)&lifreq.lifr_addr, lifreq.lifr_name);
#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
iter->current.ifindex = if_nametoindex(iter->current.name);
#endif
return (ISC_R_SUCCESS);
}
#endif

View File

@ -106,7 +106,8 @@ const struct in6_addr isc_net_in6addrloop = IN6ADDR_LOOPBACK_INIT;
static isc_once_t once_ipv6only = ISC_ONCE_INIT;
# endif
# if defined(ISC_PLATFORM_HAVEIN6PKTINFO)
# if defined(ISC_PLATFORM_HAVEIPV6) && \
defined(WANT_IPV6) && defined(ISC_PLATFORM_HAVEIN6PKTINFO)
static isc_once_t once_ipv6pktinfo = ISC_ONCE_INIT;
# endif
#endif /* ISC_PLATFORM_HAVEIPV6 */

View File

@ -41,8 +41,7 @@ subdir = libntp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
$(top_srcdir)/sntp/m4/define_dir.m4 \
$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
$(top_srcdir)/sntp/m4/libtool.m4 \
@ -71,6 +70,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/os_cflags.m4 \
$(top_srcdir)/sntp/m4/snprintf.m4 \
$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@ -444,6 +445,11 @@ TIMETRIM_DL = @TIMETRIM_DL@
TIMETRIM_DS = @TIMETRIM_DS@
TIMETRIM_MS = @TIMETRIM_MS@
TIMETRIM_NI = @TIMETRIM_NI@
UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
VERSION = @VERSION@
VER_SUFFIX = @VER_SUFFIX@
YACC = @YACC@

View File

@ -724,7 +724,13 @@ ntpcal_rd_to_date(
leaps = 0;
retv = 0;
/* get day-of-week first */
/* Get day-of-week first. Since rd is signed, the remainder can
* be in the range [-6..+6], but the assignment to an unsigned
* variable maps the negative values to positive values >=7.
* This makes the sign correction look strange, but adding 7
* causes the needed wrap-around into the desired value range of
* zero to six, both inclusive.
*/
jd->weekday = rd % 7;
if (jd->weekday >= 7) /* unsigned! */
jd->weekday += 7;

View File

@ -382,7 +382,7 @@ fork_blocking_child(
int rc;
int was_pipe;
int is_pipe;
int saved_errno;
int saved_errno = 0;
int childpid;
int keep_fd;
int fd;

View File

@ -43,8 +43,7 @@ subdir = libparse
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
$(top_srcdir)/sntp/m4/define_dir.m4 \
$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
$(top_srcdir)/sntp/m4/libtool.m4 \
@ -73,6 +72,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/os_cflags.m4 \
$(top_srcdir)/sntp/m4/snprintf.m4 \
$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@ -352,6 +353,11 @@ TIMETRIM_DL = @TIMETRIM_DL@
TIMETRIM_DS = @TIMETRIM_DS@
TIMETRIM_MS = @TIMETRIM_MS@
TIMETRIM_NI = @TIMETRIM_NI@
UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
VERSION = @VERSION@
VER_SUFFIX = @VER_SUFFIX@
YACC = @YACC@

View File

@ -15,7 +15,7 @@
* adapted by Alois Camenzind <alois.camenzind@ubs.ch>
*
* Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-rnberg, Germany
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -88,8 +88,8 @@ static struct format computime_fmt =
0
};
static u_long cvt_computime (unsigned char *, int, struct format *, clocktime_t *, void *);
static unsigned long inp_computime (parse_t *, unsigned int, timestamp_t *);
static parse_cvt_fnc_t cvt_computime;
static parse_inp_fnc_t inp_computime;
clockformat_t clock_computime =
{
@ -99,11 +99,11 @@ clockformat_t clock_computime =
(void *)&computime_fmt, /* conversion configuration */
"Diem's Computime Radio Clock", /* Computime Radio Clock */
24, /* string buffer */
0 /* no private data (complete pakets) */
0 /* no private data (complete packets) */
};
/*
* cvt_computime
* parse_cvt_fnc_t cvt_computime
*
* convert simple type format
*/
@ -144,14 +144,14 @@ cvt_computime(
}
/*
* inp_computime
* parse_inp_fnc_t inp_computime
*
* grep data from input stream
* grab data from input stream
*/
static u_long
inp_computime(
parse_t *parseio,
unsigned int ch,
char ch,
timestamp_t *tstamp
)
{

View File

@ -6,7 +6,7 @@
* ELV DCF7000 module
*
* Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-rnberg, Germany
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -64,8 +64,9 @@ static struct format dcf7000_fmt =
(const unsigned char *)" - - - - - - - \r",
0
};
static u_long cvt_dcf7000 (unsigned char *, int, struct format *, clocktime_t *, void *);
static unsigned long inp_dcf7000 (parse_t *, unsigned int, timestamp_t *);
static parse_cvt_fnc_t cvt_dcf7000;
static parse_inp_fnc_t inp_dcf7000;
clockformat_t clock_dcf7000 =
{
@ -75,11 +76,11 @@ clockformat_t clock_dcf7000 =
(void *)&dcf7000_fmt, /* conversion configuration */
"ELV DCF7000", /* ELV clock */
24, /* string buffer */
0 /* no private data (complete pakets) */
0 /* no private data (complete packets) */
};
/*
* cvt_dcf7000
* parse_cvt_fnc_t cvt_dcf7000
*
* convert dcf7000 type format
*/
@ -144,14 +145,14 @@ cvt_dcf7000(
}
/*
* inp_dcf700
* parse_inp_fnc_t inp_dcf700
*
* grep data from input stream
* grab data from input stream
*/
static u_long
inp_dcf7000(
parse_t *parseio,
unsigned int ch,
char ch,
timestamp_t *tstamp
)
{

View File

@ -118,8 +118,8 @@ static struct format hopf6021_fmt =
('A' <= (x) && (x) <= 'F') ? (x) - 'A' + 10 : \
-1)
static unsigned long cvt_hopf6021 (unsigned char *, int, struct format *, clocktime_t *, void *);
static unsigned long inp_hopf6021 (parse_t *, unsigned int, timestamp_t *);
static parse_cvt_fnc_t cvt_hopf6021;
static parse_inp_fnc_t inp_hopf6021;
clockformat_t clock_hopf6021 =
{
@ -132,7 +132,8 @@ clockformat_t clock_hopf6021 =
0 /* private data length, no private data */
};
static unsigned long
/* parse_cvt_fnc_t cvt_hopf6021 */
static u_long
cvt_hopf6021(
unsigned char *buffer,
int size,
@ -162,8 +163,8 @@ cvt_hopf6021(
clock_time->usecond = 0;
clock_time->utcoffset = 0;
status = hexval(buffer[OFFS(O_FLAGS)]);
weekday= hexval(buffer[OFFS(O_WDAY)]);
status = (u_char) hexval(buffer[OFFS(O_FLAGS)]);
weekday= (u_char) hexval(buffer[OFFS(O_WDAY)]);
if ((status == 0xFF) || (weekday == 0xFF))
{
@ -213,14 +214,14 @@ cvt_hopf6021(
}
/*
* inp_hopf6021
* parse_inp_fnc_t inp_hopf6021
*
* grep data from input stream
* grab data from input stream
*/
static u_long
inp_hopf6021(
parse_t *parseio,
unsigned int ch,
char ch,
timestamp_t *tstamp
)
{

View File

@ -6,7 +6,7 @@
* Meinberg clock support
*
* Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-rnberg, Germany
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -105,12 +105,14 @@
* <A> = '!' during the hour preceeding an daylight saving time
* start/end change
* <L> = 'A' LEAP second announcement
* <R> = 'R' alternate antenna
* <R> = 'R' "call bit" used to signalize irregularities in the control facilities,
* usually ' ', until 2003 indicated transmission via alternate antenna
*
* Meinberg GPS166 receiver
* Meinberg GPS receivers
*
* You must get the Uni-Erlangen firmware for the GPS receiver support
* For very old devices you must get the Uni-Erlangen firmware for the GPS receiver support
* to work to full satisfaction !
* With newer GPS receiver types the Uni Erlangen string format can be configured at the device.
*
* <STX><dd>.<mm>.<yy>; <w>; <hh>:<mm>:<ss>; <+/-><00:00>; <U><S><F><D><A><L><R><L>; <position...><ETX>
*
@ -131,7 +133,9 @@
* <A> = '!' during the hour preceeding an daylight saving time
* start/end change
* <L> = 'A' LEAP second announcement
* <R> = 'R' alternate antenna (reminiscent of PZF535) usually ' '
* <R> = 'R' "call bit" used to signalize irregularities in the control facilities,
* usually ' ', until 2003 indicated transmission via alternate antenna
* (reminiscent of PZF receivers)
* <L> = 'L' on 23:59:60
*
* Binary messages have a lead in for a fixed header of SOH
@ -150,19 +154,20 @@
/* Ret val: the checksum */
/*+-------------------------------------------------------------*/
unsigned long
CSUM
mbg_csum(
unsigned char *p,
unsigned int n
)
{
unsigned long sum = 0;
unsigned int sum = 0;
unsigned int i;
for ( i = 0; i < n; i++ )
sum += *p++;
return( sum );
return (CSUM) sum;
} /* csum */
void
@ -171,10 +176,10 @@ get_mbg_header(
GPS_MSG_HDR *headerp
)
{
headerp->gps_cmd = get_lsb_short(bufpp);
headerp->gps_len = get_lsb_short(bufpp);
headerp->gps_data_csum = get_lsb_short(bufpp);
headerp->gps_hdr_csum = get_lsb_short(bufpp);
headerp->cmd = (GPS_CMD) get_lsb_short(bufpp);
headerp->len = get_lsb_uint16(bufpp);
headerp->data_csum = (CSUM) get_lsb_short(bufpp);
headerp->hdr_csum = (CSUM) get_lsb_short(bufpp);
}
static struct format meinberg_fmt[] =
@ -209,10 +214,10 @@ static struct format meinberg_fmt[] =
}
};
static u_long cvt_meinberg (unsigned char *, int, struct format *, clocktime_t *, void *);
static u_long cvt_mgps (unsigned char *, int, struct format *, clocktime_t *, void *);
static u_long mbg_input (parse_t *, unsigned int, timestamp_t *);
static u_long gps_input (parse_t *, unsigned int, timestamp_t *);
static parse_cvt_fnc_t cvt_meinberg;
static parse_cvt_fnc_t cvt_mgps;
static parse_inp_fnc_t mbg_input;
static parse_inp_fnc_t gps_input;
struct msg_buf
{
@ -234,7 +239,7 @@ clockformat_t clock_meinberg[] =
0, /* conversion configuration */
"Meinberg Standard", /* Meinberg simple format - beware */
32, /* string buffer */
0 /* no private data (complete pakets) */
0 /* no private data (complete packets) */
},
{
mbg_input, /* normal input handling */
@ -243,21 +248,21 @@ clockformat_t clock_meinberg[] =
0, /* conversion configuration */
"Meinberg Extended", /* Meinberg enhanced format */
32, /* string buffer */
0 /* no private data (complete pakets) */
0 /* no private data (complete packets) */
},
{
gps_input, /* no input handling */
cvt_mgps, /* Meinberg GPS166 conversion */
cvt_mgps, /* Meinberg GPS receiver conversion */
pps_one, /* easy PPS monitoring */
(void *)&meinberg_fmt[2], /* conversion configuration */
"Meinberg GPS Extended", /* Meinberg FAU GPS format */
512, /* string buffer */
sizeof(struct msg_buf) /* no private data (complete pakets) */
sizeof(struct msg_buf) /* no private data (complete packets) */
}
};
/*
* cvt_meinberg
* parse_cvt_fnc_t cvt_meinberg
*
* convert simple type format
*/
@ -408,7 +413,7 @@ cvt_meinberg(
clock_time->flags |= PARSEB_LEAPADD;
if (f[5] == 'R')
clock_time->flags |= PARSEB_ALTERNATE;
clock_time->flags |= PARSEB_CALLBIT;
}
return CVT_OK;
}
@ -416,14 +421,14 @@ cvt_meinberg(
/*
* mbg_input
* parse_inp_fnc_t mbg_input
*
* grep data from input stream
* grab data from input stream
*/
static u_long
mbg_input(
parse_t *parseio,
unsigned int ch,
char ch,
timestamp_t *tstamp
)
{
@ -455,7 +460,7 @@ mbg_input(
/*
* cvt_mgps
* parse_cvt_fnc_t cvt_mgps
*
* convert Meinberg GPS format
*/
@ -580,14 +585,14 @@ cvt_mgps(
}
/*
* gps_input
* parse_inp_fnc_t gps_input
*
* grep binary data from input stream
*/
static u_long
gps_input(
parse_t *parseio,
unsigned int ch,
char ch,
timestamp_t *tstamp
)
{
@ -689,13 +694,13 @@ gps_input(
get_mbg_header(&datap, &header);
parseprintf(DD_PARSE, ("gps_input: header: cmd 0x%x, len %d, dcsum 0x%x, hcsum 0x%x\n",
(int)header.gps_cmd, (int)header.gps_len, (int)header.gps_data_csum,
(int)header.gps_hdr_csum));
(int)header.cmd, (int)header.len, (int)header.data_csum,
(int)header.hdr_csum));
calc_csum = mbg_csum( (unsigned char *) parseio->parse_dtime.parse_msg + 1, (unsigned short)6 );
if ( calc_csum != header.gps_hdr_csum )
if ( calc_csum != header.hdr_csum )
{
parseprintf(DD_PARSE, ("gps_input: header checksum mismatch expected 0x%x, got 0x%x\n",
(int)calc_csum, (int)mbg_csum( (unsigned char *) parseio->parse_dtime.parse_msg, (unsigned short)6 )));
@ -704,16 +709,16 @@ gps_input(
return PARSE_INP_DATA; /* invalid header checksum received - pass up for detection */
}
if ((header.gps_len == 0) || /* no data to wait for */
(header.gps_len >= (sizeof (parseio->parse_dtime.parse_msg) - sizeof(header) - 1))) /* blows anything we have space for */
if ((header.len == 0) || /* no data to wait for */
(header.len >= (sizeof (parseio->parse_dtime.parse_msg) - sizeof(header) - 1))) /* blows anything we have space for */
{
msg_buf->phase = MBG_NONE; /* back to hunting mode */
return (header.gps_len == 0) ? PARSE_INP_DATA : PARSE_INP_SKIP; /* message complete/throwaway */
return (header.len == 0) ? PARSE_INP_DATA : PARSE_INP_SKIP; /* message complete/throwaway */
}
parseprintf(DD_PARSE, ("gps_input: expecting %d bytes of data message\n", (int)header.gps_len));
parseprintf(DD_PARSE, ("gps_input: expecting %d bytes of data message\n", (int)header.len));
msg_buf->len = header.gps_len;/* save number of bytes to wait for */
msg_buf->len = header.len;/* save number of bytes to wait for */
msg_buf->phase = MBG_DATA; /* flag header already complete */
return PARSE_INP_SKIP;
}

View File

@ -6,7 +6,7 @@
* Raw DCF77 pulse clock support
*
* Copyright (c) 1995-2006 by Frank Kardel <kardel <AT> ntp.org>
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-rnberg, Germany
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -75,7 +75,8 @@
* Second Contents
* 0 - 10 AM: free, FM: 0
* 11 - 14 free
* 15 R - alternate antenna
* 15 R - "call bit" used to signalize irregularities in the control facilities
* (until 2003 indicated transmission via alternate antenna)
* 16 A1 - expect zone change (1 hour before)
* 17 - 18 Z1,Z2 - time zone
* 0 0 illegal
@ -101,9 +102,9 @@
* 59 - usually missing (minute indication), except for leap insertion
*/
static u_long pps_rawdcf (parse_t *, int, timestamp_t *);
static u_long cvt_rawdcf (unsigned char *, int, struct format *, clocktime_t *, void *);
static u_long inp_rawdcf (parse_t *, unsigned int, timestamp_t *);
static parse_pps_fnc_t pps_rawdcf;
static parse_cvt_fnc_t cvt_rawdcf;
static parse_inp_fnc_t inp_rawdcf;
typedef struct last_tcode {
time_t tcode; /* last converted time code */
@ -307,7 +308,7 @@ convert_rawdcf(
clock_time->flags |= PARSEB_LEAPADD; /* default: DCF77 data format deficiency */
if (ext_bf(buffer, DCF_R, dcfprm->zerobits))
clock_time->flags |= PARSEB_ALTERNATE;
clock_time->flags |= PARSEB_CALLBIT;
parseprintf(DD_RAWDCF,("parse: convert_rawdcf: TIME CODE OK: %d:%d, %d.%d.%d, flags 0x%lx\n",
(int)clock_time->hour, (int)clock_time->minute, (int)clock_time->day, (int)clock_time->month,(int) clock_time->year,
@ -327,6 +328,7 @@ convert_rawdcf(
}
/*
* parse_cvt_fnc_t cvt_rawdcf
* raw dcf input routine - needs to fix up 50 baud
* characters for 1/0 decision
*/
@ -379,7 +381,7 @@ cvt_rawdcf(
ch >>= 1;
}
*s = i;
*s = (unsigned char) i;
histbuf[i]++;
cutoff += i;
lowmax++;
@ -509,7 +511,7 @@ cvt_rawdcf(
}
/*
* pps_rawdcf
* parse_pps_fnc_t pps_rawdcf
*
* currently a very stupid version - should be extended to decode
* also ones and zeros (which is easy)
@ -555,14 +557,14 @@ snt_rawdcf(
}
/*
* inp_rawdcf
* parse_inp_fnc_t inp_rawdcf
*
* grab DCF77 data from input stream
*/
static u_long
inp_rawdcf(
parse_t *parseio,
unsigned int ch,
char ch,
timestamp_t *tstamp
)
{

View File

@ -57,8 +57,8 @@ static struct format rcc8000_fmt =
0
};
static unsigned long cvt_rcc8000 (unsigned char *, int, struct format *, clocktime_t *, void *);
static unsigned long inp_rcc8000 (parse_t *, unsigned int, timestamp_t *);
static parse_cvt_fnc_t cvt_rcc8000;
static parse_inp_fnc_t inp_rcc8000;
clockformat_t clock_rcc8000 =
{
@ -71,7 +71,8 @@ clockformat_t clock_rcc8000 =
0 /* no private data */
};
static unsigned long
/* parse_cvt_fnc_t cvt_rcc8000 */
static u_long
cvt_rcc8000(
unsigned char *buffer,
int size,
@ -127,14 +128,14 @@ cvt_rcc8000(
return CVT_OK;
}
/*
* inp_rcc8000
* parse_inp_fnc_t inp_rcc8000
*
* grep data from input stream
* grab data from input stream
*/
static u_long
inp_rcc8000(
parse_t *parseio,
unsigned int ch,
char ch,
timestamp_t *tstamp
)
{

View File

@ -7,7 +7,7 @@
* based on information and testing from Adam W. Feigin et. al (Swisstime iis.ethz.ch)
*
* Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-rnberg, Germany
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -82,15 +82,15 @@ extern int printf (const char *, ...);
#define WS_TIME 0x01
#define WS_SIGNAL 0x02
#define WS_ALTERNATE 0x01
#define WS_CALLBIT 0x01 /* "call bit" used to signalize irregularities in the control facilities */
#define WS_ANNOUNCE 0x02
#define WS_TZ 0x0c
#define WS_MET 0x08
#define WS_MEST 0x04
#define WS_LEAP 0x10
static u_long cvt_schmid (unsigned char *, int, struct format *, clocktime_t *, void *);
static unsigned long inp_schmid (parse_t *, unsigned int, timestamp_t *);
static parse_cvt_fnc_t cvt_schmid;
static parse_inp_fnc_t inp_schmid;
clockformat_t clock_schmid =
{
@ -103,7 +103,7 @@ clockformat_t clock_schmid =
0, /* no private data (complete messages) */
};
/* parse_cvt_fnc_t */
static u_long
cvt_schmid(
unsigned char *buffer,
@ -168,9 +168,9 @@ cvt_schmid(
if (buffer[7] & WS_SIGNAL)
{
if (buffer[8] & WS_ALTERNATE)
if (buffer[8] & WS_CALLBIT)
{
clock_time->flags |= PARSEB_ALTERNATE;
clock_time->flags |= PARSEB_CALLBIT;
}
if (buffer[8] & WS_ANNOUNCE)
@ -192,14 +192,14 @@ cvt_schmid(
}
/*
* inp_schmid
* parse_inp_fnc_t inp_schmid
*
* grep data from input stream
* grab data from input stream
*/
static u_long
inp_schmid(
parse_t *parseio,
unsigned int ch,
char ch,
timestamp_t *tstamp
)
{
@ -207,10 +207,10 @@ inp_schmid(
parseprintf(DD_PARSE, ("inp_schmid(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
switch (ch)
switch ((uint8_t)ch)
{
case 0xFD: /* */
parseprintf(DD_PARSE, ("mbg_input: ETX seen\n"));
parseprintf(DD_PARSE, ("inp_schmid: 0xFD seen\n"));
if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP)
return parse_end(parseio);
else

View File

@ -51,14 +51,8 @@
// a '?'. But we are only going to call it synced when we receive a ' '
//////////////////////////////////////////////////////////////////////////////
static unsigned long inp_sel240x( parse_t *parseio,
unsigned int ch,
timestamp_t *tstamp);
static unsigned long cvt_sel240x( unsigned char *buffer,
int size,
struct format *format,
clocktime_t *clock_time,
void *local );
static parse_inp_fnc_t inp_sel240x;
static parse_cvt_fnc_t cvt_sel240x;
// Parse clock format structure describing the message above
static struct format sel240x_fmt =
@ -94,7 +88,7 @@ clockformat_t clock_sel240x =
//////////////////////////////////////////////////////////////////////////////
static unsigned long
inp_sel240x( parse_t *parseio,
unsigned int ch,
char ch,
timestamp_t *tstamp
)
{

View File

@ -6,7 +6,7 @@
* Trimble SV6 clock support - several collected codepieces
*
* Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-rnberg, Germany
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -78,8 +78,8 @@ extern int printf (const char *, ...);
0
};
static unsigned long cvt_trimtaip (unsigned char *, int, struct format *, clocktime_t *, void *);
static unsigned long inp_trimtaip (parse_t *, unsigned int, timestamp_t *);
static parse_cvt_fnc_t cvt_trimtaip;
static parse_inp_fnc_t inp_trimtaip;
clockformat_t clock_trimtaip =
{
@ -92,7 +92,8 @@ clockformat_t clock_trimtaip =
0 /* no private data */
};
static unsigned long
/* parse_cvt_fnc_t cvt_trimtaip */
static u_long
cvt_trimtaip(
unsigned char *buffer,
int size,
@ -141,14 +142,14 @@ cvt_trimtaip(
}
/*
* inp_trimtaip
* parse_inp_fnc_t inp_trimtaip
*
* grep data from input stream
* grab data from input stream
*/
static u_long
inp_trimtaip(
parse_t *parseio,
unsigned int ch,
char ch,
timestamp_t *tstamp
)
{

View File

@ -7,7 +7,7 @@
* Thanks to Sven Dietrich for providing test hardware
*
* Copyright (c) 1995-2009 by Frank Kardel <kardel <AT> ntp.org>
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-rnberg, Germany
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -116,7 +116,7 @@ struct trimble
#define STATUS_UNSAFE 1 /* not enough receivers for full precision */
#define STATUS_SYNC 2 /* enough information for good operation */
static unsigned long inp_tsip (parse_t *, unsigned int, timestamp_t *);
static unsigned long inp_tsip (parse_t *, char, timestamp_t *);
static unsigned long cvt_trimtsip (unsigned char *, int, struct format *, clocktime_t *, void *);
struct clockformat clock_trimtsip =
@ -136,7 +136,7 @@ struct clockformat clock_trimtsip =
static unsigned long
inp_tsip(
parse_t *parseio,
unsigned int ch,
char ch,
timestamp_t *tstamp
)
{
@ -183,7 +183,7 @@ inp_tsip(
/* DLE,ETX -> end of packet */
parseio->parse_data[parseio->parse_index++] = DLE;
parseio->parse_data[parseio->parse_index] = ch;
parseio->parse_ldsize = parseio->parse_index+1;
parseio->parse_ldsize = (u_short) (parseio->parse_index + 1);
memcpy(parseio->parse_ldata, parseio->parse_data, parseio->parse_ldsize);
parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] = DLE;
parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] = ch;
@ -201,12 +201,12 @@ inp_tsip(
return PARSE_INP_SKIP;
}
static int
static short
getshort(
unsigned char *p
)
{
return get_msb_short(&p);
return (short) get_msb_short(&p);
}
/*
@ -265,8 +265,8 @@ cvt_trimtsip(
clock_time->flags = PARSEB_POWERUP;
return CVT_OK;
}
if (week < 990) {
week += 1024;
if (week < GPSWRAP) {
week += GPSWEEKS;
}
/* time OK */
@ -348,17 +348,17 @@ cvt_trimtsip(
unsigned char *lbp;
/* UTC correction data - derive a leap warning */
int tls = t->t_gpsutc = getshort((unsigned char *)&mb(12)); /* current leap correction (GPS-UTC) */
int tlsf = t->t_gpsutcleap = getshort((unsigned char *)&mb(24)); /* new leap correction */
int tls = t->t_gpsutc = (u_short) getshort((unsigned char *)&mb(12)); /* current leap correction (GPS-UTC) */
int tlsf = t->t_gpsutcleap = (u_short) getshort((unsigned char *)&mb(24)); /* new leap correction */
t->t_weekleap = getshort((unsigned char *)&mb(20)); /* week no of leap correction */
if (t->t_weekleap < 990)
t->t_weekleap += 1024;
t->t_weekleap = (u_short) getshort((unsigned char *)&mb(20)); /* week no of leap correction */
if (t->t_weekleap < GPSWRAP)
t->t_weekleap = (u_short)(t->t_weekleap + GPSWEEKS);
t->t_dayleap = getshort((unsigned char *)&mb(22)); /* day in week of leap correction */
t->t_week = getshort((unsigned char *)&mb(18)); /* current week no */
if (t->t_week < 990)
t->t_week += 1024;
t->t_dayleap = (u_short) getshort((unsigned char *)&mb(22)); /* day in week of leap correction */
t->t_week = (u_short) getshort((unsigned char *)&mb(18)); /* current week no */
if (t->t_week < GPSWRAP)
t->t_week = (u_short)(t->t_weekleap + GPSWEEKS);
lbp = (unsigned char *)&mb(14); /* last update time */
if (fetch_ieee754(&lbp, IEEE_SINGLE, &t0t, trim_offsets) != IEEE_OK)

View File

@ -16,7 +16,7 @@
*
* Codebase:
* Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-rnberg, Germany
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -105,8 +105,8 @@ static struct format varitext_fmt =
0
};
static u_long cvt_varitext (unsigned char *, int, struct format *, clocktime_t *, void *);
static u_long inp_varitext (parse_t *, unsigned int, timestamp_t *);
static parse_cvt_fnc_t cvt_varitext;
static parse_inp_fnc_t inp_varitext;
struct varitext {
unsigned char start_found;
@ -128,7 +128,7 @@ clockformat_t clock_varitext =
};
/*
* cvt_varitext
* parse_cvt_fnc_t cvt_varitext
*
* convert simple type format
*/
@ -184,10 +184,11 @@ cvt_varitext(
}
}
/* parse_inp_fnc_t inp_varitext */
static u_long
inp_varitext(
parse_t *parseio,
unsigned int ch,
char ch,
timestamp_t *tstamp
)
{

View File

@ -74,8 +74,11 @@ extern void printf (const char *, ...);
*
*/
static parse_cvt_fnc_t cvt_wharton_400a;
static parse_inp_fnc_t inp_wharton_400a;
/*
* cvt_wharton_400a
* parse_cvt_fnc_t cvt_wharton_400a
*
* convert simple type format
*/
@ -121,14 +124,14 @@ cvt_wharton_400a(
}
/*
* inp_wharton_400a
* parse_inp_fnc_t inp_wharton_400a
*
* grep data from input stream
* grab data from input stream
*/
static u_long
inp_wharton_400a(
parse_t *parseio,
unsigned int ch,
char ch,
timestamp_t *tstamp
)
{
@ -166,7 +169,7 @@ clockformat_t clock_wharton_400a =
0, /* conversion configuration */
"WHARTON 400A Series clock Output Format 1", /* String format name */
15, /* string buffer */
0 /* no private data (complete pakets) */
0 /* no private data (complete packets) */
};
#else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_WHARTON_400A) */

View File

@ -43,6 +43,7 @@
#include "ntp_types.h"
#include "ntp_stdlib.h"
#include "ntp_fp.h"
#include "ntp_calendar.h"
#include "mbg_gps166.h"
#include "binio.h"
#include "ieee754io.h"
@ -63,10 +64,10 @@ put_mbg_header(
GPS_MSG_HDR *headerp
)
{
put_lsb_short(bufpp, headerp->gps_cmd);
put_lsb_short(bufpp, headerp->gps_len);
put_lsb_short(bufpp, headerp->gps_data_csum);
put_lsb_short(bufpp, headerp->gps_hdr_csum);
put_lsb_short(bufpp, headerp->cmd);
put_lsb_short(bufpp, headerp->len);
put_lsb_short(bufpp, headerp->data_csum);
put_lsb_short(bufpp, headerp->hdr_csum);
}
void
@ -75,7 +76,7 @@ get_mbg_sw_rev(
SW_REV *sw_revp
)
{
sw_revp->code = get_lsb_short(bufpp);
sw_revp->code = get_lsb_uint16(bufpp);
memcpy(sw_revp->name, *bufpp, sizeof(sw_revp->name));
*bufpp += sizeof(sw_revp->name);
}
@ -86,8 +87,8 @@ get_mbg_ascii_msg(
ASCII_MSG *ascii_msgp
)
{
ascii_msgp->csum = get_lsb_short(bufpp);
ascii_msgp->valid = get_lsb_short(bufpp);
ascii_msgp->csum = (CSUM) get_lsb_short(bufpp);
ascii_msgp->valid = get_lsb_int16(bufpp);
memcpy(ascii_msgp->s, *bufpp, sizeof(ascii_msgp->s));
*bufpp += sizeof(ascii_msgp->s);
}
@ -98,7 +99,7 @@ get_mbg_svno(
SVNO *svnop
)
{
*svnop = get_lsb_short(bufpp);
*svnop = (SVNO) get_lsb_short(bufpp);
}
void
@ -107,7 +108,7 @@ get_mbg_health(
HEALTH *healthp
)
{
*healthp = get_lsb_short(bufpp);
*healthp = (HEALTH) get_lsb_short(bufpp);
}
void
@ -116,7 +117,7 @@ get_mbg_cfg(
CFG *cfgp
)
{
*cfgp = get_lsb_short(bufpp);
*cfgp = (CFG) get_lsb_short(bufpp);
}
void
@ -125,7 +126,7 @@ get_mbg_tgps(
T_GPS *tgpsp
)
{
tgpsp->wn = get_lsb_short(bufpp);
tgpsp->wn = get_lsb_uint16(bufpp);
tgpsp->sec = get_lsb_long(bufpp);
tgpsp->tick = get_lsb_long(bufpp);
}
@ -133,20 +134,20 @@ get_mbg_tgps(
void
get_mbg_tm(
unsigned char **buffpp,
TM *tmp
TM_GPS *tmp
)
{
tmp->year = get_lsb_short(buffpp);
tmp->year = get_lsb_int16(buffpp);
tmp->month = *(*buffpp)++;
tmp->mday = *(*buffpp)++;
tmp->yday = get_lsb_short(buffpp);
tmp->yday = get_lsb_int16(buffpp);
tmp->wday = *(*buffpp)++;
tmp->hour = *(*buffpp)++;
tmp->minute = *(*buffpp)++;
tmp->second = *(*buffpp)++;
tmp->min = *(*buffpp)++;
tmp->sec = *(*buffpp)++;
tmp->frac = get_lsb_long(buffpp);
tmp->offs_from_utc = get_lsb_long(buffpp);
tmp->status= get_lsb_short(buffpp);
tmp->status = get_lsb_uint16(buffpp);
}
void
@ -155,7 +156,7 @@ get_mbg_ttm(
TTM *ttmp
)
{
ttmp->channel = get_lsb_short(buffpp);
ttmp->channel = get_lsb_int16(buffpp);
get_mbg_tgps(buffpp, &ttmp->t);
get_mbg_tm(buffpp, &ttmp->tm);
}
@ -166,9 +167,9 @@ get_mbg_synth(
SYNTH *synthp
)
{
synthp->freq = get_lsb_short(buffpp);
synthp->range = get_lsb_short(buffpp);
synthp->phase = get_lsb_short(buffpp);
synthp->freq = get_lsb_int16(buffpp);
synthp->range = get_lsb_int16(buffpp);
synthp->phase = get_lsb_int16(buffpp);
}
static void
@ -201,7 +202,7 @@ get_mbg_antinfo(
ANT_INFO *antinfop
)
{
antinfop->status = get_lsb_short(buffpp);
antinfop->status = get_lsb_int16(buffpp);
get_mbg_tm(buffpp, &antinfop->tm_disconn);
get_mbg_tm(buffpp, &antinfop->tm_reconn);
antinfop->delta_t = get_lsb_long(buffpp);
@ -256,20 +257,22 @@ mbg_time_status_str(
void
mbg_tm_str(
char **buffpp,
TM *tmp,
int size
TM_GPS *tmp,
int size,
int print_status
)
{
char *s = *buffpp;
snprintf(*buffpp, size, "%04d-%02d-%02d %02d:%02d:%02d.%07ld (%c%02d%02d) ",
tmp->year, tmp->month, tmp->mday,
tmp->hour, tmp->minute, tmp->second, tmp->frac,
tmp->hour, tmp->min, tmp->sec, (long) tmp->frac,
(tmp->offs_from_utc < 0) ? '-' : '+',
abs((int)tmp->offs_from_utc) / 3600,
(abs((int)tmp->offs_from_utc) / 60) % 60);
*buffpp += strlen(*buffpp);
if (print_status)
mbg_time_status_str(buffpp, tmp->status, size - (*buffpp - s));
}
@ -281,8 +284,8 @@ mbg_tgps_str(
)
{
snprintf(*buffpp, size, "week %d + %ld days + %ld.%07ld sec",
tgpsp->wn, tgpsp->sec / 86400,
tgpsp->sec % 86400, tgpsp->tick);
tgpsp->wn, (long) tgpsp->sec / SECSPERDAY,
(long) tgpsp->sec % SECSPERDAY, (long) tgpsp->tick);
*buffpp += strlen(*buffpp);
}
@ -294,18 +297,18 @@ get_mbg_cfgh(
{
int i;
cfghp->csum = get_lsb_short(buffpp);
cfghp->valid = get_lsb_short(buffpp);
cfghp->csum = (CSUM) get_lsb_short(buffpp);
cfghp->valid = get_lsb_int16(buffpp);
get_mbg_tgps(buffpp, &cfghp->tot_51);
get_mbg_tgps(buffpp, &cfghp->tot_63);
get_mbg_tgps(buffpp, &cfghp->t0a);
for (i = MIN_SVNO; i <= MAX_SVNO; i++)
for (i = 0; i < N_SVNO_GPS; i++)
{
get_mbg_cfg(buffpp, &cfghp->cfg[i]);
}
for (i = MIN_SVNO; i <= MAX_SVNO; i++)
for (i = 0; i < N_SVNO_GPS; i++)
{
get_mbg_health(buffpp, &cfghp->health[i]);
}
@ -317,8 +320,8 @@ get_mbg_utc(
UTC *utcp
)
{
utcp->csum = get_lsb_short(buffpp);
utcp->valid = get_lsb_short(buffpp);
utcp->csum = (CSUM) get_lsb_short(buffpp);
utcp->valid = get_lsb_int16(buffpp);
get_mbg_tgps(buffpp, &utcp->t0t);
@ -332,8 +335,8 @@ get_mbg_utc(
L_CLR(&utcp->A1);
}
utcp->WNlsf = get_lsb_short(buffpp);
utcp->DNt = get_lsb_short(buffpp);
utcp->WNlsf = get_lsb_uint16(buffpp);
utcp->DNt = get_lsb_int16(buffpp);
utcp->delta_tls = *(*buffpp)++;
utcp->delta_tlsf = *(*buffpp)++;
}
@ -390,7 +393,7 @@ get_mbg_comparam(
{
comparamp->framing[i] = *(*buffpp)++;
}
comparamp->handshake = get_lsb_short(buffpp);
comparamp->handshake = get_lsb_int16(buffpp);
}
void
@ -401,11 +404,11 @@ get_mbg_portparam(
{
int i;
for (i = 0; i < N_COM; i++)
for (i = 0; i < DEFAULT_N_COM; i++)
{
get_mbg_comparam(buffpp, &portparamp->com[i]);
}
for (i = 0; i < N_COM; i++)
for (i = 0; i < DEFAULT_N_COM; i++)
{
portparamp->mode[i] = *(*buffpp)++;
}
@ -423,13 +426,13 @@ get_mbg_eph(
EPH *ephp
)
{
ephp->csum = get_lsb_short(buffpp);
ephp->valid = get_lsb_short(buffpp);
ephp->csum = (CSUM) get_lsb_short(buffpp);
ephp->valid = get_lsb_int16(buffpp);
ephp->health = get_lsb_short(buffpp);
ephp->IODC = get_lsb_short(buffpp);
ephp->IODE2 = get_lsb_short(buffpp);
ephp->IODE3 = get_lsb_short(buffpp);
ephp->health = (HEALTH) get_lsb_short(buffpp);
ephp->IODC = (IOD) get_lsb_short(buffpp);
ephp->IODE2 = (IOD) get_lsb_short(buffpp);
ephp->IODE3 = (IOD) get_lsb_short(buffpp);
get_mbg_tgps(buffpp, &ephp->tt);
get_mbg_tgps(buffpp, &ephp->t0c);
@ -456,7 +459,7 @@ get_mbg_eph(
FETCH_DOUBLE(buffpp, &ephp->af2);
FETCH_DOUBLE(buffpp, &ephp->tgd);
ephp->URA = get_lsb_short(buffpp);
ephp->URA = get_lsb_uint16(buffpp);
ephp->L2code = *(*buffpp)++;
ephp->L2flag = *(*buffpp)++;
@ -468,10 +471,10 @@ get_mbg_alm(
ALM *almp
)
{
almp->csum = get_lsb_short(buffpp);
almp->valid = get_lsb_short(buffpp);
almp->csum = (CSUM) get_lsb_short(buffpp);
almp->valid = get_lsb_int16(buffpp);
almp->health = get_lsb_short(buffpp);
almp->health = (HEALTH) get_lsb_short(buffpp);
get_mbg_tgps(buffpp, &almp->t0a);
@ -493,8 +496,8 @@ get_mbg_iono(
IONO *ionop
)
{
ionop->csum = get_lsb_short(buffpp);
ionop->valid = get_lsb_short(buffpp);
ionop->csum = (CSUM) get_lsb_short(buffpp);
ionop->valid = get_lsb_int16(buffpp);
FETCH_DOUBLE(buffpp, &ionop->alpha_0);
FETCH_DOUBLE(buffpp, &ionop->alpha_1);

View File

@ -34,10 +34,8 @@
*/
#include <config.h>
#include "ntp_fp.h"
#define GPSORIGIN 2524953600UL /* NTP origin - GPS origin in seconds */
#define SECSPERWEEK (unsigned)(604800) /* seconds per week - GPS tells us about weeks */
#define GPSWRAP 990 /* assume week count less than this in the previous epoch */
#include "ntp_calendar.h"
#include "parse.h"
void
gpstolfp(
@ -49,10 +47,10 @@ gpstolfp(
{
if (weeks < GPSWRAP)
{
weeks += 1024;
weeks += GPSWEEKS;
}
lfp->l_ui = weeks * SECSPERWEEK + days * 86400 + seconds + GPSORIGIN; /* convert to NTP time */
lfp->l_ui = (uint32_t)(weeks * SECSPERWEEK + days * SECSPERDAY + seconds + GPSORIGIN); /* convert to NTP time */
lfp->l_uf = 0;
}

View File

@ -12,7 +12,7 @@
* when PARSEKERNEL is not defined NTP time stamps will be used.
*
* Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-rnberg, Germany
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -188,7 +188,7 @@ parse_ioend(
unsigned int
parse_restart(
parse_t *parseio,
unsigned int ch
char ch
)
{
unsigned int updated = PARSE_INP_SKIP;
@ -218,7 +218,7 @@ parse_restart(
unsigned int
parse_addchar(
parse_t *parseio,
unsigned int ch
char ch
)
{
/*
@ -260,11 +260,11 @@ parse_end(
int
parse_ioread(
register parse_t *parseio,
register unsigned int ch,
register char ch,
register timestamp_t *tstamp
)
{
register unsigned updated = CVT_NONE;
register u_int updated = CVT_NONE;
/*
* within STREAMS CSx (x < 8) chars still have the upper bits set
* so we normalize the characters by masking unecessary bits off.
@ -284,7 +284,7 @@ parse_ioread(
break;
case PARSE_IO_CS8:
ch &= 0xFF;
ch &= (char) 0xFFU;
break;
}
@ -309,7 +309,7 @@ parse_ioread(
if (input_status & PARSE_INP_TIME) /* time sample is available */
{
updated = timepacket(parseio);
updated = (u_int) timepacket(parseio);
}
if (input_status & PARSE_INP_DATA) /* got additional data */
@ -353,7 +353,7 @@ parse_iopps(
register timestamp_t *ptime
)
{
register unsigned updated = CVT_NONE;
register u_int updated = CVT_NONE;
/*
* PPS pulse information will only be delivered to ONE clock format
@ -364,7 +364,7 @@ parse_iopps(
if (clockformats[parseio->parse_lformat]->syncpps)
{
updated = clockformats[parseio->parse_lformat]->syncpps(parseio, status == SYNC_ONE, ptime);
updated = (u_int) clockformats[parseio->parse_lformat]->syncpps(parseio, status == SYNC_ONE, ptime);
parseprintf(DD_PARSE, ("parse_iopps: updated = 0x%x\n", updated));
}
@ -614,7 +614,7 @@ syn_simple(
}
/*
* pps_simple
* parse_pps_fnc_t pps_simple
*
* handle a pps time stamp
*/
@ -633,7 +633,7 @@ pps_simple(
}
/*
* pps_one
* parse_pps_fnc_t pps_one
*
* handle a pps time stamp in ONE edge
*/
@ -652,7 +652,7 @@ pps_one(
}
/*
* pps_zero
* parse_pps_fnc_t pps_zero
*
* handle a pps time stamp in ZERO edge
*/
@ -732,7 +732,7 @@ timepacket(
parseio->parse_dtime.parse_time.tv.tv_sec = t;
parseio->parse_dtime.parse_time.tv.tv_usec = clock_time.usecond;
#else
parseio->parse_dtime.parse_time.fp.l_ui = t + JAN_1970;
parseio->parse_dtime.parse_time.fp.l_ui = (uint32_t) (t + JAN_1970);
TVUTOTSF(clock_time.usecond, parseio->parse_dtime.parse_time.fp.l_uf);
#endif
@ -852,7 +852,7 @@ parse_getfmt(
if (dct->parseformat.parse_format < nformats &&
Strlen(clockformats[dct->parseformat.parse_format]->name) <= PARSE_TCMAX)
{
dct->parseformat.parse_count = Strlen(clockformats[dct->parseformat.parse_format]->name)+1;
dct->parseformat.parse_count = (unsigned short) (Strlen(clockformats[dct->parseformat.parse_format]->name) + 1);
memcpy(dct->parseformat.parse_buffer, clockformats[dct->parseformat.parse_format]->name, dct->parseformat.parse_count);
return 1;
}
@ -870,7 +870,7 @@ parse_setcs(
)
{
parse->parse_ioflags &= ~PARSE_IO_CSIZE;
parse->parse_ioflags |= dct->parsesetcs.parse_cs & PARSE_IO_CSIZE;
parse->parse_ioflags |= (int) (dct->parsesetcs.parse_cs & PARSE_IO_CSIZE);
return 1;
}

View File

@ -12,7 +12,7 @@
* when STREAM is not defined NTP time stamps will be used.
*
* Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-rnberg, Germany
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -6,7 +6,7 @@
* STREAMS module for reference clocks
*
* Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-rnberg, Germany
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -7,7 +7,7 @@
* (SunOS4.x)
*
* Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-rnberg, Germany
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -6,7 +6,7 @@
* $Created: Sun Aug 2 20:20:34 1998 $
*
* Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-rnberg, Germany
* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -52,8 +52,7 @@ subdir = ntpd
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
$(top_srcdir)/sntp/m4/define_dir.m4 \
$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
$(top_srcdir)/sntp/m4/libtool.m4 \
@ -82,6 +81,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/os_cflags.m4 \
$(top_srcdir)/sntp/m4/snprintf.m4 \
$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@ -431,6 +432,11 @@ TIMETRIM_DL = @TIMETRIM_DL@
TIMETRIM_DS = @TIMETRIM_DS@
TIMETRIM_MS = @TIMETRIM_MS@
TIMETRIM_NI = @TIMETRIM_NI@
UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
VERSION = @VERSION@
VER_SUFFIX = @VER_SUFFIX@
YACC = @YACC@

View File

@ -76,6 +76,9 @@ getCmdOpts(
if (HAVE_OPT( PANICGATE ))
allow_panic = TRUE;
if (HAVE_OPT( FORCE_STEP_ONCE ))
force_step_once = TRUE;
#ifdef HAVE_DROPROOT
if (HAVE_OPT( JAILDIR )) {
droproot = 1;

View File

@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntp.conf.texi)
#
# It has been AutoGen-ed February 4, 2015 at 02:41:59 AM by AutoGen 5.18.5pre4
# It has been AutoGen-ed April 7, 2015 at 04:25:50 AM by AutoGen 5.18.5pre4
# From the definitions ntp.conf.def
# and the template file agtexi-file.tpl
@end ignore
@ -2482,7 +2482,7 @@ holds
the names of all peer variables and the
@code{clock_var_list}
holds the names of the reference clock variables.
@item @code{tinker} @code{[@code{allan} @kbd{allan} | @code{dispersion} @kbd{dispersion} | @code{freq} @kbd{freq} | @code{huffpuff} @kbd{huffpuff} | @code{panic} @kbd{panic} | @code{step} @kbd{srep} | @code{stepout} @kbd{stepout}]}
@item @code{tinker} @code{[@code{allan} @kbd{allan} | @code{dispersion} @kbd{dispersion} | @code{freq} @kbd{freq} | @code{huffpuff} @kbd{huffpuff} | @code{panic} @kbd{panic} | @code{step} @kbd{step} | @code{stepback} @kbd{stepback} | @code{stepfwd} @kbd{stepfwd} | @code{stepout} @kbd{stepout}]}
This command can be used to alter several system variables in
very exceptional circumstances.
It should occur in the
@ -2539,6 +2539,19 @@ adjustments will never occur.
Note: The kernel time discipline is
disabled if the step threshold is set to zero or greater than the
default.
@item @code{stepback} @kbd{stepback}
The argument is the step threshold for the backward direction,
which by default is 0.128 s.
It can
be set to any positive number in seconds.
If both the forward and backward step thresholds are set to zero, step
adjustments will never occur.
Note: The kernel time discipline is
disabled if
each direction of step threshold are either
set to zero or greater than .5 second.
@item @code{stepfwd} @kbd{stepfwd}
As for stepback, but for the forward direction.
@item @code{stepout} @kbd{stepout}
The argument is the stepout timeout, which by default is 900 s.
It can

View File

@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntp.keys.texi)
#
# It has been AutoGen-ed February 4, 2015 at 02:42:02 AM by AutoGen 5.18.5pre4
# It has been AutoGen-ed April 7, 2015 at 04:25:52 AM by AutoGen 5.18.5pre4
# From the definitions ntp.keys.def
# and the template file agtexi-file.tpl
@end ignore

View File

@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntpd.texi)
#
# It has been AutoGen-ed February 4, 2015 at 02:42:04 AM by AutoGen 5.18.5pre4
# It has been AutoGen-ed April 7, 2015 at 04:25:54 AM by AutoGen 5.18.5pre4
# From the definitions ntpd-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@ -95,6 +95,7 @@ This software is released under the NTP license, <http://ntp.org/license>.
* ntpd configfile:: configfile option (-c)
* ntpd driftfile:: driftfile option (-f)
* ntpd panicgate:: panicgate option (-g)
* ntpd force-step-once:: force-step-once option (-G)
* ntpd jaildir:: jaildir option (-i)
* ntpd interface:: interface option (-I)
* ntpd keyfile:: keyfile option (-k)
@ -141,7 +142,7 @@ with a status code of 0.
@exampleindent 0
@example
ntpd - NTP daemon program - Ver. 4.2.8p1
ntpd - NTP daemon program - Ver. 4.2.8p2
Usage: ntpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
[ <server1> ... <serverN> ]
Flg Arg Option-Name Description
@ -162,6 +163,7 @@ Usage: ntpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
-f Str driftfile frequency drift file name
-g no panicgate Allow the first adjustment to be Big
- may appear multiple times
-G no force-step-once Step any initial offset correction.
-i Str jaildir Jail directory
-I Str interface Listen on an interface name or address
- may appear multiple times
@ -326,6 +328,21 @@ options.
See the
@code{tinker}
configuration file directive for other options.
@node ntpd force-step-once
@subsection force-step-once option (-G)
@cindex ntpd-force-step-once
This is the ``step any initial offset correction.'' option.
Normally,
@code{ntpd}
steps the time if the time offset exceeds the step threshold,
which is 128 ms by default, and otherwise slews the time.
This option forces the initial offset correction to be stepped,
so the highest time accuracy can be achieved quickly.
However, this may also cause the time to be stepped back
so this option must not be used if
applications requiring monotonic time are running.
See the @code{tinker} configuration file directive for other options.
@node ntpd jaildir
@subsection jaildir option (-i)
@cindex ntpd-jaildir

View File

@ -1 +1 @@
* Generated 2015-01-03 23:51:10 UTC diff_ignore_line
* Generated 2015-03-16 09:05:44 UTC diff_ignore_line

View File

@ -206,6 +206,8 @@ struct key_tok ntp_keywords[] = {
{ "filenum", T_Filenum, FOLLBY_TOKEN },
/* tinker_option */
{ "step", T_Step, FOLLBY_TOKEN },
{ "stepback", T_Stepback, FOLLBY_TOKEN },
{ "stepfwd", T_Stepfwd, FOLLBY_TOKEN },
{ "panic", T_Panic, FOLLBY_TOKEN },
{ "dispersion", T_Dispersion, FOLLBY_TOKEN },
{ "stepout", T_Stepout, FOLLBY_TOKEN },

View File

@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
.TH ntp.conf 5man "04 Feb 2015" "4.2.8p1" "File Formats"
.TH ntp.conf 5man "07 Apr 2015" "4.2.8p2" "File Formats"
.\"
.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-sPaOCn/ag-RPaGBn)
.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-gKaW.1/ag-tKaO91)
.\"
.\" It has been AutoGen-ed February 4, 2015 at 02:41:46 AM by AutoGen 5.18.5pre4
.\" It has been AutoGen-ed April 7, 2015 at 04:25:37 AM by AutoGen 5.18.5pre4
.\" From the definitions ntp.conf.def
.\" and the template file agman-cmd.tpl
.SH NAME
@ -2786,7 +2786,7 @@ the names of all peer variables and the
\fIclock_var_list\f[]
holds the names of the reference clock variables.
.TP 7
.NOP \f\*[B-Font]tinker\f[] [\f\*[B-Font]allan\f[] \f\*[I-Font]allan\f[] | \f\*[B-Font]dispersion\f[] \f\*[I-Font]dispersion\f[] | \f\*[B-Font]freq\f[] \f\*[I-Font]freq\f[] | \f\*[B-Font]huffpuff\f[] \f\*[I-Font]huffpuff\f[] | \f\*[B-Font]panic\f[] \f\*[I-Font]panic\f[] | \f\*[B-Font]step\f[] \f\*[I-Font]srep\f[] | \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[]]
.NOP \f\*[B-Font]tinker\f[] [\f\*[B-Font]allan\f[] \f\*[I-Font]allan\f[] | \f\*[B-Font]dispersion\f[] \f\*[I-Font]dispersion\f[] | \f\*[B-Font]freq\f[] \f\*[I-Font]freq\f[] | \f\*[B-Font]huffpuff\f[] \f\*[I-Font]huffpuff\f[] | \f\*[B-Font]panic\f[] \f\*[I-Font]panic\f[] | \f\*[B-Font]step\f[] \f\*[I-Font]step\f[] | \f\*[B-Font]stepback\f[] \f\*[I-Font]stepback\f[] | \f\*[B-Font]stepfwd\f[] \f\*[I-Font]stepfwd\f[] | \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[]]
This command can be used to alter several system variables in
very exceptional circumstances.
It should occur in the
@ -2852,6 +2852,21 @@ Note: The kernel time discipline is
disabled if the step threshold is set to zero or greater than the
default.
.TP 7
.NOP \f\*[B-Font]stepback\f[] \f\*[I-Font]stepback\f[]
The argument is the step threshold for the backward direction,
which by default is 0.128 s.
It can
be set to any positive number in seconds.
If both the forward and backward step thresholds are set to zero, step
adjustments will never occur.
Note: The kernel time discipline is
disabled if
each direction of step threshold are either
set to zero or greater than .5 second.
.TP 7
.NOP \f\*[B-Font]stepfwd\f[] \f\*[I-Font]stepfwd\f[]
As for stepback, but for the forward direction.
.TP 7
.NOP \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[]
The argument is the stepout timeout, which by default is 900 s.
It can

View File

@ -1,9 +1,9 @@
.Dd February 4 2015
.Dd April 7 2015
.Dt NTP_CONF 5mdoc File Formats
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
.\" It has been AutoGen-ed February 4, 2015 at 02:42:07 AM by AutoGen 5.18.5pre4
.\" It has been AutoGen-ed April 7, 2015 at 04:25:57 AM by AutoGen 5.18.5pre4
.\" From the definitions ntp.conf.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@ -2618,7 +2618,9 @@ holds the names of the reference clock variables.
.Cm freq Ar freq |
.Cm huffpuff Ar huffpuff |
.Cm panic Ar panic |
.Cm step Ar srep |
.Cm step Ar step |
.Cm stepback Ar stepback |
.Cm stepfwd Ar stepfwd |
.Cm stepout Ar stepout
.Oc
.Xc
@ -2678,6 +2680,19 @@ adjustments will never occur.
Note: The kernel time discipline is
disabled if the step threshold is set to zero or greater than the
default.
.It Cm stepback Ar stepback
The argument is the step threshold for the backward direction,
which by default is 0.128 s.
It can
be set to any positive number in seconds.
If both the forward and backward step thresholds are set to zero, step
adjustments will never occur.
Note: The kernel time discipline is
disabled if
each direction of step threshold are either
set to zero or greater than .5 second.
.It Cm stepfwd Ar stepfwd
As for stepback, but for the forward direction.
.It Cm stepout Ar stepout
The argument is the stepout timeout, which by default is 900 s.
It can

View File

@ -2620,7 +2620,9 @@ holds the names of the reference clock variables.
.Cm freq Ar freq |
.Cm huffpuff Ar huffpuff |
.Cm panic Ar panic |
.Cm step Ar srep |
.Cm step Ar step |
.Cm stepback Ar stepback |
.Cm stepfwd Ar stepfwd |
.Cm stepout Ar stepout
.Oc
.Xc
@ -2680,6 +2682,19 @@ adjustments will never occur.
Note: The kernel time discipline is
disabled if the step threshold is set to zero or greater than the
default.
.It Cm stepback Ar stepback
The argument is the step threshold for the backward direction,
which by default is 0.128 s.
It can
be set to any positive number in seconds.
If both the forward and backward step thresholds are set to zero, step
adjustments will never occur.
Note: The kernel time discipline is
disabled if
each direction of step threshold are either
set to zero or greater than .5 second.
.It Cm stepfwd Ar stepfwd
As for stepback, but for the forward direction.
.It Cm stepout Ar stepout
The argument is the stepout timeout, which by default is 900 s.
It can

View File

@ -33,7 +33,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<p>This document describes the configuration file for the NTP Project's
<code>ntpd</code> program.
<p>This document applies to version 4.2.8p1 of <code>ntp.conf</code>.
<p>This document applies to version 4.2.8p2 of <code>ntp.conf</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
@ -2463,7 +2463,7 @@ holds
the names of all peer variables and the
<code>clock_var_list</code>
holds the names of the reference clock variables.
<br><dt><code>tinker</code> <code>[allan </code><kbd>allan</kbd><code> | dispersion </code><kbd>dispersion</kbd><code> | freq </code><kbd>freq</kbd><code> | huffpuff </code><kbd>huffpuff</kbd><code> | panic </code><kbd>panic</kbd><code> | step </code><kbd>srep</kbd><code> | stepout </code><kbd>stepout</kbd><code>]</code><dd>This command can be used to alter several system variables in
<br><dt><code>tinker</code> <code>[allan </code><kbd>allan</kbd><code> | dispersion </code><kbd>dispersion</kbd><code> | freq </code><kbd>freq</kbd><code> | huffpuff </code><kbd>huffpuff</kbd><code> | panic </code><kbd>panic</kbd><code> | step </code><kbd>step</kbd><code> | stepback </code><kbd>stepback</kbd><code> | stepfwd </code><kbd>stepfwd</kbd><code> | stepout </code><kbd>stepout</kbd><code>]</code><dd>This command can be used to alter several system variables in
very exceptional circumstances.
It should occur in the
configuration file before any other configuration options.
@ -2513,6 +2513,17 @@ adjustments will never occur.
Note: The kernel time discipline is
disabled if the step threshold is set to zero or greater than the
default.
<br><dt><code>stepback</code> <kbd>stepback</kbd><dd>The argument is the step threshold for the backward direction,
which by default is 0.128 s.
It can
be set to any positive number in seconds.
If both the forward and backward step thresholds are set to zero, step
adjustments will never occur.
Note: The kernel time discipline is
disabled if
each direction of step threshold are either
set to zero or greater than .5 second.
<br><dt><code>stepfwd</code> <kbd>stepfwd</kbd><dd>As for stepback, but for the forward direction.
<br><dt><code>stepout</code> <kbd>stepout</kbd><dd>The argument is the stepout timeout, which by default is 900 s.
It can
be set to any positive number in seconds.

View File

@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
.TH ntp.conf 5 "04 Feb 2015" "4.2.8p1" "File Formats"
.TH ntp.conf 5 "07 Apr 2015" "4.2.8p2" "File Formats"
.\"
.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-sPaOCn/ag-RPaGBn)
.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-gKaW.1/ag-tKaO91)
.\"
.\" It has been AutoGen-ed February 4, 2015 at 02:41:46 AM by AutoGen 5.18.5pre4
.\" It has been AutoGen-ed April 7, 2015 at 04:25:37 AM by AutoGen 5.18.5pre4
.\" From the definitions ntp.conf.def
.\" and the template file agman-cmd.tpl
.SH NAME
@ -2786,7 +2786,7 @@ the names of all peer variables and the
\fIclock_var_list\f[]
holds the names of the reference clock variables.
.TP 7
.NOP \f\*[B-Font]tinker\f[] [\f\*[B-Font]allan\f[] \f\*[I-Font]allan\f[] | \f\*[B-Font]dispersion\f[] \f\*[I-Font]dispersion\f[] | \f\*[B-Font]freq\f[] \f\*[I-Font]freq\f[] | \f\*[B-Font]huffpuff\f[] \f\*[I-Font]huffpuff\f[] | \f\*[B-Font]panic\f[] \f\*[I-Font]panic\f[] | \f\*[B-Font]step\f[] \f\*[I-Font]srep\f[] | \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[]]
.NOP \f\*[B-Font]tinker\f[] [\f\*[B-Font]allan\f[] \f\*[I-Font]allan\f[] | \f\*[B-Font]dispersion\f[] \f\*[I-Font]dispersion\f[] | \f\*[B-Font]freq\f[] \f\*[I-Font]freq\f[] | \f\*[B-Font]huffpuff\f[] \f\*[I-Font]huffpuff\f[] | \f\*[B-Font]panic\f[] \f\*[I-Font]panic\f[] | \f\*[B-Font]step\f[] \f\*[I-Font]step\f[] | \f\*[B-Font]stepback\f[] \f\*[I-Font]stepback\f[] | \f\*[B-Font]stepfwd\f[] \f\*[I-Font]stepfwd\f[] | \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[]]
This command can be used to alter several system variables in
very exceptional circumstances.
It should occur in the
@ -2852,6 +2852,21 @@ Note: The kernel time discipline is
disabled if the step threshold is set to zero or greater than the
default.
.TP 7
.NOP \f\*[B-Font]stepback\f[] \f\*[I-Font]stepback\f[]
The argument is the step threshold for the backward direction,
which by default is 0.128 s.
It can
be set to any positive number in seconds.
If both the forward and backward step thresholds are set to zero, step
adjustments will never occur.
Note: The kernel time discipline is
disabled if
each direction of step threshold are either
set to zero or greater than .5 second.
.TP 7
.NOP \f\*[B-Font]stepfwd\f[] \f\*[I-Font]stepfwd\f[]
As for stepback, but for the forward direction.
.TP 7
.NOP \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[]
The argument is the stepout timeout, which by default is 900 s.
It can

View File

@ -1,9 +1,9 @@
.Dd February 4 2015
.Dd April 7 2015
.Dt NTP_CONF 5 File Formats
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
.\" It has been AutoGen-ed February 4, 2015 at 02:42:07 AM by AutoGen 5.18.5pre4
.\" It has been AutoGen-ed April 7, 2015 at 04:25:57 AM by AutoGen 5.18.5pre4
.\" From the definitions ntp.conf.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@ -2618,7 +2618,9 @@ holds the names of the reference clock variables.
.Cm freq Ar freq |
.Cm huffpuff Ar huffpuff |
.Cm panic Ar panic |
.Cm step Ar srep |
.Cm step Ar step |
.Cm stepback Ar stepback |
.Cm stepfwd Ar stepfwd |
.Cm stepout Ar stepout
.Oc
.Xc
@ -2678,6 +2680,19 @@ adjustments will never occur.
Note: The kernel time discipline is
disabled if the step threshold is set to zero or greater than the
default.
.It Cm stepback Ar stepback
The argument is the step threshold for the backward direction,
which by default is 0.128 s.
It can
be set to any positive number in seconds.
If both the forward and backward step thresholds are set to zero, step
adjustments will never occur.
Note: The kernel time discipline is
disabled if
each direction of step threshold are either
set to zero or greater than .5 second.
.It Cm stepfwd Ar stepfwd
As for stepback, but for the forward direction.
.It Cm stepout Ar stepout
The argument is the stepout timeout, which by default is 900 s.
It can

View File

@ -1,8 +1,8 @@
.TH ntp.keys 5man "04 Feb 2015" "4.2.8p1" "File Formats"
.TH ntp.keys 5man "07 Apr 2015" "4.2.8p2" "File Formats"
.\"
.\" EDIT THIS FILE WITH CAUTION (ntp.man)
.\"
.\" It has been AutoGen-ed February 4, 2015 at 02:41:51 AM by AutoGen 5.18.5pre4
.\" It has been AutoGen-ed April 7, 2015 at 04:25:42 AM by AutoGen 5.18.5pre4
.\" From the definitions ntp.keys.def
.\" and the template file agman-file.tpl
.Sh NAME

View File

@ -1,9 +1,9 @@
.Dd February 4 2015
.Dd April 7 2015
.Dt NTP_KEYS 5mdoc File Formats
.Os SunOS 5.10
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
.\" It has been AutoGen-ed February 4, 2015 at 02:42:10 AM by AutoGen 5.18.5pre4
.\" It has been AutoGen-ed April 7, 2015 at 04:26:00 AM by AutoGen 5.18.5pre4
.\" From the definitions ntp.keys.def
.\" and the template file agmdoc-file.tpl
.Sh NAME

View File

@ -33,7 +33,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<p>This document describes the symmetric key file for the NTP Project's
<code>ntpd</code> program.
<p>This document applies to version 4.2.8p1 of <code>ntp.keys</code>.
<p>This document applies to version 4.2.8p2 of <code>ntp.keys</code>.
<div class="shortcontents">
<h2>Short Contents</h2>

View File

@ -1,8 +1,8 @@
.TH ntp.keys 5 "04 Feb 2015" "4.2.8p1" "File Formats"
.TH ntp.keys 5 "07 Apr 2015" "4.2.8p2" "File Formats"
.\"
.\" EDIT THIS FILE WITH CAUTION (ntp.man)
.\"
.\" It has been AutoGen-ed February 4, 2015 at 02:41:51 AM by AutoGen 5.18.5pre4
.\" It has been AutoGen-ed April 7, 2015 at 04:25:42 AM by AutoGen 5.18.5pre4
.\" From the definitions ntp.keys.def
.\" and the template file agman-file.tpl
.Sh NAME

View File

@ -1,9 +1,9 @@
.Dd February 4 2015
.Dd April 7 2015
.Dt NTP_KEYS 5 File Formats
.Os SunOS 5.10
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
.\" It has been AutoGen-ed February 4, 2015 at 02:42:10 AM by AutoGen 5.18.5pre4
.\" It has been AutoGen-ed April 7, 2015 at 04:26:00 AM by AutoGen 5.18.5pre4
.\" From the definitions ntp.keys.def
.\" and the template file agmdoc-file.tpl
.Sh NAME

View File

@ -2705,6 +2705,14 @@ config_tinker(
item = LOOP_MAX;
break;
case T_Stepback:
item = LOOP_MAX_BACK;
break;
case T_Stepfwd:
item = LOOP_MAX_FWD;
break;
case T_Stepout:
item = LOOP_MINSTEP;
break;

View File

@ -228,7 +228,8 @@ static const struct ctl_proc control_codes[] = {
#define CS_TIMER_OVERRUNS 86
#define CS_TIMER_XMTS 87
#define CS_FUZZ 88
#define CS_MAX_NOAUTOKEY CS_FUZZ
#define CS_WANDER_THRESH 89
#define CS_MAX_NOAUTOKEY CS_WANDER_THRESH
#ifdef AUTOKEY
#define CS_FLAGS (1 + CS_MAX_NOAUTOKEY)
#define CS_HOST (2 + CS_MAX_NOAUTOKEY)
@ -423,6 +424,7 @@ static const struct ctl_var sys_var[] = {
{ CS_TIMER_OVERRUNS, RO, "timer_overruns" }, /* 86 */
{ CS_TIMER_XMTS, RO, "timer_xmts" }, /* 87 */
{ CS_FUZZ, RO, "fuzz" }, /* 88 */
{ CS_WANDER_THRESH, RO, "clk_wander_threshold" }, /* 89 */
#ifdef AUTOKEY
{ CS_FLAGS, RO, "flags" }, /* 1 + CS_MAX_NOAUTOKEY */
{ CS_HOST, RO, "host" }, /* 2 + CS_MAX_NOAUTOKEY */
@ -2327,6 +2329,9 @@ ctl_putsys(
case CS_FUZZ:
ctl_putdbl(sys_var[varid].text, sys_fuzz * 1e3);
break;
case CS_WANDER_THRESH:
ctl_putdbl(sys_var[varid].text, wander_threshold * 1e6);
break;
#ifdef AUTOKEY
case CS_FLAGS:
if (crypto_flags)

View File

@ -1731,7 +1731,7 @@ crypto_args(
tstamp_t tstamp; /* NTP timestamp */
struct exten *ep; /* extension field pointer */
u_int len; /* extension field length */
size_t slen;
size_t slen = 0;
tstamp = crypto_time();
len = sizeof(struct exten);

File diff suppressed because it is too large Load Diff

View File

@ -787,7 +787,7 @@ leapsec_add(
const vint64 * now64 ,
int insert)
{
vint64 ttime, stime;
vint64 ttime, starttime;
struct calendar fts;
leap_info_t li;
@ -815,12 +815,12 @@ leapsec_add(
fts.hour = 0;
fts.minute = 0;
fts.second = 0;
stime = ntpcal_date_to_ntp64(&fts);
starttime = ntpcal_date_to_ntp64(&fts);
fts.month++;
ttime = ntpcal_date_to_ntp64(&fts);
li.ttime = ttime;
li.stime = ttime.D_s.lo - stime.D_s.lo;
li.stime = ttime.D_s.lo - starttime.D_s.lo;
li.taiof = (pt->head.size ? pt->info[0].taiof : pt->head.base_tai)
+ (insert ? 1 : -1);
li.dynls = 1;
@ -839,7 +839,7 @@ leapsec_raw(
int taiof,
int dynls)
{
vint64 stime;
vint64 starttime;
struct calendar fts;
leap_info_t li;
@ -856,9 +856,9 @@ leapsec_raw(
return FALSE;
}
fts.month--; /* was in range 1..12, no overflow here! */
stime = ntpcal_date_to_ntp64(&fts);
starttime = ntpcal_date_to_ntp64(&fts);
li.ttime = *ttime;
li.stime = ttime->D_s.lo - stime.D_s.lo;
li.stime = ttime->D_s.lo - starttime.D_s.lo;
li.taiof = (int16_t)taiof;
li.dynls = (dynls != 0);
return add_range(pt, &li);

View File

@ -106,7 +106,8 @@
/*
* Program variables that can be tinkered.
*/
double clock_max = CLOCK_MAX; /* step threshold */
double clock_max_back = CLOCK_MAX; /* step threshold */
double clock_max_fwd = CLOCK_MAX; /* step threshold */
double clock_minstep = CLOCK_MINSTEP; /* stepout threshold */
double clock_panic = CLOCK_PANIC; /* panic threshold */
double clock_phi = CLOCK_PHI; /* dispersion rate (s/s) */
@ -152,8 +153,10 @@ int kern_enable = TRUE; /* kernel support enabled */
int hardpps_enable; /* kernel PPS discipline enabled */
int ext_enable; /* external clock enabled */
int pps_stratum; /* pps stratum */
int allow_panic = FALSE; /* allow panic correction */
int mode_ntpdate = FALSE; /* exit on first clock set */
int kernel_status; /* from ntp_adjtime */
int allow_panic = FALSE; /* allow panic correction (-g) */
int force_step_once = FALSE; /* always step time once at startup (-G) */
int mode_ntpdate = FALSE; /* exit on first clock set (-q) */
int freq_cnt; /* initial frequency clamp */
int freq_set; /* initial set frequency switch */
@ -279,47 +282,69 @@ ntp_adjtime_error_handler(
}
break;
#ifdef TIME_OK
case TIME_OK: /* 0 no leap second warning */
/* OK means OK */
case TIME_OK: /* 0: synchronized, no leap second warning */
/* msyslog(LOG_INFO, "kernel reports time is synchronized normally"); */
break;
#else
# warning TIME_OK is not defined
#endif
#ifdef TIME_INS
case TIME_INS: /* 1 positive leap second warning */
msyslog(LOG_INFO, "%s: %s line %d: kernel reports positive leap second warning state",
caller, file_name(), line
);
case TIME_INS: /* 1: positive leap second warning */
msyslog(LOG_INFO, "kernel reports leap second insertion scheduled");
break;
#else
# warning TIME_INS is not defined
#endif
#ifdef TIME_DEL
case TIME_DEL: /* 2 negative leap second warning */
msyslog(LOG_INFO, "%s: %s line %d: kernel reports negative leap second warning state",
caller, file_name(), line
);
case TIME_DEL: /* 2: negative leap second warning */
msyslog(LOG_INFO, "kernel reports leap second deletion scheduled");
break;
#else
# warning TIME_DEL is not defined
#endif
#ifdef TIME_OOP
case TIME_OOP: /* 3 leap second in progress */
msyslog(LOG_INFO, "%s: %s line %d: kernel reports leap second in progress",
caller, file_name(), line
);
case TIME_OOP: /* 3: leap second in progress */
msyslog(LOG_INFO, "kernel reports leap second in progress");
break;
#else
# warning TIME_OOP is not defined
#endif
#ifdef TIME_WAIT
case TIME_WAIT: /* 4 leap second has occured */
msyslog(LOG_INFO, "%s: %s line %d: kernel reports leap second has occured",
caller, file_name(), line
);
case TIME_WAIT: /* 4: leap second has occured */
msyslog(LOG_INFO, "kernel reports leap second has occurred");
break;
#else
# warning TIME_WAIT is not defined
#endif
#ifdef TIME_ERROR
case TIME_ERROR: /* loss of synchronization */
case TIME_ERROR: /* 5: unsynchronized, or loss of synchronization */
/* error (see status word) */
if (pps_call && !(ptimex->status & STA_PPSSIGNAL))
report_event(EVNT_KERN, NULL,
"PPS no signal");
errno = saved_errno;
DPRINTF(1, ("kernel loop status (%s) %d %m\n",
k_st_flags(ptimex->status), errno));
/*
* This code may be returned when ntp_adjtime() has just
* been called for the first time, quite a while after
* startup, when ntpd just starts to discipline the kernel
* time. In this case the occurrence of this message
* can be pretty confusing.
*
* HMS: How about a message when we begin kernel processing:
* Determining kernel clock state...
* so an initial TIME_ERROR message is less confising,
* or skipping the first message (ugh),
* or ???
* msyslog(LOG_INFO, "kernel reports time synchronization lost");
*/
errno = saved_errno; /* may not be needed */
msyslog(LOG_INFO, "kernel reports TIME_ERROR: %#x: %s %m",
ptimex->status, k_st_flags(ptimex->status));
break;
#else
# warning TIME_ERROR is not defined
#endif
default:
msyslog(LOG_NOTICE, "%s: %s line %d: unhandled return value %d from ntp_adjtime in %s at line %d",
@ -403,7 +428,8 @@ local_clock(
* directly to the terminal.
*/
if (mode_ntpdate) {
if (fabs(fp_offset) > clock_max && clock_max > 0) {
if ( ( fp_offset > clock_max_fwd && clock_max_fwd > 0)
|| (-fp_offset > clock_max_back && clock_max_back > 0)) {
step_systime(fp_offset);
msyslog(LOG_NOTICE, "ntpd: time set %+.6f s",
fp_offset);
@ -465,7 +491,14 @@ local_clock(
mu = current_time - clock_epoch;
clock_frequency = drift_comp;
rval = 1;
if (fabs(fp_offset) > clock_max && clock_max > 0) {
if ( ( fp_offset > clock_max_fwd && clock_max_fwd > 0)
|| (-fp_offset > clock_max_back && clock_max_back > 0)
|| force_step_once ) {
if (force_step_once) {
force_step_once = FALSE; /* we want this only once after startup */
msyslog(LOG_NOTICE, "Doing intital time step" );
}
switch (state) {
/*
@ -543,7 +576,6 @@ local_clock(
}
rstclock(EVNT_SYNC, 0);
} else {
/*
* The offset is less than the step threshold. Calculate
* the jitter as the exponentially weighted offset
@ -706,7 +738,12 @@ local_clock(
* the pps. In any case, fetch the kernel offset,
* frequency and jitter.
*/
if ((ntp_adj_ret = ntp_adjtime(&ntv)) != 0) {
ntp_adj_ret = ntp_adjtime(&ntv);
/*
* A squeal is a return status < 0, or a state change.
*/
if ((0 > ntp_adj_ret) || (ntp_adj_ret != kernel_status)) {
kernel_status = ntp_adj_ret;
ntp_adjtime_error_handler(__func__, &ntv, ntp_adj_ret, errno, hardpps_enable, 0, __LINE__ - 1);
}
pll_status = ntv.status;
@ -1216,8 +1253,27 @@ loop_config(
break;
case LOOP_MAX: /* step threshold (step) */
clock_max = freq;
if (clock_max == 0 || clock_max > 0.5)
clock_max_fwd = clock_max_back = freq;
if (freq == 0 || freq > 0.5)
select_loop(FALSE);
break;
case LOOP_MAX_BACK: /* step threshold (step) */
clock_max_back = freq;
/*
* Leave using the kernel discipline code unless both
* limits are massive. This assumes the reason to stop
* using it is that it's pointless, not that it goes wrong.
*/
if ( (clock_max_back == 0 || clock_max_back > 0.5)
|| (clock_max_fwd == 0 || clock_max_fwd > 0.5))
select_loop(FALSE);
break;
case LOOP_MAX_FWD: /* step threshold (step) */
clock_max_fwd = freq;
if ( (clock_max_back == 0 || clock_max_back > 0.5)
|| (clock_max_fwd == 0 || clock_max_fwd > 0.5))
select_loop(FALSE);
break;

File diff suppressed because it is too large Load Diff

View File

@ -194,44 +194,46 @@ extern int yydebug;
T_Stats = 404,
T_Statsdir = 405,
T_Step = 406,
T_Stepout = 407,
T_Stratum = 408,
T_String = 409,
T_Sys = 410,
T_Sysstats = 411,
T_Tick = 412,
T_Time1 = 413,
T_Time2 = 414,
T_Timer = 415,
T_Timingstats = 416,
T_Tinker = 417,
T_Tos = 418,
T_Trap = 419,
T_True = 420,
T_Trustedkey = 421,
T_Ttl = 422,
T_Type = 423,
T_U_int = 424,
T_Unconfig = 425,
T_Unpeer = 426,
T_Version = 427,
T_WanderThreshold = 428,
T_Week = 429,
T_Wildcard = 430,
T_Xleave = 431,
T_Year = 432,
T_Flag = 433,
T_EOC = 434,
T_Simulate = 435,
T_Beep_Delay = 436,
T_Sim_Duration = 437,
T_Server_Offset = 438,
T_Duration = 439,
T_Freq_Offset = 440,
T_Wander = 441,
T_Jitter = 442,
T_Prop_Delay = 443,
T_Proc_Delay = 444
T_Stepback = 407,
T_Stepfwd = 408,
T_Stepout = 409,
T_Stratum = 410,
T_String = 411,
T_Sys = 412,
T_Sysstats = 413,
T_Tick = 414,
T_Time1 = 415,
T_Time2 = 416,
T_Timer = 417,
T_Timingstats = 418,
T_Tinker = 419,
T_Tos = 420,
T_Trap = 421,
T_True = 422,
T_Trustedkey = 423,
T_Ttl = 424,
T_Type = 425,
T_U_int = 426,
T_Unconfig = 427,
T_Unpeer = 428,
T_Version = 429,
T_WanderThreshold = 430,
T_Week = 431,
T_Wildcard = 432,
T_Xleave = 433,
T_Year = 434,
T_Flag = 435,
T_EOC = 436,
T_Simulate = 437,
T_Beep_Delay = 438,
T_Sim_Duration = 439,
T_Server_Offset = 440,
T_Duration = 441,
T_Freq_Offset = 442,
T_Wander = 443,
T_Jitter = 444,
T_Prop_Delay = 445,
T_Proc_Delay = 446
};
#endif
/* Tokens. */
@ -384,44 +386,46 @@ extern int yydebug;
#define T_Stats 404
#define T_Statsdir 405
#define T_Step 406
#define T_Stepout 407
#define T_Stratum 408
#define T_String 409
#define T_Sys 410
#define T_Sysstats 411
#define T_Tick 412
#define T_Time1 413
#define T_Time2 414
#define T_Timer 415
#define T_Timingstats 416
#define T_Tinker 417
#define T_Tos 418
#define T_Trap 419
#define T_True 420
#define T_Trustedkey 421
#define T_Ttl 422
#define T_Type 423
#define T_U_int 424
#define T_Unconfig 425
#define T_Unpeer 426
#define T_Version 427
#define T_WanderThreshold 428
#define T_Week 429
#define T_Wildcard 430
#define T_Xleave 431
#define T_Year 432
#define T_Flag 433
#define T_EOC 434
#define T_Simulate 435
#define T_Beep_Delay 436
#define T_Sim_Duration 437
#define T_Server_Offset 438
#define T_Duration 439
#define T_Freq_Offset 440
#define T_Wander 441
#define T_Jitter 442
#define T_Prop_Delay 443
#define T_Proc_Delay 444
#define T_Stepback 407
#define T_Stepfwd 408
#define T_Stepout 409
#define T_Stratum 410
#define T_String 411
#define T_Sys 412
#define T_Sysstats 413
#define T_Tick 414
#define T_Time1 415
#define T_Time2 416
#define T_Timer 417
#define T_Timingstats 418
#define T_Tinker 419
#define T_Tos 420
#define T_Trap 421
#define T_True 422
#define T_Trustedkey 423
#define T_Ttl 424
#define T_Type 425
#define T_U_int 426
#define T_Unconfig 427
#define T_Unpeer 428
#define T_Version 429
#define T_WanderThreshold 430
#define T_Week 431
#define T_Wildcard 432
#define T_Xleave 433
#define T_Year 434
#define T_Flag 435
#define T_EOC 436
#define T_Simulate 437
#define T_Beep_Delay 438
#define T_Sim_Duration 439
#define T_Server_Offset 440
#define T_Duration 441
#define T_Freq_Offset 442
#define T_Wander 443
#define T_Jitter 444
#define T_Prop_Delay 445
#define T_Proc_Delay 446
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
@ -447,7 +451,7 @@ union YYSTYPE
script_info * Sim_script;
script_info_fifo * Sim_script_fifo;
#line 451 "ntp_parser.h" /* yacc.c:1909 */
#line 455 "ntp_parser.h" /* yacc.c:1909 */
};
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1

View File

@ -92,6 +92,7 @@ int peer_free_count; /* count of free structures */
* value every time an association is mobilized.
*/
static associd_t current_association_ID; /* association ID */
static associd_t initial_association_ID; /* association ID */
/*
* Memory allocation watermarks.
@ -147,6 +148,7 @@ init_peer(void)
do
current_association_ID = ntp_random() & ASSOCID_MAX;
while (!current_association_ID);
initial_association_ID = current_association_ID;
}
@ -1036,3 +1038,21 @@ findmanycastpeer(
return peer;
}
/* peer_cleanup - clean peer list prior to shutdown */
void peer_cleanup(void)
{
struct peer *peer;
associd_t assoc;
for (assoc = initial_association_ID; assoc != current_association_ID; assoc++) {
if (assoc != 0U) {
peer = findpeerbyassoc(assoc);
if (peer != NULL)
unpeer(peer);
}
}
peer = findpeerbyassoc(current_association_ID);
if (peer != NULL)
unpeer(peer);
}

View File

@ -1255,16 +1255,6 @@ receive(
peer->flash |= TEST2; /* bogus */
}
/*
* Update the state variables.
*/
if (peer->flip == 0) {
if (hismode != MODE_BROADCAST)
peer->rec = p_xmt;
peer->dst = rbufp->recv_time;
}
peer->xmt = p_xmt;
/*
* If this is a crypto_NAK, the server cannot authenticate a
* client packet. The server might have just changed keys. Clear
@ -1285,18 +1275,20 @@ receive(
return;
/*
* If the digest fails, the client cannot authenticate a server
* If the digest fails or it's missing for authenticated
* associations, the client cannot authenticate a server
* reply to a client packet previously sent. The loopback check
* is designed to avoid a bait-and-switch attack, which was
* possible in past versions. If symmetric modes, return a
* crypto-NAK. The peer should restart the protocol.
*/
} else if (!AUTH(has_mac || (restrict_mask & RES_DONTTRUST),
is_authentic)) {
} else if (!AUTH(peer->keyid || has_mac ||
(restrict_mask & RES_DONTTRUST), is_authentic)) {
report_event(PEVNT_AUTH, peer, "digest");
peer->flash |= TEST5; /* bad auth */
peer->badauth++;
if (hismode == MODE_ACTIVE || hismode == MODE_PASSIVE)
if (has_mac &&
(hismode == MODE_ACTIVE || hismode == MODE_PASSIVE))
fast_xmit(rbufp, MODE_ACTIVE, 0, restrict_mask);
if (peer->flags & FLAG_PREEMPT) {
unpeer(peer);
@ -1309,6 +1301,16 @@ receive(
return;
}
/*
* Update the state variables.
*/
if (peer->flip == 0) {
if (hismode != MODE_BROADCAST)
peer->rec = p_xmt;
peer->dst = rbufp->recv_time;
}
peer->xmt = p_xmt;
/*
* Set the peer ppoll to the maximum of the packet ppoll and the
* peer minpoll. If a kiss-o'-death, set the peer minpoll to
@ -2661,6 +2663,7 @@ clock_select(void)
if (peer->flags & FLAG_PPS) {
if (typepps == NULL)
typepps = peer;
if (!(peer->flags & FLAG_TSTAMP_PPS))
continue;
}
#endif /* REFCLOCK */

View File

@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpd-opts.c)
*
* It has been AutoGen-ed February 4, 2015 at 02:39:17 AM by AutoGen 5.18.5pre4
* It has been AutoGen-ed April 7, 2015 at 04:23:14 AM by AutoGen 5.18.5pre4
* From the definitions ntpd-opts.def
* and the template file options
*
@ -74,8 +74,8 @@ extern FILE * option_usage_fp;
/**
* static const strings for ntpd options
*/
static char const ntpd_opt_strs[3061] =
/* 0 */ "ntpd 4.2.8p1\n"
static char const ntpd_opt_strs[3129] =
/* 0 */ "ntpd 4.2.8p2\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"
@ -122,92 +122,95 @@ static char const ntpd_opt_strs[3061] =
/* 1460 */ "Allow the first adjustment to be Big\0"
/* 1497 */ "PANICGATE\0"
/* 1507 */ "panicgate\0"
/* 1517 */ "Jail directory\0"
/* 1532 */ "JAILDIR\0"
/* 1540 */ "jaildir\0"
/* 1548 */ "built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs\0"
/* 1627 */ "Listen on an interface name or address\0"
/* 1666 */ "INTERFACE\0"
/* 1676 */ "interface\0"
/* 1686 */ "path to symmetric keys\0"
/* 1709 */ "KEYFILE\0"
/* 1717 */ "keyfile\0"
/* 1725 */ "path to the log file\0"
/* 1746 */ "LOGFILE\0"
/* 1754 */ "logfile\0"
/* 1762 */ "Do not listen to virtual interfaces\0"
/* 1798 */ "NOVIRTUALIPS\0"
/* 1811 */ "novirtualips\0"
/* 1824 */ "Modify Multimedia Timer (Windows only)\0"
/* 1863 */ "MODIFYMMTIMER\0"
/* 1877 */ "modifymmtimer\0"
/* 1891 */ "Do not fork\0"
/* 1903 */ "NOFORK\0"
/* 1910 */ "nofork\0"
/* 1917 */ "Run at high priority\0"
/* 1938 */ "NICE\0"
/* 1943 */ "nice\0"
/* 1948 */ "path to the PID file\0"
/* 1969 */ "PIDFILE\0"
/* 1977 */ "pidfile\0"
/* 1985 */ "Process priority\0"
/* 2002 */ "PRIORITY\0"
/* 2011 */ "priority\0"
/* 2020 */ "Set the time and quit\0"
/* 2042 */ "QUIT\0"
/* 2047 */ "quit\0"
/* 2052 */ "Broadcast/propagation delay\0"
/* 2080 */ "PROPAGATIONDELAY\0"
/* 2097 */ "propagationdelay\0"
/* 2114 */ "Save parsed configuration and quit\0"
/* 2149 */ "SAVECONFIGQUIT\0"
/* 2164 */ "saveconfigquit\0"
/* 2179 */ "Statistics file location\0"
/* 2204 */ "STATSDIR\0"
/* 2213 */ "statsdir\0"
/* 2222 */ "Trusted key number\0"
/* 2241 */ "TRUSTEDKEY\0"
/* 2252 */ "trustedkey\0"
/* 2263 */ "Run as userid (or userid:groupid)\0"
/* 2297 */ "USER\0"
/* 2302 */ "user\0"
/* 2307 */ "interval in seconds between scans for new or dropped interfaces\0"
/* 2371 */ "UPDATEINTERVAL\0"
/* 2386 */ "updateinterval\0"
/* 2401 */ "make ARG an ntp variable (RW)\0"
/* 2431 */ "VAR\0"
/* 2435 */ "var\0"
/* 2439 */ "make ARG an ntp variable (RW|DEF)\0"
/* 2473 */ "DVAR\0"
/* 2478 */ "dvar\0"
/* 2483 */ "Seconds to wait for first clock sync\0"
/* 2520 */ "WAIT_SYNC\0"
/* 2530 */ "wait-sync\0"
/* 2540 */ "Slew up to 600 seconds\0"
/* 2563 */ "SLEW\0"
/* 2568 */ "slew\0"
/* 2573 */ "Use CPU cycle counter (Windows only)\0"
/* 2610 */ "USEPCC\0"
/* 2617 */ "usepcc\0"
/* 2624 */ "Force CPU cycle counter use (Windows only)\0"
/* 2667 */ "PCCFREQ\0"
/* 2675 */ "pccfreq\0"
/* 2683 */ "Register with mDNS as a NTP server\0"
/* 2718 */ "MDNS\0"
/* 2723 */ "mdns\0"
/* 2728 */ "display extended usage information and exit\0"
/* 2772 */ "help\0"
/* 2777 */ "extended usage information passed thru pager\0"
/* 2822 */ "more-help\0"
/* 2832 */ "output version information and exit\0"
/* 2868 */ "version\0"
/* 2876 */ "NTPD\0"
/* 2881 */ "ntpd - NTP daemon program - Ver. 4.2.8p1\n"
/* 1517 */ "Step any initial offset correction.\0"
/* 1553 */ "FORCE_STEP_ONCE\0"
/* 1569 */ "force-step-once\0"
/* 1585 */ "Jail directory\0"
/* 1600 */ "JAILDIR\0"
/* 1608 */ "jaildir\0"
/* 1616 */ "built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs\0"
/* 1695 */ "Listen on an interface name or address\0"
/* 1734 */ "INTERFACE\0"
/* 1744 */ "interface\0"
/* 1754 */ "path to symmetric keys\0"
/* 1777 */ "KEYFILE\0"
/* 1785 */ "keyfile\0"
/* 1793 */ "path to the log file\0"
/* 1814 */ "LOGFILE\0"
/* 1822 */ "logfile\0"
/* 1830 */ "Do not listen to virtual interfaces\0"
/* 1866 */ "NOVIRTUALIPS\0"
/* 1879 */ "novirtualips\0"
/* 1892 */ "Modify Multimedia Timer (Windows only)\0"
/* 1931 */ "MODIFYMMTIMER\0"
/* 1945 */ "modifymmtimer\0"
/* 1959 */ "Do not fork\0"
/* 1971 */ "NOFORK\0"
/* 1978 */ "nofork\0"
/* 1985 */ "Run at high priority\0"
/* 2006 */ "NICE\0"
/* 2011 */ "nice\0"
/* 2016 */ "path to the PID file\0"
/* 2037 */ "PIDFILE\0"
/* 2045 */ "pidfile\0"
/* 2053 */ "Process priority\0"
/* 2070 */ "PRIORITY\0"
/* 2079 */ "priority\0"
/* 2088 */ "Set the time and quit\0"
/* 2110 */ "QUIT\0"
/* 2115 */ "quit\0"
/* 2120 */ "Broadcast/propagation delay\0"
/* 2148 */ "PROPAGATIONDELAY\0"
/* 2165 */ "propagationdelay\0"
/* 2182 */ "Save parsed configuration and quit\0"
/* 2217 */ "SAVECONFIGQUIT\0"
/* 2232 */ "saveconfigquit\0"
/* 2247 */ "Statistics file location\0"
/* 2272 */ "STATSDIR\0"
/* 2281 */ "statsdir\0"
/* 2290 */ "Trusted key number\0"
/* 2309 */ "TRUSTEDKEY\0"
/* 2320 */ "trustedkey\0"
/* 2331 */ "Run as userid (or userid:groupid)\0"
/* 2365 */ "USER\0"
/* 2370 */ "user\0"
/* 2375 */ "interval in seconds between scans for new or dropped interfaces\0"
/* 2439 */ "UPDATEINTERVAL\0"
/* 2454 */ "updateinterval\0"
/* 2469 */ "make ARG an ntp variable (RW)\0"
/* 2499 */ "VAR\0"
/* 2503 */ "var\0"
/* 2507 */ "make ARG an ntp variable (RW|DEF)\0"
/* 2541 */ "DVAR\0"
/* 2546 */ "dvar\0"
/* 2551 */ "Seconds to wait for first clock sync\0"
/* 2588 */ "WAIT_SYNC\0"
/* 2598 */ "wait-sync\0"
/* 2608 */ "Slew up to 600 seconds\0"
/* 2631 */ "SLEW\0"
/* 2636 */ "slew\0"
/* 2641 */ "Use CPU cycle counter (Windows only)\0"
/* 2678 */ "USEPCC\0"
/* 2685 */ "usepcc\0"
/* 2692 */ "Force CPU cycle counter use (Windows only)\0"
/* 2735 */ "PCCFREQ\0"
/* 2743 */ "pccfreq\0"
/* 2751 */ "Register with mDNS as a NTP server\0"
/* 2786 */ "MDNS\0"
/* 2791 */ "mdns\0"
/* 2796 */ "display extended usage information and exit\0"
/* 2840 */ "help\0"
/* 2845 */ "extended usage information passed thru pager\0"
/* 2890 */ "more-help\0"
/* 2900 */ "output version information and exit\0"
/* 2936 */ "version\0"
/* 2944 */ "NTPD\0"
/* 2949 */ "ntpd - NTP daemon program - Ver. 4.2.8p2\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n"
"\t\t[ <server1> ... <serverN> ]\n\0"
/* 3012 */ "http://bugs.ntp.org, bugs@ntp.org\0"
/* 3046 */ "\n\0"
/* 3048 */ "ntpd 4.2.8p1";
/* 3080 */ "http://bugs.ntp.org, bugs@ntp.org\0"
/* 3114 */ "\n\0"
/* 3116 */ "ntpd 4.2.8p2";
/**
* ipv4 option description with
@ -348,16 +351,28 @@ static int const aAuthnoreqCantList[] = {
/** Compiled in flag settings for the panicgate option */
#define PANICGATE_FLAGS (OPTST_DISABLED)
/**
* force_step_once option description:
*/
/** Descriptive text for the force_step_once option */
#define FORCE_STEP_ONCE_DESC (ntpd_opt_strs+1517)
/** Upper-cased name for the force_step_once option */
#define FORCE_STEP_ONCE_NAME (ntpd_opt_strs+1553)
/** Name string for the force_step_once option */
#define FORCE_STEP_ONCE_name (ntpd_opt_strs+1569)
/** Compiled in flag settings for the force_step_once option */
#define FORCE_STEP_ONCE_FLAGS (OPTST_DISABLED)
/**
* jaildir option description:
*/
#ifdef HAVE_DROPROOT
/** Descriptive text for the jaildir option */
#define JAILDIR_DESC (ntpd_opt_strs+1517)
#define JAILDIR_DESC (ntpd_opt_strs+1585)
/** Upper-cased name for the jaildir option */
#define JAILDIR_NAME (ntpd_opt_strs+1532)
#define JAILDIR_NAME (ntpd_opt_strs+1600)
/** Name string for the jaildir option */
#define JAILDIR_name (ntpd_opt_strs+1540)
#define JAILDIR_name (ntpd_opt_strs+1608)
/** Compiled in flag settings for the jaildir option */
#define JAILDIR_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@ -366,19 +381,19 @@ static int const aAuthnoreqCantList[] = {
#define JAILDIR_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
#define JAILDIR_NAME NULL
/** Descriptive text for the jaildir option */
#define JAILDIR_DESC (ntpd_opt_strs+1548)
#define JAILDIR_name (ntpd_opt_strs+1540)
#define JAILDIR_DESC (ntpd_opt_strs+1616)
#define JAILDIR_name (ntpd_opt_strs+1608)
#endif /* HAVE_DROPROOT */
/**
* interface option description:
*/
/** Descriptive text for the interface option */
#define INTERFACE_DESC (ntpd_opt_strs+1627)
#define INTERFACE_DESC (ntpd_opt_strs+1695)
/** Upper-cased name for the interface option */
#define INTERFACE_NAME (ntpd_opt_strs+1666)
#define INTERFACE_NAME (ntpd_opt_strs+1734)
/** Name string for the interface option */
#define INTERFACE_name (ntpd_opt_strs+1676)
#define INTERFACE_name (ntpd_opt_strs+1744)
/** Compiled in flag settings for the interface option */
#define INTERFACE_FLAGS (OPTST_DISABLED | OPTST_STACKED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@ -387,11 +402,11 @@ static int const aAuthnoreqCantList[] = {
* keyfile option description:
*/
/** Descriptive text for the keyfile option */
#define KEYFILE_DESC (ntpd_opt_strs+1686)
#define KEYFILE_DESC (ntpd_opt_strs+1754)
/** Upper-cased name for the keyfile option */
#define KEYFILE_NAME (ntpd_opt_strs+1709)
#define KEYFILE_NAME (ntpd_opt_strs+1777)
/** Name string for the keyfile option */
#define KEYFILE_name (ntpd_opt_strs+1717)
#define KEYFILE_name (ntpd_opt_strs+1785)
/** Compiled in flag settings for the keyfile option */
#define KEYFILE_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@ -400,11 +415,11 @@ static int const aAuthnoreqCantList[] = {
* logfile option description:
*/
/** Descriptive text for the logfile option */
#define LOGFILE_DESC (ntpd_opt_strs+1725)
#define LOGFILE_DESC (ntpd_opt_strs+1793)
/** Upper-cased name for the logfile option */
#define LOGFILE_NAME (ntpd_opt_strs+1746)
#define LOGFILE_NAME (ntpd_opt_strs+1814)
/** Name string for the logfile option */
#define LOGFILE_name (ntpd_opt_strs+1754)
#define LOGFILE_name (ntpd_opt_strs+1822)
/** Compiled in flag settings for the logfile option */
#define LOGFILE_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@ -413,11 +428,11 @@ static int const aAuthnoreqCantList[] = {
* novirtualips option description:
*/
/** Descriptive text for the novirtualips option */
#define NOVIRTUALIPS_DESC (ntpd_opt_strs+1762)
#define NOVIRTUALIPS_DESC (ntpd_opt_strs+1830)
/** Upper-cased name for the novirtualips option */
#define NOVIRTUALIPS_NAME (ntpd_opt_strs+1798)
#define NOVIRTUALIPS_NAME (ntpd_opt_strs+1866)
/** Name string for the novirtualips option */
#define NOVIRTUALIPS_name (ntpd_opt_strs+1811)
#define NOVIRTUALIPS_name (ntpd_opt_strs+1879)
/** Compiled in flag settings for the novirtualips option */
#define NOVIRTUALIPS_FLAGS (OPTST_DISABLED)
@ -426,11 +441,11 @@ static int const aAuthnoreqCantList[] = {
*/
#ifdef SYS_WINNT
/** Descriptive text for the modifymmtimer option */
#define MODIFYMMTIMER_DESC (ntpd_opt_strs+1824)
#define MODIFYMMTIMER_DESC (ntpd_opt_strs+1892)
/** Upper-cased name for the modifymmtimer option */
#define MODIFYMMTIMER_NAME (ntpd_opt_strs+1863)
#define MODIFYMMTIMER_NAME (ntpd_opt_strs+1931)
/** Name string for the modifymmtimer option */
#define MODIFYMMTIMER_name (ntpd_opt_strs+1877)
#define MODIFYMMTIMER_name (ntpd_opt_strs+1945)
/** Compiled in flag settings for the modifymmtimer option */
#define MODIFYMMTIMER_FLAGS (OPTST_DISABLED)
@ -446,11 +461,11 @@ static int const aAuthnoreqCantList[] = {
* "Must also have options" and "Incompatible options":
*/
/** Descriptive text for the nofork option */
#define NOFORK_DESC (ntpd_opt_strs+1891)
#define NOFORK_DESC (ntpd_opt_strs+1959)
/** Upper-cased name for the nofork option */
#define NOFORK_NAME (ntpd_opt_strs+1903)
#define NOFORK_NAME (ntpd_opt_strs+1971)
/** Name string for the nofork option */
#define NOFORK_name (ntpd_opt_strs+1910)
#define NOFORK_name (ntpd_opt_strs+1978)
/** Other options that appear in conjunction with the nofork option */
static int const aNoforkCantList[] = {
INDEX_OPT_WAIT_SYNC, NO_EQUIVALENT };
@ -461,11 +476,11 @@ static int const aNoforkCantList[] = {
* nice option description:
*/
/** Descriptive text for the nice option */
#define NICE_DESC (ntpd_opt_strs+1917)
#define NICE_DESC (ntpd_opt_strs+1985)
/** Upper-cased name for the nice option */
#define NICE_NAME (ntpd_opt_strs+1938)
#define NICE_NAME (ntpd_opt_strs+2006)
/** Name string for the nice option */
#define NICE_name (ntpd_opt_strs+1943)
#define NICE_name (ntpd_opt_strs+2011)
/** Compiled in flag settings for the nice option */
#define NICE_FLAGS (OPTST_DISABLED)
@ -473,11 +488,11 @@ static int const aNoforkCantList[] = {
* pidfile option description:
*/
/** Descriptive text for the pidfile option */
#define PIDFILE_DESC (ntpd_opt_strs+1948)
#define PIDFILE_DESC (ntpd_opt_strs+2016)
/** Upper-cased name for the pidfile option */
#define PIDFILE_NAME (ntpd_opt_strs+1969)
#define PIDFILE_NAME (ntpd_opt_strs+2037)
/** Name string for the pidfile option */
#define PIDFILE_name (ntpd_opt_strs+1977)
#define PIDFILE_name (ntpd_opt_strs+2045)
/** Compiled in flag settings for the pidfile option */
#define PIDFILE_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@ -486,11 +501,11 @@ static int const aNoforkCantList[] = {
* priority option description:
*/
/** Descriptive text for the priority option */
#define PRIORITY_DESC (ntpd_opt_strs+1985)
#define PRIORITY_DESC (ntpd_opt_strs+2053)
/** Upper-cased name for the priority option */
#define PRIORITY_NAME (ntpd_opt_strs+2002)
#define PRIORITY_NAME (ntpd_opt_strs+2070)
/** Name string for the priority option */
#define PRIORITY_name (ntpd_opt_strs+2011)
#define PRIORITY_name (ntpd_opt_strs+2079)
/** Compiled in flag settings for the priority option */
#define PRIORITY_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@ -500,11 +515,11 @@ static int const aNoforkCantList[] = {
* "Must also have options" and "Incompatible options":
*/
/** Descriptive text for the quit option */
#define QUIT_DESC (ntpd_opt_strs+2020)
#define QUIT_DESC (ntpd_opt_strs+2088)
/** Upper-cased name for the quit option */
#define QUIT_NAME (ntpd_opt_strs+2042)
#define QUIT_NAME (ntpd_opt_strs+2110)
/** Name string for the quit option */
#define QUIT_name (ntpd_opt_strs+2047)
#define QUIT_name (ntpd_opt_strs+2115)
/** Other options that appear in conjunction with the quit option */
static int const aQuitCantList[] = {
INDEX_OPT_SAVECONFIGQUIT,
@ -516,11 +531,11 @@ static int const aQuitCantList[] = {
* propagationdelay option description:
*/
/** Descriptive text for the propagationdelay option */
#define PROPAGATIONDELAY_DESC (ntpd_opt_strs+2052)
#define PROPAGATIONDELAY_DESC (ntpd_opt_strs+2120)
/** Upper-cased name for the propagationdelay option */
#define PROPAGATIONDELAY_NAME (ntpd_opt_strs+2080)
#define PROPAGATIONDELAY_NAME (ntpd_opt_strs+2148)
/** Name string for the propagationdelay option */
#define PROPAGATIONDELAY_name (ntpd_opt_strs+2097)
#define PROPAGATIONDELAY_name (ntpd_opt_strs+2165)
/** Compiled in flag settings for the propagationdelay option */
#define PROPAGATIONDELAY_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@ -531,11 +546,11 @@ static int const aQuitCantList[] = {
*/
#ifdef SAVECONFIG
/** Descriptive text for the saveconfigquit option */
#define SAVECONFIGQUIT_DESC (ntpd_opt_strs+2114)
#define SAVECONFIGQUIT_DESC (ntpd_opt_strs+2182)
/** Upper-cased name for the saveconfigquit option */
#define SAVECONFIGQUIT_NAME (ntpd_opt_strs+2149)
#define SAVECONFIGQUIT_NAME (ntpd_opt_strs+2217)
/** Name string for the saveconfigquit option */
#define SAVECONFIGQUIT_name (ntpd_opt_strs+2164)
#define SAVECONFIGQUIT_name (ntpd_opt_strs+2232)
/** Other options that appear in conjunction with the saveconfigquit option */
static int const aSaveconfigquitCantList[] = {
INDEX_OPT_QUIT,
@ -556,11 +571,11 @@ static int const aSaveconfigquitCantList[] = {
* statsdir option description:
*/
/** Descriptive text for the statsdir option */
#define STATSDIR_DESC (ntpd_opt_strs+2179)
#define STATSDIR_DESC (ntpd_opt_strs+2247)
/** Upper-cased name for the statsdir option */
#define STATSDIR_NAME (ntpd_opt_strs+2204)
#define STATSDIR_NAME (ntpd_opt_strs+2272)
/** Name string for the statsdir option */
#define STATSDIR_name (ntpd_opt_strs+2213)
#define STATSDIR_name (ntpd_opt_strs+2281)
/** Compiled in flag settings for the statsdir option */
#define STATSDIR_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@ -569,11 +584,11 @@ static int const aSaveconfigquitCantList[] = {
* trustedkey option description:
*/
/** Descriptive text for the trustedkey option */
#define TRUSTEDKEY_DESC (ntpd_opt_strs+2222)
#define TRUSTEDKEY_DESC (ntpd_opt_strs+2290)
/** Upper-cased name for the trustedkey option */
#define TRUSTEDKEY_NAME (ntpd_opt_strs+2241)
#define TRUSTEDKEY_NAME (ntpd_opt_strs+2309)
/** Name string for the trustedkey option */
#define TRUSTEDKEY_name (ntpd_opt_strs+2252)
#define TRUSTEDKEY_name (ntpd_opt_strs+2320)
/** Compiled in flag settings for the trustedkey option */
#define TRUSTEDKEY_FLAGS (OPTST_DISABLED | OPTST_STACKED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@ -583,11 +598,11 @@ static int const aSaveconfigquitCantList[] = {
*/
#ifdef HAVE_DROPROOT
/** Descriptive text for the user option */
#define USER_DESC (ntpd_opt_strs+2263)
#define USER_DESC (ntpd_opt_strs+2331)
/** Upper-cased name for the user option */
#define USER_NAME (ntpd_opt_strs+2297)
#define USER_NAME (ntpd_opt_strs+2365)
/** Name string for the user option */
#define USER_name (ntpd_opt_strs+2302)
#define USER_name (ntpd_opt_strs+2370)
/** Compiled in flag settings for the user option */
#define USER_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@ -596,19 +611,19 @@ static int const aSaveconfigquitCantList[] = {
#define USER_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
#define USER_NAME NULL
/** Descriptive text for the user option */
#define USER_DESC (ntpd_opt_strs+1548)
#define USER_name (ntpd_opt_strs+2302)
#define USER_DESC (ntpd_opt_strs+1616)
#define USER_name (ntpd_opt_strs+2370)
#endif /* HAVE_DROPROOT */
/**
* updateinterval option description:
*/
/** Descriptive text for the updateinterval option */
#define UPDATEINTERVAL_DESC (ntpd_opt_strs+2307)
#define UPDATEINTERVAL_DESC (ntpd_opt_strs+2375)
/** Upper-cased name for the updateinterval option */
#define UPDATEINTERVAL_NAME (ntpd_opt_strs+2371)
#define UPDATEINTERVAL_NAME (ntpd_opt_strs+2439)
/** Name string for the updateinterval option */
#define UPDATEINTERVAL_name (ntpd_opt_strs+2386)
#define UPDATEINTERVAL_name (ntpd_opt_strs+2454)
/** Compiled in flag settings for the updateinterval option */
#define UPDATEINTERVAL_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@ -617,11 +632,11 @@ static int const aSaveconfigquitCantList[] = {
* var option description:
*/
/** Descriptive text for the var option */
#define VAR_DESC (ntpd_opt_strs+2401)
#define VAR_DESC (ntpd_opt_strs+2469)
/** Upper-cased name for the var option */
#define VAR_NAME (ntpd_opt_strs+2431)
#define VAR_NAME (ntpd_opt_strs+2499)
/** Name string for the var option */
#define VAR_name (ntpd_opt_strs+2435)
#define VAR_name (ntpd_opt_strs+2503)
/** Compiled in flag settings for the var option */
#define VAR_FLAGS (OPTST_DISABLED | OPTST_STACKED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@ -630,11 +645,11 @@ static int const aSaveconfigquitCantList[] = {
* dvar option description:
*/
/** Descriptive text for the dvar option */
#define DVAR_DESC (ntpd_opt_strs+2439)
#define DVAR_DESC (ntpd_opt_strs+2507)
/** Upper-cased name for the dvar option */
#define DVAR_NAME (ntpd_opt_strs+2473)
#define DVAR_NAME (ntpd_opt_strs+2541)
/** Name string for the dvar option */
#define DVAR_name (ntpd_opt_strs+2478)
#define DVAR_name (ntpd_opt_strs+2546)
/** Compiled in flag settings for the dvar option */
#define DVAR_FLAGS (OPTST_DISABLED | OPTST_STACKED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@ -645,11 +660,11 @@ static int const aSaveconfigquitCantList[] = {
*/
#ifdef HAVE_WORKING_FORK
/** Descriptive text for the wait-sync option */
#define WAIT_SYNC_DESC (ntpd_opt_strs+2483)
#define WAIT_SYNC_DESC (ntpd_opt_strs+2551)
/** Upper-cased name for the wait-sync option */
#define WAIT_SYNC_NAME (ntpd_opt_strs+2520)
#define WAIT_SYNC_NAME (ntpd_opt_strs+2588)
/** Name string for the wait-sync option */
#define WAIT_SYNC_name (ntpd_opt_strs+2530)
#define WAIT_SYNC_name (ntpd_opt_strs+2598)
/** Other options that appear in conjunction with the wait-sync option */
static int const aWait_SyncCantList[] = {
INDEX_OPT_NOFORK,
@ -671,11 +686,11 @@ static int const aWait_SyncCantList[] = {
* slew option description:
*/
/** Descriptive text for the slew option */
#define SLEW_DESC (ntpd_opt_strs+2540)
#define SLEW_DESC (ntpd_opt_strs+2608)
/** Upper-cased name for the slew option */
#define SLEW_NAME (ntpd_opt_strs+2563)
#define SLEW_NAME (ntpd_opt_strs+2631)
/** Name string for the slew option */
#define SLEW_name (ntpd_opt_strs+2568)
#define SLEW_name (ntpd_opt_strs+2636)
/** Compiled in flag settings for the slew option */
#define SLEW_FLAGS (OPTST_DISABLED)
@ -684,11 +699,11 @@ static int const aWait_SyncCantList[] = {
*/
#ifdef SYS_WINNT
/** Descriptive text for the usepcc option */
#define USEPCC_DESC (ntpd_opt_strs+2573)
#define USEPCC_DESC (ntpd_opt_strs+2641)
/** Upper-cased name for the usepcc option */
#define USEPCC_NAME (ntpd_opt_strs+2610)
#define USEPCC_NAME (ntpd_opt_strs+2678)
/** Name string for the usepcc option */
#define USEPCC_name (ntpd_opt_strs+2617)
#define USEPCC_name (ntpd_opt_strs+2685)
/** Compiled in flag settings for the usepcc option */
#define USEPCC_FLAGS (OPTST_DISABLED)
@ -704,11 +719,11 @@ static int const aWait_SyncCantList[] = {
*/
#ifdef SYS_WINNT
/** Descriptive text for the pccfreq option */
#define PCCFREQ_DESC (ntpd_opt_strs+2624)
#define PCCFREQ_DESC (ntpd_opt_strs+2692)
/** Upper-cased name for the pccfreq option */
#define PCCFREQ_NAME (ntpd_opt_strs+2667)
#define PCCFREQ_NAME (ntpd_opt_strs+2735)
/** Name string for the pccfreq option */
#define PCCFREQ_name (ntpd_opt_strs+2675)
#define PCCFREQ_name (ntpd_opt_strs+2743)
/** Compiled in flag settings for the pccfreq option */
#define PCCFREQ_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@ -725,11 +740,11 @@ static int const aWait_SyncCantList[] = {
*/
#ifdef HAVE_DNSREGISTRATION
/** Descriptive text for the mdns option */
#define MDNS_DESC (ntpd_opt_strs+2683)
#define MDNS_DESC (ntpd_opt_strs+2751)
/** Upper-cased name for the mdns option */
#define MDNS_NAME (ntpd_opt_strs+2718)
#define MDNS_NAME (ntpd_opt_strs+2786)
/** Name string for the mdns option */
#define MDNS_name (ntpd_opt_strs+2723)
#define MDNS_name (ntpd_opt_strs+2791)
/** Compiled in flag settings for the mdns option */
#define MDNS_FLAGS (OPTST_DISABLED)
@ -743,11 +758,11 @@ static int const aWait_SyncCantList[] = {
/*
* Help/More_Help/Version option descriptions:
*/
#define HELP_DESC (ntpd_opt_strs+2728)
#define HELP_name (ntpd_opt_strs+2772)
#define HELP_DESC (ntpd_opt_strs+2796)
#define HELP_name (ntpd_opt_strs+2840)
#ifdef HAVE_WORKING_FORK
#define MORE_HELP_DESC (ntpd_opt_strs+2777)
#define MORE_HELP_name (ntpd_opt_strs+2822)
#define MORE_HELP_DESC (ntpd_opt_strs+2845)
#define MORE_HELP_name (ntpd_opt_strs+2890)
#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
#else
#define MORE_HELP_DESC HELP_DESC
@ -760,8 +775,8 @@ static int const aWait_SyncCantList[] = {
# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
#endif
#define VER_DESC (ntpd_opt_strs+2832)
#define VER_name (ntpd_opt_strs+2868)
#define VER_DESC (ntpd_opt_strs+2900)
#define VER_name (ntpd_opt_strs+2936)
/**
* Declare option callback procedures
*/
@ -901,8 +916,20 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ PANICGATE_DESC, PANICGATE_NAME, PANICGATE_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 10, VALUE_OPT_JAILDIR,
/* equiv idx, value */ 10, VALUE_OPT_JAILDIR,
{ /* entry idx, value */ 10, VALUE_OPT_FORCE_STEP_ONCE,
/* equiv idx, value */ 10, VALUE_OPT_FORCE_STEP_ONCE,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ FORCE_STEP_ONCE_FLAGS, 0,
/* last opt argumnt */ { NULL }, /* --force_step_once */
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ NULL,
/* desc, NAME, name */ FORCE_STEP_ONCE_DESC, FORCE_STEP_ONCE_NAME, FORCE_STEP_ONCE_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 11, VALUE_OPT_JAILDIR,
/* equiv idx, value */ 11, VALUE_OPT_JAILDIR,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ JAILDIR_FLAGS, 0,
@ -913,8 +940,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ JAILDIR_DESC, JAILDIR_NAME, JAILDIR_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 11, VALUE_OPT_INTERFACE,
/* equiv idx, value */ 11, VALUE_OPT_INTERFACE,
{ /* entry idx, value */ 12, VALUE_OPT_INTERFACE,
/* equiv idx, value */ 12, VALUE_OPT_INTERFACE,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, NOLIMIT, 0,
/* opt state flags */ INTERFACE_FLAGS, 0,
@ -925,8 +952,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ INTERFACE_DESC, INTERFACE_NAME, INTERFACE_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 12, VALUE_OPT_KEYFILE,
/* equiv idx, value */ 12, VALUE_OPT_KEYFILE,
{ /* entry idx, value */ 13, VALUE_OPT_KEYFILE,
/* equiv idx, value */ 13, VALUE_OPT_KEYFILE,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ KEYFILE_FLAGS, 0,
@ -937,8 +964,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ KEYFILE_DESC, KEYFILE_NAME, KEYFILE_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 13, VALUE_OPT_LOGFILE,
/* equiv idx, value */ 13, VALUE_OPT_LOGFILE,
{ /* entry idx, value */ 14, VALUE_OPT_LOGFILE,
/* equiv idx, value */ 14, VALUE_OPT_LOGFILE,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ LOGFILE_FLAGS, 0,
@ -949,8 +976,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ LOGFILE_DESC, LOGFILE_NAME, LOGFILE_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 14, VALUE_OPT_NOVIRTUALIPS,
/* equiv idx, value */ 14, VALUE_OPT_NOVIRTUALIPS,
{ /* entry idx, value */ 15, VALUE_OPT_NOVIRTUALIPS,
/* equiv idx, value */ 15, VALUE_OPT_NOVIRTUALIPS,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ NOVIRTUALIPS_FLAGS, 0,
@ -961,8 +988,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ NOVIRTUALIPS_DESC, NOVIRTUALIPS_NAME, NOVIRTUALIPS_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 15, VALUE_OPT_MODIFYMMTIMER,
/* equiv idx, value */ 15, VALUE_OPT_MODIFYMMTIMER,
{ /* entry idx, value */ 16, VALUE_OPT_MODIFYMMTIMER,
/* equiv idx, value */ 16, VALUE_OPT_MODIFYMMTIMER,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ MODIFYMMTIMER_FLAGS, 0,
@ -973,8 +1000,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ MODIFYMMTIMER_DESC, MODIFYMMTIMER_NAME, MODIFYMMTIMER_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 16, VALUE_OPT_NOFORK,
/* equiv idx, value */ 16, VALUE_OPT_NOFORK,
{ /* entry idx, value */ 17, VALUE_OPT_NOFORK,
/* equiv idx, value */ 17, VALUE_OPT_NOFORK,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ NOFORK_FLAGS, 0,
@ -985,8 +1012,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ NOFORK_DESC, NOFORK_NAME, NOFORK_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 17, VALUE_OPT_NICE,
/* equiv idx, value */ 17, VALUE_OPT_NICE,
{ /* entry idx, value */ 18, VALUE_OPT_NICE,
/* equiv idx, value */ 18, VALUE_OPT_NICE,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ NICE_FLAGS, 0,
@ -997,8 +1024,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ NICE_DESC, NICE_NAME, NICE_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 18, VALUE_OPT_PIDFILE,
/* equiv idx, value */ 18, VALUE_OPT_PIDFILE,
{ /* entry idx, value */ 19, VALUE_OPT_PIDFILE,
/* equiv idx, value */ 19, VALUE_OPT_PIDFILE,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ PIDFILE_FLAGS, 0,
@ -1009,8 +1036,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ PIDFILE_DESC, PIDFILE_NAME, PIDFILE_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 19, VALUE_OPT_PRIORITY,
/* equiv idx, value */ 19, VALUE_OPT_PRIORITY,
{ /* entry idx, value */ 20, VALUE_OPT_PRIORITY,
/* equiv idx, value */ 20, VALUE_OPT_PRIORITY,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ PRIORITY_FLAGS, 0,
@ -1021,8 +1048,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ PRIORITY_DESC, PRIORITY_NAME, PRIORITY_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 20, VALUE_OPT_QUIT,
/* equiv idx, value */ 20, VALUE_OPT_QUIT,
{ /* entry idx, value */ 21, VALUE_OPT_QUIT,
/* equiv idx, value */ 21, VALUE_OPT_QUIT,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ QUIT_FLAGS, 0,
@ -1033,8 +1060,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ QUIT_DESC, QUIT_NAME, QUIT_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 21, VALUE_OPT_PROPAGATIONDELAY,
/* equiv idx, value */ 21, VALUE_OPT_PROPAGATIONDELAY,
{ /* entry idx, value */ 22, VALUE_OPT_PROPAGATIONDELAY,
/* equiv idx, value */ 22, VALUE_OPT_PROPAGATIONDELAY,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ PROPAGATIONDELAY_FLAGS, 0,
@ -1045,8 +1072,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ PROPAGATIONDELAY_DESC, PROPAGATIONDELAY_NAME, PROPAGATIONDELAY_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 22, VALUE_OPT_SAVECONFIGQUIT,
/* equiv idx, value */ 22, VALUE_OPT_SAVECONFIGQUIT,
{ /* entry idx, value */ 23, VALUE_OPT_SAVECONFIGQUIT,
/* equiv idx, value */ 23, VALUE_OPT_SAVECONFIGQUIT,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ SAVECONFIGQUIT_FLAGS, 0,
@ -1057,8 +1084,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ SAVECONFIGQUIT_DESC, SAVECONFIGQUIT_NAME, SAVECONFIGQUIT_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 23, VALUE_OPT_STATSDIR,
/* equiv idx, value */ 23, VALUE_OPT_STATSDIR,
{ /* entry idx, value */ 24, VALUE_OPT_STATSDIR,
/* equiv idx, value */ 24, VALUE_OPT_STATSDIR,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ STATSDIR_FLAGS, 0,
@ -1069,8 +1096,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ STATSDIR_DESC, STATSDIR_NAME, STATSDIR_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 24, VALUE_OPT_TRUSTEDKEY,
/* equiv idx, value */ 24, VALUE_OPT_TRUSTEDKEY,
{ /* entry idx, value */ 25, VALUE_OPT_TRUSTEDKEY,
/* equiv idx, value */ 25, VALUE_OPT_TRUSTEDKEY,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, NOLIMIT, 0,
/* opt state flags */ TRUSTEDKEY_FLAGS, 0,
@ -1081,8 +1108,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ TRUSTEDKEY_DESC, TRUSTEDKEY_NAME, TRUSTEDKEY_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 25, VALUE_OPT_USER,
/* equiv idx, value */ 25, VALUE_OPT_USER,
{ /* entry idx, value */ 26, VALUE_OPT_USER,
/* equiv idx, value */ 26, VALUE_OPT_USER,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ USER_FLAGS, 0,
@ -1093,8 +1120,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ USER_DESC, USER_NAME, USER_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 26, VALUE_OPT_UPDATEINTERVAL,
/* equiv idx, value */ 26, VALUE_OPT_UPDATEINTERVAL,
{ /* entry idx, value */ 27, VALUE_OPT_UPDATEINTERVAL,
/* equiv idx, value */ 27, VALUE_OPT_UPDATEINTERVAL,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ UPDATEINTERVAL_FLAGS, 0,
@ -1105,8 +1132,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ UPDATEINTERVAL_DESC, UPDATEINTERVAL_NAME, UPDATEINTERVAL_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 27, VALUE_OPT_VAR,
/* equiv idx, value */ 27, VALUE_OPT_VAR,
{ /* entry idx, value */ 28, VALUE_OPT_VAR,
/* equiv idx, value */ 28, VALUE_OPT_VAR,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, NOLIMIT, 0,
/* opt state flags */ VAR_FLAGS, 0,
@ -1117,8 +1144,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ VAR_DESC, VAR_NAME, VAR_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 28, VALUE_OPT_DVAR,
/* equiv idx, value */ 28, VALUE_OPT_DVAR,
{ /* entry idx, value */ 29, VALUE_OPT_DVAR,
/* equiv idx, value */ 29, VALUE_OPT_DVAR,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, NOLIMIT, 0,
/* opt state flags */ DVAR_FLAGS, 0,
@ -1129,8 +1156,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ DVAR_DESC, DVAR_NAME, DVAR_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 29, VALUE_OPT_WAIT_SYNC,
/* equiv idx, value */ 29, VALUE_OPT_WAIT_SYNC,
{ /* entry idx, value */ 30, VALUE_OPT_WAIT_SYNC,
/* equiv idx, value */ 30, VALUE_OPT_WAIT_SYNC,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ WAIT_SYNC_FLAGS, 0,
@ -1141,8 +1168,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ WAIT_SYNC_DESC, WAIT_SYNC_NAME, WAIT_SYNC_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 30, VALUE_OPT_SLEW,
/* equiv idx, value */ 30, VALUE_OPT_SLEW,
{ /* entry idx, value */ 31, VALUE_OPT_SLEW,
/* equiv idx, value */ 31, VALUE_OPT_SLEW,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ SLEW_FLAGS, 0,
@ -1153,8 +1180,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ SLEW_DESC, SLEW_NAME, SLEW_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 31, VALUE_OPT_USEPCC,
/* equiv idx, value */ 31, VALUE_OPT_USEPCC,
{ /* entry idx, value */ 32, VALUE_OPT_USEPCC,
/* equiv idx, value */ 32, VALUE_OPT_USEPCC,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ USEPCC_FLAGS, 0,
@ -1165,8 +1192,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ USEPCC_DESC, USEPCC_NAME, USEPCC_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 32, VALUE_OPT_PCCFREQ,
/* equiv idx, value */ 32, VALUE_OPT_PCCFREQ,
{ /* entry idx, value */ 33, VALUE_OPT_PCCFREQ,
/* equiv idx, value */ 33, VALUE_OPT_PCCFREQ,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ PCCFREQ_FLAGS, 0,
@ -1177,8 +1204,8 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ PCCFREQ_DESC, PCCFREQ_NAME, PCCFREQ_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 33, VALUE_OPT_MDNS,
/* equiv idx, value */ 33, VALUE_OPT_MDNS,
{ /* entry idx, value */ 34, VALUE_OPT_MDNS,
/* equiv idx, value */ 34, VALUE_OPT_MDNS,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ MDNS_FLAGS, 0,
@ -1231,21 +1258,21 @@ static tOptDesc optDesc[OPTION_CT] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/** Reference to the upper cased version of ntpd. */
#define zPROGNAME (ntpd_opt_strs+2876)
#define zPROGNAME (ntpd_opt_strs+2944)
/** Reference to the title line for ntpd usage. */
#define zUsageTitle (ntpd_opt_strs+2881)
#define zUsageTitle (ntpd_opt_strs+2949)
/** There is no ntpd configuration file. */
#define zRcName NULL
/** There are no directories to search for ntpd config files. */
#define apzHomeList NULL
/** The ntpd program bug email address. */
#define zBugsAddr (ntpd_opt_strs+3012)
#define zBugsAddr (ntpd_opt_strs+3080)
/** Clarification/explanation of what ntpd does. */
#define zExplain (ntpd_opt_strs+3046)
#define zExplain (ntpd_opt_strs+3114)
/** Extra detail explaining what ntpd does. */
#define zDetail (NULL)
/** The full version string for ntpd. */
#define zFullVersion (ntpd_opt_strs+3048)
#define zFullVersion (ntpd_opt_strs+3116)
/* extracted from optcode.tlib near line 364 */
#if defined(ENABLE_NLS)
@ -1367,7 +1394,7 @@ tOptions ntpdOptions = {
NO_EQUIVALENT, /* '-#' option index */
NO_EQUIVALENT /* index of default opt */
},
37 /* full option count */, 34 /* user option count */,
38 /* full option count */, 35 /* user option count */,
ntpd_full_usage, ntpd_short_usage,
NULL, NULL,
PKGDATADIR, ntpd_packager_info
@ -1502,7 +1529,7 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via ntpdOptions.pzCopyright */
puts(_("ntpd 4.2.8p1\n\
puts(_("ntpd 4.2.8p2\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\
@ -1552,6 +1579,9 @@ implied warranty.\n"));
/* referenced via ntpdOptions.pOptDesc->pzText */
puts(_("Allow the first adjustment to be Big"));
/* referenced via ntpdOptions.pOptDesc->pzText */
puts(_("Step any initial offset correction."));
/* referenced via ntpdOptions.pOptDesc->pzText */
puts(_("Jail directory"));
@ -1640,7 +1670,7 @@ implied warranty.\n"));
puts(_("output version information and exit"));
/* referenced via ntpdOptions.pzUsageTitle */
puts(_("ntpd - NTP daemon program - Ver. 4.2.8p1\n\
puts(_("ntpd - NTP daemon program - Ver. 4.2.8p2\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
\t\t[ <server1> ... <serverN> ]\n"));
@ -1648,7 +1678,7 @@ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
puts(_("\n"));
/* referenced via ntpdOptions.pzFullVersion */
puts(_("ntpd 4.2.8p1"));
puts(_("ntpd 4.2.8p2"));
/* referenced via ntpdOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));

View File

@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpd-opts.h)
*
* It has been AutoGen-ed February 4, 2015 at 02:39:16 AM by AutoGen 5.18.5pre4
* It has been AutoGen-ed April 7, 2015 at 04:23:13 AM by AutoGen 5.18.5pre4
* From the definitions ntpd-opts.def
* and the template file options
*
@ -74,40 +74,41 @@ typedef enum {
INDEX_OPT_SET_DEBUG_LEVEL = 7,
INDEX_OPT_DRIFTFILE = 8,
INDEX_OPT_PANICGATE = 9,
INDEX_OPT_JAILDIR = 10,
INDEX_OPT_INTERFACE = 11,
INDEX_OPT_KEYFILE = 12,
INDEX_OPT_LOGFILE = 13,
INDEX_OPT_NOVIRTUALIPS = 14,
INDEX_OPT_MODIFYMMTIMER = 15,
INDEX_OPT_NOFORK = 16,
INDEX_OPT_NICE = 17,
INDEX_OPT_PIDFILE = 18,
INDEX_OPT_PRIORITY = 19,
INDEX_OPT_QUIT = 20,
INDEX_OPT_PROPAGATIONDELAY = 21,
INDEX_OPT_SAVECONFIGQUIT = 22,
INDEX_OPT_STATSDIR = 23,
INDEX_OPT_TRUSTEDKEY = 24,
INDEX_OPT_USER = 25,
INDEX_OPT_UPDATEINTERVAL = 26,
INDEX_OPT_VAR = 27,
INDEX_OPT_DVAR = 28,
INDEX_OPT_WAIT_SYNC = 29,
INDEX_OPT_SLEW = 30,
INDEX_OPT_USEPCC = 31,
INDEX_OPT_PCCFREQ = 32,
INDEX_OPT_MDNS = 33,
INDEX_OPT_VERSION = 34,
INDEX_OPT_HELP = 35,
INDEX_OPT_MORE_HELP = 36
INDEX_OPT_FORCE_STEP_ONCE = 10,
INDEX_OPT_JAILDIR = 11,
INDEX_OPT_INTERFACE = 12,
INDEX_OPT_KEYFILE = 13,
INDEX_OPT_LOGFILE = 14,
INDEX_OPT_NOVIRTUALIPS = 15,
INDEX_OPT_MODIFYMMTIMER = 16,
INDEX_OPT_NOFORK = 17,
INDEX_OPT_NICE = 18,
INDEX_OPT_PIDFILE = 19,
INDEX_OPT_PRIORITY = 20,
INDEX_OPT_QUIT = 21,
INDEX_OPT_PROPAGATIONDELAY = 22,
INDEX_OPT_SAVECONFIGQUIT = 23,
INDEX_OPT_STATSDIR = 24,
INDEX_OPT_TRUSTEDKEY = 25,
INDEX_OPT_USER = 26,
INDEX_OPT_UPDATEINTERVAL = 27,
INDEX_OPT_VAR = 28,
INDEX_OPT_DVAR = 29,
INDEX_OPT_WAIT_SYNC = 30,
INDEX_OPT_SLEW = 31,
INDEX_OPT_USEPCC = 32,
INDEX_OPT_PCCFREQ = 33,
INDEX_OPT_MDNS = 34,
INDEX_OPT_VERSION = 35,
INDEX_OPT_HELP = 36,
INDEX_OPT_MORE_HELP = 37
} teOptIndex;
/** count of all options for ntpd */
#define OPTION_CT 37
#define OPTION_CT 38
/** ntpd version */
#define NTPD_VERSION "4.2.8p1"
#define NTPD_VERSION "4.2.8p2"
/** Full ntpd version text */
#define NTPD_FULL_VERSION "ntpd 4.2.8p1"
#define NTPD_FULL_VERSION "ntpd 4.2.8p2"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
@ -199,6 +200,10 @@ typedef enum {
# warning undefining PANICGATE due to option name conflict
# undef PANICGATE
# endif
# ifdef FORCE_STEP_ONCE
# warning undefining FORCE_STEP_ONCE due to option name conflict
# undef FORCE_STEP_ONCE
# endif
# ifdef JAILDIR
# warning undefining JAILDIR due to option name conflict
# undef JAILDIR
@ -306,6 +311,7 @@ typedef enum {
# undef SET_DEBUG_LEVEL
# undef DRIFTFILE
# undef PANICGATE
# undef FORCE_STEP_ONCE
# undef JAILDIR
# undef INTERFACE
# undef KEYFILE
@ -348,6 +354,7 @@ typedef enum {
#define OPT_VALUE_SET_DEBUG_LEVEL (DESC(SET_DEBUG_LEVEL).optArg.argInt)
#define VALUE_OPT_DRIFTFILE 'f'
#define VALUE_OPT_PANICGATE 'g'
#define VALUE_OPT_FORCE_STEP_ONCE 'G'
#define VALUE_OPT_JAILDIR 'i'
#define VALUE_OPT_INTERFACE 'I'
#define VALUE_OPT_KEYFILE 'k'

View File

@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
.TH ntpd 1ntpdman "04 Feb 2015" "4.2.8p1" "User Commands"
.TH ntpd 1ntpdman "07 Apr 2015" "4.2.8p2" "User Commands"
.\"
.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-YYaqWo/ag-.YaiVo)
.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-TQays3/ag-5Qaqr3)
.\"
.\" It has been AutoGen-ed February 4, 2015 at 02:41:54 AM by AutoGen 5.18.5pre4
.\" It has been AutoGen-ed April 7, 2015 at 04:25:45 AM by AutoGen 5.18.5pre4
.\" From the definitions ntpd-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@ -196,6 +196,20 @@ See the
\fBtinker\fP
configuration file directive for other options.
.TP
.NOP \f\*[B-Font]\-G\f[], \f\*[B-Font]\-\-force\-step\-once\f[]
Step any initial offset correction..
.sp
Normally,
\fBntpd\fP
steps the time if the time offset exceeds the step threshold,
which is 128 ms by default, and otherwise slews the time.
This option forces the initial offset correction to be stepped,
so the highest time accuracy can be achieved quickly.
However, this may also cause the time to be stepped back
so this option must not be used if
applications requiring monotonic time are running.
See the \fBtinker\fP configuration file directive for other options.
.TP
.NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-jaildir\f[]=\f\*[I-Font]string\f[]
Jail directory.
.sp

View File

@ -1,9 +1,9 @@
.Dd February 4 2015
.Dd April 7 2015
.Dt NTPD 1ntpdmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc)
.\"
.\" It has been AutoGen-ed February 4, 2015 at 02:42:12 AM by AutoGen 5.18.5pre4
.\" It has been AutoGen-ed April 7, 2015 at 04:26:02 AM by AutoGen 5.18.5pre4
.\" From the definitions ntpd-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@ -163,6 +163,19 @@ options.
See the
\fBtinker\fP
configuration file directive for other options.
.It Fl G , Fl \-force\-step\-once
Step any initial offset correction..
.sp
Normally,
\fBntpd\fP
steps the time if the time offset exceeds the step threshold,
which is 128 ms by default, and otherwise slews the time.
This option forces the initial offset correction to be stepped,
so the highest time accuracy can be achieved quickly.
However, this may also cause the time to be stepped back
so this option must not be used if
applications requiring monotonic time are running.
See the \fBtinker\fP configuration file directive for other options.
.It Fl i Ar string , Fl \-jaildir Ns = Ns Ar string
Jail directory.
.sp

View File

@ -1262,6 +1262,7 @@ finish(
if (mdns != NULL)
DNSServiceRefDeallocate(mdns);
# endif
peer_cleanup();
exit(0);
}
#endif /* !SIM && SIGDIE1 */

View File

@ -39,7 +39,7 @@ The program can operate in any of several modes, including client/server,
symmetric and broadcast modes, and with both symmetric-key and public-key
cryptography.
<p>This document applies to version 4.2.8p1 of <code>ntpd</code>.
<p>This document applies to version 4.2.8p2 of <code>ntpd</code>.
<ul class="menu">
<li><a accesskey="1" href="#ntpd-Description">ntpd Description</a>: Description
@ -169,7 +169,8 @@ This software is released under the NTP license, &lt;http://ntp.org/license&gt;.
<li><a accesskey="6" href="#ntpd-configfile">ntpd configfile</a>: configfile option (-c)
<li><a accesskey="7" href="#ntpd-driftfile">ntpd driftfile</a>: driftfile option (-f)
<li><a accesskey="8" href="#ntpd-panicgate">ntpd panicgate</a>: panicgate option (-g)
<li><a accesskey="9" href="#ntpd-jaildir">ntpd jaildir</a>: jaildir option (-i)
<li><a accesskey="9" href="#ntpd-force_002dstep_002donce">ntpd force-step-once</a>: force-step-once option (-G)
<li><a href="#ntpd-jaildir">ntpd jaildir</a>: jaildir option (-i)
<li><a href="#ntpd-interface">ntpd interface</a>: interface option (-I)
<li><a href="#ntpd-keyfile">ntpd keyfile</a>: keyfile option (-k)
<li><a href="#ntpd-logfile">ntpd logfile</a>: logfile option (-l)
@ -219,7 +220,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">ntpd - NTP daemon program - Ver. 4.2.8p1-RC2
<pre class="example">ntpd - NTP daemon program - Ver. 4.2.8p2-RC3
Usage: ntpd [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... \
[ &lt;server1&gt; ... &lt;serverN&gt; ]
Flg Arg Option-Name Description
@ -240,6 +241,7 @@ Usage: ntpd [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ].
-f Str driftfile frequency drift file name
-g no panicgate Allow the first adjustment to be Big
- may appear multiple times
-G no force-step-once Step any initial offset correction.
-i Str jaildir Jail directory
-I Str interface Listen on an interface name or address
- may appear multiple times
@ -413,7 +415,7 @@ configuration specification in the
file.
<div class="node">
<p><hr>
<a name="ntpd-panicgate"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-jaildir">ntpd jaildir</a>,
<a name="ntpd-panicgate"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-force_002dstep_002donce">ntpd force-step-once</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-driftfile">ntpd driftfile</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<br>
@ -443,15 +445,37 @@ See the
configuration file directive for other options.
<div class="node">
<p><hr>
<a name="ntpd-jaildir"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-interface">ntpd interface</a>,
<a name="ntpd-force_002dstep_002donce"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-jaildir">ntpd jaildir</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-panicgate">ntpd panicgate</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<br>
</div>
<h4 class="subsection">force-step-once option (-G)</h4>
<p><a name="index-ntpd_002dforce_002dstep_002donce-11"></a>
This is the &ldquo;step any initial offset correction.&rdquo; option.
Normally,
<code>ntpd</code>
steps the time if the time offset exceeds the step threshold,
which is 128 ms by default, and otherwise slews the time.
This option forces the initial offset correction to be stepped,
so the highest time accuracy can be achieved quickly.
However, this may also cause the time to be stepped back
so this option must not be used if
applications requiring monotonic time are running.
See the <code>tinker</code> configuration file directive for other options.
<div class="node">
<p><hr>
<a name="ntpd-jaildir"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-interface">ntpd interface</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-force_002dstep_002donce">ntpd force-step-once</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<br>
</div>
<h4 class="subsection">jaildir option (-i)</h4>
<p><a name="index-ntpd_002djaildir-11"></a>
<p><a name="index-ntpd_002djaildir-12"></a>
This is the &ldquo;jail directory&rdquo; option.
This option takes a string argument.
@ -482,7 +506,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<h4 class="subsection">interface option (-I)</h4>
<p><a name="index-ntpd_002dinterface-12"></a>
<p><a name="index-ntpd_002dinterface-13"></a>
This is the &ldquo;listen on an interface name or address&rdquo; option.
This option takes a string argument <span class="file">iface</span>.
@ -506,7 +530,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<h4 class="subsection">keyfile option (-k)</h4>
<p><a name="index-ntpd_002dkeyfile-13"></a>
<p><a name="index-ntpd_002dkeyfile-14"></a>
This is the &ldquo;path to symmetric keys&rdquo; option.
This option takes a string argument.
Specify the name and path of the symmetric key file.
@ -525,7 +549,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<h4 class="subsection">logfile option (-l)</h4>
<p><a name="index-ntpd_002dlogfile-14"></a>
<p><a name="index-ntpd_002dlogfile-15"></a>
This is the &ldquo;path to the log file&rdquo; option.
This option takes a string argument.
Specify the name and path of the log file.
@ -543,7 +567,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<h4 class="subsection">novirtualips option (-L)</h4>
<p><a name="index-ntpd_002dnovirtualips-15"></a>
<p><a name="index-ntpd_002dnovirtualips-16"></a>
This is the &ldquo;do not listen to virtual interfaces&rdquo; option.
Do not listen to virtual interfaces, defined as those with
names containing a colon. This option is deprecated. Please
@ -559,7 +583,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<h4 class="subsection">modifymmtimer option (-M)</h4>
<p><a name="index-ntpd_002dmodifymmtimer-16"></a>
<p><a name="index-ntpd_002dmodifymmtimer-17"></a>
This is the &ldquo;modify multimedia timer (windows only)&rdquo; option.
<p class="noindent">This option has some usage constraints. It:
@ -580,7 +604,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<h4 class="subsection">nice option (-N)</h4>
<p><a name="index-ntpd_002dnice-17"></a>
<p><a name="index-ntpd_002dnice-18"></a>
This is the &ldquo;run at high priority&rdquo; option.
To the extent permitted by the operating system, run
<code>ntpd</code>
@ -595,7 +619,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<h4 class="subsection">pidfile option (-p)</h4>
<p><a name="index-ntpd_002dpidfile-18"></a>
<p><a name="index-ntpd_002dpidfile-19"></a>
This is the &ldquo;path to the pid file&rdquo; option.
This option takes a string argument.
Specify the name and path of the file used to record
@ -614,7 +638,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<h4 class="subsection">priority option (-P)</h4>
<p><a name="index-ntpd_002dpriority-19"></a>
<p><a name="index-ntpd_002dpriority-20"></a>
This is the &ldquo;process priority&rdquo; option.
This option takes a number argument.
To the extent permitted by the operating system, run
@ -632,7 +656,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<h4 class="subsection">quit option (-q)</h4>
<p><a name="index-ntpd_002dquit-20"></a>
<p><a name="index-ntpd_002dquit-21"></a>
This is the &ldquo;set the time and quit&rdquo; option.
<p class="noindent">This option has some usage constraints. It:
@ -662,7 +686,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<h4 class="subsection">propagationdelay option (-r)</h4>
<p><a name="index-ntpd_002dpropagationdelay-21"></a>
<p><a name="index-ntpd_002dpropagationdelay-22"></a>
This is the &ldquo;broadcast/propagation delay&rdquo; option.
This option takes a string argument.
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.
@ -676,7 +700,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<h4 class="subsection">saveconfigquit option</h4>
<p><a name="index-ntpd_002dsaveconfigquit-22"></a>
<p><a name="index-ntpd_002dsaveconfigquit-23"></a>
This is the &ldquo;save parsed configuration and quit&rdquo; option.
This option takes a string argument.
@ -700,7 +724,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<h4 class="subsection">statsdir option (-s)</h4>
<p><a name="index-ntpd_002dstatsdir-23"></a>
<p><a name="index-ntpd_002dstatsdir-24"></a>
This is the &ldquo;statistics file location&rdquo; option.
This option takes a string argument.
Specify the directory path for files created by the statistics facility.
@ -717,7 +741,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<h4 class="subsection">trustedkey option (-t)</h4>
<p><a name="index-ntpd_002dtrustedkey-24"></a>
<p><a name="index-ntpd_002dtrustedkey-25"></a>
This is the &ldquo;trusted key number&rdquo; option.
This option takes a string argument <span class="file">tkey</span>.
@ -737,7 +761,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<h4 class="subsection">user option (-u)</h4>
<p><a name="index-ntpd_002duser-25"></a>
<p><a name="index-ntpd_002duser-26"></a>
This is the &ldquo;run as userid (or userid:groupid)&rdquo; option.
This option takes a string argument.
@ -762,7 +786,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<h4 class="subsection">updateinterval option (-U)</h4>
<p><a name="index-ntpd_002dupdateinterval-26"></a>
<p><a name="index-ntpd_002dupdateinterval-27"></a>
This is the &ldquo;interval in seconds between scans for new or dropped interfaces&rdquo; option.
This option takes a number argument.
Give the time in seconds between two scans for new or dropped interfaces.
@ -779,7 +803,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<h4 class="subsection">wait-sync option (-w)</h4>
<p><a name="index-ntpd_002dwait_002dsync-27"></a>
<p><a name="index-ntpd_002dwait_002dsync-28"></a>
This is the &ldquo;seconds to wait for first clock sync&rdquo; option.
This option takes a number argument.
@ -808,7 +832,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<h4 class="subsection">slew option (-x)</h4>
<p><a name="index-ntpd_002dslew-28"></a>
<p><a name="index-ntpd_002dslew-29"></a>
This is the &ldquo;slew up to 600 seconds&rdquo; option.
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.
@ -833,7 +857,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<h4 class="subsection">usepcc option</h4>
<p><a name="index-ntpd_002dusepcc-29"></a>
<p><a name="index-ntpd_002dusepcc-30"></a>
This is the &ldquo;use cpu cycle counter (windows only)&rdquo; option.
<p class="noindent">This option has some usage constraints. It:
@ -855,7 +879,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<h4 class="subsection">pccfreq option</h4>
<p><a name="index-ntpd_002dpccfreq-30"></a>
<p><a name="index-ntpd_002dpccfreq-31"></a>
This is the &ldquo;force cpu cycle counter use (windows only)&rdquo; option.
This option takes a string argument.
@ -877,7 +901,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
<h4 class="subsection">mdns option (-m)</h4>
<p><a name="index-ntpd_002dmdns-31"></a>
<p><a name="index-ntpd_002dmdns-32"></a>
This is the &ldquo;register with mdns as a ntp server&rdquo; option.
<p class="noindent">This option has some usage constraints. It:

View File

@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
.TH ntpd @NTPD_MS@ "04 Feb 2015" "4.2.8p1" "User Commands"
.TH ntpd @NTPD_MS@ "07 Apr 2015" "4.2.8p2" "User Commands"
.\"
.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-YYaqWo/ag-.YaiVo)
.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-TQays3/ag-5Qaqr3)
.\"
.\" It has been AutoGen-ed February 4, 2015 at 02:41:54 AM by AutoGen 5.18.5pre4
.\" It has been AutoGen-ed April 7, 2015 at 04:25:45 AM by AutoGen 5.18.5pre4
.\" From the definitions ntpd-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@ -196,6 +196,20 @@ See the
\fBtinker\fP
configuration file directive for other options.
.TP
.NOP \f\*[B-Font]\-G\f[], \f\*[B-Font]\-\-force\-step\-once\f[]
Step any initial offset correction..
.sp
Normally,
\fBntpd\fP
steps the time if the time offset exceeds the step threshold,
which is 128 ms by default, and otherwise slews the time.
This option forces the initial offset correction to be stepped,
so the highest time accuracy can be achieved quickly.
However, this may also cause the time to be stepped back
so this option must not be used if
applications requiring monotonic time are running.
See the \fBtinker\fP configuration file directive for other options.
.TP
.NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-jaildir\f[]=\f\*[I-Font]string\f[]
Jail directory.
.sp

View File

@ -1,9 +1,9 @@
.Dd February 4 2015
.Dd April 7 2015
.Dt NTPD @NTPD_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc)
.\"
.\" It has been AutoGen-ed February 4, 2015 at 02:42:12 AM by AutoGen 5.18.5pre4
.\" It has been AutoGen-ed April 7, 2015 at 04:26:02 AM by AutoGen 5.18.5pre4
.\" From the definitions ntpd-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@ -163,6 +163,19 @@ options.
See the
\fBtinker\fP
configuration file directive for other options.
.It Fl G , Fl \-force\-step\-once
Step any initial offset correction..
.sp
Normally,
\fBntpd\fP
steps the time if the time offset exceeds the step threshold,
which is 128 ms by default, and otherwise slews the time.
This option forces the initial offset correction to be stepped,
so the highest time accuracy can be achieved quickly.
However, this may also cause the time to be stepped back
so this option must not be used if
applications requiring monotonic time are running.
See the \fBtinker\fP configuration file directive for other options.
.It Fl i Ar string , Fl \-jaildir Ns = Ns Ar string
Jail directory.
.sp

View File

@ -114,6 +114,24 @@ flag = {
_EndOfDoc_;
};
flag = {
name = force_step_once;
value = G;
descrip = "Step any initial offset correction.";
doc = <<- _EndOfDoc_
Normally,
@code{ntpd}
steps the time if the time offset exceeds the step threshold,
which is 128 ms by default, and otherwise slews the time.
This option forces the initial offset correction to be stepped,
so the highest time accuracy can be achieved quickly.
However, this may also cause the time to be stepped back
so this option must not be used if
applications requiring monotonic time are running.
See the @code{tinker} configuration file directive for other options.
_EndOfDoc_;
};
flag = {
ifdef = HAVE_DROPROOT;
name = jaildir;

View File

@ -584,7 +584,10 @@ TSIP_decode (
break;
}
if (up->leap_status & PALISADE_LEAP_PENDING) {
up->month = mb(15);
if ( (up->leap_status & PALISADE_LEAP_PENDING) &&
/* Avoid early announce: https://bugs.ntp.org/2773 */
(6 == up->month || 12 == up->month) ) {
if (up->leap_status & PALISADE_UTC_TIME)
pp->leap = LEAP_ADDSECOND;
else
@ -615,6 +618,7 @@ TSIP_decode (
pp->hour = mb(11);
pp->minute = mb(12);
pp->second = mb(13);
up->month = mb(14); /* Save for LEAP check */
#ifdef DEBUG
if (debug > 1)
@ -645,7 +649,9 @@ TSIP_decode (
printf("TSIP_decode: unit %d\n", up->unit);
}
#endif
if (getint((u_char *) &mb(10)) & 0x80)
if ( (getint((u_char *) &mb(10)) & 0x80) &&
/* Avoid early announce: https://bugs.ntp.org/2773 */
(6 == up->month || 12 == up->month) )
pp->leap = LEAP_ADDSECOND; /* we ASSUME addsecond */
else
pp->leap = LEAP_NOWARNING;

View File

@ -169,6 +169,7 @@ struct palisade_unit {
short rpt_cnt; /* TSIP packet length so far */
char rpt_buf[BMAX]; /* packet assembly buffer */
int type; /* Clock mode type */
int month; /* for LEAP filter */
};
/*

View File

@ -54,9 +54,9 @@
/*
* This driver currently provides the support for
* - Meinberg receiver DCF77 PZF 535 (TCXO version) (DCF)
* - Meinberg receiver DCF77 PZF 535 (OCXO version) (DCF)
* - Meinberg receiver DCF77 PZF 509 (DCF)
* - Meinberg receiver DCF77 PZF535 (TCXO version) (DCF)
* - Meinberg receiver DCF77 PZF535 (OCXO version) (DCF)
* - Meinberg receiver DCF77 PZF509 (DCF)
* - Meinberg receiver DCF77 AM receivers (e.g. C51) (DCF)
* - IGEL CLOCK (DCF)
* - ELV DCF7000 (DCF)
@ -65,7 +65,7 @@
* - FAU DCF77 NTP receiver (TimeBrick) (DCF)
* - WHARTON 400A Series clock (DCF)
*
* - Meinberg GPS166/GPS167 (GPS)
* - Meinberg GPS receivers (GPS)
* - Trimble (TSIP and TAIP protocol) (GPS)
*
* - RCC8000 MSF Receiver (MSF)
@ -74,7 +74,7 @@
/*
* Meinberg receivers are usually connected via a
* 9600 baud serial line
* 9600/7E1 or 19200/8N1 serial line.
*
* The Meinberg GPS receivers also have a special NTP time stamp
* format. The firmware release is Uni-Erlangen.
@ -83,7 +83,7 @@
* output time code every second
* Baud rate 9600 7E2S
*
* Meinberg GPS16x setup:
* Meinberg GPS receiver setup:
* output time code every second
* Baudrate 19200 8N1
*
@ -91,7 +91,9 @@
* in Meinberg receivers.
*
* Special software versions are only sensible for the
* GPS 16x family of receivers.
* oldest GPS receiver, GPS16x. For newer receiver types
* the output string format can be configured at the device,
* and the device name is generally GPSxxx instead of GPS16x.
*
* Meinberg can be reached via: http://www.meinberg.de/
*/
@ -156,8 +158,8 @@
# endif
#endif
#define BUFFER_SIZE(_BUF, _PTR) ((_BUF) + sizeof(_BUF) - (_PTR))
#define BUFFER_SIZES(_BUF, _PTR, _SZ) ((_BUF) + (_SZ) - (_PTR))
# define BUFFER_SIZE(_BUF, _PTR) ((int)((_BUF) + sizeof(_BUF) - (_PTR)))
# define BUFFER_SIZES(_BUF, _PTR, _SZ) ((int)((_BUF) + (_SZ) - (_PTR)))
/*
* document type of PPS interfacing - copy of ifdef mechanism in local_input()
@ -181,6 +183,18 @@
#endif /* TIOCDCDTIMESTAMP */
#endif /* HAVE_PPSAPI */
/*
* COND_DEF can be conditionally defined as DEF or 0. If defined as DEF
* then some more parse-specific variables are flagged to be printed with
* "ntpq -c cv <assid>". This can be lengthy, so by default COND_DEF
* should be defined as 0.
*/
#if 0
# define COND_DEF DEF // enable this for testing
#else
# define COND_DEF 0 // enable this by default
#endif
#include "ntp_io.h"
#include "ntp_stdlib.h"
@ -536,14 +550,14 @@ typedef struct poll_info
#define DCFPZF535OCXO_FORMAT "Meinberg Standard"
/*
* Meinberg GPS16X receiver
* Meinberg GPS receivers
*/
static void gps16x_message (struct parseunit *, parsetime_t *);
static int gps16x_poll_init (struct parseunit *);
#define GPS16X_ROOTDELAY 0.0 /* nothing here */
#define GPS16X_BASEDELAY 0.001968 /* XXX to be fixed ! 1.968ms +- 104us (oscilloscope) - relative to start (end of STX) */
#define GPS16X_DESCRIPTION "Meinberg GPS16x receiver"
#define GPS16X_DESCRIPTION "Meinberg GPS receiver"
#define GPS16X_MAXUNSYNC 60*60*96 /* only trust clock for 4 days
* @ 5e-9df/f we have accumulated
* at most an error of 1.73 ms
@ -2232,9 +2246,9 @@ local_input(
else
pts = pps_info.assert_timestamp;
parse->parseio.parse_dtime.parse_ptime.fp.l_ui = pts.tv_sec + JAN_1970;
parse->parseio.parse_dtime.parse_ptime.fp.l_ui = (uint32_t) (pts.tv_sec + JAN_1970);
dtemp = pts.tv_nsec / 1e9;
dtemp = (double) pts.tv_nsec / 1e9;
if (dtemp < 0.) {
dtemp += 1;
parse->parseio.parse_dtime.parse_ptime.fp.l_ui--;
@ -2243,7 +2257,7 @@ local_input(
dtemp -= 1;
parse->parseio.parse_dtime.parse_ptime.fp.l_ui++;
}
parse->parseio.parse_dtime.parse_ptime.fp.l_uf = dtemp * FRAC;
parse->parseio.parse_dtime.parse_ptime.fp.l_uf = (uint32_t)(dtemp * FRAC);
parse->parseio.parse_dtime.parse_state |= PARSEB_PPS|PARSEB_S_PPS;
#ifdef DEBUG
@ -2511,7 +2525,7 @@ parsestate(
{ PARSEB_LEAPADD, "LEAP ADD WARNING" },
{ PARSEB_LEAPDEL, "LEAP DELETE WARNING" },
{ PARSEB_LEAPSECOND, "LEAP SECOND" },
{ PARSEB_ALTERNATE, "ALTERNATE ANTENNA" },
{ PARSEB_CALLBIT, "CALL BIT" },
{ PARSEB_TIMECODE, "TIME CODE" },
{ PARSEB_PPS, "PPS" },
{ PARSEB_POSITION, "POSITION" },
@ -2885,7 +2899,7 @@ parse_ppsapi(
int cap, mode_ppsoffset;
const char *cp;
parse->flags &= ~PARSE_PPSCLOCK;
parse->flags &= (u_char) (~PARSE_PPSCLOCK);
/*
* collect PPSAPI offset capability - should move into generic handling
@ -2929,14 +2943,14 @@ parse_ppsapi(
} else {
if (mode_ppsoffset == PPS_OFFSETCLEAR)
{
parse->atom.pps_params.clear_offset.tv_sec = -parse->ppsphaseadjust;
parse->atom.pps_params.clear_offset.tv_nsec = -1e9*(parse->ppsphaseadjust - (long)parse->ppsphaseadjust);
parse->atom.pps_params.clear_offset.tv_sec = (time_t)(-parse->ppsphaseadjust);
parse->atom.pps_params.clear_offset.tv_nsec = (long)(-1e9*(parse->ppsphaseadjust - (double)(long)parse->ppsphaseadjust));
}
if (mode_ppsoffset == PPS_OFFSETASSERT)
{
parse->atom.pps_params.assert_offset.tv_sec = -parse->ppsphaseadjust;
parse->atom.pps_params.assert_offset.tv_nsec = -1e9*(parse->ppsphaseadjust - (long)parse->ppsphaseadjust);
parse->atom.pps_params.assert_offset.tv_sec = (time_t)(-parse->ppsphaseadjust);
parse->atom.pps_params.assert_offset.tv_nsec = (long)(-1e9*(parse->ppsphaseadjust - (double)(long)parse->ppsphaseadjust));
}
}
@ -3110,15 +3124,15 @@ parse_start(
}
#endif
tio.c_cflag = parse_clockinfo[type].cl_cflag;
tio.c_iflag = parse_clockinfo[type].cl_iflag;
tio.c_oflag = parse_clockinfo[type].cl_oflag;
tio.c_lflag = parse_clockinfo[type].cl_lflag;
tio.c_cflag = (tcflag_t) parse_clockinfo[type].cl_cflag;
tio.c_iflag = (tcflag_t) parse_clockinfo[type].cl_iflag;
tio.c_oflag = (tcflag_t) parse_clockinfo[type].cl_oflag;
tio.c_lflag = (tcflag_t) parse_clockinfo[type].cl_lflag;
#ifdef HAVE_TERMIOS
if ((cfsetospeed(&tio, parse_clockinfo[type].cl_speed) == -1) ||
(cfsetispeed(&tio, parse_clockinfo[type].cl_speed) == -1))
if ((cfsetospeed(&tio, (speed_t) parse_clockinfo[type].cl_speed) == -1) ||
(cfsetispeed(&tio, (speed_t) parse_clockinfo[type].cl_speed) == -1))
{
msyslog(LOG_ERR, "PARSE receiver #%d: parse_start: tcset{i,o}speed(&tio, speed): %m", unit);
parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */
@ -3265,7 +3279,7 @@ parse_start(
}
strlcpy(tmp_ctl.parseformat.parse_buffer, parse->parse_type->cl_format, sizeof(tmp_ctl.parseformat.parse_buffer));
tmp_ctl.parseformat.parse_count = strlen(tmp_ctl.parseformat.parse_buffer);
tmp_ctl.parseformat.parse_count = (u_short) strlen(tmp_ctl.parseformat.parse_buffer);
if (!PARSE_SETFMT(parse, &tmp_ctl))
{
@ -3365,8 +3379,8 @@ parse_ctl(
{
if (in->haveflags & (CLK_HAVEFLAG1|CLK_HAVEFLAG2|CLK_HAVEFLAG3|CLK_HAVEFLAG4))
{
parse->flags = (parse->flags & ~(CLK_FLAG1|CLK_FLAG2|CLK_FLAG3|CLK_FLAG4)) |
(in->flags & (CLK_FLAG1|CLK_FLAG2|CLK_FLAG3|CLK_FLAG4));
u_char mask = CLK_FLAG1|CLK_FLAG2|CLK_FLAG3|CLK_FLAG4;
parse->flags = (parse->flags & (u_char)(~mask)) | (in->flags & mask);
#if defined(HAVE_PPSAPI)
if (CLK_PPS(parse->peer))
{
@ -3649,7 +3663,7 @@ parse_control(
clockstatus((unsigned int)i),
l_mktime(s_time),
(int)(percent / 100), (int)(percent % 100));
if ((count = strlen(item)) < (LEN_STATES - 40 - (tt - start)))
if ((count = (int) strlen(item)) < (LEN_STATES - 40 - (tt - start)))
{
tt = ap(start, LEN_STATES, tt,
"%s", item);
@ -3681,7 +3695,7 @@ parse_control(
}
}
out->lencode = strlen(outstatus);
out->lencode = (u_short) strlen(outstatus);
out->p_lastcode = outstatus;
}
}
@ -4178,13 +4192,13 @@ parse_process(
*/
if (PARSE_PPS(parsetime->parse_state) && CLK_PPS(parse->peer))
{
parse->peer->flags |= FLAG_PPS;
parse->peer->flags |= (FLAG_PPS | FLAG_TSTAMP_PPS);
parse_hardpps(parse, PARSE_HARDPPS_ENABLE);
}
#endif
} else {
parse_hardpps(parse, PARSE_HARDPPS_DISABLE);
parse->peer->flags &= ~FLAG_PPS;
parse->peer->flags &= ~(FLAG_PPS | FLAG_TSTAMP_PPS);
}
/*
@ -4200,56 +4214,71 @@ parse_process(
refclock_receive(parse->peer);
}
/**===========================================================================
** special code for special clocks
**/
static void
mk_utcinfo(
char *t,
char *t, // pointer to the output string buffer
int wnt,
int wnlsf,
int dn,
int dtls,
int dtlsf,
int size
int size // size of the output string buffer
)
{
l_fp leapdate;
char *start = t;
snprintf(t, size, "current correction %d sec", dtls);
t += strlen(t);
if (wnlsf < 990)
wnlsf += 1024;
if (wnt < 990)
wnt += 1024;
gpstolfp((unsigned short)wnlsf, (unsigned short)dn, 0, &leapdate);
if ((dtlsf != dtls) &&
((wnlsf - wnt) < 52))
/*
* The week number transmitted by the GPS satellites for the leap date
* is truncated to 8 bits only. If the nearest leap second date is off
* the current date by more than +/- 128 weeks then conversion to a
* calendar date is ambiguous. On the other hand, if a leap second is
* currently being announced (i.e. dtlsf != dtls) then the week number
* wnlsf is close enough, and we can unambiguously determine the date
* for which the leap second is scheduled.
*/
if ( dtlsf != dtls )
{
snprintf(t, BUFFER_SIZES(start, t, size), ", next correction %d sec on %s, new GPS-UTC offset %d",
dtlsf - dtls, gmprettydate(&leapdate), dtlsf);
time_t t_ls;
struct tm *tm;
int n = 0;
if (wnlsf < GPSWRAP)
wnlsf += GPSWEEKS;
if (wnt < GPSWRAP)
wnt += GPSWEEKS;
t_ls = (time_t) wnlsf * SECSPERWEEK
+ (time_t) dn * SECSPERDAY
+ GPS_SEC_BIAS - 1;
tm = gmtime( &t_ls );
if (tm == NULL) // gmtime() failed
{
snprintf( t, size, "** (gmtime() failed in mk_utcinfo())" );
return;
}
n += snprintf( t, size, "UTC offset transition from %is to %is due to leap second %s",
dtls, dtlsf, ( dtls < dtlsf ) ? "insertion" : "deletion" );
n += snprintf( t + n, size - n, " at UTC midnight at the end of %s, %04i-%02i-%02i",
daynames[tm->tm_wday], tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday );
}
else
{
snprintf(t, BUFFER_SIZES(start, t, size), ", last correction on %s",
gmprettydate(&leapdate));
}
snprintf( t, size, "UTC offset parameter: %is, no leap second announced.\n", dtls );
}
#ifdef CLOCK_MEINBERG
/**===========================================================================
** Meinberg GPS166/GPS167 support
** Meinberg GPS receiver support
**/
/*------------------------------------------------------------
* gps16x_message - process GPS16x messages
* gps16x_message - process messages from Meinberg GPS receiver
*/
static void
gps16x_message(
@ -4275,15 +4304,15 @@ gps16x_message(
}
#endif
get_mbg_header(&bufp, &header);
if (header.gps_hdr_csum == mbg_csum(parsetime->parse_msg + 1, 6) &&
(header.gps_len == 0 ||
(header.gps_len < sizeof(parsetime->parse_msg) &&
header.gps_data_csum == mbg_csum(bufp, header.gps_len))))
if (header.hdr_csum == mbg_csum(parsetime->parse_msg + 1, 6) &&
(header.len == 0 ||
(header.len < sizeof(parsetime->parse_msg) &&
header.data_csum == mbg_csum(bufp, header.len))))
{
/*
* clean message
*/
switch (header.gps_cmd)
switch (header.cmd)
{
case GPS_SW_REV:
{
@ -4300,26 +4329,27 @@ gps16x_message(
}
break;
case GPS_STAT:
case GPS_BVAR_STAT:
{
static struct state
{
unsigned short flag; /* status flag */
unsigned const char *string; /* bit name */
BVAR_STAT flag; /* status flag */
const char *string; /* bit name */
} states[] =
{
{ TM_ANT_DISCONN, (const unsigned char *)"ANTENNA FAULTY" },
{ TM_SYN_FLAG, (const unsigned char *)"NO SYNC SIGNAL" },
{ TM_NO_SYNC, (const unsigned char *)"NO SYNC POWERUP" },
{ TM_NO_POS, (const unsigned char *)"NO POSITION" },
{ 0, (const unsigned char *)"" }
{ BVAR_CFGH_INVALID, "Configuration/Health" },
{ BVAR_ALM_NOT_COMPLETE, "Almanachs" },
{ BVAR_UTC_INVALID, "UTC Correction" },
{ BVAR_IONO_INVALID, "Ionospheric Correction" },
{ BVAR_RCVR_POS_INVALID, "Receiver Position" },
{ 0, "" }
};
unsigned short status;
BVAR_STAT status;
struct state *s = states;
char buffer[512];
char *p, *b;
status = get_lsb_short(&bufp);
status = (BVAR_STAT) get_lsb_short(&bufp);
p = b = buffer;
p = ap(buffer, sizeof(buffer), p,
"meinberg_gps_status=\"[0x%04x] ",
@ -4327,6 +4357,7 @@ gps16x_message(
if (status)
{
p = ap(buffer, sizeof(buffer), p, "incomplete buffered data: ");
b = p;
while (s->flag)
{
@ -4345,7 +4376,7 @@ gps16x_message(
}
else
{
p = ap(buffer, sizeof(buffer), p, "<OK>\"");
p = ap(buffer, sizeof(buffer), p, "<all buffered data complete>\"");
}
set_var(&parse->kv, buffer, strlen(buffer)+1, RO|DEF);
@ -4403,12 +4434,12 @@ gps16x_message(
p = ap(buffer, sizeof(buffer), p, "meinberg_antenna_status=\"");
switch (antinfo.status)
{
case ANT_INVALID:
case ANT_INVALID: // No other fields valid since antenna has not yet been disconnected
p = ap(buffer, sizeof(buffer),
p, "<OK>");
break;
case ANT_DISCONN:
case ANT_DISCONN: // Antenna is disconnected, tm_reconn and delta_t not yet set
q = ap(buffer, sizeof(buffer),
p, "DISCONNECTED since ");
NLOG(NLOG_CLOCKSTATUS)
@ -4417,20 +4448,20 @@ gps16x_message(
CLK_UNIT(parse->peer), p);
p = q;
mbg_tm_str(&p, &antinfo.tm_disconn, BUFFER_SIZE(buffer, p));
mbg_tm_str(&p, &antinfo.tm_disconn, BUFFER_SIZE(buffer, p), 0);
*p = '\0';
break;
case ANT_RECONN:
case ANT_RECONN: // Antenna had been disconnect, but receiver sync. after reconnect, so all fields valid
p = ap(buffer, sizeof(buffer),
p, "RECONNECTED on ");
mbg_tm_str(&p, &antinfo.tm_reconn, BUFFER_SIZE(buffer, p));
p, "SYNC AFTER RECONNECT on ");
mbg_tm_str(&p, &antinfo.tm_reconn, BUFFER_SIZE(buffer, p), 0);
p = ap(buffer, sizeof(buffer),
p, ", reconnect clockoffset %c%ld.%07ld s, disconnect time ",
p, ", clock offset at reconnect %c%ld.%07ld s, disconnect time ",
(antinfo.delta_t < 0) ? '-' : '+',
ABS(antinfo.delta_t) / 10000,
ABS(antinfo.delta_t) % 10000);
mbg_tm_str(&p, &antinfo.tm_disconn, BUFFER_SIZE(buffer, p));
(long) ABS(antinfo.delta_t) / 10000,
(long) ABS(antinfo.delta_t) % 10000);
mbg_tm_str(&p, &antinfo.tm_disconn, BUFFER_SIZE(buffer, p), 0);
*p = '\0';
break;
@ -4459,6 +4490,8 @@ gps16x_message(
get_mbg_cfgh(&bufp, &cfgh);
if (cfgh.valid)
{
const char *cp;
uint16_t tmp_val;
int i;
p = buffer;
@ -4467,7 +4500,7 @@ gps16x_message(
mbg_tgps_str(&p, &cfgh.tot_51, BUFFER_SIZE(buffer, p));
p = ap(buffer, sizeof(buffer),
p, "\"");
set_var(&parse->kv, buffer, sizeof(buffer), RO);
set_var(&parse->kv, buffer, sizeof(buffer), RO|COND_DEF);
p = buffer;
p = ap(buffer, sizeof(buffer),
@ -4475,7 +4508,7 @@ gps16x_message(
mbg_tgps_str(&p, &cfgh.tot_63, BUFFER_SIZE(buffer, p));
p = ap(buffer, sizeof(buffer),
p, "\"");
set_var(&parse->kv, buffer, sizeof(buffer), RO);
set_var(&parse->kv, buffer, sizeof(buffer), RO|COND_DEF);
p = buffer;
p = ap(buffer, sizeof(buffer),
@ -4483,80 +4516,54 @@ gps16x_message(
mbg_tgps_str(&p, &cfgh.t0a, BUFFER_SIZE(buffer, p));
p = ap(buffer, sizeof(buffer),
p, "\"");
set_var(&parse->kv, buffer, sizeof(buffer), RO);
set_var(&parse->kv, buffer, sizeof(buffer), RO|COND_DEF);
for (i = MIN_SVNO; i < MAX_SVNO; i++)
for (i = 0; i < N_SVNO_GPS; i++)
{
p = buffer;
p = ap(buffer, sizeof(buffer), p, "gps_cfg[%d]=\"[0x%x] ", i, cfgh.cfg[i]);
switch (cfgh.cfg[i] & 0x7)
{
case 0:
p = ap(buffer, sizeof(buffer), p, "BLOCK I");
break;
case 1:
p = ap(buffer, sizeof(buffer), p, "BLOCK II");
break;
default:
p = ap(buffer, sizeof(buffer), p, "bad CFG");
break;
}
p = ap(buffer, sizeof(buffer), p, "\"");
set_var(&parse->kv, buffer, sizeof(buffer), RO);
p = ap(buffer, sizeof(buffer), p, "sv_info[%d]=\"PRN%d", i, i + N_SVNO_GPS);
p = buffer;
p = ap(buffer, sizeof(buffer), p, "gps_health[%d]=\"[0x%x] ", i, cfgh.health[i]);
switch ((cfgh.health[i] >> 5) & 0x7 )
{
case 0:
p = ap(buffer, sizeof(buffer), p, "OK;");
break;
case 1:
p = ap(buffer, sizeof(buffer), p, "PARITY;");
break;
case 2:
p = ap(buffer, sizeof(buffer), p, "TLM/HOW;");
break;
case 3:
p = ap(buffer, sizeof(buffer), p, "Z-COUNT;");
break;
case 4:
p = ap(buffer, sizeof(buffer), p, "SUBFRAME 1,2,3;");
break;
case 5:
p = ap(buffer, sizeof(buffer), p, "SUBFRAME 4,5;");
break;
case 6:
p = ap(buffer, sizeof(buffer), p, "UPLOAD BAD;");
break;
case 7:
p = ap(buffer, sizeof(buffer), p, "DATA BAD;");
break;
}
tmp_val = cfgh.health[i]; /* a 6 bit SV health code */
p = ap(buffer, sizeof(buffer), p, "; health=0x%02x (", tmp_val);
/* "All Ones" has a special meaning" */
if (tmp_val == 0x3F) /* satellite is unusable or doesn't even exist */
cp = "SV UNAVAILABLE";
else {
/* The MSB contains a summary of the 3 MSBs of the 8 bit health code,
* indicating if the data sent by the satellite is OK or not. */
p = ap(buffer, sizeof(buffer), p, "DATA %s, ", (tmp_val & 0x20) ? "BAD" : "OK" );
switch (cfgh.health[i] & 0x1F)
/* The 5 LSBs contain the status of the different signals sent by the satellite. */
switch (tmp_val & 0x1F)
{
case 0:
p = ap(buffer, sizeof(buffer), p, "SIGNAL OK");
break;
case 0x1C:
p = ap(buffer, sizeof(buffer), p, "SV TEMP OUT");
break;
case 0x1D:
p = ap(buffer, sizeof(buffer), p, "SV WILL BE TEMP OUT");
break;
case 0x1E:
break;
case 0x1F:
p = ap(buffer, sizeof(buffer), p, "MULTIPLE ERRS");
break;
default:
p = ap(buffer, sizeof(buffer), p, "TRANSMISSION PROBLEMS");
break;
case 0x00: cp = "SIGNAL OK"; break;
/* codes 0x01 through 0x1B indicate that one or more
* specific signal components are weak or dead.
* We don't decode this here in detail. */
case 0x1C: cp = "SV IS TEMP OUT"; break;
case 0x1D: cp = "SV WILL BE TEMP OUT"; break;
default: cp = "TRANSMISSION PROBLEMS"; break;
}
}
p = ap(buffer, sizeof(buffer), p, "%s)", cp );
p = ap(buffer, sizeof(buffer), p, "\"");
set_var(&parse->kv, buffer, sizeof(buffer), RO);
tmp_val = cfgh.cfg[i]; /* a 4 bit SV configuration/type code */
p = ap(buffer, sizeof(buffer), p, "; cfg=0x%02x (", tmp_val);
switch (tmp_val & 0x7)
{
case 0x00: cp = "(reserved)"; break;
case 0x01: cp = "BLOCK II/IIA/IIR"; break;
case 0x02: cp = "BLOCK IIR-M"; break;
case 0x03: cp = "BLOCK IIF"; break;
case 0x04: cp = "BLOCK III"; break;
default: cp = "unknown SV type"; break;
}
p = ap(buffer, sizeof(buffer), p, "%s", cp );
if (tmp_val & 0x08) /* A-S is on, P-code is encrypted */
p = ap( buffer, sizeof(buffer), p, ", A-S on" );
p = ap(buffer, sizeof(buffer), p, ")\"");
set_var(&parse->kv, buffer, sizeof(buffer), RO|COND_DEF);
}
}
}
@ -4624,11 +4631,12 @@ gps16x_message(
}
else
{
msyslog(LOG_DEBUG, "PARSE receiver #%d: gps16x_message: message checksum error: hdr_csum = 0x%x (expected 0x%lx), data_len = %d, data_csum = 0x%x (expected 0x%lx)",
msyslog(LOG_DEBUG, "PARSE receiver #%d: gps16x_message: message checksum error: hdr_csum = 0x%x (expected 0x%x), "
"data_len = %d, data_csum = 0x%x (expected 0x%x)",
CLK_UNIT(parse->peer),
header.gps_hdr_csum, mbg_csum(parsetime->parse_msg + 1, 6),
header.gps_len,
header.gps_data_csum, mbg_csum(bufp, (unsigned)((header.gps_len < sizeof(parsetime->parse_msg)) ? header.gps_len : 0)));
header.hdr_csum, mbg_csum(parsetime->parse_msg + 1, 6),
header.len,
header.data_csum, mbg_csum(bufp, (unsigned)((header.len < sizeof(parsetime->parse_msg)) ? header.len : 0)));
}
}
@ -4648,7 +4656,7 @@ gps16x_poll(
static GPS_MSG_HDR sequence[] =
{
{ GPS_SW_REV, 0, 0, 0 },
{ GPS_STAT, 0, 0, 0 },
{ GPS_BVAR_STAT, 0, 0, 0 },
{ GPS_UTC, 0, 0, 0 },
{ GPS_ASCII_MSG, 0, 0, 0 },
{ GPS_ANT_INFO, 0, 0, 0 },
@ -4668,7 +4676,7 @@ gps16x_poll(
parse->peer->procptr->nextaction = current_time + ((poll_info_t *)parse->parse_type->cl_data)->rate;
}
if (sequence[parse->localstate].gps_cmd == (unsigned short)~0)
if (sequence[parse->localstate].cmd == (unsigned short)~0)
parse->localstate = 0;
header = sequence + parse->localstate++;
@ -4678,7 +4686,7 @@ gps16x_poll(
put_mbg_header(&outp, header);
outp = cmd_buffer + 1;
header->gps_hdr_csum = (short)mbg_csum(outp, 6);
header->hdr_csum = (short)mbg_csum(outp, 6);
put_mbg_header(&outp, header);
#ifdef DEBUG
@ -4695,7 +4703,7 @@ gps16x_poll(
}
#endif
rtc = write(parse->generic->io.fd, cmd_buffer, (unsigned long)(outp - cmd_buffer));
rtc = (int) write(parse->generic->io.fd, cmd_buffer, (unsigned long)(outp - cmd_buffer));
if (rtc < 0)
{
@ -4745,7 +4753,7 @@ gps16x_poll_init(
return 1;
}
#endif /* CLOCK_MEINBERG */
/**===========================================================================
** clock polling support
**/
@ -4758,11 +4766,11 @@ poll_dpoll(
struct parseunit *parse
)
{
int rtc;
long rtc;
const char *ps = ((poll_info_t *)parse->parse_type->cl_data)->string;
int ct = ((poll_info_t *)parse->parse_type->cl_data)->count;
long ct = ((poll_info_t *)parse->parse_type->cl_data)->count;
rtc = write(parse->generic->io.fd, ps, (unsigned long)ct);
rtc = write(parse->generic->io.fd, ps, ct);
if (rtc < 0)
{
ERR(ERR_BADIO)
@ -4772,7 +4780,7 @@ poll_dpoll(
if (rtc != ct)
{
ERR(ERR_BADIO)
msyslog(LOG_ERR, "PARSE receiver #%d: poll_dpoll: failed to send cmd incomplete (%d of %d bytes sent)", CLK_UNIT(parse->peer), rtc, ct);
msyslog(LOG_ERR, "PARSE receiver #%d: poll_dpoll: failed to send cmd incomplete (%ld of %ld bytes sent)", CLK_UNIT(parse->peer), rtc, ct);
}
clear_err(parse, ERR_BADIO);
}
@ -4812,7 +4820,7 @@ poll_init(
return 0;
}
/**===========================================================================
** Trimble support
**/
@ -4878,7 +4886,7 @@ trimbletaip_event(
iv = taipinit;
while (*iv)
{
int rtc = write(parse->generic->io.fd, *iv, strlen(*iv));
int rtc = (int) write(parse->generic->io.fd, *iv, strlen(*iv));
if (rtc < 0)
{
msyslog(LOG_ERR, "PARSE receiver #%d: trimbletaip_event: failed to send cmd to clock: %m", CLK_UNIT(parse->peer));
@ -5098,7 +5106,7 @@ sendflt(
int i;
union uval uval;
uval.fv = a;
uval.fv = (float) a;
#ifdef WORDS_BIGENDIAN
for (i=0; i<=3; i++)
#else
@ -5392,7 +5400,7 @@ getshort(
unsigned char *p
)
{
return get_msb_short(&p);
return (int) get_msb_short(&p);
}
/*--------------------------------------------------
@ -5431,7 +5439,7 @@ trimbletsip_message(
}
else
{
int var_flag;
u_short var_flag;
trimble_t *tr = parse->localdata;
unsigned int cmd = buffer[1];
char pbuffer[200];
@ -5466,7 +5474,7 @@ trimbletsip_message(
return;
}
var_flag = s->varmode;
var_flag = (u_short) s->varmode;
switch(cmd)
{
@ -5615,11 +5623,11 @@ trimbletsip_message(
case CMD_RUTCPARAM:
{
float t0t = getflt((unsigned char *)&mb(14));
short wnt = getshort((unsigned char *)&mb(18));
short dtls = getshort((unsigned char *)&mb(12));
short wnlsf = getshort((unsigned char *)&mb(20));
short dn = getshort((unsigned char *)&mb(22));
short dtlsf = getshort((unsigned char *)&mb(24));
short wnt = (short) getshort((unsigned char *)&mb(18));
short dtls = (short) getshort((unsigned char *)&mb(12));
short wnlsf = (short) getshort((unsigned char *)&mb(20));
short dn = (short) getshort((unsigned char *)&mb(22));
short dtlsf = (short) getshort((unsigned char *)&mb(24));
if ((int)t0t != 0)
{
@ -5755,7 +5763,7 @@ trimbletsip_message(
if (getflt((unsigned char *)&mb(4)) < 0.0)
{
t = ap(pbuffer, sizeof(pbuffer), t, "<NO MEASUREMENTS>");
var_flag &= ~DEF;
var_flag &= (u_short)(~DEF);
}
else
{
@ -5768,7 +5776,7 @@ trimbletsip_message(
getflt((unsigned char *)&mb(16)) * RTOD);
if (mb(20))
{
var_flag &= ~DEF;
var_flag &= (u_short)(~DEF);
t = ap(pbuffer, sizeof(pbuffer), t, ", OLD");
}
if (mb(22))
@ -5790,12 +5798,12 @@ trimbletsip_message(
break;
}
t = ap(pbuffer, sizeof(pbuffer), t,"\"");
t = ap(pbuffer, sizeof(pbuffer), t, "\"");
set_var(&parse->kv, pbuffer, sizeof(pbuffer), var_flag);
}
}
/**============================================================
** RAWDCF support
**/

View File

@ -48,8 +48,7 @@ subdir = ntpdate
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
$(top_srcdir)/sntp/m4/define_dir.m4 \
$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
$(top_srcdir)/sntp/m4/libtool.m4 \
@ -78,6 +77,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/os_cflags.m4 \
$(top_srcdir)/sntp/m4/snprintf.m4 \
$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@ -329,6 +330,11 @@ TIMETRIM_DL = @TIMETRIM_DL@
TIMETRIM_DS = @TIMETRIM_DS@
TIMETRIM_MS = @TIMETRIM_MS@
TIMETRIM_NI = @TIMETRIM_NI@
UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
VERSION = @VERSION@
VER_SUFFIX = @VER_SUFFIX@
YACC = @YACC@

View File

@ -50,8 +50,7 @@ subdir = ntpdc
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
$(top_srcdir)/sntp/m4/define_dir.m4 \
$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
$(top_srcdir)/sntp/m4/libtool.m4 \
@ -80,6 +79,8 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
$(top_srcdir)/sntp/m4/openldap.m4 \
$(top_srcdir)/sntp/m4/os_cflags.m4 \
$(top_srcdir)/sntp/m4/snprintf.m4 \
$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@ -363,6 +364,11 @@ TIMETRIM_DL = @TIMETRIM_DL@
TIMETRIM_DS = @TIMETRIM_DS@
TIMETRIM_MS = @TIMETRIM_MS@
TIMETRIM_NI = @TIMETRIM_NI@
UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
VERSION = @VERSION@
VER_SUFFIX = @VER_SUFFIX@
YACC = @YACC@

View File

@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntpdc.texi)
#
# It has been AutoGen-ed February 4, 2015 at 02:42:41 AM by AutoGen 5.18.5pre4
# It has been AutoGen-ed April 7, 2015 at 04:26:32 AM by AutoGen 5.18.5pre4
# From the definitions ntpdc-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@ -76,7 +76,7 @@ with a status code of 0.
@exampleindent 0
@example
ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p1
ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p2
Usage: ntpdc [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...]
Flg Arg Option-Name Description
-4 no ipv4 Force IPv4 DNS name resolution

Some files were not shown because too many files have changed in this diff Show More