Commit Graph

2695 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
João Valverde 63af1da7e7 Kill libwscodecs plugin library, just use plugins
Change-Id: I085d04840acb53b0b7681787429a2b4e10547cd5
Reviewed-on: https://code.wireshark.org/review/33068
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-06-11 20:59:39 +00:00
João Valverde 57bb2b2a09 Move codec plugins to /plugins
Change-Id: I56d61e2ef737e4326080d75a2302c73a4075e8a1
Reviewed-on: https://code.wireshark.org/review/33067
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-06-11 20:27:21 +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
Guy Harris 8a5b26efb1 Have wtap_read() fill in a wtap_rec and Buffer.
That makes it - and the routines that implement it - work more like the
seek-read routine.

Change-Id: I0cace2d0e4c9ebfc21ac98fd1af1ec70f60a240d
Reviewed-on: https://code.wireshark.org/review/32727
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-04-05 02:49:43 +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 ecefe755d4 l16_mono: fix a typo in CMakeLists.txt
Change-Id: I344354fa50c14828dd5d430ac6a377766b0afeb6
Reviewed-on: https://code.wireshark.org/review/27328
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-05-04 08:43:54 +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
Guy Harris 66c0c4f9e9 Remove more autotools stuff.
Change-Id: I2112e9a24308e2e1c04097df006f32bdf58778c3
Reviewed-on: https://code.wireshark.org/review/27010
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-18 19:57:13 +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
Alexis La Goutte 979808091d l16 (plugins/codecs): fix no previous prototype for ‘codec_register_l16’ [-Wmissing-prototypes]
Change-Id: I5f3bd624f2c5b327e40194fc29f34a11cfd48267
Reviewed-on: https://code.wireshark.org/review/26568
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2018-03-21 06:39:16 +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
Guy Harris 8a677354bd The routines that implement a codec don't need to be public.
Pointers to them are passed to register_codec(), so they can be static
to l16decode.c.

Change-Id: I2303cc4374e81a2e5a77eaa275ca601d99a4f608
Reviewed-on: https://code.wireshark.org/review/26355
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-08 06:47:31 +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
Jaap Keuter 0fb38879af L16_mono: Add L16 monaural codec plugin as functional example
This codec plugin serves a dual purpose.
First it is to add L16 codec suppport to Wireshark.
Second it is an illustration of a basic codec plugin module.

Change-Id: I64394dab3257ae49dece0257b16cd969503918e2
Reviewed-on: https://code.wireshark.org/review/26131
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-28 12:04:29 +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
Guy Harris 1f5f63f8ef Generalize wtap_pkthdr into a structure for packet and non-packet records.
Separate the stuff that any record could have from the stuff that only
particular record types have; put the latter into a union, and put all
that into a wtap_rec structure.

Add some record-type checks as necessary.

Change-Id: Id6b3486858f826fce4b096c59231f463e44bfaa2
Reviewed-on: https://code.wireshark.org/review/25696
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-09 00:29:51 +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 27ae22bd25 usbdump: Add usbdump wiretap plugin as functional example
This wiretap plugin serves a dual purpose. One is to add usbdump file
reading capability to wiretap and therefore Wireshark and Tshark.
Second it is an illustration of a basic wiretap plugin module.

Change-Id: Iefbb156ea1bc5d90dabc1753942cdb9e393714ad
Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-on: https://code.wireshark.org/review/25487
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-30 05:44:38 +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
Guy Harris 3d38b87d86 Fix registration.
Some routines are registered by the standard plugin mechanism, others
are registered internally.  If a first-stage ("register") routine is
registered internally, we must register the second-stage ("reg_handoff")
routine internally as well, otherwise the second-stage routine isn't
recognized by tools/make-plugin-reg.py and is never called.

Bug: 14322
Change-Id: I6eb94c0b74b6fb4d60eb57113d4ada73f4240150
Reviewed-on: https://code.wireshark.org/review/25256
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-01-11 08:48:18 +00:00
Dario Lombardo 8934ddfe73 mate: check LoAL existence (CID: 1159338).
Change-Id: I4acd9d57866c0832241973d349c84b6346a293f5
Reviewed-on: https://code.wireshark.org/review/25046
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-01-09 02:43:53 +00:00
Alexis La Goutte de10174629 transum(plugin) fix typo reponse => response
found by lintian

Change-Id: I8a15c7ba236024448e2ad328b200872b0c622988
Reviewed-on: https://code.wireshark.org/review/25085
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2017-12-31 14:09:42 +00:00
Dario Lombardo d17c26eafb profinet: add a nested fake variable to avoid null dereference.
CID: 1373682
CID: 1394504

Change-Id: I12ac26aad43ba817f71638605ecd6ad05d1af455
Reviewed-on: https://code.wireshark.org/review/25076
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-12-30 13:10:45 +00:00
Alexis La Goutte 65276a4ebb plugins: fix no previous prototype for function 'plugin_register' [-Wmissing-prototypes]
Change-Id: I84f1fd02f99e7d4757e418539f932c550e409f92
Reviewed-on: https://code.wireshark.org/review/24920
Petri-Dish: João Valverde <j@v6e.pt>
Reviewed-by: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2017-12-23 13:09:25 +00:00
Michalis Kapsalakis 7c14949145 EtherCAT: Fix unreached register
This commit fixes the order of register 0x0012 in ecat_esc_registers array
after the changes in 24949

Change-Id: If63921a5e3eb845e470b608161946f0477ff6e21
Reviewed-on: https://code.wireshark.org/review/24953
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-12-23 03:43:50 +00:00
Michalis Kapsalakis e6a350552a Fix unreached registers and typos
This commit fixes the following

  -- changes the order of registers in ecat_esc_register array
     because they cannot be reached by the dissect_esc_register function.

  -- typos in registers' information

Change-Id: Ia73823412abba26377f57fa59ad637879b5b9da1
Reviewed-on: https://code.wireshark.org/review/24949
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-12-22 21:58:29 +00:00
João Valverde c9f54aa1c3 autotools: Fixup plugins Custom.*.example
plugin_ldadd was removed in 262a84c384.

Change-Id: I516aa1be3466433bf8db83ab3d1773bf88082e8c
Reviewed-on: https://code.wireshark.org/review/24850
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2017-12-17 13:34:38 +00:00
João Valverde f3444ed0f9 plugins: Remove moduleinfo.h
Micro version bump for mate to homogenize it between CMake and autotools.
The cmake macro doesn't handle the "a" suffix and it doesn't seem worth
implementing.

Change-Id: Ib022c6aa170623b83a9700e4fa098c60a9cddfab
Reviewed-on: https://code.wireshark.org/review/24847
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2017-12-17 11:47:17 +00:00
João Valverde ee8ca2e1d7 plugin.rc.in: Cleanup some unnecessary code
Also add comment noting that MSVC_VARIANT is not the same thing as
CMAKE_GENERATOR.

Change-Id: Icc0f4a491786e4045c650509957655ef41352b29
Reviewed-on: https://code.wireshark.org/review/24846
Reviewed-by: João Valverde <j@v6e.pt>
2017-12-17 11:47:07 +00:00
João Valverde adde937ed7 plugins: Remove redundant plugin.rc.in files
plugin.rc is Windows specific, also add condition to reflect that.

