#include <vnet/api_errno.h>
#include <vnet/ethernet/ethernet.h>
#include <vnet/ip/ip.h>
+#include <vnet/ip/ip_neighbor.h>
#include <vnet/ip/ip6_neighbor.h>
#include <vnet/fib/fib_table.h>
#include <vnet/fib/fib_api.h>
_(IP_DUMP, ip_dump) \
_(IP_NEIGHBOR_ADD_DEL, ip_neighbor_add_del) \
_(SET_ARP_NEIGHBOR_LIMIT, set_arp_neighbor_limit) \
+_(IP_PROBE_NEIGHBOR, ip_probe_neighbor) \
+_(IP_SCAN_NEIGHBOR_ENABLE_DISABLE, ip_scan_neighbor_enable_disable) \
_(WANT_IP4_ARP_EVENTS, want_ip4_arp_events) \
_(WANT_IP6_ND_EVENTS, want_ip6_nd_events) \
_(WANT_IP6_RA_EVENTS, want_ip6_ra_events) \
_(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, \
ip_source_and_port_range_check_interface_add_del) \
_(IP_REASSEMBLY_SET, ip_reassembly_set) \
-_(IP_REASSEMBLY_GET, ip_reassembly_get)
+_(IP_REASSEMBLY_GET, ip_reassembly_get) \
+_(IP_REASSEMBLY_ENABLE_DISABLE, ip_reassembly_enable_disable)
extern void stats_dslock_with_hint (int hint, int tag);
extern void stats_dsunlock (void);
dpo_proto_t nh_proto,
u32 entry_flags,
fib_rpf_id_t rpf_id,
- u32 next_hop_sw_if_index, u32 itf_flags, u32 bier_imp)
+ u32 next_hop_sw_if_index,
+ ip46_address_t * nh, u32 itf_flags, u32 bier_imp)
{
stats_dslock_with_hint (1 /* release hint */ , 2 /* tag */ );
fib_route_path_t path = {
.frp_sw_if_index = next_hop_sw_if_index,
.frp_proto = nh_proto,
+ .frp_addr = *nh,
};
if (is_local)
{
fib_protocol_t fproto;
dpo_proto_t nh_proto;
+ ip46_address_t nh;
u32 fib_index;
int rv;
sizeof (pfx.fp_grp_addr.ip4));
clib_memcpy (&pfx.fp_src_addr.ip4, mp->src_address,
sizeof (pfx.fp_src_addr.ip4));
+ memset (&nh.ip6, 0, sizeof (nh.ip6));
+ clib_memcpy (&nh.ip4, mp->nh_address, sizeof (nh.ip4));
}
else
{
sizeof (pfx.fp_grp_addr.ip6));
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));
}
return (mroute_add_del_handler (mp->is_add,
ntohl (mp->entry_flags),
ntohl (mp->rpf_id),
ntohl (mp->next_hop_sw_if_index),
+ &nh,
ntohl (mp->itf_flags),
ntohl (mp->bier_imp)));
}
({
vl_api_registration_t *vl_reg;
vl_reg = vl_api_client_index_to_registration (reg->client_index);
+ ASSERT (vl_reg != NULL);
if (reg && vl_api_can_send_msg (vl_reg))
{
vl_api_ip4_arp_event_t * event = vl_msg_api_alloc (sizeof *event);
REPLY_MACRO (VL_API_PROXY_ARP_INTFC_ENABLE_DISABLE_REPLY);
}
+static void
+vl_api_ip_probe_neighbor_t_handler (vl_api_ip_probe_neighbor_t * mp)
+{
+ int rv = 0;
+ vlib_main_t *vm = vlib_get_main ();
+ vl_api_ip_probe_neighbor_reply_t *rmp;
+ clib_error_t *error;
+
+ VALIDATE_SW_IF_INDEX (mp);
+
+ u32 sw_if_index = ntohl (mp->sw_if_index);
+
+ if (mp->is_ipv6)
+ error = ip6_probe_neighbor (vm, (ip6_address_t *) mp->dst_address,
+ sw_if_index);
+ else
+ error = ip4_probe_neighbor (vm, (ip4_address_t *) mp->dst_address,
+ sw_if_index);
+
+ if (error)
+ {
+ clib_error_report (error);
+ rv = clib_error_get_code (error);
+ }
+
+ BAD_SW_IF_INDEX_LABEL;
+
+ REPLY_MACRO (VL_API_PROXY_ARP_INTFC_ENABLE_DISABLE_REPLY);
+}
+
+static void
+ vl_api_ip_scan_neighbor_enable_disable_t_handler
+ (vl_api_ip_scan_neighbor_enable_disable_t * mp)
+{
+ int rv = 0;
+ vl_api_ip_scan_neighbor_enable_disable_reply_t *rmp;
+ ip_neighbor_scan_arg_t arg;
+
+ arg.mode = mp->mode;
+ arg.scan_interval = mp->scan_interval;
+ arg.max_proc_time = mp->max_proc_time;
+ arg.max_update = mp->max_update;
+ arg.scan_int_delay = mp->scan_int_delay;
+ arg.stale_threshold = mp->stale_threshold;
+ ip_neighbor_scan_enable_disable (&arg);
+
+ REPLY_MACRO (VL_API_IP_SCAN_NEIGHBOR_ENABLE_DISABLE_REPLY);
+}
+
static int
ip4_reset_fib_t_handler (vl_api_reset_fib_t * mp)
{
vl_msg_api_send_shmem (q, (u8 *) & rmp);
}
+void
+ vl_api_ip_reassembly_enable_disable_t_handler
+ (vl_api_ip_reassembly_enable_disable_t * mp)
+{
+ vl_api_ip_reassembly_enable_disable_reply_t *rmp;
+ int rv = 0;
+ rv = ip4_reass_enable_disable (clib_net_to_host_u32 (mp->sw_if_index),
+ mp->enable_ip4);
+ if (0 == rv)
+ {
+ rv = ip6_reass_enable_disable (clib_net_to_host_u32 (mp->sw_if_index),
+ mp->enable_ip6);
+ }
+
+ REPLY_MACRO (VL_API_IP_REASSEMBLY_SET_REPLY);
+}
+
#define vl_msg_name_crc_list
#include <vnet/ip/ip.api.h>
#undef vl_msg_name_crc_list