b5bbe2e3e7
(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. * [Sec 2671] vallen in extension fields are not validated. --- (4.2.8p1-RC2) 2015/01/29 Released by Harlan Stenn <stenn@ntp.org> * [Bug 2627] shm refclock allows only two units with owner-only access rework: reverted sense of mode bit (so default reflects previous behaviour) and updated ducumentation. * [Bug 2732] - Leap second not handled correctly on Windows 8 use 'GetTickCount()' to get the true elapsed time of slew (This should work for all versions of Windows >= W2K) * [Bug 2738] Missing buffer initialization in refclocK_parse.c::parsestate(). * [Bug 2739] Parse driver with PPS enabled occasionally evaluates PPS timestamp with wrong sign. Removed some German umlauts. * [Bug 2740] Removed some obsolete code from the parse driver. * [Bug 2741] Incorrect buffer check in refclocK_parse.c::parsestatus(). --- (4.2.8p1-RC1) 2015/01/24 Released by Harlan Stenn <stenn@ntp.org> * Start the RC for 4.2.8p1. * [Bug 2187] Update version number generation scripts. * [Bug 2617] Fix sntp Usage documentation section. * [Sec 2672] Code cleanup: On some OSes ::1 can be spoofed... * [Bug 2736] Show error message if we cannot open the config file. * Copyright update. * Fix the package name. --- (4.2.8p1-beta5) 2015/01/07 Released by Harlan Stenn <stenn@ntp.org> * [Bug 2695] Windows build: __func__ not supported under Windows. * [Bug 2728] Work around C99-style structure initialization code for older compilers, specifically Visual Studio prior to VS2013. --- (4.2.8p1-beta4) 2015/01/04 Released by Harlan Stenn <stenn@ntp.org> * [Bug 1084] PPSAPI for ntpd on Windows with DLL backends * [Bug 2695] Build problem on Windows (sys/socket.h). * [Bug 2715] mdnstries option for ntp.conf from NetBSD. * Fix a regression introduced to timepps-Solaris.h as part of: [Bug 1206] Required compiler changes for Windows (4.2.5p181) 2009/06/06 --- (4.2.8p1-beta3) 2015/01/02 Released by Harlan Stenn <stenn@ntp.org> * [Bug 2627] shm refclock allows only two units with owner-only access Use mode bit 0 to select public access for units >= 2 (units 0 & 1 are always private. * [Bug 2681] Fix display of certificate EOValidity dates on 32-bit systems. * [Bug 2695] 4.2.8 does not build on Windows. * [bug 2700] mrulist stopped working in 4.2.8. * [Bug 2706] libparse/info_trimble.c build dependencies are broken. * [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD. * [Bug 2714] libevent may need to be built independently of any build of sntp. * [Bug 2715] mdnstries option for ntp.conf from NetBSD. --- (4.2.8p1-beta2) 2014/12/27 Released by Harlan Stenn <stenn@ntp.org> * [Bug 2674] Install sntp in sbin on NetBSD. * [Bug 2693] ntp-keygen doesn't build without OpenSSL and sntp. * [Bug 2707] Avoid a C90 extension in libjsmn/jsmn.c. * [Bug 2709] see if we have a C99 compiler (not yet required). --- (4.2.8p1-beta1) 2014/12/23 Released by Harlan Stenn <stenn@ntp.org> * [Sec 2672] On some OSes ::1 can be spoofed, bypassing source IP ACLs. * [Bug 2693] ntp-keygen doesn't build without OpenSSL. * [Bug 2697] IN6_IS_ADDR_LOOPBACK build problems on some OSes. * [Bug 2699] HAVE_SYS_SELECT_H is misspelled in refclock_gpsdjson.c. ---
80 lines
9.4 KiB
HTML
80 lines
9.4 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
|
|
<title>sntp - Simple Network Time Protocol (SNTP) Client</title>
|
|
<!-- Changed by: Harlan &, 07-Dec-2014 -->
|
|
<link href="scripts/style.css" type="text/css" rel="stylesheet">
|
|
</head>
|
|
<body>
|
|
<h3><tt>sntp</tt> - Simple Network Time Protocol (SNTP) Client</h3>
|
|
<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 -->1-Apr-2015 11:05<!-- #EndDate -->
|
|
UTC</p>
|
|
<br clear="left">
|
|
<hr>
|
|
<h4>Synopsis</h4>
|
|
<tt>sntp [{--help -?}][{-4 -6}][-a <i>keynum</i>][-b <i>bcaddress</i>][-B <i>bctimeout</i>][-c][-d][-D <i>debug-level</i>][-g <i>delay</i>][-K <i>kodfile</i>][-k <i>keyfile</i>][-l <i>logfile</i>][-M <i>steplimit</i>][-o <i>ntpver</i>][-r][-S][-s][-u <i>uctimeout</i>][--wait][--version][<i>address(es)</i>]</tt>
|
|
<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 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>
|
|
<dl>
|
|
<dt><tt>-?, --help</tt></dt>
|
|
<dd>displays usage information. The short form typically requires shell quoting, such as <tt>-\?</tt>, otherwise <tt>?</tt> is consumed by the shell.</dd>
|
|
<dt><tt>-4, --ipv4</tt></dt>
|
|
<dd>When resolving hostnames to IP addresses, use IPv4 addresses only.</dd>
|
|
<dt><tt>-6, --ipv6</tt></dt>
|
|
<dd>When resolving hostnames to IP addresses, use IPv6 addresses only.</dd>
|
|
<dt><tt>-a <i>keynum</i>, --authentication <i>keynum</i></tt></dt>
|
|
<dd>Enable authentication with the key ID <i>keynum</i>. <i>keynum</i> is a number specified in the keyfile along with an authentication secret (password or digest). See the <tt>-k, --keyfile</tt> option for more details.</dd>
|
|
<dt><tt>-b <i>bcaddress</i>, --broadcast <i>bcaddress</i></tt></dt>
|
|
<dd>Listen for NTP packets sent to the broadcast or multicast address <i>bcaddress</i>, which can be a DNS name or IP address. The default maximum time to listen for broadcasts/multicasts, 68 seconds, can be modified with the <tt>-B, --bctimeout</tt> option.</dd>
|
|
<dt><tt>-B <i>bctimeout</i>, --bctimeout <i>bctimeout</i></tt></dt>
|
|
<dd>Wait <i>bctimeout</i> seconds for broadcast or multicast NTP message before terminating. The default is 68 seconds, chosen because ntpd typically transmits broadcasts/multicasts every 64 seconds. Note that the short option is <tt>-B</tt>, an uppercase letter B.</dd>
|
|
<dt><tt>-c, --concurrent</tt></dt>
|
|
<dd>Concurrently query all addresses returned for hostname. Requests from an NTP client to a single server should never be sent more often than once every two seconds. By default, all addresses resolved from a single hostname are assumed to be for a single instance of ntpd, and therefore sntp will send queries to these addresses one after another, waiting two seconds between queries. This option indicates multiple addresses returned for a hostname are on different machines, so sntp can send concurrent queries. This is appropriate when using *.pool.ntp.org, for example.</dd>
|
|
<dt><tt>-d, --debug-level</tt></dt>
|
|
<dd>Increase debug verbosity level by one. May be specified multiple times. See also the <tt>-D, --set-debug-level</tt> option.</dd>
|
|
<dt><tt>-D <i>debug-level</i>, --set-debug-level <i>debug-level</i></tt></dt>
|
|
<dd>Set the debug verbosity level to <i>debug-level</i>. The default level is zero. Note that the short option is <tt>-D</tt>, an uppercase letter D. See also the <tt>-d, --debug-level</tt> option.</dd>
|
|
<dt><tt>-g <i>delay</i>, --gap <i>delay</i></tt></dt>
|
|
<dd>Specify the <i>delay</i> in milliseconds between outgoing queries, defaulting to 50. <tt>sntp</tt> sends queries to all provided hostnames/addresses in short succession, and by default terminates once the first valid response is received. With multiple time sources provided, all but one will not be used. To limit the number of queries whose responses will not be used, each query is separated from the preceding one by <i>delay</i> milliseconds, to allow time for responses to earlier queries to be received. A larger <i>delay</i> reduces the query load on the time sources, increasing the time to receive a valid response if the first source attempted is slow or unreachable.</dd>
|
|
<dt><tt>-K <i>kodfile</i>, --kod <i>kodfile</i></tt></dt>
|
|
<dd>Specifies the filename <i>kodfile</i> to be used for the persistent history of KoD (Kiss Of Death, or rate-limiting) responses received from servers. The default is <tt>/var/db/ntp-kod</tt>. If the file does not exist, a warning message will be displayed. The file will not be created. Note that the short option is <tt>-K</tt>, an uppercase letter K.</dd>
|
|
<dt><tt>-k <i>keyfile</i>, --keyfile <i>keyfile</i></tt></dt>
|
|
<dd>Specifies the filename <i>keyfile</i> used with the <tt>-a</tt>/<tt>--authentication</tt> option. The format of the file is described on the <a href="keygen.html"><tt>ntp-keygen</tt> page</a>.</dd>
|
|
<dt><tt>-l <i>logfile</i>, --filelog <i>logfile</i></tt></dt>
|
|
<dd>Specifies the filename in which to append a copy of status messages, which also appear on the terminal.</dd>
|
|
<dt><tt>-M <i>steplimit</i>, --steplimit <i>steplimit</i></tt></dt>
|
|
<dd>If both <tt>-S</tt>/<tt>--step</tt> and <tt>-s</tt>/<tt>--slew</tt> options are provided, an offset of less than <i>steplimit</i> milliseconds will be corrected by slewing the clock using adjtime(), while an offset of <i>steplimit</i> or more will be corrected by setting the clock to the corrected time. Note that the short option is <tt>-M</tt>, an uppercase letter M.</dd>
|
|
<dt><tt>-o <i>ntpver</i>, --ntpversion <i>ntpver</i></tt></dt>
|
|
<dd>Specifies the NTP protocol version number <i>ntpver</i> to include in requests, default 4. This option is rarely useful.</dd>
|
|
<dt><tt>-r, --usereservedport</tt></dt>
|
|
<dd>By default, <tt>sntp</tt> uses a UDP source port number selected by the operating system. When this option is used, the reserved NTP port 123 is used, which most often requires <tt>sntp</tt> be invoked as the superuser (commonly "root"). This can help identify connectivity failures due to port-based firewalling which affect <tt>ntpd</tt>, which always uses source port 123.</dd>
|
|
<dt><tt>-S, --step</tt></dt>
|
|
<dd>By default, <tt>sntp</tt> displays the clock offset but does not attempt to correct it. This option enables offset correction by stepping, that is, directly setting the clock to the corrected time. This typically requires <tt>sntp</tt> be invoked as the superuser ("root"). Note that the short option is <tt>-S</tt>, an uppercase letter S.</dd>
|
|
<dt><tt>-s, --slew</tt></dt>
|
|
<dd>By default, <tt>sntp</tt> displays the clock offset but does not attempt to correct it. This option enables offset correction by slewing using adjtime(), which changes the rate of the clock for a period long enough to accomplish the required offset (phase) correction. This typically requires <tt>sntp</tt> be invoked as the superuser ("root").</dd>
|
|
<dt><tt>-u <i>uctimeout</i>, --uctimeout <i>uctimeout</i></tt></dt>
|
|
<dd>Specifies the maximum time <i>uctimeout</i> in seconds to wait for a unicast response before terminating.</dd>
|
|
<dt><tt>--wait</tt></dt>
|
|
<dd>When neither <tt>-S</tt>/<tt>--step</tt> nor <tt>-s</tt>/<tt>--slew</tt> options are provided, <tt>sntp</tt> will by default terminate after the first valid response is received. This option causes <tt>sntp</tt> to instead wait for all pending queries' responses.</dd>
|
|
<dt><tt>--version</tt></dt>
|
|
<dd>Display the <tt>sntp</tt> program's version number and the date and time it was compiled.</dd>
|
|
</dl>
|
|
<h4>Return Value</h4>
|
|
<p>The program returns an exit status of zero for if a valid response is received and non-zero otherwise.</p>
|
|
<h4>Author</h4>
|
|
<p>This <tt>sntp</tt> was originally developed by Johannes Maximilian Kuehn. Harlan Stenn and Dave Hart modified it to query more than one server at a time. See the file <tt>ChangeLog</tt> in the distribution for details.</p>
|
|
<hr>
|
|
<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
|
|
</body>
|
|
</html>
|