Commit Graph

145 Commits

Author SHA1 Message Date
Basak Kalfa 12305928b2 PROFINET: Profienergy record dissection
According to specification, missing profienergy records
and alarms are dissected.

Change-Id: I36eec046f0aff7f4b1235e50b6dc469847c1ac8d
Reviewed-on: https://code.wireshark.org/review/35389
Petri-Dish: Tomasz Moń <desowin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-12-17 05:13:39 +00:00
Basak Kalfa 1859b35f5a PROFINET: Fix related to redundancy and PNIOStatus
According to specification, redundancy bit values in
packet-pn-rt.c are swapped. Moreover, endpoint type
was changed by Change 30821 and became ENDPOINT_NONE.
It has caused an error since related conversation can
not be found with its endpoint (ENDPOINT_UDP). Finally,
it is detected that when PNIOStatus is error, dissection
still continues but there is no data to dissect. This
defect is also fixed by this commit. (This change also
includes one fix for dead store.)

Change-Id: I09a07fd0027c4485ba84651e969b3de9d0012b5c
Reviewed-on: https://code.wireshark.org/review/35158
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-20 14:32:55 +00:00
Başak Kalfa 2ce3ec5055 PROFINET: Padding in SRLData block is corrected.
According to specification, padding in SRLData block
will be adapted to make the block unsigned32 aligned.
2 bytes padding is changed to unsigned32 aligned.

Change-Id: I78729a491cd5245acaff07fe595664187c2bf39e
Reviewed-on: https://code.wireshark.org/review/34979
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-11-05 13:26:28 +00:00
Başak Kalfa d793c8d70e PROFINET: Manufacturer Data ranges are modified.
According to specification, ranges for manufacturer data
are modified for both DCP and MRP. Small fixes are done.

Change-Id: I08fa8a8b04e8b82ade7f6a275774cfcbdb490495
Reviewed-on: https://code.wireshark.org/review/34755
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-11-05 10:13:36 +00:00
Stig Bjørlykke a673a50ad8 epan: Rename dissector_filters.c to conversation_filter.c
For the same reason as in g89c9d909.

Change-Id: I5e344ebdf8ba05d169484aa32b409d84edc6124f
Reviewed-on: https://code.wireshark.org/review/34943
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-11-04 10:17:16 +00:00
Alexis La Goutte a00d02c9b3 profinet (pn-rt): Fix Dead Store
Fix dead store (Dead assignement/Dead increment) Warning found by Clang

Change-Id: Ic06613b355e2ad5e4128e0040fc540476aed425a
Reviewed-on: https://code.wireshark.org/review/34905
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-02 15:12:26 +00:00
Rainer Keller df1c73d68f Opcua: Fix display of GUIDs
GUIDs of the OPC UA protocol are always encoded in little endian format.
Using the default RFC4122 decoder assumes big endian and results in displaying
wrong values.

Change-Id: I0c2f60ca2f1c0ae118e8388ec58291dc0d1222b9
Reviewed-on: https://code.wireshark.org/review/34790
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2019-10-20 16:33:35 +00:00
basakkal c3afba7f28 PROFINET: Adding text to Normal (non-DFP) RTC3 frames
According to specification, Normal (non-DFP) RTC3 frames
are not decoded as subframes. However, undecoded data was
not shown at the tree. The undecoded data text is added

Change-Id: Ib6ffd750c81d05318d9b81debd73a1f8022bbbb7
Reviewed-on: https://code.wireshark.org/review/34698
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-10-04 06:23:23 +00:00
Michael Mann b28952afd4 gryphon: General cleanup/improvements of dissector
1. Use switch statement for request/response functions
2. Reorder functions to limit the need for forward declarations
3. Use proto_tree_add_item_ret_uint and proto_tree_add_item_ret_length to
limit "duplicate" functionality.
4. Create initial (simple) request/response matching.  This can probably be
improved upon.
5. Use the request/response matching structures to pass (ioctl) context between
request and response.

Change-Id: I3f4c16c07f4b3aa9556d229d003a4842ff118cd9
Reviewed-on: https://code.wireshark.org/review/34404
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-09-01 09:02:19 +00:00
Michael Mann 627917faff Gryphon: Prevent endless loop
Bug: 16020
Change-Id: I59c24d3bdb3f3a85f6e498683594ee12db9642a8
Reviewed-on: https://code.wireshark.org/review/34392
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-08-29 14:47:28 +00:00
Guy Harris 5cf3fd03f1 HTTPS In More Places, update some URLs.
Change-Id: Ice2e1e2e4d94f6c9da7c651866cfa1a8ac4a31d8
Reviewed-on: https://code.wireshark.org/review/34096
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-27 07:55:36 +00:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
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-07-26 18:44:40 +00:00
Guy Harris 99f574aecb Initialize newly-allocated iap_conversation_t before fetching packet data.
If we do it after trying to fetch packet data, the attempt to fetch
might throw an exception, and the structure won't be fully initialized.

