Commit Graph

142 Commits

Author SHA1 Message Date
João Valverde a201eaf118 MinGW: Enable -Werror by default 2023-01-17 15:04:40 +00:00
João Valverde 389e70722c MSYS2: Disable -Werror by default 2023-01-14 14:52:53 +00:00
João Valverde 4c9b0d846c CMake: Reverse debug macros
Originally WS_DISABLE_DEBUG was chosen to be

However generator expressions are essential for modern CMake
but the syntax is weird and having to use negations makes it
ten-fold worse.

Remove the negation. Instead of changing the CMake variable
reverse the macro definition for WS_DISABLE_DEBUG.

The $<CONFIG:cgs> generator expression with multiple config arguments
requires CMake >= 3.19 so we can't use that yet for a further
syntactical simplification.
2023-01-12 00:59:15 +00:00
João Valverde 25d4a099f7 Remove WS_DISABLE_ASSERT
Assertions can be enabled/disabled using WS_DISABLE_DEBUG. The extra
granularity afforded by WS_DISABLE_ASSERT seems unnecessary.
2023-01-12 00:59:15 +00:00
João Valverde 2d3de008f5 CMake: Disable UTF-8 debug checks for release builds
Disable UTF-8 debug checks for release builds for optimization

Also remove unused macro that currently lacks a proper use case.

Change version info to be more complete about the build type without
being too verbose.
2022-12-15 01:57:39 +00:00
Joakim Karlsson 5b8cb733fa asn2wrs: disable line directive by default
To debug with line directive build with -DENABLE_DEBUG_A2W=ON flag
2022-11-30 11:03:09 +00:00
João Valverde 18b161c80f CMake: Split "extra" warnings into interesting/not interesting
Add another category for warnings that are worth looking


Disable pedantic warnings in the CI builds.

Add Clang specific warnings to standard category.

Fix or workaround -Wunreachable warnings.
2022-11-18 10:04:50 +00:00
João Valverde e1d492e2e0 CMake: Do not disable -Werror with "extra compiler warnings"
Give the ENABLE_WERROR option full control of -Werror. Silently
overriding the user configuration is potentially confusing and
2022-11-17 11:22:57 +00:00
João Valverde 6d06d4e46b Add some UTF-8 debug checks with a compile time flag
Some older dissectors that predate Unicode and parse text protocols
are prone to generate invalid UTF-8 strings. This is a bug and can have
safety implications.

For example passing invalid UTF-8 to proto_tree_add_string() is a
common bug. There are safeguards in format_text() but this should
not be relied on as a general solution to the problem.

For one, as the name implies, it is only used with representation of a
field value, which is not the same as the value itself of an FT_STRING field.
Issue #18317 shows another reason why.

For now this compile flag only enables extra checks for string ftypes,
which covers a subset of proto.h APIs including
proto_tree_append_string(). Later is should be extended to other

This is also not expected to be disabled for release builds because
there are still many dissectors that do not correctly handle strings.
More work is needed to 1) identify them and 2) fix them.

Ping #18317
2022-09-27 17:04:44 +00:00
Gerald Combs 5243ffa4c2 extcap: Add falcodump.
Add an extcap that fetches a scap from a Falco/libsinsp plugin. Tested
using the cloudtrail plugin.
2022-08-29 15:35:19 -07:00
João Valverde b33210750c CMake+etc: Enable Qt6 by default for Unix builds
Linux builds were left behind on the Qt transition, presumably because
our Ubuntu CI image does not support Qt6.

Enable Qt6 by default and explicitly disable it for slower or more
conservative Linux distros.

Drop experimental status for Qt6, because we are using it to build
official Windows and macOS releases.
2022-08-22 09:08:06 +00:00
Gerald Combs 75efbb1ac4 Rename Logwolf to Logray
Switch to the name "Logray" for the log analyzer. Rays are biological
cousins of sharks and more people like the name "Logray" in a completely
unscientific survey here. Apologies for any inconvenience this might
2022-07-06 15:04:25 +00:00
Gerald Combs c552665fd3 CMake: Enable Qt6 if WIRESHARK_QT6_PREFIX_PATH is set.
Remove the "developers only" admonition.
2022-05-20 15:27:49 -07:00
John Thacker 3407992cb4 CMake: Bump minimum CMake version to 3.10
Linux distributions that have a version less than 3.10 are either
almost at end of support (Debian Stretch), or will be supported by
Wireshark 3.6 LTS (RHEL 7, SLES 12).

The Windows minimum is already 3.13. Increasing the minimum required
means that policies CMP0069 and CMP0071 are automatically set to NEW,

