aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vnet/session/transport_types.h13
-rw-r--r--src/vnet/tls/tls.h9
2 files changed, 15 insertions, 7 deletions
diff --git a/src/vnet/session/transport_types.h b/src/vnet/session/transport_types.h
index e15c6bbb76f..224c8202e73 100644
--- a/src/vnet/session/transport_types.h
+++ b/src/vnet/session/transport_types.h
@@ -60,6 +60,8 @@ typedef struct _spacer
u64 last_update;
} spacer_t;
+#define TRANSPORT_CONN_ID_LEN 44
+
/*
* Protocol independent transport properties associated to a session
*/
@@ -77,24 +79,26 @@ typedef struct _transport_connection
ip46_address_t lcl_ip; /**< Local IP */
u16 rmt_port; /**< Remote port */
u16 lcl_port; /**< Local port */
+ u32 fib_index; /**< Network namespace */
u8 is_ip4; /**< Flag if IP4 connection */
u8 proto; /**< Protocol id */
- u32 fib_index; /**< Network namespace */
+ u8 unused[2]; /**< First field after id wants to be
+ 4-byte aligned) */
};
/*
* Opaque connection ID
*/
- u8 opaque_conn_id[42];
+ u8 opaque_conn_id[TRANSPORT_CONN_ID_LEN];
};
u32 s_index; /**< Parent session index */
u32 c_index; /**< Connection index in transport pool */
u32 thread_index; /**< Worker-thread index */
+ u8 flags; /**< Transport specific flags */
/*fib_node_index_t rmt_fei;
dpo_id_t rmt_dpo; */
- u8 flags; /**< Transport specific flags */
transport_stats_t stats; /**< Transport connection stats */
spacer_t pacer; /**< Simple transport pacer */
@@ -128,6 +132,9 @@ typedef struct _transport_connection
#define c_flags connection.flags
} transport_connection_t;
+STATIC_ASSERT (STRUCT_OFFSET_OF (transport_connection_t, s_index)
+ == TRANSPORT_CONN_ID_LEN, "update conn id len");
+
typedef enum _transport_proto
{
TRANSPORT_PROTO_TCP,
diff --git a/src/vnet/tls/tls.h b/src/vnet/tls/tls.h
index 6de6924d390..51b92a5debf 100644
--- a/src/vnet/tls/tls.h
+++ b/src/vnet/tls/tls.h
@@ -37,22 +37,23 @@
#endif
/* *INDENT-OFF* */
-typedef CLIB_PACKED (struct tls_cxt_id_
+typedef struct tls_cxt_id_
{
- u32 parent_app_wrk_index;
union {
session_handle_t app_session_handle;
u32 parent_app_api_ctx;
};
session_handle_t tls_session_handle;
+ u32 parent_app_wrk_index;
u32 ssl_ctx;
u32 listener_ctx_index;
u8 tcp_is_ip4;
u8 tls_engine_id;
-}) tls_ctx_id_t;
+} tls_ctx_id_t;
/* *INDENT-ON* */
-STATIC_ASSERT (sizeof (tls_ctx_id_t) <= 42, "ctx id must be less than 42");
+STATIC_ASSERT (sizeof (tls_ctx_id_t) <= TRANSPORT_CONN_ID_LEN,
+ "ctx id must be less than TRANSPORT_CONN_ID_LEN");
typedef struct tls_ctx_
{