summaryrefslogtreecommitdiff
path: root/epan/reassemble.c
AgeCommit message (Collapse)AuthorFilesLines
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45016
2012-09-07From Robert Bullen via ↵Jeff Morriss1-0/+6
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7683 : The reassembled fragments tree in the Packet Details view is awesome, but it lacks one thing: a field that exposes the reassembled data. tcp.data already exists for exposing a single TCP segment's payload as a byte array. It would be handy to have something similar for a single application layer PDU when TCP segment reassembly is involved. I propose tcp.reassembled.data, named and placed after the already existing field tcp.reassembled.length. My primary use case for this feature is outputting tcp.reassembled.data with tshark for further processing with a script. The attached patch implements this very feature. Because the reassembled fragment tree code is general purpose, i.e. not specific to just TCP, any dissector that relies upon it can add a similar field very cheaply. In that vein I've also implemented ip.reassembled.data and ipv6.reassembled.data, which expose reassembled fragment data as a single byte stream for IPv4 and IPv6, respectively. All other protocols that use the reassembly code have been left alone, other than inserting NULL into their initializer lists for the newly introduced struct field reassemble.h:fragment_items.hf_reassembled_data. svn path=/trunk/; revision=44802
2012-08-12Add 'fragment_table_destroy()' Bill Meier1-2/+26
svn path=/trunk/; revision=44459
2012-08-09Use g_slice allocation for 'reassembled_table' keys (instead of se allocation).Bill Meier1-10/+10
Not strictly required, but IMO a bit cleaner (if maybe a bit less efficient). svn path=/trunk/; revision=44382
2012-08-09From Jakub Zawadzki: Fix for memory leak in reassemble.cBill Meier1-13/+33
Bug #4141 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4141#c10 svn path=/trunk/; revision=44371
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-02-28Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3315 -Jeff Morriss1-3/+5
make Save-As/Displayed/All-Packets save not only the displayed packets but also any other packets needed (e.g., for reassembly) to fully dissect the displayed packets. This works only for the "All packets" case; choosing only the Selected packet, the Marked packets, or a range of packets would require actually storing which packets depend on which (too much memory) or going through the packet list many times (too slow). Also, this behavior is always the case: you can't save the displayed packets without their dependencies (I don't see why this would be desirable). So far this is done for SCTP and things using the reassembly routines (TCP has been tested). The Win32 dialog was modified but hasn't been tested yet. One confusing aspect of the UI is that the Displayed count in the Save-As dialog does not match the number of displayed packets. (I tried renaming the button "Displayed + Dependencies" but it looked too big.) The tooltip tries to explain this and the fact that this works only in the All-Packets case; suggestions for improvement are welcome. Implementation details: Dissectors (or the reassembly code) can list frames which were needed to build the current frame's tree. If the current frame passes the display filter then each listed frame is marked as "depended upon" (this takes up the last free frame_data flag). When performing a Save-As/Displayed/All-Packets then choose packets which passed the dfilter _or_ are depended upon. svn path=/trunk/; revision=41216
2012-01-14Remove obsolete comments referring to mem_chunks.Bill Meier1-7/+4
svn path=/trunk/; revision=40507
2012-01-14Remove obsolete GLIB_CHECK_VERSION(2,10,0) checksJörg Mayer1-39/+0
svn path=/trunk/; revision=40490
2011-09-22(Trivial) Fix a typo in a comment.Bill Meier1-1/+1
svn path=/trunk/; revision=39089
2011-07-19Use ENC_NA for hf_fragments (FT_NONE).Stig Bjørlykke1-4/+2
svn path=/trunk/; revision=38124
2011-07-11More GLIB_CHECK_VERSION cleanups. Update the minimum GLib/GTK+ versionsGerald Combs1-108/+5
in README.devloper. Remove g_gnuc.h since it's no longer needed. Remove tvbuff_init(), tvbuff_cleanup(), reassemble_init(), and reassemble_cleanup() since they were only used for older GLib versions which didn't support GSlices. Assume we always support the "matches" operator. svn path=/trunk/; revision=37978
2011-05-13As suggested by Anders: back out 37112.Jeff Morriss1-40/+4
svn path=/trunk/; revision=37123
2011-05-13We should get rid of g_mem_chunk_alloc() as it leaks memoryAnders Broman1-4/+40
http://www.wireshark.org/lists/wireshark-dev/200910/msg00074.html g_slice allocing the keys should make it possible to walk the fragment table and free the fragments once they are g_slice_alloced. It remains fo figure out how to do that. svn path=/trunk/; revision=37112
2011-03-21From Jakub Zawadzki via wireshark-dev: Fix comment.Chris Maynard1-1/+1
svn path=/trunk/; revision=36223
2011-03-03When reassembling fragments, don't stop looking at fragments just because theJeff Morriss1-40/+39
current fragment pushes us past the reassembled size: it may be that the current fragment is a duplicate/retransmission and will be ignored. Also, if we detect a conflict between a previous and the current fragment, flag the current (conflicting) fragment as FD_OVERLAPCONFLICT. Do *not* flag the fragment that got us into the reassembly routine (probably the final fragment): it is not (may not be) the guilty fragment. Clean up some spacing. Also add reassembly tests for duplicate/retransmitted fragments. svn path=/trunk/; revision=36131
2011-02-18Fix a few errors found by Clang scan-build.Gerald Combs1-0/+3
svn path=/trunk/; revision=36002
2011-01-30Introduce "Fragment count" filter element for all protocols doing reassembly.Stig Bjørlykke1-0/+12
svn path=/trunk/; revision=35705
2010-12-11Rework some comments.Bill Meier1-18/+28
svn path=/trunk/; revision=35176
2010-12-11Fix bug #5477: fuzz-test failure found by using G_SLICE=debug-blocks.Bill Meier1-2/+18
Essentially: doing g_slice_free with the wrong 'type' for the data to be freed. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5477 svn path=/trunk/; revision=35175
2010-12-08Mark parameter as unused.Anders Broman1-1/+1
reassemble.c:220: warning: unused parameter 'key_arg' svn path=/trunk/; revision=35156
2010-12-08reassemble.c: In function 'free_all_fragments':Anders Broman1-1/+1
reassemble.c:222: warning: unused variable 'key' svn path=/trunk/; revision=35155
2010-12-08fragment_free_key to be used only if Glib >= 2.10Anders Broman1-0/+2
svn path=/trunk/; revision=35154
2010-12-08Reassemble.c leaks memory for GLIB > 2.8Anders Broman1-13/+63
Free fragment data and fragment keys in fragment_table when neccessary. reassembled_table remains to be fixed. svn path=/trunk/; revision=35153
2010-10-30Rev 29427 added packet_add_new_data_source() with a comment indicating thatJeff Morriss1-1/+1
the data source does not need to be allocated if (!tree). Rev 30158 took the if (!tree) check out indicating that the check was invalid. So: (since packet_add_new_data_source() now only calls add_new_data_source()), remove packet_add_new_data_source(). svn path=/trunk/; revision=34717
2010-09-30Use the name from hf_fragment instead of hf_fragments when we only haveStig Bjørlykke1-3/+9
one fragment to reassemble. svn path=/trunk/; revision=34285
2010-09-07Put the number of fragments/segments in front of the element to avoid Stig Bjørlykke1-3/+5
conflict when they are named fragments instead of segments and to avoid duplicating the fragments/segments text. svn path=/trunk/; revision=34074
2010-09-07From Yaniv Kaul via bug 4550:Stig Bjørlykke1-6/+12
Show number of segments which were used in the desgementation. svn path=/trunk/; revision=34072
2010-05-24Fix reassemble_test's (copy of the) proto_tree_add_item() prototype to get itJeff Morriss1-23/+32
compiling again. fragment_add_seq_check(), fragment_add_seq_802_11(), and fragment_add_seq_next() all call fragment_add_seq_check_work() so make their prototypes match each other in const-ness. This fixes a warning when compiling reassemble_test. svn path=/trunk/; revision=32933
2010-04-03 From Yaniv Kaul: constify parametersBill Meier1-58/+58
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422 From me: Fix a number of instances where the function prototype or the function definition wasn't changed so there was a mismatch thus causing Windows (but not gcc) compilation errors. svn path=/trunk/; revision=32365
2010-04-02Revert SVN #32360 until Windows compilation errors corrected.Bill Meier1-58/+58
svn path=/trunk/; revision=32361
2010-04-02From Yaniv Kaul: constify parametersBill Meier1-58/+58
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422 svn path=/trunk/; revision=32360
2010-02-02Introduce "Reassembled length" filter element for all protocols doingStig Bjørlykke1-0/+12
reassembly. svn path=/trunk/; revision=31767
2009-10-20Set a mem_chunk to NULL after we destroy it. This should fix the SolarisGerald Combs1-0/+1
buildbot test failures. svn path=/trunk/; revision=30639
2009-10-19Make it actually work with glib < 2.10Jeff Morriss1-0/+6
svn path=/trunk/; revision=30621
2009-10-18Make it build on glib < 2.10.Stig Bjørlykke1-1/+1
svn path=/trunk/; revision=30607
2009-10-18dcerpc_fragment_key_copy(): don't se_alloc() the key:Jeff Morriss1-1/+7
- it contains pointers to a couple malloc()'d addresses - it is inserted in the fragment table (the contents of which are g_free()'d in free_all_fragments()) Instead, do like fragment_key_copy() and use a g_slice or g_chunk, depending on the glib version. svn path=/trunk/; revision=30599
2009-09-06Split a bunch of init routines into init() and cleanup(). This allows us to ↵Kovarththanan Rajaratnam1-6/+16
free memory properly on shutdown. This is an initial step. There's still some work to do. svn path=/trunk/; revision=29754
2009-08-16Switch a bunch of dissectors over to using tvb_new_subset_remaining()Kovarththanan Rajaratnam1-1/+1
svn path=/trunk/; revision=29446
2009-08-16Use the slice allocator if GLIB >= 2,10,0Kovarththanan Rajaratnam1-2/+48
svn path=/trunk/; revision=29440
2009-08-15This patch introduces packet_add_new_data_source() which effectively ↵Kovarththanan Rajaratnam1-1/+1
deprecates add_new_data_source(). This is based on the following observation: 1) The tvb + name (aka. data_source) is only used when the protocol tree is visible The current implementation of add_new_data_source() doesn't take this into account and simply allocates a data_source regardless. This is what packet_add_new_data_source() tries to rectify. A couple of dissectors have already been switched over to the new packet_add_new_data_source(). Many are still missing. Help appreciated! svn path=/trunk/; revision=29427
2009-08-12White space changesKovarththanan Rajaratnam1-192/+192
svn path=/trunk/; revision=29397
2009-07-27reassemble.h: update two comments; reassemble.c: correct a typo.Bill Meier1-1/+1
svn path=/trunk/; revision=29205
2009-07-16Check for an overflow. This should hopefully fix bug 3672.Gerald Combs1-1/+2
svn path=/trunk/; revision=29128
2009-03-13From Jakub Zawadzki (bug 3331):Stig Bjørlykke1-5/+2
g_free() is NULL safe, so we don't need check against it. svn path=/trunk/; revision=27718
2008-05-21Reword comment a bit ...Bill Meier1-3/+3
svn path=/trunk/; revision=25345
2008-05-21Fix for bug #2470; (don't memcmp past end of g_malloc'd buffer).Bill Meier1-13/+22
svn path=/trunk/; revision=25343
2008-05-07Fix a few typos ....Bill Meier1-14/+14
svn path=/trunk/; revision=25253
2007-11-10Apply yet another set of the optimization patches:Anders Broman1-56/+38
Use O(1) logic for the fast path when adding fragments (ie fragments are in order). svn path=/trunk/; revision=23422
2007-08-15Added fragment_start_seq_check to start a reassembly without adding any data.Stig Bjørlykke1-0/+40
svn path=/trunk/; revision=22513