diff options
author | glebius <glebius@FreeBSD.org> | 2016-01-11 01:09:50 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2016-01-11 01:09:50 +0000 |
commit | c41fbaf9bc76f0b7650e448fbd88d0a9815f47fd (patch) | |
tree | 3b45c8e63a37b132f0fe10c570b8302052c547de /contrib/ntp/ntpdc | |
parent | 3066f138bc3bf99f5cf6ec9412903d206c329cc7 (diff) | |
download | FreeBSD-src-c41fbaf9bc76f0b7650e448fbd88d0a9815f47fd.zip FreeBSD-src-c41fbaf9bc76f0b7650e448fbd88d0a9815f47fd.tar.gz |
Merge r293423, r293469:
ntp 4.2.8p5
Relnotes: yes
Diffstat (limited to 'contrib/ntp/ntpdc')
-rw-r--r-- | contrib/ntp/ntpdc/invoke-ntpdc.texi | 4 | ||||
-rw-r--r-- | contrib/ntp/ntpdc/ntpdc-opts.c | 14 | ||||
-rw-r--r-- | contrib/ntp/ntpdc/ntpdc-opts.h | 6 | ||||
-rw-r--r-- | contrib/ntp/ntpdc/ntpdc.1ntpdcman | 6 | ||||
-rw-r--r-- | contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc | 4 | ||||
-rw-r--r-- | contrib/ntp/ntpdc/ntpdc.c | 70 | ||||
-rw-r--r-- | contrib/ntp/ntpdc/ntpdc.h | 2 | ||||
-rw-r--r-- | contrib/ntp/ntpdc/ntpdc.html | 4 | ||||
-rw-r--r-- | contrib/ntp/ntpdc/ntpdc.man.in | 6 | ||||
-rw-r--r-- | contrib/ntp/ntpdc/ntpdc.mdoc.in | 4 | ||||
-rw-r--r-- | contrib/ntp/ntpdc/ntpdc_ops.c | 218 |
11 files changed, 170 insertions, 168 deletions
diff --git a/contrib/ntp/ntpdc/invoke-ntpdc.texi b/contrib/ntp/ntpdc/invoke-ntpdc.texi index 0146069..f8283de 100644 --- a/contrib/ntp/ntpdc/invoke-ntpdc.texi +++ b/contrib/ntp/ntpdc/invoke-ntpdc.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntpdc.texi) # -# It has been AutoGen-ed October 21, 2015 at 12:38:54 PM by AutoGen 5.18.5 +# It has been AutoGen-ed January 7, 2016 at 11:31:26 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.8p4 +ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p5 Usage: ntpdc [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...] Flg Arg Option-Name Description -4 no ipv4 Force IPv4 DNS name resolution diff --git a/contrib/ntp/ntpdc/ntpdc-opts.c b/contrib/ntp/ntpdc/ntpdc-opts.c index 6b4617a..da89ee2 100644 --- a/contrib/ntp/ntpdc/ntpdc-opts.c +++ b/contrib/ntp/ntpdc/ntpdc-opts.c @@ -1,7 +1,7 @@ /* * EDIT THIS FILE WITH CAUTION (ntpdc-opts.c) * - * It has been AutoGen-ed October 21, 2015 at 12:38:40 PM by AutoGen 5.18.5 + * It has been AutoGen-ed January 7, 2016 at 11:31:12 PM by AutoGen 5.18.5 * From the definitions ntpdc-opts.def * and the template file options * @@ -69,7 +69,7 @@ extern FILE * option_usage_fp; * static const strings for ntpdc options */ static char const ntpdc_opt_strs[1911] = -/* 0 */ "ntpdc 4.2.8p4\n" +/* 0 */ "ntpdc 4.2.8p5\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" @@ -128,14 +128,14 @@ static char const ntpdc_opt_strs[1911] = /* 1694 */ "no-load-opts\0" /* 1707 */ "no\0" /* 1710 */ "NTPDC\0" -/* 1716 */ "ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p4\n" +/* 1716 */ "ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p5\n" "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n\0" /* 1846 */ "$HOME\0" /* 1852 */ ".\0" /* 1854 */ ".ntprc\0" /* 1861 */ "http://bugs.ntp.org, bugs@ntp.org\0" /* 1895 */ "\n\0" -/* 1897 */ "ntpdc 4.2.8p4"; +/* 1897 */ "ntpdc 4.2.8p5"; /** * ipv4 option description with @@ -796,7 +796,7 @@ static void bogus_function(void) { translate option names. */ /* referenced via ntpdcOptions.pzCopyright */ - puts(_("ntpdc 4.2.8p4\n\ + puts(_("ntpdc 4.2.8p5\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\ @@ -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.8p4\n\ + puts(_("ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p5\n\ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n")); /* referenced via ntpdcOptions.pzExplain */ puts(_("\n")); /* referenced via ntpdcOptions.pzFullVersion */ - puts(_("ntpdc 4.2.8p4")); + puts(_("ntpdc 4.2.8p5")); /* referenced via ntpdcOptions.pzFullUsage */ puts(_("<<<NOT-FOUND>>>")); diff --git a/contrib/ntp/ntpdc/ntpdc-opts.h b/contrib/ntp/ntpdc/ntpdc-opts.h index d2494fe..d3326a7 100644 --- a/contrib/ntp/ntpdc/ntpdc-opts.h +++ b/contrib/ntp/ntpdc/ntpdc-opts.h @@ -1,7 +1,7 @@ /* * EDIT THIS FILE WITH CAUTION (ntpdc-opts.h) * - * It has been AutoGen-ed October 21, 2015 at 12:38:39 PM by AutoGen 5.18.5 + * It has been AutoGen-ed January 7, 2016 at 11:31:11 PM by AutoGen 5.18.5 * From the definitions ntpdc-opts.def * and the template file options * @@ -83,9 +83,9 @@ typedef enum { /** count of all options for ntpdc */ #define OPTION_CT 15 /** ntpdc version */ -#define NTPDC_VERSION "4.2.8p4" +#define NTPDC_VERSION "4.2.8p5" /** Full ntpdc version text */ -#define NTPDC_FULL_VERSION "ntpdc 4.2.8p4" +#define NTPDC_FULL_VERSION "ntpdc 4.2.8p5" /** * Interface defines for all options. Replace "n" with the UPPER_CASED diff --git a/contrib/ntp/ntpdc/ntpdc.1ntpdcman b/contrib/ntp/ntpdc/ntpdc.1ntpdcman index 71fd545..3e78896 100644 --- a/contrib/ntp/ntpdc/ntpdc.1ntpdcman +++ b/contrib/ntp/ntpdc/ntpdc.1ntpdcman @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntpdc 1ntpdcman "21 Oct 2015" "4.2.8p4" "User Commands" +.TH ntpdc 1ntpdcman "07 Jan 2016" "4.2.8p5" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Gvay7L/ag-Svaq6L) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-EXaGzs/ag-QXayys) .\" -.\" It has been AutoGen-ed October 21, 2015 at 12:38:51 PM by AutoGen 5.18.5 +.\" It has been AutoGen-ed January 7, 2016 at 11:31:22 PM by AutoGen 5.18.5 .\" From the definitions ntpdc-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc b/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc index ff7656c..df53d89 100644 --- a/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc +++ b/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc @@ -1,9 +1,9 @@ -.Dd October 21 2015 +.Dd January 7 2016 .Dt NTPDC 1ntpdcmdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.mdoc) .\" -.\" It has been AutoGen-ed October 21, 2015 at 12:38:57 PM by AutoGen 5.18.5 +.\" It has been AutoGen-ed January 7, 2016 at 11:31:29 PM by AutoGen 5.18.5 .\" From the definitions ntpdc-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/ntpdc/ntpdc.c b/contrib/ntp/ntpdc/ntpdc.c index ab17788..bef9ca3 100644 --- a/contrib/ntp/ntpdc/ntpdc.c +++ b/contrib/ntp/ntpdc/ntpdc.c @@ -32,6 +32,7 @@ #include "ntp_libopts.h" #include "ntpdc-opts.h" +#include "safecast.h" #ifdef SYS_VXWORKS /* vxWorks needs mode flag -casey*/ @@ -74,8 +75,8 @@ int ntpdcmain (int, char **); static int openhost (const char *); static int sendpkt (void *, size_t); static void growpktdata (void); -static int getresponse (int, int, int *, int *, char **, int); -static int sendrequest (int, int, int, u_int, size_t, char *); +static int getresponse (int, int, size_t *, size_t *, const char **, size_t); +static int sendrequest (int, int, int, size_t, size_t, const char *); static void getcmds (void); static RETSIGTYPE abortcmd (int); static void docmd (const char *); @@ -526,10 +527,11 @@ openhost( #ifdef SYS_VXWORKS if (connect(sockfd, (struct sockaddr *)&hostaddr, - sizeof(hostaddr)) == -1) { + sizeof(hostaddr)) == -1) #else - if (connect(sockfd, ai->ai_addr, ai->ai_addrlen) == -1) { + if (connect(sockfd, ai->ai_addr, ai->ai_addrlen) == -1) #endif /* SYS_VXWORKS */ + { error("connect"); exit(-1); } @@ -582,18 +584,18 @@ static int getresponse( int implcode, int reqcode, - int *ritems, - int *rsize, - char **rdata, - int esize + size_t *ritems, + size_t *rsize, + const char **rdata, + size_t esize ) { struct resp_pkt rpkt; struct sock_timeval tvo; - int items; - int i; - int size; - int datasize; + size_t items; + size_t i; + size_t size; + size_t datasize; char *datap; char *tmp_data; char haveseq[MAXSEQ+1]; @@ -603,7 +605,7 @@ getresponse( int seq; fd_set fds; ssize_t n; - int pad; + size_t pad; /* * This is pretty tricky. We may get between 1 and many packets @@ -628,8 +630,7 @@ getresponse( tvo = tvsout; FD_SET(sockfd, &fds); - n = select(sockfd+1, &fds, (fd_set *)0, (fd_set *)0, &tvo); - + n = select(sockfd+1, &fds, NULL, NULL, &tvo); if (n == -1) { warning("select fails"); return -1; @@ -640,7 +641,8 @@ getresponse( */ if (firstpkt) { (void) fprintf(stderr, - "%s: timed out, nothing received\n", currenthost); + "%s: timed out, nothing received\n", + currenthost); return ERR_TIMEOUT; } else { (void) fprintf(stderr, @@ -740,7 +742,7 @@ getresponse( if ((size_t)datasize > (n-RESP_HEADER_SIZE)) { if (debug) printf( - "Received items %d, size %d (total %d), data in packet is %zu\n", + "Received items %zu, size %zu (total %zu), data in packet is %zu\n", items, size, datasize, n-RESP_HEADER_SIZE); goto again; } @@ -751,7 +753,7 @@ getresponse( */ if (!firstpkt && size != *rsize) { if (debug) - printf("Received itemsize %d, previous %d\n", + printf("Received itemsize %zu, previous %zu\n", size, *rsize); goto again; } @@ -781,7 +783,7 @@ getresponse( * So far, so good. Copy this data into the output array. */ if ((datap + datasize + (pad * items)) > (pktdata + pktdatasize)) { - int offset = datap - pktdata; + size_t offset = datap - pktdata; growpktdata(); *rdata = pktdata; /* might have been realloced ! */ datap = pktdata + offset; @@ -844,9 +846,9 @@ sendrequest( int implcode, int reqcode, int auth, - u_int qitems, + size_t qitems, size_t qsize, - char *qdata + const char *qdata ) { struct req_pkt qpkt; @@ -855,7 +857,7 @@ sendrequest( u_long key_id; l_fp ts; l_fp * ptstamp; - int maclen; + size_t maclen; char * pass; ZERO(qpkt); @@ -918,13 +920,14 @@ sendrequest( get_systime(&ts); L_ADD(&ts, &delay_time); HTONL_FP(&ts, ptstamp); - maclen = authencrypt(info_auth_keyid, (void *)&qpkt, reqsize); + maclen = authencrypt( + info_auth_keyid, (void *)&qpkt, size2int_chk(reqsize)); if (!maclen) { fprintf(stderr, "Key not found\n"); return 1; } else if (maclen != (int)(info_auth_hashlen + sizeof(keyid_t))) { fprintf(stderr, - "%d octet MAC, %zu expected with %zu octet digest\n", + "%zu octet MAC, %zu expected with %zu octet digest\n", maclen, (info_auth_hashlen + sizeof(keyid_t)), info_auth_hashlen); return 1; @@ -941,12 +944,12 @@ doquery( int implcode, int reqcode, int auth, - int qitems, - int qsize, - char *qdata, - int *ritems, - int *rsize, - char **rdata, + size_t qitems, + size_t qsize, + const char *qdata, + size_t *ritems, + size_t *rsize, + const char **rdata, int quiet_mask, int esize ) @@ -972,8 +975,7 @@ again: tvzero.tv_sec = tvzero.tv_usec = 0; FD_ZERO(&fds); FD_SET(sockfd, &fds); - res = select(sockfd+1, &fds, (fd_set *)0, (fd_set *)0, &tvzero); - + res = select(sockfd+1, &fds, NULL, NULL, &tvzero); if (res == -1) { warning("polling select"); return -1; @@ -1271,7 +1273,7 @@ findcmd( ) { register struct xcmd *cl; - register int clen; + size_t clen; int nmatch; struct xcmd *nearmatch = NULL; struct xcmd *clist; @@ -1384,7 +1386,7 @@ getarg( return 0; } argp->uval *= 10; - argp->uval += (cp - digits); + argp->uval += (u_long)(cp - digits); } while (*(++np) != '\0'); if (isneg) { diff --git a/contrib/ntp/ntpdc/ntpdc.h b/contrib/ntp/ntpdc/ntpdc.h index 6da4a5c..4dfd1eb 100644 --- a/contrib/ntp/ntpdc/ntpdc.h +++ b/contrib/ntp/ntpdc/ntpdc.h @@ -63,5 +63,5 @@ extern int impl_ver; extern int showhostnames; extern int s_port; -extern int doquery (int, int, int, int, int, char *, int *, int *, char **, int, int); +extern int doquery (int, int, int, size_t, size_t, const char *, size_t *, size_t *, const char **, int, int); extern const char * nntohost (sockaddr_u *); diff --git a/contrib/ntp/ntpdc/ntpdc.html b/contrib/ntp/ntpdc/ntpdc.html index cc552ca..107af9b 100644 --- a/contrib/ntp/ntpdc/ntpdc.html +++ b/contrib/ntp/ntpdc/ntpdc.html @@ -36,7 +36,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>This document applies to version 4.2.8p4 of <code>ntpdc</code>. + <p>This document applies to version 4.2.8p5 of <code>ntpdc</code>. <p>The program implements the SNTP protocol as defined by RFC 5905, the NTPv4 IETF specification. @@ -152,7 +152,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">ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p4 +<pre class="example">ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p5 Usage: ntpdc [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...] Flg Arg Option-Name Description -4 no ipv4 Force IPv4 DNS name resolution diff --git a/contrib/ntp/ntpdc/ntpdc.man.in b/contrib/ntp/ntpdc/ntpdc.man.in index f5df744..6662438 100644 --- a/contrib/ntp/ntpdc/ntpdc.man.in +++ b/contrib/ntp/ntpdc/ntpdc.man.in @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntpdc @NTPDC_MS@ "21 Oct 2015" "4.2.8p4" "User Commands" +.TH ntpdc @NTPDC_MS@ "07 Jan 2016" "4.2.8p5" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Gvay7L/ag-Svaq6L) +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-EXaGzs/ag-QXayys) .\" -.\" It has been AutoGen-ed October 21, 2015 at 12:38:51 PM by AutoGen 5.18.5 +.\" It has been AutoGen-ed January 7, 2016 at 11:31:22 PM by AutoGen 5.18.5 .\" From the definitions ntpdc-opts.def .\" and the template file agman-cmd.tpl .SH NAME diff --git a/contrib/ntp/ntpdc/ntpdc.mdoc.in b/contrib/ntp/ntpdc/ntpdc.mdoc.in index 5a6e292..2e2fd31 100644 --- a/contrib/ntp/ntpdc/ntpdc.mdoc.in +++ b/contrib/ntp/ntpdc/ntpdc.mdoc.in @@ -1,9 +1,9 @@ -.Dd October 21 2015 +.Dd January 7 2016 .Dt NTPDC @NTPDC_MS@ User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.mdoc) .\" -.\" It has been AutoGen-ed October 21, 2015 at 12:38:57 PM by AutoGen 5.18.5 +.\" It has been AutoGen-ed January 7, 2016 at 11:31:29 PM by AutoGen 5.18.5 .\" From the definitions ntpdc-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME diff --git a/contrib/ntp/ntpdc/ntpdc_ops.c b/contrib/ntp/ntpdc/ntpdc_ops.c index be8ffa2..2f57768 100644 --- a/contrib/ntp/ntpdc/ntpdc_ops.c +++ b/contrib/ntp/ntpdc/ntpdc_ops.c @@ -31,9 +31,9 @@ /* * utility functions */ -static int checkitems (int, FILE *); -static int checkitemsize (int, int); -static int check1item (int, FILE *); +static int checkitems (size_t, FILE *); +static int checkitemsize (size_t, size_t); +static int check1item (size_t, FILE *); /* * Declarations for command handlers in here @@ -288,7 +288,7 @@ do { \ */ static int checkitems( - int items, + size_t items, FILE *fp ) { @@ -305,14 +305,14 @@ checkitems( */ static int checkitemsize( - int itemsize, - int expected + size_t itemsize, + size_t expected ) { if (itemsize != expected) { (void) fprintf(stderr, - "***Incorrect item size returned by remote host (%d should be %d)\n", - itemsize, expected); + "***Incorrect item size returned by remote host (%lu should be %lu)\n", + (u_long)itemsize, (u_long)expected); return 0; } return 1; @@ -324,7 +324,7 @@ checkitemsize( */ static int check1item( - int items, + size_t items, FILE *fp ) { @@ -333,8 +333,8 @@ check1item( return 0; } if (items > 1) { - (void) fprintf(fp, "Expected one item in response, got %d\n", - items); + (void) fprintf(fp, "Expected one item in response, got %lu\n", + (u_long)items); return 0; } return 1; @@ -353,8 +353,8 @@ peerlist( { struct info_peer_list *plist; sockaddr_u paddr; - int items; - int itemsize; + size_t items; + size_t itemsize; int res; again: @@ -430,8 +430,8 @@ dopeers( struct info_peer_summary *plist; sockaddr_u dstadr; sockaddr_u srcadr; - int items; - int itemsize; + size_t items; + size_t itemsize; int ntp_poll; int res; int c; @@ -679,10 +679,10 @@ showpeer( struct info_peer *pp; /* 4 is the maximum number of peers which will fit in a packet */ struct info_peer_list *pl, plist[min(MAXARGS, 4)]; - int qitemlim; - int qitems; - int items; - int itemsize; + size_t qitemlim; + size_t qitems; + size_t items; + size_t itemsize; int res; int sendsize; @@ -753,12 +753,12 @@ peerstats( /* 4 is the maximum number of peers which will fit in a packet */ struct info_peer_list *pl, plist[min(MAXARGS, 4)]; sockaddr_u src, dst; - int qitemlim; - int qitems; - int items; - int itemsize; + size_t qitemlim; + size_t qitems; + size_t items; + size_t itemsize; int res; - int sendsize; + size_t sendsize; again: if (impl_ver == IMPL_XNTPD) @@ -871,8 +871,8 @@ loopinfo( ) { struct info_loop *il; - int items; - int itemsize; + size_t items; + size_t itemsize; int oneline = 0; int res; l_fp tempts; @@ -946,8 +946,8 @@ sysinfo( { struct info_sys *is; sockaddr_u peeraddr; - int items; - int itemsize; + size_t items; + size_t itemsize; int res; l_fp tempts; @@ -1035,8 +1035,8 @@ sysstats( ) { struct info_sys_stats *ss; - int items; - int itemsize; + size_t items; + size_t itemsize; int res; again: @@ -1101,8 +1101,8 @@ iostats( ) { struct info_io_stats *io; - int items; - int itemsize; + size_t items; + size_t itemsize; int res; again: @@ -1162,8 +1162,8 @@ memstats( { struct info_mem_stats *mem; int i; - int items; - int itemsize; + size_t items; + size_t itemsize; int res; again: @@ -1219,8 +1219,8 @@ timerstats( ) { struct info_timer_stats *tim; - int items; - int itemsize; + size_t items; + size_t itemsize; int res; again: @@ -1314,9 +1314,9 @@ doconfig( ) { struct conf_peer cpeer; - int items; - int itemsize; - char *dummy; + size_t items; + size_t itemsize; + const char *dummy; u_long keyid; u_int version; u_char minpoll; @@ -1480,13 +1480,13 @@ unconfig( { /* 8 is the maximum number of peers which will fit in a packet */ struct conf_unpeer *pl, plist[min(MAXARGS, 8)]; - int qitemlim; - int qitems; - int items; - int itemsize; - char *dummy; + size_t qitemlim; + size_t qitems; + size_t items; + size_t itemsize; + const char *dummy; int res; - int sendsize; + size_t sendsize; again: if (impl_ver == IMPL_XNTPD) @@ -1564,9 +1564,9 @@ doset( ) { struct conf_sys_flags sys; - int items; - int itemsize; - char *dummy; + size_t items; + size_t itemsize; + const char *dummy; int res; sys.flags = 0; @@ -1675,8 +1675,8 @@ reslist( struct info_restrict *rl; sockaddr_u resaddr; sockaddr_u maskaddr; - int items; - int itemsize; + size_t items; + size_t itemsize; int res; int skip; const char *addr; @@ -1827,9 +1827,9 @@ do_restrict( ) { struct conf_restrict cres; - int items; - int itemsize; - char *dummy; + size_t items; + size_t itemsize; + const char *dummy; u_int32 num; u_long bit; int i; @@ -1946,14 +1946,14 @@ monlist( FILE *fp ) { - char *struct_star; - struct info_monitor *ml; - struct info_monitor_1 *m1; - struct old_info_monitor *oml; + const char *struct_star; + const struct info_monitor *ml; + const struct info_monitor_1 *m1; + const struct old_info_monitor *oml; sockaddr_u addr; sockaddr_u dstadr; - int items; - int itemsize; + size_t items; + size_t itemsize; int res; int version = -1; @@ -1987,7 +1987,7 @@ again: if (itemsize == sizeof(struct info_monitor_1) || itemsize == v4sizeof(struct info_monitor_1)) { - m1 = (void *)struct_star; + m1 = (const void*)struct_star; fprintf(fp, "remote address port local address count m ver rstr avgint lstint\n"); fprintf(fp, @@ -2014,7 +2014,7 @@ again: } else if (itemsize == sizeof(struct info_monitor) || itemsize == v4sizeof(struct info_monitor)) { - ml = (void *) struct_star; + ml = (const void *)struct_star; fprintf(fp, " address port count mode ver rstr avgint lstint\n"); fprintf(fp, @@ -2039,7 +2039,7 @@ again: } } else if (itemsize == sizeof(struct old_info_monitor)) { - oml = (void *)struct_star; + oml = (const void *)struct_star; fprintf(fp, " address port count mode version lasttime firsttime\n"); fprintf(fp, @@ -2091,9 +2091,9 @@ reset( ) { struct reset_flags rflags; - int items; - int itemsize; - char *dummy; + size_t items; + size_t itemsize; + const char *dummy; int i; size_t res; int err; @@ -2148,13 +2148,13 @@ preset( { /* 8 is the maximum number of peers which will fit in a packet */ struct conf_unpeer *pl, plist[min(MAXARGS, 8)]; - int qitemlim; - int qitems; - int items; - int itemsize; - char *dummy; + size_t qitemlim; + size_t qitems; + size_t items; + size_t itemsize; + const char *dummy; int res; - int sendsize; + size_t sendsize; again: if (impl_ver == IMPL_XNTPD) @@ -2205,9 +2205,9 @@ readkeys( FILE *fp ) { - int items; - int itemsize; - char *dummy; + size_t items; + size_t itemsize; + const char *dummy; int res; again: @@ -2263,9 +2263,9 @@ do_trustkey( { u_long keyids[MAXARGS]; size_t i; - int items; - int itemsize; - char *dummy; + size_t items; + size_t itemsize; + const char *dummy; int ritems; int res; @@ -2302,8 +2302,8 @@ authinfo( ) { struct info_auth *ia; - int items; - int itemsize; + size_t items; + size_t itemsize; int res; again: @@ -2356,11 +2356,11 @@ traps( FILE *fp ) { - int i; + size_t i; struct info_trap *it; sockaddr_u trap_addr, local_addr; - int items; - int itemsize; + size_t items; + size_t itemsize; int res; again: @@ -2446,9 +2446,9 @@ do_addclr_trap( ) { struct conf_trap ctrap; - int items; - int itemsize; - char *dummy; + size_t items; + size_t itemsize; + const char *dummy; int res; int sendsize; @@ -2545,9 +2545,9 @@ do_changekey( ) { u_long key; - int items; - int itemsize; - char *dummy; + size_t items; + size_t itemsize; + const char *dummy; int res; @@ -2581,8 +2581,8 @@ ctlstats( ) { struct info_control *ic; - int items; - int itemsize; + size_t items; + size_t itemsize; int res; again: @@ -2648,10 +2648,10 @@ clockstat( struct info_clock *cl; /* 8 is the maximum number of clocks which will fit in a packet */ u_long clist[min(MAXARGS, 8)]; - int qitemlim; - int qitems; - int items; - int itemsize; + size_t qitemlim; + size_t qitems; + size_t items; + size_t itemsize; int res; l_fp ts; struct clktype *clk; @@ -2735,9 +2735,9 @@ fudge( ) { struct conf_fudge fudgedata; - int items; - int itemsize; - char *dummy; + size_t items; + size_t itemsize; + const char *dummy; l_fp ts; int res; long val; @@ -2822,10 +2822,10 @@ clkbug( /* 8 is the maximum number of clocks which will fit in a packet */ u_long clist[min(MAXARGS, 8)]; u_int32 ltemp; - int qitemlim; - int qitems; - int items; - int itemsize; + size_t qitemlim; + size_t qitems; + size_t items; + size_t itemsize; int res; int needsp; l_fp ts; @@ -2916,8 +2916,8 @@ kerninfo( ) { struct info_kernel *ik; - int items; - int itemsize; + size_t items; + size_t itemsize; int res; unsigned status; double tscale = 1e-6; @@ -3050,8 +3050,8 @@ static void iflist( FILE *fp, struct info_if_stats *ifs, - int items, - int itemsize, + size_t items, + size_t itemsize, int res ) { @@ -3113,8 +3113,8 @@ get_if_stats( ) { struct info_if_stats *ifs; - int items; - int itemsize; + size_t items; + size_t itemsize; int res; res = doquery(impl_ver, REQ_IF_STATS, 1, 0, 0, (char *)NULL, &items, @@ -3131,8 +3131,8 @@ do_if_reload( ) { struct info_if_stats *ifs; - int items; - int itemsize; + size_t items; + size_t itemsize; int res; res = doquery(impl_ver, REQ_IF_RELOAD, 1, 0, 0, (char *)NULL, &items, |