Change-Id: Ibbb7dab77dd1f277e2302c8f931218ca433f8c72
Reviewed-on: https://code.wireshark.org/review/24833
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2017-12-15 22:09:04 +00:00
João Valverde 995812c5f1 Refactor plugin registration and loading
Put different types of plugins (libwiretap, libwireshark) in different
subdirectories, give libwiretap and libwireshark init routines that
load the plugins, and have them scan the appropriate subdirectories
so that we don't even *try* to, for example, load libwireshark plugins
in programs that only use libwiretap.

Compiled plugins are stored in subfolders of the plugin folders, with
the subfolder name being the Wireshark minor version number (X.Y). There is
another hierarchical level for each Wireshark library (libwireshark, libwscodecs
and libwiretap).

The folder names are respectively plugins/X.Y/{epan,codecs,wiretap}.

Currently we only distribute "epan" (libwireshark) plugins.

Change-Id: I3438787a6f45820d64ba4ca91cbe3c8864708acb
Reviewed-on: https://code.wireshark.org/review/23983
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2017-12-14 08:43:57 +00:00
Gizem Yurdagül f29b3deb6d PROFINET: AdjustMAUType-Extension and CheckMAUTypeExtension
disections are added.

According to specification,
AdjustMAUTypeExtension is a subblock for adjusting MAUTypeExtension.
CheckMAUTypeExtension is a subblock for checking MAUTypeExtension.

Change-Id: Ia90f204887a2e9871bc71e24978ab0095cc0fe1f
Reviewed-on: https://code.wireshark.org/review/24718
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Birol Capa <birol.capa@siemens.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-08 05:33:42 +00:00
Alexis La Goutte f8b19c6eec transum(plugins): no previous prototype for function 'is_dcerpc_stream' [-Wmissing-prototypes]
Change-Id: I3f60eae17b305e2d8982bba5f56d41121676555c
Reviewed-on: https://code.wireshark.org/review/24723
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-07 11:48:03 +00:00
Dario Lombardo 244aab31ee profinet: removed unused var.
Some compilers complain about it:
- clang (all)
- gcc 6
- gcc 7

