From 9d3a879d9d97a1b96543a942439ec1c3282a5cdd Mon Sep 17 00:00:00 2001 From: "Keith Burns (alagalah)" Date: Tue, 2 Aug 2016 11:57:37 -0700 Subject: VPP-226 - adding UDP TCP to port-range Change-Id: I5f4261279dcdbb03e182b18d05602407c0e55f89 Signed-off-by: Keith Burns (alagalah) --- vpp-api-test/vat/api_format.c | 49 ++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 17 deletions(-) (limited to 'vpp-api-test/vat') diff --git a/vpp-api-test/vat/api_format.c b/vpp-api-test/vat/api_format.c index 3590a076d85..d410955e9ff 100644 --- a/vpp-api-test/vat/api_format.c +++ b/vpp-api-test/vat/api_format.c @@ -13557,34 +13557,45 @@ int api_ip_source_and_port_range_check_interface_add_del (vat_main_t * vam) vl_api_ip_source_and_port_range_check_interface_add_del_t *mp; f64 timeout; u32 sw_if_index = ~0; - u32 vrf_id = ~0; + int vrf_set = 0; + u32 tcp_out_vrf_id = ~0, udp_out_vrf_id = ~0; + u32 tcp_in_vrf_id = ~0, udp_in_vrf_id = ~0; u8 is_add = 1; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) - { - if (unformat (input, "%U", unformat_sw_if_index, vam, &sw_if_index)) + { + if (unformat (input, "%U", unformat_sw_if_index, vam, &sw_if_index)) ; - else if (unformat (input, "sw_if_index %d", &sw_if_index)) + else if (unformat (input, "sw_if_index %d", &sw_if_index)) ; - else if (unformat (input, "vrf %d", &vrf_id)) - ; - else if (unformat (input, "del")) - is_add = 0; - else - break; - } + else if (unformat (input, "tcp-out-vrf %d", &tcp_out_vrf_id)) + vrf_set=1; + else if (unformat (input, "udp-out-vrf %d", &udp_out_vrf_id)) + vrf_set=1; + else if (unformat (input, "tcp-in-vrf %d", &tcp_in_vrf_id)) + vrf_set=1; + else if (unformat (input, "udp-in-vrf %d", &udp_in_vrf_id)) + vrf_set=1; + else if (unformat (input, "del")) + is_add = 0; + else + break; + } if (sw_if_index == ~0) { - errmsg ("Interface required but not specified\n"); - return -99; + errmsg ("Interface required but not specified\n"); + return -99; } - if (vrf_id == ~0) { + if (vrf_set == 0) { errmsg ("VRF ID required but not specified\n"); return -99; } - if (vrf_id == 0) { + if (tcp_out_vrf_id == 0 + || udp_out_vrf_id == 0 + || tcp_in_vrf_id == 0 + || udp_in_vrf_id == 0) { errmsg ("VRF ID should not be default. Should be distinct VRF for this purpose.\n"); return -99; } @@ -13594,7 +13605,10 @@ int api_ip_source_and_port_range_check_interface_add_del (vat_main_t * vam) mp->sw_if_index = ntohl (sw_if_index); mp->is_add = is_add; - mp->vrf_id = ntohl (vrf_id); + mp->tcp_out_vrf_id = ntohl (tcp_out_vrf_id); + mp->udp_out_vrf_id = ntohl (udp_out_vrf_id); + mp->tcp_in_vrf_id = ntohl (tcp_in_vrf_id); + mp->udp_in_vrf_id = ntohl (udp_in_vrf_id); /* send it... */ S; @@ -14135,7 +14149,8 @@ _(pg_enable_disable, "[stream ] disable") \ _(ip_source_and_port_range_check_add_del, \ "/ range - vrf ") \ _(ip_source_and_port_range_check_interface_add_del, \ - " | sw_if_index vrf ") + " | sw_if_index [tcp-out-vrf ] [tcp-in-vrf ]" \ + "[udp-in-vrf ] [udp-out-vrf ]") /* List of command functions, CLI names map directly to functions */ #define foreach_cli_function \ -- cgit 1.2.3-korg