misc: Purge unused pg includes
[vpp.git] / src / plugins / ioam / encap / ip6_ioam_e2e.c
index 0839cdc..a3dd048 100644 (file)
@@ -15,7 +15,6 @@
 
 #include <vlib/vlib.h>
 #include <vnet/vnet.h>
-#include <vnet/pg/pg.h>
 #include <vppinfra/error.h>
 
 #include <vnet/ip/ip.h>
@@ -25,8 +24,6 @@
 #include <vppinfra/elog.h>
 
 #include <vnet/ip/ip6_hop_by_hop.h>
-#include <vnet/plugin/plugin.h>
-
 #include "ip6_ioam_e2e.h"
 
 ioam_e2e_main_t ioam_e2e_main;
@@ -39,14 +36,14 @@ static u8 * ioam_e2e_trace_handler (u8 * s,
 
   if (e2e)
     {
-      seqno = clib_net_to_host_u32 (e2e->e2e_data);
+      seqno = clib_net_to_host_u32 (e2e->e2e_hdr.e2e_data);
     }
 
   s = format (s, "SeqNo = 0x%Lx", seqno);
   return s;
 }
 
-int 
+int
 ioam_e2e_config_handler (void *data, u8 disable)
 {
   int *analyse = data;
@@ -110,7 +107,7 @@ ioam_e2e_flow_handler (u32 ctx, u8 add)
     {
       pool_get(ioam_e2e_main.e2e_data, data);
       data->flow_ctx =  ctx;
-      ioam_seqno_init_bitmap(&data->seqno_data);
+      ioam_seqno_init_data(&data->seqno_data);
       return ((u32) (data - ioam_e2e_main.e2e_data));
     }
 
@@ -166,23 +163,6 @@ VLIB_CLI_COMMAND (ioam_show_e2e_cmd, static) = {
     .function = ioam_show_e2e_cmd_fn,
 };
 
-/*
- * 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)
-{
-  clib_error_t * error = 0;
-
-  ioam_e2e_main.vlib_main = vm;
-  ioam_e2e_main.vnet_main = h->vnet_main;
-  return error;
-}
-
 /*
  * Init handler E2E headet handling.
  * Init hanlder registers encap, decap, trace and Rewrite handlers.
@@ -190,13 +170,6 @@ vlib_plugin_register (vlib_main_t * vm, vnet_plugin_handoff_t * h,
 static clib_error_t *
 ioam_e2e_init (vlib_main_t * vm)
 {
-  clib_error_t * error;
-
-  if ((error = vlib_call_init_function (vm, ip6_hop_by_hop_ioam_init)))
-    {
-      return(error);
-    }
-
   /*
    * As of now we have only PPC under E2E header.
    */
@@ -222,6 +195,9 @@ ioam_e2e_init (vlib_main_t * vm)
           "HBH_OPTION_TYPE_IOAM_EDGE_TO_EDGE Flow handler failed"));
     }
 
+  ioam_e2e_main.vlib_main = vm;
+  ioam_e2e_main.vnet_main = vnet_get_main();
+
   return (0);
 }
 
@@ -229,4 +205,9 @@ ioam_e2e_init (vlib_main_t * vm)
  * Init function for the E2E lib.
  * ip6_hop_by_hop_ioam_e2e_init gets called during init.
  */
-VLIB_INIT_FUNCTION (ioam_e2e_init);
+/* *INDENT-OFF* */
+VLIB_INIT_FUNCTION (ioam_e2e_init) =
+{
+    .runs_after = VLIB_INITS("ip6_hop_by_hop_ioam_init"),
+};
+/* *INDENT-ON* */