../plugins/profinet/packet-dcerpc-pn-io.c:2608:27: error: unused variable 'pn_io_mau_type_extension' [-Werror,-Wunused-const-variable]
static const range_string pn_io_mau_type_extension[] = {

Change-Id: Iaffdad31c4ecd7459d07a74e3e2665058c9ff9ba
Reviewed-on: https://code.wireshark.org/review/24715
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-12-06 23:56:56 +00:00
gizem.yurdagul 27f7bbbec2 PROFINET: AdjustPeerToPeerBoundary disection is added.
According to specification, AdjustPeerToPeerBoundary is
a subblock for adjusting the peer to peer boundary.

Change-Id: I4036aa08509300e0b8533c94b991c9a21077f634
Reviewed-on: https://code.wireshark.org/review/24710
Reviewed-by: Birol Capa <birol.capa@siemens.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-12-06 12:41:45 +00:00
Bruno Verstuyft 48841d0b5b DOCSIS: Fixing typos
Change-Id: I25684534dee48158ea0cc1e960808e30cc1376d5
Reviewed-on: https://code.wireshark.org/review/24701
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-04 11:59:31 +00:00
gizem.yurdagul e77dac09f1 PROFINET: AdjustDCPBoundary disection is added.
According to specification, AdjustDCPBoundary is
a sub block for adjusting the DCP boundary.

Change-Id: I2515e2b3592ff0e5e67487b1785db41015964b21
Reviewed-on: https://code.wireshark.org/review/24673
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>
2017-12-01 21:11:51 +00:00
Paul Offord 36372a2465 TRANSUM: Fix DNS-related bug and improve performance
These changes significantly improve the speed and accuracy of TRANSUM.

I have removed the concept of rrpd status as it wasn't being used in any
significant way and created unnecessary code.

The find_latest_rrpd(...) function was becoming very complex which made it
difficult to optimise performance for certain protocols.  To overcome
this, I have introduced an equivalent function for each protocol e.g.
find_latest_rrpd_smb2(...). each of these new functions has a loop that
steps through the rrpd_list.  I could have placed this loop one level up
in the nested call and so had one loop in the code that calls the new
function.  However, I have found that this area is the prime cause of
delays in TRANSUM execution and so I want to avoid calling these new
functions with each step through the rrpd_list.

Finally, I have added code to improve the handling of retransmissions.

Bug: 14210
Change-Id: I038097f22a45ee74173aad1ae5732347f769b9bd
Reviewed-on: https://code.wireshark.org/review/24506
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-11-22 14:37:01 +00:00
João Valverde 5968fc1cae Rename UseMakeDissectorReg.cmake
Change-Id: I2723e7f0309dbe21f23b65818fbea3a7eadf13d4
Reviewed-on: https://code.wireshark.org/review/24514
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2017-11-20 21:31:38 +00:00
João Valverde fe0c2b0485 Rewrite make-dissector-reg.py in C
The output compares equal to make-dissector-reg.py and the regex
should be more robust (multiline, complete start of function definition).

The primary motivation is to clean up the python script. This small
binary results in much cleaner code. The python script is used only
to generate plugin code, therefore it is renamed.

Also in my casual measurements the C code is much faster (without cache)
than the python script with the cache.

Change-Id: Id4e8cac3c836d56775aba4819357a95ef19bcb85
Reviewed-on: https://code.wireshark.org/review/24497
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-20 06:03:08 +00:00
João Valverde 262a84c384 Fix (and chop) static build option
This sets the scope of the static build option to Wireshark support
libraries only.

Before the patch:

Static plugins don't work with CMake and autotools.

autotools static build is broken, and most likely will always be, as
building Wireshark all-static is difficult and time-consuming.

After the patch:

For CMake Wireshark will be built with static or shared libraries and
dynamic plugins. Everything just works. CMake apparently doesn't want
you building static and shared libraries at the same time.

For autotools Wireshark will be built with shared libraries by default.
--disable-shared and --enable-static options work as usual. Dlopened
plugins are not built if --disable-shared is given to configure (to
disable shared libraries). This is a limitations imposed by libtool.

Tested on Linux. This removes broken support for building plugins
statically.

Change-Id: Ib8e8176976f136eea93a2ce8f9857b6cf9bec64c
Reviewed-on: https://code.wireshark.org/review/24241
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2017-11-19 20:16:50 +00:00
João Valverde 1097e8020a autotools: Library build products don't need explicit cleaning
Change-Id: I5d68c05f2844d6c9ae486531b189dbf10bc09cff
Reviewed-on: https://code.wireshark.org/review/24484
Reviewed-by: João Valverde <j@v6e.pt>
2017-11-18 22:29:41 +00:00
Bruno Verstuyft 6f382fed37 DOCSIS: RNGRSP: formatting of equalization coefficients
Change-Id: I6745bee84b096a7008d258a39d99370b1fea29a0
Reviewed-on: https://code.wireshark.org/review/24217
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-11-04 01:25:22 +00:00
Bruno Verstuyft 7e4723a589 DOCSIS: add burst descriptor types. Fixed some bugs.
Change-Id: I9f7df2f62197c574087dbcce2c7b0ba7e6c8c56b
Reviewed-on: https://code.wireshark.org/review/24197
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-31 19:32:37 +00:00
Michael Mann abfb644117 Add conversation endpoint type
For the moment this mirrors the port_type enumeration (PT_XXX), but the
intent is to move away from using "port types", eliminating most (if not
all)

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

Change-Id: Ia0bf553a3943b702c921f185407e03ce93ebf0ef
Reviewed-on: https://code.wireshark.org/review/24166
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-29 16:53:57 +00:00
Michael Mann 7dbc520d57 Privatize the conversation_key structure
The intention is to make it more transparent when making a switch
to an "endpoint" over address/port combination.

Change-Id: Ic424c32095ecb103bcb4f7f4079c549de2c8d9c4
Reviewed-on: https://code.wireshark.org/review/24148
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-28 19:22:24 +00:00
Bruno Verstuyft ce181cbc87 DOCSIS: DPD: adding modulation list to info column
Change-Id: I5d99692d897f17e6e14952db8e4736ca65aa1373
Reviewed-on: https://code.wireshark.org/review/24106
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-28 00:25:40 +00:00
Paul Offord 1ceab868cd TRANSUM: File loading slow with transum enabled
This change improves performance through better handling of SYN -
SYN/ACK pairs.

Bug: 14094
Change-Id: Ie479f1b69fa48f85a2ed9f8f173533db25582bbd
Reviewed-on: https://code.wireshark.org/review/24090
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-27 01:40:51 +00:00
Bruno Verstuyft 3bafae200f DOCSIS: added Energy Management and CM Status Ack modem capabilities
Change-Id: Ieef2cbf34e32f0730af03acc65ebe3499e1fe1f3
Reviewed-on: https://code.wireshark.org/review/24076
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-26 13:45:34 +00:00
Guy Harris 458c3c026e Add a ws_in6_addr typedef for struct e_in6_addr.
That allows a parallel typedef of ws_in4_addr for guint32.

Change-Id: I03b230247065e0e3840eb87635315a8e523ef562
Reviewed-on: https://code.wireshark.org/review/24073
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-10-26 08:50:34 +00:00
Bruno Verstuyft bc924b6283 DOCSIS: fixed TLV name
Change-Id: Ibfc8310e1a150fb2e04f7dad9a68d08e8d0364b7
Reviewed-on: https://code.wireshark.org/review/24032
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>
2017-10-23 12:29:17 +00:00
João Valverde e6e8b7b662 autotools: Sort out how we handle plugin.c
Change-Id: Ie9570a63a1479021753807f76dd5e98fbbec7b86
Reviewed-on: https://code.wireshark.org/review/23995
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2017-10-20 04:37:16 +00:00
Bruno Verstuyft c703ba52ad DOCSIS: Fixed bug where OCD TLVs are nested
Change-Id: I3b6a7c6dabfe017eb6c223ab2491e0a3cda8c56c
Reviewed-on: https://code.wireshark.org/review/23970
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-10-18 14:46:16 +00:00
Bruno Verstuyft bbb1309741 Added default for every switch statement
Change-Id: Ie74dec4d854f65835a4e7e68dac609290a84d791
Reviewed-on: https://code.wireshark.org/review/23957
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-17 23:14:50 +00:00
João Valverde d0a4a614f9 plugins: Remove COPYING and NEWS
We don't need to be this strict for bundled plugins about following
the GNU Coding Standards.

Change-Id: I18ed1b81d428eea15ea387102823f588287daf81
Reviewed-on: https://code.wireshark.org/review/23918
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-10-15 16:51:12 +00:00
João Valverde 9764cd0a83 autotools: make maintainer-clean should allow rerunning 'configure'
Change-Id: Iedae94ffefe27b13b1967d69cacb757b5aa4576d
Reviewed-on: https://code.wireshark.org/review/23928
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-10-15 14:17:20 +00:00
Ahmad Fatoum 9d49e13166 Remove superfluous null-checks before strdup/free
NULL checks were removed for following free functions:

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

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

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

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

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

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

They were also removed around calls to g_strdup where applicable:

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

Change-Id: Ie80c2db89bef531edc3aed7b7c9f654e1d654d04
Reviewed-on: https://code.wireshark.org/review/23406
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-10-15 12:38:51 +00:00
Alexis La Goutte 68ef879711 docsis: fix 'docsis_vsif.gex.sav.spr.static_prefix_address/.gex.imja.imja_ssr_source_prefix_address/.imja.imja_ssr_group_prefix_address' exists multiple times with NOT compatible types: FT_IPv6 and FT_IPv4
Change-Id: I7c978870eb3cc54e718fe3c810f7b4e7f6ea67c9
Reviewed-on: https://code.wireshark.org/review/23897
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-13 12:15:18 +00:00
Alexis La Goutte 1e0dcf8daf docsis: fix
'docsis_vsif.gex.extended_cmts_mic_hmac_type' exists multiple times with NOT compatible types: FT_BYTES and FT_UINT8

Change-Id: Ic3a0f7f6edf5a28ffde6703276d4747d138081c7
Reviewed-on: https://code.wireshark.org/review/23896
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-13 12:14:50 +00:00
Gerald Combs 32d31e55ae WiMAX ASN CP: Leak less memory.
Replace some g_new()s, g_strdup()s and GArrays used in prefix
registration with their epan_scoped wmem equivalents. This reduces
the amount of memory we leak so that we come in below the Valgrind
fuzzer's current threshold (102400).

Bug: 14106
Change-Id: I7308ac89465316c06773552253dabc876b6c2425
Reviewed-on: https://code.wireshark.org/review/23891
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-13 06:10:27 +00:00
Bruno Verstuyft 471736ece0 DOCSIS: added vsif general extension dissection
Change-Id: Ic61815b967fac412fb1a324c470ff5171b97acbb
Reviewed-on: https://code.wireshark.org/review/23840
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>
2017-10-06 10:38:56 +00:00
Bruno Verstuyft 064038bb1b DOCSIS: added dissection of IPv6 classifier TLV
Change-Id: I49a920c2d93dbbc0ae9f8152922485a14225ea9e
Reviewed-on: https://code.wireshark.org/review/23822
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-04 03:39:45 +00:00
Alexis La Goutte ec485f3f52 wimax(-int.h): no newline at end of file [-Wnewline-eof]
Change-Id: I863fe195f314301e2ecd92638e42a0f11dd2af9b
Reviewed-on: https://code.wireshark.org/review/23826
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-03 11:44:58 +00:00
João Valverde 2777003e12 Add version check for plugin compatibility
Only plugins built for the same feature release (X.Y) are assured binary
compatibility. Make sure we don't try to run unsuitable code and, if so,
warn the user. This might happen for example if the user manually copies
a binary plugin to the wrong folder, intentionally or by accident.

I'm using "release version" to loosely mean not a patch release
(i.e: a feature release).

Change-Id: I896e9cbbd2d3843623fff6af8ef51002ec06f1f8
Reviewed-on: https://code.wireshark.org/review/23807
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-10-03 10:09:24 +00:00
Birol Capa a6dec130a9 PROFINET: Fix undecoded signal value in DCP Set Request.
According to specification, when suboption is CONTROL,
signal value is FLASH_ONCE.

Change-Id: I942579cdf3d642e636d02b778ffaad99022678e3
Reviewed-on: https://code.wireshark.org/review/23812
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-02 11:45:45 +00:00
João Valverde 6e24d5f690 Unsplit "m2m" plugin (wimax mac-to-mac encapsulation)
... not to be confused with "machine-to-machine".

M2M seems to be a simple Wimax encapsulation protocol developed by Intel.
It's not documented publicly anywhere that I can find. The boilerplate to
code ratio is huge and it even includes a complete source file from the Wimax
dissector (yuck). Put it in the Wimax plugin instead.

Minor version number bump for wimax plugin.

Change-Id: I2694339dfe89be334093b257a5b34d1577f4dc20
Reviewed-on: https://code.wireshark.org/review/23790
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-01 16:05:05 +00:00
João Valverde 23e2b1f948 Fix make distcheck
Change-Id: I6fc298c5c320fcdbc117ff2ec261e6fe335e178c
Reviewed-on: https://code.wireshark.org/review/23792
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-30 20:19:41 +00:00
João Valverde cf79a87705 WiMAX: Fix possible crash during protocol registration
proto_register_wimax() cannot be assumed to run before all other dissectors
that depend on the global proto_wimax variable. It happens to work now but
registration order is never guaranteed and cannot be relied upon. Wireshark
will crash with a null pointer dereference if proto_register_wimax() is not
run first.

Have proto_register_wimax() call the registration routine for the other dissectors
that depend on proto_wimax to impose the hard-coded order.

Change-Id: I3e9a9ea742f3feeb5b802ad79cfc9ed916264d2f
Reviewed-on: https://code.wireshark.org/review/23788
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-30 11:59:31 +00:00
João Valverde f0e12f0fd3 Remove TPG plugin and dependencies
It doesn't build with autotools and CMake.

Under-documented and unmaintained. Seems to be a work-in-progress
that stalled.

Introduces spurious CMake dependency on yapp.

Change-Id: I0dca1ccbdfd683586c05765437d4b7804ab5cc70
Reviewed-on: https://code.wireshark.org/review/23758
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-28 12:26:01 +00:00
João Valverde 9515fba1fa Remove "easy_codec" source
It's dead, unmaintained and unfinished.

Not in a good enough state to live in the tree.

Change-Id: I6a5c391503b5237638f8362fb9f0492c4cf36223
Reviewed-on: https://code.wireshark.org/review/23745
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-26 20:00:16 +00:00
Bruno Verstuyft cd6ca0da41 DOCSIS: Adding Attribute masks to Service Flow
Change-Id: I626b8a1d85e3062c58f9e3bd7bd6c6123c4b8272
Reviewed-on: https://code.wireshark.org/review/23749
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>
2017-09-26 15:49:09 +00:00
Pascal Quantin 625bab309d Docsis: fix an infinite loop
Add missing decrement of concatlen based on master-2.2 version.

Bug: 14080
Change-Id: I00f7e34f8e599718316a4ce8916d91b780ec7c14
Reviewed-on: https://code.wireshark.org/review/23663
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-25 12:33:42 +00:00
João Valverde 8615e78630 Disable flex-generated [-Wsign-compare] warnings
Change-Id: Iace0462e6bb50573f3e4603f7a19e4b7ee1f9733
Reviewed-on: https://code.wireshark.org/review/23541
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-19 10:06:07 +00:00
Joerg Mayer be995cc120 _U_ is wrong in c++, as is Q_UNUSED (in most cases).
The correct way is to not name the variable.

Change-Id: Ic016f1b9161db6b4cc3f6534c853a1f50e31aa2b
Reviewed-on: https://code.wireshark.org/review/23569
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2017-09-16 14:27:31 +00:00
Stig Bjørlykke 3f8384d779 epan: Fix misuse of comma operator
Change-Id: I349dc9896db0bd306bc92f92eb9d4a65d98d309c
Reviewed-on: https://code.wireshark.org/review/23558
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-09-15 19:52:53 +00:00
Stig Bjørlykke 8b11e37f81 Qt: Use Q_UNUSED macro for unused arguments
Change-Id: I4bf7fe4ba3e3e6575e6537a8ec2b6024c253e776
Reviewed-on: https://code.wireshark.org/review/23559
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-09-15 19:52:40 +00:00
shqking 84ee66b9bc packet-dcerpc-pn-io.c: Fix potential resource leak
Bug: 13826
Change-Id: I01674d5a31281508686bc06e222d6a87926d1c83
Reviewed-on: https://code.wireshark.org/review/23436
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-09-09 12:09:37 +00:00
Michael Mann 935c055c18 DOCSIS: Fix compiler warning on macOS.
Previous functionality presumed cat = 0, so initialize cat to it.

Change-Id: Ic0fdccc8222dfb435178416911d35bac105c6c03
Reviewed-on: https://code.wireshark.org/review/23434
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-09-08 09:16:20 +00:00
Michael Mann 1c777ec044 DOCSIS: Ensure docsis_ucd has a registered dissection function
Bug: 14038
Change-Id: I36fbaa591a7ebf5da7d2e7be837e8fcca30c7f98
Reviewed-on: https://code.wireshark.org/review/23432
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-09-08 01:47:31 +00:00
Bruno Verstuyft 8dedebbf30 DOCSIS: Added support for version 5 MAPs (dissect_map_v5)
Change-Id: Icc43fdc341a8f263af5d7b9e1bc14e13b5361dd0
Reviewed-on: https://code.wireshark.org/review/23392
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-07 23:13:14 +00:00
João Valverde c1ef4693de CMake: Make plugin installation path use PLUGIN_INSTALL_LIBDIR
Change-Id: I47f248f6ef56aba400054fa3ade2bf4d29eeb895
Reviewed-on: https://code.wireshark.org/review/23411
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-06 17:26:46 +00:00
Ahmad Fatoum 0dee5c1911 Fix memory leak in wimaxasncp
Remove unnecessary null-check before free as well.

Change-Id: Ic54459149b40fd8c8f58c643bbd6cfc81ee8b923
Reviewed-on: https://code.wireshark.org/review/23398
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-09-05 19:35:32 +00:00
Bruno Verstuyft 0393c108bc Extra decodings for DOCSIS MDD message
Change-Id: I8765c96717d80f2b340428eb025e0a1e52a6e495
Reviewed-on: https://code.wireshark.org/review/23353
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: Anders Broman <a.broman58@gmail.com>
2017-09-04 16:56:23 +00:00
Bruno Verstuyft 1d157ebeef Extra decodings for DOCSIS RNGRSP
Change-Id: I27ad1143dc5c568a3c7cced4f61c11e45485c7f4
Reviewed-on: https://code.wireshark.org/review/23354
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>
2017-09-03 19:06:10 +00:00
Peter Wu a303bc1f29 transum: clear the list of wanted hfids in file cleanup routine
Be sure to disable the wanted hfids list when the transum dissector is
cleaned up, otherwise it will leak memory when reloading a file while
the transum dissector is enabled.

Change-Id: I2af8edab89da8b3cfb65e19726e1d2546a1dc8d4
Reviewed-on: https://code.wireshark.org/review/23261
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-08-28 23:49:40 +00:00
Gerald Combs c9d0554840 PNIO: Fix another potential OOB write.
Bug: 13847
Change-Id: I62bb519b8e37112a59a7d209b39780f034dbcd0c
Reviewed-on: https://code.wireshark.org/review/23267
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-28 21:39:33 +00:00
Ulf 5574b78dae Fix potential oob write crashes
Bug: 13847
Change-Id: I3a706db25204fe4c1fd1b7be3b17b8c55365dccf
Reviewed-on: https://code.wireshark.org/review/23169
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-08-23 02:58:08 +00:00
Paul Offord 581461bb34 TRANSUM fails with DCE-RPC request Packet Type 0
TRANSUM fails to calculate RTE figures for DCE-RPC where request Packet
Type is zero

Bug: 13988
Change-Id: I1dd7aee0283042703530a6d72fff063279e6147e
Reviewed-on: https://code.wireshark.org/review/23115
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-08-18 12:27:33 +00:00
Pascal Quantin c9cb01adbb IrCOMM: check string length before appending it to item
Bug: 13929
Change-Id: I33f3fec77014949fcc15df72c42ffcb25158562f
Reviewed-on: https://code.wireshark.org/review/22887
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-31 11:16:58 +00:00
Alexis La Goutte 3fa8776a68 dcerpc-pn-io (profinet): fix typo for pn_io.iops display filter
Change-Id: I8422005703c9e0a04d067dfe5ba501fe7417ff8a
Reviewed-on: https://code.wireshark.org/review/22718
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-07-19 22:04:55 +00:00
Michael Mann c2ebb62e7e Don't use uint_to_str_back when you need guint32_to_str_buf.
It will end up eventually crashing column buffers because memory
behind the address is trounced.

Change-Id: Id6b5a42effc503e4b8bf5e1deb2135241e2893f3
Reviewed-on: https://code.wireshark.org/review/22563
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-07-09 19:54:35 +00:00
Alexis La Goutte b6f36e95fa mate_grammar(lemon): fix this statement may fall through [-Werror=implicit-fallthrough] found by gcc7
Change-Id: Id26c1c0d1678613a90ff7707265ec062cd30cf83
Reviewed-on: https://code.wireshark.org/review/22501
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-03 19:58:11 +00:00
João Valverde 7466880e8a Parse enterprise-numbers at run time
"enterprise-numbers" is converted to tab-separated values and renamed
"enterprises". Unused fields are stripped.

PENs are stored in a hash table loaded at run-time.

User "enterprises" file is loaded from the personal config dir.

Misc make-sminmpec.pl improvements and fixes.
Note: names of type "Entity (formerly ...)" have the formerly part commented out for a cleaner output.

Change-Id: I60c533afbe3e399077fbf432088064471ad3e1e2
Reviewed-on: https://code.wireshark.org/review/22246
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: João Valverde <j@v6e.pt>
2017-06-26 22:40:50 +00:00
Pascal Quantin fbfb87a243 PROFINET IO: define an arbitrary recursion depth limit
Bug: 13811
Change-Id: I52bffd4a79dcdad9da23f33e1fc6a868472390bf
Reviewed-on: https://code.wireshark.org/review/22232
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-19 23:45:25 +00:00
Michael Mann 26a6881014 DOCSIS: Prevent infinite loop from unknown FCParm.
concatlen was not updated if FCParm was unknown, leading to an infinite loop.

Bug: 13797
Change-Id: I1b64d757a369183a711f01b0b5cd1ba7aa0787bc
Reviewed-on: https://code.wireshark.org/review/22120
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-14 05:37:27 +00:00
Martin Kaiser 4291968f2a profinet: use proto_tree_add_item_ret_(u)int directly
Profinet defined functions to add 32bit integers to the tree and get their
value. This is equivalent to proto_tree_add_item_ret_(u)int. Call those
functions directly and remove the now obsolete Profinet functions.

In some cases, the returned 32bit value is discarded. Use
proto_tree_add_item then.

Change-Id: I7744fab2f27b8ae8e681a36e4e96eb2f8be87bd6
Reviewed-on: https://code.wireshark.org/review/21989
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-07 08:01:18 +00:00
Martin Kaiser dea13b3cac profinet: use proto_tree_add_item_ret_(u)int
profinet has a number of internal functions that add an item to the tree
and read its value. For 32bit integers, this is exactly what
proto_tree_add_item_ret_(u)int do. Just call those functions.

(We could do the same for 8 and 16bit values. We'd need a temporary
value then and the code wouldn't be much easier than it is now.)

Change-Id: I98fc70ced2dc5a552235a476d40a4275f3b3bd38
Reviewed-on: https://code.wireshark.org/review/21965
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2017-06-06 18:33:35 +00:00
Martin Kaiser 55d0adf689 profinet dcp: simplify dissect_PNDCP_Suboption_Manuf()
There's not much point in having a switch-case block with only a default
statement ;-)

Change-Id: Iaacd87bb2995783b98e5395b3654a1c8f32c473a
Reviewed-on: https://code.wireshark.org/review/21938
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-04 12:22:10 +00:00
Martin Kaiser 9ba786fba3 profinet dcp: don't THROW() an exception from a dissector
In this case, we can simply replace the exception with an expert info
and exit the loop.

Change-Id: I232e554af299140d7123b5e21d78372a35a7923b
Reviewed-on: https://code.wireshark.org/review/21936
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-04 12:10:08 +00:00
Martin Kaiser 2c89cd4bde profinet: remove unnecessary if(tree) checks
Change-Id: I0c4346386846c03a67b83bebfce6da6323379180
Reviewed-on: https://code.wireshark.org/review/21937
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-04 12:02:37 +00:00
Alexis La Goutte 300458b24d opcua: fix no previous prototype for ‘parseNodeClassMask/parseResultMask’ [-Wmissing-prototypes]
Change-Id: If57183bcea978b766fc53f691a35c4ddf98ca2dd
Reviewed-on: https://code.wireshark.org/review/21849
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-31 11:32:28 +00:00
Guy Harris ab6abed139 If we don't have an ARUUID, don't use it as if we do.
Don't use random on-the-stack data as a UUID.

Change-Id: I77961e1404ad73a484a7fc865bc54219dc239b4d
Reviewed-on: https://code.wireshark.org/review/21721
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-20 17:56:05 +00:00
Michael Mann 572a2e93f4 DOCSIS: Simplify all MAC Management into a single file.
Removes a bunch of duplication set up because commands were all in
different files.

Change-Id: I950bc70da0edcdef7aaf21a43328cf69267f79af
Reviewed-on: https://code.wireshark.org/review/21613
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-05-12 18:39:46 +00:00
Camille Guérin 95ec5329a3 OPC UA: Added details for BrowseDescription NodeClassMask and ResultMask
Display the details for the NodeClassMask and ResultMask values in a
BrowseRequest's BrowseDescription.
As described in OPC UA 1.03 Specification, the value 0 for the
NodeClassMask and the value 63 (0x003F) for ResultMask should results in
returning all the fields in the BrowseResponse.
Display 'All' when those fields have those values
Display a detailled bit tree mask when values are different

Code Change:
Added parseNodeClass and parseResultMask
Use them in parseBrowseDescription instead of parseUInt32
Removed not needed anymore hf_opcua_NodeClassMask, hf_opcua_ResultMask
and their related entries in registerFieldTypes

Change-Id: Ic3ed8630825b5456f91156f06b2203ebfa422155
Reviewed-on: https://code.wireshark.org/review/21446
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>
2017-05-12 16:48:18 +00:00
Guy Harris 537eddbc40 Define YYMALLOCARGTYPE appropriately.
Define it, so the generated parser knows what argument type the function
passed to MateParserAlloc() takes.  Use it when declaring
MateParserAlloc().

Change-Id: Ice18fd6b5fdbdb31f527e5d6eb06e78594d4565b
Reviewed-on: https://code.wireshark.org/review/21588
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-10 20:47:35 +00:00
Guy Harris 559952b903 Clean up MateParser routine declarations.
Remove the declarations from mate_parser.l, and have mate_parser.h
include mate.h at the beginning of the file, instead.

Move the #if'ed version of the declaration of MateParserAlloc() to
mate.h.

Change-Id: I03ffdd5f093b179ffc0cb0e43eac093f7e4af65c
Reviewed-on: https://code.wireshark.org/review/21587
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-10 20:42:06 +00:00
Alexis La Goutte 5e944ee2a8 mate (grammar): fix no previous prototype for function 'MateParser/Alloc/Free' [-Wmissing-prototypes]
Change-Id: I87ff11b7c04cb3b6963d4c8c16df2c3d60a0aec8
Reviewed-on: https://code.wireshark.org/review/21574
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-09 23:09:26 +00:00
Adrian Simionov 0972db2f9d docsis: DCC-REQ TLV 2.7 support
Change-Id: I40724306d5facd0f4a5a9ca2354330577857d27f
Reviewed-on: https://code.wireshark.org/review/21563
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-05-09 16:36:21 +00:00
Michael Mann fa5f913256 Bring DOCSIS Mac Management "dissectors" into modernity.
1. Use proto_tree_add_item_ret_uint to remove separate "gets"
2. Remove if (tree)s that prevented expert_info
3. Apply consistent whitespace
4. Apply consistent TLV behavior, making T and L always filterable
5. Remove T name (of TLV) from field name itself (where applicable)
6. Use BASE_UNIT_STRING and BASE_NO_DISPLAY_VALUE

Tested with capture generated from https://github.com/AdrianSimionov/docsis-generator

Change-Id: I9987397ccb3248b2a26d850af468740f94b28a63
Reviewed-on: https://code.wireshark.org/review/21561
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-05-09 04:52:00 +00:00
Alexis La Goutte c1880e3095 dcerpc pn io (profinet) fix conflicting entry in its value_string
Field 'Index' (pn_io.index) has a conflicting entry in its value_string: 45057 is at indices 82 (Sync-Log / RTA SyncID 1 (GSY)) and 114 (reserved for profiles))

