diff options
author | Matthieu Coudron <mattator@gmail.com> | 2015-11-11 03:19:43 +0100 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-11-24 23:02:09 +0000 |
commit | bd08ab920dd9e24c37c04dc049ce234285a337fb (patch) | |
tree | 9a17e1f2716dd576be77d72f4dae66de2cc13fc2 /epan/wmem/wmem_tree.h | |
parent | 9601a4f724492b3f9960e1f051360b071997d7d6 (diff) |
Introduces augmented interval trees
Interval trees (wmem_itree_t) are implemented as an extension of wmem_tree with a
guint64-based range as the key.
This is useful for instance in MPTCP analysis, to look for packets
matching a range defined by a mapping across TCP subflows.
Change-Id: Iea706d44fe975e390a4191ad0257ef37d5c71525
Reviewed-on: https://code.wireshark.org/review/11714
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/wmem/wmem_tree.h')
-rw-r--r-- | epan/wmem/wmem_tree.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/epan/wmem/wmem_tree.h b/epan/wmem/wmem_tree.h index 33058c0174..a31de3c1e9 100644 --- a/epan/wmem/wmem_tree.h +++ b/epan/wmem/wmem_tree.h @@ -206,6 +206,11 @@ wmem_tree_lookup32_array_le(wmem_tree_t *tree, wmem_tree_key_t *key); */ typedef gboolean (*wmem_foreach_func)(const void *key, void *value, void *userdata); + +/** Function type to print key/data of nodes in wmem_print_tree_verbose */ +typedef void (*wmem_printer_func)(const void *data); + + /** Traverse the tree and call callback(value, userdata) for each value found. * Returns TRUE if the traversal was ended prematurely by the callback. */ @@ -214,9 +219,10 @@ gboolean wmem_tree_foreach(wmem_tree_t* tree, wmem_foreach_func callback, void *user_data); -/** Prints the structure of the tree to stdout. Primarily for debugging. */ + +/* Accepts callbacks to print the key and/or data (both printers can be null) */ void -wmem_print_tree(wmem_tree_t *tree); +wmem_print_tree(wmem_tree_t *tree, wmem_printer_func key_printer, wmem_printer_func data_printer); /** @} * @} */ |