- int timertype;
-{
-
-COUNT(TCP_TIMERS);
- switch (timertype) {
-
- case TFINACK: /* fin-ack timer */
- switch (tp->t_state) {
-
- case TIME_WAIT:
- /*
- * We can be sure our ACK of foreign FIN was rcvd,
- * and can close if no data left for user.
- */
- if (rcv_empty(tp)) {
- tcp_disconnect(tp);
- return (CLOSED);
- }
- return (RCV_WAIT); /* 17 */
-
- case CLOSING:
- tp->tc_flags |= TC_WAITED_2_ML;
- return (SAME);
-
- default:
- return (SAME);
- }
-
- case TREXMT: /* retransmission timer */
- if (tp->t_rexmt_val > tp->snd_una) { /* 34 */
- /*
- * Set so for a retransmission, increase rexmt time
- * in case of multiple retransmissions.
- */
- tp->snd_nxt = tp->snd_una;
- tp->tc_flags |= TC_REXMT;
- tp->t_xmtime = tp->t_xmtime << 1;
- if (tp->t_xmtime > T_REMAX)
- tp->t_xmtime = T_REMAX;
- (void) tcp_send(tp);
- }
- return (SAME);
-
- case TREXMTTL: /* retransmit too long */
- if (tp->t_rtl_val > tp->snd_una) /* 36 */
- tcp_error(tp, EIO); /* URXTIMO !?! */
- /*
- * If user has already closed, abort the connection.
- */
- if (tp->tc_flags & TC_USR_CLOSED) {
- tcp_abort(tp);
- return (CLOSED);
- }
- return (SAME);
-
- case TPERSIST: /* persist timer */
- /*
- * Force a byte send through closed window.
- */
- tp->tc_flags |= TC_FORCE_ONE;
- (void) tcp_send(tp);
- return (SAME);
- }
- panic("tcp_timers");
- /*NOTREACHED*/
-}
-
-/*ARGSUSED*/
-tcp_sense(m)
- struct mbuf *m;
-{
-
-COUNT(TCP_SENSE);
- return (EOPNOTSUPP);
-}
-
-tcp_error(tp, errno)
- struct tcpcb *tp;
- int errno;