Commit Graph

52 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 ae747e4c4b From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48430
2013-03-19 22:03:00 +00:00
Guy Harris dcf054dd5e Fix some variable names to better indicate what they do.
Fix indentation.

Fix a proto_tree_add_uint_format_value() call not to include the name of
the field - proto_tree_add_uint_format_value() will add that for you.

Have dte_address_util() take the offset of the address as an argument;
it's not always at the same offset from the beginning of the facility.

Have it return the pointer to the generated string directly, rather than
through a pointer argument.

Create only one subtree for each facility, and give it a text description
of the facility code rather than the numerical value of the facility
code.  Make the top-level item for the facility cover all the bytes of
the facility, including code, length if present, and parameters.

Dissect the end-to-end transit delay and priorities facilities
completely.  Also, fix an incorrect use of "transmit delay" to say
"transit delay".

Get rid of the last of the spaces preceding colons in "Field: value"
descriptions and in a "default:" case label.

Do the data vs. non-data packet thing ith

	if (PACKET_IS_DATA(pkt_type)) {
		...
	} else {
		...
	}

rather than, in effect, doing the "else" with a break; that makes the
code a bit clearer.

Put the logical channel number into the protocol tree in common code for
the default case, rather than doing it separately for data and non-data
packets.  Clean up the dissection of non-data packets to add entries
before updating the columns, so that we don't throw an exception
updating the columns before we get to add items that wouldn't throw
exceptions.  Clear the Info column early in the dissection, in case we
throw an exception before getting to set it and thus leave behind the
column information for the protocol atop which we're running.

svn path=/trunk/; revision=48093
2013-03-05 19:31:13 +00:00
Michael Mann 1658b20e44 Convert at least enough proto_tree_add_text to proto_tree_add_item/expert_info to passify checkAPIs.pl.
Removed check_col calls.

svn path=/trunk/; revision=48016
2013-03-02 21:05:32 +00:00
Michael Mann 0063cc00c8 remove decode_numeric_bitfield + cleanup.
I wanted to just remove the decode_numeric_bitfield calls, but the dissector needs some MAJOR work. Cleaned up some with the power of value_strings, but I just got overwhelmed.  There has got to be existing APIs to make this dissection simpler (besides being more filterable).

svn path=/trunk/; revision=45165
2012-09-27 04:05:01 +00:00
Michael Mann b89a06a3e1 replaced decode_boolean_bitfield calls with itemized filters
svn path=/trunk/; revision=45059
2012-09-23 00:12:14 +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 dee4443809 Add data parameter to dissector_try_heuristic
svn path=/trunk/; revision=44871
2012-09-11 08:26:48 +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
Guy Harris 307e13d9f2 Move the list of AX.25 protocol IDs to epan/ax25_pids.h. Use it in
packet-ax25.c and packet-arp.c.

Add an "ax25.pid" dissector table for those protocol IDs, use it in the
AX.25 dissector, and have dissectors register in that table with their
protocol IDs.

Get rid of some unneeded includes.

Clean up some "AX25"s in user-visible strings - say "AX.25" instead.

Clean up some indentation.

svn path=/trunk/; revision=44235
2012-08-03 01:58:12 +00:00
Anders Broman 7f345354fe From Karsten Keil:
ISDN LAPD X.31 packet traffic can not be decoded

X.31 is X.25 over ISDN. It use SAPI 16 LAPD service.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7514

svn path=/trunk/; revision=43956
2012-07-24 11:47:23 +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 d53320919a Remove unneeded #includes (stdlib, stdio, ctypes, time);
In a few cases: do some whitespace, indentation cleanup & reformatting.

svn path=/trunk/; revision=42632
2012-05-15 19:23:35 +00:00
Guy Harris 0fde5403ab Fix long name for reverse charging field.
svn path=/trunk/; revision=42322
2012-04-28 17:57:41 +00:00
Guy Harris 3016d07185 Remove redundant "X.25". (I'm not sure why the protcol name is included
in the reassembly information both here and, for example, IPv4 fragment
reassembly, but perhaps those are redundant as well.)

svn path=/trunk/; revision=42321
2012-04-28 17:42:55 +00:00
pascal 5e0e1ceea8 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7213:
Update dissection of Reverse charging, fast select, and ICRD status selection facilities

svn path=/trunk/; revision=42319
2012-04-28 17:34:23 +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 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
Chris Maynard 21363344ec Add text to fac_subtree instead of fac_tree. Fixes Coverity CID 1129.
svn path=/trunk/; revision=37083
2011-05-12 17:14:36 +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
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
Bill Meier 09764dd969 Remove unneeded #include <stdio.h>
svn path=/trunk/; revision=32367
2010-04-03 21:55:23 +00:00
Stig Bjørlykke 98df26f3a9 Added protocol name to "Reassembled length" text.
svn path=/trunk/; revision=31774
2010-02-02 22:32:31 +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
Anders Broman 440c3f9261 From Didier Gautheron:
check_col.diff
Remove redundant calls to check_col() if it guards only one columns function with one parameter after the column type.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4394

