aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2018-04-28 01:19:24 -0400
committerFlorin Coras <florin.coras@gmail.com>2018-05-11 22:35:30 +0000
commit7f358b30b04aabe9a35680997cc1eeefb080a869 (patch)
tree25b82c278355adf4a49289b31e3e3ca008bbc743 /src/vpp
parent84c6204969898453aacfa900876e7b7eecd8be0e (diff)
Periodic scan and probe of IP neighbors to maintain neighbor pools
Scan IPv4 and IPv6 neigbor pool entries once a minute to keep them up to date. The neighbor of an entry is probed if its time-stamp is older than 1 minute. If the neighbor respond, its time-stamp will be updated. If there is no response from a neighbor, its entry will be deleted when the time-stamp of the entry become more than 4 minutes old. Static neighbor entries are not probed nor deleted. Implemented CLI and API to enable and disable priodic scan of IPv4, IPv6 or both types of IP neighbors. CLI is "ip scan-neighbor" and API is "ip_scan_neighbor_enable_disable". Other IP neighbor scan parameters can also be changed from their defaults via the CLI/API. Change-Id: Id1a0a934ace15d03db845aa698bcbb9cdabebfcd Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'src/vpp')
-rw-r--r--src/vpp/api/custom_dump.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/vpp/api/custom_dump.c b/src/vpp/api/custom_dump.c
index 26e87d67cbc..ba5515044e0 100644
--- a/src/vpp/api/custom_dump.c
+++ b/src/vpp/api/custom_dump.c
@@ -19,6 +19,7 @@
#include <vnet/vnet.h>
#include <vnet/ip/ip.h>
+#include <vnet/ip/ip_neighbor.h>
#include <vnet/unix/tuntap.h>
#include <vnet/mpls/mpls.h>
#include <vnet/dhcp/dhcp_proxy.h>
@@ -2011,6 +2012,37 @@ static void *vl_api_ip_probe_neighbor_t_print
FINISH;
}
+static void *vl_api_ip_scan_neighbor_enable_disable_t_print
+ (vl_api_ip_scan_neighbor_enable_disable_t * mp, void *handle)
+{
+ u8 *s;
+
+ s = format (0, "SCRIPT: ip_scan_neighbor_enable_disable ");
+
+ switch (mp->mode)
+ {
+ case IP_SCAN_V4_NEIGHBORS:
+ s = format (s, "ip4 ");
+ break;
+ case IP_SCAN_V6_NEIGHBORS:
+ s = format (s, "ip6 ");
+ break;
+ case IP_SCAN_V46_NEIGHBORS:
+ s = format (s, "both ");
+ break;
+ default:
+ s = format (s, "disable ");
+ }
+
+ s = format (s, "interval %d ", mp->scan_interval);
+ s = format (s, "max-time %d ", mp->max_proc_time);
+ s = format (s, "max-update %d ", mp->max_update);
+ s = format (s, "delay %d ", mp->scan_int_delay);
+ s = format (s, "stale %d ", mp->stale_threshold);
+
+ FINISH;
+}
+
static void *vl_api_want_ip4_arp_events_t_print
(vl_api_want_ip4_arp_events_t * mp, void *handle)
{
@@ -3545,6 +3577,7 @@ _(VXLAN_GPE_ADD_DEL_TUNNEL, vxlan_gpe_add_del_tunnel) \
_(VXLAN_GPE_TUNNEL_DUMP, vxlan_gpe_tunnel_dump) \
_(INTERFACE_NAME_RENUMBER, interface_name_renumber) \
_(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_L2_MACS_EVENTS, want_l2_macs_events) \