Commit Graph

145 Commits

Author SHA1 Message Date
Dario Lombardo fe219637a6 dissectors: use SPDX identifiers.
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a
Reviewed-on: https://code.wireshark.org/review/25756
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-12 16:49:58 +00:00
Jakub Zawadzki f244742b46 epl: fix map.title memleak.
Valgrind report:
==642== 14 bytes in 1 blocks are definitely lost in loss record 5,705 of 49,814
==642==    by 0xA966DCC: g_strdup_vprintf (gstrfuncs.c:507)
==642==    by 0xA966E88: g_strdup_printf (gstrfuncs.c:533)
==642==    by 0x6D523F4: dissect_object_mapping (packet-epl.c:4216)
==642==    by 0x6D56394: dissect_epl_sdo_command (packet-epl.c:3862)
==642==    by 0x6D56394: dissect_epl_asnd_sdo (packet-epl.c:3572)
==642==    by 0x6D59BC5: dissect_epl_asnd (packet-epl.c:3053)
==642==    by 0x6D59BC5: dissect_eplpdu.part.21 (packet-epl.c:2627)

Found by oss-fuzz/5907.

Change-Id: I6f4d2cea761581260af396c848ab1fded5641b44
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5907
Reviewed-on: https://code.wireshark.org/review/25573
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-02-02 20:31:10 +00:00
Roland Knall 8631ceaefc epl: Correctly display the error for available bytes
Don't break the remaining length by setting and invalid one

Change-Id: Ia32798db73937ada6c99a6927cc87402603a9e75
Reviewed-on: https://code.wireshark.org/review/25391
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-01-19 13:25:51 +00:00
Dario Lombardo 62f06b7196 epl: remove dead code and corresponding ei.
Due to mask EPL_ASND_SDO_SEQ_CON_MASK, scon and rcon can't be > 3.

Change-Id: Iaa2e8bae657ad57e4548a3f4749feda19ffaaf52
CID: 1220185.
CID: 1220186.
Reviewed-on: https://code.wireshark.org/review/24995
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-26 09:27:18 +00:00
Dario Lombardo 588bcb1723 epl: remove unreachable case (CID: 1412051).
Change-Id: I0caa56ecfb2327dd9da55eb8a53d0c075061e8a2
Reviewed-on: https://code.wireshark.org/review/24992
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-26 09:24:32 +00:00
Michael Mann abfb644117 Add conversation endpoint type
For the moment this mirrors the port_type enumeration (PT_XXX), but the
intent is to move away from using "port types", eliminating most (if not
all)

Added conversation_pt_to_endpoint_type() so that conversations deal with the
correct enumeration.  This is for dissector that use pinfo->ptype as input
to conversation APIs.  Explicit use of port types are converted to using
ENDPOINT_XXX type.

Change-Id: Ia0bf553a3943b702c921f185407e03ce93ebf0ef
Reviewed-on: https://code.wireshark.org/review/24166
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-29 16:53:57 +00:00
Ahmad Fatoum 9d49e13166 Remove superfluous null-checks before strdup/free
NULL checks were removed for following free functions:

- g_free "If mem is NULL it simply returns"
  https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-free

- g_slist_free(_full)? "NULL is considered to be the empty list"
  https://developer.gnome.org/glib/stable/glib-Singly-Linked-Lists.html

- g_strfreev "If str_array is NULL, this function simply returns."
  https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strfreev

- g_slice_free "If mem is NULL, this macro does nothing."
  https://developer.gnome.org/glib/stable/glib-Memory-Slices.html#g-slice-free

- g_match_info_free "not NULL... otherwise does nothing"
  https://developer.gnome.org/glib/stable/glib-Perl-compatible-regular-expressions.html#g-match-info-free

- dfilter_free defined in Wireshark code. Returns early when passed NULL
  epan/dfilter/dfilter.c

They were also removed around calls to g_strdup where applicable:

- g_strdup "If str is NULL it returns NULL."
  https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strdup

Change-Id: Ie80c2db89bef531edc3aed7b7c9f654e1d654d04
Reviewed-on: https://code.wireshark.org/review/23406
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-10-15 12:38:51 +00:00
Christoph Schlosser 9cb1892f38 epl: fix od_idx display in tree
The idx value was set to the sod_index value when the previous value of idx
was still needed to correctly set the text of the proto item.

Change-Id: I1130678aaf5f623ab30814310ac14360d13b84b7
Reviewed-on: https://code.wireshark.org/review/23770
Reviewed-by: Christoph Schlosser <christoph@schlosser.xyz>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-28 15:36:00 +00:00
Christoph Schlosser 76a3a6797c EPL: Fix Multiparamwrite response text
The text for the MultiParamWrite response was the same as for the
 MultiParamRead.

