summaryrefslogtreecommitdiffstats
path: root/src/vnet/l2/l2_fib.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-12-06 05:53:17 +0000
committerDave Barach <openvpp@barachs.net>2019-12-16 23:29:21 +0000
commitf50bac1bb25b02d7f086627c4c0a0709ee0f61d5 (patch)
tree26408a8b3d80f0e2eae7900aa8e49f37ac6de3b8 /src/vnet/l2/l2_fib.c
parent77cfc0171da0fa2b305378731a5fefd659d8947d (diff)
vppinfra: bihash walk cb typedef and continue/stop controls
Type: feature Change-Id: I28f7a658be3f3beec9ea32635b60d1d3a10d9b06 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/l2/l2_fib.c')
-rw-r--r--src/vnet/l2/l2_fib.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/vnet/l2/l2_fib.c b/src/vnet/l2/l2_fib.c
index 600d0c910fc..3e71f771dfe 100644
--- a/src/vnet/l2/l2_fib.c
+++ b/src/vnet/l2/l2_fib.c
@@ -111,7 +111,7 @@ typedef struct l2fib_dump_walk_ctx_t_
l2fib_entry_result_t *l2fe_res;
} l2fib_dump_walk_ctx_t;
-static void
+static int
l2fib_dump_walk_cb (BVT (clib_bihash_kv) * kvp, void *arg)
{
l2fib_dump_walk_ctx_t *ctx = arg;
@@ -126,6 +126,8 @@ l2fib_dump_walk_cb (BVT (clib_bihash_kv) * kvp, void *arg)
vec_add1 (ctx->l2fe_key, key);
vec_add1 (ctx->l2fe_res, result);
}
+
+ return (BIHASH_WALK_CONTINUE);
}
void
@@ -158,7 +160,7 @@ typedef struct l2fib_show_walk_ctx_t_
u8 now;
} l2fib_show_walk_ctx_t;
-static void
+static int
l2fib_show_walk_cb (BVT (clib_bihash_kv) * kvp, void *arg)
{
l2fib_show_walk_ctx_t *ctx = arg;
@@ -186,10 +188,10 @@ l2fib_show_walk_cb (BVT (clib_bihash_kv) * kvp, void *arg)
u8 *s = NULL;
if (ctx->learn && l2fib_entry_result_is_set_AGE_NOT (&result))
- return; /* skip provisioned macs */
+ return (BIHASH_WALK_CONTINUE); /* skip provisioned macs */
if (ctx->add && !l2fib_entry_result_is_set_AGE_NOT (&result))
- return; /* skip learned macs */
+ return (BIHASH_WALK_CONTINUE); /* skip learned macs */
bd_config = vec_elt_at_index (l2input_main.bd_configs,
key.fields.bd_index);
@@ -219,6 +221,8 @@ l2fib_show_walk_cb (BVT (clib_bihash_kv) * kvp, void *arg)
ctx->vnm, result.fields.sw_if_index);
vec_free (s);
}
+
+ return (BIHASH_WALK_CONTINUE);
}
/** Display the contents of the l2fib. */