tcp_connection_del (tcp_connection_t * tc)
{
TCP_EVT_DBG (TCP_EVT_DELETE, tc);
tcp_connection_del (tcp_connection_t * tc)
{
TCP_EVT_DBG (TCP_EVT_DELETE, tc);
/* Set the cleanup timer, in case the session layer/app don't
* cleanly close the connection */
tcp_timer_set (tc, TCP_TIMER_WAITCLOSE, TCP_CLOSEWAIT_TIME);
/* Set the cleanup timer, in case the session layer/app don't
* cleanly close the connection */
tcp_timer_set (tc, TCP_TIMER_WAITCLOSE, TCP_CLOSEWAIT_TIME);
tcp_connection_set_state (tc, TCP_STATE_CLOSED);
break;
case TCP_STATE_CLOSE_WAIT:
tcp_connection_set_state (tc, TCP_STATE_CLOSED);
break;
case TCP_STATE_CLOSE_WAIT:
tcp_timer_set (tc, TCP_TIMER_WAITCLOSE, TCP_CLOSEWAIT_TIME);
/* Make sure we mark the session as closed. In some states we may
* be still trying to send data */
tcp_timer_set (tc, TCP_TIMER_WAITCLOSE, TCP_CLOSEWAIT_TIME);
/* Make sure we mark the session as closed. In some states we may
* be still trying to send data */
ASSERT (tc->state == TCP_STATE_SYN_RCVD);
/* Start cleanup. App wasn't notified yet so use delete notify as
* opposed to delete to cleanup session layer state. */
ASSERT (tc->state == TCP_STATE_SYN_RCVD);
/* Start cleanup. App wasn't notified yet so use delete notify as
* opposed to delete to cleanup session layer state. */
rto = clib_max (tc->rto >> tc->rto_boff, 1);
tcp_timer_set (tc, TCP_TIMER_WAITCLOSE,
clib_min (rto * TCP_TO_TIMER_TICK, TCP_2MSL_TIME));
rto = clib_max (tc->rto >> tc->rto_boff, 1);
tcp_timer_set (tc, TCP_TIMER_WAITCLOSE,
clib_min (rto * TCP_TO_TIMER_TICK, TCP_2MSL_TIME));
tcp_connection_timers_reset (tc);
tcp_connection_set_state (tc, TCP_STATE_CLOSED);
tcp_timer_set (tc, TCP_TIMER_WAITCLOSE, TCP_CLEANUP_TIME);
tcp_connection_timers_reset (tc);
tcp_connection_set_state (tc, TCP_STATE_CLOSED);
tcp_timer_set (tc, TCP_TIMER_WAITCLOSE, TCP_CLEANUP_TIME);