aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-01-25 00:51:09 -0800
committerOle Trøan <otroan@employees.org>2019-01-25 14:32:53 +0000
commit5c1f559b1bf32acd528664e7674a2d46f2aed947 (patch)
tree8751643a2632cbb2c7015905fa04298935f6b2f6 /src/vnet/ip
parenta2e29e7705d3b2d5f2fa8c48b083f50f6faa3f3e (diff)
IP6 FIB: walk table for dump (VPP-1553)
Change-Id: Iaa57ace6df96bfacd1235c80ec7bb08e5f335530 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ip')
-rw-r--r--src/vnet/ip/ip_api.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/vnet/ip/ip_api.c b/src/vnet/ip/ip_api.c
index 25d0b8be09e..b9fa001553f 100644
--- a/src/vnet/ip/ip_api.c
+++ b/src/vnet/ip/ip_api.c
@@ -331,19 +331,17 @@ send_ip6_fib_details (vpe_api_main_t * am,
typedef struct apt_ip6_fib_show_ctx_t_
{
- u32 fib_index;
fib_node_index_t *entries;
} api_ip6_fib_show_ctx_t;
-static void
-api_ip6_fib_table_put_entries (clib_bihash_kv_24_8_t * kvp, void *arg)
+static fib_table_walk_rc_t
+api_ip6_fib_table_put_entries (fib_node_index_t fei, void *arg)
{
api_ip6_fib_show_ctx_t *ctx = arg;
- if ((kvp->key[2] >> 32) == ctx->fib_index)
- {
- vec_add1 (ctx->entries, kvp->value);
- }
+ vec_add1 (ctx->entries, fei);
+
+ return (FIB_TABLE_WALK_CONTINUE);
}
static void
@@ -352,18 +350,15 @@ api_ip6_fib_table_get_all (vl_api_registration_t * reg,
fib_table_t * fib_table)
{
vpe_api_main_t *am = &vpe_api_main;
- ip6_main_t *im6 = &ip6_main;
fib_node_index_t *fib_entry_index;
api_ip6_fib_show_ctx_t ctx = {
- .fib_index = fib_table->ft_index,
.entries = NULL,
};
fib_route_path_encode_t *api_rpaths;
const fib_prefix_t *pfx;
- BV (clib_bihash_foreach_key_value_pair)
- ((BVT (clib_bihash) *) & im6->ip6_table[IP6_FIB_TABLE_NON_FWDING].
- ip6_hash, api_ip6_fib_table_put_entries, &ctx);
+ ip6_fib_table_walk (fib_table->ft_index,
+ api_ip6_fib_table_put_entries, &ctx);
vec_sort_with_function (ctx.entries, fib_entry_cmp_for_sort);