Change-Id: Ic3e6f6db0631a9337861cd697b4d7bf17fba0c36
Reviewed-on: https://code.wireshark.org/review/21513
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-05 21:43:19 +00:00
Alexis La Goutte daf3ae77af pn dcp (profinet): fix conflicting entry in its value_string
Field 'BlockQualifier: ResettoFactory' (pn_dcp.block_qualifier_reset) has a conflicting entry in its value_string: 9 is at indices 7 (Resets all stored data) and 12 (Reserved))

Change-Id: I9d43fc44899d47eaafb50a76511dda69560a75da
Reviewed-on: https://code.wireshark.org/review/21512
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-05 18:14:22 +00:00
Adrian Simionov 4302a0ad65 [docsis->dccrsp] Resolve confirmation code
Change-Id: I1f863eea427529537df004e9782311d5c69ed4bd
Reviewed-on: https://code.wireshark.org/review/21505
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-05 12:31:42 +00:00
Michael Mann dbae27f7b2 [DOCSIS] Use expert info instead of THROWing bounds errors for bad lengths
Also adjust whitespace for a few places where if (tree) would mess up
expert_info use.

Change-Id: I79b8f7105515fb9ce220a46f3e875be466ee1044
Reviewed-on: https://code.wireshark.org/review/21474
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-03 16:13:22 +00:00
Adrian Simionov c9f3adda80 [docsis->dccrsp] Update TLV numbers and names to MULPIv3.1-I10
Change-Id: I72bec5bcbe7e2139ae36bf704e7ebda9207331fd
Reviewed-on: https://code.wireshark.org/review/21424
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-05-02 04:06:43 +00:00
Adrian Simionov 64712974ed [docsis->Annex C] Fix TLV 45 decoding
Change-Id: I23830283c1a3323cfb3b72da1e329c72817119ab
Reviewed-on: https://code.wireshark.org/review/21362
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-04-27 12:56:35 +00:00
Adrian Simionov 20d1db6439 [docsis->bpkm-attr] Updated Attribute 16 Error Codes
Change-Id: If9156b4a73e7db006daf4ab4e278379f0e39905f
Reviewed-on: https://code.wireshark.org/review/21313
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-24 16:46:58 +00:00
Guy Harris 913f9fb353 Rename BASE_VALS_NO_UNKNOWN to BASE_SPECIAL_VALS.
It makes it a bit clearer what its purpose is - to allow a value_string
to be used for numeric rather than enumerated fields, giving certain
values of the field a special meaning.

