Commit Graph

1246 Commits

Author SHA1 Message Date
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