Bug: 15934
Change-Id: If50a8c18232d934c1e33512cddb40a011a4eaef7
Reviewed-on: https://code.wireshark.org/review/34087
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26 10:23:32 +00:00
Guy Harris fac8c25bb1 Don't just grab raw string data with tvb_memcpy().
Use proto_tree_add_item_ret_display_string() routines to add strings
if we want to display the string's value in a column, and just use
proto_tree_add_item() if we don't need the string's value.  That way,
all strings are fetched using an encoding value, to properly map to
UTF-8, and, if necessary, are formatted for display.

Add comments asking about encodings.

Change-Id: I32dbdf17c90e77cc080d6132c740c8c5d19ef4c5
Reviewed-on: https://code.wireshark.org/review/33997
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-18 00:29:57 +00:00
Guy Harris 2edaca628a Clean up comments.
VisibleString does, in fact, mean ASCII in PROFINET.

Put a space after a comma.

Change-Id: I0b9da9599ddd5429736dff598e5c37e9cac88bc6
Reviewed-on: https://code.wireshark.org/review/33996
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-17 21:30:36 +00:00
Guy Harris 0696d93495 Don't just grab raw string data with tvb_memcpy().
Use proto_tree_add_item_ret_display_string() routines to add strings if
we want to display the string's value in a column, and just use
proto_tree_add_item() if we don't need the string's value.  That way,
all strings are fetched using an encoding value, to properly map to
UTF-8, and, if necessary, are formatted for display.

Add comments about fields that have type VisibleString, asking whether
that means "ASCII" or "just the "Basic" part of ISO 646", where the
latter is ENC_ISO_646_BASIC.

Add a comment about fields using "The definition of IETF RFC 5890" -
that means "Punycode", but I don't think we map Punycode to Unicode;
perhaps we should.  Also ask whether that also implies RFC 1035's
encoding of domain names as sequences of counted strings.

Change-Id: Ie8d5bc18d2846f8d723019b22f69a50ce55f9a9b
Reviewed-on: https://code.wireshark.org/review/33986
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-17 15:07:18 +00:00
Guy Harris 3e26533c08 Fix signedness warnings.
Change-Id: I2a0d6f6e73c56eb3b531d6e805c9db435ceb72e7
Reviewed-on: https://code.wireshark.org/review/33983
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-17 13:57:47 +00:00
Guy Harris 4450cf73a4 Clean up string handling.
Use tvb_get_string_enc() routines to fetch strings; all strings must
have an encoding value, to properly map to UTF-8.

Use format_text() when displaying string values in columns.

Show the interpretation of "character set" values.

Choose the encoding value based on the "character set" value.

While we're at it, use the XDLC_S_U_MASK #define, rather than a raw hex
value, when testing for S frames vs. U frames.

Change-Id: Idf9d6302473bbffdfa67341c381575aa525a6d84
Reviewed-on: https://code.wireshark.org/review/33982
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-17 07:22:07 +00:00
Guy Harris 151159ad90 Clean up indentation.
Change-Id: I072ae41e48583ed52679cc58fb3b65e7654bf3ab
Reviewed-on: https://code.wireshark.org/review/33947
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-15 10:00:26 +00:00
Anders Broman 496fe3dfbf Doxygen: Fix some warnings.
Change-Id: I0344d44d08d2e159c895d693500403c067039a44
Reviewed-on: https://code.wireshark.org/review/33894
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-11 11:03:00 +00:00
Anders Broman 850713cc8d doxygen: Try to fix warnings.
Change-Id: I1517c968f05e7d9c6b561c0f5a7c6a059462d175
Reviewed-on: https://code.wireshark.org/review/33889
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-10 16:49:37 +00:00
Richard Kuemmel fc758f97c2 ethercat: add new hf item for sdo abort code.
Add new hf item for sdo abort code and display abort code instead of index.
Added check of APWR and FPRW to decide if an EtherCAT command is a mailbox
command.

Change-Id: I42877c26cb70c7567dc2d1b703e84aad8a3f7ac8
Reviewed-on: https://code.wireshark.org/review/33405
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2019-06-09 13:54:43 +00:00
Gerald Combs 2eb1a0dd61 Use the HTTPS URL for our main site in a few places.
Fixup the encoding of plugins/plugin.rc.in while we're here.

Change-Id: I21b56ce68bc3d84298a846a991c72bf710b9ae8a
Reviewed-on: https://code.wireshark.org/review/33414
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-05-29 04:00:42 +00:00
Thomas Wiens ada3d97986 PN-DCP: Add headerfield for DHCP Option-Code
Change-Id: Id00a531355fd5e32c5b3d98388fc43a5ad71aa12
Reviewed-on: https://code.wireshark.org/review/33260
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-05-20 04:14:23 +00:00
Pascal Quantin fed0e7c2d0 PROFINET DCP: fix dissection of an empty DHCP option
Bug: 15774
Change-Id: Ief2588e5d6f43da708ef071a4490f5f881268820
Reviewed-on: https://code.wireshark.org/review/33186
Petri-Dish: Pascal Quantin <pascal@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Mehmet Oguz Sakaoglu <mehmet.oguz.mnz@gmail.com>
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
2019-05-14 11:13:03 +00:00
Dario Lombardo d352d2168c wimax: fix copy&paste error.
Fix suggested by Mark Hermeling.

