summaryrefslogtreecommitdiff
path: root/usr.bin/netstat
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r--usr.bin/netstat/atalk.c39
-rw-r--r--usr.bin/netstat/if.c20
-rw-r--r--usr.bin/netstat/inet.c89
-rw-r--r--usr.bin/netstat/inet6.c60
-rw-r--r--usr.bin/netstat/ipx.c48
-rw-r--r--usr.bin/netstat/iso.c68
-rw-r--r--usr.bin/netstat/main.c39
-rw-r--r--usr.bin/netstat/mbuf.c9
-rw-r--r--usr.bin/netstat/mroute.c11
-rw-r--r--usr.bin/netstat/mroute6.c29
-rw-r--r--usr.bin/netstat/ns.c40
-rw-r--r--usr.bin/netstat/route.c76
-rw-r--r--usr.bin/netstat/unix.c11
13 files changed, 188 insertions, 351 deletions
diff --git a/usr.bin/netstat/atalk.c b/usr.bin/netstat/atalk.c
index 22564a793ba..f3871495d54 100644
--- a/usr.bin/netstat/atalk.c
+++ b/usr.bin/netstat/atalk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atalk.c,v 1.9 2002/07/25 03:58:56 deraadt Exp $ */
+/* $OpenBSD: atalk.c,v 1.10 2003/02/01 01:51:31 deraadt Exp $ */
/* $NetBSD: atalk.c,v 1.2 1997/05/22 17:21:26 christos Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from @(#)atalk.c 1.1 (Whistle) 6/6/96";
#else
-static char rcsid[] = "$OpenBSD: atalk.c,v 1.9 2002/07/25 03:58:56 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: atalk.c,v 1.10 2003/02/01 01:51:31 deraadt Exp $";
#endif
#endif /* not lint */
@@ -82,9 +82,7 @@ static char *at_pr_port(struct sockaddr_at *);
*/
static char *
-at_pr_net(sat, numeric)
- struct sockaddr_at *sat;
- int numeric;
+at_pr_net(struct sockaddr_at *sat, int numeric)
{
static char mybuf[50];
@@ -102,9 +100,7 @@ at_pr_net(sat, numeric)
}
static char *
-at_pr_host(sat, numeric)
- struct sockaddr_at *sat;
- int numeric;
+at_pr_host(struct sockaddr_at *sat, int numeric)
{
static char mybuf[50];
@@ -122,8 +118,7 @@ at_pr_host(sat, numeric)
}
static char *
-at_pr_port(sat)
- struct sockaddr_at *sat;
+at_pr_port(struct sockaddr_at *sat)
{
static char mybuf[50];
struct servent *serv;
@@ -152,13 +147,12 @@ at_pr_port(sat)
}
static char *
-at_pr_range(sat)
- struct sockaddr_at *sat;
+at_pr_range(struct sockaddr_at *sat)
{
static char mybuf[50];
- if (sat->sat_range.r_netrange.nr_firstnet
- != sat->sat_range.r_netrange.nr_lastnet) {
+ if (sat->sat_range.r_netrange.nr_firstnet !=
+ sat->sat_range.r_netrange.nr_lastnet) {
(void) snprintf(mybuf, sizeof(mybuf), "%d-%d",
ntohs(sat->sat_range.r_netrange.nr_firstnet),
ntohs(sat->sat_range.r_netrange.nr_lastnet));
@@ -177,9 +171,7 @@ at_pr_range(sat)
* 8 for numeric only
*/
char *
-atalk_print(sa, what)
- const struct sockaddr *sa;
- int what;
+atalk_print(const struct sockaddr *sa, int what)
{
struct sockaddr_at *sat = (struct sockaddr_at *) sa;
static char mybuf[50];
@@ -215,10 +207,7 @@ atalk_print(sa, what)
}
char *
-atalk_print2(sa, mask, what)
- const struct sockaddr *sa;
- const struct sockaddr *mask;
- int what;
+atalk_print2(const struct sockaddr *sa, const struct sockaddr *mask, int what)
{
size_t n, l;
static char buf[100];
@@ -258,9 +247,7 @@ atalk_print2(sa, mask, what)
}
void
-atalkprotopr(off, name)
- u_long off;
- char *name;
+atalkprotopr(u_long off, char *name)
{
struct ddpcb cb;
struct ddpcb *prev, *next;
@@ -323,9 +310,7 @@ atalkprotopr(off, name)
* Dump DDP statistics structure.
*/
void
-ddp_stats(off, name)
- u_long off;
- char *name;
+ddp_stats(u_long off, char *name)
{
struct ddpstat ddpstat;
diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c
index a346e96ecd1..c64e087eb6c 100644
--- a/usr.bin/netstat/if.c
+++ b/usr.bin/netstat/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.32 2002/06/19 23:40:20 itojun Exp $ */
+/* $OpenBSD: if.c,v 1.33 2003/02/01 01:51:31 deraadt Exp $ */
/* $NetBSD: if.c,v 1.16.4.2 1996/06/07 21:46:46 thorpej Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from: @(#)if.c 8.2 (Berkeley) 2/21/94";
#else
-static char *rcsid = "$OpenBSD: if.c,v 1.32 2002/06/19 23:40:20 itojun Exp $";
+static char *rcsid = "$OpenBSD: if.c,v 1.33 2003/02/01 01:51:31 deraadt Exp $";
#endif
#endif /* not lint */
@@ -80,9 +80,7 @@ static void catchalarm(int);
* which is a TAILQ_HEAD.
*/
void
-intpr(interval, ifnetaddr)
- int interval;
- u_long ifnetaddr;
+intpr(int interval, u_long ifnetaddr)
{
struct ifnet ifnet;
union {
@@ -95,8 +93,7 @@ intpr(interval, ifnetaddr)
struct ipx_ifaddr ipx;
struct iso_ifaddr iso;
} ifaddr;
- u_long total;
- u_long ifaddraddr;
+ u_long total, ifaddraddr;
struct sockaddr *sa;
struct ifnet_head ifhead; /* TAILQ_HEAD */
char name[IFNAMSIZ];
@@ -120,7 +117,7 @@ intpr(interval, ifnetaddr)
ifnetaddr = (u_long)ifhead.tqh_first;
printf("%-7.7s %-5.5s %-11.11s %-17.17s ",
- "Name", "Mtu", "Network", "Address");
+ "Name", "Mtu", "Network", "Address");
if (bflag)
printf("%10.10s %10.10s", "Ibytes", "Obytes");
else
@@ -394,9 +391,7 @@ volatile sig_atomic_t signalled; /* set if alarm goes off "early" */
* First line printed at top of screen is always cumulative.
*/
static void
-sidewaysintpr(interval, off)
- unsigned interval;
- u_long off;
+sidewaysintpr(unsigned int interval, u_long off)
{
struct ifnet ifnet;
u_long firstifnet;
@@ -577,8 +572,7 @@ loop:
* Sets a flag to not wait for the alarm.
*/
static void
-catchalarm(signo)
- int signo;
+catchalarm(int signo)
{
signalled = YES;
}
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c
index a831e5b8778..e75be36f6de 100644
--- a/usr.bin/netstat/inet.c
+++ b/usr.bin/netstat/inet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet.c,v 1.62 2002/06/09 04:07:10 jsyn Exp $ */
+/* $OpenBSD: inet.c,v 1.63 2003/02/01 01:51:31 deraadt Exp $ */
/* $NetBSD: inet.c,v 1.14 1995/10/03 21:42:37 thorpej Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from: @(#)inet.c 8.4 (Berkeley) 4/20/94";
#else
-static char *rcsid = "$OpenBSD: inet.c,v 1.62 2002/06/09 04:07:10 jsyn Exp $";
+static char *rcsid = "$OpenBSD: inet.c,v 1.63 2003/02/01 01:51:31 deraadt Exp $";
#endif
#endif /* not lint */
@@ -95,7 +95,7 @@ struct socket sockb;
static void protopr0(u_long, char *, int);
char *inetname(struct in_addr *);
-void inetprint(struct in_addr *, int, char *, int);
+void inetprint(struct in_addr *, in_port_t, char *, int);
#ifdef INET6
char *inet6name(struct in6_addr *);
void inet6print(struct in6_addr *, int, char *, int);
@@ -108,28 +108,21 @@ void inet6print(struct in6_addr *, int, char *, int);
* -a (all) flag is specified.
*/
void
-protopr(off, name)
- u_long off;
- char *name;
+protopr(u_long off, char *name)
{
protopr0(off, name, AF_INET);
}
#ifdef INET6
void
-ip6protopr(off, name)
- u_long off;
- char *name;
+ip6protopr(u_long off, char *name)
{
protopr0(off, name, AF_INET6);
}
#endif
static void
-protopr0(off, name, af)
- u_long off;
- char *name;
- int af;
+protopr0(u_long off, char *name, int af)
{
struct inpcbtable table;
struct inpcb *head, *next, *prev;
@@ -210,20 +203,20 @@ protopr0(off, name, af)
name = name0;
#endif
printf("%-5.5s %6ld %6ld ", name, sockb.so_rcv.sb_cc,
- sockb.so_snd.sb_cc);
+ sockb.so_snd.sb_cc);
#ifdef INET6
if (inpcb.inp_flags & INP_IPV6) {
inet6print(&inpcb.inp_laddr6, (int)inpcb.inp_lport,
- name, 1);
+ name, 1);
inet6print(&inpcb.inp_faddr6, (int)inpcb.inp_fport,
- name, 0);
+ name, 0);
} else
#endif
{
inetprint(&inpcb.inp_laddr, (int)inpcb.inp_lport,
- name, 1);
+ name, 1);
inetprint(&inpcb.inp_faddr, (int)inpcb.inp_fport,
- name, 0);
+ name, 0);
}
if (istcp) {
if (tcpcb.t_state < 0 || tcpcb.t_state >= TCP_NSTATES)
@@ -239,15 +232,13 @@ protopr0(off, name, af)
* Dump TCP statistics structure.
*/
void
-tcp_stats(off, name)
- u_long off;
- char *name;
+tcp_stats(u_long off, char *name)
{
struct tcpstat tcpstat;
if (off == 0)
return;
- printf ("%s:\n", name);
+ printf("%s:\n", name);
kread(off, (char *)&tcpstat, sizeof (tcpstat));
#define p(f, m) if (tcpstat.f || sflag <= 1) \
@@ -338,9 +329,7 @@ tcp_stats(off, name)
* Dump UDP statistics structure.
*/
void
-udp_stats(off, name)
- u_long off;
- char *name;
+udp_stats(u_long off, char *name)
{
struct udpstat udpstat;
u_long delivered;
@@ -381,9 +370,7 @@ udp_stats(off, name)
* Dump IP statistics structure.
*/
void
-ip_stats(off, name)
- u_long off;
- char *name;
+ip_stats(u_long off, char *name)
{
struct ipstat ipstat;
@@ -458,9 +445,7 @@ static char *icmpnames[] = {
* Dump ICMP statistics.
*/
void
-icmp_stats(off, name)
- u_long off;
- char *name;
+icmp_stats(u_long off, char *name)
{
struct icmpstat icmpstat;
int i, first;
@@ -506,9 +491,7 @@ icmp_stats(off, name)
* Dump IGMP statistics structure.
*/
void
-igmp_stats(off, name)
- u_long off;
- char *name;
+igmp_stats(u_long off, char *name)
{
struct igmpstat igmpstat;
@@ -543,9 +526,7 @@ struct rpcnams {
};
char *
-getrpcportnam(port, proto)
- in_port_t port;
- int proto;
+getrpcportnam(in_port_t port, int proto)
{
struct sockaddr_in server_addr;
struct hostent *hp;
@@ -612,11 +593,7 @@ getrpcportnam(port, proto)
* If the nflag was specified, use numbers instead of names.
*/
void
-inetprint(in, port, proto, local)
- struct in_addr *in;
- in_port_t port;
- char *proto;
- int local;
+inetprint(struct in_addr *in, in_port_t port, char *proto, int local)
{
struct servent *sp = 0;
char line[80], *cp, *nam;
@@ -646,8 +623,7 @@ inetprint(in, port, proto, local)
* numeric value, otherwise try for symbolic name.
*/
char *
-inetname(inp)
- struct in_addr *inp;
+inetname(struct in_addr *inp)
{
char *cp;
static char line[50];
@@ -702,9 +678,7 @@ inetname(inp)
* Dump AH statistics structure.
*/
void
-ah_stats(off, name)
- u_long off;
- char *name;
+ah_stats(u_long off, char *name)
{
struct ahstat ahstat;
@@ -745,9 +719,7 @@ ah_stats(off, name)
* Dump etherip statistics structure.
*/
void
-etherip_stats(off, name)
- u_long off;
- char *name;
+etherip_stats(u_long off, char *name)
{
struct etheripstat etheripstat;
@@ -759,7 +731,6 @@ etherip_stats(off, name)
#define p(f, m) if (etheripstat.f || sflag <= 1) \
printf(m, etheripstat.f, plural(etheripstat.f))
-
p(etherip_hdrops, "\t%u packet%s shorter than header shows\n");
p(etherip_qfull, "\t%u packet%s were dropped due to full output queue\n");
p(etherip_noifdrops, "\t%u packet%s were dropped because of no interface/bridge information\n");
@@ -776,9 +747,7 @@ etherip_stats(off, name)
* Dump ESP statistics structure.
*/
void
-esp_stats(off, name)
- u_long off;
- char *name;
+esp_stats(u_long off, char *name)
{
struct espstat espstat;
@@ -817,9 +786,7 @@ esp_stats(off, name)
* Dump ESP statistics structure.
*/
void
-ipip_stats(off, name)
- u_long off;
- char *name;
+ipip_stats(u_long off, char *name)
{
struct ipipstat ipipstat;
@@ -839,8 +806,8 @@ ipip_stats(off, name)
p(ipips_qfull, "\t%u packet%s were dropped due to full output queue\n");
p(ipips_ibytes, "\t%qu input byte%s\n");
p(ipips_obytes, "\t%qu output byte%s\n");
- p(ipips_family, "\t%u protocol family mismatches\n");
- p(ipips_unspec, "\t%u attempts to use tunnel with unspecified endpoint(s)\n");
+ p(ipips_family, "\t%u protocol family mismatche%s\n");
+ p(ipips_unspec, "\t%u attempt%s to use tunnel with unspecified endpoint(s)\n");
#undef p
}
@@ -848,9 +815,7 @@ ipip_stats(off, name)
* Dump IPCOMP statistics structure.
*/
void
-ipcomp_stats(off, name)
- u_long off;
- char *name;
+ipcomp_stats(u_long off, char *name)
{
struct ipcompstat ipcompstat;
diff --git a/usr.bin/netstat/inet6.c b/usr.bin/netstat/inet6.c
index e8a863cc401..be54955a356 100644
--- a/usr.bin/netstat/inet6.c
+++ b/usr.bin/netstat/inet6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet6.c,v 1.24 2002/10/26 18:56:53 itojun Exp $ */
+/* $OpenBSD: inet6.c,v 1.25 2003/02/01 01:51:31 deraadt Exp $ */
/* BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp */
/*
* Copyright (c) 1983, 1988, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)inet.c 8.4 (Berkeley) 4/20/94";
#else
-/*__RCSID("$OpenBSD: inet6.c,v 1.24 2002/10/26 18:56:53 itojun Exp $");*/
+/*__RCSID("$OpenBSD: inet6.c,v 1.25 2003/02/01 01:51:31 deraadt Exp $");*/
/*__RCSID("KAME Id: inet6.c,v 1.10 2000/02/09 10:49:31 itojun Exp");*/
#endif
#endif /* not lint */
@@ -346,9 +346,7 @@ static char *ip6nh[] = {
* Dump IP6 statistics structure.
*/
void
-ip6_stats(off, name)
- u_long off;
- char *name;
+ip6_stats(u_long off, char *name)
{
struct ip6stat ip6stat;
int first, i;
@@ -510,8 +508,7 @@ ip6_stats(off, name)
* Dump IPv6 per-interface statistics based on RFC 2465.
*/
void
-ip6_ifstats(ifname)
- char *ifname;
+ip6_ifstats(char *ifname)
{
struct in6_ifreq ifr;
int s;
@@ -828,9 +825,7 @@ static char *icmp6names[] = {
* Dump ICMPv6 statistics.
*/
void
-icmp6_stats(off, name)
- u_long off;
- char *name;
+icmp6_stats(u_long off, char *name)
{
struct icmp6stat icmp6stat;
int i, first;
@@ -857,7 +852,7 @@ icmp6_stats(off, name)
first = 0;
}
printf("\t\t%s: %llu\n", icmp6names[i],
- (unsigned long long)icmp6stat.icp6s_outhist[i]);
+ (unsigned long long)icmp6stat.icp6s_outhist[i]);
}
p(icp6s_badcode, "\t%llu message%s with bad code fields\n");
p(icp6s_tooshort, "\t%llu message%s < minimum length\n");
@@ -870,7 +865,7 @@ icmp6_stats(off, name)
first = 0;
}
printf("\t\t%s: %llu\n", icmp6names[i],
- (unsigned long long)icmp6stat.icp6s_inhist[i]);
+ (unsigned long long)icmp6stat.icp6s_inhist[i]);
}
printf("\tHistogram of error messages to be generated:\n");
p_5(icp6s_odst_unreach_noroute, "\t\t%llu no route\n");
@@ -904,8 +899,7 @@ icmp6_stats(off, name)
* Dump ICMPv6 per-interface statistics based on RFC 2466.
*/
void
-icmp6_ifstats(ifname)
- char *ifname;
+icmp6_ifstats(char *ifname)
{
struct in6_ifreq ifr;
int s;
@@ -972,9 +966,7 @@ icmp6_ifstats(ifname)
* Dump PIM statistics structure.
*/
void
-pim6_stats(off, name)
- u_long off;
- char *name;
+pim6_stats(u_long off, char *name)
{
struct pim6stat pim6stat;
@@ -1000,9 +992,7 @@ pim6_stats(off, name)
* Dump raw ip6 statistics structure.
*/
void
-rip6_stats(off, name)
- u_long off;
- char *name;
+rip6_stats(u_long off, char *name)
{
struct rip6stat rip6stat;
u_quad_t delivered;
@@ -1039,20 +1029,18 @@ rip6_stats(off, name)
*/
void
-inet6print(in6, port, proto)
- struct in6_addr *in6;
- int port;
- char *proto;
+inet6print(struct in6_addr *in6, int port, char *proto)
{
-#define GETSERVBYPORT6(port, proto, ret)\
-do {\
- if (strcmp((proto), "tcp6") == 0)\
- (ret) = getservbyport((int)(port), "tcp");\
- else if (strcmp((proto), "udp6") == 0)\
- (ret) = getservbyport((int)(port), "udp");\
- else\
- (ret) = getservbyport((int)(port), (proto));\
-} while (0)
+
+#define GETSERVBYPORT6(port, proto, ret) do { \
+ if (strcmp((proto), "tcp6") == 0) \
+ (ret) = getservbyport((int)(port), "tcp"); \
+ else if (strcmp((proto), "udp6") == 0) \
+ (ret) = getservbyport((int)(port), "udp"); \
+ else \
+ (ret) = getservbyport((int)(port), (proto)); \
+ } while (0)
+
struct servent *sp = 0;
char line[80], *cp;
int width;
@@ -1081,8 +1069,7 @@ do {\
*/
char *
-inet6name(in6p)
- struct in6_addr *in6p;
+inet6name(struct in6_addr *in6p)
{
char *cp;
static char line[NI_MAXHOST];
@@ -1145,8 +1132,7 @@ inet6name(in6p)
* Dump the contents of a TCP6 PCB.
*/
void
-tcp6_dump(pcbaddr)
- u_long pcbaddr;
+tcp6_dump(u_long pcbaddr)
{
struct tcp6cb tcp6cb;
int i;
diff --git a/usr.bin/netstat/ipx.c b/usr.bin/netstat/ipx.c
index 566457d0a03..5780e8daaae 100644
--- a/usr.bin/netstat/ipx.c
+++ b/usr.bin/netstat/ipx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipx.c,v 1.12 2002/06/09 04:07:10 jsyn Exp $ */
+/* $OpenBSD: ipx.c,v 1.13 2003/02/01 01:51:31 deraadt Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from: @(#)ns.c 8.1 (Berkeley) 6/6/93";
#else
-static char *rcsid = "$OpenBSD: ipx.c,v 1.12 2002/06/09 04:07:10 jsyn Exp $";
+static char *rcsid = "$OpenBSD: ipx.c,v 1.13 2003/02/01 01:51:31 deraadt Exp $";
#endif
#endif /* not lint */
@@ -78,7 +78,9 @@ struct spxpcb spxpcb;
struct socket sockb;
static char *ipx_prpr(struct ipx_addr *);
+#ifdef IPXERRORMSGS
static void ipx_erputil(int, int);
+#endif
static int first = 1;
@@ -90,9 +92,7 @@ static int first = 1;
*/
void
-ipxprotopr(off, name)
- u_long off;
- char *name;
+ipxprotopr(u_long off, char *name)
{
struct ipxpcbtable table;
struct ipxpcb *head, *prev, *next;
@@ -164,9 +164,7 @@ ipxprotopr(off, name)
* Dump SPX statistics structure.
*/
void
-spx_stats(off, name)
- u_long off;
- char *name;
+spx_stats(u_long off, char *name)
{
struct spx_istat spx_istat;
#define spxstat spx_istat.newstats
@@ -242,9 +240,7 @@ spx_stats(off, name)
* Dump IPX statistics structure.
*/
void
-ipx_stats(off, name)
- u_long off;
- char *name;
+ipx_stats(u_long off, char *name)
{
struct ipxstat ipxstat;
@@ -263,15 +259,15 @@ static struct {
char *name;
char *where;
} ipx_errnames[] = {
- {0, "Unspecified Error", " at Destination"},
- {1, "Bad Checksum", " at Destination"},
- {2, "No Listener", " at Socket"},
- {3, "Packet", " Refused due to lack of space at Destination"},
- {01000, "Unspecified Error", " while gatewayed"},
- {01001, "Bad Checksum", " while gatewayed"},
- {01002, "Packet", " forwarded too many times"},
- {01003, "Packet", " too large to be forwarded"},
- {-1, 0, 0},
+ { 0, "Unspecified Error", " at Destination" },
+ { 1, "Bad Checksum", " at Destination" },
+ { 2, "No Listener", " at Socket" },
+ { 3, "Packet", " Refused due to lack of space at Destination" },
+ { 01000, "Unspecified Error", " while gatewayed" },
+ { 01001, "Bad Checksum", " while gatewayed" },
+ { 01002, "Packet", " forwarded too many times" },
+ { 01003, "Packet", " too large to be forwarded" },
+ { -1, 0, 0 },
};
/*
@@ -279,9 +275,7 @@ static struct {
*/
/*ARGSUSED*/
void
-ipxerr_stats(off, name)
- u_long off;
- char *name;
+ipxerr_stats(u_long off, char *name)
{
struct ipx_errstat ipx_errstat;
int j;
@@ -322,8 +316,7 @@ ipxerr_stats(off, name)
}
static void
-ipx_erputil(z, c)
- int z, c;
+ipx_erputil(int z, int c)
{
int j;
char codebuf[30];
@@ -349,11 +342,10 @@ ipx_erputil(z, c)
}
#endif /* IPXERRORMSGS */
-static struct sockaddr_ipx ssipx = {AF_IPX};
+static struct sockaddr_ipx ssipx = { AF_IPX };
static char *
-ipx_prpr(x)
- struct ipx_addr *x;
+ipx_prpr(struct ipx_addr *x)
{
struct sockaddr_ipx *sipx = &ssipx;
diff --git a/usr.bin/netstat/iso.c b/usr.bin/netstat/iso.c
index 1052741457a..f07d08bcb8a 100644
--- a/usr.bin/netstat/iso.c
+++ b/usr.bin/netstat/iso.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iso.c,v 1.10 2002/05/27 01:50:36 deraadt Exp $ */
+/* $OpenBSD: iso.c,v 1.11 2003/02/01 01:51:31 deraadt Exp $ */
/* $NetBSD: iso.c,v 1.12 1995/10/03 21:42:38 thorpej Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from: @(#)iso.c 8.1 (Berkeley) 6/6/93";
#else
-static char *rcsid = "$OpenBSD: iso.c,v 1.10 2002/05/27 01:50:36 deraadt Exp $";
+static char *rcsid = "$OpenBSD: iso.c,v 1.11 2003/02/01 01:51:31 deraadt Exp $";
#endif
#endif /* not lint */
@@ -120,9 +120,7 @@ extern void inetprint(struct in_addr *, int, char *);
* Dump esis stats
*/
void
-esis_stats(off, name)
- u_long off;
- char *name;
+esis_stats(u_long off, char *name)
{
struct esis_stat esis_stat;
@@ -149,9 +147,7 @@ esis_stats(off, name)
* Dump clnp statistics structure.
*/
void
-clnp_stats(off, name)
- u_long off;
- char *name;
+clnp_stats(u_long off, char *name)
{
struct clnp_stat clnp_stat;
@@ -184,9 +180,7 @@ clnp_stats(off, name)
* Dump CLTP statistics structure.
*/
void
-cltp_stats(off, name)
- u_long off;
- char *name;
+cltp_stats(u_long off, char *name)
{
struct cltpstat cltpstat;
@@ -220,9 +214,7 @@ static int first = 1;
* -a (all) flag is specified.
*/
void
-iso_protopr(off, name)
- u_long off;
- char *name;
+iso_protopr(u_long off, char *name)
{
struct isopcb cb;
struct isopcb *prev, *next;
@@ -257,9 +249,7 @@ iso_protopr(off, name)
}
void
-iso_protopr1(kern_addr, istp)
- u_long kern_addr;
- int istp;
+iso_protopr1(u_long kern_addr, int istp)
{
if (first) {
printf("Active ISO net connections");
@@ -284,10 +274,10 @@ iso_protopr1(kern_addr, istp)
printf("%-5.5s %6ld %6ld ", "tp", sockb.so_rcv.sb_cc,
sockb.so_snd.sb_cc);
if (istp && tpcb.tp_lsuffixlen) {
- hexprint(tpcb.tp_lsuffixlen, tpcb.tp_lsuffix, "()");
- printf("\t");
+ hexprint(tpcb.tp_lsuffixlen, tpcb.tp_lsuffix, "()");
+ printf("\t");
} else if (isopcb.isop_laddr == 0)
- printf("*.*\t");
+ printf("*.*\t");
else {
if ((char *)isopcb.isop_laddr == ((char *)kern_addr) +
_offsetof(struct isopcb, isop_sladdr))
@@ -312,9 +302,7 @@ iso_protopr1(kern_addr, istp)
}
void
-tp_protopr(off, name)
- u_long off;
- char *name;
+tp_protopr(u_long off, char *name)
{
extern char *tp_sstring[];
struct tp_ref *tpr, *tpr_base;
@@ -358,8 +346,7 @@ tp_protopr(off, name)
}
void
-tp_inproto(pcb)
- u_long pcb;
+tp_inproto(u_long pcb)
{
struct inpcb inpcb;
@@ -381,8 +368,7 @@ tp_inproto(pcb)
#ifdef notdef
char *
-isonetname(iso)
- struct iso_addr *iso;
+isonetname(struct iso_addr *iso)
{
struct sockaddr_iso sa;
struct iso_hostent *ihe = 0;
@@ -413,11 +399,7 @@ isonetname(iso)
}
static void
-isonetprint(iso, sufx, sufxlen, islocal)
- struct iso_addr *iso;
- char *sufx;
- u_short sufxlen;
- int islocal;
+isonetprint(struct iso_addr *iso, char *sufx, u_short sufxlen, int islocal)
{
struct iso_hostent *iso_getserventrybytsel(), *ihe;
struct iso_hostent Ihe;
@@ -457,9 +439,6 @@ isonetprint(iso, sufx, sufxlen, islocal)
}
} else
snprintf(cp, line + sizeof line - cp, "*");
- /*
- fprintf(stdout, Aflag?" %-18.18s":" %-22.22s", line);
- */
if (strlen(line) > Alen ) {
fprintf(stdout, " %s", line);
@@ -472,9 +451,7 @@ isonetprint(iso, sufx, sufxlen, islocal)
#ifdef notdef
static void
-x25_protopr(off, name)
- u_long off;
- char *name;
+x25_protopr(u_long off, char *name)
{
static char *xpcb_states[] = {
"CLOSED",
@@ -546,8 +523,7 @@ x25_protopr(off, name)
struct tp_stat tp_stat;
void
-tp_stats(off, name)
- caddr_t off, name;
+tp_stats(caddr_t off, char *name)
{
if (off == 0) {
printf("TP not configured\n\n");
@@ -561,9 +537,7 @@ tp_stats(off, name)
#define OUT stdout
static void
-tprintstat(s, indent)
- struct tp_stat *s;
- int indent;
+tprintstat(struct tp_stat *s, int indent)
{
fprintf(OUT,
"%*sReceiving:\n",indent," ");
@@ -806,9 +780,7 @@ tprintstat(s, indent)
#endif
static void
-isonetprint(siso, islocal)
- struct sockaddr_iso *siso;
- int islocal;
+isonetprint(struct sockaddr_iso *siso, int islocal)
{
hexprint(siso->siso_nlen, siso->siso_addr.isoa_genaddr, "{}");
if (siso->siso_tlen || siso->siso_slen || siso->siso_plen)
@@ -823,9 +795,7 @@ isonetprint(siso, islocal)
static char hexlist[] = "0123456789abcdef", obuf[128];
static void
-hexprint(n, buf, delim)
- int n;
- char *buf, *delim;
+hexprint(int n, char *buf, char *delim)
{
u_char *in = (u_char *)buf, *top = in + n;
char *out = obuf;
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index 9ec0f2be798..f5abb9f8e99 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.33 2002/08/04 16:52:07 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.34 2003/02/01 01:51:31 deraadt Exp $ */
/* $NetBSD: main.c,v 1.9 1996/05/07 02:55:02 thorpej Exp $ */
/*
@@ -44,7 +44,7 @@ char copyright[] =
#if 0
static char sccsid[] = "from: @(#)main.c 8.4 (Berkeley) 3/1/94";
#else
-static char *rcsid = "$OpenBSD: main.c,v 1.33 2002/08/04 16:52:07 deraadt Exp $";
+static char *rcsid = "$OpenBSD: main.c,v 1.34 2003/02/01 01:51:31 deraadt Exp $";
#endif
#endif /* not lint */
@@ -274,9 +274,13 @@ struct protox atalkprotox[] = {
};
#ifndef INET6
-struct protox *protoprotox[] = { protox, ipxprotox, nsprotox, isoprotox, atalkprotox, NULL };
+struct protox *protoprotox[] = {
+ protox, ipxprotox, nsprotox, isoprotox, atalkprotox, NULL
+};
#else
-struct protox *protoprotox[] = { protox, ip6protox, ipxprotox, nsprotox, isoprotox, atalkprotox, NULL };
+struct protox *protoprotox[] = {
+ protox, ip6protox, ipxprotox, nsprotox, isoprotox, atalkprotox, NULL
+};
#endif
static void printproto(struct protox *, char *);
@@ -287,9 +291,7 @@ static struct protox *knownname(char *);
kvm_t *kvmd;
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
extern char *optarg;
extern int optind;
@@ -545,9 +547,7 @@ main(argc, argv)
* is not in the namelist, ignore this one.
*/
static void
-printproto(tp, name)
- struct protox *tp;
- char *name;
+printproto(struct protox *tp, char *name)
{
void (*pr)();
u_long off;
@@ -567,10 +567,7 @@ printproto(tp, name)
* Read kernel memory, return 0 on success.
*/
int
-kread(addr, buf, size)
- u_long addr;
- char *buf;
- int size;
+kread(u_long addr, char *buf, int size)
{
if (kvm_read(kvmd, addr, buf, size) != size) {
@@ -582,15 +579,13 @@ kread(addr, buf, size)
}
char *
-plural(n)
- int n;
+plural(int n)
{
return (n != 1 ? "s" : "");
}
char *
-plurales(n)
- int n;
+plurales(int n)
{
return (n != 1 ? "es" : "");
}
@@ -599,8 +594,7 @@ plurales(n)
* Find the protox for the given "well-known" name.
*/
static struct protox *
-knownname(name)
- char *name;
+knownname(char *name)
{
struct protox **tpp, *tp;
@@ -615,8 +609,7 @@ knownname(name)
* Find the protox corresponding to name.
*/
static struct protox *
-name2protox(name)
- char *name;
+name2protox(char *name)
{
struct protox *tp;
char **alias; /* alias from p->aliases */
@@ -643,7 +636,7 @@ name2protox(name)
}
static void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"usage: %s [-Aan] [-f address_family] [-M core] [-N system]\n", __progname);
diff --git a/usr.bin/netstat/mbuf.c b/usr.bin/netstat/mbuf.c
index 5c813dc8ae1..5295d9148c0 100644
--- a/usr.bin/netstat/mbuf.c
+++ b/usr.bin/netstat/mbuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mbuf.c,v 1.16 2002/06/30 20:27:16 angelos Exp $ */
+/* $OpenBSD: mbuf.c,v 1.17 2003/02/01 01:51:31 deraadt Exp $ */
/* $NetBSD: mbuf.c,v 1.9 1996/05/07 02:55:03 thorpej Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from: @(#)mbuf.c 8.1 (Berkeley) 6/6/93";
#else
-static char *rcsid = "$OpenBSD: mbuf.c,v 1.16 2002/06/30 20:27:16 angelos Exp $";
+static char *rcsid = "$OpenBSD: mbuf.c,v 1.17 2003/02/01 01:51:31 deraadt Exp $";
#endif
#endif /* not lint */
@@ -54,6 +54,7 @@ static char *rcsid = "$OpenBSD: mbuf.c,v 1.16 2002/06/30 20:27:16 angelos Exp $"
#include <limits.h>
#include <stdio.h>
#include <string.h>
+#include <unistd.h>
#include "netstat.h"
#define YES 1
@@ -85,9 +86,7 @@ bool seen[256]; /* "have we seen this type yet?" */
* Print mbuf statistics.
*/
void
-mbpr(mbaddr, mbpooladdr, mclpooladdr)
- u_long mbaddr;
- u_long mbpooladdr, mclpooladdr;
+mbpr(u_long mbaddr, u_long mbpooladdr, u_long mclpooladdr)
{
int totmem, totused, totmbufs, totpct;
int i, mib[4], npools, flag = 0;
diff --git a/usr.bin/netstat/mroute.c b/usr.bin/netstat/mroute.c
index 6a457dde995..c5b66c503ee 100644
--- a/usr.bin/netstat/mroute.c
+++ b/usr.bin/netstat/mroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mroute.c,v 1.8 2002/06/02 15:49:05 itojun Exp $ */
+/* $OpenBSD: mroute.c,v 1.9 2003/02/01 01:51:31 deraadt Exp $ */
/* $NetBSD: mroute.c,v 1.10 1996/05/11 13:51:27 mycroft Exp $ */
/*
@@ -65,8 +65,7 @@
#include "netstat.h"
char *
-pktscale(n)
- u_long n;
+pktscale(u_long n)
{
static char buf[8];
char t;
@@ -86,8 +85,7 @@ pktscale(n)
}
void
-mroutepr(mrpaddr, mfchashtbladdr, mfchashaddr, vifaddr)
- u_long mrpaddr, mfchashtbladdr, mfchashaddr, vifaddr;
+mroutepr(u_long mrpaddr, u_long mfchashtbladdr, u_long mfchashaddr, u_long vifaddr)
{
u_int mrtproto;
LIST_HEAD(, mfc) *mfchashtbl;
@@ -206,8 +204,7 @@ mroutepr(mrpaddr, mfchashtbladdr, mfchashaddr, vifaddr)
void
-mrt_stats(mrpaddr, mstaddr)
- u_long mrpaddr, mstaddr;
+mrt_stats(u_long mrpaddr, u_long mstaddr)
{
u_int mrtproto;
struct mrtstat mrtstat;
diff --git a/usr.bin/netstat/mroute6.c b/usr.bin/netstat/mroute6.c
index 51b994e3df4..fcc3af6efed 100644
--- a/usr.bin/netstat/mroute6.c
+++ b/usr.bin/netstat/mroute6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mroute6.c,v 1.5 2002/06/02 01:30:24 deraadt Exp $ */
+/* $OpenBSD: mroute6.c,v 1.6 2003/02/01 01:51:31 deraadt Exp $ */
/*
* Copyright (C) 1998 WIDE Project.
@@ -91,21 +91,15 @@
#define WID_GRP (lflag ? 18 : (nflag ? 16 : 18)) /* width of group column */
void
-mroute6pr(mrpaddr, mfcaddr, mifaddr)
- u_long mrpaddr, mfcaddr, mifaddr;
+mroute6pr(u_long mrpaddr, u_long mfcaddr, u_long mifaddr)
{
- u_int mrtproto;
+ int banner_printed, saved_nflag, waitings, i;
struct mf6c *mf6ctable[MF6CTBLSIZ], *mfcp;
- struct mif6 mif6table[MAXMIFS];
- struct mf6c mfc;
+ struct mif6 mif6table[MAXMIFS], *mifp;
struct rtdetq rte, *rtep;
- struct mif6 *mifp;
- mifi_t mifi;
- int i;
- int banner_printed;
- int saved_nflag;
- mifi_t maxmif = 0;
- int waitings;
+ mifi_t maxmif = 0, mifi;
+ struct mf6c mfc;
+ u_int mrtproto;
if (mrpaddr == 0) {
printf("mroute6pr: symbol not in namelist\n");
@@ -124,7 +118,7 @@ mroute6pr(mrpaddr, mfcaddr, mifaddr)
default:
printf("IPv6 multicast routing protocol %u, unknown\n",
- mrtproto);
+ mrtproto);
return;
}
@@ -217,11 +211,10 @@ mroute6pr(mrpaddr, mfcaddr, mifaddr)
}
void
-mrt6_stats(mrpaddr, mstaddr)
- u_long mrpaddr, mstaddr;
+mrt6_stats(u_long mrpaddr, u_long mstaddr)
{
- u_int mrtproto;
struct mrt6stat mrtstat;
+ u_int mrtproto;
if (mrpaddr == 0) {
printf("mrt6_stats: symbol not in namelist\n");
@@ -259,7 +252,7 @@ mrt6_stats(mrpaddr, mstaddr)
printf(" %10qu upcall queue overflow%s\n",
mrtstat.mrt6s_upq_ovflw, plural(mrtstat.mrt6s_upq_ovflw));
printf(" %10qu upcall%s dropped due to full socket buffer\n",
- mrtstat.mrt6s_upq_sockfull, plural(mrtstat.mrt6s_upq_sockfull));
+ mrtstat.mrt6s_upq_sockfull, plural(mrtstat.mrt6s_upq_sockfull));
printf(" %10qu cache cleanup%s\n",
mrtstat.mrt6s_cache_cleanups, plural(mrtstat.mrt6s_cache_cleanups));
printf(" %10qu datagram%s with no route for origin\n",
diff --git a/usr.bin/netstat/ns.c b/usr.bin/netstat/ns.c
index ff231d46dab..6eba9fb387d 100644
--- a/usr.bin/netstat/ns.c
+++ b/usr.bin/netstat/ns.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ns.c,v 1.9 2002/06/09 04:07:10 jsyn Exp $ */
+/* $OpenBSD: ns.c,v 1.10 2003/02/01 01:51:31 deraadt Exp $ */
/* $NetBSD: ns.c,v 1.8 1995/10/03 21:42:46 thorpej Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from: @(#)ns.c 8.1 (Berkeley) 6/6/93";
#else
-static char *rcsid = "$OpenBSD: ns.c,v 1.9 2002/06/09 04:07:10 jsyn Exp $";
+static char *rcsid = "$OpenBSD: ns.c,v 1.10 2003/02/01 01:51:31 deraadt Exp $";
#endif
#endif /* not lint */
@@ -89,9 +89,7 @@ static int first = 1;
*/
void
-nsprotopr(off, name)
- u_long off;
- char *name;
+nsprotopr(u_long off, char *name)
{
struct nspcb cb;
struct nspcb *prev, *next;
@@ -134,16 +132,16 @@ nsprotopr(off, name)
if (Aflag)
printf("%-8.8s ", "PCB");
printf(Aflag ?
- "%-5.5s %-6.6s %-6.6s %-18.18s %-18.18s %s\n" :
- "%-5.5s %-6.6s %-6.6s %-22.22s %-22.22s %s\n",
- "Proto", "Recv-Q", "Send-Q",
- "Local Address", "Foreign Address", "(state)");
+ "%-5.5s %-6.6s %-6.6s %-18.18s %-18.18s %s\n" :
+ "%-5.5s %-6.6s %-6.6s %-22.22s %-22.22s %s\n",
+ "Proto", "Recv-Q", "Send-Q",
+ "Local Address", "Foreign Address", "(state)");
first = 0;
}
if (Aflag)
printf("%8lx ", ppcb);
printf("%-5.5s %6ld %6ld ", name, sockb.so_rcv.sb_cc,
- sockb.so_snd.sb_cc);
+ sockb.so_snd.sb_cc);
printf(" %-22.22s", ns_prpr(&nspcb.nsp_laddr));
printf(" %-22.22s", ns_prpr(&nspcb.nsp_faddr));
if (isspp) {
@@ -164,9 +162,7 @@ nsprotopr(off, name)
* Dump SPP statistics structure.
*/
void
-spp_stats(off, name)
- u_long off;
- char *name;
+spp_stats(u_long off, char *name)
{
struct spp_istat spp_istat;
#define sppstat spp_istat.newstats
@@ -247,9 +243,7 @@ spp_stats(off, name)
* Dump IDP statistics structure.
*/
void
-idp_stats(off, name)
- u_long off;
- char *name;
+idp_stats(u_long off, char *name)
{
struct idpstat idpstat;
@@ -283,9 +277,7 @@ static struct {
*/
/*ARGSUSED*/
void
-nserr_stats(off, name)
- u_long off;
- char *name;
+nserr_stats(u_long off, char *name)
{
struct ns_errstat ns_errstat;
int j;
@@ -326,12 +318,11 @@ nserr_stats(off, name)
}
static void
-ns_erputil(z, c)
- int z, c;
+ns_erputil(int z, int c)
{
- int j;
- char codebuf[30];
char *name, *where;
+ char codebuf[30];
+ int j;
for (j = 0;; j ++) {
if ((name = ns_errnames[j].name) == 0)
@@ -355,8 +346,7 @@ ns_erputil(z, c)
static struct sockaddr_ns ssns = {AF_NS};
static
-char *ns_prpr(x)
- struct ns_addr *x;
+char *ns_prpr(struct ns_addr *x)
{
struct sockaddr_ns *sns = &ssns;
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c
index 7a685d95e81..720360cc123 100644
--- a/usr.bin/netstat/route.c
+++ b/usr.bin/netstat/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.49 2002/09/23 17:48:46 deraadt Exp $ */
+/* $OpenBSD: route.c,v 1.50 2003/02/01 01:51:31 deraadt Exp $ */
/* $NetBSD: route.c,v 1.15 1996/05/07 02:55:06 thorpej Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94";
#else
-static char *rcsid = "$OpenBSD: route.c,v 1.49 2002/09/23 17:48:46 deraadt Exp $";
+static char *rcsid = "$OpenBSD: route.c,v 1.50 2003/02/01 01:51:31 deraadt Exp $";
#endif
#endif /* not lint */
@@ -142,8 +142,7 @@ static void encap_print(struct rtentry *);
* Print routing tables.
*/
void
-routepr(rtree)
- u_long rtree;
+routepr(u_long rtree)
{
struct radix_node_head *rnh, head;
int i;
@@ -185,8 +184,7 @@ routepr(rtree)
* Print address family header before a section of the routing table.
*/
void
-pr_family(af)
- int af;
+pr_family(int af)
{
char *afname;
@@ -248,8 +246,7 @@ pr_family(af)
* Print header for routing table columns.
*/
void
-pr_rthdr(af)
- int af;
+pr_rthdr(int af)
{
if (Aflag)
@@ -264,7 +261,7 @@ pr_rthdr(af)
* Print header for PF_KEY entries.
*/
void
-pr_encaphdr()
+pr_encaphdr(void)
{
if (Aflag)
printf("%-*s ", PLEN, "Address");
@@ -274,8 +271,7 @@ pr_encaphdr()
}
static struct sockaddr *
-kgetsa(dst)
- struct sockaddr *dst;
+kgetsa(struct sockaddr *dst)
{
kget(dst, pt_u.u_sa);
@@ -285,8 +281,7 @@ kgetsa(dst)
}
static void
-p_tree(rn)
- struct radix_node *rn;
+p_tree(struct radix_node *rn)
{
again:
@@ -341,7 +336,7 @@ p_rtflags(u_char flags)
char nbuf[25];
static void
-p_rtnode()
+p_rtnode(void)
{
struct radix_mask *rm = rnode.rn_mklist;
@@ -386,7 +381,7 @@ p_rtnode()
}
static void
-ntreestuff()
+ntreestuff(void)
{
size_t needed;
int mib[6];
@@ -419,8 +414,7 @@ ntreestuff()
}
static void
-np_rtentry(rtm)
- struct rt_msghdr *rtm;
+np_rtentry(struct rt_msghdr *rtm)
{
struct sockaddr *sa = (struct sockaddr *)(rtm + 1);
#ifdef notdef
@@ -459,9 +453,7 @@ np_rtentry(rtm)
}
static void
-p_sockaddr(sa, mask, flags, width)
- struct sockaddr *sa, *mask;
- int flags, width;
+p_sockaddr(struct sockaddr *sa, struct sockaddr *mask, int flags, int width)
{
char workbuf[128], *cplim;
char *cp = workbuf;
@@ -603,9 +595,7 @@ p_sockaddr(sa, mask, flags, width)
}
static void
-p_flags(f, format)
- int f;
- char *format;
+p_flags(int f, char *format)
{
char name[33], *flags;
struct bits *p = bits;
@@ -618,8 +608,7 @@ p_flags(f, format)
}
static void
-p_rtentry(rt)
- struct rtentry *rt;
+p_rtentry(struct rtentry *rt)
{
static struct ifnet ifnet, *lastif;
struct sockaddr_storage sock1, sock2;
@@ -657,7 +646,7 @@ p_rtentry(rt)
lastif = rt->rt_ifp;
}
printf(" %.16s%s", ifnet.if_xname,
- rt->rt_nodes[0].rn_dupedkey ? " =>" : "");
+ rt->rt_nodes[0].rn_dupedkey ? " =>" : "");
}
putchar('\n');
if (vflag) {
@@ -681,8 +670,7 @@ p_rtentry(rt)
}
char *
-routename(in)
- in_addr_t in;
+routename(in_addr_t in)
{
char *cp;
static char line[MAXHOSTNAMELEN];
@@ -725,8 +713,7 @@ routename(in)
* The address is assumed to be that of a net or subnet, not a host.
*/
char *
-netname(in, mask)
- in_addr_t in, mask;
+netname(in_addr_t in, in_addr_t mask)
{
char *cp = 0;
static char line[MAXHOSTNAMELEN];
@@ -758,9 +745,7 @@ netname(in, mask)
#ifdef INET6
char *
-netname6(sa6, mask)
- struct sockaddr_in6 *sa6;
- struct in6_addr *mask;
+netname6(struct sockaddr_in6 *sa6, struct in6_addr *mask)
{
static char line[MAXHOSTNAMELEN + 1];
struct sockaddr_in6 sin6;
@@ -856,8 +841,7 @@ netname6(sa6, mask)
}
char *
-routename6(sa6)
- struct sockaddr_in6 *sa6;
+routename6(struct sockaddr_in6 *sa6)
{
static char line[NI_MAXHOST];
#ifdef NI_WITHSCOPEID
@@ -876,8 +860,7 @@ routename6(sa6)
* Print routing statistics
*/
void
-rt_stats(off)
- u_long off;
+rt_stats(u_long off)
{
struct rtstat rtstat;
@@ -903,8 +886,7 @@ short ns_nullh[] = {0,0,0};
short ns_bh[] = {-1,-1,-1};
char *
-ns_print(sa)
- struct sockaddr *sa;
+ns_print(struct sockaddr *sa)
{
struct sockaddr_ns *sns = (struct sockaddr_ns*)sa;
struct ns_addr work;
@@ -952,8 +934,7 @@ ns_print(sa)
}
char *
-ns_phost(sa)
- struct sockaddr *sa;
+ns_phost(struct sockaddr *sa)
{
struct sockaddr_ns *sns = (struct sockaddr_ns *)sa;
struct sockaddr_ns work;
@@ -974,8 +955,7 @@ u_short ipx_nullh[] = {0,0,0};
u_short ipx_bh[] = {0xffff,0xffff,0xffff};
char *
-ipx_print(sa)
- struct sockaddr *sa;
+ipx_print(struct sockaddr *sa)
{
struct sockaddr_ipx *sipx = (struct sockaddr_ipx*)sa;
struct ipx_addr work;
@@ -1020,8 +1000,7 @@ ipx_print(sa)
}
char *
-ipx_phost(sa)
- struct sockaddr *sa;
+ipx_phost(struct sockaddr *sa)
{
struct sockaddr_ipx *sipx = (struct sockaddr_ipx *)sa;
struct sockaddr_ipx work;
@@ -1039,15 +1018,13 @@ ipx_phost(sa)
}
static void
-encap_print(rt)
- struct rtentry *rt;
+encap_print(struct rtentry *rt)
{
struct sockaddr_encap sen1, sen2, sen3;
struct ipsec_policy ipo;
#ifdef INET6
struct sockaddr_in6 s61, s62;
- char ip6addr[64];
#endif /* INET6 */
bcopy(kgetsa(rt_key(rt)), &sen1, sizeof(sen1));
@@ -1138,8 +1115,7 @@ encap_print(rt)
}
void
-upHex(p0)
- char *p0;
+upHex(char *p0)
{
char *p = p0;
diff --git a/usr.bin/netstat/unix.c b/usr.bin/netstat/unix.c
index 63cc2c43014..5f69eedb3e1 100644
--- a/usr.bin/netstat/unix.c
+++ b/usr.bin/netstat/unix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: unix.c,v 1.8 2002/02/16 21:27:50 millert Exp $ */
+/* $OpenBSD: unix.c,v 1.9 2003/02/01 01:51:31 deraadt Exp $ */
/* $NetBSD: unix.c,v 1.13 1995/10/03 21:42:48 thorpej Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from: @(#)unix.c 8.1 (Berkeley) 6/6/93";
#else
-static char *rcsid = "$OpenBSD: unix.c,v 1.8 2002/02/16 21:27:50 millert Exp $";
+static char *rcsid = "$OpenBSD: unix.c,v 1.9 2003/02/01 01:51:31 deraadt Exp $";
#endif
#endif /* not lint */
@@ -73,8 +73,7 @@ static int nfiles;
extern kvm_t *kvmd;
void
-unixpr(off)
- u_long off;
+unixpr(u_long off)
{
struct file *fp;
struct socket sock, *so = &sock;
@@ -104,9 +103,7 @@ static char *socktype[] =
{ "#0", "stream", "dgram", "raw", "rdm", "seqpacket" };
static void
-unixdomainpr(so, soaddr)
- struct socket *so;
- caddr_t soaddr;
+unixdomainpr(struct socket *so, caddr_t soaddr)
{
struct unpcb unpcb, *unp = &unpcb;
struct mbuf mbuf, *m;