session tcp: handle rxt and acks as custom events
[vpp.git] / src / vnet / session / session_types.h
index b392439..9a5bc76 100644 (file)
@@ -19,7 +19,8 @@
 #include <svm/svm_fifo.h>
 #include <vnet/session/transport_types.h>
 
-#define SESSION_LISTENER_PREFIX                0x5FFFFFFF
+#define SESSION_INVALID_INDEX ((u32)~0)
+#define SESSION_INVALID_HANDLE ((u64)~0)
 
 #define foreach_session_endpoint_fields                                \
   foreach_transport_endpoint_cfg_fields                                \
@@ -42,7 +43,7 @@ typedef struct _session_endpoint_cfg
   u32 ns_index;
   u8 original_tp;
   u8 *hostname;
-  u64 transport_opts;
+  u64 parent_handle;
 } session_endpoint_cfg_t;
 
 #define SESSION_IP46_ZERO                      \
@@ -82,6 +83,7 @@ typedef struct _session_endpoint_cfg
   .app_wrk_index = ENDPOINT_INVALID_INDEX,     \
   .opaque = ENDPOINT_INVALID_INDEX,            \
   .hostname = 0,                               \
+  .parent_handle = SESSION_INVALID_HANDLE      \
 }
 
 #define session_endpoint_to_transport(_sep) ((transport_endpoint_t *)_sep)
@@ -110,6 +112,12 @@ session_endpoint_is_zero (session_endpoint_t * sep)
 typedef u8 session_type_t;
 typedef u64 session_handle_t;
 
+typedef enum
+{
+  SESSION_CLEANUP_TRANSPORT,
+  SESSION_CLEANUP_SESSION,
+} session_cleanup_ntf_t;
+
 /*
  * Session states
  */
@@ -123,8 +131,9 @@ typedef enum
   SESSION_STATE_OPENED,
   SESSION_STATE_TRANSPORT_CLOSING,
   SESSION_STATE_CLOSING,
-  SESSION_STATE_CLOSED_WAITING,
+  SESSION_STATE_APP_CLOSED,
   SESSION_STATE_TRANSPORT_CLOSED,
+  SESSION_STATE_TRANSPORT_DELETED,
   SESSION_STATE_CLOSED,
   SESSION_STATE_N_STATES,
 } session_state_t;
@@ -133,7 +142,7 @@ typedef enum session_flags_
 {
   SESSION_F_RX_EVT = 1,
   SESSION_F_PROXY = (1 << 1),
-  SESSION_F_QUIC_STREAM = (1 << 2),
+  SESSION_F_CUSTOM_TX = (1 << 2),
 } session_flags_t;
 
 typedef struct session_
@@ -169,7 +178,7 @@ typedef struct session_
   union
   {
     /** Parent listener session index if the result of an accept */
-    u32 listener_index;
+    session_handle_t listener_handle;
 
     /** App listener index in app's listener pool if a listener */
     u32 al_index;