Bug: 15750
Change-Id: I0d5e29e549acf797b234175f27aa6e49a5a45436
Reviewed-on: https://code.wireshark.org/review/33080
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-05-06 09:43:56 +00:00
Başak Kalfa 01c161ca43 Revert "ProfiNet: Fix order in AssetManagment"
This reverts commit 1e98cee5e1.

According to Profinet specification, DeviceSubId, DeviceId,
VendorId, Organization must be in reverse order.

Change-Id: I3db3d7d83813239784557286479b37448f70db55
Reviewed-on: https://code.wireshark.org/review/32683
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-04-21 06:20:49 +00:00
Gerald Combs 8d3ac3af86 epan: Convert our PROTO_ITEM_ macros to inline functions.
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-04-04 04:03:38 +00:00
Guy Harris b5eb0c680d Get rid of extra declaration.
Change-Id: Ia08374136ee3a9770cd7bba2d6bf433590061337
Reviewed-on: https://code.wireshark.org/review/32468
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-18 07:02:50 +00:00
Anders Broman 44611384f3 mate: Memory leak in mate_grammar.lemon's recolonize function.
Bug: 15525
Change-Id: I42728bc7b029618d8012cbbbec470b48a8fb2d92
Reviewed-on: https://code.wireshark.org/review/32188
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-02-25 15:30:31 +00:00
Alexis La Goutte 551067767d profinet: fix unused href
Unused href entry: plugins/epan/profinet/packet-pn-dcp.c: hf_pn_dcp_blockqualifier

Change-Id: I3bf53a4fa27043b8398cd2a4d7efbec848e7bca6
Reviewed-on: https://code.wireshark.org/review/32136
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Mehmet Oguz Sakaoglu <mehmet.oguz.mnz@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-02-21 11:47:10 +00:00
Alexis La Goutte d4063f3cae profinet: fix Control flow issues (DEADCODE)
CID 1442818 & 1442815

Change-Id: I8e7201795a780f10923ff6fb0af6b78adc56b75d
Reviewed-on: https://code.wireshark.org/review/32135
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Mehmet Oguz Sakaoglu <mehmet.oguz.mnz@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-02-21 11:46:42 +00:00
moguz d184edbaed PROFINET: Additional DCP features are added.
Missing DCP features are implemented.
Minor bugs are fixed as well.

Change-Id: I2deb00ca61a09cc290a692eadaea4eaa1a52fb85
Reviewed-on: https://code.wireshark.org/review/32030
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-02-18 08:02:26 +00:00
Peter Wu 5eb8edf1cb diam_dict.l,wimaxasncp_dict.l: fix -Werror=stringop-truncation
The given "len" is the size of the string in "txt" excluding the NUL
terminator. GCC 8.2.1+20181127-1 rightfully complains that strncpy will
not terminate the destination buffer.

Change-Id: I592c7c218cf07c13697de4e60f454326a93d1124
Reviewed-on: https://code.wireshark.org/review/31600
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-19 07:08:43 +00:00
Guy Harris 2d41b15495 Add a "failed" return for tap packet routines.
This allows taps that can fail to report an error and fail; a failed
tap's packet routine won't be called again, so they don't have to keep
track of whether they've failed themselves.

We make the return value from the packet routine an enum.

Don't have a separate type for the per-packet routine for "follow" taps;
they're expected to act like tap packet routines, so just use the type
for tap packet routines.

One tap packet routine returned -1; that's not a valid return value, and
wasn't one before this change (the return value was a boolean), so
presume the intent was "don't redraw".

Another tap routine's early return, without doing any work, returned
TRUE; this is presumably an error (no work done, no need to redraw), so
presumably it should be "don't redraw".

Clean up some white space while we're at it.

Change-Id: Ia7d2b717b2cace4b13c2b886e699aa4d79cc82c8
Reviewed-on: https://code.wireshark.org/review/31283
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-01-01 05:03:42 +00:00
Michael Mann c10c7737cc Allow floating point values for stats_tree
Bug: 4234
Change-Id: Ibd59809b2dd9890a7851eb57ef7af384e280a74b
Reviewed-on: https://code.wireshark.org/review/31222
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-12-28 14:50:45 +00:00
Guy Harris 7eb3e47fa4 Try to squeeze some bytes out of the frame_data structure.
Make the time stamp precision a 4-bit bitfield, so, when combined with
the other bitfields, we have 32 bits.  That means we put the flags at
the same structure level as the time stamp precision, so they can be
combined; that gets rid of an extra "flags." for references to the flags.

Put the two pointers next to each other, and after a multiple of 8 bytes
worth of other fields, so that there's no padding before or between them.

It's still not down to 64 bytes, which is the next lower power of 2, so
there's more work to do.

