Commit Graph

1406 Commits

Author SHA1 Message Date
Gerald Combs 5373483963 Tools: Add a CMakeExecutable parameter to win-setup.ps1.
52054046c1 switched archive extraction from 7Zip to CMake. This removed
a dependency on 7Zip, but assumed that CMake was in our PATH.  Add a
CMakeExecutable to win-setup.ps1 and use it in CMakeLists.txt to pass
the value of CMAKE_COMMAND.
2022-05-26 20:13:18 +00:00
João Valverde ab33d9b809 Qt6+MSYS2: Fix windeployqt usage
The msys2 qt6 package installs windeployqt as windeployqt-qt6.
2022-05-25 23:46:23 +01:00
João Valverde ce52af1a32 CMake: Disable errors with -Walloc-size-larger-than=
This seems to be buggy and have a complicated interaction with
the GCC optimizer. Disable hard failures so we can focus on
actual issues and deal with dormant false positives when it is
convenient.

Ping #18089
2022-05-23 23:03:59 +01:00
Gerald Combs 565670c1c8 Version: 3.7.0 → 3.7.1
[skip ci]
2022-05-11 13:12:42 -07:00
Gerald Combs 52db7e88bc Falco Bridge: Fix building on Windows.
Fix Falco plugin installation in multi-config environments. Fix FindSinsp
on Windows.  Ignore a couple of warnings for now.
2022-04-27 22:01:17 +00:00
Gerald Combs dbf3ac3701 CMake+Logwolf: Populate our Falco plugin directory.
Create plugins/<version>/falco and copy over the Cloudtrail plugin.
2022-04-25 12:07:48 -07:00
Gerald Combs fc2cc05dde Move some configuration and data files to resources/share.
Create resources/share/wireshark and resources/share/logwolf. Move
various data and configuration files to resources/share/wireshark and
add resources/share/logwolf/colorfilters.
2022-04-25 09:18:57 -07:00
John Thacker 2b24b512ca rpm: Support for building with clang on Fedora
Fedora now supports rpm options to build with clang as the compiler
https://docs.fedoraproject.org/en-US/packaging-guidelines/#compiler
2022-04-25 08:52:23 -04:00
John Thacker 91987dc0ab nghttp2: Implement minimum required version 1.11.0
All currently supported Linux distributions have a version greater
than 1.11.0 (and our macOS and Windows versions are also much greater),
and this allows us to use nghttp2_hd_inflate_hd2(), which replaced the
deprecated nghttp2_hd_inflate_hd()
2022-04-24 10:24:11 -04:00
John Thacker d2064ae188 gnutls: Bump version to 3.5.8
Bum the minimum version of GnuTLS to 3.5.8, which was the first stable
release in the 3.5 series. All the currently supported Linux
distributions have a version at least this new.
2022-04-23 02:26:08 +00:00
Gerald Combs 4cc20bb49e CMake: Fail if we're building for 32-bit Windows.
Fail noisily if we're building for 32-bit Windows. Ping #17779.
2022-04-22 17:25:31 +00:00
John Thacker 2dd07bc5b9 glib: Bump required version to 2.50
All the currently supported distributions have at least 2.50.
Remove a version check.
2022-04-22 12:55:37 +00: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,
and we can use VERSION_GREATER_EQUAL.

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 4bb16383a3 macOS: Require Sparkle 2.
Remove our Sparkle 1 code. Fixes #18035.
2022-04-21 17:54:27 +00:00
John Thacker b80cdaa243 libgcrypt: Require version 1.8.0
Libgcrypt 1.8.x is required for a large amount of decryption
support and is the current LTS version of libgcrypt. The 1.6 and
1.7 series have been end-of-life since 2017-06-30 and 2019-06-30,
respectively.

The Linux distributions that have versions of libgcrypt before 1.8.0
are nearing or at end of support (RHEL7, SLES 12, Debian stretch,
Ubuntu 16.04LTS) and can be supported by the Wireshark 3.6 LTS release
series.

Remove an enormous amount of ifdefs based on libgcrypt versions
1.6.0, 1.7.0, and 1.8.0. There will be a second pass for the
commons defines HAVE_LIBGCRYPT_AEAD, HAVE_LIBGCRYPT_CHACHA20, and
HAVE_LIBGCRYPT_CHACHA20_POLY1305, which are now always defined.

The ISAKMP dissector has some comments noting that some workarounds
were used for libgcrypt 1.6 that aren't needed with 1.7; perhaps
that could be updated now.
2022-04-20 21:30:21 -04:00
John Thacker 13075b4ff0 Require Qt 5.9 or later
Increase the minimum required version of Qt from 5.6 to the next
LTS version, 5.9. The various Linux distributions that have not
released an update to 5.9 or later (SLES 12, Debian stretch) are
nearing end of support, and can be supported by the Wireshark 3.6 LTS
release.

Qt 5.9 requires macOS 10.0, so make that the minimum macOS version
as well.

Remove unneeded version checks (except from QCustomPlot).
2022-04-20 18:59:32 -04:00
John Thacker e16b1629dc CMake: Only require C++11 once
We always require C++11, and set that at the top of the file,
so there's no need to conditionally set it a second time later.
2022-04-20 21:52:34 +00:00
Gerald Combs 69b9c480fd Revert "wsutil: Use a separate "extlog" directory for Logwolf extcaps."
This reverts commit 54553de59d.

