diff options
author | AkshayaNadahalli <anadahal@cisco.com> | 2016-12-23 17:46:08 +0530 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2017-01-04 17:52:59 +0000 |
commit | a90ba9d3d0daf583f225617e57252f172e99df21 (patch) | |
tree | a957442cc1ca31d7b7ad57df8d5c7d72d9dc71d3 /src/plugins/ioam | |
parent | 8db1c76e9ab7b0c5cd334673db3c98b8fe82a1c4 (diff) |
Merging all ioam plugin libraries to single library
Double commit from 1702 branch to master.
Change-Id: I33a646ba45848c7400df4271e4933e28e62c9ad7
Signed-off-by: AkshayaNadahalli <anadahal@cisco.com>
(cherry picked from commit e4e9fbbb7c8fa4385ae31072d60ad8621fe798a4)
Signed-off-by: AkshayaNadahalli <anadahal@cisco.com>
Diffstat (limited to 'src/plugins/ioam')
-rw-r--r-- | src/plugins/ioam/encap/ip6_ioam_e2e.c | 22 | ||||
-rw-r--r-- | src/plugins/ioam/encap/ip6_ioam_trace.c | 13 | ||||
-rw-r--r-- | src/plugins/ioam/export-common/ioam_export.h | 1 | ||||
-rw-r--r-- | src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export.c | 2 | ||||
-rw-r--r-- | src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_node.c | 4 | ||||
-rw-r--r-- | src/plugins/ioam/export/ioam_export.c | 23 | ||||
-rw-r--r-- | src/plugins/ioam/lib-pot/pot_api.c | 24 | ||||
-rw-r--r-- | src/plugins/ioam/lib-trace/trace_api.c | 23 | ||||
-rw-r--r-- | src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_api.c | 27 |
9 files changed, 36 insertions, 103 deletions
diff --git a/src/plugins/ioam/encap/ip6_ioam_e2e.c b/src/plugins/ioam/encap/ip6_ioam_e2e.c index 0839cdceca7..2831a351d4f 100644 --- a/src/plugins/ioam/encap/ip6_ioam_e2e.c +++ b/src/plugins/ioam/encap/ip6_ioam_e2e.c @@ -25,8 +25,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; @@ -167,23 +165,6 @@ VLIB_CLI_COMMAND (ioam_show_e2e_cmd, static) = { }; /* - * 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. */ @@ -222,6 +203,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); } diff --git a/src/plugins/ioam/encap/ip6_ioam_trace.c b/src/plugins/ioam/encap/ip6_ioam_trace.c index e63db6e4ec5..3a6758cd859 100644 --- a/src/plugins/ioam/encap/ip6_ioam_trace.c +++ b/src/plugins/ioam/encap/ip6_ioam_trace.c @@ -24,6 +24,7 @@ #include <vppinfra/hash.h> #include <vppinfra/error.h> #include <vppinfra/elog.h> +#include <vnet/plugin/plugin.h> #include <ioam/lib-trace/trace_util.h> @@ -348,6 +349,18 @@ VLIB_CLI_COMMAND (ip6_show_ioam_trace_cmd, static) = { }; /* *INDENT-ON* */ +/* + * 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) +{ + return 0; +} static clib_error_t * ip6_hop_by_hop_ioam_trace_init (vlib_main_t * vm) diff --git a/src/plugins/ioam/export-common/ioam_export.h b/src/plugins/ioam/export-common/ioam_export.h index fbd86180656..e6ab0344958 100644 --- a/src/plugins/ioam/export-common/ioam_export.h +++ b/src/plugins/ioam/export-common/ioam_export.h @@ -77,6 +77,7 @@ ioam_export_main_t ioam_export_main; ioam_export_main_t vxlan_gpe_ioam_export_main; extern vlib_node_registration_t export_node; +extern vlib_node_registration_t vxlan_export_node; #define DEFAULT_EXPORT_SIZE (3 * CLIB_CACHE_LINE_BYTES) /* diff --git a/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export.c b/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export.c index bab8d977062..0924d68f6ff 100644 --- a/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export.c +++ b/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export.c @@ -92,7 +92,7 @@ vxlan_gpe_ioam_export_enable_disable (ioam_export_main_t * em, ip4_address_t * src_address) { vlib_main_t *vm = em->vlib_main; - u32 node_index = export_node.index; + u32 node_index = vxlan_export_node.index; vlib_node_t *vxlan_gpe_decap_ioam_node = NULL; if (is_disable == 0) diff --git a/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_node.c b/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_node.c index 722c2b061c0..f75b7081c09 100644 --- a/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_node.c +++ b/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_node.c @@ -40,7 +40,7 @@ format_export_trace (u8 * s, va_list * args) return s; } -vlib_node_registration_t export_node; +vlib_node_registration_t vxlan_export_node; #define foreach_export_error \ _(RECORDED, "Packets recorded for export") @@ -137,7 +137,7 @@ vxlan_gpe_export_node_fn (vlib_main_t * vm, * Node for VXLAN-GPE export */ /* *INDENT-OFF* */ -VLIB_REGISTER_NODE (export_node) = +VLIB_REGISTER_NODE (vxlan_export_node) = { .function = vxlan_gpe_export_node_fn, .name = "vxlan-gpe-ioam-export", diff --git a/src/plugins/ioam/export/ioam_export.c b/src/plugins/ioam/export/ioam_export.c index b122e445b28..06634baaf4b 100644 --- a/src/plugins/ioam/export/ioam_export.c +++ b/src/plugins/ioam/export/ioam_export.c @@ -81,26 +81,6 @@ 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 - */ - -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; -} - /* Action function shared between message handler and debug CLI */ int @@ -250,6 +230,9 @@ 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 (); + name = format (0, "ioam_export_%08x%c", api_version, 0); /* Ask for a correctly-sized block of API message decode slots */ diff --git a/src/plugins/ioam/lib-pot/pot_api.c b/src/plugins/ioam/lib-pot/pot_api.c index d3af7b4036a..04c2aaa59a3 100644 --- a/src/plugins/ioam/lib-pot/pot_api.c +++ b/src/plugins/ioam/lib-pot/pot_api.c @@ -213,26 +213,6 @@ static void vl_api_pot_profile_del_t_handler REPLY_MACRO(VL_API_POT_PROFILE_DEL_REPLY); } - -/* - * 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) -{ - pot_main_t * sm = &pot_main; - clib_error_t * error = 0; - - sm->vlib_main = vm; - sm->vnet_main = h->vnet_main; - return error; -} - /* Set up the API message handling tables */ static clib_error_t * pot_plugin_api_hookup (vlib_main_t *vm) @@ -273,6 +253,10 @@ static clib_error_t * pot_init (vlib_main_t * vm) bzero(sm, sizeof(pot_main)); (void)pot_util_init(); + + sm->vlib_main = vm; + sm->vnet_main = vnet_get_main(); + name = format (0, "ioam_pot_%08x%c", api_version, 0); /* Ask for a correctly-sized block of API message decode slots */ diff --git a/src/plugins/ioam/lib-trace/trace_api.c b/src/plugins/ioam/lib-trace/trace_api.c index 7e0d708e155..2ada5b7e5af 100644 --- a/src/plugins/ioam/lib-trace/trace_api.c +++ b/src/plugins/ioam/lib-trace/trace_api.c @@ -165,25 +165,6 @@ static void vl_api_trace_profile_show_config_t_handler } } -/* - * 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) -{ - trace_main_t *sm = &trace_main; - clib_error_t *error = 0; - - sm->vlib_main = vm; - sm->vnet_main = h->vnet_main; - return error; -} - /* Set up the API message handling tables */ static clib_error_t * trace_plugin_api_hookup (vlib_main_t * vm) @@ -225,6 +206,10 @@ trace_init (vlib_main_t * vm) bzero (sm, sizeof (trace_main)); (void) trace_util_init (); + + sm->vlib_main = vm; + sm->vnet_main = vnet_get_main (); + name = format (0, "ioam_trace_%08x%c", api_version, 0); /* Ask for a correctly-sized block of API message decode slots */ diff --git a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_api.c b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_api.c index 68752365f82..247bcf590f3 100644 --- a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_api.c +++ b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_api.c @@ -284,28 +284,6 @@ static void vl_api_vxlan_gpe_ioam_transit_disable_t_handler VXLAN_GPE_REPLY_MACRO (VL_API_VXLAN_GPE_IOAM_TRANSIT_DISABLE_REPLY); } - -/* - * 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) -{ - vxlan_gpe_ioam_main_t *sm = &vxlan_gpe_ioam_main; - clib_error_t *error = 0; - - sm->vlib_main = vm; - sm->vnet_main = h->vnet_main; - sm->unix_time_0 = (u32) time (0); /* Store starting time */ - sm->vlib_time_0 = vlib_time_now (vm); - return error; -} - /* Set up the API message handling tables */ static clib_error_t * vxlan_gpe_plugin_api_hookup (vlib_main_t * vm) @@ -337,6 +315,11 @@ vxlan_gpe_init (vlib_main_t * vm) vlib_node_t *vxlan_gpe_decap_node = NULL; uword next_node = 0; + sm->vlib_main = vm; + sm->vnet_main = vnet_get_main (); + sm->unix_time_0 = (u32) time (0); /* Store starting time */ + sm->vlib_time_0 = vlib_time_now (vm); + name = format (0, "ioam_vxlan_gpe_%08x%c", api_version, 0); /* Ask for a correctly-sized block of API message decode slots */ |