Commit Graph

57 Commits

Author SHA1 Message Date
Michalis Kapsalakis e6a350552a Fix unreached registers and typos
This commit fixes the following

  -- changes the order of registers in ecat_esc_register array
     because they cannot be reached by the dissect_esc_register function.

  -- typos in registers' information

Change-Id: Ia73823412abba26377f57fa59ad637879b5b9da1
Reviewed-on: https://code.wireshark.org/review/24949
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-12-22 21:58:29 +00:00
Alexis La Goutte 4f39ed9713 ethercat (plugins): fix spelling typo found by lintian
Change-Id: I85a86953c89979e975e178fed1ae13dddab304d0
Reviewed-on: https://code.wireshark.org/review/18501
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-27 07:09:35 +00:00
Alexis La Goutte 9dd085d3d6 ethercat: Fix Control flow issues MISSING_BREAK (CID 1357204)
Change-Id: I7efc9b4b44590e3408ba058d7aa02f843cbfeca4
Reviewed-on: https://code.wireshark.org/review/14642
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-03-26 22:19:10 +00:00
Stig Bjørlykke 07fb53b063 ethercat: Use tfs_ecat_fmmu_typeread
Change-Id: I928fc0eeeac99156fb50a97b5497913ca6e67350
Reviewed-on: https://code.wireshark.org/review/14610
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-03-24 11:02:30 +00:00
Stig Bjørlykke 781291d089 Revert "Fix compile error by removing an unused variable: git/plugins/ethercat/packet-ethercat-datagram.c:513:32: error: unused variable 'tfs_ecat_fmmu_typeread' [-Werror,-Wunused-const-variable] static const true_false_string tfs_ecat_fmmu_typeread = "
This reverts commit bc3bd625e1.

Change-Id: Iaf1e6fe51c20811761d18e86dc8b2c8402a2c89a
Reviewed-on: https://code.wireshark.org/review/14609
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-03-24 11:01:25 +00:00
Joerg Mayer bc3bd625e1 Fix compile error by removing an unused variable:
git/plugins/ethercat/packet-ethercat-datagram.c:513:32: error: unused variable
      'tfs_ecat_fmmu_typeread' [-Werror,-Wunused-const-variable]
static const true_false_string tfs_ecat_fmmu_typeread =
                               ^
1 error generated.

Change-Id: I7b215b9f2dafa04c6aae4a22fb6ae256f65e8585
Reviewed-on: https://code.wireshark.org/review/14597
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2016-03-23 19:50:19 +00:00
richardk 6a3a85f318 Added dissection of most of the ESC( EtherCAT slave controller) registers.
Change-Id: Idee70e6eaa926efb74cd4ff0bb529a601edbb67e
Reviewed-on: https://code.wireshark.org/review/13729
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-23 11:44:48 +00:00
Michael Mann 9bcac48403 Manually add protocol dependencies derived from find_dissector.
Started by grepping call_dissector_with_data, call_dissector_only and call_dissector and traced the handles passed into them to a find_dissector within the dissector.  Then replaced find_dissector with find_dissector_add_dependency and added the protocol id from the dissector.
"data" dissector was not considered to be a dependency.

Change-Id: I15d0d77301306587ef8e7af5876e74231816890d
Reviewed-on: https://code.wireshark.org/review/14509
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-20 12:48:48 +00:00
Michael Mann e37275bfde Associate dissector tables and heuristic subdissector lists with a protocol.
This will make it easier to determine protocol dependencies.

Some LLC OUI dissector tables didn't have an associated protocol, so they were left without one (-1 used)

Change-Id: I6339f16476510ef3f393d6fb5d8946419bfb4b7d
Reviewed-on: https://code.wireshark.org/review/14446
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-17 00:05:17 +00:00
richardk 0421e78988 Fixed bug when the actual remaining command data is less than the size
specified in the EtherCAT mailbox header.

