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_interface.h | 35 +++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'src/vnet/session/transport_interface.h') diff --git a/src/vnet/session/transport_interface.h b/src/vnet/session/transport_interface.h index 09542e6a6aa..04a5ff263b1 100644 --- a/src/vnet/session/transport_interface.h +++ b/src/vnet/session/transport_interface.h @@ -19,9 +19,26 @@ #include #include +typedef enum transport_dequeue_type_ +{ + TRANSPORT_TX_PEEK, /**< reliable transport protos */ + TRANSPORT_TX_DEQUEUE, /**< unreliable transport protos */ + TRANSPORT_TX_INTERNAL, /**< apps acting as transports */ + TRANSPORT_TX_N_FNS +} transport_tx_fn_type_t; + +typedef enum transport_service_type_ +{ + TRANSPORT_SERVICE_VC, /**< virtual circuit service */ + TRANSPORT_SERVICE_CL, /**< connectionless service */ + TRANSPORT_SERVICE_APP, /**< app transport service */ + TRANSPORT_N_SERVICES +} transport_service_type_t; + /* * Transport protocol virtual function table */ +/* *INDENT-OFF* */ typedef struct _transport_proto_vft { /* @@ -37,10 +54,11 @@ typedef struct _transport_proto_vft /* * Transmission */ - u32 (*push_header) (transport_connection_t * tconn, vlib_buffer_t * b); - u16 (*send_mss) (transport_connection_t * tc); - u32 (*send_space) (transport_connection_t * tc); - u32 (*tx_fifo_offset) (transport_connection_t * tc); + + u32 (*push_header) (transport_connection_t * tconn, vlib_buffer_t * b); + u16 (*send_mss) (transport_connection_t * tc); + u32 (*send_space) (transport_connection_t * tc); + u32 (*tx_fifo_offset) (transport_connection_t * tc); void (*update_time) (f64 time_now, u8 thread_index); /* @@ -56,11 +74,18 @@ typedef struct _transport_proto_vft u8 *(*format_connection) (u8 * s, va_list * args); u8 *(*format_listener) (u8 * s, va_list * args); u8 *(*format_half_open) (u8 * s, va_list * args); + + /* + * Properties + */ + transport_tx_fn_type_t tx_type; + transport_service_type_t service_type; } transport_proto_vft_t; +/* *INDENT-ON* */ extern transport_proto_vft_t *tp_vfts; -#define transport_proto_foreach(VAR, BODY) \ +#define transport_proto_foreach(VAR, BODY) \ do { \ for (VAR = 0; VAR < vec_len (tp_vfts); VAR++) \ if (tp_vfts[VAR].push_header != 0) \ -- cgit 1.2.3-korg