Commit Graph

140 Commits

Author SHA1 Message Date
Kovarththanan Rajaratnam 0e5cef61be Split a bunch of init routines into init() and cleanup(). This allows us to free memory properly on shutdown.
This is an initial step. There's still some work to do.

svn path=/trunk/; revision=29754
2009-09-06 18:25:23 +00:00
Kovarththanan Rajaratnam 8b515e9340 Switch a bunch of dissectors over to using tvb_new_subset_remaining()
svn path=/trunk/; revision=29446
2009-08-16 12:36:22 +00:00
Kovarththanan Rajaratnam 7cb17ecec0 Use the slice allocator if GLIB >= 2,10,0
svn path=/trunk/; revision=29440
2009-08-16 04:54:33 +00:00
Kovarththanan Rajaratnam 7d44262406 This patch introduces packet_add_new_data_source() which effectively 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-15 06:38:10 +00:00
Kovarththanan Rajaratnam 8fd6301ddc White space changes
svn path=/trunk/; revision=29397
2009-08-12 19:32:54 +00:00
Bill Meier 5aef94e6eb reassemble.h: update two comments; reassemble.c: correct a typo.
svn path=/trunk/; revision=29205
2009-07-27 13:59:53 +00:00
Gerald Combs 75e048491a Check for an overflow. This should hopefully fix bug 3672.
svn path=/trunk/; revision=29128
2009-07-16 22:25:06 +00:00
Stig Bjørlykke 62f60df6b4 From Jakub Zawadzki (bug 3331):
g_free() is NULL safe, so we don't need check against it.

svn path=/trunk/; revision=27718
2009-03-13 22:06:48 +00:00
Bill Meier fd245e378f Reword comment a bit ...
svn path=/trunk/; revision=25345
2008-05-21 18:08:43 +00:00
Bill Meier bf018e2a96 Fix for bug #2470; (don't memcmp past end of g_malloc'd buffer).
svn path=/trunk/; revision=25343
2008-05-21 16:53:07 +00:00
Bill Meier 6ae1343094 Fix a few typos ....
svn path=/trunk/; revision=25253
2008-05-07 17:57:45 +00:00
Anders Broman 03c7a3c920 Apply yet another set of the optimization patches:
Use O(1) logic for the fast path when adding fragments (ie fragments are in order).

svn path=/trunk/; revision=23422
2007-11-10 16:08:14 +00:00
Stig Bjørlykke c6ba6d714d Added fragment_start_seq_check to start a reassembly without adding any data.
svn path=/trunk/; revision=22513
2007-08-15 22:24:05 +00:00
Graeme Lunt 2033b06cda Added a new function, fragment_end_seq_next(), to end the
fragmented data without adding an empty data fragment. 
This is used by the RTSE dissector which can't identify the 
last fragment until after it has been added.


svn path=/trunk/; revision=22174
2007-06-24 05:14:39 +00:00
Stephen Fisher 46b8669566 Fix a bunch more warnings. Add -Werror when using --with-warnings-as-errors
under gcc to tools/lemon, plugins/mate and epan/


svn path=/trunk/; revision=21204
2007-03-26 06:10:52 +00:00
Anders Broman e2cab6caa9 From Richard van der Hoff:
01_reassemble_test.patch
------------------------
I didn't want to do anything without some unit tests, so here they are. 
This allows a standalone binary, epan/reassemble_test, to be built; this can be run from the commandline and should end up printing out "success" 
if all goes well.
NOTE the changes to makefile.am NOT checked in currently.

Incidentally: is it possible to get the buildbot to run things like this, exntest and tvbtest?

02_reassemble_refactor.patch
----------------------------
fragment_add_seq, fragment_add_dcerpc_dg and fragment_add_seq_check_work were all pretty much carbon-copies of each other. This patch factors out the common parts of the routines into a new routine, fragment_add_seq_key().

03_reassemble_partial_reassembly.patch
---------------------------------------
This makes fragment_set_partial_reassembly() work for datagrams assembled with fragment_add_seq(). The patch itself is actually quite small, but it adds another unit test which is reasonably lengthy.

