int flags;
#define CTX_BCST 0x0001
#define CTX_UCST 0x0002
+#define CTX_CONC 0x0004
#define CTX_unused 0xfffd
int key_id;
struct timeval timeout;
struct key *keys = NULL;
struct timeval timeout_tv;
+struct timeval ucst_timeout_tv = { 5, 0 };
+
static union {
struct pkt pkt;
char buf[1500];
printf("broadcast-after: <%s> n_pending_dns = %d\n", OPT_ARG(BROADCAST), n_pending_dns);
}
+ if (HAVE_OPT(CONCURRENT)) {
+ int cn = STACKCT_OPT( CONCURRENT );
+ const char ** cp = STACKLST_OPT( CONCURRENT );
+
+ while (cn-- > 0) {
+ /* Do something with *cp++ */
+ printf("Concurrent: <%s>\n", *cp++);
+ }
+ }
+
for (i = 0; i < argc; ++i) {
struct evutil_addrinfo hints; /* local copy is OK */
struct dns_ctx *dns_ctx;
dns_ctx->name = argv[i];
dns_ctx->flags = CTX_UCST;
- dns_ctx->timeout = timeout_tv;
+ dns_ctx->timeout = ucst_timeout_tv;
if (ENABLED_OPT(AUTHENTICATION) &&
atoint(OPT_ARG(AUTHENTICATION), &l)) {
/*
** HMS: Exactly why do we want a timeout?
- ** Should we use the same value for bcast and ucast?
*/
ev = event_new(base, sock,
EV_TIMEOUT|EV_READ|EV_PERSIST,
NTOHL_FP(&rpkt->xmt, &p_xmt);
*precision = LOGTOD(rpkt->precision);
- DPRINTF(1, ("offset_calculation: precision: %f", *precision));
+ DPRINTF(2, ("offset_calculation: precision: %f", *precision));
*root_dispersion = FPTOD(p_rdsp);
#ifdef DEBUG
- if (debug) {
+ if (debug > 2) {
printf("sntp rootdelay: %f\n", FPTOD(p_rdly));
printf("sntp rootdisp: %f\n", *root_dispersion);
/*
* EDIT THIS FILE WITH CAUTION (sntp-opts.c)
*
- * It has been AutoGen-ed January 9, 2011 at 06:03:48 AM by AutoGen 5.11.6pre7
+ * It has been AutoGen-ed January 10, 2011 at 11:23:51 PM by AutoGen 5.11.6pre7
* From the definitions sntp-opts.def
* and the template file options
*
static char const zKod_NAME[] = "KOD";
static char const zKod_Name[] = "kod";
#define KOD_FLAGS (OPTST_DISABLED \
- | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
/*
* Syslog option description with
aFilelogCantList[] = {
INDEX_OPT_SYSLOG, NO_EQUIVALENT };
#define FILELOG_FLAGS (OPTST_DISABLED \
- | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
+
+/*
+ * Steplimit option description with
+ * "Must also have options" and "Incompatible options":
+ */
+static char const zSteplimitText[] =
+ "Adjustments less than steplimit msec will be slewed.";
+static char const zSteplimit_NAME[] = "STEPLIMIT";
+static char const zSteplimit_Name[] = "steplimit";
+static const int
+ aSteplimitCantList[] = {
+ INDEX_OPT_ADJTIME,
+ INDEX_OPT_SETTOD, NO_EQUIVALENT };
+#define STEPLIMIT_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
/*
* Settod option description with
static char const zSettod_Name[] = "settod";
static const int
aSettodCantList[] = {
- INDEX_OPT_ADJTIME, NO_EQUIVALENT };
+ INDEX_OPT_ADJTIME,
+ INDEX_OPT_STEPLIMIT, NO_EQUIVALENT };
#define SETTOD_FLAGS (OPTST_DISABLED)
/*
static char const zAdjtime_Name[] = "adjtime";
static const int
aAdjtimeCantList[] = {
- INDEX_OPT_SETTOD, NO_EQUIVALENT };
+ INDEX_OPT_SETTOD,
+ INDEX_OPT_STEPLIMIT, NO_EQUIVALENT };
#define ADJTIME_FLAGS (OPTST_DISABLED)
+/*
+ * Concurrent option description:
+ */
+static char const zConcurrentText[] =
+ "Send concurrent queries to all IPs returned for host-name";
+static char const zConcurrent_NAME[] = "CONCURRENT";
+static char const zConcurrent_Name[] = "concurrent";
+#define CONCURRENT_FLAGS (OPTST_DISABLED | OPTST_STACKED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
/*
* Broadcast option description:
*/
static char const zKeyfile_NAME[] = "KEYFILE";
static char const zKeyfile_Name[] = "keyfile";
#define KEYFILE_FLAGS (OPTST_DISABLED \
- | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
/*
* Help/More_Help/Version option descriptions:
* if multiple copies are allowed.
*/
static tOptProc
- doUsageOpt;
+ doOptFilelog, doOptKeyfile, doOptKod, doUsageOpt;
/*
* #define map the "normal" callout procs to the test ones...
optionStackArg, optionTimeVal, optionUnstackArg,
optionVersionStderr;
static tOptProc
- doOptSet_Debug_Level, doUsageOpt;
+ doOptFilelog, doOptKeyfile, doOptKod, doOptSet_Debug_Level, doUsageOpt;
/*
* #define map the "normal" callout procs
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
- /* option proc */ NULL,
+ /* option proc */ doOptKod,
/* desc, NAME, name */ zKodText, zKod_NAME, zKod_Name,
/* disablement strs */ NULL, NULL },
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, aFilelogCantList,
- /* option proc */ NULL,
+ /* option proc */ doOptFilelog,
/* desc, NAME, name */ zFilelogText, zFilelog_NAME, zFilelog_Name,
/* disablement strs */ NULL, NULL },
- { /* entry idx, value */ 7, VALUE_OPT_SETTOD,
- /* equiv idx, value */ 7, VALUE_OPT_SETTOD,
+ { /* entry idx, value */ 7, VALUE_OPT_STEPLIMIT,
+ /* equiv idx, value */ 7, VALUE_OPT_STEPLIMIT,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ STEPLIMIT_FLAGS, 0,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aSteplimitCantList,
+ /* option proc */ optionNumericVal,
+ /* desc, NAME, name */ zSteplimitText, zSteplimit_NAME, zSteplimit_Name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 8, VALUE_OPT_SETTOD,
+ /* equiv idx, value */ 8, VALUE_OPT_SETTOD,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ SETTOD_FLAGS, 0,
/* desc, NAME, name */ zSettodText, zSettod_NAME, zSettod_Name,
/* disablement strs */ NULL, NULL },
- { /* entry idx, value */ 8, VALUE_OPT_ADJTIME,
- /* equiv idx, value */ 8, VALUE_OPT_ADJTIME,
+ { /* entry idx, value */ 9, VALUE_OPT_ADJTIME,
+ /* equiv idx, value */ 9, VALUE_OPT_ADJTIME,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ ADJTIME_FLAGS, 0,
/* desc, NAME, name */ zAdjtimeText, zAdjtime_NAME, zAdjtime_Name,
/* disablement strs */ NULL, NULL },
- { /* entry idx, value */ 9, VALUE_OPT_BROADCAST,
- /* equiv idx, value */ 9, VALUE_OPT_BROADCAST,
+ { /* entry idx, value */ 10, VALUE_OPT_CONCURRENT,
+ /* equiv idx, value */ 10, VALUE_OPT_CONCURRENT,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ CONCURRENT_FLAGS, 0,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionStackArg,
+ /* desc, NAME, name */ zConcurrentText, zConcurrent_NAME, zConcurrent_Name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 11, VALUE_OPT_BROADCAST,
+ /* equiv idx, value */ 11, VALUE_OPT_BROADCAST,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ BROADCAST_FLAGS, 0,
/* desc, NAME, name */ zBroadcastText, zBroadcast_NAME, zBroadcast_Name,
/* disablement strs */ NULL, NULL },
- { /* entry idx, value */ 10, VALUE_OPT_TIMEOUT,
- /* equiv idx, value */ 10, VALUE_OPT_TIMEOUT,
+ { /* entry idx, value */ 12, VALUE_OPT_TIMEOUT,
+ /* equiv idx, value */ 12, VALUE_OPT_TIMEOUT,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ TIMEOUT_FLAGS, 0,
/* desc, NAME, name */ zTimeoutText, zTimeout_NAME, zTimeout_Name,
/* disablement strs */ NULL, NULL },
- { /* entry idx, value */ 11, VALUE_OPT_AUTHENTICATION,
- /* equiv idx, value */ 11, VALUE_OPT_AUTHENTICATION,
+ { /* entry idx, value */ 13, VALUE_OPT_AUTHENTICATION,
+ /* equiv idx, value */ 13, VALUE_OPT_AUTHENTICATION,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ AUTHENTICATION_FLAGS, 0,
/* desc, NAME, name */ zAuthenticationText, zAuthentication_NAME, zAuthentication_Name,
/* disablement strs */ NULL, NULL },
- { /* entry idx, value */ 12, VALUE_OPT_KEYFILE,
- /* equiv idx, value */ 12, VALUE_OPT_KEYFILE,
+ { /* entry idx, value */ 14, VALUE_OPT_KEYFILE,
+ /* equiv idx, value */ 14, VALUE_OPT_KEYFILE,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ KEYFILE_FLAGS, 0,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
- /* option proc */ NULL,
+ /* option proc */ doOptKeyfile,
/* desc, NAME, name */ zKeyfileText, zKeyfile_NAME, zKeyfile_Name,
/* disablement strs */ NULL, NULL },
* Define the Sntp Option Environment
*/
static char const zPROGNAME[5] = "SNTP";
-static char const zUsageTitle[123] =
+static char const zUsageTitle[130] =
"sntp - standard SNTP program - Ver. 4.2.7p114\n\
-USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... hostname-or-IP ...\n";
+USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
+\t\t[ hostname-or-IP ...]\n";
static char const zRcName[7] = ".ntprc";
static char const * const apzHomeList[3] = {
"$HOME",
static char const zBugsAddr[34] = "http://bugs.ntp.org, bugs@ntp.org";
static char const zExplain[] = "\n\n";
-static char const zDetail[352] = "\n\
-sntp implements the Simple Network Time Protocol, and is used to query\n\
+static char const zDetail[351] = "\n\
+sntp implements the Simple Network Time Protocol and is used to query\n\
an NTP or SNTP server and either display the time or set the local\n\
system's time (given suitable privilege).\n\n\
It can be run interactively from the command line or as a cron job.\n\n\
+ OPTPROC_LONGOPT
+ OPTPROC_NO_REQ_OPT
+ OPTPROC_ENVIRON
- + OPTPROC_ARGS_REQ
+ OPTPROC_MISUSE ),
0, NULL, /* current option index, current option */
NULL, NULL, zPROGNAME,
NO_EQUIVALENT, /* '-#' option index */
NO_EQUIVALENT /* index of default opt */
},
- 18 /* full option count */, 13 /* user option count */,
+ 20 /* full option count */, 15 /* user option count */,
sntp_full_usage, sntp_short_usage,
NULL, NULL,
PKGDATADIR
DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );
}
#endif /* defined(TEST_SNTP_OPTS) */
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * For the kod option.
+ */
+static void
+doOptKod(tOptions* pOptions, tOptDesc* pOptDesc)
+{
+ static teOptFileType const type =
+ FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ static tuFileMode mode;
+#ifndef O_CLOEXEC
+# define O_CLOEXEC 0
+#endif
+ mode.file_flags = O_CLOEXEC;
+
+ optionFileCheck(pOptions, pOptDesc, type, mode);
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * For the filelog option.
+ */
+static void
+doOptFilelog(tOptions* pOptions, tOptDesc* pOptDesc)
+{
+ static teOptFileType const type =
+ FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ static tuFileMode mode;
+#ifndef O_CLOEXEC
+# define O_CLOEXEC 0
+#endif
+ mode.file_flags = O_CLOEXEC;
+
+ optionFileCheck(pOptions, pOptDesc, type, mode);
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * For the keyfile option.
+ */
+static void
+doOptKeyfile(tOptions* pOptions, tOptDesc* pOptDesc)
+{
+ static teOptFileType const type =
+ FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ static tuFileMode mode;
+#ifndef O_CLOEXEC
+# define O_CLOEXEC 0
+#endif
+ mode.file_flags = O_CLOEXEC;
+
+ optionFileCheck(pOptions, pOptDesc, type, mode);
+}
/* extracted from /usr/local/share/autogen/optmain.tpl near line 107 */
#if defined(TEST_SNTP_OPTS) /* TEST MAIN PROCEDURE: */
prog-name = "sntp";
prog-title = "standard SNTP program";
homerc = $HOME, ".";
-argument = 'hostname-or-IP ...';
+argument = '[ hostname-or-IP ...]';
long-opts;
flag = {
name = kod;
value = K;
- arg-type = string;
+ arg-type = file;
arg-name = "file-name";
descrip = "KoD history filename";
doc = <<- _EndOfDoc_
- Modifies the filename to be used to persist the history of KoD
+ Specifies the filename to be used for the persistent history of KoD
responses received from servers. The default is
/var/db/ntp-kod.
_EndOfDoc_;
flag = {
name = filelog;
value = l;
- arg-type = string;
+ arg-type = file;
arg-name = "file-name";
flags-cant = syslog;
descrip = "Log to specified logfile";
};
flag = {
- name = settod;
- value = s;
- flags-cant = adjtime;
- descrip = "Set (step) the time with settimeofday()";
- doc = <<- _EndOfDoc_
+ name = steplimit;
+ value = S;
+ arg-type = number;
+ flags-cant = adjtime, settod;
+ descrip = "Adjustments less than steplimit msec will be slewed.";
+ doc = <<- _EndOfDoc_
+ If the time adjustment is less than steplimit milliseconds, slew the amount using adjtime(). Otherwise, step the correction using settimeofday().
+ _EndOfDoc_;
+ };
+
+flag = {
+ name = settod;
+ value = s;
+ flags-cant = adjtime, steplimit;
+ descrip = "Set (step) the time with settimeofday()";
+ doc = <<- _EndOfDoc_
_EndOfDoc_;
};
flag = {
- name = adjtime;
- value = j;
- flags-cant = settod;
- descrip = "Set (slew) the time with adjtime()";
- doc = <<- _EndOfDoc_
+ name = adjtime;
+ value = j;
+ flags-cant = settod, steplimit;
+ descrip = "Set (slew) the time with adjtime()";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+flag = {
+ name = concurrent;
+ value = c;
+ descrip = "Send concurrent queries to all IPs returned for host-name";
+ arg-type = string;
+ arg-name = "host-name";
+ max = NOLIMIT;
+ stack-arg;
+ doc = <<- _EndOfDoc_
+ Requests from an NTP "client" to a "server" should never be sent
+ more rapidly than one every 2 seconds. By default, any IPs returned
+ as part of a DNS lookup are assumed to be for a single instance of
+ ntpd, and therefore sntp will send queries to these IPs one after
+ another, with a 2-second gap in between each query.
+
+ The -c or --concurrent flag says that any IPs returned for the
+ DNS lookup of the supplied host-name are on different machines,
+ so we can send concurrent queries.
_EndOfDoc_;
};
name = keyfile;
value = k;
descrip = "Specify a keyfile. SNTP will look in this file for the key specified with -a";
- arg-type = string;
+ arg-type = file;
arg-name = "file-name";
doc = <<- _EndOfDoc_
This option specifies the keyfile. SNTP will search for the key specified with -a keyno in this
_END_EXPLAIN;
detail = <<- _END_DETAIL
-sntp implements the Simple Network Time Protocol, and is used to query
+sntp implements the Simple Network Time Protocol and is used to query
an NTP or SNTP server and either display the time or set the local
system's time (given suitable privilege).
/*
* EDIT THIS FILE WITH CAUTION (sntp-opts.h)
*
- * It has been AutoGen-ed January 9, 2011 at 06:03:48 AM by AutoGen 5.11.6pre7
+ * It has been AutoGen-ed January 10, 2011 at 11:23:51 PM by AutoGen 5.11.6pre7
* From the definitions sntp-opts.def
* and the template file options
*
INDEX_OPT_KOD = 4,
INDEX_OPT_SYSLOG = 5,
INDEX_OPT_FILELOG = 6,
- INDEX_OPT_SETTOD = 7,
- INDEX_OPT_ADJTIME = 8,
- INDEX_OPT_BROADCAST = 9,
- INDEX_OPT_TIMEOUT = 10,
- INDEX_OPT_AUTHENTICATION = 11,
- INDEX_OPT_KEYFILE = 12,
- INDEX_OPT_VERSION = 13,
- INDEX_OPT_HELP = 14,
- INDEX_OPT_MORE_HELP = 15,
- INDEX_OPT_SAVE_OPTS = 16,
- INDEX_OPT_LOAD_OPTS = 17
+ INDEX_OPT_STEPLIMIT = 7,
+ INDEX_OPT_SETTOD = 8,
+ INDEX_OPT_ADJTIME = 9,
+ INDEX_OPT_CONCURRENT = 10,
+ INDEX_OPT_BROADCAST = 11,
+ INDEX_OPT_TIMEOUT = 12,
+ INDEX_OPT_AUTHENTICATION = 13,
+ INDEX_OPT_KEYFILE = 14,
+ INDEX_OPT_VERSION = 15,
+ INDEX_OPT_HELP = 16,
+ INDEX_OPT_MORE_HELP = 17,
+ INDEX_OPT_SAVE_OPTS = 18,
+ INDEX_OPT_LOAD_OPTS = 19
} teOptIndex;
-#define OPTION_CT 18
+#define OPTION_CT 20
#define SNTP_VERSION "4.2.7p114"
#define SNTP_FULL_VERSION "sntp - standard SNTP program - Ver. 4.2.7p114"
# warning undefining FILELOG due to option name conflict
# undef FILELOG
# endif
+# ifdef STEPLIMIT
+# warning undefining STEPLIMIT due to option name conflict
+# undef STEPLIMIT
+# endif
# ifdef SETTOD
# warning undefining SETTOD due to option name conflict
# undef SETTOD
# warning undefining ADJTIME due to option name conflict
# undef ADJTIME
# endif
+# ifdef CONCURRENT
+# warning undefining CONCURRENT due to option name conflict
+# undef CONCURRENT
+# endif
# ifdef BROADCAST
# warning undefining BROADCAST due to option name conflict
# undef BROADCAST
# undef KOD
# undef SYSLOG
# undef FILELOG
+# undef STEPLIMIT
# undef SETTOD
# undef ADJTIME
+# undef CONCURRENT
# undef BROADCAST
# undef TIMEOUT
# undef AUTHENTICATION
#define VALUE_OPT_KOD 'K'
#define VALUE_OPT_SYSLOG 'p'
#define VALUE_OPT_FILELOG 'l'
+#define VALUE_OPT_STEPLIMIT 'S'
+
+#define OPT_VALUE_STEPLIMIT (DESC(STEPLIMIT).optArg.argInt)
#define VALUE_OPT_SETTOD 's'
#define VALUE_OPT_ADJTIME 'j'
+#define VALUE_OPT_CONCURRENT 'c'
#define VALUE_OPT_BROADCAST 'b'
#define VALUE_OPT_TIMEOUT 't'
#
# EDIT THIS FILE WITH CAUTION (sntp-opts.texi)
#
-# It has been AutoGen-ed January 9, 2011 at 06:07:36 AM by AutoGen 5.11.6pre7
+# It has been AutoGen-ed January 10, 2011 at 11:23:56 PM by AutoGen 5.11.6pre7
# From the definitions sntp-opts.def
# and the template file aginfo.tpl
@end ignore
* sntp adjtime:: adjtime option (-j)
* sntp authentication:: authentication option (-a)
* sntp broadcast:: broadcast option (-b)
+* sntp concurrent:: concurrent option (-c)
* sntp debug-level:: debug-level option (-d)
* sntp filelog:: filelog option (-l)
* sntp ipv4:: ipv4 option (-4)
* sntp kod:: kod option (-K)
* sntp set-debug-level:: set-debug-level option (-D)
* sntp settod:: settod option (-s)
+* sntp steplimit:: steplimit option (-S)
* sntp syslog:: syslog option (-p)
* sntp timeout:: timeout option (-t)
@end menu
@exampleindent 0
@example
sntp - standard SNTP program - Ver. 4.2.7p114
-USAGE: sntp [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... hostname-or-IP ...
+USAGE: sntp [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
+ [ hostname-or-IP ...]
Flg Arg Option-Name Description
-d no debug-level Increase output debug message level
- may appear multiple times
-6 no ipv6 Force IPv6 DNS name resolution
- prohibits these options:
ipv4
- -K Str kod KoD history filename
+ -K Fil kod KoD history filename
-p no syslog Logging with syslog
- prohibits these options:
filelog
- -l Str filelog Log to specified logfile
+ -l Fil filelog Log to specified logfile
- prohibits these options:
syslog
+ -S Num steplimit Adjustments less than steplimit msec will be slewed.
+ - prohibits these options:
+ adjtime
+ settod
-s no settod Set (step) the time with settimeofday()
- prohibits these options:
adjtime
+ steplimit
-j no adjtime Set (slew) the time with adjtime()
- prohibits these options:
settod
+ steplimit
+ -c Str concurrent Send concurrent queries to all IPs returned for host-name
+ - may appear multiple times
-b Str broadcast Use broadcasts to the address specified for synchronisation
-t Num timeout Specify the number of seconds to wait for broadcasts
-a Num authentication Enable authentication with the key auth-keynumber
- -k Str keyfile Specify a keyfile. SNTP will look in this file for the key specified with -a
+ -k Fil keyfile Specify a keyfile. SNTP will look in this file for the key specified with -a
opt version Output version information and exit
-? no help Display extended usage information and exit
-! no more-help Extended usage information passed thru pager
- reading file ./.ntprc
- examining environment variables named SNTP_*
-sntp implements the Simple Network Time Protocol, and is used to query
+sntp implements the Simple Network Time Protocol and is used to query
an NTP or SNTP server and either display the time or set the local
system's time (given suitable privilege).
@itemize @bullet
@item
must not appear in combination with any of the following options:
-settod.
+settod, steplimit.
@end itemize
for NTP broadcasts. The default maximum wait time,
68 seconds, can be modified with -t.
+@node sntp concurrent
+@subsection concurrent option (-c)
+@cindex sntp-concurrent
+
+This is the ``send concurrent queries to all ips returned for host-name'' option.
+
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@end itemize
+
+Requests from an NTP "client" to a "server" should never be sent
+more rapidly than one every 2 seconds. By default, any IPs returned
+as part of a DNS lookup are assumed to be for a single instance of
+ntpd, and therefore sntp will send queries to these IPs one after
+another, with a 2-second gap in between each query.
+
+The -c or --concurrent flag says that any IPs returned for the
+DNS lookup of the supplied host-name are on different machines,
+so we can send concurrent queries.
+
@node sntp debug-level
@subsection debug-level option (-d)
@cindex sntp-debug-level
@cindex sntp-kod
This is the ``kod history filename'' option.
-Modifies the filename to be used to persist the history of KoD
+Specifies the filename to be used for the persistent history of KoD
responses received from servers. The default is
/var/db/ntp-kod.
@itemize @bullet
@item
must not appear in combination with any of the following options:
-adjtime.
+adjtime, steplimit.
@end itemize
+@node sntp steplimit
+@subsection steplimit option (-S)
+@cindex sntp-steplimit
+
+This is the ``adjustments less than steplimit msec will be slewed.'' option.
+
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+adjtime, settod.
+@end itemize
+
+If the time adjustment is less than steplimit milliseconds, slew the amount using adjtime(). Otherwise, step the correction using settimeofday().
+
@node sntp syslog
@subsection syslog option (-p)
@cindex sntp-syslog
-.TH SNTP 1 2011-01-09 "( 4.2.7p114)" "Programmer's Manual"
+.TH SNTP 1 2011-01-10 "( 4.2.7p114)" "Programmer's Manual"
.\" EDIT THIS FILE WITH CAUTION (sntp.1)
.\"
-.\" It has been AutoGen-ed January 9, 2011 at 06:07:35 AM by AutoGen 5.11.6pre7
+.\" It has been AutoGen-ed January 10, 2011 at 11:23:55 PM by AutoGen 5.11.6pre7
.\" From the definitions sntp-opts.def
.\" and the template file agman1.tpl
.\"
.RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \--\fIopt-name\fP " [[=| ]\fIvalue\fP]]..."
.br
.in +8
-hostname-or-IP ...
+[ hostname-or-IP ...]
.PP
.SH "DESCRIPTION"
.BR \-K " \fIfile-name\fP, " \--kod "=" \fIfile-name\fP
KoD history filename.
.sp
-Modifies the filename to be used to persist the history of KoD
+Specifies the filename to be used for the persistent history of KoD
responses received from servers. The default is
/var/db/ntp-kod.
.TP
This option causes the client to write log messages to the specified
logfile.
.TP
+.BR \-S " \fInumber\fP, " \--steplimit "=" \fInumber\fP
+Adjustments less than steplimit msec will be slewed..
+This option must not appear in combination with any of the following options:
+adjtime, settod.
+This option takes an integer number as its argument.
+.sp
+If the time adjustment is less than steplimit milliseconds, slew the amount using adjtime(). Otherwise, step the correction using settimeofday().
+.TP
.BR \-s ", " \--settod
Set (step) the time with settimeofday().
This option must not appear in combination with any of the following options:
-adjtime.
+adjtime, steplimit.
.sp
.TP
.BR \-j ", " \--adjtime
Set (slew) the time with adjtime().
This option must not appear in combination with any of the following options:
-settod.
+settod, steplimit.
+.sp
+
+.TP
+.BR \-c " \fIhost-name\fP, " \--concurrent "=" \fIhost-name\fP
+Send concurrent queries to all IPs returned for host-name.
+This option may appear an unlimited number of times.
.sp
+Requests from an NTP "client" to a "server" should never be sent
+more rapidly than one every 2 seconds. By default, any IPs returned
+as part of a DNS lookup are assumed to be for a single instance of
+ntpd, and therefore sntp will send queries to these IPs one after
+another, with a 2-second gap in between each query.
+The \-c or \--concurrent flag says that any IPs returned for the
+DNS lookup of the supplied host-name are on different machines,
+so we can send concurrent queries.
.TP
.BR \-b " \fIbroadcast-address\fP, " \--broadcast "=" \fIbroadcast-address\fP
Use broadcasts to the address specified for synchronisation.
<li><a accesskey="2" href="#sntp-adjtime">sntp adjtime</a>: adjtime option (-j)
<li><a accesskey="3" href="#sntp-authentication">sntp authentication</a>: authentication option (-a)
<li><a accesskey="4" href="#sntp-broadcast">sntp broadcast</a>: broadcast option (-b)
-<li><a accesskey="5" href="#sntp-debug_002dlevel">sntp debug-level</a>: debug-level option (-d)
-<li><a accesskey="6" href="#sntp-filelog">sntp filelog</a>: filelog option (-l)
-<li><a accesskey="7" href="#sntp-ipv4">sntp ipv4</a>: ipv4 option (-4)
-<li><a accesskey="8" href="#sntp-ipv6">sntp ipv6</a>: ipv6 option (-6)
-<li><a accesskey="9" href="#sntp-keyfile">sntp keyfile</a>: keyfile option (-k)
+<li><a accesskey="5" href="#sntp-concurrent">sntp concurrent</a>: concurrent option (-c)
+<li><a accesskey="6" href="#sntp-debug_002dlevel">sntp debug-level</a>: debug-level option (-d)
+<li><a accesskey="7" href="#sntp-filelog">sntp filelog</a>: filelog option (-l)
+<li><a accesskey="8" href="#sntp-ipv4">sntp ipv4</a>: ipv4 option (-4)
+<li><a accesskey="9" href="#sntp-ipv6">sntp ipv6</a>: ipv6 option (-6)
+<li><a href="#sntp-keyfile">sntp keyfile</a>: keyfile option (-k)
<li><a href="#sntp-kod">sntp kod</a>: kod option (-K)
<li><a href="#sntp-set_002ddebug_002dlevel">sntp set-debug-level</a>: set-debug-level option (-D)
<li><a href="#sntp-settod">sntp settod</a>: settod option (-s)
+<li><a href="#sntp-steplimit">sntp steplimit</a>: steplimit option (-S)
<li><a href="#sntp-syslog">sntp syslog</a>: syslog option (-p)
<li><a href="#sntp-timeout">sntp timeout</a>: timeout option (-t)
</ul>
This is the automatically generated usage text for sntp:
<pre class="example">sntp - standard SNTP program - Ver. 4.2.7p114
-USAGE: sntp [ -<flag> [<val>] | --<name>[{=| }<val>] ]... hostname-or-IP ...
+USAGE: sntp [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \
+ [ hostname-or-IP ...]
Flg Arg Option-Name Description
-d no debug-level Increase output debug message level
- may appear multiple times
-6 no ipv6 Force IPv6 DNS name resolution
- prohibits these options:
ipv4
- -K Str kod KoD history filename
+ -K Fil kod KoD history filename
-p no syslog Logging with syslog
- prohibits these options:
filelog
- -l Str filelog Log to specified logfile
+ -l Fil filelog Log to specified logfile
- prohibits these options:
syslog
+ -S Num steplimit Adjustments less than steplimit msec will be slewed.
+ - prohibits these options:
+ adjtime
+ settod
-s no settod Set (step) the time with settimeofday()
- prohibits these options:
adjtime
+ steplimit
-j no adjtime Set (slew) the time with adjtime()
- prohibits these options:
settod
+ steplimit
+ -c Str concurrent Send concurrent queries to all IPs returned for host-name
+ - may appear multiple times
-b Str broadcast Use broadcasts to the address specified for synchronisation
-t Num timeout Specify the number of seconds to wait for broadcasts
-a Num authentication Enable authentication with the key auth-keynumber
- -k Str keyfile Specify a keyfile. SNTP will look in this file for the key specified with -a
+ -k Fil keyfile Specify a keyfile. SNTP will look in this file for the key specified with -a
opt version Output version information and exit
-? no help Display extended usage information and exit
-! no more-help Extended usage information passed thru pager
- reading file ./.ntprc
- examining environment variables named SNTP_*
-sntp implements the Simple Network Time Protocol, and is used to query
+sntp implements the Simple Network Time Protocol and is used to query
an NTP or SNTP server and either display the time or set the local
system's time (given suitable privilege).
<p>This option has some usage constraints. It:
<ul>
<li>must not appear in combination with any of the following options:
-settod.
+settod, steplimit.
</ul>
<div class="node">
<div class="node">
<p><hr>
<a name="sntp-broadcast"></a>
-Next: <a rel="next" accesskey="n" href="#sntp-debug_002dlevel">sntp debug-level</a>,
+Next: <a rel="next" accesskey="n" href="#sntp-concurrent">sntp concurrent</a>,
Previous: <a rel="previous" accesskey="p" href="#sntp-authentication">sntp authentication</a>,
Up: <a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
for NTP broadcasts. The default maximum wait time,
68 seconds, can be modified with -t.
+<div class="node">
+<p><hr>
+<a name="sntp-concurrent"></a>
+Next: <a rel="next" accesskey="n" href="#sntp-debug_002dlevel">sntp debug-level</a>,
+Previous: <a rel="previous" accesskey="p" href="#sntp-broadcast">sntp broadcast</a>,
+Up: <a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+
+</div>
+
+<h4 class="subsection">concurrent option (-c)</h4>
+
+<p><a name="index-sntp_002dconcurrent-7"></a>
+This is the “send concurrent queries to all ips returned for host-name” option.
+
+ <p>This option has some usage constraints. It:
+ <ul>
+<li>may appear an unlimited number of times.
+</ul>
+
+ <p>Requests from an NTP "client" to a "server" should never be sent
+more rapidly than one every 2 seconds. By default, any IPs returned
+as part of a DNS lookup are assumed to be for a single instance of
+ntpd, and therefore sntp will send queries to these IPs one after
+another, with a 2-second gap in between each query.
+
+ <p>The -c or –concurrent flag says that any IPs returned for the
+DNS lookup of the supplied host-name are on different machines,
+so we can send concurrent queries.
+
<div class="node">
<p><hr>
<a name="sntp-debug-level"></a>
<a name="sntp-debug_002dlevel"></a>
Next: <a rel="next" accesskey="n" href="#sntp-filelog">sntp filelog</a>,
-Previous: <a rel="previous" accesskey="p" href="#sntp-broadcast">sntp broadcast</a>,
+Previous: <a rel="previous" accesskey="p" href="#sntp-concurrent">sntp concurrent</a>,
Up: <a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
</div>
<h4 class="subsection">debug-level option (-d)</h4>
-<p><a name="index-sntp_002ddebug_002dlevel-7"></a>
+<p><a name="index-sntp_002ddebug_002dlevel-8"></a>
This is the “increase output debug message level” option.
<p>This option has some usage constraints. It:
<h4 class="subsection">filelog option (-l)</h4>
-<p><a name="index-sntp_002dfilelog-8"></a>
+<p><a name="index-sntp_002dfilelog-9"></a>
This is the “log to specified logfile” option.
<p>This option has some usage constraints. It:
<h4 class="subsection">ipv4 option (-4)</h4>
-<p><a name="index-sntp_002dipv4-9"></a>
+<p><a name="index-sntp_002dipv4-10"></a>
This is the “force ipv4 dns name resolution” option.
<p>This option has some usage constraints. It:
<h4 class="subsection">ipv6 option (-6)</h4>
-<p><a name="index-sntp_002dipv6-10"></a>
+<p><a name="index-sntp_002dipv6-11"></a>
This is the “force ipv6 dns name resolution” option.
<p>This option has some usage constraints. It:
<h4 class="subsection">keyfile option (-k)</h4>
-<p><a name="index-sntp_002dkeyfile-11"></a>
+<p><a name="index-sntp_002dkeyfile-12"></a>
This is the “specify a keyfile. sntp will look in this file for the key specified with -a” option.
This option specifies the keyfile. SNTP will search for the key specified with -a keyno in this
file. Key files follow the following format:
<h4 class="subsection">kod option (-K)</h4>
-<p><a name="index-sntp_002dkod-12"></a>
+<p><a name="index-sntp_002dkod-13"></a>
This is the “kod history filename” option.
-Modifies the filename to be used to persist the history of KoD
+Specifies the filename to be used for the persistent history of KoD
responses received from servers. The default is
/var/db/ntp-kod.
<h4 class="subsection">set-debug-level option (-D)</h4>
-<p><a name="index-sntp_002dset_002ddebug_002dlevel-13"></a>
+<p><a name="index-sntp_002dset_002ddebug_002dlevel-14"></a>
This is the “set the output debug message level” option.
<p>This option has some usage constraints. It:
<div class="node">
<p><hr>
<a name="sntp-settod"></a>
-Next: <a rel="next" accesskey="n" href="#sntp-syslog">sntp syslog</a>,
+Next: <a rel="next" accesskey="n" href="#sntp-steplimit">sntp steplimit</a>,
Previous: <a rel="previous" accesskey="p" href="#sntp-set_002ddebug_002dlevel">sntp set-debug-level</a>,
Up: <a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
<h4 class="subsection">settod option (-s)</h4>
-<p><a name="index-sntp_002dsettod-14"></a>
+<p><a name="index-sntp_002dsettod-15"></a>
This is the “set (step) the time with settimeofday()” option.
<p>This option has some usage constraints. It:
<ul>
<li>must not appear in combination with any of the following options:
-adjtime.
+adjtime, steplimit.
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="sntp-steplimit"></a>
+Next: <a rel="next" accesskey="n" href="#sntp-syslog">sntp syslog</a>,
+Previous: <a rel="previous" accesskey="p" href="#sntp-settod">sntp settod</a>,
+Up: <a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+
+</div>
+
+<h4 class="subsection">steplimit option (-S)</h4>
+
+<p><a name="index-sntp_002dsteplimit-16"></a>
+This is the “adjustments less than steplimit msec will be slewed.” option.
+
+ <p>This option has some usage constraints. It:
+ <ul>
+<li>must not appear in combination with any of the following options:
+adjtime, settod.
</ul>
+ <p>If the time adjustment is less than steplimit milliseconds, slew the amount using adjtime(). Otherwise, step the correction using settimeofday().
+
<div class="node">
<p><hr>
<a name="sntp-syslog"></a>
Next: <a rel="next" accesskey="n" href="#sntp-timeout">sntp timeout</a>,
-Previous: <a rel="previous" accesskey="p" href="#sntp-settod">sntp settod</a>,
+Previous: <a rel="previous" accesskey="p" href="#sntp-steplimit">sntp steplimit</a>,
Up: <a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
</div>
<h4 class="subsection">syslog option (-p)</h4>
-<p><a name="index-sntp_002dsyslog-15"></a>
+<p><a name="index-sntp_002dsyslog-17"></a>
This is the “logging with syslog” option.
<p>This option has some usage constraints. It:
<h4 class="subsection">timeout option (-t)</h4>
-<p><a name="index-sntp_002dtimeout-16"></a>
+<p><a name="index-sntp_002dtimeout-18"></a>
This is the “specify the number of seconds to wait for broadcasts” option.
When waiting for a broadcast packet SNTP will wait the number
of seconds specified before giving up. Default 68 seconds.