Commit Graph

1440 Commits

Author SHA1 Message Date
Gilbert Ramirez d2c9f1824a Add a preference for ignoring duplicate frames
Sometimes you have a capture file that has many duplicate frames
because of how the capture was made, and its convenient to ignore
the duplicates so you can concentrate on the data and not all
the TCP warnings.

This adds a preference in the "Protocols" section to ignore
duplicates. This currently only works while reading a capture file
*not* during a live capture.
2023-06-09 07:21:08 +00:00
Gerald Combs cec508ab26 CMake+GitLab CI: Generate a Visual Studio Code Analysis report
Try to use /analyze:log:format:sarif and sarif-tools to generate an HTML
report. Unfortunately this currently fails with "Fail to allocate bitmap".
2023-06-05 16:40:21 +00:00
Gerald Combs f330087f08 NSIS: Add support for Arm64
Warn the user, but don't exit if we're running the x64 installer on an
Arm64 system. Warn the user and do exit if we're running the Arm64
installer on an x64 system. Fixup the 32 bit check.

Ping #18123
2023-05-31 19:44:34 +00:00
João Valverde d549c10d3b CMake: Fix build with Ninja + MSVC 2023-05-31 10:57:55 +01:00
João Valverde 155da04d67 CMake: Remove SKIP_QT_TRANSLATIONS
Now that 6.5.1 is released, remove the work-around but keep the
warning.
2023-05-29 01:12:04 +00:00
Gerald Combs 2dbd2b44dc CMake: Use "arm64" instead of "win64arm"
Use "arm64" instead of "win64arm". This lets us simplify some of our
CMake logic. Note that we could simplify things further if we used "x64"
instead of "win64" in various places.
2023-05-28 19:45:21 +00:00
João Valverde ca0357d764 Cross-compilation: Remove PowerShell requirement 2023-05-28 18:00:59 +01:00
João Valverde 875e77d784 CMake: Fix a python variable
Fix variable to use the correct case and use a cache variable
while at it.
2023-05-27 16:55:53 -07:00
João Valverde f653e52e0f CMake: Try to use FindPython3.cmake again
Use FindPython3.cmake instead of the deprecated FindPythonInterp.cmake,
to make sure we actually find Python3.

Don't use the module with MSYS2 because it is buggy and exhibits broken
behaviour.

Run it earlier in the configuration, just as a precaution, so other
indirect calls to find python don't happen earlier.
2023-05-27 12:49:29 +01:00
João Valverde 438667846a CMake: Download Npcap/USBPcap using CMake
These binaries are required to build an NSIS installer. Download
them using CMake instead. This avoids a dependency on win-setup.ps1,
that gets in the way using MSYS2.
2023-05-26 22:10:33 +00:00
João Valverde f0e4c5262d Revert "CMake: Replace deprecated module FindPythonInterp"
This reverts commit d6380e7ae4.

Turns out we were unwittingly still using FindPythonInterp
instead of FindPython3.cmake, via LocatePythonModule.cmake,
nd this commit actually enabled FindPython3.cmake. Also turns
out FindPython3.cmake is far too clever and very buggy with MSYS2.
It will usually not find the correct python binary and fail in many
suprising ways, depending on which combination of Python Windows
installations is present.
2023-05-26 22:55:47 +01:00
João Valverde d6380e7ae4 CMake: Replace deprecated module FindPythonInterp 2023-05-26 19:38:42 +00:00
João Valverde 51accf1b90 Allow using host Lemon executable
Add support for using the host system's lemon binary instead of
compiling our own. Many linux distributions include a lemon
parser generator package. Using this binary when cross-compiling
is much simpler than configuring the build to use the build host
toolchain to compile lemon.
2023-05-25 21:45:22 +00:00
João Valverde 4e70ea33af Fix build on case-sensitive filesystems
Rename some files to match case-sensitive paths on Fedora.
2023-05-24 02:49:28 +01:00
Gerald Combs fb1b022922 Packaging: Change our Windows installer filename format
Switch to Wireshark-<version>-{x64,arm64}.{exe,msi}.
2023-05-23 20:05:39 +00:00
João Valverde aa6b8368b7 MSYS2: Add support for building a stand-alone NSIS installer
This changes the existing code for the MSVC installer as little
as possible to allow building the Wireshark .exe Windows installer
using the MinGW-w64 toolchain.

