aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tvbuff_subset.c
AgeCommit message (Collapse)AuthorFilesLines
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
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>
2018-09-05tvbuff_subset.c: handle a reported_length set to -1 in tvb_new_subset_length()Pascal Quantin1-4/+10
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-04-20Handle subset tvbuffs where the length goes past the end of the parent.Guy Harris1-11/+22
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-10Rename the last argument to tvb_new_subset_length().Guy Harris1-5/+5
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-02-08epan: use SPDX indentifiers.Dario Lombardo1-13/+1
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>
2017-01-10Rename tvb_new_subset() to tvb_new_subset_length_caplen().Guy Harris1-1/+1
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>
2015-06-24Remove deprecated tvb_length callsEvan Huus1-1/+1
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-02-21Remove tvb_ from the names of wsutil mempbrk routines.Guy Harris1-2/+2
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-11Combine SSE and pre-compiled patterns for faster pbrkHadriel Kaplan1-2/+2
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-01-18Remove some apparently-unnecessary includes of emem.h.Guy Harris1-2/+0
Change-Id: Ib7d1b587b439ff21ec6b7f1756ce6ccf25b66f80 Reviewed-on: https://code.wireshark.org/review/6635 Reviewed-by: Guy Harris <guy@alum.mit.edu>
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-22(Trivial)Bill Meier1-1/+15
- Minor whitespace changes; - Fix a typo; - Add editor modelines to tnbuff_subset.c svn path=/trunk/; revision=54364
2013-11-10Add missing includes in order to remove exceptions.h from proto.h (next commit).Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53230
2013-09-13Explicitly include emem.h where it is neededJörg Mayer1-0/+2
svn path=/trunk/; revision=51997
2013-08-04Cleanup tvbJakub Zawadzki1-7/+2
- make tvb_ops->tvb_size a gsize field, not function call - remove not needed forward declaration / forward line svn path=/trunk/; revision=51141
2013-07-15Fix bug #8934: Fuzz failure: seg-fault in tvb_new_proxy()Jakub Zawadzki1-1/+6
It is possible to have NULL reassembly data, support this case in tvb_new_proxy(). svn path=/trunk/; revision=50634
2013-07-14Fix assertion failed: ERROR:print.c:823:const guint8 *get_field_data(GSList ↵Jakub Zawadzki1-1/+5
*, field_info *): code should not be reached svn path=/trunk/; revision=50593
2013-07-14All routines taking an offset and length that want to access the data inGuy Harris1-1/+1
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-14Rewrite reassemble API to use TVBs instead of raw data.Jakub Zawadzki1-2/+4
(it seems to be working for TCP ^^) svn path=/trunk/; revision=50580
2013-07-14Rewrite packet-mime-encap to use composite tvbs + cloningJakub Zawadzki1-1/+12
svn path=/trunk/; revision=50571
2013-07-14Fix tvbtest linking, move private structures to tvbuff_subsetJakub Zawadzki1-0/+17
svn path=/trunk/; revision=50570
2013-07-14Move tvb real and subset implementations to seperate files.Jakub Zawadzki1-0/+200
svn path=/trunk/; revision=50569