summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-06-29 20:52:43 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-06-29 20:52:43 +0000
commit943105aef5e4f1338044d35f1376f59f9d03b9c2 (patch)
tree7d7bb6d741b0de590d6840f2a9bcaca63b59830d /usr.bin
parent0b1d6d59b408bc7e5d443a930eb2b59b35d58883 (diff)
Make fields line up nicely for 64-bit addresses. Should probably #if
some things based on sizeof(long).
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/netstat/if.c8
-rw-r--r--usr.bin/netstat/inet.c10
-rw-r--r--usr.bin/netstat/ipx.c8
-rw-r--r--usr.bin/netstat/iso.c12
-rw-r--r--usr.bin/netstat/route.c19
-rw-r--r--usr.bin/netstat/unix.c8
6 files changed, 33 insertions, 32 deletions
diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c
index 9c53caa5f31..2a3589035b3 100644
--- a/usr.bin/netstat/if.c
+++ b/usr.bin/netstat/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.11 1997/06/29 20:17:58 millert Exp $ */
+/* $OpenBSD: if.c,v 1.12 1997/06/29 20:52:39 millert 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.11 1997/06/29 20:17:58 millert Exp $";
+static char *rcsid = "$OpenBSD: if.c,v 1.12 1997/06/29 20:52:39 millert Exp $";
#endif
#endif /* not lint */
@@ -200,7 +200,7 @@ intpr(interval, ifnetaddr)
char netnum[8];
*(union ipx_net *) &net = sipx->sipx_addr.ipx_net;
- sprintf(netnum, "%lxH", ntohl(net));
+ sprintf(netnum, "%xH", ntohl(net));
upHex(netnum);
printf("ipx:%-8s", netnum);
printf("%-17s ",
@@ -215,7 +215,7 @@ intpr(interval, ifnetaddr)
char netnum[8];
*(union ns_net *) &net = sns->sns_addr.x_net;
- sprintf(netnum, "%lxH", ntohl(net));
+ sprintf(netnum, "%xH", ntohl(net));
upHex(netnum);
printf("ns:%-8s ", netnum);
printf("%-17s ",
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c
index 90cd595e61a..8d52d87edc8 100644
--- a/usr.bin/netstat/inet.c
+++ b/usr.bin/netstat/inet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet.c,v 1.16 1997/06/29 20:17:59 millert Exp $ */
+/* $OpenBSD: inet.c,v 1.17 1997/06/29 20:52:39 millert 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.16 1997/06/29 20:17:59 millert Exp $";
+static char *rcsid = "$OpenBSD: inet.c,v 1.17 1997/06/29 20:52:39 millert Exp $";
#endif
#endif /* not lint */
@@ -139,7 +139,7 @@ protopr(off, name)
printf(" (including servers)");
putchar('\n');
if (Aflag)
- printf("%-8.8s ", "PCB");
+ printf("%-18.18s ", "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",
@@ -149,9 +149,9 @@ protopr(off, name)
}
if (Aflag)
if (istcp)
- printf("%8p ", inpcb.inp_ppcb);
+ printf("%18p ", inpcb.inp_ppcb);
else
- printf("%8p ", prev);
+ printf("%18p ", prev);
printf("%-5.5s %6ld %6ld ", name, sockb.so_rcv.sb_cc,
sockb.so_snd.sb_cc);
inetprint(&inpcb.inp_laddr, (int)inpcb.inp_lport, name, 1);
diff --git a/usr.bin/netstat/ipx.c b/usr.bin/netstat/ipx.c
index 960b4b6dd5e..92b1926c3c1 100644
--- a/usr.bin/netstat/ipx.c
+++ b/usr.bin/netstat/ipx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipx.c,v 1.2 1997/06/29 20:18:00 millert Exp $ */
+/* $OpenBSD: ipx.c,v 1.3 1997/06/29 20:52:40 millert 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.2 1997/06/29 20:18:00 millert Exp $";
+static char *rcsid = "$OpenBSD: ipx.c,v 1.3 1997/06/29 20:52:40 millert Exp $";
#endif
#endif /* not lint */
@@ -127,7 +127,7 @@ ipxprotopr(off, name)
printf(" (including servers)");
putchar('\n');
if (Aflag)
- printf("%-8.8s ", "PCB");
+ printf("%-18.18s ", "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",
@@ -136,7 +136,7 @@ ipxprotopr(off, name)
first = 0;
}
if (Aflag)
- printf("%8p ", ipxpcb.ipxp_ppcb);
+ printf("%18p ", ipxpcb.ipxp_ppcb);
printf("%-5.5s %6ld %6ld ", name, sockb.so_rcv.sb_cc,
sockb.so_snd.sb_cc);
printf(" %-22.22s", ipx_prpr(&ipxpcb.ipxp_laddr));
diff --git a/usr.bin/netstat/iso.c b/usr.bin/netstat/iso.c
index f717aaf30f1..e2fe3498359 100644
--- a/usr.bin/netstat/iso.c
+++ b/usr.bin/netstat/iso.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iso.c,v 1.4 1997/06/29 20:18:00 millert Exp $ */
+/* $OpenBSD: iso.c,v 1.5 1997/06/29 20:52:41 millert 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.4 1997/06/29 20:18:00 millert Exp $";
+static char *rcsid = "$OpenBSD: iso.c,v 1.5 1997/06/29 20:52:41 millert Exp $";
#endif
#endif /* not lint */
@@ -244,7 +244,7 @@ iso_protopr(off, name)
next = isopcb.isop_next;
kget(next, isopcb);
if (isopcb.isop_prev != prev) {
- printf("prev 0x%p next 0x%p isop_prev 0x%p isop_next 0x%p???\n",
+ printf("prev %p next %p isop_prev %p isop_next %p???\n",
prev, next, isopcb.isop_prev, isopcb.isop_next);
break;
}
@@ -266,7 +266,7 @@ iso_protopr1(kern_addr, istp)
printf(" (including servers)");
putchar('\n');
if (Aflag)
- printf("%-8.8s ", "PCB");
+ printf("%-18.18s ", "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",
@@ -275,7 +275,7 @@ iso_protopr1(kern_addr, istp)
first = 0;
}
if (Aflag)
- printf("%8p ",
+ printf("%18p ",
(sockb.so_pcb ? (void *)sockb.so_pcb : (void *)kern_addr));
printf("%-5.5s %6ld %6ld ", "tp", sockb.so_rcv.sb_cc,
sockb.so_snd.sb_cc);
@@ -328,7 +328,7 @@ tp_protopr(off, name)
continue;
kget(tpr->tpr_pcb, tpcb);
if (tpcb.tp_state == ST_ERROR)
- printf("undefined tpcb state: 0x%p\n", tpr->tpr_pcb);
+ printf("undefined tpcb state: %p\n", tpr->tpr_pcb);
if (!aflag &&
(tpcb.tp_state == TP_LISTENING ||
tpcb.tp_state == TP_CLOSED ||
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c
index 9db72c71d56..4ff7da9f6d8 100644
--- a/usr.bin/netstat/route.c
+++ b/usr.bin/netstat/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.13 1997/06/29 20:18:03 millert Exp $ */
+/* $OpenBSD: route.c,v 1.14 1997/06/29 20:52:41 millert 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.13 1997/06/29 20:18:03 millert Exp $";
+static char *rcsid = "$OpenBSD: route.c,v 1.14 1997/06/29 20:52:41 millert Exp $";
#endif
#endif /* not lint */
@@ -216,8 +216,8 @@ pr_rthdr()
{
if (Aflag)
- printf("%-8.8s ","Address");
- printf("%-*.*s %-*.*s %-6.6s %6.6s%8.8s %6.6s %s\n",
+ printf("%-18.18s ","Address");
+ printf("%-*.*s %-*.*s %-6.6s %6.6s%16.16s %6.6s %s\n",
WID_DST, WID_DST, "Destination",
WID_GW, WID_GW, "Gateway",
"Flags", "Refs", "Use", "Mtu", "Interface");
@@ -230,7 +230,7 @@ void
pr_encaphdr()
{
if (Aflag)
- printf("%-8s ", "Address");
+ printf("%-18s ", "Address");
printf("%-15s %-15s %-5s %-15s %-15s %-5s %-5s %-15s %-8s %s\n",
"Source address", "Source mask", "Port", "Dest. address",
"Dest. mask", "Port", "Proto", "Tunnel exit",
@@ -257,7 +257,7 @@ again:
kget(rn, rnode);
if (rnode.rn_b < 0) {
if (Aflag)
- printf("%-8.8lx ", rn);
+ printf("%-16p ", rn);
if (rnode.rn_flags & RNF_ROOT) {
if (Aflag)
printf("(root node)%s",
@@ -276,7 +276,7 @@ again:
goto again;
} else {
if (Aflag && do_rtent) {
- printf("%-8.8lx ", rn);
+ printf("%-16p ", rn);
p_rtnode();
}
rn = rnode.rn_r;
@@ -301,12 +301,13 @@ p_rtnode()
return;
} else {
sprintf(nbuf, "(%d)", rnode.rn_b);
- printf("%6.6s %8.8lx : %8.8lx", nbuf, rnode.rn_l, rnode.rn_r);
+ printf("%6.6s %16p : %16p", nbuf, rnode.rn_l,
+ rnode.rn_r);
}
while (rm) {
kget(rm, rmask);
sprintf(nbuf, " %d refs, ", rmask.rm_refs);
- printf(" mk = %8.8lx {(%d),%s",
+ printf(" mk = %16p {(%d),%s",
rm, -1 - rmask.rm_b, rmask.rm_refs ? nbuf : " ");
p_sockaddr(kgetsa((struct sockaddr *)rmask.rm_mask), 0, -1);
putchar('}');
diff --git a/usr.bin/netstat/unix.c b/usr.bin/netstat/unix.c
index 5a8ea6cea61..b097c38a310 100644
--- a/usr.bin/netstat/unix.c
+++ b/usr.bin/netstat/unix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: unix.c,v 1.3 1997/06/29 20:18:04 millert Exp $ */
+/* $OpenBSD: unix.c,v 1.4 1997/06/29 20:52:42 millert 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.3 1997/06/29 20:18:04 millert Exp $";
+static char *rcsid = "$OpenBSD: unix.c,v 1.4 1997/06/29 20:52:42 millert Exp $";
#endif
#endif /* not lint */
@@ -124,12 +124,12 @@ unixdomainpr(so, soaddr)
if (first) {
printf("Active UNIX domain sockets\n");
printf(
-"%-8.8s %-6.6s %-6.6s %-6.6s %8.8s %8.8s %8.8s %8.8s Addr\n",
+"%-18.18s %-6.6s %-6.6s %-6.6s %18.18s %18.18s %18.18s %18.18s Addr\n",
"Address", "Type", "Recv-Q", "Send-Q",
"Inode", "Conn", "Refs", "Nextref");
first = 0;
}
- printf("%8p %-6.6s %6ld %6ld %8p %8p %8p %8p",
+ printf("%18p %-6.6s %6ld %6ld %18p %18p %18p %18p",
soaddr, socktype[so->so_type], so->so_rcv.sb_cc, so->so_snd.sb_cc,
unp->unp_vnode, unp->unp_conn,
unp->unp_refs, unp->unp_nextref);