Commit graph

93 commits

Author SHA1 Message Date
Guy Harris
a2414d8909 Don't wire into the reassembly code the notion that reassemblies should
be done on flows from one address to another; reassembly for protocols
running atop TCP should be done on flows from one TCP endpoint to
another.

We do this by:

	adding "reassembly table" as a data structure;

	associating hash tables for both in-progress reassemblies and
	completed reassemblies with that data structure (currently, not
	all reassemblies use the latter; they might keep completed
	reassemblies in the first table);

	having functions to create and destroy keys in that table;

	offering standard routines for doing address-based and
	address-and-port-based flow processing, so that dissectors not
	needing their own specialized flow processing can just use them.

This fixes some mis-reassemblies of NIS YPSERV YPALL responses (where
the second YPALL response is processed as if it were a continuation of
a previous response between different endpoints, even though said
response is already reassembled), and also allows the DCE RPC-specific
stuff to be moved out of epan/reassembly.c into the DCE RPC dissector.

svn path=/trunk/; revision=48491
2013-03-22 23:59:54 +00:00
Anders Broman
d1f89f81d8 From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48384
2013-03-18 05:18:32 +00:00
Bill Meier
2c269c2864 Fix a set of obscure bugs found by checkhf.
svn path=/trunk/; revision=47666
2013-02-15 01:31:27 +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
Bill Meier
4ab1b84a89 Fix 2 [-Wshadow] warnings.
svn path=/trunk/; revision=46369
2012-12-04 16:31:10 +00:00
Greg Morris
9ea1ab416e Provide ability to find previous request packets in NCP hash table.
svn path=/trunk/; revision=45447
2012-10-10 13:55:18 +00:00
Greg Morris
a039953b6e Fix for buildbot warning on OSX-10.6-x64
svn path=/trunk/; revision=45178
2012-09-27 18:04:09 +00:00
Greg Morris
247040590d Added additional server information in NCP 23/17 reply structure for OES Linux.
Fixed GTKHash table being overwritten when number of NCP packets exceeds 255. Sequence numbers wrap so this was causing the request value table to be overwritten and subsequent malformed NCP packets.

Fixed buid_expert_data for file open reporting to correctly convert to Hex value so proper lookup in val table will succeed.

Added additional OES Linux values to build_expert_data for server entries.

svn path=/trunk/; revision=45177
2012-09-27 17:47:10 +00:00
Jeff Morriss
aa5d9d78dd From Robert Bullen via 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-09-07 02:09:59 +00:00
Evan Huus
5745bb4382 Remove duplicate assignment (caught by cppcheck).
svn path=/trunk/; revision=44729
2012-09-01 15:00:49 +00:00
Gerald Combs
cd3cca7edc Make the corresponding packet_info available to each tree item. This
lets us pass a NULL pinfo to expert_add_info_format() and
expert_add_undecoded_item(), which makes it possible to use those
routines deep in the bowels of many dissectors. As a proof of concept
remove the recent pinfo additions to packet-afp.c. This should also make
it easier to fix bug 3884.

svn path=/trunk/; revision=44435
2012-08-10 20:33:01 +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
Bill Meier
b17543e2c0 Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings.
svn path=/trunk/; revision=38049
2011-07-15 19:07:25 +00:00
Jeff Morriss
ec460c3e99 As suggested by Chris: use val_to_str_const() instead of match_strval() plus a
NULL-return check.

Use val_to_str_const instead of val_to_str() in a couple places where the string
is constant.

Use val_to_str() instead of blindly passing the return value from match_strval()
into a format routine (to ensure a non-NULL string pointer).

svn path=/trunk/; revision=37202
2011-05-17 17:40:26 +00:00
Jeff Morriss
7a93fdab12 Avoid passing a NULL string pointer to format routines: some libc's (e.g.,
Solaris') will seg-fault on that.

svn path=/trunk/; revision=37201
2011-05-17 16:07:24 +00:00
Bill Meier
bbea8c7cf7 Don't assign to a proto_item * if the value won't be used: Coverity 978;
Use what appears to be the intended correct tree for various proto_add...: Coverity 979;
Minor indentation cleanup.

