Commit Graph

22 Commits

Author SHA1 Message Date
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
Pascal Quantin b40beb9edf tvbuff_subset.c: handle a reported_length set to -1 in tvb_new_subset_length()
According to tvbuff.h, tvb_new_subset_length() should behave like
tvb_new_subet_caplen(). Let's do so.

Bug: 15112
Change-Id: I3f05ff45246ac0d05e9bc7bd069ec864da1afae6
Reviewed-on: https://code.wireshark.org/review/29426
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-05 19:54:34 +00:00
Guy Harris 0a130c5756 Handle subset tvbuffs where the length goes past the end of the parent.
Add a "contained length" to tvbuffs.  For non-subset tvbuffs, that's the
same as the reported length.  For a subset tvbuff, that's the amount of
the reported data that was actually present in the "contained data" of
the parent tvbuff.

This is unaffected by the *captured* length of any tvbuff; that differs
from the contained length only if the capture was cut short by a
snapshot length.

If a reference is within the reported data, but not within the contained
data, a ContainedBoundsError exception is thrown.  This exception
represents a protocol error, rather than a reference past the captured
data in the packet; we treat it as such.

Change-Id: Ide87f81238eaeb89b3093f54a87bf7f715485af5
Reviewed-on: https://code.wireshark.org/review/27039
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-20 03:18:47 +00:00
Guy Harris b3c51deb24 Rename the last argument to tvb_new_subset_length().
In tvb_new_subset_length_caplen(), the captured length argument is
backing_length and the reported length argument is reported_length.  The
length argument to tvb_new_subset_length() is a reported length, not a
captured length, so call it reported_length, not backing_length.

Change-Id: Ibfb30e15bdd885d3c0fd66e2b4b07c4a45327f14
Reviewed-on: https://code.wireshark.org/review/26863
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-10 17:53:05 +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 7cd6906056 Rename tvb_new_subset() to tvb_new_subset_length_caplen().
This emphasizes that there is no such thing as *the* routine to
construct a subset tvbuff; you need to choose one of
tvb_new_subset_remaining() (if you want a new tvbuff that contains
everything past a certain point in an existing tvbuff),
tvb_new_subset_length() (if you want a subset that contains everything
past a certain point, for some number of bytes, in an existing tvbuff),
and tvb_new_subset_length_caplen() (for all other cases).

Many of the calls to tvb_new_subset_length_caplen() should really be
calling one of the other routines; that's the next step.  (This also
makes it easier to find the calls that need fixing.)

Change-Id: Ieb3d676d8cda535451c119487d7cd3b559221f2b
Reviewed-on: https://code.wireshark.org/review/19597
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-10 06:19:37 +00:00
Evan Huus 9b5b7c1a90 Remove deprecated tvb_length calls
Trust that the files in epan/ immediately (not dissectors) know what they're
doing so just blindly convert them to captured length.

Change-Id: I872f7d58b2e15ae82c75fd56f4873996fbc97be7
Reviewed-on: https://code.wireshark.org/review/9083
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-24 00:31:25 +00:00
Guy Harris bfb4327291 Remove tvb_ from the names of wsutil mempbrk routines.
Routines that don't take a tvbuff as an argument shouldn't have tvb_ in
the name.

Change-Id: I3550256551e30b3f329cbbfca71ef27c727d29c0
Reviewed-on: https://code.wireshark.org/review/7302
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-21 20:39:25 +00:00
Hadriel Kaplan a837570d02 Combine SSE and pre-compiled patterns for faster pbrk
This combines the SSE4.2 instructions usage, with pre-compiled
pattern searching usage, for a faster pbrk search method.

Testing against large files of HTTP and SIP, there is about
a 5% performance improvement by using pre-"compiled" patterns
for guint8_pbrk() instead of passing it the search string and
having it build the match array every time.
Similar to regular expressions, "compiling" the pattern match array
in advance only once and using the "compiled" patterns for
the searches is faster than compiling it every time.

Change-Id: Ifcbc14a6c93f32d15663a10d974bacdca5119a8e
Ping-Bug: 10798
Reviewed-on: https://code.wireshark.org/review/6990
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-11 09:14:50 +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
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 e348c13deb (Trivial)
- Minor whitespace changes;
- Fix a typo;
- Add editor modelines to tnbuff_subset.c

svn path=/trunk/; revision=54364
2013-12-22 15:47:17 +00:00
Jakub Zawadzki ae59b09443 Add missing includes in order to remove exceptions.h from proto.h (next commit).
svn path=/trunk/; revision=53230
2013-11-10 15:59:37 +00:00
Jörg Mayer 029e258225 Explicitly include emem.h where it is needed
svn path=/trunk/; revision=51997
2013-09-13 08:16:50 +00:00
Jakub Zawadzki b67492bbc0 Cleanup tvb
- make tvb_ops->tvb_size a gsize field, not function call
- remove not needed forward declaration / forward line

svn path=/trunk/; revision=51141
2013-08-04 22:02:42 +00:00
Jakub Zawadzki 49b642ab1c Fix bug #8934: Fuzz failure: seg-fault in tvb_new_proxy()
It is possible to have NULL reassembly data, support this case in tvb_new_proxy().

svn path=/trunk/; revision=50634
2013-07-15 18:59:42 +00:00
Jakub Zawadzki c3c6580d18 Fix assertion failed: ERROR:print.c:823:const guint8 *get_field_data(GSList *, field_info *): code should not be reached
svn path=/trunk/; revision=50593
2013-07-14 23:01:03 +00:00
Guy Harris d296ebc525 All routines taking an offset and length that want to access the data in
the backing tvbuff must add the subset tvbuff's offset to the offset
argument, to skip to the subset.

svn path=/trunk/; revision=50591
2013-07-14 22:38:03 +00:00
Jakub Zawadzki c766e78cfa Rewrite reassemble API to use TVBs instead of raw data.
(it seems to be working for TCP ^^)

svn path=/trunk/; revision=50580
2013-07-14 14:42:05 +00:00
Jakub Zawadzki 2131f22508 Rewrite packet-mime-encap to use composite tvbs + cloning
svn path=/trunk/; revision=50571
2013-07-14 08:41:04 +00:00
Jakub Zawadzki b3e0623e5c Fix tvbtest linking, move private structures to tvbuff_subset
svn path=/trunk/; revision=50570
2013-07-14 07:59:42 +00:00
Jakub Zawadzki 0d85b75305 Move tvb real and subset implementations to seperate files.
svn path=/trunk/; revision=50569
2013-07-14 07:42:19 +00:00