Commit Graph

89 Commits

Author SHA1 Message Date
Jakub Zawadzki ea73d4a55c Avoid calling find_dissector(), cache result of [new_]register_dissector()
svn path=/trunk/; revision=53353
2013-11-16 01:10:05 +00:00
Pascal Quantin a0c53ffaa1 emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly

svn path=/trunk/; revision=52172
2013-09-22 15:50:55 +00:00
Pascal Quantin 20a40260d7 A few more dissectors converted to wmem
svn path=/trunk/; revision=52071
2013-09-15 18:03:32 +00:00
Michael Mann b38ee917b1 Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if hf_ field name is the first part of the formatted string. This was done with a perl script on the dissectors directory (packet-*.c), followed by manual inspection of the output. The manual inspection yielded a few cases that really should have been proto_tree_add_uint or proto_tree_add_item, so I updated them accordingly.
The script didn't catch as many as I would have liked, but it's a start.

The most common (ab)use of proto_tree_add_uint_format was for appending strings to CRC/checksum values to note good or bad CRC/checksum.

svn path=/trunk/; revision=52045
2013-09-15 01:48:30 +00:00
Jakub Zawadzki a18172147f Remove fragment_data, add fragment_head, fragment_item - for now alias it to the same structure.
This is begin of work to split fragment head and fragments items.

svn path=/trunk/; revision=50708
2013-07-17 21:12:24 +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
Michael Mann fa5b45834b Remove check_col() and the occasional tree.
svn path=/trunk/; revision=49921
2013-06-14 01:56:28 +00:00
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 3eb06be97d From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48425
2013-03-19 19:28:57 +00:00
Alexis La Goutte 1d4bd1cb33 Make Windows Buildbot happy
svn path=/trunk/; revision=45691
2012-10-21 16:37:45 +00:00
Alexis La Goutte 0baa7413a9 Fix Passed-by-value struct argument contains uninitialized data Warning found by Clang
svn path=/trunk/; revision=45682
2012-10-21 14:53:29 +00:00
Alexis La Goutte 523417a5ca Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=45680
2012-10-21 14:53:10 +00:00
Guy Harris f7030c6940 Get rid of unused variable.
svn path=/trunk/; revision=45179
2012-09-27 19:35:23 +00:00
Michael Mann 99d0404b73 replaced decode_enumerated_bitfield calls with itemized filters
svn path=/trunk/; revision=45176
2012-09-27 16:49:31 +00:00
Jeff Morriss 2552c750e5 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45017
2012-09-20 02:03:38 +00:00
Jakub Zawadzki 9f92dc93c5 Add data parameter to call_dissector_only.
svn path=/trunk/; revision=44872
2012-09-11 08:28:07 +00:00
Jakub Zawadzki dee4443809 Add data parameter to dissector_try_heuristic
svn path=/trunk/; revision=44871
2012-09-11 08:26:48 +00:00
Jakub Zawadzki 5a8783f5b1 Initial commit to support yet another method of passing data between dissectors.
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL

svn path=/trunk/; revision=44860
2012-09-10 21:40:21 +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
Chris Maynard 07503d2af5 Fix the 2nd part of Coverity CID 280361 (formerly 361): "Logically dead code" that mmartin seems to have unintentionally missed in r36256.
svn path=/trunk/; revision=44177
2012-08-01 01:50:27 +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 30cee99009 Fix a number of proto_tree_add_item() encoding args.
svn path=/trunk/; revision=39774
2011-11-09 17:33:18 +00:00
Bill Meier 794757ae8f For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.
Also: remove trailing whitespace for a number of files.

svn path=/trunk/; revision=39503
2011-10-21 02:10:19 +00:00
Bill Meier 67ee5049d4 Convert 'encoding' parameter of certain proto_tree_add_item() calls in non-autogenerated epan/dissectors:
Specifically:  Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as
  the encoding parameter for proto_tree_add_item() calls which directly reference
  an item in hf[] which has a type of:
     FT_BOOLEAN
     FT_IPv4
     FT_EUI64
     FT_GUID
     FT_UINT_STRING

