aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDavid Greenman <dg@FreeBSD.org>1995-07-30 00:42:55 +0000
committerDavid Greenman <dg@FreeBSD.org>1995-07-30 00:42:55 +0000
commit25f52744ef2545192e6eceb5151c960c3bf64c7d (patch)
tree14685154f81c387021c20a268dc2092fbc74931d /usr.bin
parent8e899d16d21588d9faca029456abef98b1db1f42 (diff)
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/netstat/if.c24
-rw-r--r--usr.bin/netstat/inet.c24
-rw-r--r--usr.bin/netstat/main.c2
3 files changed, 32 insertions, 18 deletions
diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c
index b6566812287c9..f6257403825fe 100644
--- a/usr.bin/netstat/if.c
+++ b/usr.bin/netstat/if.c
@@ -340,19 +340,19 @@ loop:
continue;
}
if (ip == interesting) {
- printf("%8d %5d ",
+ printf("%8u %5u ",
ifnet.if_ipackets - ip->ift_ip,
ifnet.if_ierrors - ip->ift_ie);
if (bflag)
- printf("%10d ", ifnet.if_ibytes - ip->ift_ib);
- printf("%8d %5d ",
+ printf("%10u ", ifnet.if_ibytes - ip->ift_ib);
+ printf("%8u %5u ",
ifnet.if_opackets - ip->ift_op,
ifnet.if_oerrors - ip->ift_oe);
if (bflag)
- printf("%10d ", ifnet.if_obytes - ip->ift_ob);
- printf("%5d", ifnet.if_collisions - ip->ift_co);
+ printf("%10u ", ifnet.if_obytes - ip->ift_ob);
+ printf("%5u", ifnet.if_collisions - ip->ift_co);
if (dflag)
- printf(" %5d",
+ printf(" %5u",
ifnet.if_snd.ifq_drops - ip->ift_dr);
}
ip->ift_ip = ifnet.if_ipackets;
@@ -374,19 +374,19 @@ loop:
off = (u_long) ifnet.if_next;
}
if (lastif - iftot > 0) {
- printf(" %8d %5d",
+ printf(" %8u %5u",
sum->ift_ip - total->ift_ip,
sum->ift_ie - total->ift_ie);
if (bflag)
- printf(" %10d", sum->ift_ib - total->ift_ib);
- printf(" %8d %5d",
+ printf(" %10u", sum->ift_ib - total->ift_ib);
+ printf(" %8u %5u",
sum->ift_op - total->ift_op,
sum->ift_oe - total->ift_oe);
if (bflag)
- printf(" %10d", sum->ift_ob - total->ift_ob);
- printf(" %5d", sum->ift_co - total->ift_co);
+ printf(" %10u", sum->ift_ob - total->ift_ob);
+ printf(" %5u", sum->ift_co - total->ift_co);
if (dflag)
- printf(" %5d", sum->ift_dr - total->ift_dr);
+ printf(" %5u", sum->ift_dr - total->ift_dr);
}
*total = *sum;
putchar('\n');
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c
index 3b342bb3d8f44..ae61b8ff17cb0 100644
--- a/usr.bin/netstat/inet.c
+++ b/usr.bin/netstat/inet.c
@@ -100,16 +100,25 @@ protopr(off, name)
prev = (struct inpcb *)off;
for (next = head.lh_first; next != NULL; next = inpcb.inp_list.le_next) {
- kread((u_long)next, (char *)&inpcb, sizeof (inpcb));
+ if (kread((u_long)next, (char *)&inpcb, sizeof (inpcb))) {
+ printf("???\n");
+ break;
+ }
if (!aflag &&
inet_lnaof(inpcb.inp_laddr) == INADDR_ANY) {
prev = next;
continue;
}
- kread((u_long)inpcb.inp_socket, (char *)&sockb, sizeof (sockb));
+ if (kread((u_long)inpcb.inp_socket, (char *)&sockb, sizeof (sockb))) {
+ printf("???\n");
+ break;
+ };
if (istcp) {
- kread((u_long)inpcb.inp_ppcb,
- (char *)&tcpcb, sizeof (tcpcb));
+ if (kread((u_long)inpcb.inp_ppcb,
+ (char *)&tcpcb, sizeof (tcpcb))) {
+ printf("???\n");
+ break;
+ };
}
if (first) {
printf("Active Internet connections");
@@ -210,18 +219,23 @@ tcp_stats(off, name)
p(tcps_connects, "\t%d connection%s established (including accepts)\n");
p2(tcps_closed, tcps_drops,
"\t%d connection%s closed (including %d drop%s)\n");
+ p(tcps_cachedrtt, "\t\t%d connection%s updated cached RTT on close\n");
+ p(tcps_cachedrttvar,
+ "\t\t%d connection%s updated cached RTT variance on close\n");
+ p(tcps_cachedssthresh,
+ "\t\t%d connection%s updated cached ssthresh on close\n");
p(tcps_conndrops, "\t%d embryonic connection%s dropped\n");
p2(tcps_rttupdated, tcps_segstimed,
"\t%d segment%s updated rtt (of %d attempt%s)\n");
p(tcps_rexmttimeo, "\t%d retransmit timeout%s\n");
p(tcps_timeoutdrop, "\t\t%d connection%s dropped by rexmit timeout\n");
p(tcps_persisttimeo, "\t%d persist timeout%s\n");
+ p(tcps_persistdrop, "\t\t%d connection%s dropped by persist timeout\n");
p(tcps_keeptimeo, "\t%d keepalive timeout%s\n");
p(tcps_keepprobe, "\t\t%d keepalive probe%s sent\n");
p(tcps_keepdrops, "\t\t%d connection%s dropped by keepalive\n");
p(tcps_predack, "\t%d correct ACK header prediction%s\n");
p(tcps_preddat, "\t%d correct data packet header prediction%s\n");
- p3(tcps_pcbcachemiss, "\t%d PCB cache miss%s\n");
#undef p
#undef p2
#undef p3
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index 5e59f374047cb..5be02cbe1b457 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -431,7 +431,7 @@ kread(addr, buf, size)
{
if (kvm_read(kvmd, addr, buf, size) != size) {
- warnx("kvm_read: %s", kvm_geterr(kvmd));
+ warnx("%s", kvm_geterr(kvmd));
return (-1);
}
return (0);