summaryrefslogtreecommitdiff
path: root/ntpdc
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2020-03-04 13:59:29 +0000
committerCy Schubert <cy@FreeBSD.org>2020-03-04 13:59:29 +0000
commit5171bc9b11192d9ad273db7854787eaa65eb9997 (patch)
treeb872a53605ef14ae76de1104afb4be189d1a958a /ntpdc
parent360c01464aee3bc4c520898a675f35967db09ac2 (diff)
Notes
Diffstat (limited to 'ntpdc')
-rw-r--r--ntpdc/invoke-ntpdc.texi4
-rw-r--r--ntpdc/layout.std14
-rw-r--r--ntpdc/ntpdc-opts.c20
-rw-r--r--ntpdc/ntpdc-opts.h8
-rw-r--r--ntpdc/ntpdc.1ntpdcman6
-rw-r--r--ntpdc/ntpdc.1ntpdcmdoc6
-rw-r--r--ntpdc/ntpdc.c65
-rw-r--r--ntpdc/ntpdc.html4
-rw-r--r--ntpdc/ntpdc.man.in6
-rw-r--r--ntpdc/ntpdc.mdoc.in6
-rw-r--r--ntpdc/ntpdc_ops.c141
11 files changed, 136 insertions, 144 deletions
diff --git a/ntpdc/invoke-ntpdc.texi b/ntpdc/invoke-ntpdc.texi
index 737083477841c..e0eadb7aac0a0 100644
--- a/ntpdc/invoke-ntpdc.texi
+++ b/ntpdc/invoke-ntpdc.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntpdc.texi)
#
-# It has been AutoGen-ed February 20, 2019 at 09:56:51 AM by AutoGen 5.18.5
+# It has been AutoGen-ed March 3, 2020 at 05:41:11 PM by AutoGen 5.18.5
# 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.8p13
+ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p14
Usage: ntpdc [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...]
Flg Arg Option-Name Description
-4 no ipv4 Force IPv4 DNS name resolution
diff --git a/ntpdc/layout.std b/ntpdc/layout.std
index f07f79f36f16b..68c8ddd556b89 100644
--- a/ntpdc/layout.std
+++ b/ntpdc/layout.std
@@ -269,15 +269,17 @@ offsetof(unused1) = 20
offsetof(addr6) = 24
offsetof(mask6) = 40
-sizeof(struct conf_restrict) = 52
+sizeof(struct conf_restrict) = 60
offsetof(addr) = 0
offsetof(mask) = 4
offsetof(ippeerlimit) = 8
-offsetof(flags) = 10
-offsetof(mflags) = 12
-offsetof(v6_flag) = 16
-offsetof(addr6) = 20
-offsetof(mask6) = 36
+offsetof(srvfuzrft) = 12
+offsetof(flags) = 16
+offsetof(mflags) = 18
+offsetof(unused1) = 20
+offsetof(v6_flag) = 24
+offsetof(addr6) = 28
+offsetof(mask6) = 44
sizeof(struct info_monitor_1) = 72
offsetof(avg_int) = 0
diff --git a/ntpdc/ntpdc-opts.c b/ntpdc/ntpdc-opts.c
index 2125040e0b0fa..88d04ea6028f0 100644
--- a/ntpdc/ntpdc-opts.c
+++ b/ntpdc/ntpdc-opts.c
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpdc-opts.c)
*
- * It has been AutoGen-ed February 20, 2019 at 09:56:48 AM by AutoGen 5.18.5
+ * It has been AutoGen-ed March 3, 2020 at 05:41:07 PM by AutoGen 5.18.5
* From the definitions ntpdc-opts.def
* and the template file options
*
@@ -18,7 +18,7 @@
* The ntpdc program is copyrighted and licensed
* under the following terms:
*
- * Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.
+ * Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.
* This is free software. It is licensed for use, modification and
* redistribution under the terms of the NTP License, copies of which
* can be seen at:
@@ -69,8 +69,8 @@ extern FILE * option_usage_fp;
* static const strings for ntpdc options
*/
static char const ntpdc_opt_strs[1914] =
-/* 0 */ "ntpdc 4.2.8p13\n"
- "Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.\n"
+/* 0 */ "ntpdc 4.2.8p14\n"
+ "Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.\n"
"This is free software. It is licensed for use, modification and\n"
"redistribution under the terms of the NTP License, copies of which\n"
"can be seen at:\n"
@@ -128,14 +128,14 @@ static char const ntpdc_opt_strs[1914] =
/* 1695 */ "no-load-opts\0"
/* 1708 */ "no\0"
/* 1711 */ "NTPDC\0"
-/* 1717 */ "ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p13\n"
+/* 1717 */ "ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p14\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n\0"
/* 1848 */ "$HOME\0"
/* 1854 */ ".\0"
/* 1856 */ ".ntprc\0"
/* 1863 */ "http://bugs.ntp.org, bugs@ntp.org\0"
/* 1897 */ "\n\0"
-/* 1899 */ "ntpdc 4.2.8p13";
+/* 1899 */ "ntpdc 4.2.8p14";
/**
* ipv4 option description with
@@ -796,8 +796,8 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via ntpdcOptions.pzCopyright */
- puts(_("ntpdc 4.2.8p13\n\
-Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.\n\
+ puts(_("ntpdc 4.2.8p14\n\
+Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.\n\
This is free software. It is licensed for use, modification and\n\
redistribution under the terms of the NTP License, copies of which\n\
can be seen at:\n"));
@@ -862,14 +862,14 @@ implied warranty.\n"));
puts(_("load options from a config file"));
/* referenced via ntpdcOptions.pzUsageTitle */
- puts(_("ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p13\n\
+ puts(_("ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p14\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n"));
/* referenced via ntpdcOptions.pzExplain */
puts(_("\n"));
/* referenced via ntpdcOptions.pzFullVersion */
- puts(_("ntpdc 4.2.8p13"));
+ puts(_("ntpdc 4.2.8p14"));
/* referenced via ntpdcOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
diff --git a/ntpdc/ntpdc-opts.h b/ntpdc/ntpdc-opts.h
index 5af0193c659a4..36e736e8ec5b2 100644
--- a/ntpdc/ntpdc-opts.h
+++ b/ntpdc/ntpdc-opts.h
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpdc-opts.h)
*
- * It has been AutoGen-ed February 20, 2019 at 09:56:48 AM by AutoGen 5.18.5
+ * It has been AutoGen-ed March 3, 2020 at 05:41:07 PM by AutoGen 5.18.5
* From the definitions ntpdc-opts.def
* and the template file options
*
@@ -18,7 +18,7 @@
* The ntpdc program is copyrighted and licensed
* under the following terms:
*
- * Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.
+ * Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation, all rights reserved.
* This is free software. It is licensed for use, modification and
* redistribution under the terms of the NTP License, copies of which
* can be seen at:
@@ -83,9 +83,9 @@ typedef enum {
/** count of all options for ntpdc */
#define OPTION_CT 15
/** ntpdc version */
-#define NTPDC_VERSION "4.2.8p13"
+#define NTPDC_VERSION "4.2.8p14"
/** Full ntpdc version text */
-#define NTPDC_FULL_VERSION "ntpdc 4.2.8p13"
+#define NTPDC_FULL_VERSION "ntpdc 4.2.8p14"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
diff --git a/ntpdc/ntpdc.1ntpdcman b/ntpdc/ntpdc.1ntpdcman
index e74529e1b23d8..c7130610eadd3 100644
--- a/ntpdc/ntpdc.1ntpdcman
+++ b/ntpdc/ntpdc.1ntpdcman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpdc 1ntpdcman "20 Feb 2019" "4.2.8p13" "User Commands"
+.TH ntpdc 1ntpdcman "03 Mar 2020" "4.2.8p14" "User Commands"
.\"
.\" EDIT THIS FILE WITH CAUTION (in-mem file)
.\"
-.\" It has been AutoGen-ed February 20, 2019 at 09:56:53 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed March 3, 2020 at 05:41:12 PM by AutoGen 5.18.5
.\" From the definitions ntpdc-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -848,7 +848,7 @@ RFC1305
.SH AUTHORS
The formatting directives in this document came from FreeBSD.
.SH "COPYRIGHT"
-Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation all rights reserved.
This program is released under the terms of the NTP license, <http://ntp.org/license>.
.SH BUGS
The
diff --git a/ntpdc/ntpdc.1ntpdcmdoc b/ntpdc/ntpdc.1ntpdcmdoc
index fc6f55fbbda01..6ec4135af24e9 100644
--- a/ntpdc/ntpdc.1ntpdcmdoc
+++ b/ntpdc/ntpdc.1ntpdcmdoc
@@ -1,9 +1,9 @@
-.Dd February 20 2019
+.Dd March 3 2020
.Dt NTPDC 1ntpdcmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.mdoc)
.\"
-.\" It has been AutoGen-ed February 20, 2019 at 09:56:50 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed March 3, 2020 at 05:41:10 PM by AutoGen 5.18.5
.\" From the definitions ntpdc-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -787,7 +787,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.Sh AUTHORS
The formatting directives in this document came from FreeBSD.
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2017 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2020 The University of Delaware and Network Time Foundation all rights reserved.
This program is released under the terms of the NTP license, <http://ntp.org/license>.
.Sh BUGS
The
diff --git a/ntpdc/ntpdc.c b/ntpdc/ntpdc.c
index c54596e32f947..1274e841fb66a 100644
--- a/ntpdc/ntpdc.c
+++ b/ntpdc/ntpdc.c
@@ -176,8 +176,8 @@ static l_fp delay_time; /* delay time */
static char currenthost[LENHOSTNAME]; /* current host name */
int showhostnames = 1; /* show host names by default */
-static int ai_fam_templ; /* address family */
-static int ai_fam_default; /* default address family */
+static int ai_fam_templ = AF_UNSPEC; /* address family */
+static int ai_fam_default = AF_UNSPEC; /* default address family */
static SOCKET sockfd; /* fd socket is opened on */
static int havehost = 0; /* set to 1 when host open */
int s_port = 0;
@@ -312,11 +312,11 @@ ntpdcmain(
}
if (HAVE_OPT(IPV4))
- ai_fam_templ = AF_INET;
+ ai_fam_default = AF_INET;
else if (HAVE_OPT(IPV6))
- ai_fam_templ = AF_INET6;
- else
- ai_fam_templ = ai_fam_default;
+ ai_fam_default = AF_INET6;
+
+ ai_fam_templ = ai_fam_default;
if (HAVE_OPT(COMMAND)) {
int cmdct = STACKCT_OPT( COMMAND );
@@ -1382,18 +1382,14 @@ getarg(
arg_v *argp
)
{
- int isneg;
- char *cp, *np;
- static const char *digits = "0123456789";
-
ZERO(*argp);
argp->string = str;
argp->type = code & ~OPT;
switch (argp->type) {
- case NTP_STR:
+ case NTP_STR:
break;
- case NTP_ADD:
+ case NTP_ADD:
if (!strcmp("-6", str)) {
ai_fam_templ = AF_INET6;
return -1;
@@ -1401,41 +1397,25 @@ getarg(
ai_fam_templ = AF_INET;
return -1;
}
- if (!getnetnum(str, &(argp->netnum), (char *)0, 0)) {
+ if (!getnetnum(str, &(argp->netnum), (char *)0, ai_fam_templ)) {
return 0;
}
break;
- case NTP_INT:
- case NTP_UINT:
- isneg = 0;
- np = str;
- if (*np == '-') {
- np++;
- isneg = 1;
+ case NTP_UINT:
+ if (!atouint(str, &argp->uval)) {
+ fprintf(stderr, "***Illegal unsigned value %s\n",
+ str);
+ return 0;
}
-
- argp->uval = 0;
- do {
- cp = strchr(digits, *np);
- if (cp == NULL) {
- (void) fprintf(stderr,
- "***Illegal integer value %s\n", str);
- return 0;
- }
- argp->uval *= 10;
- argp->uval += (u_long)(cp - digits);
- } while (*(++np) != '\0');
-
- if (isneg) {
- if ((code & ~OPT) == NTP_UINT) {
- (void) fprintf(stderr,
- "***Value %s should be unsigned\n", str);
- return 0;
- }
- argp->ival = -argp->ival;
+ break;
+ case NTP_INT:
+ if (!atoint(str, &argp->ival)) {
+ fprintf(stderr, "***Illegal integer value %s\n",
+ str);
+ return 0;
}
break;
- case IP_VERSION:
+ case IP_VERSION:
if (!strcmp("-6", str))
argp->ival = 6 ;
else if (!strcmp("-4", str))
@@ -1467,6 +1447,7 @@ getnetnum(
struct addrinfo hints, *ai = NULL;
ZERO(hints);
+ hints.ai_family = af;
hints.ai_flags = AI_CANONNAME;
#ifdef AI_ADDRCONFIG
hints.ai_flags |= AI_ADDRCONFIG;
@@ -1668,7 +1649,7 @@ my_delay(
} else {
if (pcmd->argval[0].ival < 0) {
isneg = 1;
- val = (u_long)(-pcmd->argval[0].ival);
+ val = ~(u_long)(pcmd->argval[0].ival) + 1UL;
} else {
isneg = 0;
val = (u_long)pcmd->argval[0].ival;
diff --git a/ntpdc/ntpdc.html b/ntpdc/ntpdc.html
index 0d550eb7f4702..d5e7f069fd6b1 100644
--- a/ntpdc/ntpdc.html
+++ b/ntpdc/ntpdc.html
@@ -64,7 +64,7 @@ display the time offset of the system clock relative to the server
clock. Run as root, it can correct the system clock to this offset as
well. It can be run as an interactive command or from a cron job.
</p>
-<p>This document applies to version 4.2.8p13 of <code>ntpdc</code>.
+<p>This document applies to version 4.2.8p14 of <code>ntpdc</code>.
</p>
<p>The program implements the SNTP protocol as defined by RFC 5905, the NTPv4
IETF specification.
@@ -214,7 +214,7 @@ used to select the program, defaulting to <samp>more</samp>. Both will exit
with a status code of 0.
</p>
<div class="example">
-<pre class="example">ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p13
+<pre class="example">ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p14
Usage: ntpdc [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [ host ...]
Flg Arg Option-Name Description
-4 no ipv4 Force IPv4 DNS name resolution
diff --git a/ntpdc/ntpdc.man.in b/ntpdc/ntpdc.man.in
index 801439049d65a..e03484df741c1 100644
--- a/ntpdc/ntpdc.man.in
+++ b/ntpdc/ntpdc.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpdc @NTPDC_MS@ "20 Feb 2019" "4.2.8p13" "User Commands"
+.TH ntpdc @NTPDC_MS@ "03 Mar 2020" "4.2.8p14" "User Commands"
.\"
.\" EDIT THIS FILE WITH CAUTION (in-mem file)
.\"
-.\" It has been AutoGen-ed February 20, 2019 at 09:56:53 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed March 3, 2020 at 05:41:12 PM by AutoGen 5.18.5
.\" From the definitions ntpdc-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -848,7 +848,7 @@ RFC1305
.SH AUTHORS
The formatting directives in this document came from FreeBSD.
.SH "COPYRIGHT"
-Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation all rights reserved.
This program is released under the terms of the NTP license, <http://ntp.org/license>.
.SH BUGS
The
diff --git a/ntpdc/ntpdc.mdoc.in b/ntpdc/ntpdc.mdoc.in
index 73f60c1f3ae04..787b22a3e1ec7 100644
--- a/ntpdc/ntpdc.mdoc.in
+++ b/ntpdc/ntpdc.mdoc.in
@@ -1,9 +1,9 @@
-.Dd February 20 2019
+.Dd March 3 2020
.Dt NTPDC @NTPDC_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.mdoc)
.\"
-.\" It has been AutoGen-ed February 20, 2019 at 09:56:50 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed March 3, 2020 at 05:41:10 PM by AutoGen 5.18.5
.\" From the definitions ntpdc-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -787,7 +787,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.Sh AUTHORS
The formatting directives in this document came from FreeBSD.
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2017 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2020 The University of Delaware and Network Time Foundation all rights reserved.
This program is released under the terms of the NTP license, <http://ntp.org/license>.
.Sh BUGS
The
diff --git a/ntpdc/ntpdc_ops.c b/ntpdc/ntpdc_ops.c
index 3b50916e7f8a8..4f66633d77831 100644
--- a/ntpdc/ntpdc_ops.c
+++ b/ntpdc/ntpdc_ops.c
@@ -40,7 +40,7 @@ static int check1item (size_t, FILE *);
*/
static void peerlist (struct parse *, FILE *);
static void peers (struct parse *, FILE *);
-static void doconfig (struct parse *pcmd, FILE *fp, int mode, int refc);
+static void doconfig (struct parse *pcmd, FILE *fp, int mode, int refc);
static void dmpeers (struct parse *, FILE *);
static void dopeers (struct parse *, FILE *, int);
static void printpeer (struct info_peer *, FILE *);
@@ -260,7 +260,7 @@ do { \
/*
- * SET_ADDRS - setup source and destination addresses for
+ * SET_ADDRS - setup source and destination addresses for
* v4/v6 as needed
*/
#define SET_ADDRS(a1, a2, info, a1prefix, a2prefix) \
@@ -359,9 +359,9 @@ peerlist(
again:
res = doquery(impl_ver, REQ_PEER_LIST, 0, 0, 0, (char *)NULL, &items,
- &itemsize, (void *)&plist, 0,
+ &itemsize, (void *)&plist, 0,
sizeof(struct info_peer_list));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -382,9 +382,16 @@ again:
if ((pcmd->nargs == 0) ||
((pcmd->argval->ival == 6) && (plist->v6_flag != 0)) ||
((pcmd->argval->ival == 4) && (plist->v6_flag == 0)))
- (void) fprintf(fp, "%-9s %s\n",
- modetoa(plist->hmode),
- nntohost(&paddr));
+ {
+ const char *strhost = nntohost(&paddr);
+ const char *straddr = stoa(&paddr);
+ (void) fprintf(fp, "%-12s %s",
+ modetoa(plist->hmode), strhost);
+ if (strcmp(strhost,straddr))
+ (void) fprintf(fp, " (%s)\n", straddr);
+ else
+ (void) fprintf(fp, "\n");
+ }
plist++;
items--;
}
@@ -439,9 +446,9 @@ dopeers(
again:
res = doquery(impl_ver, REQ_PEER_LIST_SUM, 0, 0, 0, (char *)NULL,
- &items, &itemsize, (void *)&plist, 0,
+ &items, &itemsize, (void *)&plist, 0,
sizeof(struct info_peer_summary));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -588,22 +595,24 @@ printpeer(
register int i;
l_fp tempts;
sockaddr_u srcadr, dstadr;
-
+
SET_ADDRS(dstadr, srcadr, pp, dstadr, srcadr);
-
+
(void) fprintf(fp, "remote %s, local %s\n",
stoa(&srcadr), stoa(&dstadr));
(void) fprintf(fp, "hmode %s, pmode %s, stratum %d, precision %d\n",
modetoa(pp->hmode), modetoa(pp->pmode),
pp->stratum, pp->precision);
-
+
(void) fprintf(fp,
"leap %c%c, refid [%s], rootdistance %s, rootdispersion %s\n",
pp->leap & 0x2 ? '1' : '0',
pp->leap & 0x1 ? '1' : '0',
- refid_string(pp->refid, pp->stratum), fptoa(NTOHS_FP(pp->rootdelay), 5),
+ refid_string(pp->refid,
+ (pp->flags & INFO_FLAG_REFCLOCK ? 0 : pp->stratum)),
+ fptoa(NTOHS_FP(pp->rootdelay), 5),
ufptoa(NTOHS_FP(pp->rootdispersion), 5));
-
+
(void) fprintf(fp,
"ppoll %d, hpoll %d, keyid %lu, version %d, association %u\n",
pp->ppoll, pp->hpoll, (u_long)pp->keyid, pp->version, ntohs(pp->associd));
@@ -614,9 +623,9 @@ printpeer(
(void) fprintf(fp, "boffset %s, ttl/mode %d\n",
fptoa(NTOHS_FP(pp->estbdelay), 5), pp->ttl);
-
+
(void) fprintf(fp, "timer %lds, flags", (long)ntohl(pp->timer));
- print_pflag(fp, pp->flags);
+ print_pflag(fp, pp->flags);
NTOHL_FP(&pp->reftime, &tempts);
(void) fprintf(fp, "reference time: %s\n",
@@ -630,7 +639,7 @@ printpeer(
NTOHL_FP(&pp->xmt, &tempts);
(void) fprintf(fp, "transmit timestamp: %s\n",
prettydate(&tempts));
-
+
(void) fprintf(fp, "filter delay: ");
for (i = 0; i < NTP_SHIFT; i++) {
(void) fprintf(fp, " %-8.8s",
@@ -656,7 +665,7 @@ printpeer(
(void) fprintf(fp, "\n ");
}
(void) fprintf(fp, "\n");
-
+
NTOHL_FP(&pp->offset, &tempts);
(void) fprintf(fp,
@@ -715,7 +724,7 @@ again:
res = doquery(impl_ver, REQ_PEER_INFO, 0, qitems,
sendsize, (char *)plist, &items,
&itemsize, (void *)&pp, 0, sizeof(struct info_peer));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -790,9 +799,9 @@ again:
res = doquery(impl_ver, REQ_PEER_STATS, 0, qitems,
sendsize, (char *)plist, &items,
- &itemsize, (void *)&pp, 0,
+ &itemsize, (void *)&pp, 0,
sizeof(struct info_peer_stats));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -890,9 +899,9 @@ loopinfo(
again:
res = doquery(impl_ver, REQ_LOOP_INFO, 0, 0, 0, (char *)NULL,
- &items, &itemsize, (void *)&il, 0,
+ &items, &itemsize, (void *)&il, 0,
sizeof(struct info_loop));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -955,7 +964,7 @@ again:
res = doquery(impl_ver, REQ_SYS_INFO, 0, 0, 0, (char *)NULL,
&items, &itemsize, (void *)&is, 0,
sizeof(struct info_sys));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -1041,9 +1050,9 @@ sysstats(
again:
res = doquery(impl_ver, REQ_SYS_STATS, 0, 0, 0, (char *)NULL,
- &items, &itemsize, (void *)&ss, 0,
+ &items, &itemsize, (void *)&ss, 0,
sizeof(struct info_sys_stats));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -1083,7 +1092,7 @@ again:
(u_long)ntohl(ss->badauth));
if (itemsize != sizeof(struct info_sys_stats))
return;
-
+
fprintf(fp, "rate exceeded: %lu\n",
(u_long)ntohl(ss->limitrejected));
}
@@ -1108,7 +1117,7 @@ iostats(
again:
res = doquery(impl_ver, REQ_IO_STATS, 0, 0, 0, NULL, &items,
&itemsize, (void *)&io, 0, sizeof(*io));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -1169,7 +1178,7 @@ memstats(
again:
res = doquery(impl_ver, REQ_MEM_STATS, 0, 0, 0, NULL, &items,
&itemsize, (void *)&mem, 0, sizeof(*mem));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -1226,7 +1235,7 @@ timerstats(
again:
res = doquery(impl_ver, REQ_TIMER_STATS, 0, 0, 0, NULL, &items,
&itemsize, (void *)&tim, 0, sizeof(*tim));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -1412,13 +1421,13 @@ again:
version);
res = TRUE;
}
- if (minpoll < NTP_MINPOLL || minpoll > NTP_MAXPOLL ||
- maxpoll < NTP_MINPOLL || maxpoll > NTP_MAXPOLL ||
+ if (minpoll < NTP_MINPOLL || minpoll > NTP_MAXPOLL ||
+ maxpoll < NTP_MINPOLL || maxpoll > NTP_MAXPOLL ||
minpoll > maxpoll) {
fprintf(fp, "***min/max-poll must be within %d..%d\n",
NTP_MINPOLL, NTP_MAXPOLL);
res = TRUE;
- }
+ }
if (res)
return;
@@ -1449,7 +1458,7 @@ again:
res = doquery(impl_ver, REQ_CONFIG, 1, 1,
sendsize, (char *)&cpeer, &items,
&itemsize, &dummy, 0, sizeof(struct conf_peer));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -1516,7 +1525,7 @@ again:
res = doquery(impl_ver, REQ_UNCONFIG, 1, qitems,
sendsize, (char *)plist, &items,
&itemsize, &dummy, 0, sizeof(struct conf_unpeer));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -1603,7 +1612,7 @@ again:
res = doquery(impl_ver, req, 1, 1,
sizeof(struct conf_sys_flags), (char *)&sys, &items,
&itemsize, &dummy, 0, sizeof(struct conf_sys_flags));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -1690,9 +1699,9 @@ reslist(
again:
res = doquery(impl_ver, REQ_GET_RESTRICT, 0, 0, 0, (char *)NULL,
- &items, &itemsize, (void *)&rl, 0,
+ &items, &itemsize, (void *)&rl, 0,
sizeof(struct info_restrict));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -1924,7 +1933,7 @@ again:
res = doquery(impl_ver, req_code, 1, 1, sendsize, (char *)&cres,
&items, &itemsize, &dummy, 0, sizeof(cres));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -1965,7 +1974,7 @@ again:
(version == 1 || version == -1) ? REQ_MON_GETLIST_1 :
REQ_MON_GETLIST, 0, 0, 0, NULL,
&items, &itemsize, &struct_star,
- (version < 0) ? (1 << INFO_ERR_REQ) : 0,
+ (version < 0) ? (1 << INFO_ERR_REQ) : 0,
sizeof(struct info_monitor_1));
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
@@ -1973,11 +1982,11 @@ again:
goto again;
}
- if (res == INFO_ERR_REQ && version < 0)
+ if (res == INFO_ERR_REQ && version < 0)
res = doquery(impl_ver, REQ_MON_GETLIST, 0, 0, 0, NULL,
&items, &itemsize, &struct_star, 0,
sizeof(struct info_monitor));
-
+
if (res != 0)
return;
@@ -1997,9 +2006,9 @@ again:
if ((pcmd->nargs == 0) ||
((pcmd->argval->ival == 6) && (m1->v6_flag != 0)) ||
((pcmd->argval->ival == 4) && (m1->v6_flag == 0)))
- fprintf(fp,
+ fprintf(fp,
"%-22.22s %5d %-15s %8lu %1u %1u %6lx %6lu %7lu\n",
- nntohost(&addr),
+ nntohost(&addr),
ntohs(m1->port),
stoa(&dstadr),
(u_long)ntohl(m1->count),
@@ -2124,7 +2133,7 @@ again:
res = doquery(impl_ver, REQ_RESET_STATS, 1, 1,
sizeof(struct reset_flags), (char *)&rflags, &items,
&itemsize, &dummy, 0, sizeof(struct reset_flags));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -2184,7 +2193,7 @@ again:
res = doquery(impl_ver, REQ_RESET_PEER, 1, qitems,
sendsize, (char *)plist, &items,
&itemsize, &dummy, 0, sizeof(struct conf_unpeer));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -2213,7 +2222,7 @@ readkeys(
again:
res = doquery(impl_ver, REQ_REREAD_KEYS, 1, 0, 0, (char *)0,
&items, &itemsize, &dummy, 0, sizeof(dummy));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -2276,9 +2285,9 @@ do_trustkey(
again:
res = doquery(impl_ver, req, 1, ritems, sizeof(u_long),
- (char *)keyids, &items, &itemsize, &dummy, 0,
+ (char *)keyids, &items, &itemsize, &dummy, 0,
sizeof(dummy));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -2309,7 +2318,7 @@ authinfo(
again:
res = doquery(impl_ver, REQ_AUTHINFO, 0, 0, 0, NULL, &items,
&itemsize, (void *)&ia, 0, sizeof(*ia));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -2366,7 +2375,7 @@ traps(
again:
res = doquery(impl_ver, REQ_TRAPS, 0, 0, 0, NULL, &items,
&itemsize, (void *)&it, 0, sizeof(*it));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -2399,7 +2408,7 @@ again:
fprintf(fp, "low priority\n");
else
fprintf(fp, "normal priority\n");
-
+
fprintf(fp, "set for %ld secs, last set %ld secs ago\n",
(long)ntohl(it->origtime),
(long)ntohl(it->settime));
@@ -2492,9 +2501,9 @@ again:
}
res = doquery(impl_ver, req, 1, 1, sendsize,
- (char *)&ctrap, &items, &itemsize, &dummy, 0,
+ (char *)&ctrap, &items, &itemsize, &dummy, 0,
sizeof(struct conf_trap));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -2555,9 +2564,9 @@ do_changekey(
again:
res = doquery(impl_ver, req, 1, 1, sizeof(u_int32),
- (char *)&key, &items, &itemsize, &dummy, 0,
+ (char *)&key, &items, &itemsize, &dummy, 0,
sizeof(dummy));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -2588,7 +2597,7 @@ ctlstats(
again:
res = doquery(impl_ver, REQ_GET_CTLSTATS, 0, 0, 0, NULL, &items,
&itemsize, (void *)&ic, 0, sizeof(*ic));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -2664,7 +2673,7 @@ again:
res = doquery(impl_ver, REQ_GET_CLOCKINFO, 0, qitems,
sizeof(u_int32), (char *)clist, &items,
&itemsize, (void *)&cl, 0, sizeof(struct info_clock));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -2847,7 +2856,7 @@ again:
res = doquery(impl_ver, REQ_GET_CLKBUGINFO, 0, qitems,
sizeof(u_int32), (char *)clist, &items,
&itemsize, (void *)&cl, 0, sizeof(struct info_clkbug));
-
+
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
impl_ver = IMPL_XNTPD_OLD;
goto again;
@@ -2933,7 +2942,7 @@ kerninfo(
again:
res = doquery(impl_ver, REQ_GET_KERNEL, 0, 0, 0, (char *)NULL,
- &items, &itemsize, (void *)&ik, 0,
+ &items, &itemsize, (void *)&ik, 0,
sizeof(struct info_kernel));
if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
@@ -3078,9 +3087,9 @@ iflist(
fprintf(fp, IF_LIST_FMT_STR, IF_LIST_LABELS);
fprintf(fp, IF_LIST_LINE);
-
+
while (items > 0) {
- SET_ADDR(saddr, ntohl(ifs->v6_flag),
+ SET_ADDR(saddr, ntohl(ifs->v6_flag),
ifs->unaddr.addr.s_addr, ifs->unaddr.addr6);
fprintf(fp, IF_LIST_FMT,
ntohl(ifs->ifnum),
@@ -3098,12 +3107,12 @@ iflist(
(u_long)ntohl(ifs->peercnt),
(u_long)ntohl(ifs->uptime));
- SET_ADDR(saddr, ntohl(ifs->v6_flag),
+ SET_ADDR(saddr, ntohl(ifs->v6_flag),
ifs->unmask.addr.s_addr, ifs->unmask.addr6);
fprintf(fp, IF_LIST_AFMT_STR, stoa(&saddr), 'M');
if (!ntohl(ifs->v6_flag) && ntohl(ifs->flags) & (INT_BCASTOPEN)) {
- SET_ADDR(saddr, ntohl(ifs->v6_flag),
+ SET_ADDR(saddr, ntohl(ifs->v6_flag),
ifs->unbcast.addr.s_addr, ifs->unbcast.addr6);
fprintf(fp, IF_LIST_AFMT_STR, stoa(&saddr), 'B');
@@ -3127,7 +3136,7 @@ get_if_stats(
int res;
res = doquery(impl_ver, REQ_IF_STATS, 1, 0, 0, (char *)NULL, &items,
- &itemsize, (void *)&ifs, 0,
+ &itemsize, (void *)&ifs, 0,
sizeof(struct info_if_stats));
iflist(fp, ifs, items, itemsize, res);
}
@@ -3145,7 +3154,7 @@ do_if_reload(
int res;
res = doquery(impl_ver, REQ_IF_RELOAD, 1, 0, 0, (char *)NULL, &items,
- &itemsize, (void *)&ifs, 0,
+ &itemsize, (void *)&ifs, 0,
sizeof(struct info_if_stats));
iflist(fp, ifs, items, itemsize, res);
}