diff --git a/src/vnet/session/session.h b/src/vnet/session/session.h
index babb002..6ae901c 100644
--- a/src/vnet/session/session.h
+++ b/src/vnet/session/session.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Copyright (c) 2017-2019 Cisco and/or its affiliates.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
@@ -15,15 +15,13 @@
 #ifndef __included_session_h__
 #define __included_session_h__
 
-#include <vnet/session/stream_session.h>
+#include <vnet/session/session_types.h>
 #include <vnet/session/session_lookup.h>
 #include <vnet/session/transport_interface.h>
 #include <vnet/session/session_debug.h>
 #include <vnet/session/segment_manager.h>
-#include <svm/queue.h>
+#include <svm/message_queue.h>
 
-#define HALF_OPEN_LOOKUP_INVALID_VALUE ((u64)~0)
-#define INVALID_INDEX ((u32)~0)
 #define SESSION_PROXY_LISTENER_INDEX ((u8)~0 - 1)
 #define SESSION_LOCAL_HANDLE_PREFIX 0x7FFFFFFF
 
@@ -158,7 +156,7 @@
 typedef struct session_tx_context_
 {
   CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
-  stream_session_t *s;
+  session_t *s;
   transport_proto_vft_t *transport_vft;
   transport_connection_t *tc;
   vlib_buffer_t *b;
@@ -181,7 +179,7 @@
   CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
 
   /** Worker session pool */
-  stream_session_t *sessions;
+  session_t *sessions;
 
   /** vpp event message queue for worker */
   svm_msg_q_t *vpp_event_queue;
@@ -321,7 +319,7 @@
 always_inline u8
 stream_session_is_valid (u32 si, u8 thread_index)
 {
-  stream_session_t *s;
+  session_t *s;
   s = pool_elt_at_index (session_manager_main.wrk[thread_index].sessions, si);
   if (s->thread_index != thread_index || s->session_index != si
       /* || s->server_rx_fifo->master_session_index != si
@@ -332,12 +330,12 @@
   return 1;
 }
 
-stream_session_t *session_alloc (u32 thread_index);
-int session_alloc_fifos (segment_manager_t * sm, stream_session_t * s);
-void session_free (stream_session_t * s);
-void session_free_w_fifos (stream_session_t * s);
+session_t *session_alloc (u32 thread_index);
+int session_alloc_fifos (segment_manager_t * sm, session_t * s);
+void session_free (session_t * s);
+void session_free_w_fifos (session_t * s);
 
-always_inline stream_session_t *
+always_inline session_t *
 session_get (u32 si, u32 thread_index)
 {
   ASSERT (stream_session_is_valid (si, thread_index));
@@ -345,7 +343,7 @@
 			    si);
 }
 
-always_inline stream_session_t *
+always_inline session_t *
 session_get_if_valid (u64 si, u32 thread_index)
 {
   if (thread_index >= vec_len (session_manager_main.wrk))
@@ -361,7 +359,7 @@
 }
 
 always_inline session_handle_t
-session_handle (stream_session_t * s)
+session_handle (session_t * s)
 {
   return ((u64) s->thread_index << 32) | (u64) s->session_index;
 }
@@ -386,7 +384,7 @@
   *thread_index = session_thread_from_handle (handle);
 }
 
-always_inline stream_session_t *
+always_inline session_t *
 session_get_from_handle (session_handle_t handle)
 {
   session_manager_main_t *smm = &session_manager_main;
@@ -395,7 +393,7 @@
   return pool_elt_at_index (smm->wrk[thread_index].sessions, session_index);
 }
 
-always_inline stream_session_t *
+always_inline session_t *
 session_get_from_handle_if_valid (session_handle_t handle)
 {
   u32 session_index, thread_index;
@@ -424,13 +422,13 @@
 }
 
 always_inline transport_proto_t
-session_get_transport_proto (stream_session_t * s)
+session_get_transport_proto (session_t * s)
 {
   return (s->session_type >> 1);
 }
 
 always_inline fib_protocol_t
-session_get_fib_proto (stream_session_t * s)
+session_get_fib_proto (session_t * s)
 {
   u8 is_ip4 = s->session_type & 1;
   return (is_ip4 ? FIB_PROTOCOL_IP4 : FIB_PROTOCOL_IP6);
@@ -443,27 +441,27 @@
 }
 
 always_inline u64
-session_segment_handle (stream_session_t * s)
+session_segment_handle (session_t * s)
 {
   svm_fifo_t *f;
 
   if (s->session_state == SESSION_STATE_LISTENING)
     return SESSION_INVALID_HANDLE;
 
-  f = s->server_rx_fifo;
+  f = s->rx_fifo;
   return segment_manager_make_segment_handle (f->segment_manager,
 					      f->segment_index);
 }
 
 always_inline u8
-session_has_transport (stream_session_t * s)
+session_has_transport (session_t * s)
 {
   return (session_get_transport_proto (s) != TRANSPORT_PROTO_NONE);
 }
 
-transport_service_type_t session_transport_service_type (stream_session_t *);
-transport_tx_fn_type_t session_transport_tx_fn_type (stream_session_t *);
-u8 session_tx_is_dgram (stream_session_t * s);
+transport_service_type_t session_transport_service_type (session_t *);
+transport_tx_fn_type_t session_transport_tx_fn_type (session_t *);
+u8 session_tx_is_dgram (session_t * s);
 
 /**
  * Acquires a lock that blocks a session pool from expanding.
@@ -498,7 +496,7 @@
  *
  * Caller should drop the peek 'lock' as soon as possible.
  */
-always_inline stream_session_t *
+always_inline session_t *
 session_get_from_handle_safe (u64 handle)
 {
   u32 thread_index = session_thread_from_handle (handle);
@@ -520,36 +518,36 @@
 always_inline u32
 transport_max_rx_enqueue (transport_connection_t * tc)
 {
-  stream_session_t *s = session_get (tc->s_index, tc->thread_index);
-  return svm_fifo_max_enqueue (s->server_rx_fifo);
+  session_t *s = session_get (tc->s_index, tc->thread_index);
+  return svm_fifo_max_enqueue (s->rx_fifo);
 }
 
 always_inline u32
 transport_max_tx_dequeue (transport_connection_t * tc)
 {
-  stream_session_t *s = session_get (tc->s_index, tc->thread_index);
-  return svm_fifo_max_dequeue (s->server_tx_fifo);
+  session_t *s = session_get (tc->s_index, tc->thread_index);
+  return svm_fifo_max_dequeue (s->tx_fifo);
 }
 
 always_inline u32
 transport_rx_fifo_size (transport_connection_t * tc)
 {
-  stream_session_t *s = session_get (tc->s_index, tc->thread_index);
-  return s->server_rx_fifo->nitems;
+  session_t *s = session_get (tc->s_index, tc->thread_index);
+  return s->rx_fifo->nitems;
 }
 
 always_inline u32
 transport_tx_fifo_size (transport_connection_t * tc)
 {
-  stream_session_t *s = session_get (tc->s_index, tc->thread_index);
-  return s->server_tx_fifo->nitems;
+  session_t *s = session_get (tc->s_index, tc->thread_index);
+  return s->tx_fifo->nitems;
 }
 
 always_inline u8
 transport_rx_fifo_has_ooo_data (transport_connection_t * tc)
 {
-  stream_session_t *s = session_get (tc->c_index, tc->thread_index);
-  return svm_fifo_has_ooo_data (s->server_rx_fifo);
+  session_t *s = session_get (tc->c_index, tc->thread_index);
+  return svm_fifo_has_ooo_data (s->rx_fifo);
 }
 
 always_inline f64
@@ -565,15 +563,15 @@
 }
 
 always_inline u32
-session_get_index (stream_session_t * s)
+session_get_index (session_t * s)
 {
   return (s - session_manager_main.wrk[s->thread_index].sessions);
 }
 
-always_inline stream_session_t *
+always_inline session_t *
 session_clone_safe (u32 session_index, u32 thread_index)
 {
-  stream_session_t *old_s, *new_s;
+  session_t *old_s, *new_s;
   u32 current_thread_index = vlib_get_thread_index ();
 
   /* If during the memcpy pool is reallocated AND the memory allocator
@@ -591,7 +589,7 @@
   return new_s;
 }
 
-transport_connection_t *session_get_transport (stream_session_t * s);
+transport_connection_t *session_get_transport (session_t * s);
 
 u32 session_tx_fifo_max_dequeue (transport_connection_t * tc);
 
@@ -599,7 +597,7 @@
 session_enqueue_stream_connection (transport_connection_t * tc,
 				   vlib_buffer_t * b, u32 offset,
 				   u8 queue_event, u8 is_in_order);
-int session_enqueue_dgram_connection (stream_session_t * s,
+int session_enqueue_dgram_connection (session_t * s,
 				      session_dgram_hdr_t * hdr,
 				      vlib_buffer_t * b, u8 proto,
 				      u8 queue_event);
@@ -610,8 +608,8 @@
 int session_stream_connect_notify (transport_connection_t * tc, u8 is_fail);
 int session_dgram_connect_notify (transport_connection_t * tc,
 				  u32 old_thread_index,
-				  stream_session_t ** new_session);
-int session_dequeue_notify (stream_session_t * s);
+				  session_t ** new_session);
+int session_dequeue_notify (session_t * s);
 void stream_session_init_fifos_pointers (transport_connection_t * tc,
 					 u32 rx_pointer, u32 tx_pointer);
 
@@ -623,11 +621,11 @@
 int stream_session_accept (transport_connection_t * tc, u32 listener_index,
 			   u8 notify);
 int session_open (u32 app_index, session_endpoint_t * tep, u32 opaque);
-int session_listen (stream_session_t * s, session_endpoint_cfg_t * sep);
-int session_stop_listen (stream_session_t * s);
-void session_close (stream_session_t * s);
-void session_transport_close (stream_session_t * s);
-void session_transport_cleanup (stream_session_t * s);
+int session_listen (session_t * s, session_endpoint_cfg_t * sep);
+int session_stop_listen (session_t * s);
+void session_close (session_t * s);
+void session_transport_close (session_t * s);
+void session_transport_cleanup (session_t * s);
 int session_send_io_evt_to_thread (svm_fifo_t * f,
 				   session_evt_type_t evt_type);
 int session_send_io_evt_to_thread_custom (void *data, u32 thread_index,
@@ -649,10 +647,10 @@
 always_inline void
 transport_add_tx_event (transport_connection_t * tc)
 {
-  stream_session_t *s = session_get (tc->s_index, tc->thread_index);
-  if (svm_fifo_has_event (s->server_tx_fifo))
+  session_t *s = session_get (tc->s_index, tc->thread_index);
+  if (svm_fifo_has_event (s->tx_fifo))
     return;
-  session_send_io_evt_to_thread (s->server_tx_fifo, FIFO_EVENT_APP_TX);
+  session_send_io_evt_to_thread (s->tx_fifo, FIFO_EVENT_APP_TX);
 }
 
 clib_error_t *vnet_session_enable_disable (vlib_main_t * vm, u8 is_en);
@@ -667,13 +665,13 @@
 int session_manager_flush_all_enqueue_events (u8 transport_proto);
 
 always_inline u64
-listen_session_get_handle (stream_session_t * s)
+listen_session_get_handle (session_t * s)
 {
   ASSERT (s->session_state == SESSION_STATE_LISTENING);
   return session_handle (s);
 }
 
-always_inline stream_session_t *
+always_inline session_t *
 listen_session_get_from_handle (session_handle_t handle)
 {
   return session_get_from_handle (handle);
@@ -686,32 +684,32 @@
   session_parse_handle (handle, index, thread_index);
 }
 
-always_inline stream_session_t *
+always_inline session_t *
 listen_session_new (u8 thread_index, session_type_t type)
 {
-  stream_session_t *s;
+  session_t *s;
   s = session_alloc (thread_index);
   s->session_type = type;
   s->session_state = SESSION_STATE_LISTENING;
   return s;
 }
 
-always_inline stream_session_t *
+always_inline session_t *
 listen_session_get (u32 index)
 {
   return session_get (index, 0);
 }
 
 always_inline void
-listen_session_del (stream_session_t * s)
+listen_session_del (session_t * s)
 {
   session_free (s);
 }
 
-transport_connection_t *listen_session_get_transport (stream_session_t * s);
+transport_connection_t *listen_session_get_transport (session_t * s);
 
 int
-listen_session_get_local_session_endpoint (stream_session_t * listener,
+listen_session_get_local_session_endpoint (session_t * listener,
 					   session_endpoint_t * sep);
 
 void session_flush_frames_main_thread (vlib_main_t * vm);