Change the explanation in the documentation to match as well.

Change-Id: Id07b22eee996b79ea5f3473928d29adcabe09bf3
Reviewed-on: https://code.wireshark.org/review/21209
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-18 22:28:07 +00:00
Pascal Quantin 73e2354e4c mate: avoid redefining NDEBUG
When building RelWithDebInfo target with MSVC, NDEBUG is automatically defined.
Avoid redefining the macro by checking if it already exists.

Change-Id: I1720f47cce0df210c2b2dff3b20c218dc2ae7b02
Reviewed-on: https://code.wireshark.org/review/21200
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-18 21:27:27 +00:00
Ahmad Fatoum b478df61f5 Qt: Provide both file save and open preferences
This is a breaking change.

prefs_register_filename_preference hasn't been differentiating
between files to be saved and ones to be opened.

On GTK, a neutral dialog is used, so no problems there.
On Qt, a save dialog has been always used, even in dissectors that
were reading configuration files without modification.

prefs_register_filename_preference now takes an argument to indicate
whether UI could be a save dialog with a warning on overwriting
a file, or whether it's a general purpose open file dialog.

Qt now does this. Previously no warning was shown on overwriting a file,
so it may be used for opening files too without irritating the user.
This has been changed, as non-destructive reads should now use
the open dialog.

