Commit Graph

117 Commits

Author SHA1 Message Date
Alexis La Goutte 360f156220 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=40372
2012-01-04 17:34:36 +00:00
Alexis La Goutte 00dd4b455e From Michael Mann via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6697
Modbus object support for CIP dissector

Support for the Modbus object within the CIP dissector.  Essentially wraps the Modbus protocol within a CIP object.

Also included update to Modbus error code per 
http://www.wireshark.org/lists/wireshark-dev/201111/msg00187.html

svn path=/trunk/; revision=40371
2012-01-04 13:29:48 +00:00
Anders Broman e8111a59aa From Michael Mann:
ENIP dissector - improved I/O connection dissection through "better conversation"

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

svn path=/trunk/; revision=40059
2011-12-01 06:05:39 +00:00
Anders Broman 47bc2af5fd From Michael Mann:
Bugfixes for both Buildbot issues:
1. seg-fault with multiple_service_packet
2. infinite loop

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

svn path=/trunk/; revision=39843
2011-11-15 07:18:39 +00:00
Anders Broman b0ceb1cc77 From Roland Knall:
Avoiding the fuzz-test crash, but still allowing for large parts of CIP to be dissected.

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

svn path=/trunk/; revision=39718
2011-11-02 19:36:33 +00:00
Jeff Morriss cea1d2c231 Disable the CIP dissector until we can solve the fuzz failures.
svn path=/trunk/; revision=39698
2011-11-01 00:58:21 +00:00
Guy Harris f15386dd93 Don't set mr_mult_req_info->num_services *unless we're sure
mr_mult_req_info is non-null*!  This should fix bug 6514, and possibly a
bunch of other buildbot crashes.

svn path=/trunk/; revision=39667
2011-10-29 20:41:30 +00:00
Jeff Morriss 7b6f829483 Correct an off-by-one error introduced in r39626.
svn path=/trunk/; revision=39631
2011-10-27 14:39:12 +00:00
Jeff Morriss 01de3aea36 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6498 :
Initialize cip_req_info_t.ciaData, too.

svn path=/trunk/; revision=39630
2011-10-27 14:30:57 +00:00
Jeff Morriss 8d25051a28 Followup to r39626: It is also necessary to initialize the number of services
to 0 (in case we throw an exception decoding the first service).

svn path=/trunk/; revision=39629
2011-10-27 13:30:32 +00:00
Jeff Morriss 3c622f7b80 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6491 :
Don't set mr_mult_req_info->num_services until we're sure we've
initialized the full structure for that service.  Otherwise if we
happen to throw an exception before initializing the whole
structure, we'll core someplace (like dissect_cip_generic_service_rsp())
which expects all num_services entries to be fully initialized.


svn path=/trunk/; revision=39626
2011-10-27 01:48:39 +00:00
Bill Meier 269cc1920f Fix a [-Wunused-but-set-variable] compiler warning;
Also: Remove trailing whitespace from lines.

svn path=/trunk/; revision=39623
2011-10-26 23:16:04 +00:00
Michael Tüxen 406678d63b Declare unused parameters as such. Don't assign them to themselves.
svn path=/trunk/; revision=39620
2011-10-26 20:58:05 +00:00
Anders Broman 2d9d7449b2 Try to fix
cc1: warnings being treated as errors
packet-cip.c: In function 'dissect_cip_generic_service_req':
packet-cip.c:3281: warning: format not a string literal and no format arguments
packet-cip.c: In function 'dissect_cip_generic_service_rsp':
packet-cip.c:3631: warning: format not a string literal and no format arguments
packet-cip.c: In function 'dissect_cip_data':
packet-cip.c:4881: warning: comparison between signed and unsigned

svn path=/trunk/; revision=39599
2011-10-26 06:14:53 +00:00
Anders Broman 4cfaa22784 From Michael Mann:
Improved CIP and ENIP dissectors

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

svn path=/trunk/; revision=39595
2011-10-26 04:55:21 +00:00
Bill Meier d7a1840204 Replace use of tvb_get_ephemeral_faked_unicode() by use of tvb_get_ephemeral_unicode_string();
Fix encoding arg as needed.

