Commit Graph

67 Commits

Author SHA1 Message Date
Michael Mann f7987091ba convert to proto_tree_add_subtree[_format]
Change-Id: I525ac2aae2bdbfd5f3a2f3b35f1bf10dde053f66
Reviewed-on: https://code.wireshark.org/review/2667
Tested-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-26 11:41:10 +00:00
AndersBroman c44c15363f Try to please the OSX build bot
Change-Id: I4c7d5c6b91df2baae74f6970d0e333346be47238
Reviewed-on: https://code.wireshark.org/review/1944
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-04 07:27:16 +00:00
Roland Knall f0cf649b32 EPL: Reassemble the splitted payload
The data that is sent when downloading or uploading from a server is
  sent in segments to the client.To clearly display all the segments
  belonging together the splitted payload needs to be reassembled.

  The behaviour is described in the powerlink specification 301 v1.2.0
  chapter 6.3.2.4.1.1 Download Protocol and chapter 6.3.2.4.2 Upload
  Protocol. The payload of the download/upload is now reassembled.

Signed-off-by: Lukas Emersberger <lukas.emersberger@gmail.com>
Change-Id: I17c30f15e75da47bcaba8f1fda1e412849ec268c
Reviewed-on: https://code.wireshark.org/review/1120
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-04 06:14:44 +00:00
Lukas Emersberger 75531b6a40 EPL: Duplicated frames
The MN interprets the CMD layer data only if the CN increments
  the Send-Sequence-Counter => new data. The MN interprets the
  data only once, if the same frame is sent again the MN ignores
  the data.

  The behaviour is described in the powerlink specification 301 v1.2.0
  chapter 6.3.2.3.2.3 Error: Duplication of Frame
  Frames which duplicate previous sent data are now marked as
  duplicated frames.

Signed-off-by: Lukas Emersberger <lukas.emersberger@gmail.com>
Change-Id: I9ef24b52712bfd3c735856b0cd5747c47aeef72a
Reviewed-on: https://code.wireshark.org/review/992
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-30 13:16:46 +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
AndersBroman c68769765c Fix no previous prototype warnings.
Change-Id: I859597ebc957a58f659800ef63318f94e80feabf
Reviewed-on: https://code.wireshark.org/review/1104
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-14 12:50:31 +00:00
Guy Harris 172f5cd280 Sort the values in value_strings that we'll treat as extended.
This squelches a run-time warning.

Change-Id: I5b147530b7f9255c3564fe24b56e0ea3eab45852
Reviewed-on: https://code.wireshark.org/review/995
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-07 23:07:35 +00:00
Alexis La Goutte 49be990fd3 Make Mac OS X buildbot happy (fix index shadow variable)
packet-epl.c:2248: warning: declaration of 'index' shadows a global declaration
packet-epl.c: In function 'dissect_epl_sdo_command_write_multiple_by_index':
packet-epl.c:2380: warning: declaration of 'index' shadows a global declaration
packet-epl.c: In function 'dissect_epl_sdo_command_read_by_index':
packet-epl.c:2489: warning: declaration of 'index' shadows a global declaration

Change-Id: Ib1a1d1d2aa596df558162839e7594b7fd12559a3
Reviewed-on: https://code.wireshark.org/review/765
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-21 15:31:08 +00:00
Lukas Emersberger e0556fa47f EPL: Enable PLK to display OD entries
Each package is dissected using a reference to object indeces, so
  that in the view of the dissector output, a clear indication
  to what the index means and what the subindices mean is given.
  Additional special entries (mappings, timestamps) have their own hf
  fields, and can be searched for via display filter.

Signed-off-by: Lukas Emersberger <lukas.emersberger@gmail.com>
Change-Id: I928c11a9f4a5b762c8947713a0f70e03bd711158
Reviewed-on: https://code.wireshark.org/review/730
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Lukas Emersberger <lukas.emersberger@br-automation.co.at>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-21 14:39:31 +00:00
Roland Knall 0940595a98 openSAFETY, EPL: Fix heuristic for false-positives
- Adding a typedefinition which can be deactivated, so
   that certain types of frames are only detected in their
   respective transport protocols
 - Rename bytes array as it is a key-word for some IDEs and
   hinders syntax checking
 - Add node info to the time request from/by fields
 - EPL: add message type to heuristic dissection call