Change-Id: I6f3e9d9f6f48137bbee8f100c152d2c42adb8fbe
Reviewed-on: https://code.wireshark.org/review/31213
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-12-27 04:34:29 +00:00
Hannes Mezger 348f2cfd6e opcua: show invalid OPC UA messages when 'opcua' filter is set
Change-Id: Ia9d14c14c20ef35aefbb0e6b3853450074b4c0a3
Reviewed-on: https://code.wireshark.org/review/31020
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-13 06:39:22 +00:00
Hannes Mezger 3a7df1eded opcua: fix typo, use the commonly used 'Endpoint' instead of 'EndPoint'
Change-Id: I403673962987e4da0711896e8ae3e60af34acb4e
Reviewed-on: https://code.wireshark.org/review/31019
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-12 20:22:24 +00:00
Hannes Mezger 49c6f8e432 opcua: add support for new reverse hello message
The reverse hello message type was added in OPC UA specification 1.04.

Change-Id: I00095e35049b8f38ab183ded1b96af51d788d986
Reviewed-on: https://code.wireshark.org/review/31018
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-12 20:22:06 +00:00
Ba?ak Kalfa 7805221e4a PROFINET: PDPortDataReal_block dissection is changed.
According to specification, PortState is renamed and dissected
as "LinkState.Link" and "LinkState.Port" which are both 8 bits.

Change-Id: I1eff258f48d6fd76286ae08a7d2d80793ea23f12
Reviewed-on: https://code.wireshark.org/review/30913
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-06 06:29:02 +00:00
nakarlsson 26fe83e1db PROFINET: fix dissection of IO conversasion direction
Bug: 15313
Change-Id: I5255f8b03f9d86cd7da8be34a71f0a3932bfca5c
Reviewed-on: https://code.wireshark.org/review/30821
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-30 11:25:59 +00:00
Michał Łabędzki 96224e425d Fix pluginifdemo with DISABLE_WERROR
Change-Id: I19853157ea2cbe3a28c06493a32b73913c1aad84
Reviewed-on: https://code.wireshark.org/review/30429
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-30 15:36:04 +00:00
Jiří Engelthaler b8b8275227 opcua: add missing opcua_nested_count decrement
Nest testing was added in I5f6da3a3e269f6db1b690b77470ddf60045bcedd as
a reaction to CVE-2018-12086. In this changed there was only nest
increment without decrement.

Bug: 15226
Change-Id: I178fad4be1106c8da23351220c95c85274bddc30
Reviewed-on: https://code.wireshark.org/review/30285
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-10-21 18:30:37 +00:00
cacamille3 e0401ad15b Updated OPC UA 1.0.4 enumeration
Change-Id: I55bd26abde59442280833973f6a6b52ba1d7b337
Reviewed-on: https://code.wireshark.org/review/30262
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-10-20 20:30:04 +00:00
Guy Harris 69b5325044 Include transport protocols' hfids in the list of wanted hfids.
We need to get the fields corresponding to those protocols, so we know
the range within the packet that those protocols cover.

Improve a debugging message while we're at it.

Bug: 15208
Change-Id: Idc329079584e8d035622b148503a2ec1a295ccaa
Reviewed-on: https://code.wireshark.org/review/30280
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-20 08:57:41 +00:00
cacamille3 7ca5dba864 added new OPC UA 1.04 AttributesId
Change-Id: I35963ca61792d41cf72895277e61c9fce3870200
Reviewed-on: https://code.wireshark.org/review/30234
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-17 21:30:09 +00:00
moguz 4f5bfb6035 PROFINET: ARServerblock is correctly dissected.
ARServerBlock function causes MalformedPacket error.
Padding in the function is fixed.

Change-Id: I498b1f15abcaab2a0be19096939fae5402747b68
Reviewed-on: https://code.wireshark.org/review/29899
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
(cherry picked from commit c3b0bcaed51b80faaed1bdfbfae111ef162f9672)
Reviewed-on: https://code.wireshark.org/review/29993
2018-10-03 15:11:48 +00:00
basakkal 53ee71c1be PROFINET: Decoding of DCP SetResBlock
At SetResBlock, the field "Response" should be "Option"
according to specification. It is corrected.

Moreover, hf and display filter are changed.

Change-Id: Ieae38616b130efc118673814f9fcee4241e75f05
Reviewed-on: https://code.wireshark.org/review/29988
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-03 12:49:10 +00:00
basakkal 4f44ba31b5 PROFINET: DynamicFramePacking subframes are decoded.
Last version of Wireshark can not decode DynamicFramePacking
subframes. Changes are implemented to decode subframes.

Change-Id: Ifba011418a5211d9599c48d37597a16733dfafa8
Reviewed-on: https://code.wireshark.org/review/29882
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-27 15:44:44 +00:00
Roland Knall 1e98cee5e1 ProfiNet: Fix order in AssetManagment
According to the current Profinet specification in regard
to the coding of the AM_DeviceIdentification field, the
dissection order of DeviceId and VendorId is in the wrong
order.

