X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=vpp%2Fapi%2Fcustom_dump.c;h=47c9f662517bc7942f022048ebcddb059e91cd6f;hb=72a7ded3762ef54867fc8b35ec8082c406c84005;hp=574e102fc46f4f46081c5d0de11f63a437fbd95e;hpb=fdff1e6ed540f2a04792fb64e04b0c7862dc2b8c;p=vpp.git diff --git a/vpp/api/custom_dump.c b/vpp/api/custom_dump.c index 574e102fc46..47c9f662517 100644 --- a/vpp/api/custom_dump.c +++ b/vpp/api/custom_dump.c @@ -26,8 +26,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -1014,7 +1013,7 @@ static void *vl_api_sr_tunnel_add_del_t_print s = format (0, "SCRIPT: sr_tunnel_add_del "); - if (mp->name) + if (mp->name[0]) s = format (s, "name %s ", mp->name); s = format (s, "src %U dst %U/%d ", format_ip6_address, @@ -1065,7 +1064,7 @@ static void *vl_api_sr_tunnel_add_del_t_print } } - if (mp->policy_name) + if (mp->policy_name[0]) s = format (s, "policy_name %s ", mp->policy_name); if (mp->is_add == 0) @@ -1082,11 +1081,11 @@ static void *vl_api_sr_policy_add_del_t_print s = format (0, "SCRIPT: sr_policy_add_del "); - if (mp->name) + if (mp->name[0]) s = format (s, "name %s ", mp->name); - if (mp->tunnel_names) + if (mp->tunnel_names[0]) { // start deserializing tunnel_names int num_tunnels = mp->tunnel_names[0]; //number of tunnels @@ -1110,7 +1109,7 @@ static void *vl_api_sr_policy_add_del_t_print if (mp->is_add == 0) s = format (s, "del "); - + FINISH; } @@ -1123,16 +1122,16 @@ static void *vl_api_sr_multicast_map_add_del_t_print s = format (0, "SCRIPT: sr_multicast_map_add_del "); - if (mp->multicast_address) - s = format (s, "address %U ", format_ip6_address, &mp->multicast_address); + if (mp->multicast_address[0]) + s = format (s, "address %U ", format_ip6_address, &mp->multicast_address); - if (mp->policy_name) + if (mp->policy_name[0]) s = format (s, "sr-policy %s ", &mp->policy_name); - if (mp->is_add == 0) + if (mp->is_add == 0) s = format (s, "del "); - + FINISH; } @@ -1574,77 +1573,17 @@ static void *vl_api_show_version_t_print FINISH; } -static void *vl_api_nsh_gre_add_del_tunnel_t_print -(vl_api_nsh_gre_add_del_tunnel_t * mp, void *handle) -{ - u8 * s; - int i; - u32 spi_si; - - s = format (0, "SCRIPT: nsh_gre_add_del_tunnel "); - - s = format (s, "src %U dst %U ", format_ip4_address, &mp->src, - format_ip4_address, &mp->dst); - - spi_si = ntohl(mp->spi_si); - - s = format (s, "spi %d si %d ", (spi_si>>8), (spi_si & 0xff)); - - s = format (s, "decap-next %d ", ntohl(mp->decap_next_index)); - - if (mp->is_add == 0) - s = format (s, "del "); - - if (mp->encap_vrf_id) - s = format (s, "encap-vrf-id %d ", ntohl(mp->encap_vrf_id)); - - if (mp->decap_vrf_id) - s = format (s, "decap-vrf-id %d ", ntohl(mp->decap_vrf_id)); - - if (mp->ver_o_c & 0xc) - s = format (s, "version %d ", mp->ver_o_c>>6); - if (mp->ver_o_c & NSH_O_BIT) - s = format (s, "o-bit 1 "); - if (mp->ver_o_c & NSH_C_BIT) - s = format (s, "c-bit 1 "); - if (mp->md_type) - s = format (s, "md-type %d ", mp->md_type); - if (mp->next_protocol == 1) - s = format (s, "next-ip4 "); - else if (mp->next_protocol == 2) - s = format (s, "next-ip6 "); - else if (mp->next_protocol == 3) - s = format (s, "next-ethernet"); - - s = format (s, "c1 %d ", ntohl(mp->c1)); - s = format (s, "c2 %d ", ntohl(mp->c2)); - s = format (s, "c3 %d ", ntohl(mp->c3)); - s = format (s, "c4 %d ", ntohl(mp->c4)); - - for (i = 0; i < mp->tlv_len_in_words; i++) { - s = format (s, "tlv %x ", ntohl(mp->tlvs[i])); - } - - FINISH; -} - -static void *vl_api_nsh_vxlan_gpe_add_del_tunnel_t_print -(vl_api_nsh_vxlan_gpe_add_del_tunnel_t * mp, void *handle) +static void *vl_api_vxlan_gpe_add_del_tunnel_t_print +(vl_api_vxlan_gpe_add_del_tunnel_t * mp, void *handle) { u8 * s; - int i; - u32 spi_si; - s = format (0, "SCRIPT: nsh_vxlan_gpe_add_del_tunnel "); + s = format (0, "SCRIPT: vxlan_gpe_add_del_tunnel "); - s = format (s, "src %U dst %U ", format_ip4_address, &mp->src, - format_ip4_address, &mp->dst); + s = format (s, "local %U remote %U ", format_ip4_address, &mp->local, + format_ip4_address, &mp->remote); - spi_si = ntohl(mp->spi_si); - - s = format (s, "spi %d si %d ", (spi_si>>8), (spi_si & 0xff)); - - s = format (s, "decap-next %d ", ntohl(mp->decap_next_index)); + s = format (s, "protocol %d ", ntohl(mp->protocol)); s = format (s, "vni %d ", ntohl(mp->vni)); @@ -1657,73 +1596,6 @@ static void *vl_api_nsh_vxlan_gpe_add_del_tunnel_t_print if (mp->decap_vrf_id) s = format (s, "decap-vrf-id %d ", ntohl(mp->decap_vrf_id)); - if (mp->ver_o_c & 0xc) - s = format (s, "version %d ", mp->ver_o_c>>6); - if (mp->ver_o_c & NSH_O_BIT) - s = format (s, "o-bit 1 "); - if (mp->ver_o_c & NSH_C_BIT) - s = format (s, "c-bit 1 "); - if (mp->md_type) - s = format (s, "md-type %d ", mp->md_type); - if (mp->next_protocol == 1) - s = format (s, "next-ip4 "); - else if (mp->next_protocol == 2) - s = format (s, "next-ip6 "); - else if (mp->next_protocol == 3) - s = format (s, "next-ethernet"); - - s = format (s, "c1 %d ", ntohl(mp->c1)); - s = format (s, "c2 %d ", ntohl(mp->c2)); - s = format (s, "c3 %d ", ntohl(mp->c3)); - s = format (s, "c4 %d ", ntohl(mp->c4)); - - for (i = 0; i < mp->tlv_len_in_words; i++) { - s = format (s, "tlv %x ", ntohl(mp->tlvs[i])); - } - - FINISH; -} - -static void *vl_api_lisp_gpe_add_del_tunnel_t_print -(vl_api_lisp_gpe_add_del_tunnel_t * mp, void *handle) -{ - u8 * s; - - s = format (0, "SCRIPT: lisp_gpe_add_del_tunnel "); - - s = format (s, "src %U dst %U ", format_ip4_address, &mp->src, - format_ip4_address, &mp->dst); - - if (mp->encap_vrf_id) - s = format (s, "encap-vrf-id %d ", ntohl(mp->encap_vrf_id)); - - if (mp->decap_vrf_id) - s = format (s, "decap-vrf-id %d ", ntohl(mp->decap_vrf_id)); - - s = format (s, "decap-next %d ", ntohl(mp->decap_next_index)); - - s = format (s, "flags %x ", (u32)(mp->flags)); - - if (mp->ver_res) - s = format (s, "ver_res %x ", (u32)(mp->ver_res)); - - if (mp->res) - s = format (s, "res %x ", (u32)(mp->res)); - - s = format (s, "iid %d ", ntohl (mp->iid)); - - if (mp->is_add == 0) - s = format (s, "del "); - - if (mp->next_protocol == 1) - s = format (s, "next-ip4 "); - else if (mp->next_protocol == 2) - s = format (s, "next-ip6 "); - else if (mp->next_protocol == 3) - s = format (s, "next-ethernet "); - else if (mp->next_protocol == 4) - s = format (s, "next-nsh "); - FINISH; } @@ -1915,10 +1787,8 @@ _(CLI_REQUEST, cli_request) \ _(MEMCLNT_CREATE, memclnt_create) \ _(SW_INTERFACE_VHOST_USER_DUMP, sw_interface_vhost_user_dump) \ _(SHOW_VERSION, show_version) \ -_(NSH_GRE_ADD_DEL_TUNNEL, nsh_gre_add_del_tunnel) \ _(L2_FIB_TABLE_DUMP, l2_fib_table_dump) \ -_(NSH_VXLAN_GPE_ADD_DEL_TUNNEL, nsh_vxlan_gpe_add_del_tunnel) \ -_(LISP_GPE_ADD_DEL_TUNNEL, lisp_gpe_add_del_tunnel) \ +_(VXLAN_GPE_ADD_DEL_TUNNEL, vxlan_gpe_add_del_tunnel) \ _(INTERFACE_NAME_RENUMBER, interface_name_renumber) \ _(WANT_IP4_ARP_EVENTS, want_ip4_arp_events) \ _(INPUT_ACL_SET_INTERFACE, input_acl_set_interface) \