summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/transport_interface.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-02-21 12:07:41 -0800
committerDave Barach <openvpp@barachs.net>2018-03-02 12:54:31 +0000
commit371ca50a74a9c4f1b74c4c1b65c6fdec610fcfc3 (patch)
tree947e800faa7846223bdf8fb73429c657ddaf5805 /src/vnet/session/transport_interface.h
parent9e6356962a0cbb84f7ea9056b954d65aaa231a61 (diff)
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 <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/transport_interface.h')
-rw-r--r--src/vnet/session/transport_interface.h35
1 files changed, 30 insertions, 5 deletions
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 <vnet/vnet.h>
#include <vnet/session/transport.h>
+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) \