Change-Id: I285f4f33877ac4bb1e48f36704ecb22ad7be1de4
Reviewed-on: https://code.wireshark.org/review/22811
Reviewed-by: Christoph Schlosser <christoph@schlosser.xyz>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-27 11:37:45 +00:00
Christoph Schlosser 7fadc16172 EPL: Add padding to size calculation for last frame
The padding was not part of the size calculation of the last subpayload in a
 multiple read/write by index.

Change-Id: Ibbd3ded345352ea1ceaea7b871fc2d1a0e1a6832
Reviewed-on: https://code.wireshark.org/review/22781
Reviewed-by: Christoph Schlosser <christoph@schlosser.xyz>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-07-25 08:40:44 +00:00
Christoph Schlosser 690cb8ff65 EPL: Add Modular device flag
Add detection for the modular device flag in POWERLINK.

Change-Id: I3e21eec383f1bdf2fa491d415631cda146a0fdef
Reviewed-on: https://code.wireshark.org/review/22774
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-07-24 13:27:22 +00:00
Alexis La Goutte 68c0b8311c EPL: fix redundant redeclaration of ‘epl_profile_uat_fld_fileopen_check_cb’ [-Wredundant-decls]
Change-Id: I44ba825648eb707942c4ea576c850c94f4891fb1
Reviewed-on: https://code.wireshark.org/review/22102
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-12 21:40:07 +00:00
Alexis La Goutte 2d7d10ad1a epl: Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
Change-Id: Ibe5d2e21fcda05fa8ee52157630d4896deaef440
Reviewed-on: https://code.wireshark.org/review/22003
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-08 14:44:45 +00:00
Alexis La Goutte 8aa84c630e epl: Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
Change-Id: Id5dde66c6473cd7ba3c7cc981d7b86f564f7ca9f
Reviewed-on: https://code.wireshark.org/review/22004
Reviewed-by: Ahmad Fatoum <ahmad@a3f.at>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-07 17:41:57 +00:00
Alexis La Goutte 831828878d epl: Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
Change-Id: Id8e5c3622f5186fcab530b9d329a0ff1d42bd6f3
Reviewed-on: https://code.wireshark.org/review/22002
Reviewed-by: Ahmad Fatoum <ahmad@a3f.at>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-07 16:26:23 +00:00
Alexis La Goutte dd52b16537 epl: fix code will never be executed [-Wunreachable-code]
false positive when declare variable after a switch(){

Change-Id: Ief4770b2200a356b061cf84c7828c8ebe76a1fbb
Reviewed-on: https://code.wireshark.org/review/21983
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-06 16:14:26 +00:00
Alexis La Goutte a5a4a0bd55 epl: fix no previous prototype for function 'profile_load' [-Wmissing-prototypes]
Change-Id: I5c3119436984cc7de3dcf4dffd1961481cacc553
Reviewed-on: https://code.wireshark.org/review/21982
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-06 16:13:46 +00:00
Ahmad Fatoum 197e48bcee packet-epl.c: Make dissector oss-fuzz friendly
oss-fuzz invokes the dissector without IP layer, so we can't assume
the IP address to be available when dissecting POWERLINK/UDP packets.
Same goes for the "Exported PDU" functionality.

Bug: 13756
Change-Id: I038f0445ada3f764dcc72f7bce1d02cfa49791fb
Reviewed-on: https://code.wireshark.org/review/21894
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-02 15:05:53 +00:00
Ahmad Fatoum 3eaa62dee6 packet-epl.c: Prefix EPL UAT files with epl_
Unlike preferences, UATs are stored in their own files, so prefexing file
name with the protocol abbreviation makes sense to keep matters organized.

Change-Id: Ic7918f509e38da38cdb86ad70917923547f9c112
Reviewed-on: https://code.wireshark.org/review/21888
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-06-02 10:28:24 +00:00
Guy Harris 974f985bd9 Add SUBOBJECT_INITIALIZER and use it.
Just as we have OD_ENTRY_INITIALIZER, add SUBOBJECT_INITIALIZER, and use
it rather than memset().

Whether removing initializer warnings is a Good Thing is subject to
debate; remove a comment that implies it's been deemed a Good Thing.

Change-Id: Ife658d8bb1d4868789ca3b929aff6e4fccecb430
Reviewed-on: https://code.wireshark.org/review/21892
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-02 08:30:16 +00:00
Ahmad Fatoum 10e59dba2b packet-epl.c: Change CANopen Unicode_String to little endian
CANopen DS301 defines "Unicode_String" as "ARRAY [ length ] OF UNSIGNED16"
and states "For numerical data types the encoding is little endian style".

Change-Id: I146449d7eaafe58b337b505682b14cd672f8ad76
Reviewed-on: https://code.wireshark.org/review/21891
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-06-02 07:56:23 +00:00
Ahmad Fatoum 5a06efc29d packet-epl.c: Fixup missing initializer warnings
macOS Buildbot doesn't like {0} (probably because GNU C already provides {}
exactly for the purpose of initializing all members to zero/NULL/0.0.. etc)