Currently the DLL dependency list is static, this may change in
the future. Ideally we would use CPack and install() logic
to copy the DLLs.

The msys2checkdeps.py script is copied from the Inkscape project[1].
It doesn't have a specific license identifier. The Inkscape project
is licensed under the GPL version 2 or later.

TODO: Download Npcap and USBPcap using CMake instead of requiring
manual action.

[1]https://gitlab.com/inkscape/inkscape

Ping #17771.
2023-05-22 00:54:39 +01:00
João Valverde a88af3a866 CMake: Use components to install doc guides
Use CMake components to install the guides, instead of
a custom target and script.

We have to inconveniently place the install() command in the
top-level CMakeLists.txt file, instead of docbook/CMakeLists.txt,
so that we can use
    cmake --install <builddir> --component UserGuide
insead of
    cmake --install <builddir>/docbook --component UserGuide

so that it can be used in the wireshark.spec file without too
many contortions.
2023-05-14 02:35:35 +01:00
João Valverde e36225aea5 CMake: Remove CTest
Calling CTest with a single test calling pytest is a terrible
user experience. Replace it with a custom target invoking
Python directly.
2023-05-13 13:47:34 +00:00
Guy Harris 7decbda522 Don't build radiotap-gen if we didn't find libpcap.
As a comment in its code says, it requires libpcap, so attempting to
build it if you don't have libpcap is guaranteed to fail, and we don't
require you to have libpcap's headers and libraries in order to build
Wireshark, so just don't build it if we didn't find libpcap.

Fixes #19059.
2023-05-10 23:22:54 -07:00
João Valverde 3128269aa0 Tests: Require pytest support and remove compatibility layer
Remove the pytest compatibility layer and require the real thing.

Fix running tests with pytest and Python 3.11+. Pytest strongly
favors using fixtures instead of setup/teardown methods so
use that. This fixes the test suite with pytest and Python 3.11
and has the added benefit of removing the dependency on a private
unittest property.

We remove the dedicated log file code in SubprocessTestCase and just
write to standard out. This presumes to leverage the pytest logging
features, such as writing to a log file. To make the system more useful
we should probably rely on logging calls instead of writing to
stdout.

The teardown log file cleanup logic and filename_from_id() method
are replaced with pytest fixtures and native temporary path support.
They are cleaner to use and do not require messy teadown logic. The
temporary files are created in the system temporary directory. By
default the last three runs are kept.

More work is needed to complete remove the unittest module dependency.

Fixes #18740.
2023-05-10 18:53:31 +00:00
João Valverde 20f4ce1721 Tests+Linux: Add convenience target to enable capturing on build dir 2023-05-09 09:59:02 +00:00
Gerald Combs ab21f2a31e Resources: Deprecate some old icons.
The correct Wireshark application icons are the ones created by Elliott
Aldrich in 2013 and added in 584c14c66c. They replaced the original
icons that I created in 2006 and which should no longer be used.

Keep the old icons around for the time being, but make it clear that
they're of historic importance.

Fixes #19040.
2023-05-06 20:32:21 +00:00
Gerald Combs 98a19a85a5 CMake+tools: Add Visual C++ Arm64 support
Add support for building for Windows on Arm64 using Visual C++ to the
CMake environment. Add our initial batch of packages to win-setup.ps1.