As noted in !6694, it would probably make more sense to handle this a
different way.
2022-04-18 16:46:20 -07:00
Gerald Combs fea6591b0c macOS: Add support for Sparkle 2.
Sparkle 2 deprecated the sharedUpdater singleton, so create our own
which uses Sparkle 2's updated API. Ping #18035.

Update our CMake version check.
2022-04-18 18:57:43 +00:00
João Valverde cef02cc3a0 dfilter: Add max()/min() tests and documentation 2022-04-14 13:07:41 +00:00
Gerald Combs bcc286f341 UI: Rename the qt_logwolf directory to logwolf.
We might want to split the Wireshark-specific UI code into ui/wireshark,
but that can be done at another time.
2022-04-12 19:37:30 +00:00
Gerald Combs c5da4f661a Logwolf: Fix building on Windows.
Add a couple of missing resource files. Fix a couple of paths.
2022-04-07 23:28:54 +00:00
Gerald Combs 54553de59d wsutil: Use a separate "extlog" directory for Logwolf extcaps.
If we're running in the Logwolf configuration namespace, look for
extcaps in a directory named "extlog". This paves the way for adding
log-specific capture utilities.
2022-04-07 21:41:36 +00:00
Gerald Combs 85be944ebe CMake: Make sure Logwolf includes dumpcap on macOS.
Copy dumpcap into Logwolf's application bundle.
2022-04-06 09:08:12 -07:00
Gerald Combs 550434057e CMake: Make sinsp dependent on Logwolf.
Libsinsp runs on multiple platforms, so change our logic to find it if
we're building Logwolf.
2022-04-04 23:33:50 +00:00
Gerald Combs 167d44ea6d CMake+packaging: Create our macOS Frameworks directory in osx-app.sh. 2022-04-04 09:39:27 -07:00
Gerald Combs 211353c873 CMake+packaging: Add a logwolf_app_bundle target.
Add a logwolf_app_bundle target and update osx-app.sh to handle
different application bundle names.
2022-04-04 09:39:27 -07:00
Gerald Combs 5d3ffe9b57 More Logshark to Logwolf renaming. 2022-04-04 09:39:27 -07:00
Gerald Combs 9ec6b50027 Rename ui/qt_logshark to ui/qt_logwolf. 2022-04-04 09:39:27 -07:00
Gerald Combs b153f040fc Qt: Start renaming Logshark to Logwolf.
Rename LogsharkApplication to LogwolfApplication. Rename other Logshark
references in ui/qt_logshark to Logwolf. Update our CMake target and
variable names.
2022-04-04 09:39:27 -07:00
Gerald Combs 3086774fa6 wsutil: Add configuration namespaces.
Rename init_progfile_dir to configuration_init. Add an argument which
specifies our configuration namespace, which can be "Wireshark"
(default) or "Logwolf".
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
Graham Bloice 1ff681cec6 Remove libsinsp search on Windows
The library is unlikely to ever be made available for Windows so
don't attempt to find it.
2022-03-28 01:56:08 +00:00
easonweii bdccea7692 CMakeLists: Fix the error reported when Wireshark code is recompiled
The reference variable is incorrect. As a result, the file in this directory(/resources/protocols/protobuf/sparkplug_b.proto) are deleted during recompilation. so compilation errors occur.
Related to #18013
2022-03-25 16:25:08 +00:00
Gerald Combs 829fb032e4 CMake: Add support for WIRESHARK_QT6_PREFIX_PATH.
If USE_qt6 is enabled, set CMAKE_PREFIX_PATH to WIRESHARK_QT6_PREFIX_PATH
if it's defined. This lets you more easily switch between Qt 5 and
6 builds. Note that we have experimental support for Qt 6 in the
Developer's Guide.
2022-03-22 22:01:33 +00:00
Gerald Combs 110dbffbe9 Rename Sysdig Bridge to Falco Bridge.
The Sysdig Bridge plugin loads Falco plugins, so rename it to Falco
Bridge.

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

Remove some unused code.
2022-03-22 17:51:32 +00:00
Loris Degioanni 625a042ff8 initial skeleton for sysdig plugins experiments 2022-03-22 17:51:32 +00:00
Gerald Combs 96f3b7065f CMake: Fix our dtds dependencies. 2022-03-20 17:21:19 +00:00
Richard Sharpe 4099137ad1 tools/radiotap-gen: Add a sample program for generation radiotap headers.
This program generates complete pcap files containing the proposed U-SIG
radiotap TLVs along with enough else to make it readable. You cannot currently
read such packets with tshark or wireshark until I add U-SIG handling to
Wireshark.
2022-03-18 17:07:33 +00:00
Gerald Combs 87ff577257 Move Freedesktop files to resources/freedesktop. 2022-03-12 00:19:13 +00:00
Gerald Combs 492a11a256 Move a bunch of protocol resources to resources/protocols.
Move the following directories to resources/protocols:

