diff options
author | Neale Ranns <nranns@cisco.com> | 2017-08-14 07:18:42 -0700 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2017-08-14 17:57:20 +0000 |
commit | 28ab9cc13bb0b6adf68277f12cfcd33b69f40b00 (patch) | |
tree | ada169476053b1164e2762138bb389b0a693f54d /src/vat | |
parent | 2245c0fe254f22cb64df193b90e0e6c3c6ef7847 (diff) |
FIB table add/delete API only
commit only the addition of the .api definition and their invocation through VAT so CSIT can use it
Change-Id: Id510f14b1ce007fe5e92120507ea34100652fc64
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vat')
-rw-r--r-- | src/vat/api_format.c | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/src/vat/api_format.c b/src/vat/api_format.c index ddcd5621808..9381ec5df45 100644 --- a/src/vat/api_format.c +++ b/src/vat/api_format.c @@ -4615,8 +4615,10 @@ _(l2fib_add_del_reply) \ _(l2fib_flush_int_reply) \ _(l2fib_flush_bd_reply) \ _(ip_add_del_route_reply) \ +_(ip_table_add_del_reply) \ _(ip_mroute_add_del_reply) \ _(mpls_route_add_del_reply) \ +_(mpls_table_add_del_reply) \ _(mpls_ip_bind_unbind_reply) \ _(proxy_arp_add_del_reply) \ _(proxy_arp_intfc_enable_disable_reply) \ @@ -4801,7 +4803,9 @@ _(TAP_MODIFY_REPLY, tap_modify_reply) \ _(TAP_DELETE_REPLY, tap_delete_reply) \ _(SW_INTERFACE_TAP_DETAILS, sw_interface_tap_details) \ _(IP_ADD_DEL_ROUTE_REPLY, ip_add_del_route_reply) \ +_(IP_TABLE_ADD_DEL_REPLY, ip_table_add_del_reply) \ _(IP_MROUTE_ADD_DEL_REPLY, ip_mroute_add_del_reply) \ +_(MPLS_TABLE_ADD_DEL_REPLY, mpls_table_add_del_reply) \ _(MPLS_ROUTE_ADD_DEL_REPLY, mpls_route_add_del_reply) \ _(MPLS_IP_BIND_UNBIND_REPLY, mpls_ip_bind_unbind_reply) \ _(PROXY_ARP_ADD_DEL_REPLY, proxy_arp_add_del_reply) \ @@ -7049,6 +7053,56 @@ api_tap_delete (vat_main_t * vam) } static int +api_ip_table_add_del (vat_main_t * vam) +{ + unformat_input_t *i = vam->input; + vl_api_ip_table_add_del_t *mp; + u32 table_id = ~0; + u8 is_ipv6 = 0; + u8 is_add = 1; + int ret = 0; + + /* Parse args required to build the message */ + while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) + { + if (unformat (i, "ipv6")) + is_ipv6 = 1; + else if (unformat (i, "del")) + is_add = 0; + else if (unformat (i, "add")) + is_add = 1; + else if (unformat (i, "table %d", &table_id)) + ; + else + { + clib_warning ("parse error '%U'", format_unformat_error, i); + return -99; + } + } + + if (~0 == table_id) + { + errmsg ("missing table-ID"); + return -99; + } + + /* Construct the API message */ + M (IP_TABLE_ADD_DEL, mp); + + mp->table_id = ntohl (table_id); + mp->is_ipv6 = is_ipv6; + mp->is_add = is_add; + + /* send it... */ + S (mp); + + /* Wait for a reply... */ + W (ret); + + return ret; +} + +static int api_ip_add_del_route (vat_main_t * vam) { unformat_input_t *i = vam->input; @@ -7467,6 +7521,52 @@ api_ip_mroute_add_del (vat_main_t * vam) } static int +api_mpls_table_add_del (vat_main_t * vam) +{ + unformat_input_t *i = vam->input; + vl_api_mpls_table_add_del_t *mp; + u32 table_id = ~0; + u8 is_add = 1; + int ret = 0; + + /* Parse args required to build the message */ + while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) + { + if (unformat (i, "table %d", &table_id)) + ; + else if (unformat (i, "del")) + is_add = 0; + else if (unformat (i, "add")) + is_add = 1; + else + { + clib_warning ("parse error '%U'", format_unformat_error, i); + return -99; + } + } + + if (~0 == table_id) + { + errmsg ("missing table-ID"); + return -99; + } + + /* Construct the API message */ + M (MPLS_TABLE_ADD_DEL, mp); + + mp->mt_table_id = ntohl (table_id); + mp->mt_is_add = is_add; + + /* send it... */ + S (mp); + + /* Wait for a reply... */ + W (ret); + + return ret; +} + +static int api_mpls_route_add_del (vat_main_t * vam) { unformat_input_t *i = vam->input; @@ -20000,6 +20100,8 @@ _(tap_modify, \ _(tap_delete, \ "<vpp-if-name> | sw_if_index <id>") \ _(sw_interface_tap_dump, "") \ +_(ip_table_add_del, \ + "table-id <n> [ipv6]\n") \ _(ip_add_del_route, \ "<addr>/<mask> via <addr> [table-id <n>]\n" \ "[<intfc> | sw_if_index <id>] [resolve-attempts <n>]\n" \ @@ -20008,6 +20110,8 @@ _(ip_add_del_route, \ _(ip_mroute_add_del, \ "<src> <grp>/<mask> [table-id <n>]\n" \ "[<intfc> | sw_if_index <id>] [local] [del]") \ +_(mpls_table_add_del, \ + "table-id <n>\n") \ _(mpls_route_add_del, \ "<label> <eos> via <addr> [table-id <n>]\n" \ "[<intfc> | sw_if_index <id>] [resolve-attempts <n>]\n" \ |