summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/ip/ip_test.c')
-rw-r--r--src/vnet/ip/ip_test.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/vnet/ip/ip_test.c b/src/vnet/ip/ip_test.c
index 3ba38d3470e..c47cd3d208e 100644
--- a/src/vnet/ip/ip_test.c
+++ b/src/vnet/ip/ip_test.c
@@ -40,7 +40,6 @@ typedef struct
{
/* API message ID base */
u16 msg_id_base;
- u32 ping_id;
vat_main_t *vat_main;
} ip_test_main_t;
@@ -100,7 +99,7 @@ increment_address (vl_api_address_t *a)
static uword
unformat_fib_path (unformat_input_t *input, va_list *args)
{
- vnet_main_t *vnm = va_arg (*args, vnet_main_t *);
+ vat_main_t *vam = va_arg (*args, vat_main_t *);
vl_api_fib_path_t *path = va_arg (*args, vl_api_fib_path_t *);
u32 weight, preference;
mpls_label_t out_label;
@@ -114,14 +113,14 @@ unformat_fib_path (unformat_input_t *input, va_list *args)
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
{
if (unformat (input, "%U %U", unformat_vl_api_ip4_address,
- &path->nh.address.ip4, unformat_vnet_sw_interface, vnm,
+ &path->nh.address.ip4, api_unformat_sw_if_index, vam,
&path->sw_if_index))
{
path->proto = FIB_API_PATH_NH_PROTO_IP4;
}
else if (unformat (input, "%U %U", unformat_vl_api_ip6_address,
- &path->nh.address.ip6, unformat_vnet_sw_interface,
- vnm, &path->sw_if_index))
+ &path->nh.address.ip6, api_unformat_sw_if_index, vam,
+ &path->sw_if_index))
{
path->proto = FIB_API_PATH_NH_PROTO_IP6;
}
@@ -238,7 +237,6 @@ unformat_fib_path (unformat_input_t *input, va_list *args)
static int
api_ip_route_add_del (vat_main_t *vam)
{
- vnet_main_t *vnm = vnet_get_main ();
unformat_input_t *i = vam->input;
vl_api_ip_route_add_del_t *mp;
u32 vrf_id = 0;
@@ -274,7 +272,7 @@ api_ip_route_add_del (vat_main_t *vam)
is_multipath = 1;
else if (unformat (i, "seed %d", &random_seed))
;
- else if (unformat (i, "via %U", unformat_fib_path, vnm,
+ else if (unformat (i, "via %U", unformat_fib_path, vam,
&paths[path_count]))
{
path_count++;
@@ -704,7 +702,6 @@ vl_api_ip_punt_redirect_v2_details_t_handler (
static int
api_ip_address_dump (vat_main_t *vam)
{
- vnet_main_t *vnm = vnet_get_main ();
unformat_input_t *i = vam->input;
vl_api_ip_address_dump_t *mp;
vl_api_control_ping_t *mp_ping;
@@ -718,8 +715,7 @@ api_ip_address_dump (vat_main_t *vam)
{
if (unformat (i, "sw_if_index %d", &sw_if_index))
sw_if_index_set = 1;
- else if (unformat (i, "%U", unformat_vnet_sw_interface, vnm,
- &sw_if_index))
+ else if (unformat (i, "%U", api_unformat_sw_if_index, vam, &sw_if_index))
sw_if_index_set = 1;
else if (unformat (i, "ipv4"))
ipv4_set = 1;
@@ -1022,7 +1018,6 @@ vl_api_ip_reassembly_get_reply_t_handler (vl_api_ip_reassembly_get_reply_t *mp)
int
api_ip_source_and_port_range_check_interface_add_del (vat_main_t *vam)
{
- vnet_main_t *vnm = vnet_get_main ();
unformat_input_t *input = vam->input;
vl_api_ip_source_and_port_range_check_interface_add_del_t *mp;
u32 sw_if_index = ~0;
@@ -1034,8 +1029,7 @@ api_ip_source_and_port_range_check_interface_add_del (vat_main_t *vam)
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
{
- if (unformat (input, "%U", unformat_vnet_sw_interface, vnm,
- &sw_if_index))
+ if (unformat (input, "%U", api_unformat_sw_if_index, vam, &sw_if_index))
;
else if (unformat (input, "sw_if_index %d", &sw_if_index))
;
@@ -1214,7 +1208,6 @@ api_ip_mroute_dump (vat_main_t *vam)
static int
api_sw_interface_ip6_enable_disable (vat_main_t *vam)
{
- vnet_main_t *vnm = vnet_get_main ();
unformat_input_t *i = vam->input;
vl_api_sw_interface_ip6_enable_disable_t *mp;
u32 sw_if_index;
@@ -1224,7 +1217,7 @@ api_sw_interface_ip6_enable_disable (vat_main_t *vam)
while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
{
- if (unformat (i, "%U", unformat_vnet_sw_interface, vnm, &sw_if_index))
+ 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;