LISP: add dump calls for GPE entries API
Change-Id: Ie7f51643fd3522a0fa8df8d0309305481c211f5f
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
diff --git a/src/vnet/lisp-gpe/lisp_gpe_fwd_entry.c b/src/vnet/lisp-gpe/lisp_gpe_fwd_entry.c
index e05f0e0..7ad8679 100644
--- a/src/vnet/lisp-gpe/lisp_gpe_fwd_entry.c
+++ b/src/vnet/lisp-gpe/lisp_gpe_fwd_entry.c
@@ -1042,6 +1042,32 @@
return (error);
}
+lisp_api_gpe_fwd_entry_t *
+vnet_lisp_gpe_fwd_entries_get_by_vni (u32 vni)
+{
+ lisp_gpe_main_t *lgm = &lisp_gpe_main;
+ lisp_gpe_fwd_entry_t *lfe;
+ lisp_api_gpe_fwd_entry_t *entries = 0, e;
+
+ /* *INDENT-OFF* */
+ pool_foreach (lfe, lgm->lisp_fwd_entry_pool,
+ ({
+ if (lfe->key->vni == vni)
+ {
+ memset (&e, 0, sizeof (e));
+ e.dp_table = lfe->eid_table_id;
+ e.vni = lfe->key->vni;
+ e.fwd_entry_index = lfe - lgm->lisp_fwd_entry_pool;
+ memcpy (&e.reid, &lfe->key->rmt, sizeof (e.reid));
+ memcpy (&e.leid, &lfe->key->lcl, sizeof (e.leid));
+ vec_add1 (entries, e);
+ }
+ }));
+ /* *INDENT-ON* */
+
+ return entries;
+}
+
VLIB_INIT_FUNCTION (lisp_gpe_fwd_entry_init);
/*