svn path=/trunk/; revision=39530
2011-10-23 22:58:45 +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 293049dfba Do some conversions of proto_tree_add_item() 'encoding' arg.
(previously missed).

    57   FT_BOOLEAN:       FALSE-->ENC_BIG_ENDIAN
    31   FT_BOOLEAN:       TRUE-->ENC_LITTLE_ENDIAN

    10   FT_BYTES:         ENC_BIG_ENDIAN-->ENC_NA
     1   FT_BYTES:         ENC_LITTLE_ENDIAN-->ENC_NA
    21   FT_BYTES:         FALSE-->ENC_NA
     2   FT_BYTES:         TRUE-->ENC_NA

     2   FT_IPXNET:        ENC_BIG_ENDIAN-->ENC_NA

     6   FT_IPv6:          ENC_BIG_ENDIAN-->ENC_NA
     1   FT_IPv6:          FALSE-->ENC_NA

     6   FT_NONE:          ENC_BIG_ENDIAN-->ENC_NA
    19   FT_NONE:          FALSE-->ENC_NA
     3   FT_NONE:          TRUE-->ENC_NA

     1   FT_STRING:        ENC_BIG_ENDIAN-->ENC_ASCII|ENC_NA
     1   FT_STRING:        ENC_LITTLE_ENDIAN-->ENC_ASCII|ENC_NA
     5   FT_STRING:        FALSE-->ENC_ASCII|ENC_NA
     1   FT_STRING:        TRUE-->ENC_ASCII|ENC_NA

     4   FT_STRINGZ:       ENC_NA-->ENC_ASCII|ENC_NA
     8   FT_STRINGZ:       FALSE-->ENC_ASCII|ENC_NA

     1   FT_INT32:         FALSE-->ENC_BIG_ENDIAN
     1   FT_INT32:         TRUE-->ENC_LITTLE_ENDIAN

    11   FT_UINT8:         0-->ENC_BIG_ENDIAN
   111   FT_UINT8:         FALSE-->ENC_BIG_ENDIAN
    17   FT_UINT8:         TRUE-->ENC_LITTLE_ENDIAN
     1   FT_UINT16:        0-->ENC_BIG_ENDIAN
    68   FT_UINT16:        FALSE-->ENC_BIG_ENDIAN
    18   FT_UINT16:        TRUE-->ENC_LITTLE_ENDIAN
     4   FT_UINT24:        FALSE-->ENC_BIG_ENDIAN
    70   FT_UINT32:        FALSE-->ENC_BIG_ENDIAN
     1   FT_UINT32:        TRUE-->ENC_LITTLE_ENDIAN
     4   FT_UINT64:        FALSE-->ENC_BIG_ENDIAN
     1   FT_UINT64:        TRUE-->ENC_LITTLE_ENDIAN

     1   FT_UINT_STRING:   FALSE-->ENC_ASCII|ENC_BIG_ENDIAN


svn path=/trunk/; revision=39442
2011-10-16 23:38:49 +00:00
Bill Meier 126aa85393 Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, FT_STRINGZ, FT_UINT_STRING as follows:
1. If there's no character encoding (ENC_ASCII, ...) specified
    then use ENC_ASCII.
 2. For all but FT_UINT_STRING, always use ENC_NA
    (replacing any existing True/1/FALSE/0
    /ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN).



svn path=/trunk/; revision=39426
2011-10-15 18:46:26 +00:00
Bill Meier a2e8e1cdcd From Benjamin Stocks (with some work by Michael Mann): "CIP Motion" dissector;
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5929

From me:
packet-cipmotion.c:
  FT_BOOLEAN fields with bitmasks need a bit-fieldwidth in the hf[] entry 'display' field;
  Define attribute_size as guint32 since it has to store guint8*guint16;
  Use ENC_NA as encoding arg in proto_tree_add_item() for FT_BYTES field types;
  Remove trailing whitespace from lines;
  Other minor cleanup and reformatting.

packet-enip.c:
  Use ENC_NA as encoding arg in proto_tree_add_item() for FT_BYTES field types;

svn path=/trunk/; revision=39396
2011-10-13 00:00:52 +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
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
Guy Harris 1a267e4d0e Back out improvements - it's still getting a lot of "used uninitialized"
errors, so I'll reopen the bug and log all the warnings that have been
produced, and mark the patch as "rejected".

svn path=/trunk/; revision=39230
2011-10-02 18:47:00 +00:00
Guy Harris a1b6a2e95f "seg_size" isn't set here, and the items don't appear to have a variable
segment size, they just appear to be 2 bytes long.

