aboutsummaryrefslogtreecommitdiff
path: root/slirp/tcp_timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'slirp/tcp_timer.c')
-rw-r--r--slirp/tcp_timer.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/slirp/tcp_timer.c b/slirp/tcp_timer.c
index cc1bd50c07..3e865977ce 100644
--- a/slirp/tcp_timer.c
+++ b/slirp/tcp_timer.c
@@ -41,7 +41,10 @@ int tcp_keepintvl = TCPTV_KEEPINTVL;
int tcp_maxidle;
int so_options = DO_KEEPALIVE;
+#ifdef LOG_ENABLED
struct tcpstat tcpstat; /* tcp statistics */
+#endif
+
u_int32_t tcp_now; /* for RFC 1323 timestamps */
/*
@@ -62,7 +65,7 @@ tcp_fasttimo()
(tp->t_flags & TF_DELACK)) {
tp->t_flags &= ~TF_DELACK;
tp->t_flags |= TF_ACKNOW;
- tcpstat.tcps_delack++;
+ STAT(tcpstat.tcps_delack++);
(void) tcp_output(tp);
}
}
@@ -192,7 +195,7 @@ tcp_timers(tp, timer)
* We tried our best, now the connection must die!
*/
tp->t_rxtshift = TCP_MAXRXTSHIFT;
- tcpstat.tcps_timeoutdrop++;
+ STAT(tcpstat.tcps_timeoutdrop++);
tp = tcp_drop(tp, tp->t_softerror);
/* tp->t_softerror : ETIMEDOUT); */ /* XXX */
return (tp); /* XXX */
@@ -204,7 +207,7 @@ tcp_timers(tp, timer)
*/
tp->t_rxtshift = 6;
}
- tcpstat.tcps_rexmttimeo++;
+ STAT(tcpstat.tcps_rexmttimeo++);
rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift];
TCPT_RANGESET(tp->t_rxtcur, rexmt,
(short)tp->t_rttmin, TCPTV_REXMTMAX); /* XXX */
@@ -267,7 +270,7 @@ tcp_timers(tp, timer)
* Force a byte to be output, if possible.
*/
case TCPT_PERSIST:
- tcpstat.tcps_persisttimeo++;
+ STAT(tcpstat.tcps_persisttimeo++);
tcp_setpersist(tp);
tp->t_force = 1;
(void) tcp_output(tp);
@@ -279,7 +282,7 @@ tcp_timers(tp, timer)
* or drop connection if idle for too long.
*/
case TCPT_KEEP:
- tcpstat.tcps_keeptimeo++;
+ STAT(tcpstat.tcps_keeptimeo++);
if (tp->t_state < TCPS_ESTABLISHED)
goto dropit;
@@ -299,7 +302,7 @@ tcp_timers(tp, timer)
* by the protocol spec, this requires the
* correspondent TCP to respond.
*/
- tcpstat.tcps_keepprobe++;
+ STAT(tcpstat.tcps_keepprobe++);
#ifdef TCP_COMPAT_42
/*
* The keepalive packet must have nonzero length
@@ -317,7 +320,7 @@ tcp_timers(tp, timer)
break;
dropit:
- tcpstat.tcps_keepdrops++;
+ STAT(tcpstat.tcps_keepdrops++);
tp = tcp_drop(tp, 0); /* ETIMEDOUT); */
break;
}