From 371ca50a74a9c4f1b74c4c1b65c6fdec610fcfc3 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Wed, 21 Feb 2018 12:07:41 -0800 Subject: session: first approximation implementation of tls It consists of two main parts. First, add an application transport type whereby applications can offer transport to other applications. For instance, a tls app can offer transport services to other applications. And second, a tls transport app that leverages the mbedtls library for tls protocol implementation. Change-Id: I616996c6e6539a9e2368fab8a1ac874d7c5d9838 Signed-off-by: Florin Coras --- src/vnet/session/transport.h | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'src/vnet/session/transport.h') diff --git a/src/vnet/session/transport.h b/src/vnet/session/transport.h index 76ee2262ecd..ed9eb02754e 100644 --- a/src/vnet/session/transport.h +++ b/src/vnet/session/transport.h @@ -25,20 +25,34 @@ */ typedef struct _transport_connection { - ip46_address_t rmt_ip; /**< Remote IP */ - ip46_address_t lcl_ip; /**< Local IP */ - u16 lcl_port; /**< Local port */ - u16 rmt_port; /**< Remote port */ - u8 proto; /**< Protocol id */ - u8 is_ip4; /**< Flag if IP4 connection */ - u32 fib_index; /**< Network namespace */ + /** Connection ID */ + union + { + /* + * Network connection ID tuple + */ + struct + { + ip46_address_t rmt_ip; /**< Remote IP */ + ip46_address_t lcl_ip; /**< Local IP */ + u16 lcl_port; /**< Local port */ + u16 rmt_port; /**< Remote port */ + u8 proto; /**< Protocol id */ + u8 is_ip4; /**< Flag if IP4 connection */ + u32 fib_index; /**< Network namespace */ + }; + /* + * Opaque connection ID + */ + u8 opaque_conn_id[42]; + }; u32 s_index; /**< Parent session index */ u32 c_index; /**< Connection index in transport pool */ u32 thread_index; /**< Worker-thread index */ - fib_node_index_t rmt_fei; /**< FIB entry index for rmt */ - dpo_id_t rmt_dpo; /**< Forwarding DPO for rmt */ + /*fib_node_index_t rmt_fei; + dpo_id_t rmt_dpo; */ #if TRANSPORT_DEBUG elog_track_t elog_track; /**< Event logging */ @@ -64,6 +78,7 @@ typedef struct _transport_connection #define c_cc_stat_tstamp connection.cc_stat_tstamp #define c_rmt_fei connection.rmt_fei #define c_rmt_dpo connection.rmt_dpo +#define c_opaque_id connection.opaque_conn_id } transport_connection_t; typedef enum _transport_proto @@ -72,6 +87,7 @@ typedef enum _transport_proto TRANSPORT_PROTO_UDP, TRANSPORT_PROTO_SCTP, TRANSPORT_PROTO_NONE, + TRANSPORT_PROTO_TLS, TRANSPORT_N_PROTO } transport_proto_t; -- cgit 1.2.3-korg