Commit Graph

2256 Commits

Author SHA1 Message Date
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
Alexis La Goutte 1551f01814 profinet (pn): Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
Change-Id: Id00e7dc1b23f7fce31845f024671a05fe06fc660
Reviewed-on: https://code.wireshark.org/review/19635
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-01-16 16:07:14 +00:00
Dario Lombardo 805ddd1add uat: add a reset callback.
This function will free the resources allocated by the caller.

Change-Id: Ib486c14e4fd3c321662fb71f7fd06733ce9a64a4
Reviewed-on: https://code.wireshark.org/review/19375
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-01-12 12:39:15 +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
Graham Bloice 45d967c803 profinet: Skip comments in GSD file
Bug: 13303
Change-Id: I9ab17ec25917723be06b36ab4c11fe67e6792715
Reviewed-on: https://code.wireshark.org/review/19593
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-01-09 05:10:47 +00:00
Michael Mann 6a6d7ea34f Convert range API to always use wmem memory.
This is mostly to address memory leaks in range preferences (the biggest
user of range functionality) on shutdown.
Now range preferences must use epan scoped memory when referencing
internal preference structures to keep consistency.

Change-Id: Idc644f59b5b42fa1d46891542b53ff13ea754157
Reviewed-on: https://code.wireshark.org/review/19387
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-07 00:44:10 +00:00
Michael Mann 79fc411936 Convert some easily identifiable pinos.
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>
2017-01-06 12:48:47 +00:00
Michael Mann f4b0abc729 Dissectors don't need a journey of self discovery.
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-31 07:31:42 +00:00
Michael Mann e41201cde4 Don't claim packet as MATE if there is no MATE configuration
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-26 15:51:51 +00:00
Michael Mann 78d56e5dd7 Cleanup transum post-dissector.
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-25 08:06:53 +00:00
Michael Mann ad7caed698 [TRANSUM] smb2.msg_id is now a FT_UINT64.
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-24 03:25:09 +00:00
Guy Harris f15b3a0f73 Make sure we know that a RNG_RSP_DL_FREQ_OVERRIDE item is present.
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-23 09:02:37 +00:00
Alexis La Goutte a5f1afe2b7 decoders(transum): fix redundant redeclaration of 'add_detected_tcp_svc’ [-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-21 15:57:46 +00:00
Alexis La Goutte c7a46477d3 transum: fix no previous prototype for ‘proto_register_transum’ [-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-21 15:57:16 +00:00
Alexis La Goutte 56cf6998bb transum: fix no previous prototype for '...’ [-Wmissing-prototypes]
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-21 11:37:42 +00:00
Alexis La Goutte cf0f6ae0ae transum: add Modelines info
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-19 13:32:10 +00:00
Alexis La Goutte 562954bbe6 transum: fix no previous prototype for '...’ [-Wmissing-prototypes]
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-19 13:31:57 +00:00
Alexis La Goutte 8e19794b5e decoders(transum): fix no previous prototype for ‘decode_*’ [-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 21:24:56 +00:00
AdrianSimionov 81fc27f5d7 [docsis->type2ucd] Fix issue with decoding
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-18 11:55:44 +00:00
Jiri Novak 7eee48ad55 RTP: RTP dissector is able to decode RTP over TCP (RFC 4571)
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-18 03:12:48 +00:00
Michael Mann 232cb9a2dd Remove proto_item_append_text calls in favor of BASE_UNIT_STRING.
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-16 03:04:11 +00:00
Michael Mann b7f4e25059 Adjust proto_tree_add_uint_format_value calls to use unit string
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-13 22:56:50 +00:00
Pascal Quantin 693dcd276e Build TRANSUM plugin
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-13 08:50:27 +00:00
Paul Offord fb0c288f99 transum: plugin code
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-09 04:41:35 +00:00
Guy Harris 6f37317539 Include config.h at the very beginning of all Flex scanners.
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-12-02 21:02:10 +00:00
Pascal Quantin f975020121 DOCSIS: fix an infinite recursion introduced in g3e1828e
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-26 17:40:30 +00:00
Birol Capa c551e06e79 PROFINET: Update LineDelay Dissection
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-25 21:41:55 +00:00
Seth Alexander 8eb6b3ee14 Removed Manipulation of Visited Flag
Change-Id: Ic77afa3fd0b9cabb3f2681be099e11be79d271be
Reviewed-on: https://code.wireshark.org/review/18938
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-11-24 04:03:16 +00:00
Seth Alexander 3e1828e351 Added Path Value and CRC to DOCSIS Plugin
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-22 14:18:22 +00:00
Alexis La Goutte 70c3260083 profinet (dcerpc pn io): Fix Dead Store (Dead assignement/Dead increment) 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-14 16:29:53 +00:00
Birol Capa 4994d3dbf3 PROFINET: Add Asset Management Record Dissection
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-13 17:36:43 +00:00
Bruno Verstuyft 7ba0c0cc02 DOCSIS: Added dissector for type51 UCD
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-13 00:55:55 +00:00
Birol Capa faa5ba2e20 PROFINET: Update MRP dissection according to IEC62439-2 Ed.2.
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-10 13:27:31 +00:00
Birol Capa 12e030cd5b PROFINET: Update preliminary version of the Reporting System (RS) dissection.
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-11-07 13:27:48 +00:00
Alexis La Goutte 832852f533 gryphon (plugins): fix spelling typo found by lintian
Change-Id: I82f87f809ff0a261dacf38a2fb52aa4788403490
Reviewed-on: https://code.wireshark.org/review/18500
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-27 07:12:32 +00:00
Alexis La Goutte 38bf499648 docsis (plugins): fix spelling typo found by lintian
Change-Id: I730c8df46165d4778174d6931785765d2434d14d
Reviewed-on: https://code.wireshark.org/review/18502
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-27 07:10:29 +00:00
Alexis La Goutte 4f39ed9713 ethercat (plugins): fix spelling typo found by lintian
Change-Id: I85a86953c89979e975e178fed1ae13dddab304d0
Reviewed-on: https://code.wireshark.org/review/18501
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-27 07:09:35 +00:00
Guy Harris a6d81effbc Clean up file handle management.
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-21 22:30:39 +00:00
Balint Reczey bf96599f19 Drop redundant SIZEOF() macro
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-19 04:02:06 +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
Birol Capa 50ddeaadf9 PROFINET: Don't display expert information when implicit AR is used.
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-12 03:45:38 +00:00
Michael Mann e8022a9c7b Profinet I/O: Sanity check number of I/O objects
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-10 13:11:29 +00:00
Michael Mann 268841f3e0 Combine Decode As and port preferences for tcp.port dissector table.
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-08 02:44:53 +00:00
Birol Capa d2a59db2bb PROFINET: Add preliminary version of the Reporting System (RS) dissection.
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-10-03 17:44:23 +00:00
Peter Wu 534787e402 cmake: make WERROR_COMMON_FLAGS a normal string
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-30 20:08:02 +00:00
Birol Capa 48b641576c PROFINET: Fix variable may not have been initialized warning
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-29 03:55:03 +00:00
Birol Capa a88b7bc1a6 PROFINET: Fix switch statement has no default
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-29 00:51:15 +00:00
Birol Capa 814477c32f PROFINET: Fix pointer variable 'fp' previously deallocated warning
'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-29 00:49:57 +00:00
Birol Capa a3ce2336b2 PROFINET: Fix possibly passing a null pointer to function
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-28 18:14:14 +00:00
Peter Wu b6a2915d0d mate: fix Match edge cases, improve documentation
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-23 05:59:26 +00:00