Dissectors were changed accordingly.

Change-Id: I9087fefa5ee7ca58de0775d4fe2c0fdcfa3a3018
Reviewed-on: https://code.wireshark.org/review/21086
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-04-17 10:51:10 +00:00
Guy Harris ea1f62a8e8 Get rid of unnecesary #includes.
Change-Id: I379a2a1007be1b844873d9c5e8ea53bd689f0f4d
Reviewed-on: https://code.wireshark.org/review/21158
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-17 03:02:30 +00:00
Guy Harris 4db20ec4a4 Remove unnecessary tap.
The tap was just a trick to get fields and protocols registered as being
of interest.  Now that we have mechanisms by which postdissectors can
explicitly register fields and protocols as being of interest, and are
using that, the trick is no longer needed.

Change-Id: I0bccc88a1e4ee4c9fc84b90d968820375594c5c1
Reviewed-on: https://code.wireshark.org/review/21157
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-17 02:58:22 +00:00
Guy Harris b9c6e2d391 Remove unnecessary tap.
The tap was just a trick to get fields and protocols registered as being
of interest.  Now that we have mechanisms by which postdissectors can
explicitly register fields and protocols as being of interest, and are
using that, the trick is no longer needed.

Change-Id: Ib2620ff32c41ffa050203c1d4481c63535fb3f4b
Reviewed-on: https://code.wireshark.org/review/21156
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-17 02:37:31 +00:00
Guy Harris 407a2b07e5 Rename some routines and structure members.
They deal with sets of hfids, which can belong to protocols as well as
fields (I guess you could argue that a protocol is a field, but...).