Bug: 15140
Change-Id: I9954619a938db382967104de91e2b905677cc171
Reviewed-on: https://code.wireshark.org/review/29780
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-09-21 13:01:50 +00:00
Gerald Combs e9ccaf79ae checkAPIs: Add a max termout count for TRANSUM.
Change-Id: I241da2d1c2e46947c31743f9527faa5884767ed9
Reviewed-on: https://code.wireshark.org/review/29763
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-09-20 23:29:37 +00:00
Gerald Combs 8f08a4e74e Try to discourage the use of APIs via counting.
Add the ability to specify maximum function counts for each group to
checkAPIs. Add maximum counts for the "termoutput" and "abort" groups
where needed. Show summaries in various checkAPI targets.

Switch uses of ws_g_warning back to plain g_warning.

Change-Id: I5cbddc8c671729e424eed8551f69116d16491976
Reviewed-on: https://code.wireshark.org/review/29721
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-09-19 16:07:03 +00:00
Pascal Quantin 2ab87102bb TRANSUM: fix crash with current top of tree
ssl filters were renamed to tls.
Also protect against not found fields to avoid a crash in the future.

Change-Id: I181a252557b8261fa134b1331c31096a6205635f
Reviewed-on: https://code.wireshark.org/review/29715
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-09-18 11:14:30 +00:00
basakkal b9333f7f09 PROFINET: AM_Reserved is added on AM_FirmwareOnlyInformation
block

According to specification, AM_FirmwareOnlyInformation is
extended with AM_Reserved.
Dissection of I&M3 was only for read response. Dissection is
 also added for write request.

Change-Id: I281efa2324416b0f98d22ee4e50f2c8f711e2913
Reviewed-on: https://code.wireshark.org/review/29693
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-18 04:05:03 +00:00
Hannes Mezger 28a7a79cac opcua: prevent opcua dissector crash by limiting nesting depth
The OPC UA types DiagnosticInfo, Variant and ExtensionObject can be
nested, which can lead to stack overflows when parsing specially
crafted packets. This is fixed by storing the current nesting depth
as expert info.
The corresponding CVE is https://cve.mitre.org/cgi-bin/cvename.cgi?name=2018-12086
The corresponding security bulletin of the OPC Foundation is https://opcfoundation-onlineapplications.org/faq/SecurityBulletins/OPC_Foundation_Security_Bulletin_CVE-2018-12086.pdf

Change-Id: I5f6da3a3e269f6db1b690b77470ddf60045bcedd
Reviewed-on: https://code.wireshark.org/review/29645
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-14 04:11:20 +00:00
João Valverde 65d9c473f0 plugins: Minor interface improvement
Change the plugin compatibility check to make it more convenient to
define and check the major.minor Wireshark version.

Change-Id: I2a6d2a746682c29504311cce5c457e0a852c3daf
Reviewed-on: https://code.wireshark.org/review/29224
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-08-21 19:56:12 +00:00
Guy Harris 9b731e2b32 Add a tap "finish" callback, called when a listener is removed.
Change-Id: Ic6c23dbd39d1adf8f730f1c866e409f731947475
Reviewed-on: https://code.wireshark.org/review/28786
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-21 00:51:13 +00:00
gizem.yurdagul f20b05f87d PROFINET: Refactoring
According to the prediction, some new features will be
added in the future. I'm working on the implementation
of these new features. dissect_PNIO_status is updated
as "extern" and transferred to the packet-pn.c.
Because upcoming feature will have own c file and it
will use this dissection. Thus, dependence between
classes will be decreased and duplicated code lines
will be prevented. So that future changes will be easier.

Change-Id: I067d9582dcc8b9909e5a9bc3ab5f30d3c879b226
Reviewed-on: https://code.wireshark.org/review/28677
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-07-14 06:48:07 +00:00
Peter Wu 910bc034ab TRANSUM: fix crash when switching profiles
"output_rrpd" is NULL when the TRANSUM dissector is disabled (which is
the default behavior). When switching to a profile where the dissector
is enabled, redissection happens, but without invoking the init routine.
This leads to a crash when dissect_transum tries to query "output_rrpd".

Fix this by creating the map unconditionally. Use wmem_map_new_autoreset
since its contents should be erased for new capture files.

Bug: 13697
Change-Id: Iea897da8faf8042dffdc74327d9d1221e5fb155f
Fixes: v2.3.0rc0-1887-g78d56e5dd7 ("Cleanup transum post-dissector.")
Reviewed-on: https://code.wireshark.org/review/28474
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-27 03:20:09 +00:00
Erika Szelleova 6b13c05da1 OpcUa: fix in function getExtensionObjectType
The function getExtensionObjectType was not reading the corrects bytes,
this sometimes ended in reading outside the buffer and that way
exception was raised even for correct packets.

Bug: 14465
Change-Id: I5d7d9ca5f43f0afbc93f40487a78709c52f0658a
Reviewed-on: https://code.wireshark.org/review/28328
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-21 03:33:21 +00:00
Gizem Yurdagül 9932f496e2 PROFINET: ErrorCode2 is updated
According to specification, pn_io_error_code2_pnio_64
is expanded with new error codes.

