aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
AgeCommit message (Collapse)AuthorFilesLines
2017-01-06Convert some easily identifiable pinos.Michael Mann1-5/+5
grepping for "Decode As" comments reveals exactly was pinos were created for - distinguishing multiple dissection functions in a single dissection table. Change-Id: Iaa9294045e9d0633563e7d763cb585c0e6dc598f Reviewed-on: https://code.wireshark.org/review/19490 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-31Dissectors don't need a journey of self discovery.Michael Mann49-198/+140
They already know who they are when they register themselves. Saving the handle then to avoid finding it later. Not sure if this will increase unnecessary register_dissector functions (instead of using create_dissector_handle in proto_reg_handoff function) when other dissectors copy/paste, but it should make startup time a few microseconds better. Change-Id: I3839be791b32b84887ac51a6a65fb5733e9f1f43 Reviewed-on: https://code.wireshark.org/review/19481 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>
2016-12-26Don't claim packet as MATE if there is no MATE configurationMichael Mann1-1/+6
This prevents MATE from (falsely) being included in the list of protocols for any given frame. Change-Id: I9ffdfb52cf31dfda89b674a41bcc0992e17de5e8 Reviewed-on: https://code.wireshark.org/review/19432 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-12-25Cleanup transum post-dissector.Michael Mann5-665/+514
1. Enable/disable preference not needed - just use Enabled Protocol dialog interface. Added support for backwards compatibility of preference. 2. Add value_string for calculation values 3. Create an structured array of "hfs of interest" so they can more easily be extended. 4. Convert a bunch of arrays into hash tables and lists. For the amount of wasted space they were taking up, we can live with the very slight performance degrade. Also puts less limits on number of things to process. Change-Id: I7399789d62432b507062ed9cdc20ad974b9dde1b Reviewed-on: https://code.wireshark.org/review/19406 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>
2016-12-24[TRANSUM] smb2.msg_id is now a FT_UINT64.Michael Mann1-1/+1
Per bug 12915, SMB2 message ID should be treated as a unsigned 64bit value. Have transum logic match that as it was assuming SMB2 message ID was a signed 64bit value Change-Id: Ide0c12b505d1eef2aeb89d165a3ea59058e6be34 Reviewed-on: https://code.wireshark.org/review/19407 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-23Make sure we know that a RNG_RSP_DL_FREQ_OVERRIDE item is present.Guy Harris1-1/+4
Set a variable that we were supposed to be setting. Also, note some items that should probably be expert info items instead of, or in addition to, additional text at the end of protocol tree items. Addresses CID 1397702. Change-Id: I2ff0c2549f229546035964efa6af19b77646f7d2 Reviewed-on: https://code.wireshark.org/review/19397 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-12-21decoders(transum): fix redundant redeclaration of 'add_detected_tcp_svc’ ↵Alexis La Goutte1-1/+0
[-Wredundant-decls] Change-Id: I70ccf182160086a4c04467eec214857a461a2869 Reviewed-on: https://code.wireshark.org/review/19373 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-21transum: fix no previous prototype for ‘proto_register_transum’ ↵Alexis La Goutte1-1/+1
[-Wmissing-prototypes] the last one Change-Id: I8b279d11b61645a19b0b356d52cf66eed0180700 Reviewed-on: https://code.wireshark.org/review/19372 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-21transum: fix no previous prototype for '...’ [-Wmissing-prototypes]Alexis La Goutte1-4/+4
Part 2... Change-Id: Id219bd2b04de2003b5bfa4a33893d0310856275d Reviewed-on: https://code.wireshark.org/review/19368 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-12-19transum: add Modelines infoAlexis La Goutte5-0/+65
Change-Id: I9d9ffdb7d32a940dbe155e82946d59f649cafe09 Reviewed-on: https://code.wireshark.org/review/19345 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-12-19transum: fix no previous prototype for '...’ [-Wmissing-prototypes]Alexis La Goutte2-16/+20
Comment set_pkt_rrpd (not used) Change-Id: I8d571f3cd45c51b07969132718a43244003c0f59 Reviewed-on: https://code.wireshark.org/review/19344 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-18decoders(transum): fix no previous prototype for ‘decode_*’ ↵Alexis La Goutte1-0/+1
[-Wmissing-prototypes] Change-Id: I93b24285443d99799f83c40f61f413c2d106c85f Reviewed-on: https://code.wireshark.org/review/19338 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-18[docsis->type2ucd] Fix issue with decodingAdrianSimionov1-5/+5
Burst 4 and Burst 5 values are now properly decoded. Change-Id: I6232a19eb849a419825be69435069e4be721cbc1 Reviewed-on: https://code.wireshark.org/review/19327 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-12-18RTP: RTP dissector is able to decode RTP over TCP (RFC 4571)Jiri Novak1-1/+1
Bug: 13251 Change-Id: I56a01e779f7f0eadc8a078f88543269a91148f00 Reviewed-on: https://code.wireshark.org/review/19293 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-12-16Remove proto_item_append_text calls in favor of BASE_UNIT_STRING.Michael Mann5-124/+107
Many proto_item_append_text calls were just adding a unit string to a field. There's a better way to do that now. Change-Id: Id18d5ac1ea4d8ecdc4cbe7ebaec07fbd2eab6e78 Reviewed-on: https://code.wireshark.org/review/19289 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-13Adjust proto_tree_add_uint_format_value calls to use unit stringMichael Mann2-19/+13
Several calls to proto_tree_add_uint_format_value could be better served using BASE_UNIT_STRING with a "unit string" in hf_ field. There also a few cases where proto_tree_add_uint_format_value could just be proto_tree_add_uint. Added a few more "common" unit string values to unit_strings.[ch] Change-Id: Iaedff82c515269c9c31ab9100dff19f5563c932d Reviewed-on: https://code.wireshark.org/review/19242 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-13Build TRANSUM pluginPascal Quantin7-35/+220
Add plugin to autofoo and CMake build systems and fix errors found Add plugin to Windows installer (optional component activated by default) Change-Id: Id1b777bdee04e53076b3291f6fb68d5abad6985d Reviewed-on: https://code.wireshark.org/review/19228 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-12-09transum: plugin codePaul Offord12-0/+2524
A plugin to calculate response, service and spread time values based on the RTE model. Bug: 12892 Change-Id: I47d7e5354fc269916851a318fef10b826897eaf8 Reviewed-on: https://code.wireshark.org/review/17750 Petri-Dish: Anders Broman <a.broman58@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-12-02Include config.h at the very beginning of all Flex scanners.Guy Harris2-2/+10
That way, if we #define anything for large file support, that's done before we include any system header files that either depend on that definition or that define it themselves if it's not already defined. Change-Id: I9b07344151103be337899dead44d6960715d6813 Reviewed-on: https://code.wireshark.org/review/19035 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-11-26DOCSIS: fix an infinite recursion introduced in g3e1828ePascal Quantin1-1/+4
Bug: 13179 Change-Id: I4c510dab463f7c223bcaabd3157ca791dd86d690 Reviewed-on: https://code.wireshark.org/review/18958 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Seth Alexander <pxsdaemon@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-11-25PROFINET: Update LineDelay DissectionBirol Capa1-8/+67
When LineDelay is decoded, the FormatIndicator is not evaluted. Sample LineDelay: 2147483658 (0x80 00 00 0a) This value should be 10, since FormatIndicator (Bit 31) = 0x01 states that this is a CableDelay. Change-Id: I08ae8e6de8b6f8c493122109e29e91dc47096734 Reviewed-on: https://code.wireshark.org/review/18950 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-11-24Removed Manipulation of Visited FlagSeth Alexander1-3/+5
Change-Id: Ic77afa3fd0b9cabb3f2681be099e11be79d271be Reviewed-on: https://code.wireshark.org/review/18938 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-11-22Added Path Value and CRC to DOCSIS PluginSeth Alexander1-421/+747
DOCSIS update with basic defragmentation Bug: 13106 Change-Id: Idbb42c80b87c0c3189da087b523733cf0b19967c Reviewed-on: https://code.wireshark.org/review/18676 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-11-14profinet (dcerpc pn io): Fix Dead Store (Dead assignement/Dead increment) ↵Alexis La Goutte1-1/+1
Warning found by Clang Change-Id: I5b7d97b6238c26dd8fa748aaa59a84eb4a03274c Reviewed-on: https://code.wireshark.org/review/18814 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-11-13PROFINET: Add Asset Management Record DissectionBirol Capa1-2/+608
Identification and Maintenance (I&M) and AssetManagement (AM) functions are to collect information about the assets of an automation plant to cover the use cases such as identification, configuration, commissioning, diagnosis etc.. PROFINET plugin should support the Asset Management Record (AMR). Bug: 13112 Change-Id: I9c557b5f7f4f633fdd475c2c9e8900a8e6c2ba47 Reviewed-on: https://code.wireshark.org/review/18719 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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-11-13DOCSIS: Added dissector for type51 UCDBruno Verstuyft3-0/+1649
Change-Id: Ifb46b2bd0a6eeae3e641ebcb3ecc89fc4f74b3f9 Reviewed-on: https://code.wireshark.org/review/18673 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-11-10PROFINET: Update MRP dissection according to IEC62439-2 Ed.2.Birol Capa1-55/+189
The MRP PDU dissection is updated with respect to MRP standard IEC62439-2 Ed.2. 0x88e3 is added for MRP Ether Type String definions of MRP block and sub block types are updated. dissect_pn_ManuData function is removed since it is not used anymore. Change-Id: Iec6666abc75bcba4189f2c38851407abc23267f9 Reviewed-on: https://code.wireshark.org/review/18730 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-11-07PROFINET: Update preliminary version of the Reporting System (RS) dissection.Birol Capa1-17/+72
Timestamp decoding is added. Name of "Stop Observer" is changed as "Observer Status Observer". TimeStatusObserver padding bytes location is changed. Text of RS_ReasonCode for value "0" is changed from "Reserved" to "No Detail". Change-Id: I2c231d75001a89a1e41f2518f5c6ca1fdf49a2f0 Reviewed-on: https://code.wireshark.org/review/18662 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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-10-27gryphon (plugins): fix spelling typo found by lintianAlexis La Goutte1-2/+2
Change-Id: I82f87f809ff0a261dacf38a2fb52aa4788403490 Reviewed-on: https://code.wireshark.org/review/18500 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-27docsis (plugins): fix spelling typo found by lintianAlexis La Goutte1-2/+2
Change-Id: I730c8df46165d4778174d6931785765d2434d14d Reviewed-on: https://code.wireshark.org/review/18502 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-27ethercat (plugins): fix spelling typo found by lintianAlexis La Goutte1-1/+1
Change-Id: I85a86953c89979e975e178fed1ae13dddab304d0 Reviewed-on: https://code.wireshark.org/review/18501 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-21Clean up file handle management.Guy Harris1-9/+5
The main reason fclose() could fail is if the file is open for writing, not all the buffered data has been written out at the time fclose() was called, and the attempt to write it out fails. In any case, the file handle is no longer valid after fclose() completes, whether the close succeeds or not, so there's no reason to keep it around. There's no reason to check whether it's null in a loop called in code where it's not null to start with and where it's not set to null in the loop. This should fix CID 1374111. Change-Id: Ib8067a17731b41d6b184a5a415addc2ecaa7c00c Reviewed-on: https://code.wireshark.org/review/18359 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-19Drop redundant SIZEOF() macroBalint Reczey2-12/+10
Change-Id: I6db2033746f5f22dd0229c96727bb352bdb1e866 Reviewed-on: https://code.wireshark.org/review/18298 Reviewed-by: Balint Reczey <balint@balintreczey.hu> Petri-Dish: Balint Reczey <balint@balintreczey.hu> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-13Convert most UDP dissectors to use "auto" preferences.Michael Mann5-110/+17
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-12PROFINET: Don't display expert information when implicit AR is used.Birol Capa1-21/+19
According to specification: Value(UUID): 00000000-0000-0000-0000-000000000000 Meaning: Reserved Use: The value NIL indicates the usage of the implicit AR. Change-Id: Iea807f14bf6da36700b778a1383ebd970aa105a5 Reviewed-on: https://code.wireshark.org/review/17951 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>
2016-10-10Profinet I/O: Sanity check number of I/O objectsMichael Mann1-5/+22
Can prevent really long loops from fuzz testing. Bug: 12851 Change-Id: I85e00af2c4753ce4c5bcb650a7df188d7f679c9a Reviewed-on: https://code.wireshark.org/review/18136 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-08Combine Decode As and port preferences for tcp.port dissector table.Michael Mann6-64/+14
This patch introduces new APIs to allow dissectors to have a preference for a (TCP) port, but the underlying data is actually part of Decode As functionality. For now the APIs are intentionally separate from the regular APIs that register a dissector within a dissector table. It may be possible to eventually combine the two so that all dissectors that register with a dissector table have an opportunity to "automatically" have a preference to adjust the "table value" through the preferences dialog. The tcp.port dissector table was used as the guinea pig. This will eventually be expanded to other dissector tables as well (most notably UDP ports). Some dissectors that "shared" a TCP/UDP port preference were also converted. It also removed the need for some preference callback functions (mostly when the callback function was the proto_reg_handoff function) so there is cleanup around that. Dissectors that has a port preference whose default was 0 were switched to using the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference Also added comments for TCP ports used that aren't IANA registered. Change-Id: I99604f95d426ad345f4b494598d94178b886eb67 Reviewed-on: https://code.wireshark.org/review/17724 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-03PROFINET: Add preliminary version of the Reporting System (RS) dissection.Birol Capa2-9/+964
The Reporting System (RS) ASE is composed of Observers and Event buffer queues. Bug: 12959 Change-Id: Ibce2d607bffe9c04b24e8ccd5ef502307fbba7c6 Reviewed-on: https://code.wireshark.org/review/17965 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-09-30cmake: make WERROR_COMMON_FLAGS a normal stringPeter Wu14-98/+252
Instead of checking for the boolean "FALSE", just set an empty string. This avoids the need to check for WERROR_COMMON_FLAGS before using it. The transformation is the same for all files, remove "if (WERROR_COMMON_FLAGS)" and "endif()", reindent and add quotes (since we have a string here and not a list). Modelines have been added where missing. Change-Id: I0ab05ae507c51fa77336d49a99a226399cc81b92 Reviewed-on: https://code.wireshark.org/review/17997 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt> Reviewed-by: Dario Lombardo <lomato@gmail.com> Tested-by: Dario Lombardo <lomato@gmail.com>
2016-09-29PROFINET: Fix variable may not have been initialized warningBirol Capa2-5/+5
The variable may not have been initialized. To make code more readable and to avoid possible future mistakes initialize the variables. Change-Id: I0c5e78b6d625c87252a4c47e263a3d5c701f2674 Reviewed-on: https://code.wireshark.org/review/17962 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-29PROFINET: Fix switch statement has no defaultBirol Capa1-0/+4
A switch statement has no section labeled default. To make the code more readable add the default statement with a good comment. Change-Id: Iacd9b1520628e229baedc89277d07ffac2caf1b6 Reviewed-on: https://code.wireshark.org/review/17960 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-09-29PROFINET: Fix pointer variable 'fp' previously deallocated warningBirol Capa1-1/+4
'fp' pointer variable was freed or deleted in an earlier statement. To make code more readable and to avoid possible future mistakes make sure that developer sees this situation. Change-Id: Ib5b9c4c32000adf05a30e094ebc98fe4bc4cfa52 Reviewed-on: https://code.wireshark.org/review/17961 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-28PROFINET: Fix possibly passing a null pointer to functionBirol Capa1-6/+6
A NULL pointer is possibly being passed to a function identified. Change-Id: I87afb4fcd669451d94fecbcb827e7ff82d3e6740 Reviewed-on: https://code.wireshark.org/review/17950 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2016-09-23mate: fix Match edge cases, improve documentationPeter Wu3-280/+184
Use strcmp to sort AVPs in an AVPL and for matching instead of comparing pointer addresses. Pointers can only be used for (in)equality, there is no ordering in them. Matching of attributes however requires a better ordering to know whether the operator (condition) or whether the operand (data) can be skipped. Otherwise it is possible that condition (b) randomly fails to match data (a,b). User-visible changes (mainly edge cases): - Loose (a=1, a?) on data (a=0, a=1) would previously fail to return (a=0,a=1) because the a? condition is not tried for data a=0. Now it tries all compatible conditions for a data AVP. - Any Match condition like (a=1, a^1) would previously be treated the same as (a=1) while (a^1, a=1) would still be seen as (a^1, a=1). The first case is now fixed to match (a=1, a^1). (Via a fix in insert_avp to ensure that (a=1) is not considered the same as (a^1).) - Every (a=1, a=2) on data (a=1, b=1) previously failed, but the comment "it will not create a list if there is not a match for every attribute in op" suggests that it should return (a=1). - Every (a=1) on data (a=2) previously succeeded (bug) while it would fail on (a=2, b=1). This is fixed now by checking whether any of the conditions really have matching data for the attribute. Other changes: optimize merge_avpl and new_avpl_*_match to insert in linear time instead of quadratic, rewrite and add comments in an attempt to make it easier to understand. Merge the new_avpl_every_match and new_avpl_exact_match functions and rename it to new_avpl_pairs_match to reflects its actual implemented functionality. Not addressed in this patch is the quasi-randomness of the returned data AVPL. AVPLs are unordered, so the condition Strict (a?) on data (a=1, a=2) could in theory return either (a=1) or (a=2). In practice this returns (a=1) because of alphabetical ordering, but this cannot really be relied on. It gets worse for conditions like Strict (a?, a>1), these are considered undefined behavior (without warnings for now). Ping-Bug: 12184 Change-Id: I0008448ffcb96183f106cb937c4f488e26a82f92 Reviewed-on: https://code.wireshark.org/review/17777 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> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-22Fix Profinet RPCInterfaceUUID decodingBirol Capa1-4/+6
The translation of all RPCInterfaceUUID for PNIO evaluates to "PNIO". However, UUID allows distinction of - UUID_IO_DeviceInterface (IOD-IF) - UUID_IO_ControllerInterface (IOC-IF) - UUID_IO_SupervisorInterface (IOS-IF) - UUID_IO_ParameterServerInterface (PServ-IF) Bug: 12938 Change-Id: I97c27808f61abd96728421488bb0ee5fdbace566 Reviewed-on: https://code.wireshark.org/review/17865 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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-09-19Improve support for single-character fields and filter expressions.Guy Harris1-2/+2
Add an FT_CHAR type, which is like FT_UINT8 except that the value is displayed as a C-style character constant. Allow use of C-style character constants in filter expressions; they can be used in comparisons with all integral types, and in "contains" operators. Use that type for some fields that appear (based on the way they're displayed, or on the use of C-style character constants in their value_string tables) to be 1-byte characters rather than 8-bit numbers. Change-Id: I39a9f0dda0bd7f4fa02a9ca8373216206f4d7135 Reviewed-on: https://code.wireshark.org/review/17787 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-04irda: restore a line removed by mistake in ge4c059fPascal Quantin1-1/+1
Bug: 12821 Change-Id: If6423c7f8443eccd6ddb4b699bbc327a965d0d74 Reviewed-on: https://code.wireshark.org/review/17477 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-08-31Use "ecatf" as the protocol name, to parallel everything else.Guy Harris1-1/+1
The fields have names beginning with "ecatf.", the dissector is called "ecatf", and it's only the frame layer of EtherCAT anyway, so just call it "ecatf". Change-Id: I2f127363fd115c307f0525f612fe184a30d46c55 Reviewed-on: https://code.wireshark.org/review/17406 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-31Don't do any Decode As stuff for dissector tables not used with Decode As.Guy Harris4-4/+4
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-10ethercat: fix check for SdoControl (CID 1256520).Dario Lombardo1-1/+1
Change-Id: I6a24974b41f9abee32e3a170b607062bf80f3368 Reviewed-on: https://code.wireshark.org/review/16990 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>