Change-Id: Ia572bb68fc1d24d70e72b77867f0dad323b055b9
Reviewed-on: https://code.wireshark.org/review/750
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-21 05:17:05 +00:00
Lukas Emersberger c45a15f211 EPL: Support SyncReq and SyncResp Frames
- For PollResponse-Chaining SyncReq and SyncResp frames were introduced.
    Those frame-types are not recognized by Wireshark yet.

  - Currently only the FeatureFlags 0-13 where interpreted by Wireshark.
    Flags 14-15 and all extended flags where missing.

    14 = SDO Read/Write All by Index
    15 = SDO Read/Write Multiple Parameter by Index
    16 = Multiple-ASend Support (TRUE = Device supports Multiple-ASend; FALSE = Device doesn’t support Multiple-ASend)
    17 = Ring Redundancy (TRUE = MN supports ring redundancy; FALSE = MN does not support ring redundancy)
    18 = PResChaining (TRUE = Device supports PResChaining; FALSE = Device does not support PResChaining)
    19 = Multiple PReq/PRes (TRUE = Device supports Multiple PReq/PRes; FALSE = Device does not support Multiple PReq/PRes)
    20 = Dynamic Node Allocation (TRUE = Device supports DNA; FALSE = Device does not support DNA)

Signed-off-by: Lukas Emersberger <lukas.emersberger@gmail.com>
Change-Id: I9ac19f8b71b1be1094f410141c0f806996b1cb25
Reviewed-on: https://code.wireshark.org/review/589
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-11 09:24:15 +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
Roland Knall 95190e4bd6 EPL + openSAFETY: Better handling of guint in EPL
This is a permanent solution for bug #9786. guint overflows
 are now prevented, and the remaining length is queried from
 tvb and taken into consideration.

 As a side-effect, the fix brought up two bugs in the openSAFETY
 dissector, which where fixed as well.

 Upd: Remove stdio.h and fix one encoding error found by
 fix-encoding-args.pl

Change-Id: Ic2d478a8ea15b0bcfd2536a074c217daf610fe08
Reviewed-on: https://code.wireshark.org/review/291
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-21 16:45:31 +00:00
Martin Kaiser 9e00e02598 fix endless loop
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9786

Change-Id: I336f2bcc14596d64ad2e3f3e8140269996e077f5
Reviewed-on: https://code.wireshark.org/review/260
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-02-19 22:18:05 +00:00
Roland Knall 627069c20c openSAFETY: Reduce overload and display gap data
Up until now, openSAFETY hooked into a heuristic filter for epl
 and dissected the whole package, handing back some epl header
 information by calling epl again. This was time-consuming and
 on a busy network led to an increase in dropped packages and
 memory usage, as well as unresponsivness.

 This patch only takes the payload data of epl frames, and
 therefore greatly reduces the dissection overhead of openSAFETY.

 On a second note, intergap data between safety frames is now
 being displayed as Data, but only if the option for doing so
 is specifically enabled in the openSAFETY preferences, as it
 changes the behaviour of the dissector output.

 Upd: Because of the gap handling, some frames where marked
 as being truncated, although they were not, or did not contain
 openSAFETY frames at all. In the course of the fix for this,
 the byte copying for the byte swap with MBTCP has been moved
 to only occur when needed, and is additionaly guarded.

 Upd2: Identation and comment fixes

 Upd3: Change memcpy to memdup and move find_dissector ( "data" )
 to proto_reg_handoff

PLK: Store data dissector pointer

 Move the if-clause to proto_reg_handoff as documented
 in comment of Change-id: 191

Change-Id: I3038ed465900a2b5e63b3a0967abd62a4c66f318
Reviewed-on: https://code.wireshark.org/review/191
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-14 16:12:22 +00:00
Roland Knall 96583cdf3e Powerlink: New heuristic payload dissection
Up until now, the heuristic dissector for epl allways passed the
 complete epl frame. Therefore a lot of information got passed,
 which was not needed, resulting in subdissectors to have to call
 the epl dissector again, if the epl data had to be dissected.

 This patch adds a second heuristic dissector (not breaking the
 way, the existing one is working), which only passes the payload
 of the epl frame to a sub-dissector, therefore reducing memory
 overhead and increasing dissection speed.

 Upd: Changes according to comments in patchset

Change-Id: I2ef309310f421f24d96dd1c188e188ccfa5935cd
Reviewed-on: https://code.wireshark.org/review/190
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-13 22:12:43 +00:00
Jakub Zawadzki c45475ab45 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54135
2013-12-15 23:44:12 +00:00
Michael Mann 9fa6c9fb80 Create new dissectors when a protocol goes across ethernet and "something else" instead a single dissector that uses pinfo->ethertype to determine if it's the "ethernet" or the "something else" case.
svn path=/trunk/; revision=53488
2013-11-21 19:51:17 +00:00
Bill Meier 0ad98563a2 From didier gautheron: remove redundant or use faster col_xxx functions
- when the text parameter is constant col_add_str() and col_set_str() are equivalent but col_set_str() is faster.
- same for  replace col_append_fstr and col_append_str
- remove col_clear() when it's redundant:
    + before a col_set/col_add if the dissector can't throw an exception.
- replace col_append() after a col_clear() with faster col_add... or col_set

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


svn path=/trunk/; revision=52948
2013-10-29 14:09:20 +00:00
Michael Mann b752cfa88d Correct source code formatting. Bug 9146 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9146)
From Roland Knall

