#include <vnet/ip/ip4_reassembly.h>
#include <vnet/ip/ip6_reassembly.h>
#include <vnet/ethernet/arp.h>
+#include <vnet/ip/ip_types_api.h>
#include <vnet/vnet_msg_enum.h>
_(SW_INTERFACE_IP6_SET_LINK_LOCAL_ADDRESS, \
sw_interface_ip6_set_link_local_address) \
_(IP_CONTAINER_PROXY_ADD_DEL, ip_container_proxy_add_del) \
+_(IP_CONTAINER_PROXY_DUMP, ip_container_proxy_dump) \
_(IOAM_ENABLE, ioam_enable) \
_(IOAM_DISABLE, ioam_disable) \
_(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, \
sizeof (pfx.fp_src_addr.ip4));
memset (&nh.ip6, 0, sizeof (nh.ip6));
clib_memcpy (&nh.ip4, mp->nh_address, sizeof (nh.ip4));
+ if (!ip46_address_is_zero (&pfx.fp_src_addr))
+ pfx.fp_len = 64;
}
else
{
clib_memcpy (&pfx.fp_src_addr.ip6, mp->src_address,
sizeof (pfx.fp_src_addr.ip6));
clib_memcpy (&nh.ip6, mp->nh_address, sizeof (nh.ip6));
+ if (!ip46_address_is_zero (&pfx.fp_src_addr))
+ pfx.fp_len = 256;
}
mfib_entry_index = mroute_add_del_handler (mp->is_add,
REPLY_MACRO (VL_API_IP_CONTAINER_PROXY_ADD_DEL_REPLY);
}
+typedef struct ip_container_proxy_walk_ctx_t_
+{
+ vl_api_registration_t *reg;
+ u32 context;
+} ip_container_proxy_walk_ctx_t;
+
+static int
+ip_container_proxy_send_details (const fib_prefix_t * pfx, u32 sw_if_index,
+ void *args)
+{
+ vl_api_ip_container_proxy_details_t *mp;
+ ip_container_proxy_walk_ctx_t *ctx = args;
+
+ mp = vl_msg_api_alloc (sizeof (*mp));
+ if (!mp)
+ return 1;
+
+ memset (mp, 0, sizeof (*mp));
+ mp->_vl_msg_id = ntohs (VL_API_IP_CONTAINER_PROXY_DETAILS);
+ mp->context = ctx->context;
+
+ mp->sw_if_index = ntohl (sw_if_index);
+ ip_prefix_encode (pfx, &mp->prefix);
+
+ vl_api_send_msg (ctx->reg, (u8 *) mp);
+
+ return 1;
+}
+
+static void
+vl_api_ip_container_proxy_dump_t_handler (vl_api_ip_container_proxy_dump_t *
+ mp)
+{
+ vl_api_registration_t *reg;
+
+ reg = vl_api_client_index_to_registration (mp->client_index);
+ if (!reg)
+ return;
+
+ ip_container_proxy_walk_ctx_t ctx = {
+ .context = mp->context,
+ .reg = reg,
+ };
+
+ ip_container_proxy_walk (ip_container_proxy_send_details, &ctx);
+}
+
static void
vl_api_ioam_enable_t_handler (vl_api_ioam_enable_t * mp)
{