+ * Transport protocol virtual function table
+ */
+/* *INDENT-OFF* */
+typedef struct _transport_proto_vft
+{
+ /*
+ * Setup
+ */
+ u32 (*start_listen) (u32 session_index, transport_endpoint_t * lcl);
+ u32 (*stop_listen) (u32 conn_index);
+ int (*connect) (transport_endpoint_cfg_t * rmt);
+ void (*close) (u32 conn_index, u32 thread_index);
+ void (*reset) (u32 conn_index, u32 thread_index);
+ void (*cleanup) (u32 conn_index, u32 thread_index);
+ void (*cleanup_ho) (u32 conn_index);
+ clib_error_t *(*enable) (vlib_main_t * vm, u8 is_en);
+
+ /*
+ * Transmission
+ */
+
+ u32 (*push_header) (transport_connection_t * tconn, vlib_buffer_t * b);
+ int (*send_params) (transport_connection_t * tconn,
+ transport_send_params_t *sp);
+ void (*update_time) (f64 time_now, u8 thread_index);
+ void (*flush_data) (transport_connection_t *tconn);
+ int (*custom_tx) (void *session, transport_send_params_t *sp);
+ int (*app_rx_evt) (transport_connection_t *tconn);
+
+ /*
+ * Connection retrieval
+ */
+ transport_connection_t *(*get_connection) (u32 conn_idx, u32 thread_idx);
+ transport_connection_t *(*get_listener) (u32 conn_index);
+ transport_connection_t *(*get_half_open) (u32 conn_index);
+
+ /*
+ * Format
+ */
+ 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 retrieval
+ */
+ void (*get_transport_endpoint) (u32 conn_index, u32 thread_index,
+ transport_endpoint_t *tep, u8 is_lcl);
+ void (*get_transport_listener_endpoint) (u32 conn_index,
+ transport_endpoint_t *tep,
+ u8 is_lcl);
+
+ /*
+ * Properties
+ */
+ transport_options_t transport_options;
+} transport_proto_vft_t;
+/* *INDENT-ON* */
+
+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)
+
+int transport_connect (transport_proto_t tp, transport_endpoint_cfg_t * tep);
+void transport_close (transport_proto_t tp, u32 conn_index, u8 thread_index);
+void transport_reset (transport_proto_t tp, u32 conn_index, u8 thread_index);
+u32 transport_start_listen (transport_proto_t tp, u32 session_index,
+ transport_endpoint_t * tep);
+u32 transport_stop_listen (transport_proto_t tp, u32 conn_index);
+void transport_cleanup (transport_proto_t tp, u32 conn_index,
+ u8 thread_index);
+void transport_cleanup_half_open (transport_proto_t tp, u32 conn_index);
+void transport_get_endpoint (transport_proto_t tp, u32 conn_index,
+ u32 thread_index, transport_endpoint_t * tep,
+ u8 is_lcl);
+void transport_get_listener_endpoint (transport_proto_t tp, u32 conn_index,
+ transport_endpoint_t * tep, u8 is_lcl);
+
+static inline transport_connection_t *
+transport_get_connection (transport_proto_t tp, u32 conn_index,
+ u8 thread_index)
+{
+ return tp_vfts[tp].get_connection (conn_index, thread_index);
+}
+
+static inline transport_connection_t *
+transport_get_listener (transport_proto_t tp, u32 conn_index)
+{
+ return tp_vfts[tp].get_listener (conn_index);
+}
+
+static inline transport_connection_t *
+transport_get_half_open (transport_proto_t tp, u32 conn_index)
+{
+ return tp_vfts[tp].get_half_open (conn_index);
+}
+
+static inline int
+transport_custom_tx (transport_proto_t tp, void *s,
+ transport_send_params_t * sp)
+{
+ return tp_vfts[tp].custom_tx (s, sp);
+}
+
+static inline int
+transport_app_rx_evt (transport_proto_t tp, u32 conn_index, u32 thread_index)
+{
+ transport_connection_t *tc;
+ if (!tp_vfts[tp].app_rx_evt)
+ return 0;
+ tc = transport_get_connection (tp, conn_index, thread_index);
+ return tp_vfts[tp].app_rx_evt (tc);
+}
+
+/**
+ * Get send parameters for transport connection
+ *
+ * These include maximum tx burst, mss, tx offset and other flags
+ * transport might want to provide to sessin layer
+ *
+ * @param tc transport connection
+ * @param sp send paramaters
+ *