- case TINIT: /* initialization timer */
- if ((tp->tc_flags&TC_SYN_ACKED) == 0) { /* 35 */
- t_close(tp, UINTIMO);
- return (CLOSED);
- }
- return (SAME);
-
- 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)) {
- t_close(tp, UCLOSED); /* 14 */
- return (CLOSED);
- }
- return (RCV_WAIT); /* 17 */
-
- case CLOSING1:
- 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 up 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;
- send(tp);
- }
- return (SAME);
-
- case TREXMTTL: /* retransmit too long */
- if (tp->t_rtl_val > tp->snd_una) /* 36 */
- to_user(tp->t_ucb, URXTIMO);
- /*
- * If user has already closed, abort the connection.
- */
- if (tp->tc_flags & TC_USR_CLOSED) {
- t_close(tp, URXTIMO);
- return (CLOSED);
- }
- return (SAME);
-
- case TPERSIST: /* persist timer */
- /*
- * Force a byte send through closed window.
- */
- tp->tc_flags |= TC_FORCE_ONE;
- send(tp);
- return (SAME);
- }
- panic("tcp_timers");
-}
-
-/* THIS ROUTINE IS A CROCK */
-to_user(up, state)
- register struct ucb *up;
- register short state;
-{
-COUNT(TO_USER);