Change-Id: I661c62af915b9455da1df49f5746953d41dc527a
Reviewed-on: https://code.wireshark.org/review/13595
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-03 14:51:19 +00:00
Michael Mann 210dc9b301 new_create_dissector_handle -> create_dissector_handle for plugins.
Change-Id: I0d485b1337c669291ad58b6c096657ce2db353c8
Reviewed-on: https://code.wireshark.org/review/12516
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-11 03:42:52 +00:00
Michael Mann 3ca5e3ec7d create_dissector_handle -> new_create_dissector_handle for plugins
Was able to actually convert all calls to "new style"

Change-Id: If9916a4762d410f2ad12aa5431174d7462dc7ac4
Reviewed-on: https://code.wireshark.org/review/11941
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-18 17:44:49 +00:00
Pascal Quantin 1ec868eddd Fix a few issues reported by PVS-Studio
See http://www.viva64.com/en/b/0328/ for details

Change-Id: Ic9ddfd690b49401c96cb8a4a277c671f9824be31
Reviewed-on: https://code.wireshark.org/review/8775
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-05 21:15:37 +00:00
Evan Huus c1e6a19f27 ethercat: remove deprecated tvb_length API
Change-Id: I76916948fc06c5a4df5a1188fde164d516b4105d
Reviewed-on: https://code.wireshark.org/review/7938
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-04-06 17:17:47 +00:00
Bill Meier 998a84774b plugins: Cleanup #includes
Change-Id: Ic839f2995532d68308f8b5908c185acc7acaaa9c
Mostly: remove '#include <glib/glib.h>' and certain
         other #includes already included in packet.h
Reviewed-on: https://code.wireshark.org/review/5971
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-22 05:00:20 +00:00
Guy Harris 2b006ad30e Have a heur_dissector_list_t be an opaque handle.
This allows dissector lists to be looked up by name, so they can be
shared by multiple dissectors.

(This means that there's no "udplite" heuristic dissector list, but
there shouldn't be one - protocols can run atop UDP or UDPLite equally
well, and they share a port namespace and uint dissector table, so they
should share a heuristic dissector table as well.)

Change-Id: Ifb2d2c294938c06d348a159adea7a57db8d770a7
Reviewed-on: https://code.wireshark.org/review/5936
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-21 04:14:24 +00:00
Bill Meier 0111e46193 plugins: Add editor modelines; Adjust whitespace as needed.
Change-Id: I36124f6021d46a228721bdc976f6b9fef1c8c088
Reviewed-on: https://code.wireshark.org/review/4488
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-06 01:42:32 +00:00
Michael Mann e6c87fe6b1 convert to proto_tree_add_subtree[_format] for plugin dissectors
Change-Id: I13924c5a2f056688a42cdee25654d82c056b5f97
Reviewed-on: https://code.wireshark.org/review/2974
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-10 01:51:21 +00:00
Michael Mann 73217d9f3f tvb_new_subset -> tvb_new_subset_length when length parameters are equal.
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is.

Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d
Reviewed-on: https://code.wireshark.org/review/1999
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-07 15:41:07 +00:00
AndersBroman 2cfda31ff0 Change the signature of dissector_try_heuristic() to return hdtbl_entry
which can be used to call the found heuristic dissector on the next pass.

Introduce call_heur_dissector_direct() to be used to call a heuristic
dissector which accepted the frame on the first pass.

Change-Id: I524edd717b7d92b510bd60acfeea686d5f2b4582
Reviewed-on: https://code.wireshark.org/review/1697
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-21 20:17:29 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Anders Broman 864431b900 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=53425
2013-11-19 06:06:38 +00:00
Evan Huus 37600a157b Rename value string (and similar) functions to use a consistent pattern. This
was done using textual search+replace, not anything syntax-aware, so presumably
it got most comments as well (except where there were typos).

Use a consistent coding style, and make proper use of the WS_DLL_* defines.

Group the functions appropriately in the header.

I ended up getting rid of most of the explanatory comments since many of them
duplicated what was in the value_string.c file (and were out of sync with the
recent updates I made to those in r48633). Presumably most of the comments
should be in the .h file not the .c file, but there's enough churn ahead that
it's not worth fixing yet.

Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8467