Affected local type definitions now have a static intializer macro that uses
the correct amount of zeroes and braces (similar to PTHREAD_MUTEX_INITIALIZER)
Global type definitions have a memset to zero (Which isn't strictly correct,
but as the platforms we support all have all-bits-zero-nulls and IEEE 754
floats, it should be good enough. A separate change will attempt to disable
-Wmissing-field-initializers -Wmissing-braces globally and hopefully make
these workarounds unnecessary.

Change-Id: I30b0f679bbb8adb2dd7269c9f3bc19732e48212b
Reviewed-on: https://code.wireshark.org/review/21887
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-02 07:42:11 +00:00
Ahmad Fatoum 9a85e30668 packet-epl.c: Enhance dissection by ObjectMappings and device profiles
Cyclic PDOs are setup either by ObjectMappings in the asynchronous SDOs,
or by serialized ObjectMappings in device profile files.

We now keep track of ObjectMappings transmitted via SDOs or read from
XDC files and use those to correctly partition the PDO's payloads.

Additionally types and descriptions for Object Directory entries extracted
from the EDS and XDD profiles are used to select the correct Wireshark type
and a string representation for those partitoned PDOs. Other places where
indices and subindices are also enriched by this information.

EDS support leverages GKeyFile and is available unconditionally, XDD/XDC
parsing support depends on the availabilty of libxml2. A patch for
inclusion of the latter as optional dependency was submitted
as Change-Id: I13c0a2f408fb5c21bad7ab3d7971e0fa8ed7d783

Electronic Data Sheet (EDS) is the CANopen standard for device profiles,
POWERLINK being based on CANopen, is occasionly used with EDS profiles.

XML Device Description (XDD) is the Ethernet POWERLINK standard for
device profiles. XDC have the same structure but contain actualValues
fields which can contain default ObjectMappings.

XML Device Descriptions can be 25k+ lines with much duplication,
so wmem_iarray_t is leveraged for saving space as well as faster lookups.

A side-effect of now organizing the capture in conversations is that
POWERLINK over UDP packets are now assigned proper destination and source
node IDs, which are displayed in the column view. The Referenced bug where
packets where erronously flagged as duplicates because the address wasn't
considered is also fixed as a result.

Bug: 13604
Bug: 13749
Change-Id: Ic33ff0be8f2eae7c24fe5877ad9258d1e550c227
Reviewed-on: https://code.wireshark.org/review/21112
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-06-01 22:04:02 +00:00
Ahmad Fatoum 855a05cd1e packet-epl.c: Fix bounds error on malformed packet
dissect_epl_payload is called with len retrieved from the packet payload,
so we've to ensure there are indeed at least len bytes remaining in the tvbuff.

Counting the remaining bytes has to start from the _current_ offset, not from
the start of the buffer.

Change-Id: I6f4a94e8503cde6c5eaadc43f560c15ef8c1c375
Reviewed-on: https://code.wireshark.org/review/21829
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-05-31 19:47:41 +00:00
Alexis La Goutte b933b8a4d3 EPL: remove unused hf (hf_epl_sdo_od_field)
Change-Id: I85b26a235874fa67c4f44251166353fadccd1eb5
Reviewed-on: https://code.wireshark.org/review/21659
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>
2017-05-15 10:21:31 +00:00
Alexis La Goutte 993a0afe56 epl: Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
Change-Id: Idb2ba4181a9affd8c9a71e52a1dd24fda56bd52c
Reviewed-on: https://code.wireshark.org/review/21658
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-05-15 10:21:09 +00:00
Guy Harris 871a8a2ccc Another shadowing fix for abort().
Change-Id: I991bd24ab8b64bdfeae275941d79b716da3309f9
Reviewed-on: https://code.wireshark.org/review/21592
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-11 10:50:45 +00:00
Guy Harris 804d0cdfa3 Squelch warning from some compilers.
Change-Id: Iacd5832e3b63fa24907423d2b7df40e81fafb0de
Reviewed-on: https://code.wireshark.org/review/21591
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-11 10:08:07 +00:00
Christoph Schlosser 1be20bc4c2 EPL: Dissect read/write multiple parameter SDOs
The dissector only dissected Write Multiple Parameter by Index requests
 correctly.
 Now it is possible to dissect the response to the request and
 Read Multiple Parameter by Index request and responses.

Bug: 13677

Change-Id: I13aae241690cd3ac9dfbe8129ef56d0fc9016301
Reviewed-on: https://code.wireshark.org/review/21034
Reviewed-by: Christoph Schlosser <christoph@schlosser.xyz>
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-05-11 04:56:36 +00:00
Ahmad Fatoum 6c096f31ac packet-epl.c: Fix bigger-than-actual offset being reported
dissect_epl_asnd_nmtdna returns the offset + 27,
adding that to the original offset isn't correct,
unless the offset was 0 to begin with, which isn't the case.

Change-Id: Id0d5043b23a83aef8d07a6f6ee3b70486d913e9f
Reviewed-on: https://code.wireshark.org/review/21056
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-13 01:16:17 +00:00
Michael Mann af54b292e6 Register reassembly tables
Register all reassembly tables with a central unit, allowing the
central unit to have the callback that initializes and destroys
the reassembly tables, rather than have dissectors do it individually.

Change-Id: Ic92619c06fb5ba6f1c3012f613cae14982e101d4
Reviewed-on: https://code.wireshark.org/review/19834
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-29 13:29:04 +00:00
Guy Harris 7cd6906056 Rename tvb_new_subset() to tvb_new_subset_length_caplen().
This emphasizes that there is no such thing as *the* routine to
construct a subset tvbuff; you need to choose one of
tvb_new_subset_remaining() (if you want a new tvbuff that contains
everything past a certain point in an existing tvbuff),
tvb_new_subset_length() (if you want a subset that contains everything
past a certain point, for some number of bytes, in an existing tvbuff),
and tvb_new_subset_length_caplen() (for all other cases).

Many of the calls to tvb_new_subset_length_caplen() should really be
calling one of the other routines; that's the next step.  (This also
makes it easier to find the calls that need fixing.)

