summaryrefslogtreecommitdiffstats
path: root/usr.bin/systat/tcp.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2006-04-30 04:26:46 +0000
committerbde <bde@FreeBSD.org>2006-04-30 04:26:46 +0000
commit1a769818fed8aac0f389ffe0e1c8b90b88451e87 (patch)
treec9f530dc8f5ab25caea2ee408fe8cb03c131a441 /usr.bin/systat/tcp.c
parentcae6dfae7d6d6411928fcea33679d4f25f07e8be (diff)
downloadFreeBSD-src-1a769818fed8aac0f389ffe0e1c8b90b88451e87.zip
FreeBSD-src-1a769818fed8aac0f389ffe0e1c8b90b88451e87.tar.gz
Show the load average in the tcp display (it was already shown, perhaps
not very usefully, in all other displays). This was the original point of the PR. Move the load average up by 2 so that it starts in row 0 for all windows (2 lines above it were wasted for all other windows except vmstat). Move everything below it up by 2 or 3 (3 for icmp and icmp6 which had an extra blank line due from not compensating for the foot-shooting in note (3); only ip and ip6 compensated). Reduce the magic numbers related to this. Notes by the submitter: %%% 1. All the subwin() calls are identical using #define MAINWIN_ROW 3 (systat.h). 2. The load average is at the top of the window. 3. Each display starts on the fourth line. I made changes to those displays that shifted the start line (i.e., icmp). This entailed a lot of changes within the comments at the top of those displays. 4. For ip6, I shifted the "Input next-header histogram" column down one row to separate it from "IPv6 Output". I raised "bad scope packets" and "address selection failed" up one row to stay with "IPv6 Input" (valid?). They were down one row to probably line up at the bottom, but I think they should stick with their fellow items in a column. 5. I condensed ifstat a bit. It had a lot of empty rows. %%% Submitted by: Se=E1n Farley <sean-freebsd at farley dot org> PR: bin/81874
Diffstat (limited to 'usr.bin/systat/tcp.c')
-rw-r--r--usr.bin/systat/tcp.c122
1 files changed, 61 insertions, 61 deletions
diff --git a/usr.bin/systat/tcp.c b/usr.bin/systat/tcp.c
index 40311d6..a758f15 100644
--- a/usr.bin/systat/tcp.c
+++ b/usr.bin/systat/tcp.c
@@ -70,26 +70,26 @@ static struct tcpstat curstat, initstat, oldstat;
/*-
--0 1 2 3 4 5 6 7
--0123456789012345678901234567890123456789012345678901234567890123456789012345
-01 TCP Connections TCP Packets
-02999999999 connections initiated 999999999 total packets sent
-03999999999 connections accepted 999999999 - data
-04999999999 connections established 999999999 - data (retransmit)
-05999999999 connections dropped 999999999 - ack-only
-06999999999 - in embryonic state 999999999 - window probes
-07999999999 - on retransmit timeout 999999999 - window updates
-08999999999 - by keepalive 999999999 - urgent data only
-09999999999 - from listen queue 999999999 - control
-10 999999999 - resends by PMTU discovery
-11 TCP Timers 999999999 total packets received
-12999999999 potential rtt updates 999999999 - in sequence
-13999999999 - successful 999999999 - completely duplicate
-14999999999 delayed acks sent 999999999 - with some duplicate data
-15999999999 retransmit timeouts 999999999 - out-of-order
-16999999999 persist timeouts 999999999 - duplicate acks
-17999999999 keepalive probes 999999999 - acks
-18999999999 - timeouts 999999999 - window probes
-19 999999999 - window updates
-20 999999999 - bad checksum
+00 TCP Connections TCP Packets
+01999999999 connections initiated 999999999 total packets sent
+02999999999 connections accepted 999999999 - data
+03999999999 connections established 999999999 - data (retransmit)
+04999999999 connections dropped 999999999 - ack-only
+05999999999 - in embryonic state 999999999 - window probes
+06999999999 - on retransmit timeout 999999999 - window updates
+07999999999 - by keepalive 999999999 - urgent data only
+08999999999 - from listen queue 999999999 - control
+09 999999999 - resends by PMTU discovery
+10 TCP Timers 999999999 total packets received
+11999999999 potential rtt updates 999999999 - in sequence
+12999999999 - successful 999999999 - completely duplicate
+13999999999 delayed acks sent 999999999 - with some duplicate data
+14999999999 retransmit timeouts 999999999 - out-of-order
+15999999999 persist timeouts 999999999 - duplicate acks
+16999999999 keepalive probes 999999999 - acks
+17999999999 - timeouts 999999999 - window probes
+18 999999999 - window updates
+19 999999999 - bad checksum
--0123456789012345678901234567890123456789012345678901234567890123456789012345
--0 1 2 3 4 5 6 7
*/
@@ -97,8 +97,7 @@ static struct tcpstat curstat, initstat, oldstat;
WINDOW *
opentcp(void)
{
-
- return (stdscr);
+ return (subwin(stdscr, LINES-3-1, 0, MAINWIN_ROW, 0));
}
void
@@ -109,6 +108,7 @@ closetcp(w)
return;
wclear(w);
wrefresh(w);
+ delwin(w);
}
void
@@ -117,26 +117,26 @@ labeltcp(void)
wmove(wnd, 0, 0); wclrtoeol(wnd);
#define L(row, str) mvwprintw(wnd, row, 10, str)
#define R(row, str) mvwprintw(wnd, row, 45, str);
- L(1, "TCP Connections"); R(1, "TCP Packets");
- L(2, "connections initiated"); R(2, "total packets sent");
- L(3, "connections accepted"); R(3, "- data");
- L(4, "connections established"); R(4, "- data (retransmit)");
- L(5, "connections dropped"); R(5, "- ack-only");
- L(6, "- in embryonic state"); R(6, "- window probes");
- L(7, "- on retransmit timeout"); R(7, "- window updates");
- L(8, "- by keepalive"); R(8, "- urgent data only");
- L(9, "- from listen queue"); R(9, "- control");
- R(10, "- resends by PMTU discovery");
- L(11, "TCP Timers"); R(11, "total packets received");
- L(12, "potential rtt updates"); R(12, "- in sequence");
- L(13, "- successful"); R(13, "- completely duplicate");
- L(14, "delayed acks sent"); R(14, "- with some duplicate data");
- L(15, "retransmit timeouts"); R(15, "- out-of-order");
- L(16, "persist timeouts"); R(16, "- duplicate acks");
- L(17, "keepalive probes"); R(17, "- acks");
- L(18, "- timeouts"); R(18, "- window probes");
- R(19, "- window updates");
- R(20, "- bad checksum");
+ L(0, "TCP Connections"); R(0, "TCP Packets");
+ L(1, "connections initiated"); R(1, "total packets sent");
+ L(2, "connections accepted"); R(2, "- data");
+ L(3, "connections established"); R(3, "- data (retransmit)");
+ L(4, "connections dropped"); R(4, "- ack-only");
+ L(5, "- in embryonic state"); R(5, "- window probes");
+ L(6, "- on retransmit timeout"); R(6, "- window updates");
+ L(7, "- by keepalive"); R(7, "- urgent data only");
+ L(8, "- from listen queue"); R(8, "- control");
+ R(9, "- resends by PMTU discovery");
+ L(10, "TCP Timers"); R(10, "total packets received");
+ L(11, "potential rtt updates"); R(11, "- in sequence");
+ L(12, "- successful"); R(12, "- completely duplicate");
+ L(13, "delayed acks sent"); R(13, "- with some duplicate data");
+ L(14, "retransmit timeouts"); R(14, "- out-of-order");
+ L(15, "persist timeouts"); R(15, "- duplicate acks");
+ L(16, "keepalive probes"); R(16, "- acks");
+ L(17, "- timeouts"); R(17, "- window probes");
+ R(18, "- window updates");
+ R(19, "- bad checksum");
#undef L
#undef R
}
@@ -240,25 +240,25 @@ showtcp(void)
mvwprintw(wnd, row, col, "%9lu", stats.stat)
#define L(row, stat) DO(stat, row, 0)
#define R(row, stat) DO(stat, row, 35)
- L(2, tcps_connattempt); R(2, tcps_sndtotal);
- L(3, tcps_accepts); R(3, tcps_sndpack);
- L(4, tcps_connects); R(4, tcps_sndrexmitpack);
- L(5, tcps_drops); R(5, tcps_sndacks);
- L(6, tcps_conndrops); R(6, tcps_sndprobe);
- L(7, tcps_timeoutdrop); R(7, tcps_sndwinup);
- L(8, tcps_keepdrops); R(8, tcps_sndurg);
- L(9, tcps_listendrop); R(9, tcps_sndctrl);
- R(10, tcps_mturesent);
- R(11, tcps_rcvtotal);
- L(12, tcps_segstimed); R(12, tcps_rcvpack);
- L(13, tcps_rttupdated); R(13, tcps_rcvduppack);
- L(14, tcps_delack); R(14, tcps_rcvpartduppack);
- L(15, tcps_rexmttimeo); R(15, tcps_rcvoopack);
- L(16, tcps_persisttimeo); R(16, tcps_rcvdupack);
- L(17, tcps_keepprobe); R(17, tcps_rcvackpack);
- L(18, tcps_keeptimeo); R(18, tcps_rcvwinprobe);
- R(19, tcps_rcvwinupd);
- R(20, tcps_rcvbadsum);
+ L(1, tcps_connattempt); R(1, tcps_sndtotal);
+ L(2, tcps_accepts); R(2, tcps_sndpack);
+ L(3, tcps_connects); R(3, tcps_sndrexmitpack);
+ L(4, tcps_drops); R(4, tcps_sndacks);
+ L(5, tcps_conndrops); R(5, tcps_sndprobe);
+ L(6, tcps_timeoutdrop); R(6, tcps_sndwinup);
+ L(7, tcps_keepdrops); R(7, tcps_sndurg);
+ L(8, tcps_listendrop); R(8, tcps_sndctrl);
+ R(9, tcps_mturesent);
+ R(10, tcps_rcvtotal);
+ L(11, tcps_segstimed); R(11, tcps_rcvpack);
+ L(12, tcps_rttupdated); R(12, tcps_rcvduppack);
+ L(13, tcps_delack); R(13, tcps_rcvpartduppack);
+ L(14, tcps_rexmttimeo); R(14, tcps_rcvoopack);
+ L(15, tcps_persisttimeo); R(15, tcps_rcvdupack);
+ L(16, tcps_keepprobe); R(16, tcps_rcvackpack);
+ L(17, tcps_keeptimeo); R(17, tcps_rcvwinprobe);
+ R(18, tcps_rcvwinupd);
+ R(19, tcps_rcvbadsum);
#undef DO
#undef L
#undef R
OpenPOWER on IntegriCloud