diff options
author | Filip Tehlar <ftehlar@cisco.com> | 2017-01-18 12:57:37 +0100 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2017-01-30 10:40:35 +0000 |
commit | 5fae99c184e09342aed888d4d7790b533513209f (patch) | |
tree | f636af17d41b0c0ea307647357cd019cbe7278a9 /src/vnet/lisp-gpe/lisp_gpe_fwd_entry.c | |
parent | 006eb478bb7a14ba7ba4199fecce29ebc495fb9c (diff) |
LISP: add dump calls for GPE entries API
Change-Id: Ie7f51643fd3522a0fa8df8d0309305481c211f5f
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/vnet/lisp-gpe/lisp_gpe_fwd_entry.c')
-rw-r--r-- | src/vnet/lisp-gpe/lisp_gpe_fwd_entry.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/vnet/lisp-gpe/lisp_gpe_fwd_entry.c b/src/vnet/lisp-gpe/lisp_gpe_fwd_entry.c index e05f0e01bee..7ad8679e8c0 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 @@ lisp_gpe_fwd_entry_init (vlib_main_t * vm) 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); /* |