- dtds
- diameter
- protobuf
- radius
- tpncp
- wimaxasncp
2022-03-11 18:34:41 +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
Gerald Combs e482b375f2 Rename the "image" directory to "resources".
The "image" directory contains resource compiler assets and other
application resources, so name it "resources."
2022-03-09 02:07:51 +00:00
Gerald Combs 1677e0a8f9 Packaging: Ship macOS dSYMs in their own .dmg.
Create a Wireshark.dSYM bundle for our debugging symbols. Create a
separate .dmg for the dSYM bundle, similar to what we do for Windows.
`dwarfdump --uuid run/Wireshark.dSYM` returns what app

This reduces the size of the application bundle and .dmg quite a bit
(sizes measured with `du -sm`):

51	Wireshark 3.7.0 Intel 64.dmg
81	Wireshark dSYM 3.7.0 Intel 64.dmg
182	Wireshark.app
262	Wireshark.dSYM
2022-03-05 14:32:53 -08:00
Gerald Combs fec12018f3 CMake: Remove redundant code. 2022-02-23 09:57:17 -08:00
Gerald Combs a6e24a6234 macOS: Require Sparkle 1 for now.
The Sparkle project recently released Sparkle 2.0.0, which deprecates
the version 1 API. Add version discovery to FindSparkle.cmake and
require version 1 until we add support for the new API. Ping #17861.
2022-01-13 09:11:24 +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
Gerald Combs 4e417b8e7c Windows: UTF-8 harder.
Set the process code page in wireshark.exe.manifest to UTF-8 as
described at

https://docs.microsoft.com/en-us/windows/apps/design/globalizing/use-utf8-code-page

Make sure each of our command line resource files includes our main
manifest. Rename wiretap.rc to libwiretap.rc to match our other libraries.
2022-01-01 08:09:12 +00:00
Moshe Kaplan 67f05835ca Fix more repeated words throughout
Fixes more repeated words seen throughout
the code base.
2021-12-31 22:50:40 +00:00
John Thacker 0867374044 text2pcap: Call text_import
Have text2pcap call text_import to do the work.
Related to #16724.
2021-12-23 20:41:52 -05:00
John Thacker c5cc836a48 text2pcap: Use wtap_dumper
Use wtap_dump instead of the pcapio functions for writing files.
This makes it easier to unify with text_import, and also makes it
easier to eventually write other file formats (with a similar option
to the other CLI programs), and allows using the standard CLI error
messages.

Also move some of the option validation before attempting to open
the output file.
2021-12-22 00:46:00 +00:00
João Valverde 4448b6494e Add a ws_posix_compat.h header
Currently used to define ssize_t on platforms that lack it.

Fix some Windows build errors caused by moving the definition into a
separate header.

Fix some narrowing warnings on Windows x64 from changing the definition
of ssize_t from long int to int64_t.

The casts in dumpcap are ugly but necessary. The whole code needs
to be rewritten for portability, or the warnings disabled.
2021-12-21 01:30:06 +00:00
João Valverde 77f95e18ab CMake: Disable Wformat-truncation (GCC warning)
Converting from GLib functions to stdio.h turns up many of these
warnings. They are disabled to allow work to go on and until
there is consensus on how to handle them.

    -Wformat-truncation
    -Wformat-truncation=1

        Level 1 of -Wformat-truncation enabled by -Wformat employs
        a conservative approach that warns only about calls to bounded
        functions whose return value is unused and that will most likely
        result in output truncation.
2021-12-17 19:34:55 +00:00
Gerald Combs 07c4059277 GitLab CI+Qt+Docs: CMAKE_PREFIX_PATH updates.
Qt's documentation recommends using CMAKE_PREFIX_PATH to designate your
Qt installation prefix: https://doc.qt.io/qt-5/cmake-get-started.html.
Do so in GitLab's CI and update the Developer's Guide.
2021-12-16 18:47:18 -08:00
João Valverde 9ebeb39395 CMake: Be stricter about MSVC requirements 2021-12-16 12:19:22 +00:00
Gerald Combs c324696504 CMake: Update a Windows SDK version check.
C11 support requires a newer Windows SDK. Add version checks and
workarounds as needed. Remove a redundant CMAKE_C_COMPILER_ID check. Add
a description of C5105 to match our other warning adjustments.
2021-12-15 10:54:02 -08:00
João Valverde 663c1655b4 CMake: Use CMAKE_C_STANDARD to require C11
Related to #17768.
2021-12-15 10:41:45 +00:00
João Valverde 5623e60375 Revert "CMake: Change our configuration to enable C17"
This reverts commit 0781007df4.
2021-12-15 10:39:29 +00:00
João Valverde 0781007df4 CMake: Change our configuration to enable C17
For now it only includes MSVC, GCC and clang.

