aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/flowperpkt/flowperpkt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/flowperpkt/flowperpkt.c')
-rw-r--r--src/plugins/flowperpkt/flowperpkt.c32
1 files changed, 8 insertions, 24 deletions
diff --git a/src/plugins/flowperpkt/flowperpkt.c b/src/plugins/flowperpkt/flowperpkt.c
index cc35159906d..6b292eef3cc 100644
--- a/src/plugins/flowperpkt/flowperpkt.c
+++ b/src/plugins/flowperpkt/flowperpkt.c
@@ -24,6 +24,7 @@
*/
#include <vnet/vnet.h>
+#include <vpp/app/version.h>
#include <vnet/plugin/plugin.h>
#include <flowperpkt/flowperpkt.h>
@@ -479,30 +480,11 @@ static void *vl_api_flowperpkt_tx_interface_add_del_t_print
#define foreach_flowperpkt_plugin_api_msg \
_(FLOWPERPKT_TX_INTERFACE_ADD_DEL, flowperpkt_tx_interface_add_del)
-/**
- * @brief plugin-api required function
- * @param vm vlib_main_t * vlib main data structure pointer
- * @param h vlib_plugin_handoff_t * handoff structure
- * @param from_early_init int notused
- *
- * <em>Notes:</em>
- * 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
- */
-clib_error_t *
-vlib_plugin_register (vlib_main_t * vm, vnet_plugin_handoff_t * h,
- int from_early_init)
-{
- flowperpkt_main_t *fm = &flowperpkt_main;
- clib_error_t *error = 0;
-
- fm->vlib_main = vm;
- fm->vnet_main = h->vnet_main;
-
- return error;
-}
+/* *INDENT-OFF* */
+VLIB_PLUGIN_REGISTER () = {
+ .version = VPP_BUILD_VER,
+};
+/* *INDENT-ON* */
static clib_error_t *
flowperpkt_tx_interface_add_del_feature_command_fn (vlib_main_t * vm,
@@ -627,6 +609,8 @@ flowperpkt_init (vlib_main_t * vm)
u32 num_threads;
u8 *name;
+ fm->vnet_main = vnet_get_main ();
+
/* Construct the API name */
name = format (0, "flowperpkt_%08x%c", api_version, 0);