svn path=/trunk/; revision=20888
2007-02-21 06:19:03 +00:00
Jeff Morriss 0787b688cc Squelch a few unused parameter warnings.
svn path=/trunk/; revision=20863
2007-02-19 15:30:06 +00:00
Jeff Morriss 1a9420702e Fix the SCCP dissector so it doesn't show non-segmented DT1 messages as
having been reassembled.

Fix the comments in reassembly.c and reassembly.h regarding what the reassembly
routines actually return in the 802.11 and no-sequence-number cases when they
are given the first and last packet (that is, a non-segmented packet): in
particular the routines return a pointer to a list containing just the one
fragment.

svn path=/trunk/; revision=20505
2007-01-19 23:27:24 +00:00
Guy Harris b343fcddd9 Fix pluralization of "bytes" so it doesn't say "1 bytes".
Clean up indentation.

svn path=/trunk/; revision=19953
2006-11-21 21:49:58 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Ulf Lamping 17afca625c simply use DISSECTOR_ASSERT() to detect tvb problems instead of my previous commit
svn path=/trunk/; revision=17074
2006-01-22 19:31:42 +00:00
Ulf Lamping 4843257596 add fragment_get_reassembled_id so the handed id doesn't need to be a packet number (experimental)
add a check to fragment_add_common() if the given tvb parameters are ok, otherwise throw a DissectorError

add some more symbols to libethereal.def

svn path=/trunk/; revision=17073
2006-01-22 16:47:16 +00:00
Jaap Keuter 815a4af69e Hi All,
Find attached a couple of changes for t38:
- Use the dissector to reassemble t30 frames
- Dissect t30 protocol
- Move the "Fax t38 analysis" to the "VoIP Calls". Now when selecting
"Statistics"->"Fax t38 analysis" option, there is a message that
redirect the user to use the "Voip calls" instead. We may keep this
option for one release, and then remove it ?
- Added in the "Voip calls" the ability to detect a t38 call if there
are not signaling associated with it. For example, when using "Decode
as.." to dissect t38 packets, it is possible to use the "Voip calls" to                                                      analyze that call.
- Display "SDP (t38)" in the "Voip calls graph" for SDP t38 sessions.

Regards
Alejandro Vaquero


svn path=/trunk/; revision=17033
2006-01-15 15:01:14 +00:00
Gerald Combs ba83bf145f Don't try to reassemble a zero-length fragment. Add a comment to
reassemble.c about the handling of zero-length fragments.

svn path=/trunk/; revision=15899
2005-09-20 17:23:19 +00:00
Ulf Lamping 55c3e85a95 fix reassembling problem I've introduced yesterday, by using fragment_add_seq_next() function instead of fragment_add()
in addition, I had to implement fragment_get_reassembled() in addition to fragment_get(), which works with reassembled_table

svn path=/trunk/; revision=15762
2005-09-12 00:16:57 +00:00
Ulf Lamping 0bb7a6e003 rename fragment_add_dcerpc -> fragment_add_dcerpc_dg to avoid confusion a bit,
as connection oriented (cn) and connectionless (dg) DCE/RPC uses different ways to handle defragmentation and this function is only used for dg

svn path=/trunk/; revision=15757
2005-09-11 21:10:26 +00:00
Ulf Lamping 541fd750b8 fix DCE/RPC defragmentation, if both middle and last DCE/RPC fragments are in the same TCP desegmented data blob
reassemble.c:
I had to change the way the reassemble code works if the dissector is telling that more fragments *will* follow. In this case the reassemble code shouldn't try to reassemble already at that time ...

I've also changed the way if a fragment was already seen or not, as it's not enough to check for the frame number, in the scenario described above.

Unfortunately both changes *might* broke other protocols from reassemble properly. I've checked with excessive TCP desegmentation and it's still working without any changes :-)

packet-dcerpc.c:
use a tvb subset to limit the "end of bytes" processed in a single fragment dissect run, as each fragment has it's own DCE/RPC header (and isn't part of the stub data of the previous packet).

