aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-epl.c
AgeCommit message (Collapse)AuthorFilesLines
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-05-03Powerlink: Fix representation of PDO versionUli Heilmeier1-2/+2
Show PDO version of PRes in the same way as we do it for PReq. Change-Id: Ib433ade6cfedfcf74e9886bcfc8eba08dcddb588 Reviewed-on: https://code.wireshark.org/review/33062 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-04epan: Convert our PROTO_ITEM_ macros to inline functions.Gerald Combs1-12/+12
Convert our various PROTO_ITEM_ macros to inline functions and document them. Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c Reviewed-on: https://code.wireshark.org/review/32706 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-24EPL: fix build with incomplete libxml2 libraryPeter Wu1-3/+0
HAVE_LIBXML2 can be set while PARSE_XDD is unset, resulting in missing functions and linker errors. Bug: 15419 Change-Id: I0aa20a80080d159bfb6eebccc503b66cc148f7f8 Reviewed-on: https://code.wireshark.org/review/31715 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2018-12-01Apply port preferences during dissector handoff registrationJaap Keuter1-0/+1
Handling of preferences is often done in the dissector handoff registration. Therefore this function is often registered as callback while registering preference handling for the module. In this way the preferences are processed both when registering the dissector and when changes happen. Some dissectors opt to register a seperate callback function to be called when preferences change. Now these have to be called from the dissector handoff function explicitly, in order to have the preferences processed during dissector registration. This becomes explicitly apparent when the port registration comes into play. With the migration to using dissector registration on ports with preference this port (range) is often retrieved from the preferences to match against the ports in a packet to determine an incoming or outgoing packet of a server. In case the callback function is not called from the dissector registration this determination fails, until the preferences are applied/changed, causing the preference handling callback to be called. This change add the calling of the callback during dissector registration, fixing some dissector port registrations in the process. Change-Id: Ieaea7f63f8f9062c56582a042a3a5a862e286406 Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl> Reviewed-on: https://code.wireshark.org/review/30848 Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-08Initialize epl_placeholder_mac at compile time.Guy Harris1-3/+2
Change-Id: I01d48dd34d4377c40d101446cdb3ceb82cc2c3e2 Reviewed-on: https://code.wireshark.org/review/29491 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-02Add new encoding names for seconds/{micro,nano}second time stamps.Guy Harris1-3/+3
Add ENC_TIME_SECS_NSECS and ENC_TIME_SECS_USECS; they make it more explicit (especially to those not familiar with UN*X data types) what the representation is, allow for ENC_TIME_SECS_MSECS etc. if they're needed, and match names such as ENC_TIME_SECS and ENC_TIME_MSECS. Change-Id: I6ab36fb4da70563587141cd65ffff8523477b0c4 Reviewed-on: https://code.wireshark.org/review/28564 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-02Use proto_tree_add_item() for a number of time values.Guy Harris1-6/+4
Change-Id: I862a7870d335f8b0b57d13e2981a8bb1a02b2726 Reviewed-on: https://code.wireshark.org/review/28563 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-17Constify a bunch of pointers and some casts.Guy Harris1-13/+13
This squelches a bunch of "constness casted away" warnings. Change-Id: I95949ccbecceea651e7e4acb99f8e69ee0bfc475 Reviewed-on: https://code.wireshark.org/review/25843 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-12dissectors: use SPDX identifiers.Dario Lombardo1-13/+1
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-02epl: fix map.title memleak.Jakub Zawadzki1-4/+4
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-01-19epl: Correctly display the error for available bytesRoland Knall1-3/+4
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>
2017-12-26epl: remove dead code and corresponding ei.Dario Lombardo1-18/+0
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-26epl: remove unreachable case (CID: 1412051).Dario Lombardo1-1/+1
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-10-29Add conversation endpoint typeMichael Mann1-2/+2
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-15Remove superfluous null-checks before strdup/freeAhmad Fatoum1-3/+1
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-09-28epl: fix od_idx display in treeChristoph Schlosser1-6/+6
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-07-27EPL: Fix Multiparamwrite response textChristoph Schlosser1-1/+1
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-25EPL: Add padding to size calculation for last frameChristoph Schlosser1-2/+2
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-24EPL: Add Modular device flagChristoph Schlosser1-0/+6
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-06-12EPL: fix redundant redeclaration of ↵Alexis La Goutte1-2/+0
‘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-08epl: Fix Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-1/+1
Change-Id: Ibe5d2e21fcda05fa8ee52157630d4896deaef440 Reviewed-on: https://code.wireshark.org/review/22003 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-07epl: Fix Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-0/+4
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-07epl: Fix Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-4/+4
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-06epl: fix code will never be executed [-Wunreachable-code]Alexis La Goutte1-3/+3
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-06epl: fix no previous prototype for function 'profile_load' ↵Alexis La Goutte1-1/+1
[-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-02packet-epl.c: Make dissector oss-fuzz friendlyAhmad Fatoum1-12/+29
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-02packet-epl.c: Prefix EPL UAT files with epl_Ahmad Fatoum1-2/+2
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-02Add SUBOBJECT_INITIALIZER and use it.Guy Harris1-1/+0
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-02packet-epl.c: Change CANopen Unicode_String to little endianAhmad Fatoum1-2/+2
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-02packet-epl.c: Fixup missing initializer warningsAhmad Fatoum1-2/+4
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-01packet-epl.c: Enhance dissection by ObjectMappings and device profilesAhmad Fatoum1-284/+1874
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-05-31packet-epl.c: Fix bounds error on malformed packetAhmad Fatoum1-10/+8
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-15EPL: remove unused hf (hf_epl_sdo_od_field)Alexis La Goutte1-5/+0
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-15epl: Fix Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-10/+0
Change-Id: Idb2ba4181a9affd8c9a71e52a1dd24fda56bd52c Reviewed-on: https://code.wireshark.org/review/21658 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-05-11Another shadowing fix for abort().Guy Harris1-4/+4
Change-Id: I991bd24ab8b64bdfeae275941d79b716da3309f9 Reviewed-on: https://code.wireshark.org/review/21592 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-11Squelch warning from some compilers.Guy Harris1-4/+4
Change-Id: Iacd5832e3b63fa24907423d2b7df40e81fafb0de Reviewed-on: https://code.wireshark.org/review/21591 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-11EPL: Dissect read/write multiple parameter SDOsChristoph Schlosser1-9/+444
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-04-13packet-epl.c: Fix bigger-than-actual offset being reportedAhmad Fatoum1-1/+1
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-01-29Register reassembly tablesMichael Mann1-3/+3
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-10Rename tvb_new_subset() to tvb_new_subset_length_caplen().Guy Harris1-1/+1
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>
2016-10-13Convert most UDP dissectors to use "auto" preferences.Michael Mann1-1/+1
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-09-12epl: fix memleaksPeter Wu1-7/+5
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-08-31Don't do any Decode As stuff for dissector tables not used with Decode As.Guy Harris1-1/+1
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-05-06EPL: Add support for DS302-EChristoph Schlosser1-7/+143
* 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-04-25EPL: fix 'segmented' was marked unused but was used ↵Alexis La Goutte1-1/+1
[-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-22epl: change g_malloc to wmem_alloc.Dario Lombardo1-2/+2
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-03-29EPL: Fix segmented transfer complete detectionChristoph Schlosser1-53/+96
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-20Create call_data_dissector() to call data dissector.Michael Mann1-7/+1
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-17Associate dissector tables and heuristic subdissector lists with a protocol.Michael Mann1-3/+3
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>