+ if (smm->evt_qs_use_memfd_seg)
+ ssvm_pop_heap (oldheap);
+ else
+ svm_pop_heap (oldheap);
+}
+
+ssvm_private_t *
+session_manager_get_evt_q_segment (void)
+{
+ session_manager_main_t *smm = &session_manager_main;
+ if (smm->evt_qs_use_memfd_seg)
+ return &smm->evt_qs_segment;
+ return 0;
+}
+
+/**
+ * Initialize session layer for given transport proto and ip version
+ *
+ * Allocates per session type (transport proto + ip version) data structures
+ * and adds arc from session queue node to session type output node.
+ */
+void
+session_register_transport (transport_proto_t transport_proto,
+ const transport_proto_vft_t * vft, u8 is_ip4,
+ u32 output_node)
+{
+ session_manager_main_t *smm = &session_manager_main;
+ session_type_t session_type;
+ u32 next_index = ~0;
+
+ session_type = session_type_from_proto_and_ip (transport_proto, is_ip4);
+
+ vec_validate (smm->session_type_to_next, session_type);
+ vec_validate (smm->listen_sessions, session_type);
+ vec_validate (smm->session_tx_fns, session_type);
+
+ /* *INDENT-OFF* */
+ foreach_vlib_main (({
+ next_index = vlib_node_add_next (this_vlib_main, session_queue_node.index,
+ output_node);
+ }));
+ /* *INDENT-ON* */
+
+ smm->session_type_to_next[session_type] = next_index;
+ session_manager_set_transport_rx_fn (session_type,
+ vft->tx_fifo_offset != 0);