Change-Id: Ibd103cfa26427ead4ef54be89f1251908004cfae
Reviewed-on: https://code.wireshark.org/review/21154
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-17 01:49:01 +00:00
Guy Harris 1bfc8580e3 Include protocols in the list of wanted hfids.
That's currently required to get the fields we want.

Bug: 12161
Change-Id: Ic1066334358c58fa915ef886b2658902393172c7
Reviewed-on: https://code.wireshark.org/review/21153
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-17 01:30:00 +00:00
Guy Harris 0cc454359c Consistently call mate_config pointers "mc".
Some routines had "matecfg", some had "mc"; be a bit more consistent.

Change-Id: I3406488315483fb281ebc3fb8a23e9e1b2104a14
Reviewed-on: https://code.wireshark.org/review/21152
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-17 01:23:19 +00:00
Guy Harris dae108837f Make the current MATE config pointer static only to packet-mate.c.
Pass it as an argument to everything else, so only packet-mate.c has the
notion of there being *a* configuration, and everything else takes the
configuration as an argument.

Change-Id: Ia92c1539586d3e71580fd822cf07bd3d79a6f093
Reviewed-on: https://code.wireshark.org/review/21151
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-17 01:18:43 +00:00
Guy Harris d28d537391 No need for this to be a global variable.
Make it local to mate_tree(), and pass it to mate_pdu_tree().

Change-Id: I489683614b4d65aec3ddd94ce2c9077180e769ca
Reviewed-on: https://code.wireshark.org/review/21149
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-16 21:51:03 +00:00
Guy Harris 5d7bd7ca26 Work around a Lemon bug.
There's a Lemon bug where this grammar produces a parser that fails
assertions; to work around it, we disable assert() failures.

(A bug report has been sent to sqlite-users about this.)

Change-Id: I6812b20fafe318425b37755a15009b0baf2d68a2
Reviewed-on: https://code.wireshark.org/review/21148
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-16 21:37:37 +00:00
Michael Mann 9d9bb8ef98 [DOCSIS] Fix typo in docsis_conf_code.
Flagged during value_string duplication check

Change-Id: Ia6b657b6e0d8e60cf69ea0e40199b78e96837ecc
Reviewed-on: https://code.wireshark.org/review/21133
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-16 16:19:59 +00:00
Guy Harris 287a9cf8f3 Revert "Temporary hack to debug the MATE grammar."
This reverts commit c63c5c8c42.

This is probably easier than just abandoning it and trying to remove it from my repository.

    https://xkcd.com/1597/

Change-Id: Ibba2107cfa9c60c86862b16a4cac31689670e137
Reviewed-on: https://code.wireshark.org/review/21127
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-16 11:33:44 +00:00
Guy Harris c63c5c8c42 Temporary hack to debug the MATE grammar.
Builds on my machines, physical and virtual, crash with an assertion
failure in the MATE Lemon grammar when parsing the MATE configuration
file in bug 12161 - on Mac OS X Lion with llvm-gcc, Ubuntu 15.10 with
GCC, and on macOS Sierra with clang.

Builds on the macOS buildbot do *not* fail.

So put the result of Lemon in the MATE plugin into the release tarball,
so I can compare it with what Lemon generates on my machine.

Change-Id: I2d5ecee68535a8b4803de0bd7f02d448ab629083
Reviewed-on: https://code.wireshark.org/review/21126
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-16 11:32:39 +00:00
Guy Harris 581db4c2b8 Get rid of some generated files with "make distclean".
register.c, and the plugin.c for various plugins, are generated by tools
that must be available to do a build, and aren't distributed as part of
the source tarball.  That means "make distclean" should remove them.  Do
so.

Change-Id: I9e37abdafb50234cf1ebb5fb828446e45e605d78
Reviewed-on: https://code.wireshark.org/review/21125
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-16 08:24:01 +00:00
Pascal Quantin c8dd3a1141 mate: move 3 big structures from stack to heap
Change-Id: I03bdb1f17c8c8b79cc78e37b14ac4e959f1ed089
Reviewed-on: https://code.wireshark.org/review/21078
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-04-14 05:47:49 +00:00
Alexis La Goutte e5a120a570 unistim: fix conflicting entry in its value_string
Field 'Stream Based Volume ID' (unistim.stream.volume.id) has a conflicting entry in its value_string: 111 is at indices 0 (C1=0xFF00 C2=0x00 C3=0x00 c4=0x00 Steady on.  -13 dBmO per frequency.) and 1 (C1=0x0505 C2=0x0505 C3=0x0505 c4=0xFF00 3 burst(0.1 sec on,0.1 sec off),Then steady on.-13 dBmO per frequency.))

Change-Id: I49f50688b9e68d597190d891b114eea1ff3e4858
Reviewed-on: https://code.wireshark.org/review/21059
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-13 00:55:23 +00:00
Guy Harris 9769e8af99 Use proto_get_finfo_ptr_array() rather than proto_find_finfo().
As the comments say, proto_find_finfo() is slower than
proto_get_finfo_ptr_array(), as it has to scan the entire tree, and,
given that we're priming the tree with the fields we need (which we
*have* to do to *guarantee* that we'll get the fields we want;
requesting that a protocol tree be constructed isn't sufficient, and
asking for a "visible" protocol tree is overkill),
proto_get_finfo_ptr_array() will work.

Change-Id: Ic1e21105a0a89003a3cdd3d7a2e55ac287ddad5e
Reviewed-on: https://code.wireshark.org/review/21068
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-13 00:10:11 +00:00
Guy Harris 37e45ccba8 Fix indentation.
Change-Id: Idc3d9c40a5f8ecd0f192c289538c3303ba2b7ffe
Reviewed-on: https://code.wireshark.org/review/21067
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-12 23:45:23 +00:00
Guy Harris 847c25c5a7 Prime the epan_dissect_t with postdissector wanted fields if necessary.
This makes sure that postdissectors that indicate that they need certain
fields in the first pass will get them.

While we're at it:

Fix the field-fetching code in TRANSUM not to assume it got any
instances of the field being fetched.

Rename process_packet_first_pass() in sharkd to process_packet(), as
it's the only routine in sharkd that processes packets.

Rename process_packet() in tshark and tfshark to
process_packet_single_pass(), as it's what's used if we're only doing
one-pass analysis.

Clean up comments and whitespace.

Change-Id: I3769af952c66f5ca4b68002ad6213858ab9cab9b
Reviewed-on: https://code.wireshark.org/review/21063
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-12 23:33:37 +00:00
Guy Harris c079255539 Add an API to let a postdissector specify fields whose values it needs.
Currently, this is only used to determine whether a protocol tree needs
to be built on the first pass or not - if there are postdissectors that
need fields, it does - but eventually we should be able to use it to
prime the dissection to deliver those fields in cases where we don't
need the *entire* protocol tree (rather than using a hack such as
cooking up a fake tap with a fake filter to do that).

Update MATE and TRANSUM to use it.

Clean up code to check whether we need a protocol tree, and add comments
before that code indicating, in each case, what the criteria are.

The array of postdissectors includes a length, so we don't need to
separately keep track of the number of postdissectors.

Clean up indentation while we're at it.

