X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fip%2Fip6_hop_by_hop.c;h=355aba627fb9b45285ea7be1cc8c0142d3957c39;hb=756cd9441752fc8f84104c9ee19099506ba89f85;hp=3a820b3cefc541605f593f726ed61a4e26b72976;hpb=7cd468a3d7dee7d6c92f69a0bb7061ae208ec727;p=vpp.git diff --git a/src/vnet/ip/ip6_hop_by_hop.c b/src/vnet/ip/ip6_hop_by_hop.c index 3a820b3cefc..355aba627fb 100644 --- a/src/vnet/ip/ip6_hop_by_hop.c +++ b/src/vnet/ip/ip6_hop_by_hop.c @@ -46,7 +46,7 @@ ip6_hop_by_hop_ioam_main_t ip6_hop_by_hop_ioam_main; #define foreach_ip6_hbyh_ioam_input_next \ _(IP6_REWRITE, "ip6-rewrite") \ _(IP6_LOOKUP, "ip6-lookup") \ - _(DROP, "error-drop") + _(DROP, "ip6-drop") typedef enum { @@ -56,32 +56,6 @@ typedef enum IP6_HBYH_IOAM_INPUT_N_NEXT, } ip6_hbyh_ioam_input_next_t; - -u32 -ioam_flow_add (u8 encap, u8 * flow_name) -{ - ip6_hop_by_hop_ioam_main_t *hm = &ip6_hop_by_hop_ioam_main; - flow_data_t *flow = 0; - u32 index = 0; - u8 i; - - pool_get (hm->flows, flow); - memset (flow, 0, sizeof (flow_data_t)); - - index = flow - hm->flows; - strncpy ((char *) flow->flow_name, (char *) flow_name, 31); - - if (!encap) - IOAM_SET_DECAP (index); - - for (i = 0; i < 255; i++) - { - if (hm->flow_handler[i]) - flow->ctx[i] = hm->flow_handler[i] (index, 1); - } - return (index); -} - static uword unformat_opaque_ioam (unformat_input_t * input, va_list * args) { @@ -129,7 +103,7 @@ ip6_hbh_add_register_option (u8 option, { ip6_hop_by_hop_ioam_main_t *hm = &ip6_hop_by_hop_ioam_main; - ASSERT (option < ARRAY_LEN (hm->add_options)); + ASSERT ((u32) option < ARRAY_LEN (hm->add_options)); /* Already registered */ if (hm->add_options[option]) @@ -146,7 +120,7 @@ ip6_hbh_add_unregister_option (u8 option) { ip6_hop_by_hop_ioam_main_t *hm = &ip6_hop_by_hop_ioam_main; - ASSERT (option < ARRAY_LEN (hm->add_options)); + ASSERT ((u32) option < ARRAY_LEN (hm->add_options)); /* Not registered */ if (!hm->add_options[option]) @@ -164,7 +138,7 @@ ip6_hbh_config_handler_register (u8 option, { ip6_hop_by_hop_ioam_main_t *hm = &ip6_hop_by_hop_ioam_main; - ASSERT (option < ARRAY_LEN (hm->config_handler)); + ASSERT ((u32) option < ARRAY_LEN (hm->config_handler)); /* Already registered */ if (hm->config_handler[option]) @@ -180,7 +154,7 @@ ip6_hbh_config_handler_unregister (u8 option) { ip6_hop_by_hop_ioam_main_t *hm = &ip6_hop_by_hop_ioam_main; - ASSERT (option < ARRAY_LEN (hm->config_handler)); + ASSERT ((u32) option < ARRAY_LEN (hm->config_handler)); /* Not registered */ if (!hm->config_handler[option]) @@ -197,7 +171,7 @@ ip6_hbh_flow_handler_register (u8 option, { ip6_hop_by_hop_ioam_main_t *hm = &ip6_hop_by_hop_ioam_main; - ASSERT (option < ARRAY_LEN (hm->flow_handler)); + ASSERT ((u32) option < ARRAY_LEN (hm->flow_handler)); /* Already registered */ if (hm->flow_handler[option]) @@ -213,7 +187,7 @@ ip6_hbh_flow_handler_unregister (u8 option) { ip6_hop_by_hop_ioam_main_t *hm = &ip6_hop_by_hop_ioam_main; - ASSERT (option < ARRAY_LEN (hm->flow_handler)); + ASSERT ((u32) option < ARRAY_LEN (hm->flow_handler)); /* Not registered */ if (!hm->flow_handler[option]) @@ -510,7 +484,7 @@ ip6_hbh_pop_register_option (u8 option, { ip6_hop_by_hop_ioam_main_t *hm = &ip6_hop_by_hop_ioam_main; - ASSERT (option < ARRAY_LEN (hm->pop_options)); + ASSERT ((u32) option < ARRAY_LEN (hm->pop_options)); /* Already registered */ if (hm->pop_options[option]) @@ -526,7 +500,7 @@ ip6_hbh_pop_unregister_option (u8 option) { ip6_hop_by_hop_ioam_main_t *hm = &ip6_hop_by_hop_ioam_main; - ASSERT (option < ARRAY_LEN (hm->pop_options)); + ASSERT ((u32) option < ARRAY_LEN (hm->pop_options)); /* Not registered */ if (!hm->pop_options[option]) @@ -607,8 +581,6 @@ static uword ip6_pop_hop_by_hop_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { - ip6_main_t *im = &ip6_main; - ip_lookup_main_t *lm = &im->lookup_main; u32 n_left_from, *from, *to_next; ip_lookup_next_t next_index; u32 processed = 0; @@ -666,8 +638,8 @@ ip6_pop_hop_by_hop_node_fn (vlib_main_t * vm, ip1 = vlib_buffer_get_current (b1); adj_index0 = vnet_buffer (b0)->ip.adj_index[VLIB_TX]; adj_index1 = vnet_buffer (b1)->ip.adj_index[VLIB_TX]; - adj0 = ip_get_adjacency (lm, adj_index0); - adj1 = ip_get_adjacency (lm, adj_index1); + adj0 = adj_get (adj_index0); + adj1 = adj_get (adj_index1); next0 = adj0->lookup_next_index; next1 = adj1->lookup_next_index; @@ -755,7 +727,7 @@ ip6_pop_hop_by_hop_node_fn (vlib_main_t * vm, ip0 = vlib_buffer_get_current (b0); adj_index0 = vnet_buffer (b0)->ip.adj_index[VLIB_TX]; - adj0 = ip_get_adjacency (lm, adj_index0); + adj0 = adj_get (adj_index0); /* Default use the next_index from the adjacency. */ next0 = adj0->lookup_next_index;