VPP-651: Ensure sw_if_index to node mapping for L2 output path is only done via l2out...
[vpp.git] / src / plugins / ioam / export / ioam_export.c
index b122e44..eeeb973 100644 (file)
@@ -81,25 +81,9 @@ do {                                                            \
 #define foreach_ioam_export_plugin_api_msg                        \
 _(IOAM_EXPORT_IP6_ENABLE_DISABLE, ioam_export_ip6_enable_disable)
 
-/*
- * This routine exists to convince the vlib plugin framework that
- * we haven't accidentally copied a random .dll into the plugin directory.
- *
- * Also collects global variable pointers passed from the vpp engine
- */
+ioam_export_main_t ioam_export_main;
 
-clib_error_t *
-vlib_plugin_register (vlib_main_t * vm, vnet_plugin_handoff_t * h,
-                     int from_early_init)
-{
-  ioam_export_main_t *em = &ioam_export_main;
-  clib_error_t *error = 0;
-
-  em->vlib_main = vm;
-  em->vnet_main = h->vnet_main;
-
-  return error;
-}
+extern vlib_node_registration_t export_node;
 
 /* Action function shared between message handler and debug CLI */
 
@@ -250,6 +234,11 @@ ioam_export_init (vlib_main_t * vm)
   u32 node_index = export_node.index;
   vlib_node_t *ip6_hbyh_node = NULL;
 
+  em->vlib_main = vm;
+  em->vnet_main = vnet_get_main ();
+  em->set_id = IPFIX_IOAM_EXPORT_ID;
+  ioam_export_reset_next_node (em);
+
   name = format (0, "ioam_export_%08x%c", api_version, 0);
 
   /* Ask for a correctly-sized block of API message decode slots */