diff options
author | Neale Ranns <nranns@cisco.com> | 2017-01-26 01:18:23 -0800 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2017-02-20 09:54:49 +0000 |
commit | 5a8123bda0261158457e38bfb4922aa5961389ff (patch) | |
tree | df221814e21d30ea5d63620504c73e64371a5780 /src/vnet/mfib/ip4_mfib.c | |
parent | 90c55724b583434957cf83555a084770f2efdd7a (diff) |
Python test IP and MPLS objects conform to infra.
Add IP[46] MFIB dump.
Change-Id: I4a2821f65e67a5416b291e4912c84f64989883b8
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/mfib/ip4_mfib.c')
-rw-r--r-- | src/vnet/mfib/ip4_mfib.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/vnet/mfib/ip4_mfib.c b/src/vnet/mfib/ip4_mfib.c index 3e7bdd81bbf..164cafa118b 100644 --- a/src/vnet/mfib/ip4_mfib.c +++ b/src/vnet/mfib/ip4_mfib.c @@ -279,6 +279,29 @@ ip4_mfib_table_entry_remove (ip4_mfib_t *mfib, mfib->fib_entry_by_dst_address[len] = hash; } +void +ip4_mfib_table_walk (ip4_mfib_t *mfib, + mfib_table_walk_fn_t fn, + void *ctx) +{ + int i; + + for (i = 0; i < ARRAY_LEN (mfib->fib_entry_by_dst_address); i++) + { + uword * hash = mfib->fib_entry_by_dst_address[i]; + + if (NULL != hash) + { + hash_pair_t * p; + + hash_foreach_pair (p, hash, + ({ + fn(p->value[0], ctx); + })); + } + } +} + static void ip4_mfib_table_show_all (ip4_mfib_t *mfib, vlib_main_t * vm) |