summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/transport_interface.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-12-09 10:19:43 -0800
committerDave Barach <openvpp@barachs.net>2017-12-11 21:07:22 +0000
commit561af9b441c7392cf391dd46399b0b16b876a08a (patch)
treed5aa49c73728b6f7cb55071a5398ee9cdba53808 /src/vnet/session/transport_interface.h
parentd78349109fdb98fa0ba5f5aff779be700ff78357 (diff)
session: generalize handling of network transports
- compute session type out of transport and network protos - make session, session lookup and session queue code network protocol agnostic This does not update the session layer to support non-ip network layer protocols Change-Id: Ifc2f92845e158b649d59462eb7d51c12af536691 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.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/vnet/session/transport_interface.h b/src/vnet/session/transport_interface.h
index 079e6464268..09542e6a6aa 100644
--- a/src/vnet/session/transport_interface.h
+++ b/src/vnet/session/transport_interface.h
@@ -32,6 +32,7 @@ typedef struct _transport_proto_vft
int (*open) (transport_endpoint_t * rmt);
void (*close) (u32 conn_index, u32 thread_index);
void (*cleanup) (u32 conn_index, u32 thread_index);
+ clib_error_t *(*enable) (vlib_main_t * vm, u8 is_en);
/*
* Transmission
@@ -40,6 +41,7 @@ typedef struct _transport_proto_vft
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);
/*
* Connection retrieval
@@ -56,10 +58,21 @@ typedef struct _transport_proto_vft
u8 *(*format_half_open) (u8 * s, va_list * args);
} transport_proto_vft_t;
+extern transport_proto_vft_t *tp_vfts;
+
+#define transport_proto_foreach(VAR, BODY) \
+do { \
+ for (VAR = 0; VAR < vec_len (tp_vfts); VAR++) \
+ if (tp_vfts[VAR].push_header != 0) \
+ do { BODY; } while (0); \
+} while (0)
+
void transport_register_protocol (transport_proto_t transport_proto,
- u8 is_ip4,
- const transport_proto_vft_t * vft);
-transport_proto_vft_t *transport_protocol_get_vft (u8 session_type);
+ const transport_proto_vft_t * vft,
+ fib_protocol_t fib_proto, u32 output_node);
+transport_proto_vft_t *transport_protocol_get_vft (transport_proto_t tp);
+void transport_update_time (f64 time_now, u8 thread_index);
+void transport_enable_disable (vlib_main_t * vm, u8 is_en);
#endif /* SRC_VNET_SESSION_TRANSPORT_INTERFACE_H_ */