-#define foreach_vpe_api_reply_msg \
-_(CREATE_LOOPBACK_REPLY, create_loopback_reply) \
-_(SW_INTERFACE_DETAILS, sw_interface_details) \
-_(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags) \
-_(SW_INTERFACE_SET_FLAGS_REPLY, sw_interface_set_flags_reply) \
-_(CONTROL_PING_REPLY, control_ping_reply) \
-_(CLI_REPLY, cli_reply) \
-_(CLI_INBAND_REPLY, cli_inband_reply) \
-_(SW_INTERFACE_ADD_DEL_ADDRESS_REPLY, \
- sw_interface_add_del_address_reply) \
-_(SW_INTERFACE_SET_TABLE_REPLY, sw_interface_set_table_reply) \
-_(SW_INTERFACE_SET_MPLS_ENABLE_REPLY, sw_interface_set_mpls_enable_reply) \
-_(SW_INTERFACE_SET_VPATH_REPLY, sw_interface_set_vpath_reply) \
-_(SW_INTERFACE_SET_VXLAN_BYPASS_REPLY, sw_interface_set_vxlan_bypass_reply) \
-_(SW_INTERFACE_SET_L2_XCONNECT_REPLY, \
- sw_interface_set_l2_xconnect_reply) \
-_(SW_INTERFACE_SET_L2_BRIDGE_REPLY, \
- sw_interface_set_l2_bridge_reply) \
-_(BRIDGE_DOMAIN_ADD_DEL_REPLY, bridge_domain_add_del_reply) \
-_(BRIDGE_DOMAIN_DETAILS, bridge_domain_details) \
-_(BRIDGE_DOMAIN_SW_IF_DETAILS, bridge_domain_sw_if_details) \
-_(L2FIB_ADD_DEL_REPLY, l2fib_add_del_reply) \
-_(L2_FLAGS_REPLY, l2_flags_reply) \
-_(BRIDGE_FLAGS_REPLY, bridge_flags_reply) \
-_(TAP_CONNECT_REPLY, tap_connect_reply) \
-_(TAP_MODIFY_REPLY, tap_modify_reply) \
-_(TAP_DELETE_REPLY, tap_delete_reply) \
-_(SW_INTERFACE_TAP_DETAILS, sw_interface_tap_details) \
-_(IP_ADD_DEL_ROUTE_REPLY, ip_add_del_route_reply) \
-_(IP_MROUTE_ADD_DEL_REPLY, ip_mroute_add_del_reply) \
-_(MPLS_ROUTE_ADD_DEL_REPLY, mpls_route_add_del_reply) \
-_(MPLS_IP_BIND_UNBIND_REPLY, mpls_ip_bind_unbind_reply) \
-_(PROXY_ARP_ADD_DEL_REPLY, proxy_arp_add_del_reply) \
-_(PROXY_ARP_INTFC_ENABLE_DISABLE_REPLY, \
- proxy_arp_intfc_enable_disable_reply) \
-_(MPLS_TUNNEL_ADD_DEL_REPLY, mpls_tunnel_add_del_reply) \
-_(SW_INTERFACE_SET_UNNUMBERED_REPLY, \
- sw_interface_set_unnumbered_reply) \
-_(IP_NEIGHBOR_ADD_DEL_REPLY, ip_neighbor_add_del_reply) \
-_(RESET_VRF_REPLY, reset_vrf_reply) \
-_(CREATE_VLAN_SUBIF_REPLY, create_vlan_subif_reply) \
-_(CREATE_SUBIF_REPLY, create_subif_reply) \
-_(OAM_ADD_DEL_REPLY, oam_add_del_reply) \
-_(RESET_FIB_REPLY, reset_fib_reply) \
-_(DHCP_PROXY_CONFIG_REPLY, dhcp_proxy_config_reply) \
-_(DHCP_PROXY_SET_VSS_REPLY, dhcp_proxy_set_vss_reply) \
-_(DHCP_PROXY_DETAILS, dhcp_proxy_details) \
-_(DHCP_CLIENT_CONFIG_REPLY, dhcp_client_config_reply) \
-_(SET_IP_FLOW_HASH_REPLY, set_ip_flow_hash_reply) \
-_(SW_INTERFACE_IP6_ENABLE_DISABLE_REPLY, \
- sw_interface_ip6_enable_disable_reply) \
-_(SW_INTERFACE_IP6_SET_LINK_LOCAL_ADDRESS_REPLY, \
- sw_interface_ip6_set_link_local_address_reply) \
-_(SW_INTERFACE_IP6ND_RA_PREFIX_REPLY, \
- sw_interface_ip6nd_ra_prefix_reply) \
-_(SW_INTERFACE_IP6ND_RA_CONFIG_REPLY, \
- sw_interface_ip6nd_ra_config_reply) \
-_(SET_ARP_NEIGHBOR_LIMIT_REPLY, set_arp_neighbor_limit_reply) \
-_(L2_PATCH_ADD_DEL_REPLY, l2_patch_add_del_reply) \
-_(SR_TUNNEL_ADD_DEL_REPLY, sr_tunnel_add_del_reply) \
-_(SR_POLICY_ADD_DEL_REPLY, sr_policy_add_del_reply) \
-_(SR_MULTICAST_MAP_ADD_DEL_REPLY, sr_multicast_map_add_del_reply) \
-_(CLASSIFY_ADD_DEL_TABLE_REPLY, classify_add_del_table_reply) \
-_(CLASSIFY_ADD_DEL_SESSION_REPLY, classify_add_del_session_reply) \
-_(CLASSIFY_SET_INTERFACE_IP_TABLE_REPLY, \
-classify_set_interface_ip_table_reply) \
-_(CLASSIFY_SET_INTERFACE_L2_TABLES_REPLY, \
- classify_set_interface_l2_tables_reply) \
-_(GET_NODE_INDEX_REPLY, get_node_index_reply) \
-_(ADD_NODE_NEXT_REPLY, add_node_next_reply) \
-_(L2TPV3_CREATE_TUNNEL_REPLY, l2tpv3_create_tunnel_reply) \
-_(L2TPV3_SET_TUNNEL_COOKIES_REPLY, l2tpv3_set_tunnel_cookies_reply) \
-_(L2TPV3_INTERFACE_ENABLE_DISABLE_REPLY, \
- l2tpv3_interface_enable_disable_reply) \
-_(L2TPV3_SET_LOOKUP_KEY_REPLY, l2tpv3_set_lookup_key_reply) \
-_(SW_IF_L2TPV3_TUNNEL_DETAILS, sw_if_l2tpv3_tunnel_details) \
-_(VXLAN_ADD_DEL_TUNNEL_REPLY, vxlan_add_del_tunnel_reply) \
-_(VXLAN_TUNNEL_DETAILS, vxlan_tunnel_details) \
-_(GRE_ADD_DEL_TUNNEL_REPLY, gre_add_del_tunnel_reply) \
-_(GRE_TUNNEL_DETAILS, gre_tunnel_details) \
-_(L2_FIB_CLEAR_TABLE_REPLY, l2_fib_clear_table_reply) \
-_(L2_INTERFACE_EFP_FILTER_REPLY, l2_interface_efp_filter_reply) \
-_(L2_INTERFACE_VLAN_TAG_REWRITE_REPLY, l2_interface_vlan_tag_rewrite_reply) \
-_(SW_INTERFACE_VHOST_USER_DETAILS, sw_interface_vhost_user_details) \
-_(CREATE_VHOST_USER_IF_REPLY, create_vhost_user_if_reply) \
-_(MODIFY_VHOST_USER_IF_REPLY, modify_vhost_user_if_reply) \
-_(DELETE_VHOST_USER_IF_REPLY, delete_vhost_user_if_reply) \
-_(SHOW_VERSION_REPLY, show_version_reply) \
-_(L2_FIB_TABLE_ENTRY, l2_fib_table_entry) \
-_(VXLAN_GPE_ADD_DEL_TUNNEL_REPLY, vxlan_gpe_add_del_tunnel_reply) \
-_(VXLAN_GPE_TUNNEL_DETAILS, vxlan_gpe_tunnel_details) \
-_(INTERFACE_NAME_RENUMBER_REPLY, interface_name_renumber_reply) \
-_(WANT_IP4_ARP_EVENTS_REPLY, want_ip4_arp_events_reply) \
-_(IP4_ARP_EVENT, ip4_arp_event) \
-_(WANT_IP6_ND_EVENTS_REPLY, want_ip6_nd_events_reply) \
-_(IP6_ND_EVENT, ip6_nd_event) \
-_(INPUT_ACL_SET_INTERFACE_REPLY, input_acl_set_interface_reply) \
-_(IP_ADDRESS_DETAILS, ip_address_details) \
-_(IP_DETAILS, ip_details) \
-_(IPSEC_SPD_ADD_DEL_REPLY, ipsec_spd_add_del_reply) \
-_(IPSEC_INTERFACE_ADD_DEL_SPD_REPLY, ipsec_interface_add_del_spd_reply) \
-_(IPSEC_SPD_ADD_DEL_ENTRY_REPLY, ipsec_spd_add_del_entry_reply) \
-_(IPSEC_SAD_ADD_DEL_ENTRY_REPLY, ipsec_sad_add_del_entry_reply) \
-_(IPSEC_SA_SET_KEY_REPLY, ipsec_sa_set_key_reply) \
-_(IKEV2_PROFILE_ADD_DEL_REPLY, ikev2_profile_add_del_reply) \
-_(IKEV2_PROFILE_SET_AUTH_REPLY, ikev2_profile_set_auth_reply) \
-_(IKEV2_PROFILE_SET_ID_REPLY, ikev2_profile_set_id_reply) \
-_(IKEV2_PROFILE_SET_TS_REPLY, ikev2_profile_set_ts_reply) \
-_(IKEV2_SET_LOCAL_KEY_REPLY, ikev2_set_local_key_reply) \
-_(IKEV2_SET_RESPONDER_REPLY, ikev2_set_responder_reply) \
-_(IKEV2_SET_IKE_TRANSFORMS_REPLY, ikev2_set_ike_transforms_reply) \
-_(IKEV2_SET_ESP_TRANSFORMS_REPLY, ikev2_set_esp_transforms_reply) \
-_(IKEV2_SET_SA_LIFETIME_REPLY, ikev2_set_sa_lifetime_reply) \
-_(IKEV2_INITIATE_SA_INIT_REPLY, ikev2_initiate_sa_init_reply) \
-_(IKEV2_INITIATE_DEL_IKE_SA_REPLY, ikev2_initiate_del_ike_sa_reply) \
-_(IKEV2_INITIATE_DEL_CHILD_SA_REPLY, ikev2_initiate_del_child_sa_reply) \
-_(IKEV2_INITIATE_REKEY_CHILD_SA_REPLY, ikev2_initiate_rekey_child_sa_reply) \
-_(DELETE_LOOPBACK_REPLY, delete_loopback_reply) \
-_(BD_IP_MAC_ADD_DEL_REPLY, bd_ip_mac_add_del_reply) \
-_(DHCP_COMPL_EVENT, dhcp_compl_event) \
-_(VNET_INTERFACE_COUNTERS, vnet_interface_counters) \
-_(VNET_IP4_FIB_COUNTERS, vnet_ip4_fib_counters) \
-_(VNET_IP6_FIB_COUNTERS, vnet_ip6_fib_counters) \
-_(VNET_IP4_NBR_COUNTERS, vnet_ip4_nbr_counters) \
-_(VNET_IP6_NBR_COUNTERS, vnet_ip6_nbr_counters) \
-_(MAP_ADD_DOMAIN_REPLY, map_add_domain_reply) \
-_(MAP_DEL_DOMAIN_REPLY, map_del_domain_reply) \
-_(MAP_ADD_DEL_RULE_REPLY, map_add_del_rule_reply) \
-_(MAP_DOMAIN_DETAILS, map_domain_details) \
-_(MAP_RULE_DETAILS, map_rule_details) \
-_(WANT_INTERFACE_EVENTS_REPLY, want_interface_events_reply) \
-_(WANT_STATS_REPLY, want_stats_reply) \
-_(GET_FIRST_MSG_ID_REPLY, get_first_msg_id_reply) \
-_(COP_INTERFACE_ENABLE_DISABLE_REPLY, cop_interface_enable_disable_reply) \
-_(COP_WHITELIST_ENABLE_DISABLE_REPLY, cop_whitelist_enable_disable_reply) \
-_(GET_NODE_GRAPH_REPLY, get_node_graph_reply) \
-_(SW_INTERFACE_CLEAR_STATS_REPLY, sw_interface_clear_stats_reply) \
-_(IOAM_ENABLE_REPLY, ioam_enable_reply) \
-_(IOAM_DISABLE_REPLY, ioam_disable_reply) \
-_(ONE_ADD_DEL_LOCATOR_SET_REPLY, one_add_del_locator_set_reply) \
-_(ONE_ADD_DEL_LOCATOR_REPLY, one_add_del_locator_reply) \
-_(ONE_ADD_DEL_LOCAL_EID_REPLY, one_add_del_local_eid_reply) \
-_(ONE_ADD_DEL_REMOTE_MAPPING_REPLY, one_add_del_remote_mapping_reply) \
-_(ONE_ADD_DEL_ADJACENCY_REPLY, one_add_del_adjacency_reply) \
-_(ONE_ADD_DEL_MAP_RESOLVER_REPLY, one_add_del_map_resolver_reply) \
-_(ONE_ADD_DEL_MAP_SERVER_REPLY, one_add_del_map_server_reply) \
-_(ONE_ENABLE_DISABLE_REPLY, one_enable_disable_reply) \
-_(ONE_MAP_REGISTER_ENABLE_DISABLE_REPLY, \
- one_map_register_enable_disable_reply) \
-_(ONE_RLOC_PROBE_ENABLE_DISABLE_REPLY, \
- one_rloc_probe_enable_disable_reply) \
-_(ONE_PITR_SET_LOCATOR_SET_REPLY, one_pitr_set_locator_set_reply) \
-_(ONE_MAP_REQUEST_MODE_REPLY, one_map_request_mode_reply) \
-_(ONE_EID_TABLE_ADD_DEL_MAP_REPLY, one_eid_table_add_del_map_reply) \
-_(ONE_LOCATOR_SET_DETAILS, one_locator_set_details) \
-_(ONE_LOCATOR_DETAILS, one_locator_details) \
-_(ONE_EID_TABLE_DETAILS, one_eid_table_details) \
-_(ONE_EID_TABLE_MAP_DETAILS, one_eid_table_map_details) \
-_(ONE_EID_TABLE_VNI_DETAILS, one_eid_table_vni_details) \
-_(ONE_MAP_RESOLVER_DETAILS, one_map_resolver_details) \
-_(ONE_MAP_SERVER_DETAILS, one_map_server_details) \
-_(ONE_ADJACENCIES_GET_REPLY, one_adjacencies_get_reply) \
-_(GPE_ADD_DEL_IFACE_REPLY, gpe_add_del_iface_reply) \
-_(GPE_ENABLE_DISABLE_REPLY, gpe_enable_disable_reply) \
-_(GPE_ADD_DEL_FWD_ENTRY_REPLY, gpe_add_del_fwd_entry_reply) \
-_(GPE_FWD_ENTRIES_GET_REPLY, gpe_fwd_entries_get_reply) \
-_(GPE_FWD_ENTRY_PATH_DETAILS, \
- gpe_fwd_entry_path_details) \
-_(SHOW_ONE_STATUS_REPLY, show_one_status_reply) \
-_(ONE_ADD_DEL_MAP_REQUEST_ITR_RLOCS_REPLY, \
- one_add_del_map_request_itr_rlocs_reply) \
-_(ONE_GET_MAP_REQUEST_ITR_RLOCS_REPLY, \
- one_get_map_request_itr_rlocs_reply) \
-_(SHOW_ONE_PITR_REPLY, show_one_pitr_reply) \
-_(SHOW_ONE_MAP_REQUEST_MODE_REPLY, show_one_map_request_mode_reply) \
-_(SHOW_ONE_RLOC_PROBE_STATE_REPLY, show_one_rloc_probe_state_reply) \
-_(SHOW_ONE_MAP_REGISTER_STATE_REPLY, \
- show_one_map_register_state_reply) \
-_(AF_PACKET_CREATE_REPLY, af_packet_create_reply) \
-_(AF_PACKET_DELETE_REPLY, af_packet_delete_reply) \
-_(POLICER_ADD_DEL_REPLY, policer_add_del_reply) \
-_(POLICER_DETAILS, policer_details) \
-_(POLICER_CLASSIFY_SET_INTERFACE_REPLY, policer_classify_set_interface_reply) \
-_(POLICER_CLASSIFY_DETAILS, policer_classify_details) \
-_(NETMAP_CREATE_REPLY, netmap_create_reply) \
-_(NETMAP_DELETE_REPLY, netmap_delete_reply) \
-_(MPLS_TUNNEL_DETAILS, mpls_tunnel_details) \
-_(MPLS_FIB_DETAILS, mpls_fib_details) \
-_(CLASSIFY_TABLE_IDS_REPLY, classify_table_ids_reply) \
-_(CLASSIFY_TABLE_BY_INTERFACE_REPLY, classify_table_by_interface_reply) \
-_(CLASSIFY_TABLE_INFO_REPLY, classify_table_info_reply) \
-_(CLASSIFY_SESSION_DETAILS, classify_session_details) \
-_(SET_IPFIX_EXPORTER_REPLY, set_ipfix_exporter_reply) \
-_(IPFIX_EXPORTER_DETAILS, ipfix_exporter_details) \
-_(SET_IPFIX_CLASSIFY_STREAM_REPLY, set_ipfix_classify_stream_reply) \
-_(IPFIX_CLASSIFY_STREAM_DETAILS, ipfix_classify_stream_details) \
-_(IPFIX_CLASSIFY_TABLE_ADD_DEL_REPLY, ipfix_classify_table_add_del_reply) \
-_(IPFIX_CLASSIFY_TABLE_DETAILS, ipfix_classify_table_details) \
-_(FLOW_CLASSIFY_SET_INTERFACE_REPLY, flow_classify_set_interface_reply) \
-_(FLOW_CLASSIFY_DETAILS, flow_classify_details) \
-_(SW_INTERFACE_SPAN_ENABLE_DISABLE_REPLY, sw_interface_span_enable_disable_reply) \
-_(SW_INTERFACE_SPAN_DETAILS, sw_interface_span_details) \
-_(GET_NEXT_INDEX_REPLY, get_next_index_reply) \
-_(PG_CREATE_INTERFACE_REPLY, pg_create_interface_reply) \
-_(PG_CAPTURE_REPLY, pg_capture_reply) \
-_(PG_ENABLE_DISABLE_REPLY, pg_enable_disable_reply) \
-_(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL_REPLY, \
- ip_source_and_port_range_check_add_del_reply) \
-_(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL_REPLY, \
- ip_source_and_port_range_check_interface_add_del_reply) \
-_(IPSEC_GRE_ADD_DEL_TUNNEL_REPLY, ipsec_gre_add_del_tunnel_reply) \
-_(IPSEC_GRE_TUNNEL_DETAILS, ipsec_gre_tunnel_details) \
-_(DELETE_SUBIF_REPLY, delete_subif_reply) \
-_(L2_INTERFACE_PBB_TAG_REWRITE_REPLY, l2_interface_pbb_tag_rewrite_reply) \
-_(PUNT_REPLY, punt_reply) \
-_(IP_FIB_DETAILS, ip_fib_details) \
-_(IP6_FIB_DETAILS, ip6_fib_details) \
-_(FEATURE_ENABLE_DISABLE_REPLY, feature_enable_disable_reply) \
-_(SW_INTERFACE_TAG_ADD_DEL_REPLY, sw_interface_tag_add_del_reply) \
-_(L2_XCONNECT_DETAILS, l2_xconnect_details) \
-_(SW_INTERFACE_SET_MTU_REPLY, sw_interface_set_mtu_reply) \
-_(IP_NEIGHBOR_DETAILS, ip_neighbor_details) \
-_(SW_INTERFACE_GET_TABLE_REPLY, sw_interface_get_table_reply)
-
-#if DPDK > 0
-#define foreach_vpe_dpdk_api_reply_msg \
-_(SW_INTERFACE_SET_DPDK_HQOS_PIPE_REPLY, \
- sw_interface_set_dpdk_hqos_pipe_reply) \
-_(SW_INTERFACE_SET_DPDK_HQOS_SUBPORT_REPLY, \
- sw_interface_set_dpdk_hqos_subport_reply) \
-_(SW_INTERFACE_SET_DPDK_HQOS_TCTBL_REPLY, \
- sw_interface_set_dpdk_hqos_tctbl_reply)
-#endif
+#define foreach_vpe_api_reply_msg \
+_(CREATE_LOOPBACK_REPLY, create_loopback_reply) \
+_(CREATE_LOOPBACK_INSTANCE_REPLY, create_loopback_instance_reply) \
+_(SW_INTERFACE_DETAILS, sw_interface_details) \
+_(SW_INTERFACE_SET_FLAGS_REPLY, sw_interface_set_flags_reply) \
+_(CONTROL_PING_REPLY, control_ping_reply) \
+_(CLI_REPLY, cli_reply) \
+_(CLI_INBAND_REPLY, cli_inband_reply) \
+_(SW_INTERFACE_ADD_DEL_ADDRESS_REPLY, \
+ sw_interface_add_del_address_reply) \
+_(SW_INTERFACE_SET_TABLE_REPLY, sw_interface_set_table_reply) \
+_(SW_INTERFACE_SET_MPLS_ENABLE_REPLY, sw_interface_set_mpls_enable_reply) \
+_(SW_INTERFACE_SET_VPATH_REPLY, sw_interface_set_vpath_reply) \
+_(SW_INTERFACE_SET_VXLAN_BYPASS_REPLY, sw_interface_set_vxlan_bypass_reply) \
+_(SW_INTERFACE_SET_GENEVE_BYPASS_REPLY, sw_interface_set_geneve_bypass_reply) \
+_(SW_INTERFACE_SET_VXLAN_GPE_BYPASS_REPLY, sw_interface_set_vxlan_gpe_bypass_reply) \
+_(SW_INTERFACE_SET_L2_XCONNECT_REPLY, \
+ sw_interface_set_l2_xconnect_reply) \
+_(SW_INTERFACE_SET_L2_BRIDGE_REPLY, \
+ sw_interface_set_l2_bridge_reply) \
+_(BRIDGE_DOMAIN_ADD_DEL_REPLY, bridge_domain_add_del_reply) \
+_(BRIDGE_DOMAIN_DETAILS, bridge_domain_details) \
+_(BRIDGE_DOMAIN_SET_MAC_AGE_REPLY, bridge_domain_set_mac_age_reply) \
+_(L2FIB_ADD_DEL_REPLY, l2fib_add_del_reply) \
+_(L2FIB_FLUSH_INT_REPLY, l2fib_flush_int_reply) \
+_(L2FIB_FLUSH_BD_REPLY, l2fib_flush_bd_reply) \
+_(L2_FLAGS_REPLY, l2_flags_reply) \
+_(BRIDGE_FLAGS_REPLY, bridge_flags_reply) \
+_(TAP_CONNECT_REPLY, tap_connect_reply) \
+_(TAP_MODIFY_REPLY, tap_modify_reply) \
+_(TAP_DELETE_REPLY, tap_delete_reply) \
+_(SW_INTERFACE_TAP_DETAILS, sw_interface_tap_details) \
+_(IP_ADD_DEL_ROUTE_REPLY, ip_add_del_route_reply) \
+_(IP_TABLE_ADD_DEL_REPLY, ip_table_add_del_reply) \
+_(IP_MROUTE_ADD_DEL_REPLY, ip_mroute_add_del_reply) \
+_(MPLS_TABLE_ADD_DEL_REPLY, mpls_table_add_del_reply) \
+_(MPLS_ROUTE_ADD_DEL_REPLY, mpls_route_add_del_reply) \
+_(MPLS_IP_BIND_UNBIND_REPLY, mpls_ip_bind_unbind_reply) \
+_(PROXY_ARP_ADD_DEL_REPLY, proxy_arp_add_del_reply) \
+_(PROXY_ARP_INTFC_ENABLE_DISABLE_REPLY, \
+ proxy_arp_intfc_enable_disable_reply) \
+_(MPLS_TUNNEL_ADD_DEL_REPLY, mpls_tunnel_add_del_reply) \
+_(SW_INTERFACE_SET_UNNUMBERED_REPLY, \
+ sw_interface_set_unnumbered_reply) \
+_(IP_NEIGHBOR_ADD_DEL_REPLY, ip_neighbor_add_del_reply) \
+_(RESET_VRF_REPLY, reset_vrf_reply) \
+_(CREATE_VLAN_SUBIF_REPLY, create_vlan_subif_reply) \
+_(CREATE_SUBIF_REPLY, create_subif_reply) \
+_(OAM_ADD_DEL_REPLY, oam_add_del_reply) \
+_(RESET_FIB_REPLY, reset_fib_reply) \
+_(DHCP_PROXY_CONFIG_REPLY, dhcp_proxy_config_reply) \
+_(DHCP_PROXY_SET_VSS_REPLY, dhcp_proxy_set_vss_reply) \
+_(DHCP_PROXY_DETAILS, dhcp_proxy_details) \
+_(DHCP_CLIENT_CONFIG_REPLY, dhcp_client_config_reply) \
+_(SET_IP_FLOW_HASH_REPLY, set_ip_flow_hash_reply) \
+_(SW_INTERFACE_IP6_ENABLE_DISABLE_REPLY, \
+ sw_interface_ip6_enable_disable_reply) \
+_(SW_INTERFACE_IP6_SET_LINK_LOCAL_ADDRESS_REPLY, \
+ sw_interface_ip6_set_link_local_address_reply) \
+_(IP6ND_PROXY_ADD_DEL_REPLY, ip6nd_proxy_add_del_reply) \
+_(IP6ND_PROXY_DETAILS, ip6nd_proxy_details) \
+_(SW_INTERFACE_IP6ND_RA_PREFIX_REPLY, \
+ sw_interface_ip6nd_ra_prefix_reply) \
+_(SW_INTERFACE_IP6ND_RA_CONFIG_REPLY, \
+ sw_interface_ip6nd_ra_config_reply) \
+_(SET_ARP_NEIGHBOR_LIMIT_REPLY, set_arp_neighbor_limit_reply) \
+_(L2_PATCH_ADD_DEL_REPLY, l2_patch_add_del_reply) \
+_(SR_POLICY_ADD_REPLY, sr_policy_add_reply) \
+_(SR_POLICY_MOD_REPLY, sr_policy_mod_reply) \
+_(SR_POLICY_DEL_REPLY, sr_policy_del_reply) \
+_(SR_LOCALSID_ADD_DEL_REPLY, sr_localsid_add_del_reply) \
+_(SR_STEERING_ADD_DEL_REPLY, sr_steering_add_del_reply) \
+_(CLASSIFY_ADD_DEL_TABLE_REPLY, classify_add_del_table_reply) \
+_(CLASSIFY_ADD_DEL_SESSION_REPLY, classify_add_del_session_reply) \
+_(CLASSIFY_SET_INTERFACE_IP_TABLE_REPLY, \
+classify_set_interface_ip_table_reply) \
+_(CLASSIFY_SET_INTERFACE_L2_TABLES_REPLY, \
+ classify_set_interface_l2_tables_reply) \
+_(GET_NODE_INDEX_REPLY, get_node_index_reply) \
+_(ADD_NODE_NEXT_REPLY, add_node_next_reply) \
+_(L2TPV3_CREATE_TUNNEL_REPLY, l2tpv3_create_tunnel_reply) \
+_(L2TPV3_SET_TUNNEL_COOKIES_REPLY, l2tpv3_set_tunnel_cookies_reply) \
+_(L2TPV3_INTERFACE_ENABLE_DISABLE_REPLY, \
+ l2tpv3_interface_enable_disable_reply) \
+_(L2TPV3_SET_LOOKUP_KEY_REPLY, l2tpv3_set_lookup_key_reply) \
+_(SW_IF_L2TPV3_TUNNEL_DETAILS, sw_if_l2tpv3_tunnel_details) \
+_(VXLAN_ADD_DEL_TUNNEL_REPLY, vxlan_add_del_tunnel_reply) \
+_(GENEVE_ADD_DEL_TUNNEL_REPLY, geneve_add_del_tunnel_reply) \
+_(VXLAN_TUNNEL_DETAILS, vxlan_tunnel_details) \
+_(GENEVE_TUNNEL_DETAILS, geneve_tunnel_details) \
+_(GRE_ADD_DEL_TUNNEL_REPLY, gre_add_del_tunnel_reply) \
+_(GRE_TUNNEL_DETAILS, gre_tunnel_details) \
+_(L2_FIB_CLEAR_TABLE_REPLY, l2_fib_clear_table_reply) \
+_(L2_INTERFACE_EFP_FILTER_REPLY, l2_interface_efp_filter_reply) \
+_(L2_INTERFACE_VLAN_TAG_REWRITE_REPLY, l2_interface_vlan_tag_rewrite_reply) \
+_(SW_INTERFACE_VHOST_USER_DETAILS, sw_interface_vhost_user_details) \
+_(CREATE_VHOST_USER_IF_REPLY, create_vhost_user_if_reply) \
+_(MODIFY_VHOST_USER_IF_REPLY, modify_vhost_user_if_reply) \
+_(DELETE_VHOST_USER_IF_REPLY, delete_vhost_user_if_reply) \
+_(SHOW_VERSION_REPLY, show_version_reply) \
+_(L2_FIB_TABLE_DETAILS, l2_fib_table_details) \
+_(VXLAN_GPE_ADD_DEL_TUNNEL_REPLY, vxlan_gpe_add_del_tunnel_reply) \
+_(VXLAN_GPE_TUNNEL_DETAILS, vxlan_gpe_tunnel_details) \
+_(INTERFACE_NAME_RENUMBER_REPLY, interface_name_renumber_reply) \
+_(WANT_IP4_ARP_EVENTS_REPLY, want_ip4_arp_events_reply) \
+_(IP4_ARP_EVENT, ip4_arp_event) \
+_(WANT_IP6_ND_EVENTS_REPLY, want_ip6_nd_events_reply) \
+_(IP6_ND_EVENT, ip6_nd_event) \
+_(WANT_L2_MACS_EVENTS_REPLY, want_l2_macs_events_reply) \
+_(L2_MACS_EVENT, l2_macs_event) \
+_(INPUT_ACL_SET_INTERFACE_REPLY, input_acl_set_interface_reply) \
+_(IP_ADDRESS_DETAILS, ip_address_details) \
+_(IP_DETAILS, ip_details) \
+_(IPSEC_SPD_ADD_DEL_REPLY, ipsec_spd_add_del_reply) \
+_(IPSEC_INTERFACE_ADD_DEL_SPD_REPLY, ipsec_interface_add_del_spd_reply) \
+_(IPSEC_SPD_ADD_DEL_ENTRY_REPLY, ipsec_spd_add_del_entry_reply) \
+_(IPSEC_SAD_ADD_DEL_ENTRY_REPLY, ipsec_sad_add_del_entry_reply) \
+_(IPSEC_SA_DETAILS, ipsec_sa_details) \
+_(IPSEC_SA_SET_KEY_REPLY, ipsec_sa_set_key_reply) \
+_(IPSEC_TUNNEL_IF_ADD_DEL_REPLY, ipsec_tunnel_if_add_del_reply) \
+_(IPSEC_TUNNEL_IF_SET_KEY_REPLY, ipsec_tunnel_if_set_key_reply) \
+_(IKEV2_PROFILE_ADD_DEL_REPLY, ikev2_profile_add_del_reply) \
+_(IKEV2_PROFILE_SET_AUTH_REPLY, ikev2_profile_set_auth_reply) \
+_(IKEV2_PROFILE_SET_ID_REPLY, ikev2_profile_set_id_reply) \
+_(IKEV2_PROFILE_SET_TS_REPLY, ikev2_profile_set_ts_reply) \
+_(IKEV2_SET_LOCAL_KEY_REPLY, ikev2_set_local_key_reply) \
+_(IKEV2_SET_RESPONDER_REPLY, ikev2_set_responder_reply) \
+_(IKEV2_SET_IKE_TRANSFORMS_REPLY, ikev2_set_ike_transforms_reply) \
+_(IKEV2_SET_ESP_TRANSFORMS_REPLY, ikev2_set_esp_transforms_reply) \
+_(IKEV2_SET_SA_LIFETIME_REPLY, ikev2_set_sa_lifetime_reply) \
+_(IKEV2_INITIATE_SA_INIT_REPLY, ikev2_initiate_sa_init_reply) \
+_(IKEV2_INITIATE_DEL_IKE_SA_REPLY, ikev2_initiate_del_ike_sa_reply) \
+_(IKEV2_INITIATE_DEL_CHILD_SA_REPLY, ikev2_initiate_del_child_sa_reply) \
+_(IKEV2_INITIATE_REKEY_CHILD_SA_REPLY, ikev2_initiate_rekey_child_sa_reply) \
+_(DELETE_LOOPBACK_REPLY, delete_loopback_reply) \
+_(BD_IP_MAC_ADD_DEL_REPLY, bd_ip_mac_add_del_reply) \
+_(DHCP_COMPL_EVENT, dhcp_compl_event) \
+_(MAP_ADD_DOMAIN_REPLY, map_add_domain_reply) \
+_(MAP_DEL_DOMAIN_REPLY, map_del_domain_reply) \
+_(MAP_ADD_DEL_RULE_REPLY, map_add_del_rule_reply) \
+_(MAP_DOMAIN_DETAILS, map_domain_details) \
+_(MAP_RULE_DETAILS, map_rule_details) \
+_(WANT_INTERFACE_EVENTS_REPLY, want_interface_events_reply) \
+_(WANT_STATS_REPLY, want_stats_reply) \
+_(GET_FIRST_MSG_ID_REPLY, get_first_msg_id_reply) \
+_(COP_INTERFACE_ENABLE_DISABLE_REPLY, cop_interface_enable_disable_reply) \
+_(COP_WHITELIST_ENABLE_DISABLE_REPLY, cop_whitelist_enable_disable_reply) \
+_(GET_NODE_GRAPH_REPLY, get_node_graph_reply) \
+_(SW_INTERFACE_CLEAR_STATS_REPLY, sw_interface_clear_stats_reply) \
+_(IOAM_ENABLE_REPLY, ioam_enable_reply) \
+_(IOAM_DISABLE_REPLY, ioam_disable_reply) \
+_(ONE_ADD_DEL_LOCATOR_SET_REPLY, one_add_del_locator_set_reply) \
+_(ONE_ADD_DEL_LOCATOR_REPLY, one_add_del_locator_reply) \
+_(ONE_ADD_DEL_LOCAL_EID_REPLY, one_add_del_local_eid_reply) \
+_(ONE_ADD_DEL_REMOTE_MAPPING_REPLY, one_add_del_remote_mapping_reply) \
+_(ONE_ADD_DEL_ADJACENCY_REPLY, one_add_del_adjacency_reply) \
+_(ONE_ADD_DEL_MAP_RESOLVER_REPLY, one_add_del_map_resolver_reply) \
+_(ONE_ADD_DEL_MAP_SERVER_REPLY, one_add_del_map_server_reply) \
+_(ONE_ENABLE_DISABLE_REPLY, one_enable_disable_reply) \
+_(ONE_MAP_REGISTER_ENABLE_DISABLE_REPLY, \
+ one_map_register_enable_disable_reply) \
+_(ONE_MAP_REGISTER_SET_TTL_REPLY, one_map_register_set_ttl_reply) \
+_(ONE_SET_TRANSPORT_PROTOCOL_REPLY, one_set_transport_protocol_reply) \
+_(ONE_GET_TRANSPORT_PROTOCOL_REPLY, one_get_transport_protocol_reply) \
+_(ONE_MAP_REGISTER_FALLBACK_THRESHOLD_REPLY, \
+ one_map_register_fallback_threshold_reply) \
+_(ONE_RLOC_PROBE_ENABLE_DISABLE_REPLY, \
+ one_rloc_probe_enable_disable_reply) \
+_(ONE_PITR_SET_LOCATOR_SET_REPLY, one_pitr_set_locator_set_reply) \
+_(ONE_USE_PETR_REPLY, one_use_petr_reply) \
+_(ONE_MAP_REQUEST_MODE_REPLY, one_map_request_mode_reply) \
+_(ONE_EID_TABLE_ADD_DEL_MAP_REPLY, one_eid_table_add_del_map_reply) \
+_(ONE_LOCATOR_SET_DETAILS, one_locator_set_details) \
+_(ONE_LOCATOR_DETAILS, one_locator_details) \
+_(ONE_EID_TABLE_DETAILS, one_eid_table_details) \
+_(ONE_EID_TABLE_MAP_DETAILS, one_eid_table_map_details) \
+_(ONE_EID_TABLE_VNI_DETAILS, one_eid_table_vni_details) \
+_(ONE_MAP_RESOLVER_DETAILS, one_map_resolver_details) \
+_(ONE_MAP_SERVER_DETAILS, one_map_server_details) \
+_(ONE_ADJACENCIES_GET_REPLY, one_adjacencies_get_reply) \
+_(ONE_STATS_DETAILS, one_stats_details) \
+_(ONE_STATS_FLUSH_REPLY, one_stats_flush_reply) \
+_(ONE_STATS_ENABLE_DISABLE_REPLY, one_stats_enable_disable_reply) \
+_(SHOW_ONE_STATS_ENABLE_DISABLE_REPLY, \
+ show_one_stats_enable_disable_reply) \
+_(ONE_ADD_DEL_NDP_ENTRY_REPLY, one_add_del_ndp_entry_reply) \
+_(ONE_NDP_BD_GET_REPLY, one_ndp_bd_get_reply) \
+_(ONE_NDP_ENTRIES_GET_REPLY, one_ndp_entries_get_reply) \
+_(ONE_ADD_DEL_L2_ARP_ENTRY_REPLY, one_add_del_l2_arp_entry_reply) \
+_(ONE_L2_ARP_BD_GET_REPLY, one_l2_arp_bd_get_reply) \
+_(ONE_L2_ARP_ENTRIES_GET_REPLY, one_l2_arp_entries_get_reply) \
+_(GPE_SET_ENCAP_MODE_REPLY, gpe_set_encap_mode_reply) \
+_(GPE_GET_ENCAP_MODE_REPLY, gpe_get_encap_mode_reply) \
+_(GPE_ADD_DEL_IFACE_REPLY, gpe_add_del_iface_reply) \
+_(GPE_ENABLE_DISABLE_REPLY, gpe_enable_disable_reply) \
+_(GPE_ADD_DEL_FWD_ENTRY_REPLY, gpe_add_del_fwd_entry_reply) \
+_(GPE_FWD_ENTRY_VNIS_GET_REPLY, gpe_fwd_entry_vnis_get_reply) \
+_(GPE_FWD_ENTRIES_GET_REPLY, gpe_fwd_entries_get_reply) \
+_(GPE_NATIVE_FWD_RPATHS_GET_REPLY, gpe_native_fwd_rpaths_get_reply) \
+_(GPE_ADD_DEL_NATIVE_FWD_RPATH_REPLY, \
+ gpe_add_del_native_fwd_rpath_reply) \
+_(GPE_FWD_ENTRY_PATH_DETAILS, \
+ gpe_fwd_entry_path_details) \
+_(SHOW_ONE_STATUS_REPLY, show_one_status_reply) \
+_(ONE_ADD_DEL_MAP_REQUEST_ITR_RLOCS_REPLY, \
+ one_add_del_map_request_itr_rlocs_reply) \
+_(ONE_GET_MAP_REQUEST_ITR_RLOCS_REPLY, \
+ one_get_map_request_itr_rlocs_reply) \
+_(SHOW_ONE_NSH_MAPPING_REPLY, show_one_nsh_mapping_reply) \
+_(SHOW_ONE_PITR_REPLY, show_one_pitr_reply) \
+_(SHOW_ONE_USE_PETR_REPLY, show_one_use_petr_reply) \
+_(SHOW_ONE_MAP_REQUEST_MODE_REPLY, show_one_map_request_mode_reply) \
+_(SHOW_ONE_RLOC_PROBE_STATE_REPLY, show_one_rloc_probe_state_reply) \
+_(SHOW_ONE_MAP_REGISTER_STATE_REPLY, \
+ show_one_map_register_state_reply) \
+_(SHOW_ONE_MAP_REGISTER_TTL_REPLY, show_one_map_register_ttl_reply) \
+_(SHOW_ONE_MAP_REGISTER_FALLBACK_THRESHOLD_REPLY, \
+ show_one_map_register_fallback_threshold_reply) \
+_(AF_PACKET_CREATE_REPLY, af_packet_create_reply) \
+_(AF_PACKET_DELETE_REPLY, af_packet_delete_reply) \
+_(POLICER_ADD_DEL_REPLY, policer_add_del_reply) \
+_(POLICER_DETAILS, policer_details) \
+_(POLICER_CLASSIFY_SET_INTERFACE_REPLY, policer_classify_set_interface_reply) \
+_(POLICER_CLASSIFY_DETAILS, policer_classify_details) \
+_(NETMAP_CREATE_REPLY, netmap_create_reply) \
+_(NETMAP_DELETE_REPLY, netmap_delete_reply) \
+_(MPLS_TUNNEL_DETAILS, mpls_tunnel_details) \
+_(MPLS_FIB_DETAILS, mpls_fib_details) \
+_(CLASSIFY_TABLE_IDS_REPLY, classify_table_ids_reply) \
+_(CLASSIFY_TABLE_BY_INTERFACE_REPLY, classify_table_by_interface_reply) \
+_(CLASSIFY_TABLE_INFO_REPLY, classify_table_info_reply) \
+_(CLASSIFY_SESSION_DETAILS, classify_session_details) \
+_(SET_IPFIX_EXPORTER_REPLY, set_ipfix_exporter_reply) \
+_(IPFIX_EXPORTER_DETAILS, ipfix_exporter_details) \
+_(SET_IPFIX_CLASSIFY_STREAM_REPLY, set_ipfix_classify_stream_reply) \
+_(IPFIX_CLASSIFY_STREAM_DETAILS, ipfix_classify_stream_details) \
+_(IPFIX_CLASSIFY_TABLE_ADD_DEL_REPLY, ipfix_classify_table_add_del_reply) \
+_(IPFIX_CLASSIFY_TABLE_DETAILS, ipfix_classify_table_details) \
+_(FLOW_CLASSIFY_SET_INTERFACE_REPLY, flow_classify_set_interface_reply) \
+_(FLOW_CLASSIFY_DETAILS, flow_classify_details) \
+_(SW_INTERFACE_SPAN_ENABLE_DISABLE_REPLY, sw_interface_span_enable_disable_reply) \
+_(SW_INTERFACE_SPAN_DETAILS, sw_interface_span_details) \
+_(GET_NEXT_INDEX_REPLY, get_next_index_reply) \
+_(PG_CREATE_INTERFACE_REPLY, pg_create_interface_reply) \
+_(PG_CAPTURE_REPLY, pg_capture_reply) \
+_(PG_ENABLE_DISABLE_REPLY, pg_enable_disable_reply) \
+_(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL_REPLY, \
+ ip_source_and_port_range_check_add_del_reply) \
+_(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL_REPLY, \
+ ip_source_and_port_range_check_interface_add_del_reply) \
+_(IPSEC_GRE_ADD_DEL_TUNNEL_REPLY, ipsec_gre_add_del_tunnel_reply) \
+_(IPSEC_GRE_TUNNEL_DETAILS, ipsec_gre_tunnel_details) \
+_(DELETE_SUBIF_REPLY, delete_subif_reply) \
+_(L2_INTERFACE_PBB_TAG_REWRITE_REPLY, l2_interface_pbb_tag_rewrite_reply) \
+_(PUNT_REPLY, punt_reply) \
+_(IP_FIB_DETAILS, ip_fib_details) \
+_(IP6_FIB_DETAILS, ip6_fib_details) \
+_(FEATURE_ENABLE_DISABLE_REPLY, feature_enable_disable_reply) \
+_(SW_INTERFACE_TAG_ADD_DEL_REPLY, sw_interface_tag_add_del_reply) \
+_(L2_XCONNECT_DETAILS, l2_xconnect_details) \
+_(SW_INTERFACE_SET_MTU_REPLY, sw_interface_set_mtu_reply) \
+_(IP_NEIGHBOR_DETAILS, ip_neighbor_details) \
+_(SW_INTERFACE_GET_TABLE_REPLY, sw_interface_get_table_reply) \
+_(P2P_ETHERNET_ADD_REPLY, p2p_ethernet_add_reply) \
+_(P2P_ETHERNET_DEL_REPLY, p2p_ethernet_del_reply) \
+_(LLDP_CONFIG_REPLY, lldp_config_reply) \
+_(SW_INTERFACE_SET_LLDP_REPLY, sw_interface_set_lldp_reply) \
+_(TCP_CONFIGURE_SRC_ADDRESSES_REPLY, tcp_configure_src_addresses_reply) \
+_(APP_NAMESPACE_ADD_DEL_REPLY, app_namespace_add_del_reply) \
+_(DNS_ENABLE_DISABLE_REPLY, dns_enable_disable_reply) \
+_(DNS_NAME_SERVER_ADD_DEL_REPLY, dns_name_server_add_del_reply) \
+_(DNS_RESOLVE_NAME_REPLY, dns_resolve_name_reply)
+
+#define foreach_standalone_reply_msg \
+_(SW_INTERFACE_EVENT, sw_interface_event) \
+_(VNET_INTERFACE_SIMPLE_COUNTERS, vnet_interface_simple_counters) \
+_(VNET_INTERFACE_COMBINED_COUNTERS, vnet_interface_combined_counters) \
+_(VNET_IP4_FIB_COUNTERS, vnet_ip4_fib_counters) \
+_(VNET_IP6_FIB_COUNTERS, vnet_ip6_fib_counters) \
+_(VNET_IP4_NBR_COUNTERS, vnet_ip4_nbr_counters) \
+_(VNET_IP6_NBR_COUNTERS, vnet_ip6_nbr_counters) \
+_(MEMFD_SEGMENT_CREATE_REPLY, memfd_segment_create_reply) \
+
+typedef struct
+{
+ u8 *name;
+ u32 value;
+} name_sort_t;
+
+
+#define STR_VTR_OP_CASE(op) \
+ case L2_VTR_ ## op: \
+ return "" # op;
+
+static const char *
+str_vtr_op (u32 vtr_op)
+{
+ switch (vtr_op)
+ {
+ STR_VTR_OP_CASE (DISABLED);
+ STR_VTR_OP_CASE (PUSH_1);
+ STR_VTR_OP_CASE (PUSH_2);
+ STR_VTR_OP_CASE (POP_1);
+ STR_VTR_OP_CASE (POP_2);
+ STR_VTR_OP_CASE (TRANSLATE_1_1);
+ STR_VTR_OP_CASE (TRANSLATE_1_2);
+ STR_VTR_OP_CASE (TRANSLATE_2_1);
+ STR_VTR_OP_CASE (TRANSLATE_2_2);
+ }
+
+ return "UNKNOWN";
+}
+
+static int
+dump_sub_interface_table (vat_main_t * vam)
+{
+ const sw_interface_subif_t *sub = NULL;
+
+ if (vam->json_output)
+ {
+ clib_warning
+ ("JSON output supported only for VPE API calls and dump_stats_table");
+ return -99;
+ }
+
+ print (vam->ofp,
+ "%-30s%-12s%-11s%-7s%-5s%-9s%-9s%-6s%-8s%-10s%-10s",
+ "Interface", "sw_if_index",
+ "sub id", "dot1ad", "tags", "outer id",
+ "inner id", "exact", "default", "outer any", "inner any");
+
+ vec_foreach (sub, vam->sw_if_subif_table)
+ {
+ print (vam->ofp,
+ "%-30s%-12d%-11d%-7s%-5d%-9d%-9d%-6d%-8d%-10d%-10d",
+ sub->interface_name,
+ sub->sw_if_index,
+ sub->sub_id, sub->sub_dot1ad ? "dot1ad" : "dot1q",
+ sub->sub_number_of_tags, sub->sub_outer_vlan_id,
+ sub->sub_inner_vlan_id, sub->sub_exact_match, sub->sub_default,
+ sub->sub_outer_vlan_id_any, sub->sub_inner_vlan_id_any);
+ if (sub->vtr_op != L2_VTR_DISABLED)
+ {
+ print (vam->ofp,
+ " vlan-tag-rewrite - op: %-14s [ dot1q: %d "
+ "tag1: %d tag2: %d ]",
+ str_vtr_op (sub->vtr_op), sub->vtr_push_dot1q,
+ sub->vtr_tag1, sub->vtr_tag2);
+ }
+ }
+
+ return 0;
+}
+
+static int
+name_sort_cmp (void *a1, void *a2)
+{
+ name_sort_t *n1 = a1;
+ name_sort_t *n2 = a2;
+
+ return strcmp ((char *) n1->name, (char *) n2->name);
+}
+
+static int
+dump_interface_table (vat_main_t * vam)
+{
+ hash_pair_t *p;
+ name_sort_t *nses = 0, *ns;
+
+ if (vam->json_output)
+ {
+ clib_warning
+ ("JSON output supported only for VPE API calls and dump_stats_table");
+ return -99;
+ }
+
+ /* *INDENT-OFF* */
+ hash_foreach_pair (p, vam->sw_if_index_by_interface_name,
+ ({
+ vec_add2 (nses, ns, 1);
+ ns->name = (u8 *)(p->key);
+ ns->value = (u32) p->value[0];
+ }));
+ /* *INDENT-ON* */
+
+ vec_sort_with_function (nses, name_sort_cmp);
+
+ print (vam->ofp, "%-25s%-15s", "Interface", "sw_if_index");
+ vec_foreach (ns, nses)
+ {
+ print (vam->ofp, "%-25s%-15d", ns->name, ns->value);
+ }
+ vec_free (nses);
+ return 0;
+}
+
+static int
+dump_ip_table (vat_main_t * vam, int is_ipv6)
+{
+ const ip_details_t *det = NULL;
+ const ip_address_details_t *address = NULL;
+ u32 i = ~0;
+
+ print (vam->ofp, "%-12s", "sw_if_index");
+
+ vec_foreach (det, vam->ip_details_by_sw_if_index[is_ipv6])
+ {
+ i++;
+ if (!det->present)
+ {
+ continue;
+ }
+ print (vam->ofp, "%-12d", i);
+ print (vam->ofp, " %-30s%-13s", "Address", "Prefix length");
+ if (!det->addr)
+ {
+ continue;
+ }
+ vec_foreach (address, det->addr)
+ {
+ print (vam->ofp,
+ " %-30U%-13d",
+ is_ipv6 ? format_ip6_address : format_ip4_address,
+ address->ip, address->prefix_length);
+ }
+ }
+
+ return 0;
+}
+
+static int
+dump_ipv4_table (vat_main_t * vam)
+{
+ if (vam->json_output)
+ {
+ clib_warning
+ ("JSON output supported only for VPE API calls and dump_stats_table");
+ return -99;
+ }
+
+ return dump_ip_table (vam, 0);
+}
+
+static int
+dump_ipv6_table (vat_main_t * vam)
+{
+ if (vam->json_output)
+ {
+ clib_warning
+ ("JSON output supported only for VPE API calls and dump_stats_table");
+ return -99;
+ }
+
+ return dump_ip_table (vam, 1);
+}
+
+static char *
+counter_type_to_str (u8 counter_type, u8 is_combined)
+{
+ if (!is_combined)
+ {
+ switch (counter_type)
+ {
+ case VNET_INTERFACE_COUNTER_DROP:
+ return "drop";
+ case VNET_INTERFACE_COUNTER_PUNT:
+ return "punt";
+ case VNET_INTERFACE_COUNTER_IP4:
+ return "ip4";
+ case VNET_INTERFACE_COUNTER_IP6:
+ return "ip6";
+ case VNET_INTERFACE_COUNTER_RX_NO_BUF:
+ return "rx-no-buf";
+ case VNET_INTERFACE_COUNTER_RX_MISS:
+ return "rx-miss";
+ case VNET_INTERFACE_COUNTER_RX_ERROR:
+ return "rx-error";
+ case VNET_INTERFACE_COUNTER_TX_ERROR:
+ return "tx-error";
+ default:
+ return "INVALID-COUNTER-TYPE";
+ }
+ }
+ else
+ {
+ switch (counter_type)
+ {
+ case VNET_INTERFACE_COUNTER_RX:
+ return "rx";
+ case VNET_INTERFACE_COUNTER_TX:
+ return "tx";
+ default:
+ return "INVALID-COUNTER-TYPE";
+ }
+ }
+}
+
+static int
+dump_stats_table (vat_main_t * vam)
+{
+ vat_json_node_t node;
+ vat_json_node_t *msg_array;
+ vat_json_node_t *msg;
+ vat_json_node_t *counter_array;
+ vat_json_node_t *counter;
+ interface_counter_t c;
+ u64 packets;
+ ip4_fib_counter_t *c4;
+ ip6_fib_counter_t *c6;
+ ip4_nbr_counter_t *n4;
+ ip6_nbr_counter_t *n6;
+ int i, j;
+
+ if (!vam->json_output)
+ {
+ clib_warning ("dump_stats_table supported only in JSON format");
+ return -99;
+ }
+
+ vat_json_init_object (&node);
+
+ /* interface counters */
+ msg_array = vat_json_object_add (&node, "interface_counters");
+ vat_json_init_array (msg_array);
+ for (i = 0; i < vec_len (vam->simple_interface_counters); i++)
+ {
+ msg = vat_json_array_add (msg_array);
+ vat_json_init_object (msg);
+ vat_json_object_add_string_copy (msg, "vnet_counter_type",
+ (u8 *) counter_type_to_str (i, 0));
+ vat_json_object_add_int (msg, "is_combined", 0);
+ counter_array = vat_json_object_add (msg, "data");
+ vat_json_init_array (counter_array);
+ for (j = 0; j < vec_len (vam->simple_interface_counters[i]); j++)
+ {
+ packets = vam->simple_interface_counters[i][j];
+ vat_json_array_add_uint (counter_array, packets);
+ }
+ }
+ for (i = 0; i < vec_len (vam->combined_interface_counters); i++)
+ {
+ msg = vat_json_array_add (msg_array);
+ vat_json_init_object (msg);
+ vat_json_object_add_string_copy (msg, "vnet_counter_type",
+ (u8 *) counter_type_to_str (i, 1));
+ vat_json_object_add_int (msg, "is_combined", 1);
+ counter_array = vat_json_object_add (msg, "data");
+ vat_json_init_array (counter_array);
+ for (j = 0; j < vec_len (vam->combined_interface_counters[i]); j++)
+ {
+ c = vam->combined_interface_counters[i][j];
+ counter = vat_json_array_add (counter_array);
+ vat_json_init_object (counter);
+ vat_json_object_add_uint (counter, "packets", c.packets);
+ vat_json_object_add_uint (counter, "bytes", c.bytes);
+ }
+ }
+
+ /* ip4 fib counters */
+ msg_array = vat_json_object_add (&node, "ip4_fib_counters");
+ vat_json_init_array (msg_array);
+ for (i = 0; i < vec_len (vam->ip4_fib_counters); i++)
+ {
+ msg = vat_json_array_add (msg_array);
+ vat_json_init_object (msg);
+ vat_json_object_add_uint (msg, "vrf_id",
+ vam->ip4_fib_counters_vrf_id_by_index[i]);
+ counter_array = vat_json_object_add (msg, "c");
+ vat_json_init_array (counter_array);
+ for (j = 0; j < vec_len (vam->ip4_fib_counters[i]); j++)
+ {
+ counter = vat_json_array_add (counter_array);
+ vat_json_init_object (counter);
+ c4 = &vam->ip4_fib_counters[i][j];
+ vat_json_object_add_ip4 (counter, "address", c4->address);
+ vat_json_object_add_uint (counter, "address_length",
+ c4->address_length);
+ vat_json_object_add_uint (counter, "packets", c4->packets);
+ vat_json_object_add_uint (counter, "bytes", c4->bytes);
+ }
+ }
+
+ /* ip6 fib counters */
+ msg_array = vat_json_object_add (&node, "ip6_fib_counters");
+ vat_json_init_array (msg_array);
+ for (i = 0; i < vec_len (vam->ip6_fib_counters); i++)
+ {
+ msg = vat_json_array_add (msg_array);
+ vat_json_init_object (msg);
+ vat_json_object_add_uint (msg, "vrf_id",
+ vam->ip6_fib_counters_vrf_id_by_index[i]);
+ counter_array = vat_json_object_add (msg, "c");
+ vat_json_init_array (counter_array);
+ for (j = 0; j < vec_len (vam->ip6_fib_counters[i]); j++)
+ {
+ counter = vat_json_array_add (counter_array);
+ vat_json_init_object (counter);
+ c6 = &vam->ip6_fib_counters[i][j];
+ vat_json_object_add_ip6 (counter, "address", c6->address);
+ vat_json_object_add_uint (counter, "address_length",
+ c6->address_length);
+ vat_json_object_add_uint (counter, "packets", c6->packets);
+ vat_json_object_add_uint (counter, "bytes", c6->bytes);
+ }
+ }
+
+ /* ip4 nbr counters */
+ msg_array = vat_json_object_add (&node, "ip4_nbr_counters");
+ vat_json_init_array (msg_array);
+ for (i = 0; i < vec_len (vam->ip4_nbr_counters); i++)
+ {
+ msg = vat_json_array_add (msg_array);
+ vat_json_init_object (msg);
+ vat_json_object_add_uint (msg, "sw_if_index", i);
+ counter_array = vat_json_object_add (msg, "c");
+ vat_json_init_array (counter_array);
+ for (j = 0; j < vec_len (vam->ip4_nbr_counters[i]); j++)
+ {
+ counter = vat_json_array_add (counter_array);
+ vat_json_init_object (counter);
+ n4 = &vam->ip4_nbr_counters[i][j];
+ vat_json_object_add_ip4 (counter, "address", n4->address);
+ vat_json_object_add_uint (counter, "link-type", n4->linkt);
+ vat_json_object_add_uint (counter, "packets", n4->packets);
+ vat_json_object_add_uint (counter, "bytes", n4->bytes);
+ }
+ }
+
+ /* ip6 nbr counters */
+ msg_array = vat_json_object_add (&node, "ip6_nbr_counters");
+ vat_json_init_array (msg_array);
+ for (i = 0; i < vec_len (vam->ip6_nbr_counters); i++)
+ {
+ msg = vat_json_array_add (msg_array);
+ vat_json_init_object (msg);
+ vat_json_object_add_uint (msg, "sw_if_index", i);
+ counter_array = vat_json_object_add (msg, "c");
+ vat_json_init_array (counter_array);
+ for (j = 0; j < vec_len (vam->ip6_nbr_counters[i]); j++)
+ {
+ counter = vat_json_array_add (counter_array);
+ vat_json_init_object (counter);
+ n6 = &vam->ip6_nbr_counters[i][j];
+ vat_json_object_add_ip6 (counter, "address", n6->address);
+ vat_json_object_add_uint (counter, "packets", n6->packets);
+ vat_json_object_add_uint (counter, "bytes", n6->bytes);
+ }
+ }
+
+ vat_json_print (vam->ofp, &node);
+ vat_json_free (&node);
+
+ return 0;
+}
+
+/*
+ * Pass CLI buffers directly in the CLI_INBAND API message,
+ * instead of an additional shared memory area.
+ */
+static int
+exec_inband (vat_main_t * vam)
+{
+ vl_api_cli_inband_t *mp;
+ unformat_input_t *i = vam->input;
+ int ret;
+
+ if (vec_len (i->buffer) == 0)
+ return -1;
+
+ if (vam->exec_mode == 0 && unformat (i, "mode"))
+ {
+ vam->exec_mode = 1;
+ return 0;
+ }
+ if (vam->exec_mode == 1 && (unformat (i, "exit") || unformat (i, "quit")))
+ {
+ vam->exec_mode = 0;
+ return 0;
+ }
+
+ /*
+ * In order for the CLI command to work, it
+ * must be a vector ending in \n, not a C-string ending
+ * in \n\0.
+ */
+ u32 len = vec_len (vam->input->buffer);
+ M2 (CLI_INBAND, mp, len);
+ clib_memcpy (mp->cmd, vam->input->buffer, len);
+ mp->length = htonl (len);
+
+ S (mp);
+ W (ret);
+ /* json responses may or may not include a useful reply... */
+ if (vec_len (vam->cmd_reply))
+ print (vam->ofp, "%v", (char *) (vam->cmd_reply));
+ return ret;
+}
+
+int
+exec (vat_main_t * vam)
+{
+ return exec_inband (vam);
+}
+
+static int
+api_create_loopback (vat_main_t * vam)
+{
+ unformat_input_t *i = vam->input;
+ vl_api_create_loopback_t *mp;
+ vl_api_create_loopback_instance_t *mp_lbi;
+ u8 mac_address[6];
+ u8 mac_set = 0;
+ u8 is_specified = 0;
+ u32 user_instance = 0;
+ int ret;
+
+ memset (mac_address, 0, sizeof (mac_address));
+
+ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (i, "mac %U", unformat_ethernet_address, mac_address))
+ mac_set = 1;
+ if (unformat (i, "instance %d", &user_instance))
+ is_specified = 1;
+ else
+ break;
+ }
+
+ if (is_specified)
+ {
+ M (CREATE_LOOPBACK_INSTANCE, mp_lbi);
+ mp_lbi->is_specified = is_specified;
+ if (is_specified)
+ mp_lbi->user_instance = htonl (user_instance);
+ if (mac_set)
+ clib_memcpy (mp_lbi->mac_address, mac_address, sizeof (mac_address));
+ S (mp_lbi);
+ }
+ else
+ {
+ /* Construct the API message */
+ M (CREATE_LOOPBACK, mp);
+ if (mac_set)
+ clib_memcpy (mp->mac_address, mac_address, sizeof (mac_address));
+ S (mp);
+ }
+
+ W (ret);
+ return ret;
+}
+
+static int
+api_delete_loopback (vat_main_t * vam)
+{
+ unformat_input_t *i = vam->input;
+ vl_api_delete_loopback_t *mp;
+ u32 sw_if_index = ~0;
+ int ret;
+
+ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (i, "sw_if_index %d", &sw_if_index))
+ ;
+ else
+ break;
+ }
+
+ if (sw_if_index == ~0)
+ {
+ errmsg ("missing sw_if_index");
+ return -99;
+ }
+
+ /* Construct the API message */
+ M (DELETE_LOOPBACK, mp);
+ mp->sw_if_index = ntohl (sw_if_index);
+
+ S (mp);
+ W (ret);
+ return ret;
+}
+
+static int
+api_want_stats (vat_main_t * vam)
+{
+ unformat_input_t *i = vam->input;
+ vl_api_want_stats_t *mp;
+ int enable = -1;
+ int ret;
+
+ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (i, "enable"))
+ enable = 1;
+ else if (unformat (i, "disable"))
+ enable = 0;
+ else
+ break;
+ }
+
+ if (enable == -1)
+ {
+ errmsg ("missing enable|disable");
+ return -99;
+ }
+
+ M (WANT_STATS, mp);
+ mp->enable_disable = enable;
+
+ S (mp);
+ W (ret);
+ return ret;
+}
+
+static int
+api_want_interface_events (vat_main_t * vam)
+{
+ unformat_input_t *i = vam->input;
+ vl_api_want_interface_events_t *mp;
+ int enable = -1;
+ int ret;
+
+ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (i, "enable"))
+ enable = 1;
+ else if (unformat (i, "disable"))
+ enable = 0;
+ else
+ break;
+ }
+
+ if (enable == -1)
+ {
+ errmsg ("missing enable|disable");
+ return -99;
+ }
+
+ M (WANT_INTERFACE_EVENTS, mp);
+ mp->enable_disable = enable;
+
+ vam->interface_event_display = enable;
+
+ S (mp);
+ W (ret);
+ return ret;
+}
+
+
+/* Note: non-static, called once to set up the initial intfc table */
+int
+api_sw_interface_dump (vat_main_t * vam)
+{
+ vl_api_sw_interface_dump_t *mp;
+ vl_api_control_ping_t *mp_ping;
+ hash_pair_t *p;
+ name_sort_t *nses = 0, *ns;
+ sw_interface_subif_t *sub = NULL;
+ int ret;
+
+ /* Toss the old name table */
+ /* *INDENT-OFF* */
+ hash_foreach_pair (p, vam->sw_if_index_by_interface_name,
+ ({
+ vec_add2 (nses, ns, 1);
+ ns->name = (u8 *)(p->key);
+ ns->value = (u32) p->value[0];
+ }));
+ /* *INDENT-ON* */
+
+ hash_free (vam->sw_if_index_by_interface_name);
+
+ vec_foreach (ns, nses) vec_free (ns->name);
+
+ vec_free (nses);
+
+ vec_foreach (sub, vam->sw_if_subif_table)
+ {
+ vec_free (sub->interface_name);
+ }
+ vec_free (vam->sw_if_subif_table);
+
+ /* recreate the interface name hash table */
+ vam->sw_if_index_by_interface_name = hash_create_string (0, sizeof (uword));
+
+ /* Get list of ethernets */
+ M (SW_INTERFACE_DUMP, mp);
+ mp->name_filter_valid = 1;
+ strncpy ((char *) mp->name_filter, "Ether", sizeof (mp->name_filter) - 1);
+ S (mp);
+
+ /* and local / loopback interfaces */
+ M (SW_INTERFACE_DUMP, mp);
+ mp->name_filter_valid = 1;
+ strncpy ((char *) mp->name_filter, "lo", sizeof (mp->name_filter) - 1);
+ S (mp);
+
+ /* and packet-generator interfaces */
+ M (SW_INTERFACE_DUMP, mp);
+ mp->name_filter_valid = 1;
+ strncpy ((char *) mp->name_filter, "pg", sizeof (mp->name_filter) - 1);
+ S (mp);
+
+ /* and vxlan-gpe tunnel interfaces */
+ M (SW_INTERFACE_DUMP, mp);
+ mp->name_filter_valid = 1;
+ strncpy ((char *) mp->name_filter, "vxlan_gpe",
+ sizeof (mp->name_filter) - 1);
+ S (mp);
+
+ /* and vxlan tunnel interfaces */
+ M (SW_INTERFACE_DUMP, mp);
+ mp->name_filter_valid = 1;
+ strncpy ((char *) mp->name_filter, "vxlan", sizeof (mp->name_filter) - 1);
+ S (mp);
+
+ /* and geneve tunnel interfaces */
+ M (SW_INTERFACE_DUMP, mp);
+ mp->name_filter_valid = 1;
+ strncpy ((char *) mp->name_filter, "geneve", sizeof (mp->name_filter) - 1);
+ S (mp);
+
+ /* and host (af_packet) interfaces */
+ M (SW_INTERFACE_DUMP, mp);
+ mp->name_filter_valid = 1;
+ strncpy ((char *) mp->name_filter, "host", sizeof (mp->name_filter) - 1);
+ S (mp);
+
+ /* and l2tpv3 tunnel interfaces */
+ M (SW_INTERFACE_DUMP, mp);
+ mp->name_filter_valid = 1;
+ strncpy ((char *) mp->name_filter, "l2tpv3_tunnel",
+ sizeof (mp->name_filter) - 1);
+ S (mp);
+
+ /* and GRE tunnel interfaces */
+ M (SW_INTERFACE_DUMP, mp);
+ mp->name_filter_valid = 1;
+ strncpy ((char *) mp->name_filter, "gre", sizeof (mp->name_filter) - 1);
+ S (mp);
+
+ /* and LISP-GPE interfaces */
+ M (SW_INTERFACE_DUMP, mp);
+ mp->name_filter_valid = 1;
+ strncpy ((char *) mp->name_filter, "lisp_gpe",
+ sizeof (mp->name_filter) - 1);
+ S (mp);
+
+ /* and IPSEC tunnel interfaces */
+ M (SW_INTERFACE_DUMP, mp);
+ mp->name_filter_valid = 1;
+ strncpy ((char *) mp->name_filter, "ipsec", sizeof (mp->name_filter) - 1);
+ S (mp);
+
+ /* Use a control ping for synchronization */
+ MPING (CONTROL_PING, mp_ping);
+ S (mp_ping);
+
+ W (ret);
+ return ret;
+}