summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session/session.h')
-rw-r--r--src/vnet/session/session.h30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/vnet/session/session.h b/src/vnet/session/session.h
index 8b591339edb..1a59d7df403 100644
--- a/src/vnet/session/session.h
+++ b/src/vnet/session/session.h
@@ -331,8 +331,7 @@ int session_wrk_handle_mq (session_worker_t *wrk, svm_msg_q_t *mq);
session_t *session_alloc (u32 thread_index);
void session_free (session_t * s);
void session_free_w_fifos (session_t * s);
-void session_cleanup_half_open (transport_proto_t tp,
- session_handle_t ho_handle);
+void session_cleanup_half_open (session_handle_t ho_handle);
u8 session_is_valid (u32 si, u8 thread_index);
always_inline session_t *
@@ -504,8 +503,7 @@ int session_dgram_connect_notify (transport_connection_t * tc,
int session_stream_accept_notify (transport_connection_t * tc);
void session_transport_closing_notify (transport_connection_t * tc);
void session_transport_delete_notify (transport_connection_t * tc);
-void session_half_open_delete_notify (transport_proto_t tp,
- session_handle_t ho_handle);
+void session_half_open_delete_notify (transport_connection_t *tc);
void session_transport_closed_notify (transport_connection_t * tc);
void session_transport_reset_notify (transport_connection_t * tc);
int session_stream_accept (transport_connection_t * tc, u32 listener_index,
@@ -656,6 +654,30 @@ listen_session_free (session_t * s)
session_free (s);
}
+always_inline session_t *
+ho_session_alloc (void)
+{
+ session_t *s;
+ ASSERT (vlib_get_thread_index () == 0);
+ s = session_alloc (0);
+ s->session_state = SESSION_STATE_CONNECTING;
+ s->flags |= SESSION_F_HALF_OPEN;
+ return s;
+}
+
+always_inline session_t *
+ho_session_get (u32 ho_index)
+{
+ return session_get (ho_index, 0 /* half-open thread */);
+}
+
+always_inline void
+ho_session_free (session_t *s)
+{
+ ASSERT (!s->rx_fifo && s->thread_index == 0);
+ session_free (s);
+}
+
transport_connection_t *listen_session_get_transport (session_t * s);
/*