aboutsummaryrefslogtreecommitdiffstats
path: root/epan/range.h
AgeCommit message (Collapse)AuthorFilesLines
2017-08-08We really only need one range_foreach routine.Guy Harris1-9/+3
Rename range_foreach_r() to range_foreach(), getting rid of the old range_foreach(). If your callback doesn't require an additional argument, just pass NULL when calling range_foreach(), and declare the argument as unused. Change-Id: I49a56f90610e39cf2ddc398c9e30ed11a6ca90db Reviewed-on: https://code.wireshark.org/review/23025 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-08-07Rename reentrant range_foreach2 to range_foreach_rAhmad Fatoum1-1/+1
to avoid mistaking it for a range function that operates on pairs. Change-Id: If9117c195ba21d55a476c3b9deb2a2ca7a1056ed Reviewed-on: https://code.wireshark.org/review/22994 Reviewed-by: João Valverde <j@v6e.pt> Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-07Fix -Wdocumentation warning about range_foreach2Ahmad Fatoum1-1/+1
Mismatch between parameter name in comment and prototype Change-Id: Ia458362a3cc8cd073dbb0a184f28b28f12b19b9f Reviewed-on: https://code.wireshark.org/review/22993 Reviewed-by: João Valverde <j@v6e.pt>
2017-08-04Optimize the "services" dictionaryJoão Valverde1-0/+8
Remove assignee and other miscellaneous information that changes more frequently than service name and can be consulted directly in the IANA registry. Allow merging identical transports into a single line for convenience and size/speed optimization (a backward-compatible change). Remove obsolete make-services.pl. Change-Id: I3ecbd1a6a68d87c084d77498a0eeb44b7afdab67 Reviewed-on: https://code.wireshark.org/review/22872 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-02Add SUBOBJECT_INITIALIZER and use it.Guy Harris1-0/+1
Just as we have OD_ENTRY_INITIALIZER, add SUBOBJECT_INITIALIZER, and use it rather than memset(). Whether removing initializer warnings is a Good Thing is subject to debate; remove a comment that implies it's been deemed a Good Thing. Change-Id: Ife658d8bb1d4868789ca3b929aff6e4fccecb430 Reviewed-on: https://code.wireshark.org/review/21892 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-07Convert range API to always use wmem memory.Michael Mann1-7/+11
This is mostly to address memory leaks in range preferences (the biggest user of range functionality) on shutdown. Now range preferences must use epan scoped memory when referencing internal preference structures to keep consistency. Change-Id: Idc644f59b5b42fa1d46891542b53ff13ea754157 Reviewed-on: https://code.wireshark.org/review/19387 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-08Combine Decode As and port preferences for tcp.port dissector table.Michael Mann1-1/+1
This patch introduces new APIs to allow dissectors to have a preference for a (TCP) port, but the underlying data is actually part of Decode As functionality. For now the APIs are intentionally separate from the regular APIs that register a dissector within a dissector table. It may be possible to eventually combine the two so that all dissectors that register with a dissector table have an opportunity to "automatically" have a preference to adjust the "table value" through the preferences dialog. The tcp.port dissector table was used as the guinea pig. This will eventually be expanded to other dissector tables as well (most notably UDP ports). Some dissectors that "shared" a TCP/UDP port preference were also converted. It also removed the need for some preference callback functions (mostly when the callback function was the proto_reg_handoff function) so there is cleanup around that. Dissectors that has a port preference whose default was 0 were switched to using the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference Also added comments for TCP ports used that aren't IANA registered. Change-Id: I99604f95d426ad345f4b494598d94178b886eb67 Reviewed-on: https://code.wireshark.org/review/17724 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-09-22Add range_add_value and range_remove_value.Michael Mann1-0/+16
These APIs can insert or remove a single value into a range structure. Adding a value may extend an existing range or create a new one. Removing a value may remove a range item. Change-Id: Ia6995ecf7760aca1fb7fd9b4c53972298a57675f Reviewed-on: https://code.wireshark.org/review/17836 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-03Add the Display Filter Expression dialog.Gerald Combs1-1/+9
Changes from the GTK+ UI: - The display filter is built on the fly with immediate syntax feedback. - Slightly different layout. - You can search for fields. Make the plain SyntaxLineEdit a bit more plain. Bug: 11128 Change-Id: I06a48cd7b9ba7b9dc193b0199540aede4eb62fa7 Reviewed-on: https://code.wireshark.org/review/8742 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-12Remove emem APIs from UAT functionality.Michael Mann1-2/+3
Change-Id: I009c09f25d170e5c9aaaef713eaacb3252817856 Reviewed-on: https://code.wireshark.org/review/6460 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Evan Huus <eapache@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2013-12-20Avoid including <epan/range.h> in dissectors.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=54315
2013-08-10Fix (-W)documentation error found by ClangAlexis La Goutte1-2/+2
../../epan/range.h:87:11: error: empty paragraph passed to '@return' command [-Werror,-Wdocumentation] * @return ~~~~~~~^ ../../epan/range.h:86:11: error: parameter 'max_value'' not found in the function declaration [-Werror,-Wdocumentation] * @param max_value' specifies the maximum value in a range. ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../epan/range.h:86:11: note: did you mean 'max_value'? * @param max_value' specifies the maximum value in a range. ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ max_value svn path=/trunk/; revision=51256
2013-03-01Export libwireshark symbols using WS_DLL_PUBLIC defineBalint Reczey1-8/+9
Also remove old WS_VAR_IMPORT define and related Makefile magic everywhere in the project. svn path=/trunk/; revision=47992
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2010-10-29Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4768 :Jeff Morriss1-6/+9
Return an error if the user specifies a value in a range in excess of the range-specified maximum. Except when reading in preferences files which might have ranges that exceed the maximum (because we didn't use to check): in that case silently lower the out-of-range values. svn path=/trunk/; revision=34698
2010-08-30Doxygen fix.Anders Broman1-1/+1
svn path=/trunk/; revision=34013
2010-08-28Doxygen changes.Anders Broman1-5/+56
svn path=/trunk/; revision=33981
2008-04-12From Andrew Feren (bug 2433):Stig Bjørlykke1-0/+1
Add support for port ranges in services. svn path=/trunk/; revision=24934
2006-05-21name changeRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18197
2004-11-24From Jeff Morriss: SSCOP over UDP and SSCF-NNI support.Guy Harris1-0/+5
svn path=/trunk/; revision=12585
2004-10-17Have "range_convert_range()" dynamically allocate a string large enoughGuy Harris1-5/+1
to hold the representation of the range, rather than imposing a fixed-size limit on the string. Check for overflow in "strtoul()" - and use "strtoul()" rather than "strtol()" for range members. Clean up indentation. Get rid of an unnecessary include in <epan/range.h>. svn path=/trunk/; revision=12323
2004-10-16Remove the fixed maximum number of subranges in a range_t; dynamicallyGuy Harris1-8/+7
allocate them to be large enough. Add checks that the numbers in the range fit in a guint32. Check the validity of a range before saving or printing, and report errors in an alert box. Clean up white space. svn path=/trunk/; revision=12320
2004-10-16Make the nranges member of a range_t be the number of ranges, not theGuy Harris1-1/+10
number of ranges - 1, and update loops that iterate over all the ranges appropriately. Make "range_convert_str()" return a success/failure indication, and check it. Rewrite it to do more checks, and not to blithely ignore unknown characters. svn path=/trunk/; revision=12313
2004-10-14From Jeff Morriss: PREF_RANGE preference type, for ranges of integers.Guy Harris1-0/+8
svn path=/trunk/; revision=12300
2004-09-04Split the pure range stuff out into separate files, exporting their ownGuy Harris1-0/+56
functions. svn path=/trunk/; revision=11892