diff options
author | Neale Ranns <nranns@cisco.com> | 2019-12-06 05:53:17 +0000 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2019-12-16 23:29:21 +0000 |
commit | f50bac1bb25b02d7f086627c4c0a0709ee0f61d5 (patch) | |
tree | 26408a8b3d80f0e2eae7900aa8e49f37ac6de3b8 /src/vnet/adj | |
parent | 77cfc0171da0fa2b305378731a5fefd659d8947d (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/adj')
-rw-r--r-- | src/vnet/adj/adj_nbr.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/vnet/adj/adj_nbr.c b/src/vnet/adj/adj_nbr.c index 2e0888b8c7c..4fb6d9263ae 100644 --- a/src/vnet/adj/adj_nbr.c +++ b/src/vnet/adj/adj_nbr.c @@ -521,12 +521,13 @@ typedef struct adj_db_count_ctx_t_ { u64 count; } adj_db_count_ctx_t; -static void +static int adj_db_count (BVT(clib_bihash_kv) * kvp, void *arg) { adj_db_count_ctx_t * ctx = arg; ctx->count++; + return (BIHASH_WALK_CONTINUE); } u32 @@ -563,14 +564,16 @@ typedef struct adj_walk_ctx_t_ void *awc_ctx; } adj_walk_ctx_t; -static void +static int adj_nbr_walk_cb (BVT(clib_bihash_kv) * kvp, void *arg) { adj_walk_ctx_t *ctx = arg; // FIXME: can't stop early... - ctx->awc_cb(kvp->value, ctx->awc_ctx); + if (ADJ_WALK_RC_STOP == ctx->awc_cb(kvp->value, ctx->awc_ctx)) + return (BIHASH_WALK_STOP); + return (BIHASH_WALK_CONTINUE); } void |