svn path=/trunk/; revision=31519
2010-01-13 20:32:01 +00:00
Anders Broman 88bb44a51e From Jakub Zawadzki:
Cleanup dissector code - use proper memory functions.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4164

svn path=/trunk/; revision=30691
2009-10-25 11:43:30 +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 4b6090e576 Don't guard col_set_str (COL_INFO) with col_check
svn path=/trunk/; revision=29342
2009-08-09 07:01:26 +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
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
Stig Bjørlykke f528fef394 Renamed filter name to x25 to be like other X protocols.
svn path=/trunk/; revision=27595
2009-03-03 22:00:10 +00:00
Bill Meier c0e92cbc04 Fix various typos and spelling errors (mostly in text strings)
svn path=/trunk/; revision=27065
2008-12-20 00:09:02 +00:00
Stig Bjørlykke 94e9e2b1ec Fix some "format not a string literal and no format arguments" warnings.
svn path=/trunk/; revision=26652
2008-10-31 17:27:51 +00:00
Anders Broman 152973c876 From Gerhard Olsson:
X25 reassembly fragment table and dissected proto presented for all X25 packets

svn path=/trunk/; revision=25874
2008-07-30 14:50:17 +00:00
Stig Bjørlykke dc84f3a887 From Jesus Roman (bug 2431):
The decoded value of Size Packet shown as "From the calling DTE" is the value
of "From the called DTE".

When the size packet to negotiate has any of 512, 1024, 2048 or 4096 bytes, the
value shown decoded is erroneus.


The patch attached also includes new decoded facilities:

- Extended CUG selection.
- Extended access outgoing CUG selection.
- Extended RPOA selection.
- NUI selection.

- Charging info selection.
- Call dureation.
- Segment Count.
- Monetary Unit.

svn path=/trunk/; revision=24932
2008-04-12 13:41:53 +00:00
Jaap Keuter 2693fce57b From Gerhard Olsson:
Add "Assume COTP" prefererence instead of hard coding

If there is no current dissector registered for X25 and there is no hints in
the call packets, X25 tries to look at user data, then try heuristics. See end
of dissect_x25_common

This means that if the call data happens to start with 0x45, IP is assumed as
the data format even if the packet cannot be handled as IP (for instance too
short).

It is better to try the heuristics first as they should have more complete tests.

svn path=/trunk/; revision=24655
2008-03-16 10:19:51 +00:00
Stig Bjørlykke 10752972ea Check for COTP if Call Request has not been captured.
Fixed an offset for diagnostic in COL_INFO.

This file should really be rewritten to use more proto_tree_add_item's
instead of proto_tree_add_text's.

svn path=/trunk/; revision=22552
2007-08-18 22:56:44 +00:00
Ronnie Sahlberg d5d5159b6d From Sebastien Tandel
fixes for various compiler warnings

svn path=/trunk/; revision=21210
2007-03-26 11:06:26 +00:00
Graeme Lunt c05709dc70 "When X.264/ISO 11570 default identification is being used, there is no user data field in the
CALL REQUEST packet.  This is for X.225/ISO 8073 COTP."

Added this default handling.


svn path=/trunk/; revision=21026
2007-03-14 17:28:55 +00:00
Ronnie Sahlberg feab79e328 change a whole bunch of ethereal into wireshark
svn path=/trunk/; revision=18196
2006-05-21 04:49:01 +00:00
Jörg Mayer f9a57f08d1 Bill Meier:
Spelling fixes.

svn path=/trunk/; revision=16956
2006-01-05 13:01:08 +00:00
Ulf Lamping 9a42ef9536 fix #480: Change defaults for all reassembling settings to ON
I've changed all settings I could find to TRUE. It might be reasonable to change some protocol settings back to FALSE, if reassembling fails very often.

svn path=/trunk/; revision=16048
2005-09-28 22:15:38 +00:00
Guy Harris b7b80d94be Move a pile of protocol-related headers from the top-level source
directory to the epan directory.  Some of them should perhaps ultimately
be moved to epan/dissectors, if they pertain only to stuff exported by a
particular dissector.

Fix Gerald's e-mail address in files we're moving.

svn path=/trunk/; revision=15844
2005-09-17 00:02:31 +00:00
Ronnie Sahlberg ec488447dc more sprintf removals,
replace some char arrays on the stack to ep_alloc()ed memory


svn path=/trunk/; revision=15446
2005-08-19 23:28:23 +00:00
Jörg Mayer 2b2506f0f6 More char -> const char warning fixes
svn path=/trunk/; revision=15222
2005-08-05 13:10:58 +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
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
Gerald Combs eae0fb9b98 Improve the byte length check from the last commit, and check for the same
problem in other parts of the code.

svn path=/trunk/; revision=12699
2004-12-09 19:06:59 +00:00
Gerald Combs d888d28671 Check for a bogus byte length.
svn path=/trunk/; revision=12698
2004-12-09 18:46:27 +00:00