session: Add transport vft protocol options
[vpp.git] / src / vnet / sctp / sctp.c
index 21cc78b..e5d6cca 100644 (file)
@@ -892,7 +892,7 @@ sctp_main_enable (vlib_main_t * vm)
   vec_validate (tm->ip_lookup_tx_frames[0], num_threads - 1);
   vec_validate (tm->ip_lookup_tx_frames[1], num_threads - 1);
 
-  tm->bytes_per_buffer = vlib_bufer_get_default_size (vm);
+  tm->bytes_per_buffer = vlib_buffer_get_default_data_size (vm);
 
   vec_validate (tm->time_now, num_threads - 1);
   return error;
@@ -940,8 +940,8 @@ sctp_update_time (f64 now, u8 thread_index)
   sctp_flush_frames_to_output (thread_index);
 }
 
-/* *INDENT OFF* */
-const static transport_proto_vft_t sctp_proto = {
+/* *INDENT-OFF* */
+static const transport_proto_vft_t sctp_proto = {
   .enable = sctp_enable_disable,
   .start_listen = sctp_session_bind,
   .stop_listen = sctp_session_unbind,
@@ -958,11 +958,12 @@ const static transport_proto_vft_t sctp_proto = {
   .format_connection = format_sctp_session,
   .format_listener = format_sctp_listener_session,
   .format_half_open = format_sctp_half_open,
-  .tx_type = TRANSPORT_TX_DEQUEUE,
-  .service_type = TRANSPORT_SERVICE_VC,
+  .transport_options = {
+    .tx_type = TRANSPORT_TX_DEQUEUE,
+    .service_type = TRANSPORT_SERVICE_VC,
+  },
 };
-
-/* *INDENT ON* */
+/* *INDENT-ON* */
 
 clib_error_t *
 sctp_init (vlib_main_t * vm)
@@ -970,6 +971,12 @@ sctp_init (vlib_main_t * vm)
   sctp_main_t *tm = vnet_get_sctp_main ();
   ip_main_t *im = &ip_main;
   ip_protocol_info_t *pi;
+  vlib_node_t *node = vlib_get_node_by_name (vm, (u8 *) "sctp4-established");
+  tm->sctp4_established_phase_node_index = node->index;
+
+  node = vlib_get_node_by_name (vm, (u8 *) "sctp6-established");
+  tm->sctp6_established_phase_node_index = node->index;
+
   /* Session layer, and by implication SCTP, are disabled by default */
   tm->is_enabled = 0;