Related to #17768.
2021-12-14 11:23:05 +00:00
Chuck Craft 4e92b7c762 win/cmake: missing rc files to set icon and copyright
Closes #17761
2021-12-14 05:45:12 +00:00
Gerald Combs b62197c283 CMake+GitLab CI: Reduce verbosity.
For various commands, make sure we show warnings and errors, but not
other extraneous information such as filenames.
2021-12-11 13:57:29 -08:00
João Valverde 83eda5fcfd CMake: Fix setting default build type
Also avoid setting a build type if that setting is meaningless,
like with multi-config generators.
2021-12-05 18:01:55 +00:00
Joerg Mayer 3594a05ba7 CMakeLists.txt: Fix enabling the use of C++ 2017 with MSVC 2021-11-26 14:42:47 +01:00
Joerg Mayer fe01f0109d Readd feature to make QtXMultimedia optional again
In order to be able to defer solving all Qt6 API differences at once
I tried to reactivate the QT_MULTIMEDIA_LIB feature. I managed to fix
most problems but one problem remains in both Qt5 and Qt6 builds.
Without Qt[56]Multimedia, the following error exceeds my non-existing
C++ knowledge:

jmayer/work/wireshark/git/ui/qt/rtp_player_dialog.cpp:154:18: error: out-of-line definition of 'RtpPlayerDialog' does not match any declaration in 'RtpPlayerDialog'
RtpPlayerDialog::RtpPlayerDialog(QWidget &parent, CaptureFile &cf, bool capture_running) :
                 ^~~~~~~~~~~~~~~
2021-11-24 10:31:16 +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
    Qt5Core.
- 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
Joerg Mayer 769be50d76 Remove last remnants of Qt5MacExtras
MacExtras has been both obsoleted by Qt5 and unused by Wireshark code.
https://doc.qt.io/qt-5/qtmac-obsolete.html
2021-11-22 09:31:23 +00:00
Joerg Mayer 8772147021 Cmake: Qt6 extends CMAKE_MODULE_PATH, work around this 2021-11-17 17:30:28 +00:00
Jaap Keuter 5f7806a496 c-ares: move domain from haxx.se to its own .org
With c-ares release 1.18.0 the URLs were updated to c-ares.org.
Let's do the same.
2021-11-16 17:02:50 +00:00
João Valverde 14c52913e2 CMake: Improve a status message and add a comment 2021-11-15 16:36:17 +00:00
João Valverde aa1515b32b CMake: Fix typo 2021-11-15 16:36:17 +00:00
João Valverde b9f2e4b7fa Make PCRE2 a required dependency 2021-11-14 21:00:59 +00:00
João Valverde 9df5279af7 dfilter: Remove support for GRegex
PCRE2 is mature, widely used and widely available. Supporting two
different RE implementations, one of which is unmaintained, is
unnecessary and counter-productive.
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 ca06d7e4fe Add an include sub-directory to the tree
Blind attempt to fix Debian package brokenness managing
headers separately from install rules.

Global public headers that don't fit any of the Wireshark
libraries should be placed in include/.

Eventually the C files in the root dir should be placed somewhere
else as well (like src/) but this is not a priority.

Fixes #17726.
2021-11-12 17:33:13 +00:00
João Valverde 76c4ca4059 CMake: Remove globals.h from public headers
On closer inspection this doesn't seem to contain any public
interfaces.
2021-11-12 17:33:13 +00:00
João Valverde b8f9758742 MSYS2: Use system SpeexDSP package 2021-11-12 11:19:34 +00:00
Gerald Combs 87b84b7813 Lua is a proper name. Fix its capitalization. 2021-11-11 01:08:51 +00:00
Peter Wu e84acd86eb CMake: fix macOS build without Asciidoctor
Fix an error when running cmake on macOS without Asciidoctor:

    The dependency target "manpages" of target "wireshark" does not exist.

