X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fgbp%2Fgbp_vxlan.c;fp=src%2Fplugins%2Fgbp%2Fgbp_vxlan.c;h=49dae7e9f4cb929cdc3c87ee0db414ccbb6eb04f;hb=76b5649d074ab198cbf5737ac76d21649a61bffd;hp=286345ed8fa562751c2a086dbe0a309a8fdb43c7;hpb=1f4e1cbf576fc6ab4e871ba0603028112074b43b;p=vpp.git diff --git a/src/plugins/gbp/gbp_vxlan.c b/src/plugins/gbp/gbp_vxlan.c index 286345ed8fa..49dae7e9f4c 100644 --- a/src/plugins/gbp/gbp_vxlan.c +++ b/src/plugins/gbp/gbp_vxlan.c @@ -22,6 +22,7 @@ #include #include #include +#include /** * A reference to a VXLAN-GBP tunnel created as a child/dependent tunnel @@ -66,6 +67,10 @@ index_t *gbp_vxlan_tunnel_db; */ index_t *vxlan_tunnel_ref_db; +/** + * handle registered with the ;unt infra + */ +static vlib_punt_hdl_t punt_hdl; static char *gbp_vxlan_tunnel_layer_strings[] = { #define _(n,s) [GBP_VXLAN_TUN_##n] = s, @@ -672,28 +677,23 @@ VLIB_CLI_COMMAND (gbp_vxlan_show_node, static) = { static clib_error_t * gbp_vxlan_init (vlib_main_t * vm) { - u32 slot4; - vlib_node_t *node = vlib_get_node_by_name (vm, (u8 *) "gbp-vxlan4"); - - /* - * insert ourselves into the VXLAN-GBP arc to collect the no-tunnel - * packets. - */ - slot4 = vlib_node_add_next_with_slot (vm, - vxlan4_gbp_input_node.index, - node->index, - VXLAN_GBP_INPUT_NEXT_NO_TUNNEL); - ASSERT (slot4 == VXLAN_GBP_INPUT_NEXT_NO_TUNNEL); - - /* slot6 = vlib_node_add_next_with_slot (vm, */ - /* vxlan6_gbp_input_node.index, */ - /* gbp_vxlan6_input_node.index, */ - /* VXLAN_GBP_INPUT_NEXT_NO_TUNNEL); */ - /* ASSERT (slot6 == VXLAN_GBP_INPUT_NEXT_NO_TUNNEL); */ + vxlan_gbp_main_t *vxm = &vxlan_gbp_main; + clib_error_t *error; gt_logger = vlib_log_register_class ("gbp", "tun"); - return (NULL); + if ((error = vlib_call_init_function (vm, punt_init))) + return error; + if ((error = vlib_call_init_function (vm, vxlan_gbp_init))) + return error; + + punt_hdl = vlib_punt_client_register ("gbp-vxlan"); + + vlib_punt_register (punt_hdl, + vxm->punt_no_such_tunnel[FIB_PROTOCOL_IP4], + "gbp-vxlan4"); + + return (error); } VLIB_INIT_FUNCTION (gbp_vxlan_init);