Also: For type FT_ITv6 use ENC_NA. (This was missed in SVN #39260)

svn path=/trunk/; revision=39328
2011-10-10 00:39:31 +00:00
Bill Meier 4e57694d4a Convert 'encoding' parameter of certain proto_tree_add_item() calls in non-autogenerated epan/dissectors:
Specifically:  Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as
 the encoding parameter for proto_tree_add_item() calls which directly reference
 an item in hf[] which has a type of:
    FT_UINT8
    FT_UINT16
    FT_UINT24
    FT_UINT32
    FT_UINT64
    FT_INT8
    FT_INT16
    FT_INT24
    FT_INT32
    FT_INT64
    FT_FLOAT
    FT_DOUBLE


svn path=/trunk/; revision=39288
2011-10-06 03:35:44 +00:00
Jaap Keuter 18e443f308 Fix for bug 6009:
Information transfer rate is a 7 bit field.

svn path=/trunk/; revision=37663
2011-06-13 20:29:51 +00:00
Martin Mathieson 0370a7977d Remove redundant comparison.
Coverity CID 361.

svn path=/trunk/; revision=36256
2011-03-22 18:06:58 +00:00
Jeff Morriss d8659693ef Check for places where tvb_bytes_to_str() or tvb_get_bytes_to_str_punct()
should be used (instead of the non-tvb functions with a call to tvb_get_ptr()).

Use those functions in a bunch of places.

svn path=/trunk/; revision=35911
2011-02-11 02:43:07 +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
Jeff Morriss 8d32d2066a There's no need to pass the result of tvb_get_ptr() as the 'value' in
proto_tree_add_*(): just use proto_tree_add_item().

Replace some tvb_get_ptr()s with tvb_get_ephemeral_string() or
tvb_get_const_stringz().

Use tvb_memeql() & tvb_memcmp().

svn path=/trunk/; revision=35558
2011-01-16 20:51:21 +00:00
Guy Harris a8bc4a0d13 Rename the routines that handle dissector tables with unsigned integer
keys to have _uint in their names, to match the routines that handle
dissector tables with string keys.  (Using _port can confuse people into
thinking they're intended solely for use with TCP/UDP/etc. ports when,
in fact, they work better for things such as Ethernet types, where the
binding of particular values to particular protocols are a lot
stronger.)

svn path=/trunk/; revision=35224
2010-12-20 05:35:29 +00:00
Anders Broman 7870de6f95 Fill value_strings.
svn path=/trunk/; revision=34875
2010-11-15 16:46:07 +00:00
Bill Meier b78ec52693 Use value_string_ext fcns to access certain value_string arrays;
Sort certain value_string arrays so the values are in ascending order;
Use val_to_str_ext() instead of for loops to do value_string array lookups (voip_calls.c).
Minor whitespace cleanup.

svn path=/trunk/; revision=34794
2010-11-05 22:44:03 +00:00
Jaap Keuter c1b8394ebc From Alexis La Goutte:
Fix false positive from checkhf.

svn path=/trunk/; revision=34772
2010-11-04 06:44:57 +00:00
Jaap Keuter b7920c07c5 From Alexis La Goutte:
Replace all *_min()/*_max() by MIN() and MAX().

svn path=/trunk/; revision=34767
2010-11-04 06:36:33 +00:00
Tomas Kukosa b32d39b755 ignore unreassembled fragments if the first segment of the next message comes
svn path=/trunk/; revision=32643
2010-05-03 08:07:53 +00:00
Bill Meier 09764dd969 Remove unneeded #include <stdio.h>
svn path=/trunk/; revision=32367
2010-04-03 21:55:23 +00:00
Tomas Kukosa 6fe3d98de8 Do not reassemble messages if segment is not complete (packet size limited during capture)
svn path=/trunk/; revision=32326
2010-03-30 12:23:52 +00:00
Tomas Kukosa 02a8a77f03 add some Q.931 messages from older specifications
svn path=/trunk/; revision=32244
2010-03-19 13:03:14 +00:00
Tomas Kukosa cd719af33a Add heuristic table for Q.931 User-specific protocol
svn path=/trunk/; revision=32218
2010-03-17 15:25:20 +00:00
Stig Bjørlykke 47e732e29e Changed "reassembled_length" -> "reassembled.length".
svn path=/trunk/; revision=31776
2010-02-03 08:47:15 +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
Bill Meier 1a4283ccf8 Fixes for gcc -Wshadow warnings; Fix indentation and do other minor cleanup in a few cases.
svn path=/trunk/; revision=31617
2010-01-22 13:56:19 +00:00
Anders Broman 3faf5345ab From Gerasimos Dimitriadis:
DTAP: Progress description depends on coding standard.
Changed to export value strings trough .h file
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4146

svn path=/trunk/; revision=30661
2009-10-22 05:28:53 +00:00
Anders Broman f5f2bf6ecd From Gerasimos Dimitriadis:
DTAP: Call state depends on coding standard.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4145

svn path=/trunk/; revision=30655
2009-10-21 09:38:51 +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 e971354a54 Don't guard col_set_str (COL_PROTOCOL) with col_check
svn path=/trunk/; revision=29340
2009-08-09 06:26:46 +00:00
Jaap Keuter 2c9c96744d From Gerasimos Dimitriadis:
Added decoding support for the High Layer Compatibility IE in DTAP and updated
the relevant part in Q.931. Also some minor enhancements in Q.931.

svn path=/trunk/; revision=29280
2009-08-03 21:12:41 +00:00
Stig Bjørlykke b228488bc0 From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
    for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
    FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero

svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +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