Commit Graph

110 Commits

Author SHA1 Message Date
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
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
Pascal Quantin 074349264e Convert some dissectors to wmem (leaving uat-like memory with emem for now)
svn path=/trunk/; revision=52031
2013-09-14 10:53:29 +00:00
Anders Broman dd12400161 From Chris Bontje:
Changes include:
- Detect previously-unknown object types.  No dissection is attempted of response messages, but at least the types are documented and labelled.  As Graham notes, if some examples are provided we can attempt a little more here.
- Change up info_column object label handling to add some of the new objects.  Also added in a few that would be present in 'write' messages.
- Add expert info field for abnormal IIN bits.  This will help me in my job of detecting unknown objects and unsupported function codes and will easily flag to the user that 'something is up' due to the color changes.
- Only detect Application Layer if we are on the Final Transport Layer frame.

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

svn path=/trunk/; revision=51768
2013-09-05 05:34:40 +00:00
Pascal Quantin b46f9bebe2 Change some dissectors to use pinfo memory pool instead of malloc if it can trigger an exception between between buffer allocation and tvb_set_free_cb call
svn path=/trunk/; revision=51427
2013-08-19 14:55:41 +00:00
Graham Bloice 243a76b04f Improved info column with multiple pdu's in a frame
svn path=/trunk/; revision=50966
2013-07-28 09:57:52 +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
Alexis La Goutte dc00c8fc94 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=50355
2013-07-03 16:44:08 +00:00
Michael Mann 2d37ec3cb0 Batch of filterable expert infos.
svn path=/trunk/; revision=49853
2013-06-09 03:28:05 +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 263a9d0683 [-Wmissing-prototypes]
Use explicit casts.

svn path=/trunk/; revision=48341
2013-03-16 16:25:41 +00:00
Guy Harris bf4e129f5f Get rid of unused string to squelch warning.
svn path=/trunk/; revision=47661
2013-02-14 22:27:04 +00:00
Pascal Quantin f244067727 From Chris Bontje via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8333 :
Corrections to Recent DNP3 Control Code Changes in Bug ID 7865

svn path=/trunk/; revision=47660
2013-02-14 21:57:30 +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 3a40f4d2a0 Fix [-Wuninitialized] warning.
svn path=/trunk/; revision=46237
2012-11-27 21:54:10 +00:00
Bill Meier 3617c83076 General cleanup:
- create/use extended variable string;
- #if 0 unused value_string arrays (instead of marking with _U_);
- "localize" some variable definitions;
- remove some uneeded variable initializers;
- reformat hf[] entries;
- do some whitespace and formatting changes to use a consistent style.


svn path=/trunk/; revision=46236
2012-11-27 21:48:15 +00:00
Anders Broman c1e5be52ad From Chris Bontje:
DNP3 - Incorrect Information Column Display for "Read" Function Code.

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

svn path=/trunk/; revision=46039
2012-11-16 11:29:05 +00:00
Anders Broman be96ac69d7 The heuristic is to weak, add a preference if heuristics shoulld be used or not and default it to not used.
svn path=/trunk/; revision=45847
2012-10-31 12:47:24 +00:00
Michael Mann 0d5d45cf9f Enhancements to DNP3.0 Control Code Dissection (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7865)
minor updates to checked in patch (from rev 45583)

svn path=/trunk/; revision=45584
2012-10-16 14:21:05 +00:00
Anders Broman 3134b7d7f8 From Benjamin Stocks:
Enhancements to DNP3.0 Control Code Dissection.

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

svn path=/trunk/; revision=45583
2012-10-16 14:15:11 +00:00
Michael Mann 97c808c75c replaced decode_boolean_bitfield calls with itemized filters
svn path=/trunk/; revision=45152
2012-09-26 18:10:29 +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 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
Graham Bloice 5a93983e41 Various DNP3 cleanups and fixes:
1.  Fix time displayed in object values when using relative time from a CTO.
2.  Fix some text for IIN flags regarding Outputs in local control
3.  Try out DNP3 as a heuristic dissector.

svn path=/trunk/; revision=44486
2012-08-14 11:52:46 +00:00
Guy Harris 9667a4703b Fix non-proto_tree_add_item() calls passing an ENC_ value as the last
argument.

svn path=/trunk/; revision=43804
2012-07-18 23:27:37 +00:00
Pascal Quantin 574f57d5ba From Chris Bontje via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7491 :
DNP3 protocol dissector does not fully decode application layer object 50 variation 3

