aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/adj
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/adj')
-rw-r--r--src/vnet/adj/adj_delegate.c14
-rw-r--r--src/vnet/adj/adj_delegate.h6
-rw-r--r--src/vnet/adj/adj_glean.c2
-rw-r--r--src/vnet/adj/adj_internal.h1
-rw-r--r--src/vnet/adj/adj_mcast.c2
-rw-r--r--src/vnet/adj/adj_nbr.c5
6 files changed, 29 insertions, 1 deletions
diff --git a/src/vnet/adj/adj_delegate.c b/src/vnet/adj/adj_delegate.c
index 17d6f0d6a09..68232c5810a 100644
--- a/src/vnet/adj/adj_delegate.c
+++ b/src/vnet/adj/adj_delegate.c
@@ -140,6 +140,20 @@ adj_delegate_adj_deleted (ip_adjacency_t *adj)
vec_reset_length(adj->ia_delegates);
}
+void
+adj_delegate_adj_created (ip_adjacency_t *adj)
+{
+ adj_delegate_vft_t *vft;
+
+ vec_foreach(vft, ad_vfts)
+ {
+ if (vft->adv_adj_created)
+ {
+ vft->adv_adj_created(adj_get_index(adj));
+ }
+ }
+}
+
u8*
adj_delegate_format (u8* s, ip_adjacency_t *adj)
{
diff --git a/src/vnet/adj/adj_delegate.h b/src/vnet/adj/adj_delegate.h
index f6da245bb52..096c1823e27 100644
--- a/src/vnet/adj/adj_delegate.h
+++ b/src/vnet/adj/adj_delegate.h
@@ -78,11 +78,17 @@ typedef void (*adj_delegate_adj_deleted_t)(adj_delegate_t *aed);
typedef u8 * (*adj_delegate_format_t)(const adj_delegate_t *aed, u8 *s);
/**
+ * Notification that an adjacency has been created
+ */
+typedef u8 * (*adj_delegate_adj_created_t)(adj_index_t ai);
+
+/**
* An ADJ delegate virtual function table
*/
typedef struct adj_delegate_vft_t_ {
adj_delegate_format_t adv_format;
adj_delegate_adj_deleted_t adv_adj_deleted;
+ adj_delegate_adj_created_t adv_adj_created;
} adj_delegate_vft_t;
/**
diff --git a/src/vnet/adj/adj_glean.c b/src/vnet/adj/adj_glean.c
index 92369116532..a8a422d30ba 100644
--- a/src/vnet/adj/adj_glean.c
+++ b/src/vnet/adj/adj_glean.c
@@ -91,6 +91,8 @@ adj_glean_add_or_lock (fib_protocol_t proto,
adj_lock(adj_get_index(adj));
}
+ adj_delegate_adj_created(adj);
+
return (adj_get_index(adj));
}
diff --git a/src/vnet/adj/adj_internal.h b/src/vnet/adj/adj_internal.h
index efaa11d5346..2053c69342a 100644
--- a/src/vnet/adj/adj_internal.h
+++ b/src/vnet/adj/adj_internal.h
@@ -136,6 +136,7 @@ extern int adj_bfd_is_up (adj_index_t ai);
* Adj delegates
*/
extern void adj_delegate_adj_deleted(ip_adjacency_t *adj);
+extern void adj_delegate_adj_created(ip_adjacency_t *adj);
extern u8* adj_delegate_format(u8* s, ip_adjacency_t *adj);
#endif
diff --git a/src/vnet/adj/adj_mcast.c b/src/vnet/adj/adj_mcast.c
index c94d28e8713..4d7172cdb58 100644
--- a/src/vnet/adj/adj_mcast.c
+++ b/src/vnet/adj/adj_mcast.c
@@ -88,6 +88,8 @@ adj_mcast_add_or_lock (fib_protocol_t proto,
adj_lock(adj_get_index(adj));
}
+ adj_delegate_adj_created(adj);
+
return (adj_get_index(adj));
}
diff --git a/src/vnet/adj/adj_nbr.c b/src/vnet/adj/adj_nbr.c
index 7f053c82d59..2e0888b8c7c 100644
--- a/src/vnet/adj/adj_nbr.c
+++ b/src/vnet/adj/adj_nbr.c
@@ -221,12 +221,12 @@ adj_nbr_add_or_lock (fib_protocol_t nh_proto,
u32 sw_if_index)
{
adj_index_t adj_index;
- ip_adjacency_t *adj;
adj_index = adj_nbr_find(nh_proto, link_type, nh_addr, sw_if_index);
if (ADJ_INDEX_INVALID == adj_index)
{
+ ip_adjacency_t *adj;
vnet_main_t *vnm;
vnm = vnet_get_main();
@@ -256,6 +256,7 @@ adj_nbr_add_or_lock (fib_protocol_t nh_proto,
adj_lock(adj_index);
}
+ adj_delegate_adj_created(adj_get(adj_index));
return (adj_index);
}
@@ -284,6 +285,8 @@ adj_nbr_add_or_lock_w_rewrite (fib_protocol_t nh_proto,
ADJ_NBR_REWRITE_FLAG_COMPLETE,
rewrite);
+ adj_delegate_adj_created(adj_get(adj_index));
+
return (adj_index);
}