summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_timer.c
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2008-04-08 01:03:58 +0000
committerthorpej <thorpej@NetBSD.org>2008-04-08 01:03:58 +0000
commitf5c68c0b9fc4ff7e896f0f6d757995c19351d8a7 (patch)
treeb2d38957962ebc8a6d489268c1105d29a7ebcbc7 /sys/netinet/tcp_timer.c
parent27b03461ec930d8ba4c9885fa97fb79a0fa310fd (diff)
Change TCP stats from a structure to an array of uint64_t's.
Note: This is ABI-compatible with the old tcpstat structure; old netstat binaries will continue to work properly.
Diffstat (limited to 'sys/netinet/tcp_timer.c')
-rw-r--r--sys/netinet/tcp_timer.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index 5ab8eb641a8..fa20d0eb1d8 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_timer.c,v 1.77 2007/06/20 15:29:18 christos Exp $ */
+/* $NetBSD: tcp_timer.c,v 1.78 2008/04/08 01:03:58 thorpej Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -100,7 +100,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_timer.c,v 1.77 2007/06/20 15:29:18 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_timer.c,v 1.78 2008/04/08 01:03:58 thorpej Exp $");
#include "opt_inet.h"
#include "opt_tcp_debug.h"
@@ -349,12 +349,12 @@ tcp_timer_rexmt(void *arg)
if (++tp->t_rxtshift > TCP_MAXRXTSHIFT) {
tp->t_rxtshift = TCP_MAXRXTSHIFT;
- tcpstat.tcps_timeoutdrop++;
+ tcpstat[TCP_STAT_TIMEOUTDROP]++;
tp = tcp_drop(tp, tp->t_softerror ?
tp->t_softerror : ETIMEDOUT);
goto out;
}
- tcpstat.tcps_rexmttimeo++;
+ tcpstat[TCP_STAT_REXMTTIMEO]++;
rto = TCP_REXMTVAL(tp);
if (rto < tp->t_rttmin)
rto = tp->t_rttmin;
@@ -371,7 +371,7 @@ tcp_timer_rexmt(void *arg)
* value here...
*/
if (tp->t_mtudisc && tp->t_rxtshift > TCP_MAXRXTSHIFT / 6) {
- tcpstat.tcps_pmtublackhole++;
+ tcpstat[TCP_STAT_PMTUBLACKHOLE]++;
#ifdef INET
/* try turning PMTUD off */
@@ -486,11 +486,11 @@ tcp_timer_persist(void *arg)
if (tp->t_rxtshift == TCP_MAXRXTSHIFT &&
((tcp_now - tp->t_rcvtime) >= tcp_maxpersistidle ||
(tcp_now - tp->t_rcvtime) >= rto * tcp_totbackoff)) {
- tcpstat.tcps_persistdrops++;
+ tcpstat[TCP_STAT_PERSISTDROPS]++;
tp = tcp_drop(tp, ETIMEDOUT);
goto out;
}
- tcpstat.tcps_persisttimeo++;
+ tcpstat[TCP_STAT_PERSISTTIMEO]++;
tcp_setpersist(tp);
tp->t_force = 1;
(void) tcp_output(tp);
@@ -531,7 +531,7 @@ tcp_timer_keep(void *arg)
* or drop connection if idle for too long.
*/
- tcpstat.tcps_keeptimeo++;
+ tcpstat[TCP_STAT_KEEPTIMEO]++;
if (TCPS_HAVEESTABLISHED(tp->t_state) == 0)
goto dropit;
#ifdef INET
@@ -561,7 +561,7 @@ tcp_timer_keep(void *arg)
* by the protocol spec, this requires the
* correspondent TCP to respond.
*/
- tcpstat.tcps_keepprobe++;
+ tcpstat[TCP_STAT_KEEPPROBE]++;
if (tcp_compat_42) {
/*
* The keepalive packet must have nonzero
@@ -588,7 +588,7 @@ tcp_timer_keep(void *arg)
return;
dropit:
- tcpstat.tcps_keepdrops++;
+ tcpstat[TCP_STAT_KEEPDROPS]++;
(void) tcp_drop(tp, ETIMEDOUT);
splx(s);
}