svn path=/trunk/; revision=36594
2011-04-12 17:44:22 +00:00
Gerald Combs
46865581e5 Fix Visual C++ code analysis warnings.
svn path=/trunk/; revision=36007
2011-02-19 00:05:12 +00:00
Stig Bjørlykke
84bc28bd6a Introduce "Fragment count" filter element for all protocols doing reassembly.
svn path=/trunk/; revision=35705
2011-01-30 21:01:07 +00:00
Stig Bjørlykke
18e3850d24 Switched to bitwise & instead of logical && in bit operations.
This bug was found by clang.

svn path=/trunk/; revision=35210
2010-12-17 13:01:52 +00:00
Bill Meier
2f8ab63858 Compile (over 100) dfilters only if needed rather than at every Wireshark startup;
Also: Minor whitespace cleanup.

svn path=/trunk/; revision=34747
2010-11-01 18:38:13 +00:00
Bill Meier
acccf6a77c Define some fcns & vars as static...
svn path=/trunk/; revision=34459
2010-10-10 20:14:34 +00:00
Bill Meier
9c0d7c63a8 Do some constifying (based upon gcc -Wwrite-strings warnings);
Use #if 0/#endif instead of /* ... */ to comment out code..

svn path=/trunk/; revision=33176
2010-06-09 13:30:44 +00:00
Guy Harris
927b7da346 Have abs_time_to_str() and abs_time_to_str_secs() take an additional
argument indicating whether to include the time zone in the string.  If
we're constructing a display filter, don't include the time zone,
otherwise do.  Fixes bug 4756.

svn path=/trunk/; revision=32913
2010-05-21 06:33:25 +00:00
Guy Harris
500eb99cd9 Add a third date format, ABSOLUTE_TIME_DOY_UTC, to show UTC with the
date as YYYY/DDD, where DDD is a 1-origin day of year.  Move the formats
to a "time_fmt.h" file, included by the headers that use it.  Have
abs_time_to_str() and abs_time_secs_to_str() take the date format value,
rather than a Boolean "show this as UTC" flag, as an argument.  Document
the ABSOLUTE_TIME_ formats a bit better.  Use that format in the CCSDS
and VCDU dissectors, rather than having those dissectors do the
formatting themselves.

svn path=/trunk/; revision=32034
2010-02-27 19:01:27 +00:00
Stig Bjørlykke
88b72356ad Introduce "Reassembled length" filter element for all protocols doing
reassembly.

svn path=/trunk/; revision=31767
2010-02-02 16:01:52 +00:00
Guy Harris
4fde145bd2 Add an argument to abs_time_to_str() and abs_time_secs_to_str()
indicating whether the time should be shown as local time or UTC.  For
now, always pass FALSE, meaning "show as local time".

Clean up some stuff in the SNMP dissector, use abs_time_secs_to_str()
for times with one-second resolution, and update a comment in various
macros in the WSP dissector, while we're at it.

svn path=/trunk/; revision=31227
2009-12-10 22:19:29 +00:00
Bill Meier
f479b75ea3 Remove #define which is no longer req'd.
svn path=/trunk/; revision=30525
2009-10-12 00:54:41 +00:00
Bill Meier
9f24b1870b Replace use of GMemChunk by se_alloc;
This fixes a major memory leak in the NCP dissector
caused by the fact that "in recent versions of GLib" (>= 2.10 ?)
g_mem_chunk_destroy doesn't actually free up the mem_chunk memory.

Note that there still appears to be one or more smaller
memory leaks somehow associated with NCP dissection.

Example:

A 40M capture file with mostly NCP frames which resulted in a memory
usage increase of about 20M each time the file was reloaded now results 
in a 400K-800K memory usage increase each time the file is reloaded.

(If NCP dissection is disabled, there is minimal memory expansion
each time the file is reloaded).


svn path=/trunk/; revision=30481
2009-10-10 21:13:16 +00:00
Bill Meier
17a2e0b460 Fix a benign no-effect bug;
Use consistent indentation.

svn path=/trunk/; revision=30480
2009-10-10 17:49:28 +00:00
Kovarththanan Rajaratnam
cf8138e195 Remove check_col() guard
svn path=/trunk/; revision=30124
2009-09-24 19:50:43 +00:00
Kovarththanan Rajaratnam
fa940d3366 Use PTREE_FINFO.
svn path=/trunk/; revision=29356
2009-08-09 18:05:44 +00:00
Anders Broman
c91a384702 Apply some of the patches from:
http://wiki.wireshark.org/Development/Optimization

