X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvpp%2Fapi%2Fcustom_dump.c;h=ee0c4629b50aa7d95a32c1b83639696b0d753c94;hb=c83c3b7f117b981b677f646a0e30f44ec70de239;hp=c2cd3d15a20e7177d2a7706f214bd685319097f5;hpb=738f3f2a170bace45180bc8718d5a7e75939b275;p=vpp.git diff --git a/src/vpp/api/custom_dump.c b/src/vpp/api/custom_dump.c index c2cd3d15a20..ee0c4629b50 100644 --- a/src/vpp/api/custom_dump.c +++ b/src/vpp/api/custom_dump.c @@ -21,8 +21,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -73,6 +72,18 @@ static void *vl_api_create_loopback_t_print FINISH; } +static void *vl_api_create_loopback_instance_t_print + (vl_api_create_loopback_instance_t * mp, void *handle) +{ + u8 *s; + + s = format (0, "SCRIPT: create_loopback "); + s = format (s, "mac %U ", format_ethernet_address, &mp->mac_address); + s = format (s, "instance %d ", ntohl (mp->user_instance)); + + FINISH; +} + static void *vl_api_delete_loopback_t_print (vl_api_delete_loopback_t * mp, void *handle) { @@ -238,58 +249,6 @@ static void *vl_api_sw_interface_set_l2_bridge_t_print FINISH; } -#if DPDK > 0 -static void *vl_api_sw_interface_set_dpdk_hqos_pipe_t_print - (vl_api_sw_interface_set_dpdk_hqos_pipe_t * mp, void *handle) -{ - u8 *s; - - s = format (0, "SCRIPT: sw_interface_set_dpdk_hqos_pipe "); - - s = format (s, "sw_if_index %u ", ntohl (mp->sw_if_index)); - - s = format (s, "subport %u pipe %u profile %u ", - ntohl (mp->subport), ntohl (mp->pipe), ntohl (mp->profile)); - - FINISH; -} - -static void *vl_api_sw_interface_set_dpdk_hqos_subport_t_print - (vl_api_sw_interface_set_dpdk_hqos_subport_t * mp, void *handle) -{ - u8 *s; - - s = format (0, "SCRIPT: sw_interface_set_dpdk_hqos_subport "); - - s = format (s, "sw_if_index %u ", ntohl (mp->sw_if_index)); - - s = - format (s, - "subport %u rate %u bkt_size %u tc0 %u tc1 %u tc2 %u tc3 %u period %u", - ntohl (mp->subport), ntohl (mp->tb_rate), ntohl (mp->tb_size), - ntohl (mp->tc_rate[0]), ntohl (mp->tc_rate[1]), - ntohl (mp->tc_rate[2]), ntohl (mp->tc_rate[3]), - ntohl (mp->tc_period)); - - FINISH; -} - -static void *vl_api_sw_interface_set_dpdk_hqos_tctbl_t_print - (vl_api_sw_interface_set_dpdk_hqos_tctbl_t * mp, void *handle) -{ - u8 *s; - - s = format (0, "SCRIPT: sw_interface_set_dpdk_hqos_tctbl "); - - s = format (s, "sw_if_index %u ", ntohl (mp->sw_if_index)); - - s = format (s, "entry %u tc %u queue %u", - ntohl (mp->entry), ntohl (mp->tc), ntohl (mp->queue)); - - FINISH; -} -#endif - static void *vl_api_bridge_domain_add_del_t_print (vl_api_bridge_domain_add_del_t * mp, void *handle) { @@ -438,7 +397,12 @@ static void *vl_api_tap_connect_t_print s = format (s, "tag %s ", mp->tag); if (memcmp (mp->mac_address, null_mac, 6)) s = format (s, "mac %U ", format_ethernet_address, mp->mac_address); - + if (mp->ip4_address_set) + s = format (s, "address %U/%d ", format_ip4_address, mp->ip4_address, + mp->ip4_mask_width); + if (mp->ip6_address_set) + s = format (s, "address %U/%d ", format_ip6_address, mp->ip6_address, + mp->ip6_mask_width); FINISH; } @@ -629,8 +593,6 @@ static void *vl_api_ip_neighbor_add_del_t_print if (mp->is_static) s = format (s, "is_static "); - s = format (s, "vrf_id %d ", ntohl (mp->vrf_id)); - if (memcmp (mp->mac_address, null_mac, 6)) s = format (s, "mac %U ", format_ethernet_address, mp->mac_address); @@ -767,37 +729,6 @@ static void *vl_api_dhcp_proxy_config_t_print { u8 *s; - s = format (0, "SCRIPT: dhcp_proxy_config "); - - s = format (s, "vrf_id %d ", ntohl (mp->vrf_id)); - - if (mp->is_ipv6) - { - s = format (s, "svr %U ", format_ip6_address, - (ip6_address_t *) mp->dhcp_server); - s = format (s, "src %U ", format_ip6_address, - (ip6_address_t *) mp->dhcp_src_address); - } - else - { - s = format (s, "svr %U ", format_ip4_address, - (ip4_address_t *) mp->dhcp_server); - s = format (s, "src %U ", format_ip4_address, - (ip4_address_t *) mp->dhcp_src_address); - } - if (mp->is_add == 0) - s = format (s, "del "); - - s = format (s, "insert-cid %d ", mp->insert_circuit_id); - - FINISH; -} - -static void *vl_api_dhcp_proxy_config_2_t_print - (vl_api_dhcp_proxy_config_2_t * mp, void *handle) -{ - u8 *s; - s = format (0, "SCRIPT: dhcp_proxy_config_2 "); s = format (s, "rx_vrf_id %d ", ntohl (mp->rx_vrf_id)); @@ -820,8 +751,6 @@ static void *vl_api_dhcp_proxy_config_2_t_print if (mp->is_add == 0) s = format (s, "del "); - s = format (s, "insert-cid %d ", mp->insert_circuit_id); - FINISH; } @@ -911,8 +840,7 @@ static void *vl_api_sw_interface_ip6_set_link_local_address_t_print s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index)); - s = format (s, "%U/%d ", format_ip6_address, mp->address, - mp->address_length); + s = format (s, "%U ", format_ip6_address, mp->address); FINISH; } @@ -2325,12 +2253,12 @@ static void *vl_api_lisp_enable_disable_t_print FINISH; } -static void *vl_api_lisp_gpe_add_del_iface_t_print - (vl_api_lisp_gpe_add_del_iface_t * mp, void *handle) +static void *vl_api_gpe_add_del_iface_t_print + (vl_api_gpe_add_del_iface_t * mp, void *handle) { u8 *s; - s = format (0, "SCRIPT: lisp_gpe_add_del_iface "); + s = format (0, "SCRIPT: gpe_add_del_iface "); s = format (s, "%s ", mp->is_add ? "up" : "down"); s = format (s, "vni %d ", mp->vni); @@ -2373,34 +2301,6 @@ format_lisp_flat_eid (u8 * s, va_list * args) return 0; } -/** Used for transferring locators via VPP API */ -typedef CLIB_PACKED (struct - { - u8 is_ip4; - /**< is locator an IPv4 address */ - u8 priority; - /**< locator priority */ - u8 weight; - /**< locator weight */ - u8 addr[16]; - /**< IPv4/IPv6 address */ - }) rloc_t; - -static u8 * -format_rloc (u8 * s, va_list * args) -{ - rloc_t *rloc = va_arg (*args, rloc_t *); - - if (rloc->is_ip4) - s = format (s, "%U ", format_ip4_address, rloc->addr); - else - s = format (s, "%U ", format_ip6_address, rloc->addr); - - s = format (s, "p %d w %d", rloc->priority, rloc->weight); - - return s; -} - static void *vl_api_lisp_add_del_remote_mapping_t_print (vl_api_lisp_add_del_remote_mapping_t * mp, void *handle) { @@ -2428,12 +2328,6 @@ static void *vl_api_lisp_add_del_remote_mapping_t_print if (0 == rloc_num) s = format (s, "action %d", mp->action); - else - { - rloc_t *rloc = (rloc_t *) mp->rlocs; - for (i = 0; i < rloc_num; i++) - s = format (s, "%U ", format_rloc, &rloc[i]); - } FINISH; } @@ -2509,12 +2403,12 @@ static void *vl_api_lisp_add_del_local_eid_t_print FINISH; } -static void *vl_api_lisp_gpe_add_del_fwd_entry_t_print - (vl_api_lisp_gpe_add_del_fwd_entry_t * mp, void *handle) +static void *vl_api_gpe_add_del_fwd_entry_t_print + (vl_api_gpe_add_del_fwd_entry_t * mp, void *handle) { u8 *s; - s = format (0, "SCRIPT: lisp_gpe_add_del_fwd_entry TODO"); + s = format (0, "SCRIPT: gpe_add_del_fwd_entry TODO"); FINISH; } @@ -2537,43 +2431,23 @@ static void *vl_api_lisp_add_del_map_resolver_t_print FINISH; } -static void *vl_api_lisp_gpe_enable_disable_t_print - (vl_api_lisp_gpe_enable_disable_t * mp, void *handle) +static void *vl_api_gpe_enable_disable_t_print + (vl_api_gpe_enable_disable_t * mp, void *handle) { u8 *s; - s = format (0, "SCRIPT: lisp_gpe_enable_disable "); + s = format (0, "SCRIPT: gpe_enable_disable "); s = format (s, "%s ", mp->is_en ? "enable" : "disable"); FINISH; } -typedef CLIB_PACKED (struct - { - u32 sw_if_index; - /**< locator sw_if_index */ - u8 priority; - /**< locator priority */ - u8 weight; - /**< locator weight */ - }) ls_locator_t; - -static u8 * -format_locator (u8 * s, va_list * args) -{ - ls_locator_t *l = va_arg (*args, ls_locator_t *); - - return format (s, "sw_if_index %d p %d w %d", - l->sw_if_index, l->priority, l->weight); -} - static void *vl_api_lisp_add_del_locator_set_t_print (vl_api_lisp_add_del_locator_set_t * mp, void *handle) { u8 *s; u32 loc_num = 0, i; - ls_locator_t *locs; s = format (0, "SCRIPT: lisp_add_del_locator_set "); @@ -2583,10 +2457,6 @@ static void *vl_api_lisp_add_del_locator_set_t_print s = format (s, "locator-set %s ", mp->locator_set_name); loc_num = clib_net_to_host_u32 (mp->locator_num); - locs = (ls_locator_t *) mp->locators; - - for (i = 0; i < loc_num; i++) - s = format (s, "%U ", format_locator, &locs[i]); FINISH; } @@ -2949,8 +2819,7 @@ _(lisp_map_resolver_dump) \ _(lisp_map_server_dump) \ _(show_lisp_rloc_probe_state) \ _(show_lisp_map_register_state) \ -_(show_lisp_map_request_mode) \ -_(lisp_gpe_tunnel_dump) +_(show_lisp_map_request_mode) #define _(f) \ static void * vl_api_ ## f ## _t_print \ @@ -2964,6 +2833,7 @@ foreach_custom_print_no_arg_function #undef _ #define foreach_custom_print_function \ _(CREATE_LOOPBACK, create_loopback) \ +_(CREATE_LOOPBACK_INSTANCE, create_loopback_instance) \ _(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags) \ _(SW_INTERFACE_ADD_DEL_ADDRESS, sw_interface_add_del_address) \ _(SW_INTERFACE_SET_TABLE, sw_interface_set_table) \ @@ -3009,7 +2879,6 @@ _(BRIDGE_DOMAIN_DUMP, bridge_domain_dump) \ _(CLASSIFY_SET_INTERFACE_IP_TABLE, classify_set_interface_ip_table) \ _(CLASSIFY_SET_INTERFACE_L2_TABLES, classify_set_interface_l2_tables) \ _(ADD_NODE_NEXT, add_node_next) \ -_(DHCP_PROXY_CONFIG_2, dhcp_proxy_config_2) \ _(DHCP_CLIENT_CONFIG, dhcp_client_config) \ _(L2TPV3_CREATE_TUNNEL, l2tpv3_create_tunnel) \ _(L2TPV3_SET_TUNNEL_COOKIES, l2tpv3_set_tunnel_cookies) \ @@ -3077,8 +2946,8 @@ _(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, \ _(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, \ ip_source_and_port_range_check_interface_add_del) \ _(LISP_ENABLE_DISABLE, lisp_enable_disable) \ -_(LISP_GPE_ENABLE_DISABLE, lisp_gpe_enable_disable) \ -_(LISP_GPE_ADD_DEL_IFACE, lisp_gpe_add_del_iface) \ +_(GPE_ENABLE_DISABLE, gpe_enable_disable) \ +_(GPE_ADD_DEL_IFACE, gpe_add_del_iface) \ _(LISP_PITR_SET_LOCATOR_SET, lisp_pitr_set_locator_set) \ _(LISP_MAP_REQUEST_MODE, lisp_map_request_mode) \ _(SHOW_LISP_MAP_REQUEST_MODE, show_lisp_map_request_mode) \ @@ -3088,14 +2957,13 @@ _(LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS, \ lisp_add_del_map_request_itr_rlocs) \ _(LISP_EID_TABLE_ADD_DEL_MAP, lisp_eid_table_add_del_map) \ _(LISP_ADD_DEL_LOCAL_EID, lisp_add_del_local_eid) \ -_(LISP_GPE_ADD_DEL_FWD_ENTRY, lisp_gpe_add_del_fwd_entry) \ +_(GPE_ADD_DEL_FWD_ENTRY, gpe_add_del_fwd_entry) \ _(LISP_ADD_DEL_LOCATOR_SET, lisp_add_del_locator_set) \ _(LISP_ADD_DEL_MAP_RESOLVER, lisp_add_del_map_resolver) \ _(LISP_ADD_DEL_LOCATOR, lisp_add_del_locator) \ _(LISP_EID_TABLE_DUMP, lisp_eid_table_dump) \ _(LISP_EID_TABLE_MAP_DUMP, lisp_eid_table_map_dump) \ _(LISP_EID_TABLE_VNI_DUMP, lisp_eid_table_vni_dump) \ -_(LISP_GPE_TUNNEL_DUMP, lisp_gpe_tunnel_dump) \ _(LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump) \ _(LISP_MAP_SERVER_DUMP, lisp_map_server_dump) \ _(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump) \ @@ -3127,18 +2995,6 @@ vl_msg_api_custom_dump_configure (api_main_t * am) = (void *) vl_api_##f##_t_print; foreach_custom_print_function; #undef _ - -#if DPDK > 0 - /* - * manually add DPDK hqos print handlers - */ - am->msg_print_handlers[VL_API_SW_INTERFACE_SET_DPDK_HQOS_PIPE] = - (void *) vl_api_sw_interface_set_dpdk_hqos_pipe_t_print; - am->msg_print_handlers[VL_API_SW_INTERFACE_SET_DPDK_HQOS_SUBPORT] = - (void *) vl_api_sw_interface_set_dpdk_hqos_subport_t_print; - am->msg_print_handlers[VL_API_SW_INTERFACE_SET_DPDK_HQOS_TCTBL] = - (void *) vl_api_sw_interface_set_dpdk_hqos_tctbl_t_print; -#endif } /*