Commit Graph

50 Commits

Author SHA1 Message Date
Michael Mann fa5b45834b Remove check_col() and the occasional tree.
svn path=/trunk/; revision=49921
2013-06-14 01:56:28 +00:00
Anders Broman 85a8e304dd Add the posibillity to use a key for per-packet-data.
svn path=/trunk/; revision=49259
2013-05-12 18:11:02 +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 a10b98284c From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48412
2013-03-19 04:54:30 +00:00
Guy Harris f910cb502c calc_checksum() should be passed the length of the block to be
checksummed, which is the length of the TPDU, not that length + 1.

Calculate the TPDU length correctly - use
tvb_reported_length_remaining(), not tvb_length_remaining() (we want the
*actual* length, not the amount of captured data we have), and take the
offset handed to the dissector routine into account.  Don't take the
length indicator into account for TPDUs with user data, as they run to
the end of the lower-level packet containing the TPDU(s).  The CLTP UD
TPDU contains user data.

Note that this dissects both COTP *and* CLTP (that's why it's
"packet-ositp.c", not "packet-cotp.c").

Separate some groups of #includes with blank lines.

svn path=/trunk/; revision=47745
2013-02-19 07:06:55 +00:00
Guy Harris c037516c5e Whitespace tweaks.
svn path=/trunk/; revision=47743
2013-02-19 03:55:14 +00:00
Michael Mann 425ede28b4 Bugfix OSITP - Incorrect TP4 checksum calculation (ATN extended checksum) in case of multiple TPDU's per frame.
Bug 8293 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8293)

svn path=/trunk/; revision=47741
2013-02-19 01:34:15 +00:00
Jeff Morriss 04c9d29799 Make an enum_val_t static.
svn path=/trunk/; revision=46293
2012-11-29 20:21:30 +00:00
Guy Harris 06ce5d1571 More TODOs:
We hand the user data in a CR or CC packet to the subdissectors,
	but don't tell the subdissectors that - do we need to?

	We don't hand the data in an ED packet to the subdissectors -
	should we, and do we need to tell them that it's an ED packet?

svn path=/trunk/; revision=46067
2012-11-18 01:59:05 +00:00
Guy Harris bdb30c63bf Squelch another warning.
svn path=/trunk/; revision=46062
2012-11-17 23:05:03 +00:00
Guy Harris 8b2de024bf Squelch a warning (not enough data flow analysis is done to know that
cotp_tree actually never will be used uninitialized).

svn path=/trunk/; revision=46061
2012-11-17 22:35:13 +00:00
Guy Harris 7ef91b394d Handle the pseudo-trailer for the ATN extended checksums by passing in
the source and destination address lengths and data, and adding them in,
rather than by copying those fields to a fixed-size static buffer - that
gets rid of a global variable (global variables considered harmful), and
also means that we don't try to copy 24 bytes of length+address from
packets that don't *have* 24 bytes of length+address (which caused
exceptions to be thrown on some OSI captures I have).

Construct some LI #defines out of other LI #defines, to make it a bit
clearer why they have the values they do.

Support the "additional information related to the clearing of the
connection" variable part parameter of the COTP DR packet (which just
means giving it a name, as its contents are user-defined - some HP-UX
OSI stack appears to just stick in a string saying that it's said
stack).

Make the code that decodes the variable part of a DR packet look like
the code that decodes the variable part of most other packets.

For COTP CR packets, determine the class up front by checking whether
the length is > 2.  (At some point we might want to associate a class
indication with the COTP connection, if we see the connection setup,
and, if we have that indication, use it in preference to the
heuristics.)

Make the code to handle various length indicator values in the ATN case
more like the code in the non-ATN case.

Dissect the variable part of COTP ER packets.

Fix tpyos (TDPU->TPDU, tdpu->tpdu) and typpoes (accross->across).

Clean up white space.

svn path=/trunk/; revision=46060
2012-11-17 22:12:37 +00:00
Guy Harris 9e2c7a6aa9 Default to *not* decoding the ATN flavor of COTP, so that, for example,
we don't, by default, break the dissection of RDP (or anything else that
happens to run atop class 0 or 1).

svn path=/trunk/; revision=46056
2012-11-17 11:24:13 +00:00
Guy Harris 04709b632f Get rid of extra blank lines and trailing white space.
svn path=/trunk/; revision=46054
2012-11-17 10:25:03 +00:00
Guy Harris 1c872788d0 Clean up white space.
Add a comment noting that the value of the length indicator in a DT TPDU
is not as constrained as one might think.

svn path=/trunk/; revision=46053
2012-11-17 09:54:51 +00:00
Guy Harris 9225f22ec5 Get rid of /* FALLTHROUGH */ comments that don't refer to falling
through a clause in a switch statement to the following clause (that's
what /* FALLTHROUGH */ is for - it was originally a comment to tell lint
not to complain about the lack of a break statement).

Use guint8 rather than guchar for an 8-bit binary value.

Add a comment noting the weird stuff Microsoft does with RDP atop ISO
COTP atop TPKT.

