summaryrefslogtreecommitdiffstats
path: root/src/vat
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2018-09-20 16:07:00 -0400
committerNeale Ranns <nranns@cisco.com>2018-09-21 08:18:34 +0000
commit22030434ac9a3a7296617b996268e79dbf8bbffa (patch)
tree131292c34035b8508003773b3111eb0a002005aa /src/vat
parentc01c4451c5c6285fbfb086fb46557234804f86ee (diff)
Add more CLI options to vpp_api_test for calling ip_add_del_route
Change-Id: I114e93b6bc71cfcdcfe6d3ddde26f77118e36ab8 Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'src/vat')
-rw-r--r--src/vat/api_format.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/vat/api_format.c b/src/vat/api_format.c
index 61b34973d6f..0a0198940cf 100644
--- a/src/vat/api_format.c
+++ b/src/vat/api_format.c
@@ -8486,6 +8486,8 @@ api_ip_add_del_route (vat_main_t * vam)
mpls_label_t next_hop_out_label = MPLS_LABEL_INVALID;
mpls_label_t next_hop_via_label = MPLS_LABEL_INVALID;
+ memset (&v4_next_hop_address, 0, sizeof (ip4_address_t));
+ memset (&v6_next_hop_address, 0, sizeof (ip6_address_t));
/* Parse args required to build the message */
while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
{
@@ -8518,6 +8520,16 @@ api_ip_add_del_route (vat_main_t * vam)
{
next_hop_set = 1;
}
+ else
+ if (unformat
+ (i, "via %U", api_unformat_sw_if_index, vam, &sw_if_index))
+ {
+ next_hop_set = 1;
+ }
+ else if (unformat (i, "via sw_if_index %d", &sw_if_index))
+ {
+ next_hop_set = 1;
+ }
else if (unformat (i, "resolve-attempts %d", &resolve_attempts))
;
else if (unformat (i, "weight %d", &next_hop_weight))
@@ -23509,8 +23521,8 @@ _(sw_interface_slave_dump, \
_(ip_table_add_del, \
"table <n> [ipv6] [add | del]\n") \
_(ip_add_del_route, \
- "<addr>/<mask> via <addr | via-label <n>> [table-id <n>]\n" \
- "[<intfc> | sw_if_index <id>] [resolve-attempts <n>]\n" \
+ "<addr>/<mask> via <<addr>|<intfc>|sw_if_index <id>|via-label <n>>\n" \
+ "[table-id <n>] [<intfc> | sw_if_index <id>] [resolve-attempts <n>]\n"\
"[weight <n>] [drop] [local] [classify <n>] [del]\n" \
"[multipath] [count <n>]") \
_(ip_mroute_add_del, \