Ping #18123
2023-05-05 23:01:35 +00:00
Gerald Combs 9f22be9701 Revert "CMake: Replace our wrapper scripts with symlinks"
Revert 9864a877ce, since it causes problems with Sparkle:

    error	13:09:41.018537-0700	Wireshark	Error: the bundle being updated at NSBundle </path/to/wireshark/build/run> (loaded) has no CFBundleIdentifier! This will cause preference read/write to not work properly.
    error	13:09:41.019087-0700	Wireshark	Error: the bundle being updated at NSBundle </path/to/wireshark/build/run> (loaded) has no CFBundleIdentifier! This will cause preference read/write to not work properly.
    error	13:09:41.019165-0700	Wireshark	Error: the bundle being updated at NSBundle </path/to/wireshark/build/run> (loaded) has no CFBundleIdentifier! This will cause preference read/write to not work properly.
    error	13:09:41.019216-0700	Wireshark	Error: the bundle being updated at NSBundle </path/to/wireshark/build/run> (loaded) has no CFBundleIdentifier! This will cause preference read/write to not work properly.
    error	13:09:41.019303-0700	Wireshark	This host (/path/to/wireshark/build/run) has no CFBundleVersion! This attribute is required.
    error	13:09:41.019628-0700	Wireshark	Fatal updater error (6): Sparkle cannot target a bundle that does not have a valid bundle identifier for run.

Update the comments in CMakeLists.txt to note this.
2023-04-07 16:08:39 +00:00
Gerald Combs 9864a877ce CMake: Replace our wrapper scripts with symlinks
Since f63628d9c4, `run/wireshark` has been a wrapper script which execs
run/Wireshark.app/Contents/MacOS/Wireshark. It looks like newer versions
of Qt call `[NSApp activateIgnoringOtherApps:YES]`, so this should no
longer be needed.

Make `run/wireshark` and `run/logray` symlinks like our other
executables. This makes it possible to run a debugger on those files and
simplifies CMakeLists.txt a little.

This means that running `run/wireshark` will result in a lower-case
application name in the main menu bar, but if that's an issue you can
still run `open run/Wireshark.app` on the command line.
2023-03-22 07:41:39 +00:00
Harald Welte 01c51aad3e Add AMR codec support 2023-03-21 12:26:05 +00:00
John Thacker be4ea87bb6 CMake+Windows: Get AddressSanitizer working with MSVC
AddressSanitizer is available on MSVC since Visual Studio 2019 16.9.
The Microsoft LINK linker doesn't recognize or need the ASAN flag,
unlike with clang/gcc, and will give a LNK4044 warning that will
cause checks and compilation to fail.

So we add the flag with add_compile_options instead of adding to CMAKE_C_FLAGS
so that it doesn't get added to the linker options for MSVC, and use
add_link_options (added in CMake 3.13, our minimum) when not on MSVC.

Note that this only includes AddressSanitizer support, unlike on
clang/gcc where LinkSanitizer is automatically part of ASAN builds
(and the standalone "-fsanitize=leak" is less well tested.)
2023-03-14 01:32:44 +00:00
Tomasz Moń cf0fc59e64
CMake: Fix logray build on Windows
Add missing zlib libraries to logray project to fix linking errors.
2023-03-12 17:45:11 +01:00
Biswapriyo Nath bd24f450f8 CMake: Allow arm64 architecure in Windows
This also sets arm64 as processor architecture in exe manifest files.
2023-02-13 18:25:18 +00:00
João Valverde 9cb759b38e Enable rpathification and working relocation on Linux (take 3)
Dumpcap depends on wsutil.so. The path to the shared library
is encoded in the RPATH (or RUNPATH) property of ELF binaries.
This is currently an absolute path on most Unixy systems.

Dumpcap could not be made to work with a relative RPATH because it
uses elevated privileges and some loaders will ignore relative
RPATHs and non-standard paths under those circumstances, because of
(justified) security concerns.

To enable relocation of the program we link dumpcap statically
with wsutil instead.

This provides a fully working relocatable installation on Linux
and other platforms that support relative RPATHs.
2023-02-13 00:24:21 +00:00
João Valverde ce6c3da727 Revert "Enable rpathification and working relocation on Linux (take 2)"
This reverts commit 8dfe8737c5
2023-02-12 20:30:38 +00:00
João Valverde 8dfe8737c5 Enable rpathification and working relocation on Linux (take 2)
Dumpcap depends on wsutil.so. The path to the shared library
is encoded in the RPATH (or RUNPATH) property of ELF binaries.
This is currently an absolute path on most Unixy systems.