svn path=/trunk/; revision=52691
2013-10-19 16:50:52 +00:00
Bill Meier 2ac134b3c5 whitespace fixes; mostly: remove trailing blanks
svn path=/trunk/; revision=52591
2013-10-13 19:56:52 +00:00
Michael Mann cf80442912 Convert some proto_tree_add_string_format calls to something more appropriate.
There seem to be several cases of proto_tree_add_string_format where a "string" value/filter doesn't really make sense because it's always empty, and is just being used as a "filterable subtree header (placeholder)".  They appear to be more for "presense" than "value" and should probably be FT_NONE, although I'd almost argue for removing the filter in favor of  proto_tree_add_text.

svn path=/trunk/; revision=52296
2013-09-30 15:21:09 +00:00
Pascal Quantin e078770856 From Roland Knall via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9047 :
EPL: Dissection for WriteMultipleParameter, Node Alias, SDO/ASND structuring

svn path=/trunk/; revision=52021
2013-09-13 19:27:53 +00:00
Jakub Zawadzki 5fa2a99087 Keep result of [new_]register_dissector in some dissectors.
svn path=/trunk/; revision=51156
2013-08-05 18:09:43 +00:00
Jörg Mayer 32b98e8524 Fix CID 1033205: Dead default in switch (DEADCODE)
svn path=/trunk/; revision=50030
2013-06-19 03:30:06 +00:00
Michael Mann 0f0c111119 Remove check_col() and the occasional tree.
svn path=/trunk/; revision=49920
2013-06-14 01:02:11 +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 c439b805e2 Comment out unused hf[] entries & etc.
(found by checkhf)

svn path=/trunk/; revision=47389
2013-01-31 17:55:31 +00:00
Bill Meier 7cd0417af5 Fix numerous instances of a variable/parameter name "shadowing" a library function name;
(At least some (gcc ?) compilers give a "shadow" warning for these).

svn path=/trunk/; revision=46402
2012-12-05 15:56:36 +00:00
Bill Meier 8f8775800b Minor Updates:
- #if 0 unused typedef (found by cppcheck);
- create/use extended value strings as appropriate;
- reformat hf[] entries;
- whitespace.

svn path=/trunk/; revision=45652
2012-10-18 23:01:47 +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
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 2df5dc3d53 From Reinhard Speyerer: Fix several misspellings/typos in Wireshark
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6967

svn path=/trunk/; revision=41645
2012-03-18 22:24:24 +00:00
Alexis La Goutte 777540e39f Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=40896
2012-02-06 22:06:28 +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 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 67ee5049d4 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_BOOLEAN
     FT_IPv4
     FT_EUI64
     FT_GUID
     FT_UINT_STRING

Also: For type FT_ITv6 use ENC_NA. (This was missed in SVN #39260)

svn path=/trunk/; revision=39328
2011-10-10 00:39:31 +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
Bill Meier 8e01cc53fc Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings;
Also: In various places: compute 'offset' whether or not 'if(tree)'.

svn path=/trunk/; revision=38156
2011-07-21 21:54:09 +00:00
Bill Meier 8889f829c0 Use correct subtree in a few cases: Fixes Coverity 921,894,878 & 1136;
svn path=/trunk/; revision=37361
2011-05-23 14:26:43 +00:00
Anders Broman 9486d7dcc2 From Roland Knall:
Patch, which removes both EPL and EPLv1 .h files, as well as adding a heuristic dissector hook to EPL (v1 is nearly nowhere in use anymore, therefore not needed)

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

svn path=/trunk/; revision=36198
2011-03-16 06:21:56 +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
Guy Harris 8e236e55de For fields of type FT_ABSOLUTE_TIME, have the "display" value be one of
ABSOLUTE_TIME_LOCAL or ABSOLUTE_TIME_UTC, indicating whether to display
the date/time in local time or UTC. (int)ABSOLUTE_TIME_LOCAL ==
(int)BASE_NONE, so there's no source or binary compatiblity issue,
although we might want to eliminate BASE_NONE at some point and have the
BASE_ values used with integral types start at 0, so that you can't
specify BASE_NONE for an integral field.

svn path=/trunk/; revision=31319
2009-12-19 03:17:44 +00:00
Guy Harris e1a76d5e2b Well, not quite - proto_tree_add_item() doesn't work on FT_ABSOLUTE_TIME
fields, as there are several different possible time formats, and
there's not yet any way to specify the particular format.  However, we
don't need to format the time stamp - let the Wireshark core code do that.

svn path=/trunk/; revision=31226
2009-12-10 22:15:59 +00:00
Guy Harris 28ccd651bf Just use proto_tree_add_item(), don't use a fancy sequence of code that
yields the same result.

svn path=/trunk/; revision=31225
2009-12-10 21:59:35 +00:00
Kovarththanan Rajaratnam 65c53fedb6 Don't guard col_append_str with check_col
svn path=/trunk/; revision=30125
2009-09-24 20:00:21 +00:00