Change-Id: I71d4025848206d144bc54cc82941089a50e80ab7
Reviewed-on: https://code.wireshark.org/review/21029
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-12 04:31:19 +00:00
Alexis La Goutte 043df01c56 Add support for BASE_VALS_NO_UNKNOWN
BASE_VALS_NO_UNKNOWN is a special value_string value for only a single
(maybe 2) numerical value(s).  If a field has the numerical value
that doesn't match anything in the value_string, just the number
is supplied for the field (no "Unknown")

Dissectors that had this use case have been converted in the patch.

Change-Id: Ie63a36cceec2fe4436938ec7e3d7f9e690d2b8d9
Reviewed-on: https://code.wireshark.org/review/20736
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-10 20:31:37 +00:00
Guy Harris 2c44a7f930 Clean up handling of enabled/disabled protocols/heuristic dissectors.
Add a "report a warning message" routine to the "report_err" code in
libwsutil, and rename files and routines appropriately, as they don't
only handle errors any more.

Have a routine read_enabled_and_disabled_protos() that reads all the
files that enable or disable protocols or heuristic dissectors, enables
and disables them based on the contents of those files, and reports
errors itself (as warnings) using the new "report a warning message"
routine.  Fix that error reporting to report separately on the disabled
protocols, enabled protocols, and heuristic dissectors files.

Have a routine to set up the enabled and disabled protocols and
heuristic dissectors from the command-line arguments, so it's done the
same way in all programs.

If we try to enable or disable an unknown heuristic dissector via a
command-line argument, report an error.

Update a bunch of comments.

Update the name of disabled_protos_cleanup(), as it cleans up
information for disabled *and* enabled protocols and for heuristic
dissectors.

Support the command-line flags to enable and disable protocols and
heuristic dissectors in tfshark.

Change-Id: I9b8bd29947cccdf6dc34a0540b5509ef941391df
Reviewed-on: https://code.wireshark.org/review/20966
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-08 20:40:08 +00:00
Guy Harris 01ec22994a Don't use proto_tree_add_uint() to add an FT_BOOLEAN field.
We don't allow that.  Use proto_tree_add_boolean() instead.

Change-Id: I59ed0f0dc731b1ce4b5d921cd4e85b1c101cb2a8
Reviewed-on: https://code.wireshark.org/review/20821
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-01 01:43:03 +00:00
Alexis La Goutte 6c374a2a5c profinet (pn-rt): fix 'pn_rt.ds_redundancy' exists multiple times with NOT compatible types: FT_BOOLEAN and FT_UINT8
Change-Id: I5c74a34619ea66c3ac2a77d10b31a3f1256c6595
Reviewed-on: https://code.wireshark.org/review/20707
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-03-25 17:28:08 +00:00
Birol Capa cea41157fd PROFINET: Support the new BlockVersion 1.1 of the record PDPortStatistic.
PDPortStatistic with BlockVersionLow = 1 has 2 bytes CounterStatus while
PDPortStatistic with BlockVersionLow = 0 has 2 bytes Padding.

Change-Id: I39783ad29993501249bfa7875760b505ded6a8e9
Reviewed-on: https://code.wireshark.org/review/20563
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-17 20:51:19 +00:00
Birol Capa 2210ef1c76 PROFINET: Remove AMFilterData Block
Since AMFilterData block is removed from PROFINET specification,
related parts are removed from dissector.

Change-Id: I0f9f346fd409fc0cb78f4d7a8ca5869229d68bed
Reviewed-on: https://code.wireshark.org/review/20546
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-16 04:48:31 +00:00
Birol Capa 20d7669bbe PROFINET: Fix the Asset Management Record Dissection
Dissecting AMR doesn't work properly when AM_Location.Structure don't equal to 2.

Bug: 13480
Change-Id: Ie116e10f6e88e240b2f1ae4e1eab27b24350e55a
Reviewed-on: https://code.wireshark.org/review/20529
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Birol Capa <birol.capa@siemens.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-14 12:21:48 +00:00
Birol Capa 41b4f0b6ea PROFINET: Extend System Redundancy Support
A special ARType for System redundancy IOCARSR (0x0020) used to indicate
SR during the IODConnectReq for Advanced Startup ARs (StartupMode:=1).
With this change, the ARUUID is subdivided into several parts.
APDUStatus dissection is affected by Primary/Backup switchover.

Bug: 13456
Change-Id: I0504ad2f4d15c491b0142c6d24bb8b849a929ba2
Reviewed-on: https://code.wireshark.org/review/20422
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>
2017-03-12 18:18:09 +00:00
Alexis La Goutte ecd598ae69 unistim (plugin): fix this statement may fall through [-Werror=implicit-fallthrough] found by gcc7
Change-Id: Id928c9f4506b3f88016d77e3e79a4ecf78d52e93
Reviewed-on: https://code.wireshark.org/review/20494
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-11 17:36:04 +00:00
Roland Knall 807fe8ed99 pluginIF: Allow en-/disable of elements
Allow the enable/disable of an element

Change-Id: I9652e8d74b261ba259cebfba53e7bc7ef560d347
Reviewed-on: https://code.wireshark.org/review/20370
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-03-04 00:56:51 +00:00
Roland Knall 85aa48cef2 pluginIf: Add/Remove single entries from selector
Allow to add and remove single items from a selector list and also
fixing the selection of items in a selector list

Change-Id: I0c69ea97db6ca1a6932939f0df9049c6fb720f77
Reviewed-on: https://code.wireshark.org/review/20363
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-03-03 15:13:13 +00:00
Stig Bjørlykke e8ff9f5b48 pluginifdemo: Adjust title texts
Small improvement in the title texts.

Change-Id: Ia413577386dab11f78fd141d6333944beefb5b33
Reviewed-on: https://code.wireshark.org/review/20295
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-02-27 11:41:00 +00:00
Roland Knall 321386e9f4 PluginIF: AdditionalToolbar
Creates an interface for plugins and other parts of the code, to
add a new toolbar to the system and have various widget types interact
with this toolbar.

All toolbars added via this interface, will be added to an additional
submenu called "Additional Toolbars" within Wireshark.

Also a demo plugin is being provided, demonstrating various features
of the toolbar, including updating the gui elements. It also demonstrates
how to update toolbar items.

Change-Id: I8d0351224b3d7f4b90220d58970b51695551d7e3
Reviewed-on: https://code.wireshark.org/review/19803
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-02-24 08:12:46 +00:00
Michael Mann 5d3d96cac4 transum: Add protections against NULL trees.
proto_find_finfo doesn't have NULL tree protection, so protect it from
transum dissector.

Bug: 13395
Change-Id: I1037c675cf10b959f116b20b12cc7b388c175cd3
Reviewed-on: https://code.wireshark.org/review/20077
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-02-18 03:09:38 +00:00
Hannes Mezger 7e9b7b5967 opcua: display abort messages correctly
Change-Id: I795fc3a3cf4ca93483f870d229668d7f747bb799
Reviewed-on: https://code.wireshark.org/review/20147
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-02-16 17:32:08 +00:00
Michael Mann af54b292e6 Register reassembly tables
Register all reassembly tables with a central unit, allowing the
central unit to have the callback that initializes and destroys
the reassembly tables, rather than have dissectors do it individually.

Change-Id: Ic92619c06fb5ba6f1c3012f613cae14982e101d4
Reviewed-on: https://code.wireshark.org/review/19834
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-29 13:29:04 +00:00
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