Dumpcap could not be made to work with a relative RPATH because it
uses elevated privileges and some loaders will ignore relative
RPATHs and non-standard paths under those circumstances, because of
(justified) security concerns.

To enable relocation of the program we link dumpcap statically
with wsutil instead.

This provides a fully working relocatable installation on Linux
and other platforms that support relative RPATHs.
2023-02-12 19:20:18 +00:00
João Valverde 9fca1acb40 CMake: Remove dumpcap dependency on ui 2023-02-10 20:59:22 +00:00
Gerald Combs ecbfda08c4 macOS: Update our extra package versions.
Track our extra package versions using CMake variables and bump each
version.
2023-02-09 17:52:55 +00:00
João Valverde 84f963dfa2 Move ui/version_info.[ch] to wsutil 2023-02-07 23:17:37 +00:00
João Valverde c62aa67d2c Move ui/exit_codes.h to include/ 2023-02-07 10:12:08 +00:00
João Valverde 7c156d9ac4 Add a #define HAVE_MSYSTEM and use it
In certain situations using __MINGW64__ is not correct.
We want to have the condition apply using MinGW-w64 but also
using MSYS2, which the __MINGW64__ condition alone does not
capture.

Add a HAVE_MSYSTEM C define and use it where appropriate.
2023-02-06 19:39:33 +00:00
João Valverde ab0d190450 CMake: Fix libnl unused link dependencies 2023-02-06 15:04:46 +00:00
João Valverde b07ab25a1c CMake: Cleanup unnecessary linking with shared libraries 2023-02-06 15:04:46 +00:00
Gerald Combs 894e8c46c6 Revert "Enable rpathification and working relocation on Linux"
This reverts commit 7a346c398a.
2023-01-30 22:30:56 +00:00
João Valverde 7a346c398a Enable rpathification and working relocation on Linux
Dumpcap depends on wsutil.so. The path to the shared library
is encoded in the RPATH (or RUNPATH) property of ELF binaries.
This is currently an absolute path on most Unixy systems.

Dumpcap could not be made to work with a relative RPATH because it
uses elevated privileges and some loaders will ignore relative
RPATHs and non-standard paths under those circumstances, because of
(justified) security concerns.

To enable relocation of the program we link dumpcap statically
with wsutil instead.

This provides a fully working relocatable installation on Linux
and other platforms that support relative RPATHs.
2023-01-29 23:38:00 +00:00
João Valverde c66fc43e5b GUI: Ship authors as a Qt resource file 2023-01-20 13:35:03 +00:00
João Valverde 5f63989ee0 Update authors file in place
Instead of having AUTHORS.src and copying that to a new AUTHORS
file with git log information appended to that have a single
AUHTORS file and update it in place with git log info.
2023-01-20 12:04:57 +00:00
João Valverde 2ab291b3b2 GUI: Ship license + acknowledgements as Qt resource 2023-01-19 19:14:32 +00:00
João Valverde 776aafc7de CMake: Install CSS to DOCDIR 2023-01-19 17:55:20 +00:00
João Valverde 74909f1499 Install PDML files to DOCDIR
Add README because this stuff is somewhat obscure and move XSLT
file to DOCDIR because it is not used by wireshark directly.
2023-01-19 17:08:36 +00:00
Joakim Karlsson c06a38da31 CMake: Update a compiler version check 2023-01-19 16:58:58 +00:00
João Valverde 06519be205 Install documentation (HTML manuals) to DOCDIR
Install documentation to DOCDIR instead of DATADIR.
The code must be fixed to open the Help URLs from
this new path.

This only affects Unix-like FHS platforms. Windows
installation does its own thing.

Needs testing with macOS packaging.
2023-01-19 01:40:59 +00:00
João Valverde 9e6faf4169 Remove dftest man page
DFTest is a private test utility and isn't installed anywhere.

I don't think it makes sense to maintain a man page. Certainly
doesn't make sense to ship it.

The doc file is understandably minimal so just nuke it.
2023-01-19 00:17:56 +00:00
Gerald Combs de7ca4c64a Packaging: Add a Logray AppImage package 2023-01-18 14:26:33 -08:00