X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvpp%2Fapi%2Fcustom_dump.c;h=f27acda24dd822edfdc7b7159512ff2aaee9d36b;hb=70bfcaf47779340951c1e6f169b1cedcabe708d1;hp=be74b83ace807a823e633482bc7bdc7faf883b60;hpb=1500254bee11355bbd69cc1dd9705be4f002f2bd;p=vpp.git diff --git a/src/vpp/api/custom_dump.c b/src/vpp/api/custom_dump.c index be74b83ace8..f27acda24dd 100644 --- a/src/vpp/api/custom_dump.c +++ b/src/vpp/api/custom_dump.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -229,6 +230,26 @@ static void *vl_api_sw_interface_set_vxlan_bypass_t_print FINISH; } +static void *vl_api_sw_interface_set_geneve_bypass_t_print + (vl_api_sw_interface_set_geneve_bypass_t * mp, void *handle) +{ + u8 *s; + + s = format (0, "SCRIPT: sw_interface_set_geneve_bypass "); + + s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index)); + + if (mp->is_ipv6) + s = format (s, "ip6 "); + + if (mp->enable) + s = format (s, "enable "); + else + s = format (s, "disable "); + + FINISH; +} + static void *vl_api_sw_interface_set_l2_xconnect_t_print (vl_api_sw_interface_set_l2_xconnect_t * mp, void *handle) { @@ -279,6 +300,8 @@ static void *vl_api_bridge_domain_add_del_t_print if (mp->is_add) { + if (mp->bd_tag[0]) + s = format (s, "bd_tag %s ", mp->bd_tag); s = format (s, "flood %d uu-flood %d ", mp->flood, mp->uu_flood); s = format (s, "forward %d learn %d ", mp->forward, mp->learn); s = format (s, "arp-term %d mac-age %d", mp->arp_term, mp->mac_age); @@ -359,7 +382,7 @@ static void *vl_api_l2fib_add_del_t_print s = format (0, "SCRIPT: l2fib_add_del "); - s = format (s, "mac %U ", format_ethernet_address, &mp->mac); + s = format (s, "mac %U ", format_ethernet_address, mp->mac); s = format (s, "bd_id %d ", ntohl (mp->bd_id)); @@ -563,9 +586,6 @@ static void *vl_api_ip_add_del_route_t_print if (mp->next_hop_weight != 1) s = format (s, "weight %d ", mp->next_hop_weight); - if (mp->not_last) - s = format (s, "not-last "); - if (mp->is_multipath) s = format (s, "multipath "); @@ -688,22 +708,6 @@ static void *vl_api_ip_neighbor_add_del_t_print FINISH; } -static void * -vl_api_reset_vrf_t_print (vl_api_reset_vrf_t * mp, void *handle) -{ - u8 *s; - - s = format (0, "SCRIPT: reset_vrf "); - - if (mp->vrf_id) - s = format (s, "vrf %d ", ntohl (mp->vrf_id)); - - if (mp->is_ipv6 != 0) - s = format (s, "ipv6 "); - - FINISH; -} - static void *vl_api_create_vlan_subif_t_print (vl_api_create_vlan_subif_t * mp, void *handle) { @@ -840,9 +844,13 @@ static void *vl_api_dhcp_proxy_set_vss_t_print s = format (s, "tbl_id %d ", ntohl (mp->tbl_id)); - s = format (s, "fib_id %d ", ntohl (mp->fib_id)); - - s = format (s, "oui %d ", ntohl (mp->oui)); + if (mp->vss_type == VSS_TYPE_VPN_ID) + { + s = format (s, "fib_id %d ", ntohl (mp->vpn_index)); + s = format (s, "oui %d ", ntohl (mp->oui)); + } + else if (mp->vss_type == VSS_TYPE_ASCII) + s = format (s, "vpn_ascii_id %s", mp->vpn_ascii_id); if (mp->is_ipv6 != 0) s = format (s, "ipv6 "); @@ -1493,6 +1501,50 @@ static void *vl_api_vxlan_tunnel_dump_t_print FINISH; } +static void *vl_api_geneve_add_del_tunnel_t_print + (vl_api_geneve_add_del_tunnel_t * mp, void *handle) +{ + u8 *s; + s = format (0, "SCRIPT: geneve_add_del_tunnel "); + + ip46_address_t local = to_ip46 (mp->is_ipv6, mp->local_address); + ip46_address_t remote = to_ip46 (mp->is_ipv6, mp->remote_address); + + u8 is_grp = ip46_address_is_multicast (&remote); + char *remote_name = is_grp ? "group" : "dst"; + + s = format (s, "src %U ", format_ip46_address, &local, IP46_TYPE_ANY); + s = format (s, "%s %U ", remote_name, format_ip46_address, + &remote, IP46_TYPE_ANY); + + if (is_grp) + s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index)); + + if (mp->encap_vrf_id) + s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id)); + + s = format (s, "decap-next %d ", ntohl (mp->decap_next_index)); + + s = format (s, "vni %d ", ntohl (mp->vni)); + + if (mp->is_add == 0) + s = format (s, "del "); + + FINISH; +} + +static void *vl_api_geneve_tunnel_dump_t_print + (vl_api_geneve_tunnel_dump_t * mp, void *handle) +{ + u8 *s; + + s = format (0, "SCRIPT: geneve_tunnel_dump "); + + s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index)); + + FINISH; +} + static void *vl_api_gre_add_del_tunnel_t_print (vl_api_gre_add_del_tunnel_t * mp, void *handle) { @@ -1708,6 +1760,16 @@ static void *vl_api_memclnt_create_t_print FINISH; } +static void *vl_api_sockclnt_create_t_print + (vl_api_sockclnt_create_t * mp, void *handle) +{ + u8 *s; + + s = format (0, "SCRIPT: sockclnt_create name %s ", mp->name); + + FINISH; +} + static void *vl_api_show_version_t_print (vl_api_show_version_t * mp, void *handle) { @@ -3025,6 +3087,155 @@ static void *vl_api_tcp_configure_src_addresses_t_print FINISH; } +static void *vl_api_app_namespace_add_del_t_print + (vl_api_app_namespace_add_del_t * mp, void *handle) +{ + u8 *s, *ns_id = 0; + u8 len = clib_min (mp->namespace_id_len, + ARRAY_LEN (mp->namespace_id) - 1); + mp->namespace_id[len] = 0; + s = format (0, "SCRIPT: app_namespace_add_del "); + s = format (s, "ns-id %s secret %lu sw_if_index %d ipv4_fib_id %d " + "ipv6_fib_id %d", (char *) mp->namespace_id, mp->secret, + clib_net_to_host_u32 (mp->sw_if_index), + clib_net_to_host_u32 (mp->ip4_fib_id), + clib_net_to_host_u32 (mp->ip6_fib_id)); + FINISH; +} + +static void *vl_api_lldp_config_t_print + (vl_api_lldp_config_t * mp, void *handle) +{ + u8 *s; + + s = format (0, "SCRIPT: lldp_config "); + s = format (s, "system_name %s ", mp->system_name); + s = format (s, "tx_hold %d ", ntohl (mp->tx_hold)); + s = format (s, "tx_interval %d ", ntohl (mp->tx_interval)); + FINISH; +} + +static void *vl_api_dns_enable_disable_t_print + (vl_api_dns_enable_disable_t * mp, void *handle) +{ + u8 *s; + + s = format (0, "SCRIPT: dns_enable_disable "); + s = format (s, "%s ", mp->enable ? "enable" : "disable"); + + FINISH; +} + +static void *vl_api_sw_interface_set_lldp_t_print + (vl_api_sw_interface_set_lldp_t * mp, void *handle) +{ + u8 *s; + u8 null_data[128]; + + memset (null_data, 0, sizeof (null_data)); + + s = format (0, "SCRIPT: sw_interface_set_lldp "); + s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index)); + + if (memcmp (mp->port_desc, null_data, sizeof (mp->port_desc))) + s = format (s, "port_desc %s ", mp->port_desc); + + if (memcmp (mp->mgmt_ip4, null_data, sizeof (mp->mgmt_ip4))) + s = format (s, "mgmt_ip4 %U ", format_ip4_address, mp->mgmt_ip4); + + if (memcmp (mp->mgmt_ip6, null_data, sizeof (mp->mgmt_ip6))) + s = format (s, "mgmt_ip6 %U ", format_ip6_address, mp->mgmt_ip6); + + if (memcmp (mp->mgmt_oid, null_data, sizeof (mp->mgmt_oid))) + s = format (s, "mgmt_oid %s ", mp->mgmt_oid); + + if (mp->enable == 0) + s = format (s, "disable "); + + FINISH; +} + +static void *vl_api_dns_name_server_add_del_t_print + (vl_api_dns_name_server_add_del_t * mp, void *handle) +{ + u8 *s; + + s = format (0, "SCRIPT: dns_name_server_add_del "); + if (mp->is_ip6) + s = format (s, "%U ", format_ip6_address, + (ip6_address_t *) mp->server_address); + else + s = format (s, "%U ", format_ip4_address, + (ip4_address_t *) mp->server_address); + + if (mp->is_add == 0) + s = format (s, "del "); + + FINISH; +} + +static void *vl_api_dns_resolve_name_t_print + (vl_api_dns_resolve_name_t * mp, void *handle) +{ + u8 *s; + + s = format (0, "SCRIPT: dns_resolve_name "); + s = format (s, "%s ", mp->name); + FINISH; +} + +static void *vl_api_dns_resolve_ip_t_print + (vl_api_dns_resolve_ip_t * mp, void *handle) +{ + u8 *s; + + s = format (0, "SCRIPT: dns_resolve_ip "); + if (mp->is_ip6) + s = format (s, "%U ", format_ip6_address, mp->address); + else + s = format (s, "%U ", format_ip4_address, mp->address); + FINISH; +} + +static void *vl_api_session_rule_add_del_t_print + (vl_api_session_rule_add_del_t * mp, void *handle) +{ + u8 *s; + char *proto = mp->transport_proto == 0 ? "tcp" : "udp"; + s = format (0, "SCRIPT: session_rule_add_del "); + mp->tag[sizeof (mp->tag) - 1] = 0; + if (mp->is_ip4) + s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u tag %s", + mp->appns_index, mp->scope, proto, format_ip4_address, + (ip4_address_t *) mp->lcl_ip, mp->lcl_plen, + format_ip4_address, (ip4_address_t *) mp->rmt_ip, + mp->rmt_plen, mp->action_index, mp->tag); + else + s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u tag %s", + mp->appns_index, mp->scope, proto, format_ip6_address, + (ip6_address_t *) mp->lcl_ip, mp->lcl_plen, + format_ip6_address, (ip6_address_t *) mp->rmt_ip, + mp->rmt_plen, mp->action_index, mp->tag); + FINISH; +} + +static void *vl_api_ip_container_proxy_add_del_t_print + (vl_api_ip_container_proxy_add_del_t * mp, void *handle) +{ + u8 *s; + s = format (0, "SCRIPT: ip_container_proxy_add_del "); + if (mp->is_ip4) + s = format (s, "is_add %d address %U/%d sw_if_index %d", + mp->is_add, format_ip4_address, + (ip4_address_t *) mp->ip, mp->plen, mp->sw_if_index); + else + s = format (s, "is_add %d address %U/%d sw_if_index %d", + mp->is_add, format_ip6_address, + (ip6_address_t *) mp->ip, mp->plen, mp->sw_if_index); + FINISH; +} + + #define foreach_custom_print_no_arg_function \ _(lisp_eid_table_vni_dump) \ _(lisp_map_resolver_dump) \ @@ -3053,6 +3264,7 @@ _(SW_INTERFACE_SET_TABLE, sw_interface_set_table) \ _(SW_INTERFACE_SET_MPLS_ENABLE, sw_interface_set_mpls_enable) \ _(SW_INTERFACE_SET_VPATH, sw_interface_set_vpath) \ _(SW_INTERFACE_SET_VXLAN_BYPASS, sw_interface_set_vxlan_bypass) \ +_(SW_INTERFACE_SET_GENEVE_BYPASS, sw_interface_set_geneve_bypass) \ _(TAP_CONNECT, tap_connect) \ _(TAP_MODIFY, tap_modify) \ _(TAP_DELETE, tap_delete) \ @@ -3063,7 +3275,6 @@ _(PROXY_ARP_INTFC_ENABLE_DISABLE, proxy_arp_intfc_enable_disable) \ _(MPLS_TUNNEL_ADD_DEL, mpls_tunnel_add_del) \ _(SW_INTERFACE_SET_UNNUMBERED, sw_interface_set_unnumbered) \ _(IP_NEIGHBOR_ADD_DEL, ip_neighbor_add_del) \ -_(RESET_VRF, reset_vrf) \ _(CREATE_VLAN_SUBIF, create_vlan_subif) \ _(CREATE_SUBIF, create_subif) \ _(OAM_ADD_DEL, oam_add_del) \ @@ -3106,6 +3317,8 @@ _(L2TPV3_SET_LOOKUP_KEY, l2tpv3_set_lookup_key) \ _(SW_IF_L2TPV3_TUNNEL_DUMP, sw_if_l2tpv3_tunnel_dump) \ _(VXLAN_ADD_DEL_TUNNEL, vxlan_add_del_tunnel) \ _(VXLAN_TUNNEL_DUMP, vxlan_tunnel_dump) \ +_(GENEVE_ADD_DEL_TUNNEL, geneve_add_del_tunnel) \ +_(GENEVE_TUNNEL_DUMP, geneve_tunnel_dump) \ _(GRE_ADD_DEL_TUNNEL, gre_add_del_tunnel) \ _(GRE_TUNNEL_DUMP, gre_tunnel_dump) \ _(L2_FIB_CLEAR_TABLE, l2_fib_clear_table) \ @@ -3120,6 +3333,7 @@ _(WANT_INTERFACE_EVENTS, want_interface_events) \ _(CLI, cli) \ _(CLI_INBAND, cli_inband) \ _(MEMCLNT_CREATE, memclnt_create) \ +_(SOCKCLNT_CREATE, sockclnt_create) \ _(SW_INTERFACE_VHOST_USER_DUMP, sw_interface_vhost_user_dump) \ _(SHOW_VERSION, show_version) \ _(L2_FIB_TABLE_DUMP, l2_fib_table_dump) \ @@ -3210,7 +3424,15 @@ _(SW_INTERFACE_TAG_ADD_DEL, sw_interface_tag_add_del) \ _(SW_INTERFACE_SET_MTU, sw_interface_set_mtu) \ _(P2P_ETHERNET_ADD, p2p_ethernet_add) \ _(P2P_ETHERNET_DEL, p2p_ethernet_del) \ -_(TCP_CONFIGURE_SRC_ADDRESSES, tcp_configure_src_addresses) +_(TCP_CONFIGURE_SRC_ADDRESSES, tcp_configure_src_addresses) \ +_(APP_NAMESPACE_ADD_DEL, app_namespace_add_del) \ +_(LLDP_CONFIG, lldp_config) \ +_(SW_INTERFACE_SET_LLDP, sw_interface_set_lldp) \ +_(DNS_ENABLE_DISABLE, dns_enable_disable) \ +_(DNS_NAME_SERVER_ADD_DEL, dns_name_server_add_del) \ +_(DNS_RESOLVE_NAME, dns_resolve_name) \ +_(DNS_RESOLVE_IP, dns_resolve_ip) \ +_(SESSION_RULE_ADD_DEL, session_rule_add_del) void vl_msg_api_custom_dump_configure (api_main_t * am) {