Rework CP and DP communication in IPv6 RD (VPP-1256)
Replace binary API communication between CP and DP with
direct communication using function calls and callbacks.
Change-Id: Ib54f09062217c028e5ee0e96ae2449cf7e9224e3
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
diff --git a/src/vnet/ip/ip6_neighbor.c b/src/vnet/ip/ip6_neighbor.c
index 6b63e6f..5e98475 100644
--- a/src/vnet/ip/ip6_neighbor.c
+++ b/src/vnet/ip/ip6_neighbor.c
@@ -230,6 +230,7 @@
} ip6_icmp_neighbor_discovery_event_data_t;
static ip6_neighbor_main_t ip6_neighbor_main;
+ip6_neighbor_public_main_t ip6_neighbor_public_main;
static ip6_address_t ip6a_zero; /* ip6 address 0 */
static void wc_nd_signal_report (wc_nd_report_t * r);
@@ -1417,6 +1418,23 @@
return;
}
+clib_error_t *
+call_ip6_neighbor_callbacks (void *data,
+ _vnet_ip6_neighbor_function_list_elt_t * elt)
+{
+ clib_error_t *error = 0;
+
+ while (elt)
+ {
+ error = elt->fp (data);
+ if (error)
+ return error;
+ elt = elt->next_ip6_neighbor_function;
+ }
+
+ return error;
+}
+
/* ipv6 neighbor discovery - router advertisements */
typedef enum
{
@@ -2434,9 +2452,9 @@
rai = nm->if_radv_pool_index_by_sw_if_index[sw_if_index];
ra = pool_elt_at_index (nm->if_radv_pool, rai);
- if (stop)
- stop_sending_rs (vm, ra);
- else
+ stop_sending_rs (vm, ra);
+
+ if (!stop)
{
ra->keep_sending_rs = 1;
ra->params = *params;