Fix an error in the Qt version comparison; it's Qt 5.14 that first
required macOS 10.13 High Sierra, not Qt 5.15.
2022-04-21 20:24:52 -04:00
Gerald Combs 5d3ffe9b57 More Logshark to Logwolf renaming. 2022-04-04 09:39:27 -07:00
Gerald Combs 245f988e9e Logshark: Add initial UI.
Add a separate UI application named "Logshark". It's currently a very
thin superclass of Wireshark, but that will change over time. Based on
work by Loris Degioanni.
2022-04-04 09:39:26 -07:00
Gerald Combs 110dbffbe9 Rename Sysdig Bridge to Falco Bridge.
The Sysdig Bridge plugin loads Falco plugins, so rename it to Falco

Make it optional and dependent on libsinsp+libscap, similar to our codec

Remove some unused code.
2022-03-22 17:51:32 +00:00
Gerald Combs e39b9a2f80 CMake: Disable fuzzshark by default.
Most people don't use fuzzshark, so don't waste compute resources
building it. OSS-Fuzz has been updated to always build fuzzshark in
2022-03-11 17:35:49 +00:00
Adrian Granados 8622c92a75 extcap: new interface, wifidump, to capture Wi-Fi frames using a remote SSH host 2022-03-09 08:01:39 +00:00
João Valverde 119473eab3 CMake: Use more consistent naming for options
Having some options use DISABLE_ and others ENABLE_ is inconsistent
and difficult to remember. Use ENABLE_ instead consistently.

Frame-larger-than remains an exception.
2022-01-03 15:55:06 +00:00
Joerg Mayer 24a364f762 Get CMake to successfully work with Qt6
Of course it still fails in the compile phase, but only for some
of the ui/qt/ files.

Wireshark with Qt5 still compiles and runs.

To do the build invoke cmake with the following settings added:
export CMAKE_PREFIX_PATH=:${MY_QT6_PREFIX}/lib/cmake
cmake -DUSE_qt6=ON ...

Independently of this patch there is lots of Qt-stuff in
CMakeLists.txt that needs review/cleanup:
- Some of the stuff can probably be solved in a less hacky way:
  + There seemed to be a way for QT6 to provide the required c++-standard,
    but in the end I could not find it.
  + Once we have a working Qt6 codebase, we may get rid of the USE_qt6
    flag and just test for Qt6Core first and if not present check for
- All comments that match /qt ?[4-6]/i need reviewing/cleaning up.
- The changes in this patch have been tested to work on all machines
  that are my mac (macos 12.0.1, XCode 13.1, Intel, GPL-Qt6.2.1 with only
  the macos package selected, cmake 3.21.4)

