aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wmem
AgeCommit message (Collapse)AuthorFilesLines
2017-10-15autotools: make maintainer-clean should allow rerunning 'configure'João Valverde1-5/+0
Change-Id: Iedae94ffefe27b13b1967d69cacb757b5aa4576d Reviewed-on: https://code.wireshark.org/review/23928 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-10-13CMake: Allow user build flags to override default build flagsJoão Valverde1-2/+0
Autotools has the very useful feature by design of allowing the user to override the default build flags (you break it you keep it). Apparently CMake applies COMPILE_OPTIONS target property after CMAKE_{C,CXX}_FLAGS so that doesn't work here. Prepend our flags to those variables instead to make it work then. Specific target flag overrides can still be added with COMPILER_OPTIONS (e.g: generated files with -Wno-warning) but this is less effective and then we're back at the point where this overrides user flags. It's less of a concern though. Change-Id: I44761a79be4289238e02d4e781fef0099628817b Reviewed-on: https://code.wireshark.org/review/23675 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-09-17CMake: Initial work to install headers for the benefit of pluginsJoão Valverde1-0/+23
To be continued incrementally to fix gaps and omissions. If we are willing to reorganize the source tree to have one or two header include folders this could be simplified considerably. It would also force developers to give more consideration to API issues, which is a good thing. See also e7ef19efc0e928b50644b37772ccbf176e74f766. Bug: 14062 Change-Id: I0759da2f9793cfb5cf92c9e231457bba43df4353 Reviewed-on: https://code.wireshark.org/review/23548 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-09-15autotools: Initial work to install headers for the benefit of pluginsJoão Valverde1-14/+18
Install public headers required to build plugins for libwireshark (taps and dissectors). The source tree is organized to serve the CLI/GUI parts of wireshark. Plugins are built in tree. This change is intende to allow plugins to be built out-of-tree but we want to avoid dumping all headers into /usr/include. To be continued incrementally to fix errors and omissions. Change-Id: Iaa0def0ba3de4b456a29114c315544d2d64fa748 Reviewed-on: https://code.wireshark.org/review/23374 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-09-06plugins: config.h must not be included by public headersJoão Valverde1-0/+1
For a sane plugin build environment. Include config.h as the first header in the .c file instead. Fix by moving required compiler attribute macros to a new "ws_attributes.h" API header. Change-Id: I34f58a927f68c1a0e59686c14d214825149749e1 Reviewed-on: https://code.wireshark.org/review/23400 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-03-05wmem: Ensure callbacks are initialized and not accidentally unregisteredMichael Mann2-7/+4
Start the "callback register ID" at 1, so that zeroed out callback IDs are not found during unregister. Change-Id: I1d7d70f53d89c40e07d1637e1e195dd027855ed3 Reviewed-on: https://code.wireshark.org/review/20385 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
2017-03-05Add wmem_tree_destroyMichael Mann2-0/+44
Allows the cleanup of NULL scoped wmem trees Change-Id: I7c49a224ca7e2f7ddfe0e38d3ea0e79aa2cb057c Reviewed-on: https://code.wireshark.org/review/20382 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com>
2017-03-04Add wmem_tree_count.Michael Mann3-0/+30
There are cases where wmem_tree needs to know its number of nodes. Change-Id: I6411cf4275fd4d85a1d76382e1922d236be3b176 Reviewed-on: https://code.wireshark.org/review/20005 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-10wmem_list: Fix Dead Store (Dead assignement/Dead increment) Warning found by ↵Alexis La Goutte1-1/+0
Clang Change-Id: Ibbbe9fb0165eaa297c2b70bf7e478cf538e2cc33 Reviewed-on: https://code.wireshark.org/review/20040 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-09Add wmem_map_get_keys.Michael Mann2-0/+34
Mimic functionality of g_hash_table_get_keys Change-Id: I7702854ed771a5b3bf7ea5295a67c42f0f477cdf Reviewed-on: https://code.wireshark.org/review/20039 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-09Add wmem_map_stealMichael Mann2-0/+40
Mimic functionality of g_hash_table_steal Change-Id: Iaf4aeef951b60934569143b2d119f782aeefe380 Reviewed-on: https://code.wireshark.org/review/20038 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-09Add wmem_tree_remove32Michael Mann2-0/+19
Change-Id: Ic79fd0a2a13341dd7ba563cf3a056c51e9d16960 Reviewed-on: https://code.wireshark.org/review/20037 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-08wmem_list: add wmem_list_insert_sorted.Dario Lombardo3-0/+115
This mimics the function g_list_insert_sorted. Change-Id: I6f7ac01155588006662c8c0c138d88cea753868c Reviewed-on: https://code.wireshark.org/review/19978 Reviewed-by: Dario Lombardo <lomato@gmail.com>
2017-01-28wmem: Delay creation of map table until its neededMichael Mann1-2/+4
wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), ...) doesn't have "file" scope ready at startup to create hash table and will assert. Change-Id: I3437f45ef42bf8635e4d504cf073fc3fb0c9a8cd Reviewed-on: https://code.wireshark.org/review/19825 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
2017-01-28Add wmem_map_new_autoresetMichael Mann3-4/+122
This can be used similarly to wmem_tree_new_autoreset for hash tables that need reset after capture file change. Change-Id: I3a2f0b0a0cad3eca46266523c594d3d7aac17489 Reviewed-on: https://code.wireshark.org/review/19794 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com>
2017-01-22wmem: fix rb-tree data printer feedJaap Keuter1-2/+2
When using a data printer for the red/black tree it is fed with the nodes of the tree. But nodes can be either subtree or data nodes. Don't feed the subtree nodes to the data printer. The data printer can't recognize it as such, can't handle it, or worse, could break stuff. Change-Id: Ibbc1311d901c0d0c52e710f951dd53620f2c3d0f Reviewed-on: https://code.wireshark.org/review/19652 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-24Add wmem_list_find_custom()João Valverde2-0/+18
Change-Id: I5c4f85df0a1899d629386581de2c2c3ec0812d54 Reviewed-on: https://code.wireshark.org/review/18440 Reviewed-by: João Valverde <j@v6e.pt> Petri-Dish: João Valverde <j@v6e.pt> Reviewed-by: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-09-30cmake: make WERROR_COMMON_FLAGS a normal stringPeter Wu1-7/+5
Instead of checking for the boolean "FALSE", just set an empty string. This avoids the need to check for WERROR_COMMON_FLAGS before using it. The transformation is the same for all files, remove "if (WERROR_COMMON_FLAGS)" and "endif()", reindent and add quotes (since we have a string here and not a list). Modelines have been added where missing. Change-Id: I0ab05ae507c51fa77336d49a99a226399cc81b92 Reviewed-on: https://code.wireshark.org/review/17997 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt> Reviewed-by: Dario Lombardo <lomato@gmail.com> Tested-by: Dario Lombardo <lomato@gmail.com>
2016-08-23CMake: Allow setting per target compiler warningsJoão Valverde1-0/+2
Setting our compiler warning flags in CMAKE_C_FLAGS does not allow using different flags per target. Allow for that possibility by setting the internal WS_WARNINGS_{C,CXX}_FLAGS and using the COMPILE_OPTIONS property to set them. This change is just setting mechanism and there should be no difference in generated warnings. The check_X_compiler_flag cmake test is changed to test each flag individually. We need a list, not a space separated string, and the aggregate test is not significant. Change-Id: I59fc5cd7e130c7a5e001c598e3df3e13f83a6a25 Reviewed-on: https://code.wireshark.org/review/17150 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-08-01Remove checkAPI warnings from wmem.Michael Mann3-9/+11
printf and g_warning are not allowed in epan or its subdirectories Change-Id: I4c07a7258f4c9566384bef93af35c350b5c88758 Reviewed-on: https://code.wireshark.org/review/16801 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-30Use correct relative path.Guy Harris1-1/+1
The build is done in epan/wmem, so libwsutil.la is in ../../wsutil. Change-Id: I053f6b925829e9c5e9ded014fbc716abc527b46a Reviewed-on: https://code.wireshark.org/review/16790 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-30ifdef out a variable used only on Windows.Guy Harris1-1/+3
Also, fix identation - tab stops are set every 8 spaces, not every 4 spaces, in UN*X, which is why the mode lines specify that. Change-Id: If7cfc2cdae26feb2d5c13e31a32ed950354fb15b Reviewed-on: https://code.wireshark.org/review/16789 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-30Add string function times to wmem_test.Gerald Combs3-2/+162
The system, GLib, and wmem string functions can perform differently, particularly on Windows. Start adding performance tests to wmem_test so that we can see the differences. With this change applied "wmem_test --verbose" prints out the following on a Windows 7 x64 VM here. wmem_test is linked against GLib 2.4.20. (MINPERF:g_printf_string_upper_bound (via g_snprintf) 1 string: u 327.602 ms s 0 .000 ms) (MINPERF:g_printf_string_upper_bound (via g_snprintf) 5 strings: u 1419.609 ms s 0.000 ms) (MINPERF:g_printf_string_upper_bound (via g_snprintf) mixed args: u 1606.810 ms s 0.000 ms) (MINPERF:_snprintf_s upper bound 1 string: u 124.801 ms s 0.000 ms) (MINPERF:_snprintf_s upper bound 5 strings: u 140.401 ms s 0.000 ms) (MINPERF:_snprintf_s upper bound mixed args: u 124.801 ms s 0.000 ms) (MINPERF:g_strdup_printf 2 strings: u 702.005 ms s 0.156 ms) (MINPERF:g_strconcat 2 strings: u 78.000 ms s 0.000 ms) (MINPERF:g_strdup_printf 5 strings: u 1419.609 ms s 0.156 ms) (MINPERF:g_strconcat 5 strings: u 93.601 ms s 0.156 ms) (MINPERF:wmem_strdup_printf 2 strings: u 343.202 ms s 0.312 ms) (MINPERF:wmem_strconcat 2 strings: u 93.601 ms s 0.468 ms) (MINPERF:wmem_strdup_printf 5 strings: u 327.602 ms s 8.268 ms) (MINPERF:wmem_strconcat 5 strings: u 62.400 ms s 3.432 ms) Change-Id: Id9b23918829db1719d141e7f830b9eba6245a25b Reviewed-on: https://code.wireshark.org/review/14857 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-16wmem_map.c: Address some VS Code Analysis warnings.Michael Mann1-3/+4
size_t can vary on size, so you can't always mix it with guint. Change-Id: I7e2ea3a990dd4df99422f6113aa3ae53dbf2bc4f Reviewed-on: https://code.wireshark.org/review/16501 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-30Reinstate the wmem test-programs target.Jeff Morriss1-0/+2
It's used when building the test programs (today wmem has only one but it might someday have more). Change-Id: I627513e1297b8348bf034e852eaf212ddbef96ff Reviewed-on: https://code.wireshark.org/review/16221 Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2016-06-30Remove Makefile.common filesJoão Valverde2-88/+44
Now that nmake build system has been removed they are not needed anymore. Change-Id: I88075f955bb4349185859c1af4be22e53de5850f Reviewed-on: https://code.wireshark.org/review/16050 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-06-15Remove Nmake build systemPascal Quantin2-62/+0
Change-Id: I3bd474f3cda9667dec66426b5729449953df3e61 Reviewed-on: https://code.wireshark.org/review/15777 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jörg Mayer <jmayer@loplof.de> Reviewed-by: Balint Reczey <balint@balintreczey.hu>
2016-05-24Document wmem null guaranteeEvan Huus1-0/+4
Change-Id: Ibbbda815b144441f7db2d1920e1551c45e997370 Reviewed-on: https://code.wireshark.org/review/15549 Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-05-13Run checkAPIs in epan/wmem/Michael Mann1-0/+9
Was fixed to pass. Let's keep it that way. Change-Id: I49b532b6f1df2430b3912f8f1e9d518caff17d2c Reviewed-on: https://code.wireshark.org/review/15413 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-13Have wmem conform to checkAPIs.plMichael Mann7-19/+20
Yes, the rename of structure members is a bit hacky. Yes, catering to Windows since "GLib's v*printf routines are surprisingly slow on Windows". But it does pass checkAPIs.pl Change-Id: I5b1552472c83aa2e159f17b5b7eb70b37d03eff9 Reviewed-on: https://code.wireshark.org/review/15404 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-11Remove strcpy from wmem_strbuf.cMichael Mann1-1/+1
This removes all strcpy calls from Wireshark provided code (only ones remaining are in lemon.c) Change-Id: I7a467fc3e10cc94c97196ecea3277a5375bc14b7 Reviewed-on: https://code.wireshark.org/review/15347 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-04-22wmem: add wmem_map_size().Dario Lombardo3-0/+23
Change-Id: I3acca7939466a4436e23bcf828ef94f927ce8b76 Reviewed-on: https://code.wireshark.org/review/15042 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-22wmem: add foreach function to wmem_map.Dario Lombardo3-2/+43
Makes wmem_map more similar to g_hash. Change-Id: Ia17a19ab0be8e07fbb64801d54db2ba8217a7fea Reviewed-on: https://code.wireshark.org/review/15020 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-20wmem: add foreach function to wmem_list.Dario Lombardo3-0/+29
Makes wmem_list more similar to glib lists. Change-Id: Ifadf0627791a72c4118a14f205aa1a7189894d27 Reviewed-on: https://code.wireshark.org/review/15019 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-17More test-programs autotoolizingJoão Valverde1-2/+2
Change-Id: I3e16dc8c591352f19bba190d84a6ed3fe431e21f Reviewed-on: https://code.wireshark.org/review/14926 Reviewed-by: João Valverde <j@v6e.pt>
2016-04-09Wmem: Use the native v*printf routines on Windows.Gerald Combs2-0/+68
GLib's v*printf routines are close to unreasonably slow on Windows. Use the native CRT routines in wmem_strdup_vprintf and wmem_strbuf_append_vprintf on that platform. Change-Id: I5e94aa6fe47434e5a18f3a4d5b6b24ebe71499c1 Reviewed-on: https://code.wireshark.org/review/14868 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-03-26Improves MPTCP analysisMatthieu Coudron1-0/+1
Adds options that control depth of MPTCP analysis, notably: - if mptcp_relative_seq is enabled, can display relative MPTCP sequence numbers - if mapping analysis is allowed, can tell in which packets the DSS mappings covering this data was sent - if intersubflow checks are enabled, it can check for retransmissions over other subflows Change-Id: I82b934513c9f16affb60c066a1fbcca234ffc999 Reviewed-on: https://code.wireshark.org/review/12316 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-01CMake: Add more structure to libwireshark buildJoão Valverde2-2/+87
Smaller epan/CMakeLists.txt is easier to work with and this structure is well suited to CMake. It should make it easier to manage and configure each epan module differently if necessary. Change-Id: Ia649db3b7dcd405aa43dbdba3288699d5e375229 Reviewed-on: https://code.wireshark.org/review/14068 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: João Valverde <j@v6e.pt>
2016-02-22wmem: add null-terminator support.Dario Lombardo3-0/+45
This change makes wmem_array more similar to GArray by adding two functions that mimic the first two params of g_array_new(). Change-Id: Iaec999cd2e44f79f44d766be5d39741b73602e5a Reviewed-on: https://code.wireshark.org/review/13989 Petri-Dish: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com>
2016-02-21autotools: Use pkg-config autoconf macros for GLib/GTKJoão Valverde1-1/+2
Remove mostly obsolete aclocal macros. Make GTK build flags a strict superset of GLib flags. Use GTK build variables for GTK GUI and GLib elsewhere. Add dependency flags explicitly instead of using WS_CPPFLAGS. Some minor improvements and fixes for missing/unnecessary variables (no impact on our test builds). Change-Id: I3e1f067a875f79d6516c1fa7af986f17a7a6b671 Reviewed-on: https://code.wireshark.org/review/14005 Reviewed-by: João Valverde <j@v6e.pt>
2016-01-28autotools: Don't use "user variables" to set build flagsJoão Valverde1-7/+2
GNU coding standards recommend against it and automake is designed around it. This allows overriding the global build flags using AM_CFLAGS, etc., or per object flags, something that is difficult or impossible currently because of automake precedence rules. Change-Id: I3f1ea12e560af5a46b2f04b342b1882bbf123f12 Reviewed-on: https://code.wireshark.org/review/13455 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-01-26api ref (wmem_interval_tree): fix end of file while inside a groupAlexis La Goutte1-0/+3
Change-Id: I68fbe85a8a7e3f0181fc84151fa8f58c459fd46a Reviewed-on: https://code.wireshark.org/review/13542 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-04Adds wmem_list_find functionMatthieu Coudron2-0/+20
Change-Id: I72162210b830a57978e108032d75d8c54f17d16b Reviewed-on: https://code.wireshark.org/review/12387 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: Michael Mann <mmann78@netscape.net>
2015-11-25wmem: add initializer (CID 1340194).Dario Lombardo1-3/+1
Change-Id: I7b3d7a95af213a198b62c1475ba2125f8fe37ee6 Reviewed-on: https://code.wireshark.org/review/12142 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Evan Huus <eapache@gmail.com>
2015-11-25Print guint64's with G_GUINT64_FORMAT.Guy Harris1-1/+1
There is no guarantee that they will be long's, and thus no guarantee that they can be printed with "%lu". Change-Id: I5c2ff844a1024332f01dec58489a2d304ba4e7ce Reviewed-on: https://code.wireshark.org/review/12135 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-25No declarations in the middle of code.Guy Harris1-1/+1
We crank up pedantic warnings enough that this provokes "warning: ISO C90 forbids mixed declarations and code" on the OS X 10.5 buildbot. Change-Id: Ic3962f20d85e3ed003b84b298f83d12c3ae25ea1 Reviewed-on: https://code.wireshark.org/review/12120 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-24Avoid colliding definitions of wmem_tree_t.Guy Harris1-4/+1
Change-Id: I643eae3c35f96591770ab03ce44a85c806f17e1c Reviewed-on: https://code.wireshark.org/review/12119 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-24Introduces augmented interval treesMatthieu Coudron8-61/+591
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>
2015-11-11Change prototype of callbacks passed to wmem_tree_foreach so that theyMatthieu Coudron3-3/+3
accept the node key as a first parameter. wmem_tree accepts all sort of keys (strings, integers, soon ranges), thus it is of interest for various purposes (testing, greedy search) to know the key of the node. Change-Id: Ie748b917bef91f0b1ba8cce15bd1b471922641dc Reviewed-on: https://code.wireshark.org/review/11683 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-08-11wmem: Fix wmem_tree_remove_stringStig Bjørlykke1-3/+1
Always set is_removed when insert data in a node. Change-Id: I8fb50932a369e3f4fe8a1f743462683fff705cc2 Reviewed-on: https://code.wireshark.org/review/9978 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>