Change-Id: I1faf6e8f86a075057520ba4615d1d4f07032931d
Reviewed-on: https://code.wireshark.org/review/28106
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-08 08:25:50 +00:00
Guy Harris 00f51fef21 Don't check the CRC if the message isn't big enough to have a CRC.
We should really do a better length check.  This also suggests that we
might be going past the length if it's too short - should we create a
new tvbuff, with tvb_subset_length(), and dissect based on that?

Bug: 14780
Change-Id: Iaaab529f34b0168ad74c7b4f3e1b4255504c1b57
Reviewed-on: https://code.wireshark.org/review/27930
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-31 17:23:28 +00:00
Guy Harris b1de8c87a1 Older versions of Clang don't understand -Wpedantic.
Define DIAG_OFF_PEDANTIC and DIAG_ON_PEDANTIC, and have it do nothing on
Clang prior to 4.0.

Change-Id: Ic6b2e607659db66f3210401024bf3f2239665506
Reviewed-on: https://code.wireshark.org/review/27649
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-18 22:31:05 +00:00
Peter Wu bb81e1807b Free g_ptr_array_free-related memory leaks
g_ptr_array_free(a, FALSE) returns "a->pdata". Callers that do not
handle this will leak memory (e.g. "tshark -G plugins"). Convert other
users to use the return value instead of direct access to "a->pdata".

Change-Id: I29835477d587f5f54bf0d94cdae9f375e3da3ce3
Reviewed-on: https://code.wireshark.org/review/27437
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-05-14 13:42:10 +00:00
Pascal Quantin 1eda133c36 MATE: fix compilation with gcc 8
mate_runtime.c:816:35: error: cast between incompatible function types from ‘void (*)(void *)’ to ‘void (*)(void *, void *)’ [-Werror=cast-function-type]
mate_parser.l:401:40: error: cast between incompatible function types from ‘void (*)(mate_config_frame *)’ {aka ‘void (*)(struct _mate_config_frame *)’} to ‘void (*)(void *, void *)’ [-Werror=cast-function-type]

Change-Id: I90fbed9c52f6fe43958a0ff11b21f0fe4c23c41a
Reviewed-on: https://code.wireshark.org/review/27267
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-02 21:04:43 +00:00
Stig Bjørlykke 488c831790 Use common indenting space in heading
Change-Id: I47022f9c7d568ca6d9705ba63c669a980822818a
Reviewed-on: https://code.wireshark.org/review/27229
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-01 06:55:55 +00:00
Michalis Kapsalakis e863ece7fc EtherCAT: Fix small bugs for mailbox type
This commit fixes the bug in the EtherCAT dissector for the FoE
mailbox type. With this commit, the dissector displays the
either foe_efw or foe_data in the ECAT_FOE_OPMODE_DATA,
and not both of them as until now.

Bug: 14613

Change-Id: I09fc569f5adc5665c64653087c475f7f1d94639a
Reviewed-on: https://code.wireshark.org/review/25336
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2018-04-22 19:50:57 +00:00
Dario Lombardo 4a156da068 Remove autotools build system.
It has been replaced by cmake.

Change-Id: I83a5eddb8645dbbf6bca9f026066d2e995d8e87a
Reviewed-on: https://code.wireshark.org/review/26969
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-18 03:46:17 +00:00
Peter Wu ccff21854d Forbid leading, duplicated and trailing dots in field names
In order to simplify the display filter scanner, try to restrict the use
of dots ('.') in field names. Forbid leading dots, does not affect
current dissectors. Fix '..' typo in fpp dissector and forbid it. Forbid
trailing dots after fixing dissectors: some of them just have an excess
dot, others are missing a name after the dot.

Change-Id: I6e58a04ef0306ee8c16fbf6a3cabb076d7fc69c9
Reviewed-on: https://code.wireshark.org/review/26967
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-16 15:44:08 +00:00
Guy Harris c7970d9356 Add, and use, "fetch signed value" for lengths < 40 bits.
Add 8-bit, 16-bit, 24-bit, and 32-bit "fetch signed value" routines, and
use them rather than casting the result of the 8/16/24/32-bit "fetch
unsigned value" routines to a signed type (which, BTW, isn't sufficient
for 24-bit values, so this appears to fix a bug
in epan/dissectors/packet-zbee-zcl.c).

Use numbers rather than sizeof()s in various tvb_get_ routines.

Change-Id: I0e48a57fac9f70fe42de815c3fa915f1592548bd
Reviewed-on: https://code.wireshark.org/review/26844
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-10 14:55:45 +00:00
Guy Harris 1a29a70443 Remove const from fields in a dynamically-allocated structure.
There's no need for them to be const, and that causes compiler warnings
when you try to give them a value.

Change-Id: I666a03dd443dff462de0fe2e393284f3341535d0
Reviewed-on: https://code.wireshark.org/review/26834
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-09 22:22:35 +00:00
Guy Harris 777b17c374 Remove const from fields in a dynamically-allocated structure.
There's no need for them to be const, and that causes compiler warnings
when you try to give them a value.

