fib: Adjacency creation notifications for dlegates
[vpp.git] / src / vnet / adj / adj_delegate.c
index 15dcb02..68232c5 100644 (file)
@@ -23,9 +23,9 @@
 static adj_delegate_vft_t *ad_vfts;
 
 /**
- * The value of the last dynamically allocated delegeate value
+ * The value of the last dynamically allocated delegate value
  */
-static adj_delegate_type_t ad_max_id = ADJ_DELEGATE_BFD;
+static adj_delegate_type_t ad_max_id = ADJ_DELEGATE_LAST;
 
 static adj_delegate_t *
 adj_delegate_find_i (const ip_adjacency_t *adj,
@@ -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)
 {