svn path=/trunk/; revision=28356
2009-05-13 19:46:11 +00:00
Guy Harris
cfe974aadd The expert_item pointers and expert_status values don't need to be
static; make them auto variables.

Make sure that expert information is added outside "if (tree) { }", so
it gets added even if we're not building the protocol tree.

Clean up white space.

svn path=/trunk/; revision=28281
2009-05-05 19:33:46 +00:00
Gerald Combs
4403f89243 More size_t fixes.
svn path=/trunk/; revision=27976
2009-04-06 19:30:48 +00:00
Jaap Keuter
d373860a00 Make the column check actually check the information column status.
svn path=/trunk/; revision=27223
2009-01-13 20:46:26 +00:00
Stig Bjørlykke
e6a22e689e Fix some "format not a string literal and no format arguments" warnings.
svn path=/trunk/; revision=26648
2008-10-31 15:34:00 +00:00
Bill Meier
7f2978acc8 From Pavol Rusnak: Add missing break statement....
svn path=/trunk/; revision=26166
2008-09-08 16:13:39 +00:00
Greg Morris
326e983d22 Fix for retransmission of fragmented NDS reply packets.
Fix for crash in expert file information.
Fix for malformed NDS iteration packets.
Fix indention on NDS read attribute definition verb.

svn path=/trunk/; revision=26012
2008-08-14 11:40:12 +00:00
Bill Meier
f4a7b39753 Print various uints with %u ...
svn path=/trunk/; revision=25914
2008-08-04 03:46:49 +00:00
Bill Meier
8f84b18945 Fix 2 bugs:
- Misplaced } resulted in incorrect program flow in switch statement;
- Invalid input caused "Dissector bug: infinite loop";

svn path=/trunk/; revision=25913
2008-08-04 02:56:47 +00:00
Bill Meier
1fc904c6be Adjust various indentation/spacing; Do some minor reformatting
svn path=/trunk/; revision=25911
2008-08-04 02:27:20 +00:00
Anders Broman
2c4bdd2e82 From Bill Meier:
segmentation fault loading trace containing NCP packets.

svn path=/trunk/; revision=25892
2008-08-01 11:56:57 +00:00
Jeff Morriss
f97023f302 Don't use proto_tree_add_uint_hidden() any more: it's deprecated.
svn path=/trunk/; revision=25807
2008-07-23 20:35:28 +00:00
Bill Meier
c63145b3d9 Fix some spacing .....
svn path=/trunk/; revision=25683
2008-07-09 02:30:39 +00:00
Bill Meier
d0258115a6 Fix some mis-spellings
svn path=/trunk/; revision=25682
2008-07-09 01:30:30 +00:00
Guy Harris
044e57c917 Clean up indentation.
Make build_expert_data() take the size of "buffer" as an argument, and
use that when doing g_snprintf() into the buffer, to ensure we don't
overflow the buffer.  Also, don't just assign to "buffer", as that
doesn't put anything *in* the buffer.

svn path=/trunk/; revision=25600
2008-06-25 09:10:50 +00:00
Stig Bjørlykke
9cb03a761c Rewrote to use g_strlcat and g_strlcpy.
svn path=/trunk/; revision=24522
2008-03-01 13:58:15 +00:00
Greg Morris
438c96dabb Error code 0x89a9 updated error message to be:
"Invalid Path With Junction Present"

Fix get extended volume info to register correct name with NDS EID value. (added data type of 20 to extract string value)

Fix expert data for file handles to report file handle in expert data. (Added data type of 22 to extract bytes value)

svn path=/trunk/; revision=24505
2008-02-29 15:36:51 +00:00
Jörg Mayer
7303115b86 Replace // comments
svn path=/trunk/; revision=23856
2007-12-13 11:37:03 +00:00
Gerald Combs
f3fdef83d6 Don't try to overwrite read-only memory. Fixes bug 2001.
svn path=/trunk/; revision=23529
2007-11-21 17:00:24 +00:00