forked from osmocom/wireshark
b5917d0182
A number of protocols have IDs that can be reused that are used as lookup keys. In most cases the frame number should be used as well to differentiate repeat appearances of an ID. For response/request matching, it is frequently useful to find the most recent frame number (greatest value less than or equal to the current one) that contained an ID. We can achieve that by using a multimap that stores values with a given ID in a tree keyed with the frame number. This works better than using a map or a tree alone: 1) A map isn't ordered, so doesn't allow for less than or equal comparison. 2) Using a tree requires an ordering on all the ID components, and then having to test all the components other than the frame number separately for equality after retrieval. Currently the multimap does not support inserting items without specifying the tree key (and having the multimap generate a key), because the total capacity of trees (including deleted nodes) is not tracked. If other use cases are needed, this could be added later along with more generic multimap support. Use a multimap in ANSI MAP, ANSI TCAP, and GSM SMS, all of which need to match lookup IDs that can be reused. Fix #7653. |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
wmem-int.h | ||
wmem.h | ||
wmem_allocator.h | ||
wmem_allocator_block.c | ||
wmem_allocator_block.h | ||
wmem_allocator_block_fast.c | ||
wmem_allocator_block_fast.h | ||
wmem_allocator_simple.c | ||
wmem_allocator_simple.h | ||
wmem_allocator_strict.c | ||
wmem_allocator_strict.h | ||
wmem_array.c | ||
wmem_array.h | ||
wmem_core.c | ||
wmem_core.h | ||
wmem_interval_tree.c | ||
wmem_interval_tree.h | ||
wmem_list.c | ||
wmem_list.h | ||
wmem_map.c | ||
wmem_map.h | ||
wmem_map_int.h | ||
wmem_miscutl.c | ||
wmem_miscutl.h | ||
wmem_multimap.c | ||
wmem_multimap.h | ||
wmem_queue.h | ||
wmem_stack.c | ||
wmem_stack.h | ||
wmem_strbuf.c | ||
wmem_strbuf.h | ||
wmem_strutl.c | ||
wmem_strutl.h | ||
wmem_test.c | ||
wmem_tree-int.h | ||
wmem_tree.c | ||
wmem_tree.h | ||
wmem_user_cb.c | ||
wmem_user_cb.h | ||
wmem_user_cb_int.h |