svn path=/trunk/; revision=46052
2012-11-17 09:45:11 +00:00
Guy Harris cbd58e5115 Fix checksum handling (using val_to_str() on a Boolean is overkill, and
calc_checksum() doesn't return a Boolean, it returns a cksum_status_t,
which has more values than just "checksum OK" and "checksum not OK",
such as "not enough data available to check the checksum).

Fix typoes (Transport Protocol Data Unit is TPDU/tpdu, not TDPU/tdpu).

svn path=/trunk/; revision=46051
2012-11-17 09:37:04 +00:00
Anders Broman fcfbd9f21a Missed a ","
svn path=/trunk/; revision=46045
2012-11-16 15:44:31 +00:00
Anders Broman 74065f28e1 Fix:
Error: packet-ositp.c                     : {..., NULL} is required as the last XXX_string array entry: value_string tp_vpart_checksum_vals[]

svn path=/trunk/; revision=46044
2012-11-16 15:32:18 +00:00
Anders Broman c6cf5703f5 From guettler:
ATN decoding fixes for CLNP and COTP dissectors (configurable by option).

ATN decoding fixes for CLNP and COTP dissectors (configurable by option).

ATN specifics may be
selected/deseleted per CLNP/COTP dissector configuration (as requested).

CLNP dissector
1) configurable decoding of "ATN security label"

COTP dissector
1) configurable decoding of ATN TPDU's 
2) checksum calculation (none,OSI,ATN 16-bit, ATN 32-bit)
3) VP decoding for DR TPDU's

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

svn path=/trunk/; revision=46043
2012-11-16 14:18:27 +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
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
Jakub Zawadzki 5ad3e5331e MT: move global frame_end_routines to packet_info.
svn path=/trunk/; revision=44748
2012-09-03 12:00:40 +00:00
Bill Meier 638d74d43f Use val_to_str_const() where appropriate;
Also (for a few files):
- create/use some extended value strings;
- remove unneeded #include files;
- remove unneeded variable initialization;
- re-order fcns slightly so prefs_reg_handoff...() at end, etc

svn path=/trunk/; revision=44438
2012-08-10 22:55:02 +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 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 94f36ca4ff Use ENC_NA as encoding for proto_tree_add_item() calls which directly reference an hf item (in hf[] with types:
FT_NONE
   FT_BYTES
   FT_IPV6
   FT_IPXNET
   FT_OID

Note: Encoding field set to ENC_NA only if the field was previously TRUE|FALSE|ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN

svn path=/trunk/; revision=39260
2011-10-04 22:44:31 +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
Chris Maynard 0b1df697ea Multi-byte fields are big-endian, so fixed hf_cotp_vp_[src|dst]_tsap_bytes.
Added link to most up-to-date spec, relegating RFC905 to historic status.

svn path=/trunk/; revision=34778
2010-11-04 15:34:36 +00:00
Bill Meier 055dd62063 #include <string.h> not needed.
svn path=/trunk/; revision=32410
2010-04-06 21:14:01 +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 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
Anders Broman e8042d8eec From gonzalocas:
GSSE message dissector.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4370

svn path=/trunk/; revision=31442
2010-01-04 23:17:37 +00:00
Kovarththanan Rajaratnam 00810ff199 * Prefer col_append_str instead of col_append_fstr for constant strings
* Remove check_col guards

svn path=/trunk/; revision=30127
2009-09-24 20:21: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
Bill Meier 41a9e1c16f (Trivial) Fix two typos.
svn path=/trunk/; revision=29271
2009-08-03 14:17:31 +00:00
Gerald Combs e951661130 Remove some unused variable assignments.
svn path=/trunk/; revision=29243
2009-07-30 16:17:46 +00:00
Stig Bjørlykke 9391dce6b2 From Kovarththanan Rajaratnam via bug 3548:
More header_field_info cleanup.

svn path=/trunk/; revision=28772
2009-06-19 02:09:52 +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
Bill Meier d6a5a7c761 P64 changes: Fix some cases for which size_t is not required
svn path=/trunk/; revision=27822
2009-03-22 20:55:31 +00:00
Bill Meier 0e1613fbe5 Minor changes mostly related to proto_register & proto_reg_handoff;
- Use 'dissector standard template format'
- Remove 'once-only' ["if (!initialized) ..."] if not req'd
- Misc
Also: adjust some indentation

svn path=/trunk/; revision=27324
2009-01-28 21:52:57 +00:00
Bill Meier 19098177f3 Remove unneeded/incorrect properties
svn path=/trunk/; revision=27116
2008-12-26 17:02:08 +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 81633df2db Also use conversation index in the generated dst_ref.
svn path=/trunk/; revision=26357
2008-10-06 15:24:20 +00:00
Guy Harris 725f75caed Add registered fields for the transport class and option bits in
connection requests.

svn path=/trunk/; revision=25747
2008-07-15 18:47:11 +00:00
Guy Harris 85796b5506 Move the OSI transport protocol dissectors (ISO 8073/ITU-T X.224
connection-oriented transport protocol and ISO 8602/ITU-T X.234
connectionless transport protocol) out of packet-clnp.c into
packet-isotp.c.

svn path=/trunk/; revision=25746
2008-07-15 16:33:15 +00:00