Change-Id: Ieb3d676d8cda535451c119487d7cd3b559221f2b
Reviewed-on: https://code.wireshark.org/review/19597
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-10 06:19:37 +00:00
Michael Mann 2eb7b05b8c Convert most UDP dissectors to use "auto" preferences.
Similar to the "tcp.port" changes in I99604f95d426ad345f4b494598d94178b886eb67,
convert dissectors that use "udp.port".

More cleanup done on dissectors that use both TCP and UDP dissector
tables, so that less preference callbacks exist.

Change-Id: If07be9b9e850c244336a7069599cd554ce312dd3
Reviewed-on: https://code.wireshark.org/review/18120
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-10-13 02:51:18 +00:00
Peter Wu 71c41a0a13 epl: fix memleaks
Fixes a memleak that occurs on (re)loading a pcap. While at it, remove
some unnecessary variables.

Change-Id: Ibb662e5c608881bc7dfde9d12cdb77f699ff6542
Reviewed-on: https://code.wireshark.org/review/17639
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-09-12 01:20:55 +00:00
Guy Harris a4c8ebc18b Don't do any Decode As stuff for dissector tables not used with Decode As.
Have all dissector tables have a "supports Decode As" flag, which
defaults to FALSE, and which is set to TRUE if a register_decode_as()
refers to it.

When adding a dissector to a dissector table with a given key, only add
it for Decode As if the dissector table supports it.

For non-FT_STRING dissector tables, always check for multiple entries
for the same protocol with different dissectors, and report an error if
we found them.

This means there's no need for the creator of a dissector table to
specify whether duplicates of that sort should be allowed - we always do
the check when registering something for "Decode As" (in a non-FT_STRING
dissector table), and just don't bother registering anything for "Decode
As" if the dissector table doesn't support "Decode As", so there's no
check done for those dissector tables.

Change-Id: I4a1fdea3bddc2af27a65cfbca23edc99b26c0eed
Reviewed-on: https://code.wireshark.org/review/17402
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-31 00:08:01 +00:00
Christoph Schlosser 4176e1f4b7 EPL: Add support for DS302-E
* Add AN local and global flags to the SoA frame
 * Add NMT command for dynamic node assignment (DNA)