Fixes: 44bd3a7d79 ("CMake+Docs: Update our man page targets.")
2021-11-03 16:04:46 +00:00
João Valverde e63857aa4e CMake: Make -Wmaybe-uninitialized non-fatal 2021-11-01 21:46:19 +00:00
João Valverde 0839f05bf7 tests/dfilter: Move deprecated to syntax group 2021-10-27 07:42:23 +00:00
João Valverde 59c082c046 Add new global header wireshark.h with guideline
Remove ws_diag_control.h from config.h because that was a workaround
for the lack of a public global header. Fix the resultant build errors.
2021-10-22 06:41:44 +00:00
Gerald Combs 2c3b13834d CMake: Place all of the documentation in the "Documentation" folder. 2021-10-21 00:21:17 +00:00
Gerald Combs 0c4d4f6835 Version: 3.5.1 → 3.7.0
[skip ci]
2021-10-07 14:27:38 -07:00
João Valverde 39036a0a30 dfilter: Add some more syntax tests 2021-10-05 19:19:36 +01:00
Gerald Combs 84ab55cf75 Docs+Packaging: Convert our man pages to Asciidoctor.
Convert doc/*.pod to Asciidoctor. This:

* Means we use the same markup for our man pages, the guides, and
  release notes.
* Lets us add versions to our man pages.
* Gives us more formatting options, e.g. AsciiDoc supports `commands`,
  nested lists and makes it easy to include version information. The
  manpage backend doesn't seem to support tables very well,
  unfortunately.

Convert our CMake configuration to produce *roff and html man pages
using Asciidoctor. Add a "manarg" block macro which makes our synopses
wrap correctly.

Similar to the release notes, guides, and FAQ, if Asciidoctor isn't
found the man pages won't be generated or installed.

Move Asciidoctor to the list of package build dependencies in various
places.

This commit includes the conversion script (pod2adoc.py), which will be
removed later.

Line count sanity check:

Man page         .pod .adoc
androiddump       260  280
asn2deb            93  105
capinfos          401  471
captype            54   55
ciscodump         241  269
dftest             42   42
dpauxmon          153  169
dumpcap           464  534
editcap           528  583
etwdump           136  156
extcap            157  181
idl2deb            91  103
idl2wrs           120  100
mergecap          206  207
mmdbresolve        75   75
randpkt           107  111
randpktdump       158  184
rawshark          558  610
reordercap         76   78
sdjournal         145  157
sshdump           272  302
text2pcap         274  312
tshark           2135 2360
udpdump           133  151
wireshark-filter  486  479
wireshark        2967 3420
2021-10-01 16:42:34 +00:00
João Valverde d6836d103d dfilter: Add test for "deprecated" tokens
Tokens that are (so-called) deprecated produce a warning/hint to
the user in the UI.
2021-09-30 17:26:19 +01:00
Brian Sipos abd0f1183f COSE dissector from dtn-wireshark project 2021-09-29 08:51:13 +00:00
João Valverde 6c5e56f752 Windows: Add preliminary support for MSYS2
If we are using MSYS2 we use those packages to build Wireshark
using MinGW-w64 and disable most or all of our win-setup.ps1 codepaths.

Fix GLib configuration. Disable copying of DLLs with MSYS2.

Some tests in the suite_capture test suite are failing with MSYS
MINGW64. That particular set of tests is way too brittle regarding
file system paths; more work is needed to improve that situation.
2021-09-27 16:45:58 +00:00
João Valverde 1c8752935d CMake: Remove debian package target
This is more likely to hinder than to help, and is not really a good way to
invoke dpkg-buildpackage. It's a crutch that doesn't interact well with ninja,
has a 50/50 chance of giving the right results and will pollute the build
environment.

The Debian package should be built from a tarball instead.
2021-09-27 17:25:45 +01:00
João Valverde b6e80d9a2f CMake: The minizip URL is ancient
Use something a bit more modern instead.
2021-09-24 09:41:57 +00:00
João Valverde fa525649be CMake: Try to set a required try_run() definition in a more idiomatic way
This is applicable to every test (if we had more), not just HAVE_C99_VSNPRINTF.

Could also be a #define but let's go with this for now. This takes
advantage of the stack based design of CMakePushCheckState.
2021-09-22 16:34:37 +00:00
João Valverde 9f9afc0e86 CMake: Remove an unnecessary version check
MINGW implies WIN32 which implies CMake >= 3.13.

Follow-up to 1dad8190b1.
2021-09-22 16:43:09 +01:00
João Valverde 6921f01250 MinGW-w64: Need to use ANSI C stdio
Defining _POSIX enables __USE_MINGW_ANSI_STDIO, this switches the
stdio API from Microsoft to MinGW internal (ANSI C).
2021-09-22 14:37:13 +01:00
João Valverde c4265865c2 MinGW-w64: Fix windeployqt errors
--debug and --release flags are unnecessary and trigger errors.

--pdb not supported and triggers a warning.
2021-09-22 14:28:49 +01:00
João Valverde c4d5eea33e CMake: Target platform for WIN32 needs to be lower case
Capitalization matters here. We are now accepting this value from the
environment so we need to lower case that string.

Add an extra sanity check and status message for target CPU architecture
to help detect mismatches.
2021-09-22 14:21:20 +01:00
João Valverde 1dad8190b1 CMake: Fix minimum version requirements for CentOS 8
target_link_options() requires CMake >= 3.13.
2021-09-22 10:46:20 +00:00
João Valverde 0d6f0a4213 MinGW-w64: Add guards for MSVC macro definitions
Add a comment too.
2021-09-21 14:52:32 +00:00
João Valverde a5a9bb0763 CMake: Move UNICODE defines to command line
For consistency's sake, I have not had any build errors that can
be attributed to this.
2021-09-21 14:52:32 +00:00
João Valverde 6bd1bb4d7c MinGW-w64: Define NOMINMAX for Windows API
This seems relevant to MinGW-w64 from a quick look at the source.
2021-09-21 14:52:32 +00:00
João Valverde b12644b629 MinGW-w64: Need to define WIN32_LEAN_AND_MEAN 2021-09-21 05:56:34 +00:00
João Valverde 50fdfda316 MinGW-w64: Need to link using -municode
Some targets are not using unicode/WinMain (not sure why), so this
really needs to be a per target setting (better anyway).
2021-09-21 05:56:34 +00:00
João Valverde a193aff052 Windows: Don't search for a SpeexDSP package 2021-09-20 20:11:49 +00:00
João Valverde 2c7d22dba2 CMake: Fix macro redefinition of Windows API versioning 2021-09-20 20:11:23 +01:00
João Valverde bb12a187df CMake: Add guards for PLATFORM sanity check
The sanity check is specific for Visual Studio so add those
guards. The PLATFORM variable is not standard for other toolchains.

Add a default "windows target platform" of Win64.

Add error output for win-setup.ps1.
2021-09-20 15:11:52 +01:00
João Valverde c513188f52 CMake: wsetargv.obj is specific to Visual Studio 2021-09-20 13:27:11 +01:00
Gerald Combs 55a67fd66a Tools: Migrate compress-pngs.sh to Python.
Migrate compress-pngs from a Bash script that ran Make to a Python
script, which should be usable on more platforms.

Add Efficient Compression Tool (ect) to the list of compressors.

Add the compressors to the various *-setup.sh scripts, but comment them
out for now.
2021-09-13 11:00:04 -07:00
Nardi Ivan 3cb302f05b HTTP2, QUIC: fix "Follow Stream"
"Follow Stream" functionality assumes that all data in a single packet
belongs to the same stream. That is not true for HTTP2 and QUIC, where
we end up having data from unrelated streams.

Filter out the unwanted data directly in the protocol dissector code with
a custom `tap_handler` (as TCP already does).

Close #16093
2021-09-13 15:13:10 +00:00
John Thacker 6fe68991df wiretap: Add zstd and lz4 as WTAP compression types
This has a few effects on the behavior of wtap_get_compression_type()
and wtap_get_all_compression_type_extensions():

Make capinfos correctly report the compression type (instead of
saying gzip compressed for zstd and lz4 compressed files).

Makes files with the .zstd and .lz4 extension show up in the file
chooser when "Files of type" is set to something other than "All Files",
such as "All Capture Files" or "Wireshark/... pcapng"

Makes the UI not default to gzip compression when saving a file
compressed as zstd or lz4 (write support for zstd and lz4 doesn't
exist yet, and the GUI doesn't have hooks for it anyway, though
this can help as a prerequisite for later support for writing.)

Also replace a couple of assert() with ws_assert().

Update the PURPOSE in CMakeLists for zstd and lz4 to note that they
can be used to read compressed capture files.
2021-09-11 22:37:25 +00:00
Gerald Combs 5893d3cd09 CMake: Fix tests.
Pass $<TARGET_FILE_DIR:wmem_test> to test.py, which should be the path
for all of our built executables, instead of ...:tshark, which is the
path for *some* of our built executables on macOS.
2021-09-01 09:31:07 -07:00
Gerald Combs 4d1357eebe CMake: Get rid of WS_PROGRAM_PATH
Use the $<TARGET_FILE_DIR:tshark> generator expression instead.
2021-09-01 07:16:20 +00:00
Gerald Combs f51b018f87 Version: 3.5.0 → 3.5.1. 2021-08-27 21:40:12 +00:00
Guy Harris ea0f14a6fb cmake: add an "uninstall" target.
Based on the uninstall target I added to libpcap and tcpdump's CMake
files.  cmake_uninstall.cmake.in is BSD-licensed, so I can use it here
and in libpcap/tcpdump without adding any GPL stuff to libpcap/tcpdump.
2021-08-26 00:42:51 -07: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 c0ae696253 CMake: Remove some unused definitions 2021-07-23 21:23:00 +01:00
Gerald Combs 539ad8a91b CMake: Remove unneeded GLIB2_LIBRARIES.
GLib is part of wsutil's link interface, so we don't need to link to it
explictly.
2021-07-21 10:05:21 +00:00
Gerald Combs 34ef2066e5 CMake: Don't bother checking for fcntl.h or floorl.
fcntl.h appears to be available on all of our supported platforms,
including Windows. We've also been including it without HAVE_FCNTL_H
guards in a few places (e.g. sshdump.c) without any issues for some
time.

floorl is part of C99.
2021-07-15 06:41:05 +00:00
Gerald Combs 9b78a42855 CMake: Fixup qtui's includes.
Add ${MINIZIP_INCLUDE_DIRS} to qtui's includes instead of every
target's. Make more includes SYSTEM PRIVATE.
2021-07-14 17:33:18 -07:00
Gerald Combs 8834b470d0 CMake: Fixup SpanDSP's TIFF includes.
Add TIFF_INCLUDE_DIR to SPANDSP_INCLUDE_DIRS, but only if TIFF has been
found.

Ping #17477.
2021-07-14 09:10:09 -07:00
Gerald Combs ff60fcf92d CMake: Adjust wsutil includes and linking.
Mark wsutil's includes SYSTEM PRIVATE. This exposed a lot of targets
that were indirectly picking up include paths via the wsutil target, so
add direct includes where needed. The G.722 and G.726 codecs were
implicilty including tiffio.h; find it explicitly instead.

Mark some of wsutil's libraries PRIVATE, but leave commonly-used ones
PUBLIC.

Ping #17477.
2021-07-14 03:56:05 +00:00
João Valverde 89acb935bc wsutil: Start adding a test suite 2021-07-11 14:39:13 +00:00
João Valverde ffcfc83ecb Rename version.h to be more descriptive
Version.h is too generic. This is specific to VCSVERSION and that
should be made more obvious and discoverable.
2021-07-09 18:27:41 +00:00
Anders Broman 2270056073 Revert "Wirehark Windows: Harden build with Shadow Stack and EHCONT metadata"
This reverts commit ebb8703a50.
2021-07-05 15:48:48 +02:00
João Valverde 100876337a Move version_info.[ch] to ui/
Version info is an aspect of UI implementation so move it to
a more appropriate place, such as ui/. This also helps declutter
the top-level.

A static library is appropriate to encapsulate the dependencies
as private and it is better supported by CMake than object libraries.

Also version_info.h should not be installed as a public header.
2021-07-04 10:37:49 +00:00
Gerald Combs 0bc39aa2eb Win32: Compile ui/win32 as C++.
We always build the .c files in ui/win32 with Visual C++, so rename
them to .cpp and update CMakeLists.txt to match. Leave the C code mostly
intact for now, but this lets us take advantage of C++ features in the
future if desired.
2021-07-02 08:02:38 +00:00
Moshe Kaplan ebb8703a50 Wirehark Windows: Harden build with Shadow Stack and EHCONT metadata
Compile and link with the /CETCOMPAT and /guard:ehcont flags
on supported versions of Visual Studio
2021-06-28 16:37:11 +00:00
Peter Wu a7ef7ff40d CMake: clear stale MaxMindDB cache entries if needed
On macOS with Homebrew, the version is included with the library path.
On updates, the old MAXMINDDB_LIBRARY is invalidated. However
ws_find_package only checks MaxMindDB_LIBRARY. Windows has a similar
problem. Make sure to clear the stale value such that newer versions can
be found, fixing the build.

Fixes #17069
2021-06-24 22:55:50 +00:00
João Valverde ff9acff6f2 Replace usage of GLogLevel flags everywhere
ws_log_domains.h needs to be included before wslog.h to be used
to define WS_LOG_DOMAIN. Also the definition for enum ws_log_level
needs to be exported for other APIs so move that to ws_log_domains.h
and rename the file to ws_log_defs.h to reflect the new scope.
2021-06-17 12:00:10 +01:00
João Valverde 05ed76d4c0 wslog: Use plain format with "message" level
Try out a simpler format with the default log level.

Don't display process and file/function information with "message"
level (experimental).
2021-06-17 12:00:09 +01:00
João Valverde c025e793dd CMake: Remove -Wc++-compat
Happy days are here again.
2021-06-14 11:47:53 +00:00
João Valverde dc7f0b88bb Refactor our logging and extend the wslog API
Experience has shown that:

  1. The current logging methods are not very reliable or practical.
A logging bitmask makes little sense as the user-facing interface (who
would want debug but not crtical messages for example?); it's
computer-friendly and user-unfriendly. More importantly the console
log level preference is initialized too late in the startup process
to be used for the logging subsystem and that fact raises a number
of annoying and hard-to-fix usability issues.

  2. Coding around G_MESSAGES_DEBUG to comply with our log level mask
and not clobber the user's settings or not create unexpected log misses
is unworkable and generally follows the principle of most surprise.
The fact that G_MESSAGES_DEBUG="all" can leak to other programs using
GLib is also annoying.

  3. The non-structured GLib logging API is very opinionated and lacks
configurability beyond replacing the log handler.

  4. Windows GUI has some special code to attach to a console,
but it would be nice to abstract away the rest under a single
interface.

  5. Using this logger seems to be noticeably faster.

Deprecate the console log level preference and extend our API to
implement a log handler in wsutil/wslog.h to provide easy-to-use,
flexible and dependable logging during all execution phases.

Log levels have a hierarchy, from most verbose to least verbose
(debug to error). When a given level is set everything above that
is also enabled.

The log level can be set with an environment variable or a command
line option (parsed as soon as possible but still later than the
environment). The default log level is "message".

Dissector logging is not included because it is not clear what log
domain they should use. An explosion to thousands of domains is
not desirable and putting everything in a single domain is probably
too coarse and noisy. For now I think it makes sense to let them do
their own thing using g_log_default_handler() and continue using the
G_MESSAGES_DEBUG mechanism with specific domains for each individual
dissector.

In the future a mechanism may be added to selectively enable these
domains at runtime while trying to avoid the problems introduced
by G_MESSAGES_DEBUG.
2021-06-11 09:40:28 +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 9b13c4352d epan: Add SMI version 2021-05-25 20:10:37 +01:00
João Valverde 6a772ab68c CMake: Rewrite preprocessor definitions again 2021-05-24 19:38:14 +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 d34ade4d9a CMake: Refactor DISABLE_ASSERT option 2021-05-24 01:35:30 +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
temporary.
2021-05-24 01:13:19 +00:00
Anders Broman f5c05eedc5 Adding more than one protobuff file fails. 2021-05-20 18:37:51 +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
WS_DISABLE_ASSERT.

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 7b2c0edb74 CMake: Remove a no-longer-needed workaround.
It looks like the setting autogen properties for the wireshark target in
2c62e2eb3f means we don't have to work around CMake issue 22085 any
more.
2021-05-14 13:45:47 -07:00
Graham Bloice f6ad4812a2 Add SparkplugB dissector
Add a dissector for SparkplugB as a heuristic subdissector of MQTT
and which calls protobuf to dissect the messages payload.
2021-05-14 12:11:03 +01:00
Gerald Combs 2c62e2eb3f CMake: Set Qt autogen properties for Wireshark.
It looks like multi-configuration generators (notably MSBuild) need
Qt autogen properties set on the wireshark target as well as qtui. Do
so unconditionally in both cases. (We were doing so conditionally for
qtui before.)
2021-05-14 07:55:25 +00:00
Gerald Combs 826e03c9f4 CMake: Apply AUTO{MOC,UIC,RCC} more selectively.
Set CMAKE_AUTO{MOC,UIC,RCC} if we're running CMake 3.20.0 or 3.20.1 in
order to work around CMake issue 22085, otherwise set the AUTOMOC,
AUTOUIC, and AUTORCC properties for the qtui target. The latter is
preferred since it keeps us from running Qt's meta-object, user
interface, or resource compilers on code outside of ui/qt. Ping #17314.
2021-05-06 19:14:15 -07:00
Gerald Combs 2549e51ee4 Remove unneeded c-ares checks.
C-ares has been mandatory since 451a241e50. Remove some checks that are
no longer needed.

Rename OPTIONAL_DLLS to THIRD_PARTY_DLLS and OPTIONAL_PDBS to
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
Roland Knall 2448f6da57 BCG729: Fix url
Apparently the website was reworked and the link has to be changed
2021-04-26 08:41:17 +02:00
Peter Wu 785657d9b8 CMake: fix macOS build when Qt5 and Qt6 are both installed
When both qt (qt@6) and qt5 are installed via Homebrew, the build fails:

    FAILED: ui/qt/CMakeFiles/qtui.dir/qtui_autogen/mocs_compilation.cpp.o
    ...
    In file included from ui/qt/qtui_autogen/mocs_compilation.cpp:2:
    In file included from ui/qt/qtui_autogen/EWIEGA46WW/moc_about_dialog.cpp:10:
    In file included from ui/qt/qtui_autogen/EWIEGA46WW/../../../../../repos/wireshark/ui/qt/about_dialog.h:15:
    In file included from /Users/pwu/repos/wireshark/ui/qt/models/astringlist_list_model.h:15:
    In file included from /usr/local/opt/qt5/lib/QtCore.framework/Headers/QAbstractTableModel:1:
    In file included from /usr/local/opt/qt5/lib/QtCore.framework/Headers/qabstractitemmodel.h:43:
    In file included from /usr/local/include/QtCore/qvariant.h:43:
    In file included from /usr/local/include/QtCore/qatomic.h:41:
    /usr/local/include/QtCore/qglobal.h:667:26: error: no template named 'enable_if_t' in namespace 'std'; did you mean 'enable_if'?
             typename = std::enable_if_t<std::is_arithmetic_v<T> && std::is_arithmetic_v<U> &&
                        ~~~~~^

That qvariant.h header is from Qt 6 which is backwards incompatible:

    /usr/local/include/QtCore -> ../Cellar/qt/6.0.2/include/QtCore

It appears that `<qt5 prefix>/include` must be explicitly included as
the default Qt5 include directories does not cover this:

    $ find /usr/local -lname '*include/QtCore' -ls
    ... /usr/local/include/QtCore -> ../Cellar/qt/6.0.2/include/QtCore
    $ find /usr/local -name qvariant.h -ls
    ... /usr/local/Cellar/qt@5/5.15.2/lib/QtCore.framework/Versions/5/Headers/qvariant.h
    ... /usr/local/Cellar/qt/6.0.2/lib/QtCore.framework/Versions/A/Headers/qvariant.h
    $ find /usr/local -name QtCore -lname '*Headers' -ls
    ... /usr/local/Cellar/qt@5/5.15.2/include/QtCore -> ../lib/QtCore.framework/Headers
    ... /usr/local/Cellar/qt/6.0.2/include/QtCore -> ../lib/QtCore.framework/Headers
    $ ls -la /usr/local/opt/qt5
    ... /usr/local/opt/qt5 -> ../Cellar/qt@5/5.15.2
2021-04-21 20:30:53 +00:00
Gerald Combs 8af90fcf47 CMake: Pass /diagnostics:caret to Visual C++.
Pass /diagnostics:caret to Visual C++ so in order to bring us in line
with Clang and gcc.
2021-04-14 21:30:45 +00:00
Gerald Combs 1dc50f7433 CMake+CI: Colorize our compiler output.
As described at

https://medium.com/@alasher/colored-c-compiler-output-with-ninja-clang-gcc-10bfe7f2b949

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
ansi2html.
2021-04-14 12:42:00 -07:00
Tomasz Moń 4bd5830cda CMake: Add ENABLE_VLD option for MSVC
Calling cmake with -DENABLE_VLD=ON when building with Visual Studio,
results in debug configuration being linked to Visual Leak Detector.
By default, Visual Leak Detector outputs the leak summary to Visual
Studio debug window. When ENABLE_VLD is active, VLD is linked to all
wireshark libraries and executables.
2021-04-10 21:53:59 +00:00
Guy Harris 52030fdca7 Try not disabling designated initializer overides.
Sometimes initializing the same field twice indicates a bug, so see
whether we can leave it enabled and suppress the warning in cases where
it's probably not a bug (too bad GCC didn't let you specify a default
initializer with, for example:

	int foo[16] = {
		[] = 17,
		[12] = 34
	};

which would mean we wouldn't have to suppress that warning in
ui/text_import.c).

Note also that not all compilers that can produce this warning call the
option "-Woverride-init".
2021-04-02 16:30:26 -07:00