summaryrefslogtreecommitdiffstats
path: root/src/vat
diff options
context:
space:
mode:
Diffstat (limited to 'src/vat')
-rw-r--r--src/vat/api_format.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/vat/api_format.c b/src/vat/api_format.c
index 35b46f49fb0..e7382c29720 100644
--- a/src/vat/api_format.c
+++ b/src/vat/api_format.c
@@ -7562,6 +7562,7 @@ api_ip_add_del_route (vat_main_t * vam)
u8 is_ipv6 = 0;
u8 is_local = 0, is_drop = 0;
u8 is_unreach = 0, is_prohibit = 0;
+ u8 create_vrf_if_needed = 0;
u8 is_add = 1;
u32 next_hop_weight = 1;
u8 not_last = 0;
@@ -7658,6 +7659,8 @@ api_ip_add_del_route (vat_main_t * vam)
is_multipath = 1;
else if (unformat (i, "vrf %d", &vrf_id))
;
+ else if (unformat (i, "create-vrf"))
+ create_vrf_if_needed = 1;
else if (unformat (i, "count %d", &count))
;
else if (unformat (i, "lookup-in-vrf %d", &next_hop_table_id))
@@ -7744,6 +7747,7 @@ api_ip_add_del_route (vat_main_t * vam)
mp->next_hop_sw_if_index = ntohl (sw_if_index);
mp->table_id = ntohl (vrf_id);
+ mp->create_vrf_if_needed = create_vrf_if_needed;
mp->is_add = is_add;
mp->is_drop = is_drop;
@@ -7857,6 +7861,7 @@ api_ip_mroute_add_del (vat_main_t * vam)
u32 sw_if_index = ~0, vrf_id = 0;
u8 is_ipv6 = 0;
u8 is_local = 0;
+ u8 create_vrf_if_needed = 0;
u8 is_add = 1;
u8 address_set = 0;
u32 grp_address_length = 0;
@@ -7913,6 +7918,8 @@ api_ip_mroute_add_del (vat_main_t * vam)
is_add = 1;
else if (unformat (i, "vrf %d", &vrf_id))
;
+ else if (unformat (i, "create-vrf"))
+ create_vrf_if_needed = 1;
else if (unformat (i, "%U", unformat_mfib_itf_flags, &iflags))
;
else if (unformat (i, "%U", unformat_mfib_entry_flags, &eflags))
@@ -7935,6 +7942,7 @@ api_ip_mroute_add_del (vat_main_t * vam)
mp->next_hop_sw_if_index = ntohl (sw_if_index);
mp->table_id = ntohl (vrf_id);
+ mp->create_vrf_if_needed = create_vrf_if_needed;
mp->is_add = is_add;
mp->is_ipv6 = is_ipv6;
@@ -7975,12 +7983,12 @@ api_mpls_table_add_del (vat_main_t * vam)
/* Parse args required to build the message */
while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
{
- if (unformat (i, "del"))
+ if (unformat (i, "table %d", &table_id))
+ ;
+ else if (unformat (i, "del"))
is_add = 0;
else if (unformat (i, "add"))
is_add = 1;
- else if (unformat (i, "table-id %d", &table_id))
- ;
else
{
clib_warning ("parse error '%U'", format_unformat_error, i);
@@ -8015,6 +8023,7 @@ api_mpls_route_add_del (vat_main_t * vam)
unformat_input_t *i = vam->input;
vl_api_mpls_route_add_del_t *mp;
u32 sw_if_index = ~0, table_id = 0;
+ u8 create_table_if_needed = 0;
u8 is_add = 1;
u32 next_hop_weight = 1;
u8 is_multipath = 0;
@@ -8064,6 +8073,8 @@ api_mpls_route_add_del (vat_main_t * vam)
}
else if (unformat (i, "weight %d", &next_hop_weight))
;
+ else if (unformat (i, "create-table"))
+ create_table_if_needed = 1;
else if (unformat (i, "classify %d", &classify_table_index))
{
is_classify = 1;
@@ -8131,6 +8142,7 @@ api_mpls_route_add_del (vat_main_t * vam)
mp->mr_next_hop_sw_if_index = ntohl (sw_if_index);
mp->mr_table_id = ntohl (table_id);
+ mp->mr_create_table_if_needed = create_table_if_needed;
mp->mr_is_add = is_add;
mp->mr_next_hop_proto = next_hop_proto;
@@ -8236,6 +8248,7 @@ api_mpls_ip_bind_unbind (vat_main_t * vam)
unformat_input_t *i = vam->input;
vl_api_mpls_ip_bind_unbind_t *mp;
u32 ip_table_id = 0;
+ u8 create_table_if_needed = 0;
u8 is_bind = 1;
u8 is_ip4 = 1;
ip4_address_t v4_address;
@@ -8262,6 +8275,8 @@ api_mpls_ip_bind_unbind (vat_main_t * vam)
}
else if (unformat (i, "%d", &local_label))
;
+ else if (unformat (i, "create-table"))
+ create_table_if_needed = 1;
else if (unformat (i, "table-id %d", &ip_table_id))
;
else if (unformat (i, "unbind"))
@@ -8290,6 +8305,7 @@ api_mpls_ip_bind_unbind (vat_main_t * vam)
/* Construct the API message */
M (MPLS_IP_BIND_UNBIND, mp);
+ mp->mb_create_table_if_needed = create_table_if_needed;
mp->mb_is_bind = is_bind;
mp->mb_is_ip4 = is_ip4;
mp->mb_ip_table_id = ntohl (ip_table_id);