Change-Id: I7cc8c9ee26b0676727d28f32b056fbe1a153c8af
Reviewed-on: https://code.wireshark.org/review/15263
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Christoph Schlosser <christoph@schlosser.xyz>
Reviewed-by: Roland Knall <rknall@gmail.com>
2016-05-06 09:45:57 +00:00
Alexis La Goutte 643235d181 EPL: fix 'segmented' was marked unused but was used [-Werror,-Wused-but-marked-unused]
Change-Id: I90109f724c47684a2413fe3eca9fa73d2f637cbe
Reviewed-on: https://code.wireshark.org/review/15083
Reviewed-by: Roland Knall <rknall@gmail.com>
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
2016-04-25 09:31:52 +00:00
Dario Lombardo 493f6e223b epl: change g_malloc to wmem_alloc.
Change-Id: I3d099047be2a4ef0e104f5f54b6b458387e7a1f0
Reviewed-on: https://code.wireshark.org/review/14928
Reviewed-by: Christoph Schlosser <christoph@schlosser.xyz>
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-22 04:41:52 +00:00
Christoph Schlosser 070ea6f587 EPL: Fix segmented transfer complete detection
In case of a segmented SDO transfer, the transfer complete response can
 contain additional data that should not be evaluated by the dissector.

Change-Id: I7016eb88b93aac8c318e703fe60a90c3adbf9eeb
Reviewed-on: https://code.wireshark.org/review/14692
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2016-03-29 19:42:11 +00:00
Michael Mann 1e60d63c8c Create call_data_dissector() to call data dissector.
This saves many dissectors the need to find the data dissector and store a handle to it.

There were also some that were finding it, but not using it.
For others this was the only reason for their handoff function, so it could be eliminated.

Change-Id: I5d3f951ee1daa3d30c060d21bd12bbc881a8027b
Reviewed-on: https://code.wireshark.org/review/14530
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-20 17:38:03 +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
Guy Harris 099698445b Move the proto data stuff out of frame_data.[ch].
It's not tied to the frame_data structure any more, so it belongs by
itself.

Clean up some #includes while we're at it; in particular, frame_data.h
doesn't use anything related to tvbuffs, so don't have it gratuitiously
include tvbuff.h.

Change-Id: Ic32922d4a3840bac47007c5d4c546b8842245e0c
Reviewed-on: https://code.wireshark.org/review/13518
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-25 02:24:34 +00:00
Guy Harris bc5a0374bf Add the packet number to the packet_info structure, and use it.
That removes most of the uses of the frame number field in the
frame_data structure.

Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22
Reviewed-on: https://code.wireshark.org/review/13509
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-24 03:41:28 +00:00
moshekaplan cd7026951b Fix a lot of typos and misspellings
Change-Id: I8512cfa1d424f82a873a0e0e1d22c7b075fdd7f3
Reviewed-on: https://code.wireshark.org/review/13069
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-08 20:04:56 +00:00
Guy Harris c2b7743264 Eliminate more unnecessary casting away of constness.
Change-Id: I3d2d83d60f798703ea3fa16ba2d6e95a00f88469
Reviewed-on: https://code.wireshark.org/review/12885
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-28 20:46:26 +00:00
Michael Mann 31a54708f4 new_register_dissector -> register_dissector for dissector directory.
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c
Reviewed-on: https://code.wireshark.org/review/12485
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:38:06 +00:00
Michael Mann 443a7ed259 new_create_dissector_handle -> create_dissector_handle for dissector directory.
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now.

Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f
Reviewed-on: https://code.wireshark.org/review/12484
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:37:36 +00:00
Michael Mann 74541a9596 Don't allow multiple registrations of a protocol in dissector tables.
The target here is the Decode As dialog where protocols have multiple registrations into a dissector table and that shows up as multiple entries in the Decode As dialog list with the same name so users are unsure which "dissector" they are choosing.

The "default" behavior (done in this commit) is to not allow duplicates for a dissector table, whether its part of Decode As or not.  It's just ENFORCED for Decode As.

Bug: 3949
Change-Id: Ibe14fa61aaeca0881f9cc39b78799e314b5e8127
Reviewed-on: https://code.wireshark.org/review/11405
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-04 12:39:40 +00:00
Christoph Schlosser 0f05ab9ab1 epl: Put OD information into own subtree
Instead of displaying a long list of OD index, subindex and padding, group
 the information by parameters.

Change-Id: I03ea83f187b4bd4956361d33be674ec62e35bea1
Reviewed-on: https://code.wireshark.org/review/11398
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Christoph Schlosser <christoph.schlosser@yahoo.de>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-29 17:44:31 +00:00
Alexis La Goutte d141562efb EPL: fix no previous prototype for epl_[gs]et_sequence_nr [-Wmissing-prototypes]
Change-Id: I794a26bd21494532629035a7d23751235ecec3db
Reviewed-on: https://code.wireshark.org/review/11289
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-26 20:48:37 +00:00