svn path=/trunk/; revision=39229
2011-10-02 18:31:33 +00:00
Anders Broman 362d86a22f Add comments.
svn path=/trunk/; revision=39227
2011-10-02 17:27:05 +00:00
Michael Tüxen eb4f10eedb Fix warnings.
svn path=/trunk/; revision=39226
2011-10-02 17:18:23 +00:00
Anders Broman 8bb88d9efc From Michael Mann :
General improvements to CIP and ENIP dissectors. 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6416

svn path=/trunk/; revision=39222
2011-10-02 16:35:10 +00:00
Anders Broman fc447d3377 Get rid of check_col, while at it set ENC.
svn path=/trunk/; revision=39147
2011-09-26 09:01:17 +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
Chris Maynard a4d1ae6547 Don't assign return value of proto_tree_add_text() to rrsc_item if it's not going to be used. Fixes Coverity CID 863.
svn path=/trunk/; revision=39054
2011-09-19 20:28:10 +00:00
Jeff Morriss b2120849b1 From Michael Mann via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5749 :
Added support for the following services of the Connection Manager object:
LargeForwardOpen
GetConnectionOwner

Added support for the following services of the Connection Configuration
Object:
GetAttributeAll
SetAttributeAll

From me:
Replace tabs with spaces; adjust modelines for 8-space tabs instead of 3.

svn path=/trunk/; revision=37404
2011-05-26 02:20:23 +00:00
Bill Meier f396f68124 Remove unneeded #include <stdlib.h>;
Use consistent indentation;
Add editor modelines;
Use #if 0/#endif to comment out code instead of /* */.

svn path=/trunk/; revision=36913
2011-04-27 19:24:32 +00:00
Bill Meier c588ff282a From Yaniv Kaul:
Some fixes for 'set but not used' errors that GCC 4.6 emits.

svn path=/trunk/; revision=36911
2011-04-27 18:09:39 +00:00
Gerald Combs dae5200002 Fix some Visual C++ analysis warnings.
svn path=/trunk/; revision=35988
2011-02-17 23:00:34 +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
Stig Bjørlykke 54671a1ebe Removed unused entries.
svn path=/trunk/; revision=34546
2010-10-17 18:16:44 +00:00
Bill Meier e7568712ef Define some fcns & vars as static;
Minor whitespace and comments cleanup.

svn path=/trunk/; revision=34477
2010-10-11 19:00:55 +00:00
Bill Meier 69df32fb11 #include <string.h> not needed.
svn path=/trunk/; revision=32411
2010-04-06 22:09:47 +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 c198fc6546 From Didier Gautheron via bug 4419:
se_alloc and ep_alloc never return NULL and se_alloc0 already initialized
data with 0.

svn path=/trunk/; revision=31654
2010-01-25 11:47:39 +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
Jaap Keuter f4b9554a27 From Julian Fielding:
Function dissect_epath() expects path_length in bytes, but the value from the 
packet is in words, so there's lots of *2 and /2 in those parts of the code.
In this invocation dissect_epath( tvbIOI, pi, 0, preq_info->IOILen, TRUE );
preq_info->IOILen is in words.

In six places proto_tree_add_item is used with tvb NULL and size 0 to add an
FT_UINT8/16/32 item. I think it should be replaced with proto_tree_add_uint().

svn path=/trunk/; revision=30061
2009-09-22 05:49:15 +00:00
Kovarththanan Rajaratnam 0a5b014cec Don't guard col_clear with col_check
svn path=/trunk/; revision=29344
2009-08-09 07:36:13 +00:00
Kovarththanan Rajaratnam 24ca3c44c9 Don't guard col_set_str (COL_PROTOCOL) with col_check
svn path=/trunk/; revision=29341
2009-08-09 06:47:24 +00:00
Stig Bjørlykke da47d6113a From Joakim Wiberg via bug 3670:
This patch correctes serveral minor things.

1. Adds decoding of generic services to classes that have a separate dissect
   function.
2. Adds new error codes.
3. Adds new CIP objects.
4. Extends the VendorID list.

svn path=/trunk/; revision=28951
2009-07-06 13:59:09 +00:00
Stig Bjørlykke 7f1f48a8b2 From Joakim Wiberg via bug 3103:
Various improvements to the CIP and ENIP dissectors.

From me:
Updated to latest trunk changes.