svn path=/trunk/; revision=43772
2012-07-17 19:54:35 +00:00
Jakub Zawadzki b18e880040 Update FSF address - part II.
svn path=/trunk/; revision=43538
2012-06-28 23:18:38 +00:00
Alexis La Goutte 1f0cbf3baa Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=42362
2012-04-30 21:15:17 +00:00
Graham Bloice 19895f31b5 Fixed wrong registration call causing compilation warnings.
svn path=/trunk/; revision=40129
2011-12-09 13:31:19 +00:00
Graham Bloice 9770256235 Added dissector registration for udp messages to permit use with a USER_DLT as per request from Chris Bontje
svn path=/trunk/; revision=40128
2011-12-09 13:08:50 +00:00
Graham Bloice 62ffea3b32 Added definition and handling for IIN Function Code Not Implemented bit.
svn path=/trunk/; revision=40127
2011-12-09 12:42:31 +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
Anders Broman 03a6c7fe7d Get rid of check_col() and use ENC.
svn path=/trunk/; revision=39151
2011-09-26 17:18:10 +00:00
Bill Meier e6bd9d1a8c Whitespace cleanup:
Use consistent indentation;
 Convert "4 space tabs" to spaces;
 Remove trailing whitespace.

svn path=/trunk/; revision=39082
2011-09-21 18:55:03 +00:00
Bill Meier 781129806f Fix ex "modeline" so it works;
See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5748

svn path=/trunk/; revision=39081
2011-09-21 17:49:11 +00:00
Graham Bloice 13743add73 Added code to distinguish conversations between different RTUs that happen to use the same address\port pair.
Based on patch supplied by Kelvin Proctor.

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

svn path=/trunk/; revision=37584
2011-06-06 22:32:37 +00:00
Bill Meier 4f7a9174fe Fix Bug 5920: "DNP3 dissector incorrect constants AL_OBJ_FCTR_16NF _FDCTR_32NF _FDCTR_16NF"
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5920

svn path=/trunk/; revision=37135
2011-05-13 22:01:22 +00:00
Chris Maynard 8e99ec73a2 From Yaniv Kaul via bug 5858: Fix some "set but not used" warnings. I
committed a variation of his patch that deleted unused variables rather than
#if 0'ing them out, and I also kept dissect_dnp3_al()'s return values, even if
it's not currently being checked, just in case the commented code is ever
uncommented and the return value ends up being checked later on.  Lastly, I
also added what appeared to be some missing DNP3_AL_UNS's.

svn path=/trunk/; revision=37100
2011-05-12 20:32:28 +00:00
Stig Bjørlykke 2cc2403a33 Initialize al_cto before usage.
Coverity 808.

svn path=/trunk/; revision=36260
2011-03-22 18:42:02 +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 b589c42fa3 Replace some duplicate blurbs with NULL
svn path=/trunk/; revision=35541
2011-01-15 18:18:13 +00:00
Graham Bloice 8e86e3dbbf Removed redundant comparison that caused compilation failure on OSX
svn path=/trunk/; revision=35536
2011-01-14 14:39:40 +00:00
Graham Bloice 1be12860e6 Updated dissector:
Additional function codes: Disable unsolicited messages, Open\Close\Delete file
Additional data objects: Analog output events, File objects and Octet string events.
Improved Info column display for reassembled fragments.
Changed all event timestamps to be UTC as per protocol spec.

svn path=/trunk/; revision=35533
2011-01-14 12:15:10 +00:00
Jaap Keuter 720f40cd30 From Rob Casey:
Patch to add support for DNP3 protocol Binary Output Change object type.

svn path=/trunk/; revision=35227
2010-12-20 07:57:52 +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 ef35235e5a From Rob Casey:
Addition of support for DNP3 Analog Input Deadband object type
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5471

svn path=/trunk/; revision=35171
2010-12-10 15:32:47 +00:00
Anders Broman e1b1ef192c "Fill" value_strings.
svn path=/trunk/; revision=34888
2010-11-15 21:32:27 +00:00
Bill Meier c17c9fff87 Use value_string_ext fcns to access certain value_string arrays;
Sort a few value_string arrays to be in ascending order by value;
Do minor reformatting and whitespace cleanup.

svn path=/trunk/; revision=34813
2010-11-08 21:59:39 +00:00