Commit Graph

37 Commits

Author SHA1 Message Date
John Thacker 6fd212926a epan: Constify a few range functions 2022-08-06 08:26:40 -04:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
Change all wireshark.org URLs to use https.

Fix some broken links while we're at it.

Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c
Reviewed-on: https://code.wireshark.org/review/34089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26 18:44:40 +00:00
Dario Lombardo b67b47558d epan: remove redundant casts.
Found by clang-tidy.

Change-Id: Iaf6cf84c33b03ddfcd39a333b49f4987002afa56
Reviewed-on: https://code.wireshark.org/review/31338
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-01-03 23:39:43 +00:00
Guy Harris 5e019c6b8f Use ws_basetostru32(), rather than strtoul(), when parsing ranges.
Make ws_basetostru32(), and the other ws_baseto... routines, public, and
use ws_basetostru32() when parsing ranges, to detect additional errors
such as negative values.

Addresses part of
https://ask.wireshark.org/question/5538/preference-range/.

Change-Id: I00fac97a198a237b01b5cd9406ea32c220f80972
Reviewed-on: https://code.wireshark.org/review/30266
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-19 20:30:53 +00:00
Dario Lombardo 55c68ee69c epan: use SPDX indentifiers.
Skipping dissectors dir for now.

Change-Id: I717b66bfbc7cc81b83f8c2cbc011fcad643796aa
Reviewed-on: https://code.wireshark.org/review/25694
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08 19:29:45 +00:00
Guy Harris 01f2e2b201 We really only need one range_foreach routine.
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-08 22:06:27 +00:00
Ahmad Fatoum e63db3ce0e Rename reentrant range_foreach2 to range_foreach_r
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-07 22:53:07 +00:00
João Valverde 733c19a072 Optimize the "services" dictionary
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-08-04 05:55:08 +00:00
Michael Mann 6a6d7ea34f Convert range API to always use wmem memory.
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>
2017-01-07 00:44:10 +00:00
Michael Mann d29b369bdc Add range_add_value and range_remove_value.
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>
2016-09-22 13:49:42 +00:00
Adam Goldman baea677290 Allow hex and octal values to be used in ranges
Change-Id: I896b945067c4325a29c41c23ad39486e356d9434
Reviewed-on: https://code.wireshark.org/review/13474
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-01-24 01:36:31 +00:00
Gerald Combs ec3f923e3e Add the Display Filter Expression dialog.
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-06-03 02:27:00 +00:00
Guy Harris 44e7ce54ff Remove some apparently-unnecessary includes of emem.h.
Change-Id: Ib7d1b587b439ff21ec6b7f1756ce6ccf25b66f80
Reviewed-on: https://code.wireshark.org/review/6635
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18 20:19:05 +00:00
Michael Mann 7967ef9510 Remove emem APIs from UAT functionality.
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>
2015-01-12 14:25:12 +00:00
Guy Harris 033f096ee9 Don't use ctype.h routines.
That avoids locale dependency and handles possibly-signed chars (which
we weren't always doing before).

Change-Id: Ieceb93029252f646397b6488f2df8a57c6d2a23d
Reviewed-on: https://code.wireshark.org/review/4794
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 23:11:18 +00:00
Bill Meier 23e78cd6bd Add editor modelines; Adjust whitespace as needed.
Change-Id: I3dc57f4c2ca57585103e3b71503ac4c332903e50
Reviewed-on: https://code.wireshark.org/review/4594
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-10 14:50:08 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(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>
2014-03-04 14:27:33 +00:00
Bill Meier 11b5c15fdb Remove trailing whitespace
Change-Id: I8116f63ff88687c8db3fd6e8e23b22ab2f759af0
Reviewed-on: https://code.wireshark.org/review/385
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-25 20:46:49 +00:00
Jakub Zawadzki 8b73d378a4 exceptions.h not needed by tvbuff.h (no much progress because it's needed by proto.h)
svn path=/trunk/; revision=53219
2013-11-10 11:48:03 +00:00
Bill Meier 0df5a9390d From beroset:
remove C++ incompatibilities
 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10397

svn path=/trunk/; revision=48438
2013-03-20 01:18:10 +00:00
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings.

When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.

Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers.  Cast
away those warnings in some cases where an API we don't control forces
us to do so.

Enable a bunch of additional warnings by default.  Note why at least
some of the other warnings aren't enabled.

randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.

If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.

svn path=/trunk/; revision=46748
2012-12-26 05:57:06 +00:00
Jeff Morriss 3729335973 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45016
2012-09-20 01:48:30 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Stig Bjørlykke 08c7a1d0f1 From Tony Trinh via bug 5895:
Add sanity checks in range.c

svn path=/trunk/; revision=37784
2011-06-25 15:21:17 +00:00
Jeff Morriss 6eba069093 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4768 :
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-10-29 22:09:31 +00:00
Bill Meier f06f9125bc range.c: ep_strbuf_new("") ==> ep_strbuf_new(NULL);
svn path=/trunk/; revision=28145
2009-04-24 12:18:31 +00:00
Gerald Combs f0eeb0bdf1 More size_t fixes. Use a string buffer in range.c.
svn path=/trunk/; revision=27999
2009-04-08 16:50:20 +00:00
Gerald Combs 5ff80e9b5f Use the correct data type for the range string in the Win32 file dialog.
Have value_is_in_range() to gracefully handle a NULL range. This might
fix bug 3208.

svn path=/trunk/; revision=27281
2009-01-20 23:33:38 +00:00
Guy Harris caa183b45b We require GLib 2.4 or later, and they define G_MININT32, G_MAXIN32,
G_MAXUINT32, and G_MAXUINT64; don't check whether we need to define them
ourselves.

svn path=/trunk/; revision=25420
2008-06-03 23:57:47 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Ronnie Sahlberg b177f170eb convert to g_snprintf()
also make range_convert_range() return an emem allocated string


svn path=/trunk/; revision=15660
2005-09-01 19:05:00 +00:00
Guy Harris a053ee960e Have "range_convert_range()" dynamically allocate a string large enough
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-17 01:31:36 +00:00
Guy Harris 727ad67453 Remove the fixed maximum number of subranges in a range_t; dynamically
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-16 23:32:24 +00:00
Guy Harris b2543fed6c Make the nranges member of a range_t be the number of ranges, not the
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-16 08:33:40 +00:00
Guy Harris abd16b297f From Jeff Morriss: PREF_RANGE preference type, for ranges of integers.
svn path=/trunk/; revision=12300
2004-10-14 23:45:09 +00:00
Guy Harris 6507d0de6a We don't need "globals.h"; don't include it.
svn path=/trunk/; revision=11896
2004-09-04 19:56:25 +00:00
Guy Harris 3c7631aa32 Split the pure range stuff out into separate files, exporting their own
functions.

svn path=/trunk/; revision=11892
2004-09-04 01:32:13 +00:00