svn path=/trunk/; revision=48634
2013-03-29 00:26:23 +00:00
Bill Meier f784806968 Comment out numerous unused hf_.... instances found by checkhf.
svn path=/trunk/; revision=47617
2013-02-10 20:52:21 +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
Jeff Morriss 3551a86c36 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45015
2012-09-20 01:29:52 +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 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
Guy Harris 774028e5fc Get rid of remaining Booleans-as-encoding-arguments in
proto_tree_add_item() calls.

svn path=/trunk/; revision=42584
2012-05-11 18:57:51 +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 cca6984ab9 Do some more conversions of proto_tree_add_item() 'encoding' arg
(previously missed).

svn path=/trunk/; revision=39450
2011-10-18 00:17:48 +00:00
Bill Meier 9eb54292d3 Convert 'encoding' parameter of certain proto_tree_add_item() calls in plugins/*:
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 an earlier SVN)

svn path=/trunk/; revision=39329
2011-10-10 00:53:55 +00:00
Bill Meier 02065b0981 Convert 'encoding' parameter of certain proto_tree_add_item() calls in plugin 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=39292
2011-10-06 14:46:34 +00:00
Bill Meier ef8009abe3 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|1|0|ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN

svn path=/trunk/; revision=39262
2011-10-05 01:00:06 +00:00
Bill Meier 78c5c20d08 Don't assign to a proto_item* if the value won't be used: Coverity 1155-1156;
Also:
  - Fix a few cases of SET_HIDDEN on the wrong item. (The SET_HIDDEN was being
    done on an already hidden item).
  - Minor indentation cleanup;

svn path=/trunk/; revision=36315
2011-03-24 21:19:39 +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 7cfa27b04b Get rid of a bunch of check_col().
svn path=/trunk/; revision=32388
2010-04-05 20:04:52 +00:00
Gerasimos Dimitriadis c840cdd5a0 Remove the address operator from value_string arrays fed to VALS()
svn path=/trunk/; revision=30995
2009-11-17 18:35:27 +00:00
Bill Meier 6f87844d0a (Minor) Remove unneeded #includes.
svn path=/trunk/; revision=29492
2009-08-21 14:36:27 +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 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 09218f7338 From Richard Kummel:
- New dissector for EtherCAT Switch Link Header added to EtherCAT plugin
- Changed filtering of EtherCAT commands to the abbreviated form:
  e.g. ecat.cmd = APWR

From me:
- Mark unused variables
- Fixed a string warning
- Do not initialize a static struct
- Use tfs_yes_no
- Reorder files in Makefile

svn path=/trunk/; revision=28976
2009-07-07 11:13:22 +00:00
Stig Bjørlykke 2bba6be84f From Kovarththanan Rajaratnam via bug 3548:
Cleanup header_field_info in plugins.

svn path=/trunk/; revision=28771
2009-06-18 23:22:10 +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
Bill Meier 05c1929f1d proto_register/proto_reg_handoff; Various small cleanup and bug-fixing
remove unnecessary #include prefs.f and emem.h in a few cases...

svn path=/trunk/; revision=26554
2008-10-25 20:24:31 +00:00
Bill Meier a3a9ff5a2b #include <prefs.h> not required
svn path=/trunk/; revision=26103
2008-08-29 01:40:32 +00:00
Sake Blok 53bee63aa1 Oops... missed one ;
svn path=/trunk/; revision=25740
2008-07-14 21:02:30 +00:00
Sake Blok 03e0f71e8f From Richard Kuemmel (bug 2668):
Removed the line 
tvb_ensure_bytes_exist(tvb, offset, 44);
from  again. 
This is not correct, because the frame might have been captured before the
os added the padding bytes. E.g. in Windows the frames are captured on the
protocol layer. When another protocol driver sends a frame this frame does 
not include the padding bytes.  

Also the dataLength variable in case of bMox==TRUE  was not calculated
correctly.


svn path=/trunk/; revision=25738
2008-07-14 19:56:37 +00:00
Stig Bjørlykke d1208e55e1 Initialize aitem.
svn path=/trunk/; revision=25302
2008-05-14 11:02:39 +00:00
Tomas Kukosa 19c327d160 From Anders Broman:
Patches for broken build

svn path=/trunk/; revision=25298
2008-05-14 10:21:41 +00:00