-always_inline u8
-tcp_make_state_flags (tcp_connection_t * tc, tcp_state_t next_state)
-{
- switch (next_state)
- {
- case TCP_STATE_ESTABLISHED:
- case TCP_STATE_CLOSE_WAIT:
- case TCP_STATE_TIME_WAIT:
- case TCP_STATE_FIN_WAIT_2:
- return TCP_FLAG_ACK;
- case TCP_STATE_SYN_RCVD:
- return TCP_FLAG_SYN | TCP_FLAG_ACK;
- case TCP_STATE_SYN_SENT:
- return TCP_FLAG_SYN;
- case TCP_STATE_LAST_ACK:
- case TCP_STATE_FIN_WAIT_1:
- case TCP_STATE_CLOSING:
- if (tc->snd_nxt + 1 < tc->snd_una_max)
- return TCP_FLAG_ACK;
- else
- return TCP_FLAG_FIN;
- default:
- clib_warning ("Shouldn't be here!");
- }
- return 0;
-}
-