svn path=/trunk/; revision=15744
2005-09-10 15:11:21 +00:00
Ronnie Sahlberg 99d08f067e remove two more GMemChunks
svn path=/trunk/; revision=15348
2005-08-14 01:26:34 +00:00
Guy Harris 0c5af0dde6 If we do reassembly and hand the packet to the dissector, and the
dissector says "sorry, I need even more data in this packet", don't flag
that packet as being reassembled in that frame.  Indicate that we should
perhaps do all the "partial reassembly" stuff in
"fragment_set_partial_assembly()", which would obviate the need for the
hack in the TCP dissector.

Clean up indentation.

svn path=/trunk/; revision=15139
2005-07-29 07:14:32 +00:00
Jörg Mayer 7949c7f31c char -> const char warning fixes
svn path=/trunk/; revision=15079
2005-07-26 08:01:16 +00:00
Guy Harris 7a6f0a102c When reassembling a packet, all data, including data with
FD_NOT_MALLOCED set, has to be copied - all FD_NOT_MALLOCED means is
that the fragment's data is part of the old reassembled data, rather
than a malloced chunk of its own (this happens if, after reassembly, the
dissector says more reassembly is necessary, as can happen, for example,
in the case of HTTP and other protocols where reassembly continues until
a terminator is seen).  Not copying the data means that the reassembled
data is, in part, whatever random junk happens to be in the
newly-allocated buffer.

Back out the change not to copy the data, but add some sanity checks, in
the hopes of preventing the crash that caused the change not to copy the
data to be added, and in the hopes of discovering the ultimate source of
that crash and fixing it.

svn path=/trunk/; revision=15057
2005-07-25 18:03:19 +00:00
Guy Harris 72560a2e04 Fix indentation.
svn path=/trunk/; revision=15050
2005-07-24 22:01:14 +00:00
Guy Harris 72c01a62f8 "fragment_add_common()" isn't used outside this file - make it static.
Move to "show_fragment()" the code to append the fragment information to
the top-level item.

Fix indentation.

svn path=/trunk/; revision=15042
2005-07-24 17:48:10 +00:00
Gerald Combs 276f179b0b Don't crash if we're handed a zero-length fragment. Fixes bug 272. Although
we don't crash now, we still don't handle zero-length fragments correctly.

svn path=/trunk/; revision=14858
2005-07-05 20:04:03 +00:00
Ulf Lamping 56a9fe6d2a add a generated toplevel line between the connectionless DCE/RPC protocol and the defragmented DCE/RPC content, to better understand what's going on if defragmentation is done.
svn path=/trunk/; revision=14531
2005-06-02 20:55:58 +00:00
Ulf Lamping e2c3b60280 add a generated toplevel line between the TCP protocol and the desegmented content, to better understand what's going on while desegmenting.
We'll have to add similar mechanisms for other protocols as well...

svn path=/trunk/; revision=14527
2005-06-02 18:52:55 +00:00
Gerald Combs 64cafdda21 From Peter Johansson: Fix a segmentation fault in the reassembly code.
Fix up the formatting a bit.

svn path=/trunk/; revision=14136
2005-04-19 14:17:22 +00:00
Gerald Combs 5eb73dd01b In fragment_unhash(), free our key data _after_ we remove the key from
the hash table so that fragment_equal() doesn't end up working with
recently-freed data.

svn path=/trunk/; revision=14096
2005-04-15 20:15:03 +00:00
Ulf Lamping 79daa1e80e use DISSECTOR_ASSERT instead of g_assert
svn path=/trunk/; revision=13871
2005-03-23 00:09:12 +00:00
Lars Roland ec9ca01616 Move the following files from /trunk to /trunk/epan:
asn1.[ch]
follow.[ch]
ptvcursor.[ch]
reassemble.[ch]
xmlstub.[ch]

fix #include statements accordingly.

svn path=/trunk/; revision=13366
2005-02-09 23:38:00 +00:00