remove K&R support

This commit is contained in:
assar 2001-06-15 23:35:13 +00:00
parent 16333bcfca
commit ee746c97f9
15 changed files with 200 additions and 337 deletions

View File

@ -155,8 +155,7 @@ static char mybuf[50];
/* 4 for port */
/* 8 for numeric only */
char *
atalk_print(sa,what)
register struct sockaddr *sa;
atalk_print(struct sockaddr *sa, int what)
{
struct sockaddr_at *sat = (struct sockaddr_at *)sa;
static char mybuf[50];
@ -213,9 +212,7 @@ atalk_print2(struct sockaddr *sa, struct sockaddr *mask, int what)
}
void
atalkprotopr(off, name)
u_long off;
char *name;
atalkprotopr(u_long off, char *name)
{
struct ddpcb *this, *next;
@ -264,9 +261,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;

View File

@ -76,11 +76,11 @@ static const char rcsid[] =
#define YES 1
#define NO 0
static void sidewaysintpr __P((u_int, u_long));
static void catchalarm __P((int));
static void sidewaysintpr (u_int, u_long);
static void catchalarm (int);
#ifdef INET6
char *netname6 __P((struct sockaddr_in6 *, struct in6_addr *));
char *netname6 (struct sockaddr_in6 *, struct in6_addr *);
static char ntop_buf[INET6_ADDRSTRLEN]; /* for inet_ntop() */
static int bdg_done;
#endif
@ -131,12 +131,8 @@ bdg_stats(u_long dummy, char *name) /* print bridge statistics */
/*
* Display a formatted value, or a '-' in the same space.
*/
void
show_stat(fmt, width, value, showvalue)
char *fmt;
int width;
u_long value;
short showvalue;
static void
show_stat(char *fmt, int width, u_long value, short showvalue)
{
char newfmt[32];
@ -156,10 +152,7 @@ show_stat(fmt, width, value, showvalue)
* Print a description of the network interfaces.
*/
void
intpr(interval, ifnetaddr, pfunc)
int interval;
u_long ifnetaddr;
void (*pfunc)(char *);
intpr(int interval, u_long ifnetaddr, void (*pfunc)(char *))
{
struct ifnet ifnet;
struct ifnethead ifnethead;
@ -514,9 +507,7 @@ u_char signalled; /* set if alarm goes off "early" */
* XXX - should be rewritten to use ifmib(4).
*/
static void
sidewaysintpr(interval, off)
unsigned interval;
u_long off;
sidewaysintpr(unsigned interval, u_long off)
{
struct ifnet ifnet;
u_long firstifnet;
@ -679,8 +670,7 @@ sidewaysintpr(interval, off)
* Sets a flag to not wait for the alarm.
*/
static void
catchalarm(signo)
int signo;
catchalarm(int signo)
{
signalled = YES;
}

View File

@ -80,10 +80,10 @@ static const char rcsid[] =
#include <unistd.h>
#include "netstat.h"
char *inetname __P((struct in_addr *));
void inetprint __P((struct in_addr *, int, char *, int));
char *inetname (struct in_addr *);
void inetprint (struct in_addr *, int, char *, int);
#ifdef INET6
extern void inet6print __P((struct in6_addr *, int, char *, int));
extern void inet6print (struct in6_addr *, int, char *, int);
static int udp_done, tcp_done;
#endif /* INET6 */
@ -94,10 +94,8 @@ static int udp_done, tcp_done;
* -a (all) flag is specified.
*/
void
protopr(proto, name, af)
u_long proto; /* for sysctl version we pass proto # */
char *name;
int af;
protopr(u_long proto, /* for sysctl version we pass proto # */
char *name, int af)
{
int istcp;
static int first = 1;
@ -348,9 +346,7 @@ protopr(proto, 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;
size_t len = sizeof tcpstat;
@ -448,9 +444,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;
size_t len = sizeof udpstat;
@ -501,9 +495,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;
size_t len = sizeof ipstat;
@ -583,9 +575,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;
@ -651,9 +641,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;
size_t len = sizeof igmpstat;
@ -686,11 +674,7 @@ igmp_stats(off, name)
* Pretty print an Internet address (net address + port).
*/
void
inetprint(in, port, proto, numeric_port)
register struct in_addr *in;
int port;
char *proto;
int numeric_port;
inetprint(struct in_addr *in, int port, char *proto, int numeric_port)
{
struct servent *sp = 0;
char line[80], *cp;
@ -720,8 +704,7 @@ inetprint(in, port, proto, numeric_port)
* numeric value, otherwise try for symbolic name.
*/
char *
inetname(inp)
struct in_addr *inp;
inetname(struct in_addr *inp)
{
register char *cp;
static char line[MAXHOSTNAMELEN];

View File

@ -72,8 +72,8 @@ static char sccsid[] = "@(#)inet6.c 8.4 (Berkeley) 4/20/94";
struct socket sockb;
char *inet6name __P((struct in6_addr *));
void inet6print __P((struct in6_addr *, int, char *, int));
char *inet6name (struct in6_addr *);
void inet6print (struct in6_addr *, int, char *, int);
static char ntop_buf[INET6_ADDRSTRLEN];
@ -340,9 +340,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;
@ -494,8 +492,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;
@ -810,9 +807,7 @@ static char *icmp6names[] = {
* Dump ICMP6 statistics.
*/
void
icmp6_stats(off, name)
u_long off;
char *name;
icmp6_stats(u_long off, char *name)
{
struct icmp6stat icmp6stat;
register int i, first;
@ -885,8 +880,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;
@ -951,9 +945,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;
@ -978,9 +970,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;
@ -1035,11 +1025,7 @@ rip6_stats(off, name)
};
void
inet6print(in6, port, proto, numeric)
register struct in6_addr *in6;
int port;
char *proto;
int numeric;
inet6print(struct in6_addr *in6, int port, char *proto, int numeric)
{
struct servent *sp = 0;
char line[80], *cp;
@ -1065,8 +1051,7 @@ inet6print(in6, port, proto, numeric)
*/
char *
inet6name(in6p)
struct in6_addr *in6p;
inet6name(struct in6_addr *in6p)
{
register char *cp;
static char line[50];

View File

@ -159,21 +159,20 @@ static const char *pfkey_msgtypenames[] = {
static struct ipsecstat ipsecstat;
static void print_ipsecstats __P((void));
static const char *pfkey_msgtype_names __P((int));
static void ipsec_hist __P((const u_quad_t *, size_t, const struct val2str *,
size_t, const char *));
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 *);
/*
* Dump IPSEC statistics structure.
*/
static void
ipsec_hist(hist, histmax, name, namemax, title)
const u_quad_t *hist;
size_t histmax;
const struct val2str *name;
size_t namemax;
const char *title;
ipsec_hist(const u_quad_t *hist,
size_t histmax,
const struct val2str *name,
size_t namemax,
const char *title)
{
int first;
size_t proto;
@ -201,7 +200,7 @@ ipsec_hist(hist, histmax, name, namemax, title)
}
static void
print_ipsecstats()
print_ipsecstats(void)
{
#define p(f, m) if (ipsecstat.f || sflag <= 1) \
printf(m, (CAST)ipsecstat.f, plural(ipsecstat.f))
@ -238,9 +237,7 @@ print_ipsecstats()
}
void
ipsec_stats(off, name)
u_long off;
char *name;
ipsec_stats(u_long off, char *name)
{
if (off == 0)
return;
@ -251,8 +248,7 @@ ipsec_stats(off, name)
}
static const char *
pfkey_msgtype_names(x)
int x;
pfkey_msgtype_names(int x)
{
const int max =
sizeof(pfkey_msgtypenames)/sizeof(pfkey_msgtypenames[0]);
@ -265,9 +261,7 @@ pfkey_msgtype_names(x)
}
void
pfkey_stats(off, name)
u_long off;
char *name;
pfkey_stats(u_long off, char *name)
{
struct pfkeystat pfkeystat;
int first, type;

View File

@ -71,7 +71,7 @@ struct ipxpcb ipxpcb;
struct spxpcb spxpcb;
struct socket sockb;
static char *ipx_prpr __P((struct ipx_addr *));
static char *ipx_prpr (struct ipx_addr *);
static int first = 1;
@ -83,9 +83,7 @@ static int first = 1;
*/
void
ipxprotopr(off, name)
u_long off;
char *name;
ipxprotopr(u_long off, char *name)
{
struct ipxpcb cb;
register struct ipxpcb *prev, *next;
@ -161,9 +159,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
@ -239,9 +235,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;
@ -284,9 +278,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;
register int j;
@ -326,8 +318,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];
@ -355,8 +346,7 @@ ipx_erputil(z, c)
static struct sockaddr_ipx ssipx = {AF_IPX};
static
char *ipx_prpr(x)
struct ipx_addr *x;
char *ipx_prpr(struct ipx_addr *x)
{
struct sockaddr_ipx *sipx = &ssipx;

View File

@ -106,18 +106,16 @@ SOFTWARE.
#include <stdlib.h>
#include "netstat.h"
static void tprintstat __P((struct tp_stat *, int));
static void isonetprint __P((struct sockaddr_iso *, int));
static void hexprint __P((int, char *, char *));
extern void inetprint __P((struct in_addr *, int, char *));
static void tprintstat (struct tp_stat *, int);
static void isonetprint (struct sockaddr_iso *, int);
static void hexprint (int, char *, char *);
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;
@ -144,9 +142,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;
@ -179,9 +175,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;
@ -215,9 +209,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;
register struct isopcb *prev, *next;
@ -252,9 +244,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");
@ -303,9 +293,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;
@ -349,8 +337,7 @@ tp_protopr(off, name)
}
void
tp_inproto(pcb)
u_long pcb;
tp_inproto(u_long pcb)
{
struct inpcb inpcb;
kget(tpcb.tp_npcb, inpcb);
@ -372,8 +359,7 @@ tp_inproto(pcb)
#ifdef notdef
char *
isonetname(iso)
register struct iso_addr *iso;
isonetname(struct iso_addr *iso)
{
struct sockaddr_iso sa;
struct iso_hostent *ihe = 0;
@ -404,11 +390,7 @@ isonetname(iso)
}
static void
isonetprint(iso, sufx, sufxlen, islocal)
register 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;
@ -462,9 +444,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",
@ -533,8 +513,7 @@ x25_protopr(off, name)
struct tp_stat tp_stat;
void
tp_stats(off, name)
caddr_t off, name;
tp_stats(caddr_t off, caddr_t name)
{
if (off == 0) {
printf("TP not configured\n\n");
@ -548,9 +527,7 @@ tp_stats(off, name)
#define OUT stdout
static void
tprintstat(s, indent)
register struct tp_stat *s;
int indent;
tprintstat(struct tp_stat *s, int indent)
{
fprintf(OUT,
"%*sReceiving:\n",indent," ");
@ -800,9 +777,7 @@ tprintstat(s, indent)
#endif
static void
isonetprint(siso, islocal)
register 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)
@ -817,9 +792,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)
{
register u_char *in = (u_char *)buf, *top = in + n;
register char *out = obuf;

View File

@ -160,9 +160,11 @@ struct protox {
u_char pr_index; /* index into nlist of cb head */
u_char pr_sindex; /* index into nlist of stat block */
u_char pr_wanted; /* 1 if wanted, 0 otherwise */
void (*pr_cblocks)(); /* control blocks printing routine */
void (*pr_stats)(); /* statistics printing routine */
void (*pr_istats)(); /* per/if statistics printing routine */
void (*pr_cblocks)(u_long, char *, int);
/* control blocks printing routine */
void (*pr_stats)(u_long, char *, int);
/* statistics printing routine */
void (*pr_istats)(char *); /* per/if statistics printing routine */
char *pr_name; /* well-known name */
int pr_usesysctl; /* true if we use sysctl, not kvm */
} protox[] = {
@ -294,10 +296,10 @@ struct protox *protoprotox[] = {
#endif
NULL };
static void printproto __P((struct protox *, char *));
static void usage __P((void));
static struct protox *name2protox __P((char *));
static struct protox *knownname __P((char *));
static void printproto (struct protox *, char *);
static void usage (void);
static struct protox *name2protox (char *);
static struct protox *knownname (char *);
static kvm_t *kvmd;
static char *nlistf = NULL, *memf = NULL;
@ -653,10 +655,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 (kvmd == 0) {
/*
@ -693,15 +692,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" : "");
}
@ -710,8 +707,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;
@ -726,8 +722,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 */
@ -754,7 +749,7 @@ name2protox(name)
}
static void
usage()
usage(void)
{
(void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n",
"usage: netstat [-AaLlnW] [-f address_family] [-M core] [-N system]",

View File

@ -94,8 +94,7 @@ static struct mbtypenames {
* Print mbuf statistics.
*/
void
mbpr(mbaddr, mbtaddr, nmbcaddr, nmbufaddr)
u_long mbaddr, mbtaddr, nmbcaddr, nmbufaddr;
mbpr(u_long mbaddr, u_long mbtaddr, u_long nmbcaddr, u_long nmbufaddr)
{
u_long totmem, totpossible, totmbufs;
register int i;

View File

@ -67,8 +67,7 @@ static const char rcsid[] =
#include "netstat.h"
void
mroutepr(mfcaddr, vifaddr)
u_long mfcaddr, vifaddr;
mroutepr(u_long mfcaddr, u_long vifaddr)
{
struct mfc *mfctable[MFCTBLSIZ];
struct vif viftable[MAXVIFS];
@ -150,8 +149,7 @@ mroutepr(mfcaddr, vifaddr)
void
mrt_stats(mstaddr)
u_long mstaddr;
mrt_stats(u_long mstaddr)
{
struct mrtstat mrtstat;

View File

@ -91,11 +91,10 @@
#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 __P((struct sockaddr_in6 *));
extern char *routename6 (struct sockaddr_in6 *);
void
mroute6pr(mfcaddr, mifaddr)
u_long mfcaddr, mifaddr;
mroute6pr(u_long mfcaddr, u_long mifaddr)
{
struct mf6c *mf6ctable[MF6CTBLSIZ], *mfcp;
struct mif6 mif6table[MAXMIFS];
@ -196,8 +195,7 @@ mroute6pr(mfcaddr, mifaddr)
}
void
mrt6_stats(mstaddr)
u_long mstaddr;
mrt6_stats(u_long mstaddr)
{
struct mrt6stat mrtstat;

View File

@ -59,91 +59,91 @@ extern int unit; /* unit number for above */
extern int af; /* address family */
int kread __P((u_long addr, char *buf, int size));
char *plural __P((int));
char *plurales __P((int));
int kread (u_long addr, char *buf, int size);
char *plural (int);
char *plurales (int);
void protopr __P((u_long, char *, int));
void tcp_stats __P((u_long, char *));
void udp_stats __P((u_long, char *));
void ip_stats __P((u_long, char *));
void icmp_stats __P((u_long, char *));
void igmp_stats __P((u_long, char *));
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 *);
#ifdef IPSEC
void ipsec_stats __P((u_long, char *));
void ipsec_stats (u_long, char *);
#endif
#ifdef INET6
void ip6_stats __P((u_long, char *));
void ip6_ifstats __P((char *));
void icmp6_stats __P((u_long, char *));
void icmp6_ifstats __P((char *));
void pim6_stats __P((u_long, char *));
void rip6_stats __P((u_long, char *));
void mroute6pr __P((u_long, u_long));
void mrt6_stats __P((u_long));
void ip6_stats (u_long, char *);
void ip6_ifstats (char *);
void icmp6_stats (u_long, char *);
void icmp6_ifstats (char *);
void pim6_stats (u_long, char *);
void rip6_stats (u_long, char *);
void mroute6pr (u_long, u_long);
void mrt6_stats (u_long);
struct sockaddr_in6;
struct in6_addr;
char *routename6 __P((struct sockaddr_in6 *));
char *netname6 __P((struct sockaddr_in6 *, struct in6_addr *));
char *routename6 (struct sockaddr_in6 *);
char *netname6 (struct sockaddr_in6 *, struct in6_addr *);
#endif /*INET6*/
#ifdef IPSEC
void pfkey_stats __P((u_long, char *));
void pfkey_stats (u_long, char *);
#endif
void bdg_stats __P((u_long, char *));
void bdg_stats (u_long, char *);
void mbpr __P((u_long, u_long, u_long, u_long));
void mbpr (u_long, u_long, u_long, u_long);
void hostpr __P((u_long, u_long));
void impstats __P((u_long, u_long));
void hostpr (u_long, u_long);
void impstats (u_long, u_long);
void intpr __P((int, u_long, void (*) __P((char *))));
void intpr (int, u_long, void (*)(char *));
void pr_rthdr __P((int));
void pr_family __P((int));
void rt_stats __P((u_long));
char *ipx_pnet __P((struct sockaddr *));
char *ipx_phost __P((struct sockaddr *));
char *ns_phost __P((struct sockaddr *));
void upHex __P((char *));
void pr_rthdr (int);
void pr_family (int);
void rt_stats (u_long);
char *ipx_pnet (struct sockaddr *);
char *ipx_phost (struct sockaddr *);
char *ns_phost (struct sockaddr *);
void upHex (char *);
char *routename __P((u_long));
char *netname __P((u_long, u_long));
char *atalk_print __P((struct sockaddr *, int));
char *atalk_print2 __P((struct sockaddr *, struct sockaddr *, int));
char *ipx_print __P((struct sockaddr *));
char *ns_print __P((struct sockaddr *));
void routepr __P((u_long));
char *routename (u_long);
char *netname (u_long, u_long);
char *atalk_print (struct sockaddr *, int);
char *atalk_print2 (struct sockaddr *, struct sockaddr *, int);
char *ipx_print (struct sockaddr *);
char *ns_print (struct sockaddr *);
void routepr (u_long);
void ipxprotopr __P((u_long, char *));
void spx_stats __P((u_long, char *));
void ipx_stats __P((u_long, char *));
void ipxerr_stats __P((u_long, char *));
void ipxprotopr (u_long, char *);
void spx_stats (u_long, char *);
void ipx_stats (u_long, char *);
void ipxerr_stats (u_long, char *);
void nsprotopr __P((u_long, char *));
void spp_stats __P((u_long, char *));
void idp_stats __P((u_long, char *));
void nserr_stats __P((u_long, char *));
void nsprotopr (u_long, char *);
void spp_stats (u_long, char *);
void idp_stats (u_long, char *);
void nserr_stats (u_long, char *);
void atalkprotopr __P((u_long, char *));
void ddp_stats __P((u_long, char *));
void atalkprotopr (u_long, char *);
void ddp_stats (u_long, char *);
void netgraphprotopr __P((u_long, char *));
void netgraphprotopr (u_long, char *);
void unixpr __P((void));
void unixpr (void);
void esis_stats __P((u_long, char *));
void clnp_stats __P((u_long, char *));
void cltp_stats __P((u_long, char *));
void iso_protopr __P((u_long, char *));
void iso_protopr1 __P((u_long, int));
void tp_protopr __P((u_long, char *));
void tp_inproto __P((u_long));
void tp_stats __P((caddr_t, caddr_t));
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 iso_protopr1 (u_long, int);
void tp_protopr (u_long, char *);
void tp_inproto (u_long);
void tp_stats (caddr_t, caddr_t);
void mroutepr __P((u_long, u_long));
void mrt_stats __P((u_long));
void mroutepr (u_long, u_long);
void mrt_stats (u_long);

View File

@ -72,8 +72,8 @@ struct nspcb nspcb;
struct sppcb sppcb;
struct socket sockb;
static char *ns_prpr __P((struct ns_addr *));
static void ns_erputil __P((int, int));
static char *ns_prpr (struct ns_addr *);
static void ns_erputil (int, int);
static int first = 1;
@ -85,9 +85,7 @@ static int first = 1;
*/
void
nsprotopr(off, name)
u_long off;
char *name;
nsprotopr(u_long off, char *name)
{
struct nspcb cb;
register struct nspcb *prev, *next;
@ -160,9 +158,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
@ -238,9 +234,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;
@ -274,9 +268,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;
register int j;
@ -317,8 +309,7 @@ nserr_stats(off, name)
}
static void
ns_erputil(z, c)
int z, c;
ns_erputil(int z, int c)
{
int j;
char codebuf[30];
@ -345,8 +336,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;

View File

@ -124,28 +124,27 @@ struct radix_node_head *rt_tables[AF_MAX+1];
int NewTree = 0;
static struct sockaddr *kgetsa __P((struct sockaddr *));
static void p_tree __P((struct radix_node *));
static void p_rtnode __P((void));
static void ntreestuff __P((void));
static void np_rtentry __P((struct rt_msghdr *));
static void p_sockaddr __P((struct sockaddr *, struct sockaddr *, int, int));
static void p_flags __P((int, char *));
static void p_rtentry __P((struct rtentry *));
static u_long forgemask __P((u_long));
static void domask __P((char *, u_long, u_long));
static struct sockaddr *kgetsa (struct sockaddr *);
static void p_tree (struct radix_node *);
static void p_rtnode (void);
static void ntreestuff (void);
static void np_rtentry (struct rt_msghdr *);
static void p_sockaddr (struct sockaddr *, struct sockaddr *, int, int);
static void p_flags (int, char *);
static void p_rtentry (struct rtentry *);
static u_long forgemask (u_long);
static void domask (char *, u_long, u_long);
#ifdef INET6
char *routename6 __P((struct sockaddr_in6 *));
char *netname6 __P((struct sockaddr_in6 *, struct in6_addr *));
char *routename6 (struct sockaddr_in6 *);
char *netname6 (struct sockaddr_in6 *, struct in6_addr *);
#endif /*INET6*/
/*
* Print routing tables.
*/
void
routepr(rtree)
u_long rtree;
routepr(u_long rtree)
{
struct radix_node_head *rnh, head;
int i;
@ -184,8 +183,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;
@ -245,8 +243,7 @@ pr_family(af)
* Print header for routing table columns.
*/
void
pr_rthdr(af)
int af;
pr_rthdr(int af)
{
if (Aflag)
@ -272,8 +269,7 @@ pr_rthdr(af)
}
static struct sockaddr *
kgetsa(dst)
register struct sockaddr *dst;
kgetsa(struct sockaddr *dst)
{
kget(dst, pt_u.u_sa);
@ -283,8 +279,7 @@ kgetsa(dst)
}
static void
p_tree(rn)
struct radix_node *rn;
p_tree(struct radix_node *rn)
{
again:
@ -322,7 +317,7 @@ p_tree(rn)
char nbuf[20];
static void
p_rtnode()
p_rtnode(void)
{
struct radix_mask *rm = rnode.rn_mklist;
@ -359,7 +354,7 @@ p_rtnode()
}
static void
ntreestuff()
ntreestuff(void)
{
size_t needed;
int mib[6];
@ -390,8 +385,7 @@ ntreestuff()
}
static void
np_rtentry(rtm)
register struct rt_msghdr *rtm;
np_rtentry(struct rt_msghdr *rtm)
{
register struct sockaddr *sa = (struct sockaddr *)(rtm + 1);
#ifdef notdef
@ -430,9 +424,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;
register char *cp = workbuf;
@ -573,9 +565,7 @@ p_sockaddr(sa, mask, flags, width)
}
static void
p_flags(f, format)
register int f;
char *format;
p_flags(int f, char *format)
{
char name[33], *flags;
register struct bits *p = bits;
@ -588,8 +578,7 @@ p_flags(f, format)
}
static void
p_rtentry(rt)
register struct rtentry *rt;
p_rtentry(struct rtentry *rt)
{
static struct ifnet ifnet, *lastif;
struct rtentry parent;
@ -656,8 +645,7 @@ ifandkey:;
}
char *
routename(in)
u_long in;
routename(u_long in)
{
register char *cp;
static char line[MAXHOSTNAMELEN];
@ -685,8 +673,7 @@ routename(in)
}
static u_long
forgemask(a)
u_long a;
forgemask(u_long a)
{
u_long m;
@ -700,9 +687,7 @@ forgemask(a)
}
static void
domask(dst, addr, mask)
char *dst;
u_long addr, mask;
domask(char *dst, u_long addr, u_long mask)
{
register int b, i;
@ -734,8 +719,7 @@ domask(dst, addr, mask)
* The address is assumed to be that of a net or subnet, not a host.
*/
char *
netname(in, mask)
u_long in, mask;
netname(u_long in, u_long mask)
{
char *cp = 0;
static char line[MAXHOSTNAMELEN];
@ -791,9 +775,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];
u_char *p = (u_char *)mask;
@ -855,8 +837,7 @@ netname6(sa6, mask)
}
char *
routename6(sa6)
struct sockaddr_in6 *sa6;
routename6(struct sockaddr_in6 *sa6)
{
static char line[MAXHOSTNAMELEN];
int flag = NI_WITHSCOPEID;
@ -880,8 +861,7 @@ routename6(sa6)
* Print routing statistics
*/
void
rt_stats(off)
u_long off;
rt_stats(u_long off)
{
struct rtstat rtstat;
@ -904,8 +884,7 @@ rt_stats(off)
}
char *
ipx_print(sa)
register struct sockaddr *sa;
ipx_print(struct sockaddr *sa)
{
u_short port;
struct servent *sp = 0;
@ -974,8 +953,7 @@ ipx_print(sa)
}
char *
ipx_phost(sa)
struct sockaddr *sa;
ipx_phost(struct sockaddr *sa)
{
register struct sockaddr_ipx *sipx = (struct sockaddr_ipx *)sa;
struct sockaddr_ipx work;
@ -999,8 +977,7 @@ short ns_nullh[] = {0,0,0};
short ns_bh[] = {-1,-1,-1};
char *
ns_print(sa)
register struct sockaddr *sa;
ns_print(struct sockaddr *sa)
{
register struct sockaddr_ns *sns = (struct sockaddr_ns*)sa;
struct ns_addr work;
@ -1046,8 +1023,7 @@ ns_print(sa)
}
char *
ns_phost(sa)
struct sockaddr *sa;
ns_phost(struct sockaddr *sa)
{
register struct sockaddr_ns *sns = (struct sockaddr_ns *)sa;
struct sockaddr_ns work;
@ -1066,8 +1042,7 @@ ns_phost(sa)
#endif
void
upHex(p0)
char *p0;
upHex(char *p0)
{
register char *p = p0;

View File

@ -62,13 +62,13 @@ static const char rcsid[] =
#include <kvm.h>
#include "netstat.h"
static void unixdomainpr __P((struct xunpcb *, struct xsocket *));
static void unixdomainpr (struct xunpcb *, struct xsocket *);
static const char *const socktype[] =
{ "#0", "stream", "dgram", "raw", "rdm", "seqpacket" };
void
unixpr()
unixpr(void)
{
char *buf;
int type;
@ -126,9 +126,7 @@ unixpr()
}
static void
unixdomainpr(xunp, so)
struct xunpcb *xunp;
struct xsocket *so;
unixdomainpr(struct xunpcb *xunp, struct xsocket *so)
{
struct unpcb *unp;
struct sockaddr_un *sa;