Add ui/qt/qt6-migration-links.txt for some possibly helpful links
2021-11-24 10:31:16 +00:00
João Valverde b9f2e4b7fa Make PCRE2 a required dependency 2021-11-14 21:00:59 +00:00
João Valverde ed8a02af17 dfilter: Add support for PCRE2
PCRE2 is the future of PCRE. The only advantage of GRegex is that
it comes bundled with GLib, which is not an advantage at all.
PCRE2 is widely available, the GRegex abstractions layer are not a
good fit and abstract things that don't need abstracting or that we
could handle better ourselves, there are open bugs (#12997) and
maintenance is spotty at best.

GRegex comes with many of the problems of bundled code, aggravated by
the fact that it completely falls outside of our control.
2021-11-14 21:00:59 +00:00
João Valverde 0c735dcf0a MinGW-w64: Disable building 'etwdump' 2021-09-21 14:52:32 +00:00
João Valverde 3467b98eb7 CMake: Make LTO default off, restrict to release build
Link Time Optimizations increases build time a lot so restrict
this optimization to release builds. Follow our build bots and
make this option default off.

Also LTO requires CMake >= 3.9 so make the LTO CMake option
universally conditional on that requirement.
2021-07-26 15:13:38 +00:00
João Valverde af2a88cd18 CMake: Reverse logic to handle debug code
Only enabling debug code by default with Debug build type
seems overly restrictive; debug output is still conditional
on the log level.
2021-06-10 00:57:49 +01:00
João Valverde 92269631a7 CMake: Disable LTO again by default
After some experimentation results with GCC and clang seem poor, compilation
times are terrible and I don't feel confident enabling it by default yet. More
testing is needed.
2021-05-24 21:23:45 +00:00
João Valverde f273c62553 CMake: Enable LTO/IPO support for all platforms 2021-05-24 15:58:16 +00:00
João Valverde 9ba97d12d6 Add ws_debug() and use it
Replace most instances of ws_debug_printf() except in
epan/dissectors and dissector plugins.

Some replacements use printf(), some use ws_debug(), and
some were removed because they were dead or judged to be
2021-05-24 01:13:19 +00:00
João Valverde 8eacd615c8 Disable assertions for release builds
Currently our build generates very many warnings if
G_DISABLE_ASSERT is defined.

Add ws_assert() and ws_assert_not_reached() to incrementally
replace existing assertions and then disable them using

Assertions are disabled with CMake build type Release.
By default the build type is RelWithDebInfo so the current
behaviour of enabling assertions by default is (for now) preserved.

Add some notes to README.Developer.
2021-05-19 03:52:45 +01:00
Gerald Combs 2549e51ee4 Remove unneeded c-ares checks.
C-ares has been mandatory since 451a241e50. Remove some checks that are
no longer needed.

THIRD_PARTY_PDBS in CMakeLists.txt, which is more accurate.
2021-04-27 05:36:49 +00:00
Pascal Quantin c713fb3b7d Windows: move ENABLE_VLD to CMakeOptions.txt 2021-04-26 21:37:06 +02:00
Gerald Combs 1dc50f7433 CMake+CI: Colorize our compiler output.
As described at

both Clang and gcc generate colorized output when they detect a
terminal, but not for piped output, which is the case when using Ninja.
Add an ENABLE_COMPILER_COLOR_DIAGNOSTICS CMake option, and set it to
"ON" when we're using Ninja.

In the merge-req:ubuntu-gcc-ctest and merge-req:ubuntu-clang-other-tests
GitLab CI jobs, generate colorized HTML report artifacts using
2021-04-14 12:42:00 -07:00
Odysseus Yang 2a5b34d8b0 MBIM: Update dissector to support DLT_ETW
New link type DLT_ETW is added for write and read Event Trace on Windows.
This change updates MBIM dissector to decode a MBIM message from
a DLT_ETW packet.
2020-12-02 09:05:11 +00:00
Lin Sun 6136c719da RTP: opus playback
It's possible to play opus payload with libopus (
Closes #16882.

Helped-by: Pascal Quantin <>
Signed-off-by: Lin Sun <>
Signed-off-by: Yuanzhi Li <>
2020-10-03 21:15:09 +00:00
Graham Bloice e6b5bd0976 Build: Add LTO/IPO support
Enable Link Time Optimization, also known as Interprocedural Optimization
if the compiler supports it.

Added a CMake option (ENABLE_LTO), defaulted to ON only on Windows

Change-Id: Iea02b00aac12cc9a62595eeb8ff52382f1c4ddcd
Reviewed-by: Graham Bloice <>
Petri-Dish: Graham Bloice <>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <>
2020-08-04 05:21:01 +00:00
Peter Wu ef717da61a CMake: remove ENABLE_PCAP_NG_DEFAULT option
pcapng has been the compile-time default since 2011. If there are any
users who would like to use the libpcap format, then they should use
runtime options instead (e.g. `tshark -P` or `editcap -F pcap`).

Change-Id: I54b70368cdc3ca78bc8617bc488cc687740a1eb9
Petri-Dish: Peter Wu <>
Reviewed-by: Gerald Combs <>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <>
2020-04-06 01:29:37 +00:00
Jirka Novak 12a13a6926 RTP: decode iLBC payload
It is possible to decode iLBC payload. It uses libilbc library (

Bug: 16314
Change-Id: Id4cad7ae32305a0e94ef32beb24e07733d7f834e
Reviewed-by: João Valverde <>
Petri-Dish: Pascal Quantin <>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <>
2020-01-20 07:50:08 +00:00
Gerald Combs 02057200fd macOS: Add support for automatic updates using Sparkle.
Add support for automatic updates using the Sparkle framework. Add
FindSparkle.cmake and associated CMake plumbing. Add a public key and
other info to Add ui/macosx/sparkle_bridge.{h,m}, which
wraps the Sparkle API. Make code that's specific to WinSparkle

Add Sparkle installation steps to the macos-setup scripts. Sparkle
prints a warning if your bundle is unsigned (which is the case during
development) so disable installing it by default.

Updating here takes a long time. We might be able to fix that by
shipping our DSYMs separately.

Change-Id: I6cc6671db5657dadc514bda6bf6e1c8bbc9468a5
Petri-Dish: Gerald Combs <>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <>
2019-11-15 18:39:04 +00:00
Piotr Smolinski ad94c4d459 Kafka: include zstd compression in Kafka message batches
Change-Id: I1d06486ccf7b174ee9aa621fa3d8acb8b3673777
Petri-Dish: Anders Broman <>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <>
2019-08-20 13:50:45 +00:00
Roland Knall 390071ed0b Qt: Import Profile information
Allow easy import of profiles. Profiles must be stored inside
a zip file, with no additional hierarchy.

Change-Id: I0ae77460c20ef6b3e447906e671b0cefa6b9b032
Petri-Dish: Roland Knall <>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <>
2019-07-17 18:25:11 +00:00
Fabrice Fontaine 900b9f1379 CMake: add USE_STATIC option
 - always link statically with external libraries (such as glib2)
 - will not set rpath to avoid the following error:

CMake Error at cmake_install.cmake:50 (file):
  file RPATH_CHANGE could not write new RPATH:


  to the file:


  No valid ELF RPATH or RUNPATH entry exists in the file;

Change-Id: I242dc1a091cc211ee891568a2dee5080c9974fba
Ping-Bug: 15713
Signed-off-by: Fabrice Fontaine <>
Petri-Dish: Peter Wu <>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <>
2019-04-23 23:19:40 +00:00
Dániel Bakai 9ce60b173b Add brotli decompression support for HTTP and HTTP2 dissectors.
Change-Id: I9c09f55673187f6fee723fcd72798fb6b9958b03
Petri-Dish: Peter Wu <>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <>
2019-04-22 15:24:46 +00:00
Peter Wu ac58eafa32 Add support for RSA decryption using PKCS #11 tokens
Add support for loading RSA private key files from PKCS #11 tokens,
identified by PKCS #11 URIs. Add a new 'pkcs11_libs' UAT which can
dynamically load PKCS #11 provider libraries that are not found by

The configuration GUI will need additional code to discover available
PKCS #11 tokens and will be added later.

This feature requires GnuTLS 3.4 with PKCS #11 support, so Windows,
macOS via Homebrew, Ubuntu 16.04, Debian Stretch. Not supported: RHEL7.
Currently macOS via official packages disables PKCS #11 support, so that
will also not work.

Change-Id: I20646bfd69c6bd13c8c2d27cb65c164a4b0b7a66
Petri-Dish: Peter Wu <>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <>
2018-12-29 10:40:16 +00:00
Peter Wu 7e88bb5e53 fuzzshark: integrate oss-fuzz targets in CMake
The current fuzzshark target built by CMake is not usable for fuzzing.
Address this by adding a new ENABLE_FUZZER option that enables mandatory
instrumentation and libFuzzer linking options for the fuzzshark binary.

Create more CMake targets for specific fuzzing targets such as
fuzzshark_ip and fuzzshark_ip_proto-udp. These targets are not built by
default, either build individual targets or use the all-fuzzers target.

Now these binaries are not specific to oss-fuzz, so move them to a new
directory (perhaps the corpora can be added here in the future).
oss-fuzz is simplified and reuses the CMake targets.

When OSS_FUZZ is set, it will force static linking with external
libraries and limit parallel linker jobs (maybe not necessary for
Google's oss-fuzz builders, but my 8G/6c VM ran out of memory).

Change-Id: If3ba8f60ea1f5c3bd2131223050a81f9acbce05d
Petri-Dish: Peter Wu <>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <>
2018-10-20 07:00:43 +00:00
Gerald Combs f69108b84e Add a systemd Journal Export extcap.
Add an sdjournal extcap, which reads journal entries using the
sd-journal API and dumps them as journal Export Format records.

Change-Id: I17ccfa88ab5d053c16c869cd26e580d84022502e
Reviewed-by: Gerald Combs <>
Petri-Dish: Gerald Combs <>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <>
Reviewed-by: Anders Broman <>
2018-10-01 08:58:13 +00:00
João Valverde e75905a583 CMake: Add dumpcap group option to installation
Change-Id: I2718776a908ae5f9c6c475a110f9170b812b392d
Petri-Dish: João Valverde <>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <>
2018-08-25 18:06:56 +00:00
João Valverde e09c9a8e46 CMake: Format for readability
Change-Id: I6c3ba0f09c9eb59abc24798930ffa5e51feb2cf1
Petri-Dish: João Valverde <>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <>
2018-08-25 18:01:46 +00:00
Dirk Eibach e0002b0427 extcap: Support for DisplayPort AUX channel monitors
Support for the generic netlink DisplayPort AUX channel monitor kernel driver.

Change-Id: Iab445229ecef082968355f604993292f5f2d8d69
Petri-Dish: Dario Lombardo <>
Tested-by: Petri Dish Buildbot
Reviewed-by: Dario Lombardo <>
Reviewed-by: Roland Knall <>
2018-05-14 10:44:37 +00:00
Gerald Combs 55f6f6593c CMake: More Qt4 removal.
Remove some Qt major version checks. Remove the ENABLE_QT5 option.

Change-Id: I891bc90956a2ea2cd5a7c50c56d9fcbfc963d6c2
Petri-Dish: Gerald Combs <>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <>
2018-04-09 01:35:28 +00:00