Revision 31a60e22 slirp/tcp_timer.c

b/slirp/tcp_timer.c
41 41
int	tcp_maxidle;
42 42
int	so_options = DO_KEEPALIVE;
43 43

  
44
#ifdef LOG_ENABLED
44 45
struct   tcpstat tcpstat;        /* tcp statistics */
46
#endif
47

  
45 48
u_int32_t        tcp_now;                /* for RFC 1323 timestamps */
46 49

  
47 50
/*
......
62 65
		    (tp->t_flags & TF_DELACK)) {
63 66
			tp->t_flags &= ~TF_DELACK;
64 67
			tp->t_flags |= TF_ACKNOW;
65
			tcpstat.tcps_delack++;
68
			STAT(tcpstat.tcps_delack++);
66 69
			(void) tcp_output(tp);
67 70
		}
68 71
}
......
192 195
				 * We tried our best, now the connection must die!
193 196
				 */
194 197
				tp->t_rxtshift = TCP_MAXRXTSHIFT;
195
				tcpstat.tcps_timeoutdrop++;
198
				STAT(tcpstat.tcps_timeoutdrop++);
196 199
				tp = tcp_drop(tp, tp->t_softerror);
197 200
				/* tp->t_softerror : ETIMEDOUT); */ /* XXX */
198 201
				return (tp); /* XXX */
......
204 207
			 */
205 208
			tp->t_rxtshift = 6;
206 209
		}
207
		tcpstat.tcps_rexmttimeo++;
210
		STAT(tcpstat.tcps_rexmttimeo++);
208 211
		rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift];
209 212
		TCPT_RANGESET(tp->t_rxtcur, rexmt,
210 213
		    (short)tp->t_rttmin, TCPTV_REXMTMAX); /* XXX */
......
267 270
	 * Force a byte to be output, if possible.
268 271
	 */
269 272
	case TCPT_PERSIST:
270
		tcpstat.tcps_persisttimeo++;
273
		STAT(tcpstat.tcps_persisttimeo++);
271 274
		tcp_setpersist(tp);
272 275
		tp->t_force = 1;
273 276
		(void) tcp_output(tp);
......
279 282
	 * or drop connection if idle for too long.
280 283
	 */
281 284
	case TCPT_KEEP:
282
		tcpstat.tcps_keeptimeo++;
285
		STAT(tcpstat.tcps_keeptimeo++);
283 286
		if (tp->t_state < TCPS_ESTABLISHED)
284 287
			goto dropit;
285 288

  
......
299 302
			 * by the protocol spec, this requires the
300 303
			 * correspondent TCP to respond.
301 304
			 */
302
			tcpstat.tcps_keepprobe++;
305
			STAT(tcpstat.tcps_keepprobe++);
303 306
#ifdef TCP_COMPAT_42
304 307
			/*
305 308
			 * The keepalive packet must have nonzero length
......
317 320
		break;
318 321

  
319 322
	dropit:
320
		tcpstat.tcps_keepdrops++;
323
		STAT(tcpstat.tcps_keepdrops++);
321 324
		tp = tcp_drop(tp, 0); /* ETIMEDOUT); */
322 325
		break;
323 326
	}

Also available in: Unified diff