Change-Id: Ib9bb034f3876abb7e86b6c9f41ebdd35192b5af3
Reviewed-on: https://code.wireshark.org/review/26831
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-09 20:36:58 +00:00
Alexis La Goutte 927489dc78 dcerpc-pn-io (profinet): Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
Change-Id: I8dd3fe09d7b5d3132814e3531314220f600746ba
Reviewed-on: https://code.wireshark.org/review/26649
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-26 12:00:48 +00:00
Gizem Yurdagul fd69d893ff PROFINET: Am_location dissection was wrong byte order.
Dissection is updated according to spec.

Unnecessary tab and spaces are removed.

Change-Id: Ia9b3252f5e9dcdc3617286a802fffeef250888c2
Reviewed-on: https://code.wireshark.org/review/26542
Reviewed-by: Birol Capa <birol.capa@siemens.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2018-03-22 07:02:21 +00:00
ciechanowski fa27833548 Removed assert which was only used for debugging.
Change-Id: I647f023e0e40c90a71b3328717c7ab9eaf30aac5
Reviewed-on: https://code.wireshark.org/review/26461
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-13 18:17:21 +00:00
Alexis La Goutte ab7fbb7395 gryphon: fix 'gryphon.usdt.action_flags' exists multiple times with NOT compatible types: FT_BOOLEAN and FT_UINT8
Change-Id: Id273b1f80728042122b6bfa3053d263b25f6bdbe
Reviewed-on: https://code.wireshark.org/review/26412
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-03-11 00:56:04 +00:00
Alexis La Goutte 7ddfccec19 gryphon: Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
Change-Id: I08b59156dbe537c6c4a6b3502ab469c88e984b67
Reviewed-on: https://code.wireshark.org/review/26357
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-08 12:42:27 +00:00
Alexis La Goutte 6a62e2d22d gryphon(.h): fix indent (use 4 spaces)
Change-Id: Ic3ba745e22b5c28ffb8dd9d7fe513c4d86f3d603
Reviewed-on: https://code.wireshark.org/review/26360
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-08 12:41:34 +00:00
ciechanowski cc45082635 Gryphon Protocol dissector fixes and updates.
These updates fix the incorrect "malformed packet" errors.
The updates include Gryphon Protocol commands that were
not included in the prior version of the Gryphon dissector.
Specifically, added LIN Protocol commands for LDF files,
LIN ioctls, LIN signal conversion commands, and USDT
ISO-15765-2 commands.

Change-Id: I746aa871d8496f3a73374eefd52ed900a069d16b
Reviewed-on: https://code.wireshark.org/review/26269
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-07 22:06:16 +00:00
Dario Lombardo fe71e26af2 spdx: more licenses converted.
Change-Id: I3861061ec261e63b23621799e020e811ed78a343
Reviewed-on: https://code.wireshark.org/review/26333
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-07 15:56:44 +00:00
Dario Lombardo 1248c658d1 mate: change strcmp in g_strcmp0 that supports NULL (found by clang).
Change-Id: I66e6183a4f356adfdfd9c55b7b39245a9913857e
Reviewed-on: https://code.wireshark.org/review/25988
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2018-02-23 06:06:33 +00:00
Guy Harris 459bd4646d Don't have CLEAN_FILES variables for the "clean" source files.
Except for the one directory that (currently) has "not yet clean" files,
epan/dissectors, we don't need a separate variable to keep track of the
"clean" source files.

In the cases where not all files were in CLEAN_FILES, put them into the
variable used to enable -Werror or its equivalent.

Change-Id: Ic4119861c1d9e381adfe31e9977e1ac71d623f5b
Reviewed-on: https://code.wireshark.org/review/25830
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-17 02:50:24 +00:00
Guy Harris 5f0d50690a Use -Werror except for explicitly listed dirty dissectors.
Use AM_CFLAGS for everything except for libdirtydissectors in
epan/dissectors.  Rename GENERATED_CFLAGS/GENERATED_CXXFLAGS to
DIRTY_CFLAGS/DIRTY_CXXFLAGS, as it doesn't apply to all generated files.

Change-Id: I702b53e185d6972c08d68ef31c05df7b03669daa
Reviewed-on: https://code.wireshark.org/review/25829
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-17 01:51:59 +00:00
Guy Harris 72b57ac4ef Use DIAG_OFF_FLEX/DIAG_ON_FLEX more consistently.
Add warning C4267 (size_t to int conversion) with MSVC to DIAG_OFF_FLEX.

Addd -Wshorten-64-to-32 with Clang and GCC to DIAG_OFF_FLEX.

Don't explicitly use #pragma to turn off warnings; use DIAG_OFF_FLEX for
all of them.

If we use DIAG_OFF_FLEX, use DIAG_ON_FLEX, even if we have no section of
entirely included code at the end.

Change-Id: Ibfd44e8954704e9a8bcb1bd8e54f31d28357fffb
Reviewed-on: https://code.wireshark.org/review/25817
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-16 19:54:16 +00:00
Guy Harris 8bc1c6e3e8 Add DIAG_OFF_FLEX and DIAG_ON_FLEX for use in Flex scanners.
DIAG_OFF_FLEX turns off all warnings that we want to disable for
Flex-generated code due to some versions of Flex generating code that
triggers those warnings.

