aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/bihash_doc.h
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/vppinfra/bihash_doc.h
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/vppinfra/bihash_doc.h')
-rw-r--r--src/vppinfra/bihash_doc.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/vppinfra/bihash_doc.h b/src/vppinfra/bihash_doc.h
index a7e70e9695c..da8c832f160 100644
--- a/src/vppinfra/bihash_doc.h
+++ b/src/vppinfra/bihash_doc.h
@@ -165,17 +165,25 @@ void clib_bihash_prefetch_data (clib_bihash * h, u64 hash);
int clib_bihash_search_inline_2
(clib_bihash * h, clib_bihash_kv * search_key, clib_bihash_kv * valuep);
+/* Calback function for walking a bihash table
+ *
+ * @param kv - KV pair visited
+ * @param ctx - Context passed to the walk
+ * @return BIHASH_WALK_CONTINUE to continue BIHASH_WALK_STOP to stop
+ */
+typedef int (*clib_bihash_foreach_key_value_pair_cb) (clib_bihash_kv * kv,
+ void *ctx);
+
/** Visit active (key,value) pairs in a bi-hash table
@param h - the bi-hash table to search
@param callback - function to call with each active (key,value) pair
@param arg - arbitrary second argument passed to the callback function
First argument is the (key,value) pair to visit
- @note Trying to supply a proper function prototype for the
- callback function appears to be a fool's errand.
*/
void clib_bihash_foreach_key_value_pair (clib_bihash * h,
- void *callback, void *arg);
+ clib_bihash_foreach_key_value_pair_cb
+ * callback, void *arg);
/*
* fd.io coding-style-patch-verification: ON