wireshark/wsutil/wmem
John Thacker b5917d0182 wmem: Add a multimap
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.
2021-11-21 07:16:55 -05:00
..
CMakeLists.txt wmem: Add a multimap 2021-11-21 07:16:55 -05:00
wmem-int.h
wmem.h wmem: Add a multimap 2021-11-21 07:16:55 -05:00
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: don't check whether sizeof(type) is <= 0. 2021-08-24 20:58:00 -07:00
wmem_interval_tree.c
wmem_interval_tree.h
wmem_list.c
wmem_list.h
wmem_map.c
wmem_map.h Update a bunch of GLib documentation links. 2021-11-20 21:33:17 +00:00
wmem_map_int.h
wmem_miscutl.c QUIC: fix compilation on Raspberry 2021-10-19 20:04:17 +00:00
wmem_miscutl.h QUIC: fix compilation on Raspberry 2021-10-19 20:04:17 +00:00
wmem_multimap.c wmem: Add a multimap 2021-11-21 07:16:55 -05:00
wmem_multimap.h wmem: Add a multimap 2021-11-21 07:16:55 -05:00
wmem_queue.h
wmem_stack.c
wmem_stack.h
wmem_strbuf.c
wmem_strbuf.h
wmem_strutl.c
wmem_strutl.h
wmem_test.c QUIC: fix compilation on Raspberry 2021-10-19 20:04:17 +00:00
wmem_tree-int.h
wmem_tree.c
wmem_tree.h
wmem_user_cb.c
wmem_user_cb.h
wmem_user_cb_int.h