svn path=/trunk/; revision=28844
2009-06-26 02:38:23 +00:00
Stig Bjørlykke ff7ff86249 More hf_register_info related cleanup.
svn path=/trunk/; revision=28834
2009-06-24 03:03:25 +00:00
Stig Bjørlykke 1733596a6f Revert changes committed by an accident.
Will be committed again later.

svn path=/trunk/; revision=28779
2009-06-19 06:15:52 +00:00
Stig Bjørlykke b3e10e559a Moved setting of length2 to make it always set.
svn path=/trunk/; revision=28777
2009-06-19 05:45:40 +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 c544c20956 Fix various typos and spelling errors (mostly in text strings)
svn path=/trunk/; revision=27050
2008-12-18 19:08:49 +00:00
Bill Meier a8f30cbca1 Fix some typos and spelling (mostly in text strings)
svn path=/trunk/; revision=27037
2008-12-17 17:23:37 +00:00
Jaap Keuter ddce920fd8 Let the dissectors fill the Protocol and Info columns by calling the even when tree == NULL.
svn path=/trunk/; revision=26531
2008-10-23 21:01:04 +00:00
Bill Meier b52d95d591 #include <emem.h> not req'd
svn path=/trunk/; revision=26091
2008-08-26 01:28:50 +00:00
Bill Meier aac2a36133 #include <prefs.h> not req'd; Fix indentation to be conistent
svn path=/trunk/; revision=26086
2008-08-25 20:41:05 +00:00
Jaap Keuter f9792481d2 Replace custom data presentation with native one.
svn path=/trunk/; revision=25965
2008-08-08 21:39:25 +00:00
Jaap Keuter c3914ce6d5 From Ryan Wamsley:
For the EtherNet/IP protocol (ENIP), display text for Additional Status in the
Forward Open Response packet.

svn path=/trunk/; revision=25865
2008-07-30 06:07:47 +00:00
Bill Meier 931cc922a1 Fix some of the Errors/warnings detected by checkapi.
svn path=/trunk/; revision=25305
2008-05-15 01:44:53 +00:00
Gerald Combs b7d8f269b2 Make sure we don't try to allocate a negative number.
svn path=/trunk/; revision=23820
2007-12-10 03:12:11 +00:00
Anders Broman 1950ffc214 Apply the small performance enhancment patches for:
- if offset is 0, tvb_length is the same as tvb_length_remaining, just faster.
Replace 
- col_append_fstr() with faster  col_append_str() 
- col_add_str() with col_set_str()
when it's safe

svn path=/trunk/; revision=23252
2007-10-23 05:50:00 +00:00
Graham Bloice 0e5819e547 Permit decoding of individual service errors + removal of a few lines consisting of just whitespace
svn path=/trunk/; revision=22599
2007-08-23 09:26:01 +00:00
Bill Meier 211cdda386 From Ryan Wamsley: Add Connection Configuration Object support to EtherNet/IP dissector
svn path=/trunk/; revision=20897
2007-02-22 03:21:26 +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
Ronnie Sahlberg f6d36d20d0 ememify cip
svn path=/trunk/; revision=15353
2005-08-14 05:54:54 +00:00
Ulf Lamping 0dc9fb3d4a various code cleanup:
-use g_snprintf instead of sprintf and snprintf
-use g_strdup_printf where appropriate
-remove #include "snprintf.h" (as only g_snprintf should be used)
-replace some more alloc/realloc/calloc/free with their glib pendants

svn path=/trunk/; revision=15264
2005-08-08 18:50:39 +00:00
Guy Harris 9cb86fda9c Squelch various signed vs. unsigned warnings by:
making pointers to byte data be "guint8 *" rather than "char *",
	and making buffers holding byte data arrays of "guint8" rather
	than arrays of "char";

	making pointers to text strings "char *" rather than "guchar *";

	appropriately casting pointers (cast to "guint8 *" when passing
	to routines expecting "guint8 *" or when assigning to "guint8
	*");

	making port-number preferences "guint";

	making enum preferences "gint";

	making hf_ variables "int".

Clean up white space.

svn path=/trunk/; revision=14884
2005-07-09 00:53:17 +00:00
Guy Harris 12d310a458 From Magnus Hansson:
move CIP protocol to own dissector
	clean up code and fix variable names
	add more info to info column
	fixed decoding of embedded messages in Unconnected send and
	    Multiple Service packets
	add more info to path decoding
	add more filter options/clean up
	complete CIP vendor codes

svn path=/trunk/; revision=12070
2004-09-23 17:34:35 +00:00