summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/netstat/atalk.c6
-rw-r--r--usr.bin/netstat/if.c7
-rw-r--r--usr.bin/netstat/inet.c12
-rw-r--r--usr.bin/netstat/inet6.c8
-rw-r--r--usr.bin/netstat/ipsec.c13
-rw-r--r--usr.bin/netstat/ipx.c8
-rw-r--r--usr.bin/netstat/iso.c12
-rw-r--r--usr.bin/netstat/main.c21
-rw-r--r--usr.bin/netstat/mroute6.c2
-rw-r--r--usr.bin/netstat/netgraph.c2
-rw-r--r--usr.bin/netstat/netstat.h56
-rw-r--r--usr.bin/netstat/ns.c8
-rw-r--r--usr.bin/netstat/route.c5
13 files changed, 67 insertions, 93 deletions
diff --git a/usr.bin/netstat/atalk.c b/usr.bin/netstat/atalk.c
index e940047..b2dd382 100644
--- a/usr.bin/netstat/atalk.c
+++ b/usr.bin/netstat/atalk.c
@@ -103,7 +103,7 @@ static char mybuf[50];
return mybuf;
}
-char *
+static char *
at_pr_port(struct sockaddr_at *sat)
{
static char mybuf[50];
@@ -212,7 +212,7 @@ atalk_print2(struct sockaddr *sa, struct sockaddr *mask, int what)
}
void
-atalkprotopr(u_long off, char *name)
+atalkprotopr(u_long off __unused, char *name, int af __unused)
{
struct ddpcb *this, *next;
@@ -261,7 +261,7 @@ atalkprotopr(u_long off, char *name)
* Dump DDP statistics structure.
*/
void
-ddp_stats(u_long off, char *name)
+ddp_stats(u_long off __unused, char *name, int af __unused)
{
struct ddpstat ddpstat;
diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c
index fa491a3..ca88fce 100644
--- a/usr.bin/netstat/if.c
+++ b/usr.bin/netstat/if.c
@@ -85,8 +85,9 @@ static char ntop_buf[INET6_ADDRSTRLEN]; /* for inet_ntop() */
static int bdg_done;
#endif
+/* print bridge statistics */
void
-bdg_stats(u_long dummy, char *name) /* print bridge statistics */
+bdg_stats(u_long dummy __unused, char *name, int af __unused)
{
int i;
size_t slen ;
@@ -132,7 +133,7 @@ bdg_stats(u_long dummy, char *name) /* print bridge statistics */
* Display a formatted value, or a '-' in the same space.
*/
static void
-show_stat(char *fmt, int width, u_long value, short showvalue)
+show_stat(const char *fmt, int width, u_long value, short showvalue)
{
char newfmt[32];
@@ -670,7 +671,7 @@ loop:
* Sets a flag to not wait for the alarm.
*/
static void
-catchalarm(int signo)
+catchalarm(int signo __unused)
{
signalled = YES;
}
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c
index 194c60c..723ec5b 100644
--- a/usr.bin/netstat/inet.c
+++ b/usr.bin/netstat/inet.c
@@ -165,7 +165,7 @@ protopr(u_long proto, /* for sysctl version we pass proto # */
}
/* Ignore sockets for protocols other than the desired one. */
- if (so->xso_protocol != proto)
+ if (so->xso_protocol != (int)proto)
continue;
/* Ignore PCBs which were freed during copyout. */
@@ -346,7 +346,7 @@ protopr(u_long proto, /* for sysctl version we pass proto # */
* Dump TCP statistics structure.
*/
void
-tcp_stats(u_long off, char *name)
+tcp_stats(u_long off __unused, char *name, int af __unused)
{
struct tcpstat tcpstat;
size_t len = sizeof tcpstat;
@@ -444,7 +444,7 @@ tcp_stats(u_long off, char *name)
* Dump UDP statistics structure.
*/
void
-udp_stats(u_long off, char *name)
+udp_stats(u_long off __unused, char *name, int af __unused)
{
struct udpstat udpstat;
size_t len = sizeof udpstat;
@@ -495,7 +495,7 @@ udp_stats(u_long off, char *name)
* Dump IP statistics structure.
*/
void
-ip_stats(u_long off, char *name)
+ip_stats(u_long off __unused, char *name, int af __unused)
{
struct ipstat ipstat;
size_t len = sizeof ipstat;
@@ -575,7 +575,7 @@ static char *icmpnames[] = {
* Dump ICMP statistics.
*/
void
-icmp_stats(u_long off, char *name)
+icmp_stats(u_long off __unused, char *name, int af __unused)
{
struct icmpstat icmpstat;
int i, first;
@@ -641,7 +641,7 @@ icmp_stats(u_long off, char *name)
* Dump IGMP statistics structure.
*/
void
-igmp_stats(u_long off, char *name)
+igmp_stats(u_long off __unused, char *name, int af __unused)
{
struct igmpstat igmpstat;
size_t len = sizeof igmpstat;
diff --git a/usr.bin/netstat/inet6.c b/usr.bin/netstat/inet6.c
index 163273d..c89c09f 100644
--- a/usr.bin/netstat/inet6.c
+++ b/usr.bin/netstat/inet6.c
@@ -340,7 +340,7 @@ static char *ip6nh[] = {
* Dump IP6 statistics structure.
*/
void
-ip6_stats(u_long off, char *name)
+ip6_stats(u_long off __unused, char *name, int af __unused)
{
struct ip6stat ip6stat;
int first, i;
@@ -807,7 +807,7 @@ static char *icmp6names[] = {
* Dump ICMP6 statistics.
*/
void
-icmp6_stats(u_long off, char *name)
+icmp6_stats(u_long off __unused, char *name, int af __unused)
{
struct icmp6stat icmp6stat;
register int i, first;
@@ -945,7 +945,7 @@ icmp6_ifstats(char *ifname)
* Dump PIM statistics structure.
*/
void
-pim6_stats(u_long off, char *name)
+pim6_stats(u_long off __unused, char *name, int af __unused)
{
struct pim6stat pim6stat;
@@ -970,7 +970,7 @@ pim6_stats(u_long off, char *name)
* Dump raw ip6 statistics structure.
*/
void
-rip6_stats(u_long off, char *name)
+rip6_stats(u_long off __unused, char *name, int af __unused)
{
struct rip6stat rip6stat;
u_quad_t delivered;
diff --git a/usr.bin/netstat/ipsec.c b/usr.bin/netstat/ipsec.c
index a82ad13..2176458 100644
--- a/usr.bin/netstat/ipsec.c
+++ b/usr.bin/netstat/ipsec.c
@@ -162,7 +162,7 @@ static struct ipsecstat ipsecstat;
static void print_ipsecstats (void);
static const char *pfkey_msgtype_names (int);
static void ipsec_hist (const u_quad_t *, size_t, const struct val2str *,
- size_t, const char *);
+ const char *);
/*
* Dump IPSEC statistics structure.
@@ -171,7 +171,6 @@ static void
ipsec_hist(const u_quad_t *hist,
size_t histmax,
const struct val2str *name,
- size_t namemax,
const char *title)
{
int first;
@@ -187,7 +186,7 @@ ipsec_hist(const u_quad_t *hist,
first = 0;
}
for (p = name; p && p->str; p++) {
- if (p->val == proto)
+ if (p->val == (int)proto)
break;
}
if (p && p->str) {
@@ -205,7 +204,7 @@ print_ipsecstats(void)
#define p(f, m) if (ipsecstat.f || sflag <= 1) \
printf(m, (CAST)ipsecstat.f, plural(ipsecstat.f))
#define hist(f, n, t) \
- ipsec_hist((f), sizeof(f)/sizeof(f[0]), (n), sizeof(n)/sizeof(n[0]), (t));
+ ipsec_hist((f), sizeof(f)/sizeof(f[0]), (n), (t));
p(in_success, "\t" LLU " inbound packet%s processed successfully\n");
p(in_polvio, "\t" LLU " inbound packet%s violated process security "
@@ -237,7 +236,7 @@ print_ipsecstats(void)
}
void
-ipsec_stats(u_long off, char *name)
+ipsec_stats(u_long off __unused, char *name, int af __unused)
{
if (off == 0)
return;
@@ -261,10 +260,10 @@ pfkey_msgtype_names(int x)
}
void
-pfkey_stats(u_long off, char *name)
+pfkey_stats(u_long off __unused, char *name, int af __unused)
{
struct pfkeystat pfkeystat;
- int first, type;
+ unsigned first, type;
if (off == 0)
return;
diff --git a/usr.bin/netstat/ipx.c b/usr.bin/netstat/ipx.c
index 0f2236e..e7a0155 100644
--- a/usr.bin/netstat/ipx.c
+++ b/usr.bin/netstat/ipx.c
@@ -83,7 +83,7 @@ static int first = 1;
*/
void
-ipxprotopr(u_long off, char *name)
+ipxprotopr(u_long off, char *name, int af __unused)
{
struct ipxpcb cb;
register struct ipxpcb *prev, *next;
@@ -159,7 +159,7 @@ ipxprotopr(u_long off, char *name)
* Dump SPX statistics structure.
*/
void
-spx_stats(u_long off, char *name)
+spx_stats(u_long off, char *name, int af __unused)
{
struct spx_istat spx_istat;
#define spxstat spx_istat.newstats
@@ -235,7 +235,7 @@ spx_stats(u_long off, char *name)
* Dump IPX statistics structure.
*/
void
-ipx_stats(u_long off, char *name)
+ipx_stats(u_long off, char *name, int af __unused)
{
struct ipxstat ipxstat;
@@ -278,7 +278,7 @@ static struct {
*/
/*ARGSUSED*/
void
-ipxerr_stats(u_long off, char *name)
+ipxerr_stats(u_long off, char *name, int af __unused)
{
struct ipx_errstat ipx_errstat;
register int j;
diff --git a/usr.bin/netstat/iso.c b/usr.bin/netstat/iso.c
index 149c8a2..387c633 100644
--- a/usr.bin/netstat/iso.c
+++ b/usr.bin/netstat/iso.c
@@ -115,7 +115,7 @@ extern void inetprint (struct in_addr *, int, char *);
* Dump esis stats
*/
void
-esis_stats(u_long off, char *name)
+esis_stats(u_long off, char *name, int af __unused)
{
struct esis_stat esis_stat;
@@ -142,7 +142,7 @@ esis_stats(u_long off, char *name)
* Dump clnp statistics structure.
*/
void
-clnp_stats(u_long off, char *name)
+clnp_stats(u_long off, char *name, int af __unused)
{
struct clnp_stat clnp_stat;
@@ -175,7 +175,7 @@ clnp_stats(u_long off, char *name)
* Dump CLTP statistics structure.
*/
void
-cltp_stats(u_long off, char *name)
+cltp_stats(u_long off, char *name, int af __unused)
{
struct cltpstat cltpstat;
@@ -209,7 +209,7 @@ static int first = 1;
* -a (all) flag is specified.
*/
void
-iso_protopr(u_long off, char *name)
+iso_protopr(u_long off, char *name, int af __unused)
{
struct isopcb cb;
register struct isopcb *prev, *next;
@@ -293,7 +293,7 @@ iso_protopr1(u_long kern_addr, int istp)
}
void
-tp_protopr(u_long off, char *name)
+tp_protopr(u_long off, char *name, int af __unused)
{
extern char *tp_sstring[];
struct tp_ref *tpr, *tpr_base;
@@ -444,7 +444,7 @@ isonetprint(struct iso_addr *iso, char *sufx, u_short sufxlen, int islocal)
#ifdef notdef
static void
-x25_protopr(u_long off, char *name)
+x25_protopr(u_long off, char *name, int af __unused)
{
static char *xpcb_states[] = {
"CLOSED",
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index 51e5da4..05f41c6 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -491,25 +491,6 @@ main(argc, argv)
mbpr(0, 0, 0, 0);
exit(0);
}
- if (pflag) {
- if (iflag && tp->pr_istats) {
- kread(0, 0, 0);
- intpr(interval, nl[N_IFNET].n_value, tp->pr_istats);
- exit(0);
- }
- if (!tp->pr_stats) {
- printf("%s: no stats routine\n", tp->pr_name);
- exit(0);
- }
- if (tp->pr_usesysctl) {
- (*tp->pr_stats)(tp->pr_usesysctl, tp->pr_name);
- } else {
- kread(0, 0, 0);
- (*tp->pr_stats)(nl[tp->pr_sindex].n_value,
- tp->pr_name);
- }
- exit(0);
- }
#if 0
/*
* Keep file descriptors open to avoid overhead
@@ -613,7 +594,7 @@ printproto(tp, name)
register struct protox *tp;
char *name;
{
- void (*pr)();
+ void (*pr)(u_long, char *, int);
u_long off;
if (sflag) {
diff --git a/usr.bin/netstat/mroute6.c b/usr.bin/netstat/mroute6.c
index 8539188..16368b8 100644
--- a/usr.bin/netstat/mroute6.c
+++ b/usr.bin/netstat/mroute6.c
@@ -91,8 +91,6 @@
#define WID_ORG (lflag ? 39 : (numeric_addr ? 29 : 18)) /* width of origin column */
#define WID_GRP (lflag ? 18 : (numeric_addr ? 16 : 18)) /* width of group column */
-extern char *routename6 (struct sockaddr_in6 *);
-
void
mroute6pr(u_long mfcaddr, u_long mifaddr)
{
diff --git a/usr.bin/netstat/netgraph.c b/usr.bin/netstat/netgraph.c
index 17cc9a0..fb032e8 100644
--- a/usr.bin/netstat/netgraph.c
+++ b/usr.bin/netstat/netgraph.c
@@ -65,7 +65,7 @@ static int first = 1;
static int csock = -1;
void
-netgraphprotopr(u_long off, char *name)
+netgraphprotopr(u_long off, char *name, int af __unused)
{
struct ngpcb *this, *next;
struct ngpcb ngpcb;
diff --git a/usr.bin/netstat/netstat.h b/usr.bin/netstat/netstat.h
index 2dd939e..e590c48 100644
--- a/usr.bin/netstat/netstat.h
+++ b/usr.bin/netstat/netstat.h
@@ -64,22 +64,22 @@ char *plural (int);
char *plurales (int);
void protopr (u_long, char *, int);
-void tcp_stats (u_long, char *);
-void udp_stats (u_long, char *);
-void ip_stats (u_long, char *);
-void icmp_stats (u_long, char *);
-void igmp_stats (u_long, char *);
+void tcp_stats (u_long, char *, int);
+void udp_stats (u_long, char *, int);
+void ip_stats (u_long, char *, int);
+void icmp_stats (u_long, char *, int);
+void igmp_stats (u_long, char *, int);
#ifdef IPSEC
-void ipsec_stats (u_long, char *);
+void ipsec_stats (u_long, char *, int);
#endif
#ifdef INET6
-void ip6_stats (u_long, char *);
+void ip6_stats (u_long, char *, int);
void ip6_ifstats (char *);
-void icmp6_stats (u_long, char *);
+void icmp6_stats (u_long, char *, int);
void icmp6_ifstats (char *);
-void pim6_stats (u_long, char *);
-void rip6_stats (u_long, char *);
+void pim6_stats (u_long, char *, int);
+void rip6_stats (u_long, char *, int);
void mroute6pr (u_long, u_long);
void mrt6_stats (u_long);
@@ -90,10 +90,10 @@ char *netname6 (struct sockaddr_in6 *, struct in6_addr *);
#endif /*INET6*/
#ifdef IPSEC
-void pfkey_stats (u_long, char *);
+void pfkey_stats (u_long, char *, int);
#endif
-void bdg_stats (u_long, char *);
+void bdg_stats (u_long, char *, int);
void mbpr (u_long, u_long, u_long, u_long);
@@ -118,29 +118,29 @@ char *ipx_print (struct sockaddr *);
char *ns_print (struct sockaddr *);
void routepr (u_long);
-void ipxprotopr (u_long, char *);
-void spx_stats (u_long, char *);
-void ipx_stats (u_long, char *);
-void ipxerr_stats (u_long, char *);
+void ipxprotopr (u_long, char *, int);
+void spx_stats (u_long, char *, int);
+void ipx_stats (u_long, char *, int);
+void ipxerr_stats (u_long, char *, int);
-void nsprotopr (u_long, char *);
-void spp_stats (u_long, char *);
-void idp_stats (u_long, char *);
-void nserr_stats (u_long, char *);
+void nsprotopr (u_long, char *, int);
+void spp_stats (u_long, char *, int);
+void idp_stats (u_long, char *, int);
+void nserr_stats (u_long, char *, int);
-void atalkprotopr (u_long, char *);
-void ddp_stats (u_long, char *);
+void atalkprotopr (u_long, char *, int);
+void ddp_stats (u_long, char *, int);
-void netgraphprotopr (u_long, char *);
+void netgraphprotopr (u_long, char *, int);
void unixpr (void);
-void esis_stats (u_long, char *);
-void clnp_stats (u_long, char *);
-void cltp_stats (u_long, char *);
-void iso_protopr (u_long, char *);
+void esis_stats (u_long, char *, int);
+void clnp_stats (u_long, char *, int);
+void cltp_stats (u_long, char *, int);
+void iso_protopr (u_long, char *, int);
void iso_protopr1 (u_long, int);
-void tp_protopr (u_long, char *);
+void tp_protopr (u_long, char *, int);
void tp_inproto (u_long);
void tp_stats (caddr_t, caddr_t);
diff --git a/usr.bin/netstat/ns.c b/usr.bin/netstat/ns.c
index 041282f..1b924be 100644
--- a/usr.bin/netstat/ns.c
+++ b/usr.bin/netstat/ns.c
@@ -85,7 +85,7 @@ static int first = 1;
*/
void
-nsprotopr(u_long off, char *name)
+nsprotopr(u_long off, char *name, int af __unused)
{
struct nspcb cb;
register struct nspcb *prev, *next;
@@ -158,7 +158,7 @@ nsprotopr(u_long off, char *name)
* Dump SPP statistics structure.
*/
void
-spp_stats(u_long off, char *name)
+spp_stats(u_long off, char *name, int af __unused)
{
struct spp_istat spp_istat;
#define sppstat spp_istat.newstats
@@ -234,7 +234,7 @@ spp_stats(u_long off, char *name)
* Dump IDP statistics structure.
*/
void
-idp_stats(u_long off, char *name)
+idp_stats(u_long off, char *name, int af __unused)
{
struct idpstat idpstat;
@@ -268,7 +268,7 @@ static struct {
*/
/*ARGSUSED*/
void
-nserr_stats(u_long off, char *name)
+nserr_stats(u_long off, char *name, int af __unused)
{
struct ns_errstat ns_errstat;
register int j;
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c
index 7166648..83c4c49 100644
--- a/usr.bin/netstat/route.c
+++ b/usr.bin/netstat/route.c
@@ -135,11 +135,6 @@ static void p_rtentry (struct rtentry *);
static u_long forgemask (u_long);
static void domask (char *, u_long, u_long);
-#ifdef INET6
-char *routename6 (struct sockaddr_in6 *);
-char *netname6 (struct sockaddr_in6 *, struct in6_addr *);
-#endif /*INET6*/
-
/*
* Print routing tables.
*/
OpenPOWER on IntegriCloud