X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvat%2Fapi_format.c;h=8d2cf17b923c527ea225c1093342716a0fc034fb;hb=26f341a8392d73735d7f341d7e947150966eeb6b;hp=3654cd663bda339cbf6e846ba35bb70b11461d79;hpb=4d9b9d8e74f12a26404ccdd8baf46c61b44584db;p=vpp.git diff --git a/src/vat/api_format.c b/src/vat/api_format.c index 3654cd663bd..8d2cf17b923 100644 --- a/src/vat/api_format.c +++ b/src/vat/api_format.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include @@ -5391,7 +5391,8 @@ _(tcp_configure_src_addresses_reply) \ _(dns_enable_disable_reply) \ _(dns_name_server_add_del_reply) \ _(session_rule_add_del_reply) \ -_(ip_container_proxy_add_del_reply) +_(ip_container_proxy_add_del_reply) \ +_(output_acl_set_interface_reply) #define _(n) \ static void vl_api_##n##_t_handler \ @@ -5719,6 +5720,7 @@ _(DNS_RESOLVE_IP_REPLY, dns_resolve_ip_reply) \ _(SESSION_RULE_ADD_DEL_REPLY, session_rule_add_del_reply) \ _(SESSION_RULES_DETAILS, session_rules_details) \ _(IP_CONTAINER_PROXY_ADD_DEL_REPLY, ip_container_proxy_add_del_reply) \ +_(OUTPUT_ACL_SET_INTERFACE_REPLY, output_acl_set_interface_reply) \ #define foreach_standalone_reply_msg \ _(SW_INTERFACE_EVENT, sw_interface_event) \ @@ -7772,8 +7774,12 @@ api_tap_create_v2 (vat_main_t * vam) u8 host_mac_addr_set = 0; u8 *host_bridge = 0; ip4_address_t host_ip4_addr; + ip4_address_t host_ip4_gw; + u8 host_ip4_gw_set = 0; u32 host_ip4_prefix_len = 0; ip6_address_t host_ip6_addr; + ip6_address_t host_ip6_gw; + u8 host_ip6_gw_set = 0; u32 host_ip6_prefix_len = 0; int ret; int rx_ring_sz = 0, tx_ring_sz = 0; @@ -7804,6 +7810,12 @@ api_tap_create_v2 (vat_main_t * vam) else if (unformat (i, "host-ip6-addr %U/%d", unformat_ip6_address, &host_ip6_addr, &host_ip6_prefix_len)) ; + else if (unformat (i, "host-ip4-gw %U", unformat_ip4_address, + &host_ip4_gw)) + host_ip4_gw_set = 1; + else if (unformat (i, "host-ip6-gw %U", unformat_ip6_address, + &host_ip6_gw)) + host_ip6_gw_set = 1; else if (unformat (i, "rx-ring-size %d", &rx_ring_sz)) ; else if (unformat (i, "tx-ring-size %d", &tx_ring_sz)) @@ -7885,7 +7897,10 @@ api_tap_create_v2 (vat_main_t * vam) clib_memcpy (mp->host_ip4_addr, &host_ip4_addr, 4); if (host_ip4_prefix_len) clib_memcpy (mp->host_ip6_addr, &host_ip6_addr, 16); - + if (host_ip4_gw_set) + clib_memcpy (mp->host_ip4_gw, &host_ip4_gw, 4); + if (host_ip6_gw_set) + clib_memcpy (mp->host_ip6_gw, &host_ip6_gw, 16); vec_free (host_ns); vec_free (host_if_name); @@ -9531,7 +9546,7 @@ vl_api_dhcp_proxy_details_t_handler (vl_api_dhcp_proxy_details_t * mp) if (mp->is_ipv6) print (vam->ofp, "RX Table-ID %d, Source Address %U, VSS Type %d, " - "VSS VPN-ID '%s', VSS FIB-ID %d, VSS OUI %d", + "VSS ASCII VPN-ID '%s', VSS RFC2685 VPN-ID (oui:id) %d:%d", ntohl (mp->rx_vrf_id), format_ip6_address, mp->dhcp_src_address, mp->vss_type, mp->vss_vpn_ascii_id, @@ -9539,7 +9554,7 @@ vl_api_dhcp_proxy_details_t_handler (vl_api_dhcp_proxy_details_t * mp) else print (vam->ofp, "RX Table-ID %d, Source Address %U, VSS Type %d, " - "VSS VPN-ID '%s', VSS FIB-ID %d, VSS OUI %d", + "VSS ASCII VPN-ID '%s', VSS RFC2685 VPN-ID (oui:id) %d:%d", ntohl (mp->rx_vrf_id), format_ip4_address, mp->dhcp_src_address, mp->vss_type, mp->vss_vpn_ascii_id, @@ -12497,6 +12512,7 @@ api_vxlan_add_del_tunnel (vat_main_t * vam) u8 src_set = 0; u8 dst_set = 0; u8 grp_set = 0; + u32 instance = ~0; u32 mcast_sw_if_index = ~0; u32 encap_vrf_id = 0; u32 decap_next_index = ~0; @@ -12511,6 +12527,8 @@ api_vxlan_add_del_tunnel (vat_main_t * vam) { if (unformat (line_input, "del")) is_add = 0; + else if (unformat (line_input, "instance %d", &instance)) + ; else if (unformat (line_input, "src %U", unformat_ip4_address, &src.ip4)) { @@ -12630,6 +12648,8 @@ api_vxlan_add_del_tunnel (vat_main_t * vam) clib_memcpy (mp->src_address, &src.ip4, sizeof (src.ip4)); clib_memcpy (mp->dst_address, &dst.ip4, sizeof (dst.ip4)); } + + mp->instance = htonl (instance); mp->encap_vrf_id = ntohl (encap_vrf_id); mp->decap_next_index = ntohl (decap_next_index); mp->mcast_sw_if_index = ntohl (mcast_sw_if_index); @@ -12649,8 +12669,9 @@ static void vl_api_vxlan_tunnel_details_t_handler ip46_address_t src = to_ip46 (mp->is_ipv6, mp->dst_address); ip46_address_t dst = to_ip46 (mp->is_ipv6, mp->src_address); - print (vam->ofp, "%11d%24U%24U%14d%18d%13d%19d", + print (vam->ofp, "%11d%11d%24U%24U%14d%18d%13d%19d", ntohl (mp->sw_if_index), + ntohl (mp->instance), format_ip46_address, &src, IP46_TYPE_ANY, format_ip46_address, &dst, IP46_TYPE_ANY, ntohl (mp->encap_vrf_id), @@ -12673,6 +12694,9 @@ static void vl_api_vxlan_tunnel_details_t_handler_json vat_json_init_object (node); vat_json_object_add_uint (node, "sw_if_index", ntohl (mp->sw_if_index)); + + vat_json_object_add_uint (node, "instance", ntohl (mp->instance)); + if (mp->is_ipv6) { struct in6_addr ip6; @@ -12726,8 +12750,8 @@ api_vxlan_tunnel_dump (vat_main_t * vam) if (!vam->json_output) { - print (vam->ofp, "%11s%24s%24s%14s%18s%13s%19s", - "sw_if_index", "src_address", "dst_address", + print (vam->ofp, "%11s%11s%24s%24s%14s%18s%13s%19s", + "sw_if_index", "instance", "src_address", "dst_address", "encap_vrf_id", "decap_next_index", "vni", "mcast_sw_if_index"); } @@ -14125,6 +14149,59 @@ api_input_acl_set_interface (vat_main_t * vam) return ret; } +static int +api_output_acl_set_interface (vat_main_t * vam) +{ + unformat_input_t *i = vam->input; + vl_api_output_acl_set_interface_t *mp; + u32 sw_if_index; + int sw_if_index_set; + u32 ip4_table_index = ~0; + u32 ip6_table_index = ~0; + u32 l2_table_index = ~0; + u8 is_add = 1; + int ret; + + while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) + { + if (unformat (i, "%U", api_unformat_sw_if_index, vam, &sw_if_index)) + sw_if_index_set = 1; + else if (unformat (i, "sw_if_index %d", &sw_if_index)) + sw_if_index_set = 1; + else if (unformat (i, "del")) + is_add = 0; + else if (unformat (i, "ip4-table %d", &ip4_table_index)) + ; + else if (unformat (i, "ip6-table %d", &ip6_table_index)) + ; + else if (unformat (i, "l2-table %d", &l2_table_index)) + ; + else + { + clib_warning ("parse error '%U'", format_unformat_error, i); + return -99; + } + } + + if (sw_if_index_set == 0) + { + errmsg ("missing interface name or sw_if_index"); + return -99; + } + + M (OUTPUT_ACL_SET_INTERFACE, mp); + + mp->sw_if_index = ntohl (sw_if_index); + mp->ip4_table_index = ntohl (ip4_table_index); + mp->ip6_table_index = ntohl (ip6_table_index); + mp->l2_table_index = ntohl (l2_table_index); + mp->is_add = is_add; + + S (mp); + W (ret); + return ret; +} + static int api_ip_address_dump (vat_main_t * vam) { @@ -22799,7 +22876,7 @@ _(l2tpv3_set_lookup_key, \ _(sw_if_l2tpv3_tunnel_dump, "") \ _(vxlan_add_del_tunnel, \ "src { dst | group \n" \ - "{ | mcast_sw_if_index } }\n" \ + "{ | mcast_sw_if_index } [instance ]}\n" \ "vni [encap-vrf-id ] [decap-next ] [del]") \ _(geneve_add_del_tunnel, \ "src { dst | group \n" \ @@ -23100,6 +23177,9 @@ _(session_rule_add_del, "[add|del] proto / " \ " / action ") \ _(session_rules_dump, "") \ _(ip_container_proxy_add_del, "[add|del]
") \ +_(output_acl_set_interface, \ + " | sw_if_index [ip4-table ] [ip6-table ]\n" \ + " [l2-table ] [del]") \ /* List of command functions, CLI names map directly to functions */ #define foreach_cli_function \