DIAG_ON_FLEX restores those warnings, so we do the checks for code that
*we* wrote.

Use them in .l files.

Change-Id: I613a20309a30cd4c61111a1edbe27a5d05fcbf59
Reviewed-on: https://code.wireshark.org/review/25815
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-16 10:35:10 +00:00
Gerald Combs 010c73daa6 Disable warning C4267 in generated files.
Disable warning C4267 in Visual C++ in order to squelch the following
warnings:

   125>dtd_parse.c(1699): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [C:\buildbot\builders\windows-x86-64-petri-dish\windows-x86-64-petri-dish\build\cmbuild\epan\epan.vcxproj]
   125>diam_dict.c(2348): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [C:\buildbot\builders\windows-x86-64-petri-dish\windows-x86-64-petri-dish\build\cmbuild\epan\epan.vcxproj]
   125>C:/buildbot/builders/windows-x86-64-petri-dish/windows-x86-64-petri-dish/build/cmbuild/epan/uat_load.c(1476): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [C:\buildbot\builders\windows-x86-64-petri-dish\windows-x86-64-petri-dish\build\cmbuild\epan\epan.vcxproj]
   130>wimaxasncp_dict.c(2103): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [C:\buildbot\builders\windows-x86-64-petri-dish\windows-x86-64-petri-dish\build\cmbuild\plugins\epan\wimaxasncp\wimaxasncp.vcxproj]

Change-Id: Ie29ae096e5a8b5037abaf3f2aa97754260f4cace
Reviewed-on: https://code.wireshark.org/review/25800
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-15 05:30:48 +00:00
Guy Harris feb8f6b14d Make the DOCSIS dissector a built-in dissector.
Stuff that calls it is built in, and stuff it calls is built in, so
there's not much point in having it be a plugin; we already have
examples of plugin dissectors.

Change-Id: I512e0fda62faedb5f03f476fbece2e267e1d644f
Reviewed-on: https://code.wireshark.org/review/25775
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-13 20:15:19 +00:00
Dario Lombardo d2d1f793f8 plugins: use SPDX identifiers.
Change-Id: I8155573933daeb69c6e4c95c6702bdd6fc1fa89b
Reviewed-on: https://code.wireshark.org/review/25707
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-09 14:12:48 +00:00
Dario Lombardo 8cd389e161 replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.
The first is deprecated, as per https://spdx.org/licenses/.

Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed
Reviewed-on: https://code.wireshark.org/review/25661
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08 14:57:36 +00:00
Guy Harris 121abba1a2 Have individual plugin CMakeLists.txt files add library dependencies.
This removes any knowledge of plugin types from
cmake/modules/WiresharkPlugin.cmake, so that it doesn't have to be
changed if we add a new plugin type.  Revert to the second argument to
add_plugin_library() and install_plugin() being the subfolder.

Change-Id: I668ab90b28c73a8b12ca8e3e906b8de2f9395ca5
Reviewed-on: https://code.wireshark.org/review/25585
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-04 02:03:58 +00:00
Jaap Keuter 903c143769 autotools: Rework the plugin Makefiles
The plugin.c generation in an autotools build comes in from an included
Makefile.am file. The various types of plugins need different parameters
for the generation script. Put the plugin.c production rule is a seperate
include file so each plugin type build can include its own variant.

Also amend the README.plugins file with regards to the new directory
structure and the fact that there are multiple types of plugins, not just
dissector plugins.

Change-Id: I3a815d0d767baa555356cf428861b18697401355
Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-on: https://code.wireshark.org/review/25398
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-01-21 13:13:17 +00:00
Alexis La Goutte ceddf70388 wimax (plugins): fix no previous prototype for function 'proto_reg_handoff_wimax' [-Wmissing-prototypes]
Change-Id: Icc79994ace4e32def3f03cf62b49f3c7dd3011df
Reviewed-on: https://code.wireshark.org/review/25384
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-01-19 12:09:47 +00:00
Michalis Kapsalakis 96e865b4b8 EtherCAT: Add Mailbox as a string in EtherCAT Frame Types.
This commit adds the missing mailbox type to the EthercatFrameTypes
array.

Change-Id: I0710b723cdfa6cff28b6655729dafb68678518cb
Reviewed-on: https://code.wireshark.org/review/25338
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: Dario Lombardo <lomato@gmail.com>
2018-01-16 13:45:06 +00:00
João Valverde 5352ef42f9 plugins: Add source tree subfolder for plugin library
This allows some simplification and makes things more consistent,
particularly for loading plugins from the build dir.

Also fixes the issue reported here:

https://www.wireshark.org/lists/wireshark-dev/201801/msg00061.html

Change-Id: I0d8a000ee679172bccad546a3b0c47a79486f44d
Reviewed-on: https://code.wireshark.org/review/25329
Petri-Dish: João Valverde <j@v6e.pt>
Reviewed-by: João Valverde <j@v6e.pt>
2018-01-16 08:51:37 +00:00