X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvat%2Fapi_format.c;h=ae1db411242698885339ab960dfa5fa39be84f50;hb=9a6fcef43c3263d6acb95aaca2dcd2eb86169a75;hp=7cd4b22df9abf878b4b6fa30df18cf36ab883727;hpb=d91c1dbdb31f80db7d967f2f57c43d0a81d65297;p=vpp.git diff --git a/src/vat/api_format.c b/src/vat/api_format.c index 7cd4b22df9a..ae1db411242 100644 --- a/src/vat/api_format.c +++ b/src/vat/api_format.c @@ -5116,7 +5116,8 @@ _(p2p_ethernet_add_reply) \ _(p2p_ethernet_del_reply) \ _(lldp_config_reply) \ _(sw_interface_set_lldp_reply) \ -_(tcp_configure_src_addresses_reply) +_(tcp_configure_src_addresses_reply) \ +_(app_namespace_add_del_reply) #define _(n) \ static void vl_api_##n##_t_handler \ @@ -5420,7 +5421,8 @@ _(P2P_ETHERNET_ADD_REPLY, p2p_ethernet_add_reply) \ _(P2P_ETHERNET_DEL_REPLY, p2p_ethernet_del_reply) \ _(LLDP_CONFIG_REPLY, lldp_config_reply) \ _(SW_INTERFACE_SET_LLDP_REPLY, sw_interface_set_lldp_reply) \ -_(TCP_CONFIGURE_SRC_ADDRESSES_REPLY, tcp_configure_src_addresses_reply) +_(TCP_CONFIGURE_SRC_ADDRESSES_REPLY, tcp_configure_src_addresses_reply) \ +_(APP_NAMESPACE_ADD_DEL_REPLY, app_namespace_add_del_reply) #define foreach_standalone_reply_msg \ _(SW_INTERFACE_EVENT, sw_interface_event) \ @@ -20631,9 +20633,14 @@ api_sw_interface_set_lldp (vat_main_t * vam) vl_api_sw_interface_set_lldp_t *mp; u32 sw_if_index = ~0; u32 enable = 1; - u8 *port_desc = NULL; + u8 *port_desc = NULL, *mgmt_oid = NULL; + ip4_address_t ip4_addr; + ip6_address_t ip6_addr; int ret; + memset (&ip4_addr, 0, sizeof (ip4_addr)); + memset (&ip6_addr, 0, sizeof (ip6_addr)); + while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { if (unformat (i, "disable")) @@ -20645,6 +20652,12 @@ api_sw_interface_set_lldp (vat_main_t * vam) ; else if (unformat (i, "port-desc %s", &port_desc)) ; + else if (unformat (i, "mgmt-ip4 %U", unformat_ip4_address, &ip4_addr)) + ; + else if (unformat (i, "mgmt-ip6 %U", unformat_ip6_address, &ip6_addr)) + ; + else if (unformat (i, "mgmt-oid %s", &mgmt_oid)) + ; else break; } @@ -20657,11 +20670,16 @@ api_sw_interface_set_lldp (vat_main_t * vam) /* Construct the API message */ vec_add1 (port_desc, 0); + vec_add1 (mgmt_oid, 0); M (SW_INTERFACE_SET_LLDP, mp); mp->sw_if_index = ntohl (sw_if_index); mp->enable = enable; clib_memcpy (mp->port_desc, port_desc, vec_len (port_desc)); + clib_memcpy (mp->mgmt_oid, mgmt_oid, vec_len (mgmt_oid)); + clib_memcpy (mp->mgmt_ip4, &ip4_addr, sizeof (ip4_addr)); + clib_memcpy (mp->mgmt_ip6, &ip6_addr, sizeof (ip6_addr)); vec_free (port_desc); + vec_free (mgmt_oid); S (mp); W (ret); @@ -20735,6 +20753,55 @@ api_tcp_configure_src_addresses (vat_main_t * vam) return ret; } +static int +api_app_namespace_add_del (vat_main_t * vam) +{ + vl_api_app_namespace_add_del_t *mp; + unformat_input_t *i = vam->input; + u8 *ns_id = 0, secret_set = 0, sw_if_index_set = 0; + u32 sw_if_index, ip4_fib_id, ip6_fib_id; + u64 secret; + int ret; + + while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) + { + if (unformat (i, "id %_%v%_", &ns_id)) + ; + else if (unformat (i, "secret %lu", &secret)) + secret_set = 1; + else if (unformat (i, "sw_if_index %d", &sw_if_index)) + sw_if_index_set = 1; + else if (unformat (i, "ip4_fib_id %d", &ip4_fib_id)) + ; + else if (unformat (i, "ip6_fib_id %d", &ip6_fib_id)) + ; + else + break; + } + if (!ns_id || !secret_set || !sw_if_index_set) + { + errmsg ("namespace id, secret and sw_if_index must be set"); + return -99; + } + if (vec_len (ns_id) > 64) + { + errmsg ("namespace id too long"); + return -99; + } + M (APP_NAMESPACE_ADD_DEL, mp); + + clib_memcpy (mp->namespace_id, ns_id, vec_len (ns_id)); + mp->namespace_id_len = vec_len (ns_id); + mp->secret = secret; + mp->sw_if_index = clib_host_to_net_u32 (sw_if_index); + mp->ip4_fib_id = clib_host_to_net_u32 (ip4_fib_id); + mp->ip6_fib_id = clib_host_to_net_u32 (ip6_fib_id); + vec_free (ns_id); + S (mp); + W (ret); + return ret; +} + static int api_memfd_segment_create (vat_main_t * vam) { @@ -21549,9 +21616,11 @@ _(sw_interface_get_table, " | sw_if_index [ipv6]") \ _(p2p_ethernet_add, " | sw_if_index remote_mac sub_id ") \ _(p2p_ethernet_del, " | sw_if_index remote_mac ") \ _(lldp_config, "system-name tx-hold tx-interval ") \ -_(sw_interface_set_lldp, " | sw_if_index [port-desc ] [disable]") \ +_(sw_interface_set_lldp, " | sw_if_index [port-desc ]\n" \ + " [mgmt-ip4 ] [mgmt-ip6 ] [mgmt-oid ] [disable]") \ _(tcp_configure_src_addresses, "first-last [vrf ]") \ -_(memfd_segment_create,"size ") +_(memfd_segment_create,"size ") \ +_(app_namespace_add_del, "[add] id secret sw_if_index ")\ /* List of command functions, CLI names map directly to functions */ #define foreach_cli_function \