Commit Graph

1224 Commits

Author SHA1 Message Date
Gerald Combs ac4f3c0f4d macOS: Make Wireshark.app drag-installable.
Create ChmodBPF installer and uninstaller packages using pkgbuild and
productbuild. Place them in Wireshark.app/Resources/Extras.

Add a path_helper installer and uninstaller which respectively add and
remove /etc/*paths.d/Wireshark.

Remove the PackageMaker and utility-launcher assets and build targets.

Show a message in the main welcome screen if we don't have capture
permissions. Add an link which launches the ChmodBPF installer.

Add a "macOS Extras" item to About → Folders.

Migrate "Read me first" from RTF to Asciidoctor, which lets us add links
and looks like our other documentation.

Rename dmg_set_style.scpt to arrange_dmg.applescript and make it plain
text. Always run it in osx-dmg.sh.

Bug: 6991
Bug: 12593
Bug: 11399
Ping-Bug: 16074
Change-Id: I7b6aa89aae2be522b4141b0d44e8142dec749e90
Reviewed-on: https://code.wireshark.org/review/31047
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-09-25 16:26:31 +00:00
Tomasz Moń 893a2d9c62 MSVC: Warn about unused formal parameters
Provide _U_ macro definition for Visual Studio.

Change the way _U_ macro is ifdefed for some targets to allow Visual
Studio to recognize it.

Ping-Bug: 15832
Change-Id: Ic7ce145cbe9e8aa751d64c9c09ce8ba6c1bbbd30
Reviewed-on: https://code.wireshark.org/review/34530
Tested-by: Petri Dish Buildbot
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-09-21 08:51:34 +00:00
João Valverde a544570546 Fix build with non-standard install prefix
The variables BUILD_dumpcap and PCAP_FOUND are defined after the if
condition, therefore wireshark is built with a relative RPATH and
library loading for privileged processes fails with glibc.

Move the definition of BUILD_dumpcap before it is used and drop
the test for PCAP_FOUND.

Move a comment to the proper line while at it.

Change-Id: Ie151a3781898e712f9e324e9ef995022bbea40b6
Reviewed-on: https://code.wireshark.org/review/34564
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-09-19 18:51:27 +00:00
Tomasz Moń cacccb57db CMake: Reverse CheckPIESupported version check logic
Instead of checking for CMake version greater than "3.13.999" check for
version lower than "3.14". This fixes the condition for current Pengwin
releases which do ship with CMake version "3.13.18112701-MSVC_2".

Change-Id: Ib5fc494d7fd42625e24ddac55af8aa92f0e983ec
Reviewed-on: https://code.wireshark.org/review/34535
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-09-15 18:06:23 +00:00
Guy Harris 6d6376e81f Move the last of the routines from capture_info.c into ui/capture.c.
That means the packet-count-during-capture stuff is scattered amongst
fewer locations.

Move capture_info.h into ui; it's now a header that declares routines
whose implementations are GUI-platform-dependent.

Change-Id: I475815724a4766f6bc2511e67ebae14865e1a9d1
Reviewed-on: https://code.wireshark.org/review/26249
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2019-09-15 14:09:41 +00:00
Dario Lombardo a1532e7b16 cmake: check minimum zstd library version.
The APIs used in the kafka dissector have been introduced in version
1.0.0, then we need at least that version to work.

Change-Id: I80ded2362d4f324ec26392bd7a9781ea6d9ba630
Reviewed-on: https://code.wireshark.org/review/34382
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-08-27 15:50:40 +00:00
Piotr Smolinski ad94c4d459 Kafka: include zstd compression in Kafka message batches
Change-Id: I1d06486ccf7b174ee9aa621fa3d8acb8b3673777
Reviewed-on: https://code.wireshark.org/review/34222
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-08-20 13:50:45 +00:00
Pascal Quantin 41b8c22e74 Windows: add nghttp2.pdb file to our PDB .zip
Change-Id: I496959a04fdbd7a275d772600736bde63ac8b14e
Reviewed-on: https://code.wireshark.org/review/34307
Petri-Dish: Pascal Quantin <pascal@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
2019-08-16 20:15:30 +00:00
Peter Wu 86a35ac6a2 cmake: allow VCSVERSION to be overridden with VCSVERSION_OVERRIDE
The default VCSVERSION from make-version.pl is based on the "git
archive" information (for tarballs) or uses "git describe" to discover
the version. Distributors such as Debian who directly build from a Git
repository might want to include a deterministic value, therefore add a
new option to achieve this.

Change-Id: I5a39670519f4d846020d917b124fc4d548d00137
Reviewed-on: https://code.wireshark.org/review/34100
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-08-12 20:26:32 +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
Gerald Combs 12e8b4edd3 3.1.0 > 3.1.1.
Change-Id: Idc7ab6cfe38cffa4053d0d8ce710cb95b33aa6ac
Reviewed-on: https://code.wireshark.org/review/34084
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-07-25 20:03:30 +00:00
João Valverde 6e5ba74b31 Remove ABI compliance checker code.
It's broken, unmaintained, poorly implemented and obsoleted by saner
debug-info methods.

Note: To do the compliance check properly would require much more
extensive work to clearly define public and private interfaces (without
manual bookeeping of files or symbols either, of course, because who
would want that...).

Change-Id: Ib801f3c152ca2369f95ca1f4af4d37cd8cc7c47a
Reviewed-on: https://code.wireshark.org/review/33928
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: João Valverde <j@v6e.pt>
2019-07-21 15:54:41 +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
Reviewed-on: https://code.wireshark.org/review/33881
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-17 18:25:11 +00:00
Jaap Keuter 214d8af13b AppImage: Fix symbol name error in CMakeList.txt
Change-Id: Ibaf85eaea382f2e600fc8f725b2adaa344836ae3
Reviewed-on: https://code.wireshark.org/review/33832
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-07-03 20:04:51 +00:00
Dario Lombardo 1af6e1f860 tap: add credentials tap.
This new tap collects credentials (username and paassword)
from the dissectors.

So far, few dissectors have been instrumented:
- http (basic auth)
- http (header auth)
- ftp
Others can be instrumented as well using the same technique.

Tshark has a new option (-z credentials) and Wireshark a new
"tools" menu: the documentation has been updated accordingly.

Change-Id: I2d0d96598c85bb3ea4fb5ec090dd8dc28b481fc9
Reviewed-on: https://code.wireshark.org/review/33453
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2019-06-26 07:09:54 +00:00
Anders Broman 329e1da5cd CMakeList: We require minimum c++11
Change-Id: I685901dac2e950678362b3b8759c22dceec39176
Reviewed-on: https://code.wireshark.org/review/33636
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-06-17 14:42:12 +00:00
Jaap Keuter e8645f69d8 sharkd: link with libm because of Speex
When builing without the Speex library the build inserts its own files
to handle the codec conversion. These however require sharkd to be
linked against libm, for the sine function.

Change-Id: I80b3fd67a346849480976c00280537b786780627
Reviewed-on: https://code.wireshark.org/review/33582
Reviewed-by: Vasil Velichkov <vvvelichkov@gmail.com>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-06-13 18:03:02 +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
Dario Lombardo f35e7f874d ship the dfilter_macros file.
By providing such a file, we give the users a basic toolbox
of macros. At the moment 3 macros have been added, for private
mac addresses, as well al IP v4 and v6.

Change-Id: Icc33efce437adef00e268172c184c8b52167df23
Reviewed-on: https://code.wireshark.org/review/33449
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-06-05 17:04:22 +00:00
Gerald Combs dd4c987756 CMake+macOS: Use symlinks for our CLI utilities.
On macOS, <build directory>/run/wireshark is a wrapper script that execs
run/Wireshark.app/Contents/MacOS/Wireshark so that Launch Services will
activate our application properly. We don't need to worry about this for
our other executables. Make them symlinks so that we can run things like
`lldb run/tshark` with impunity.

Change-Id: I4e656d778040ece722f873b1a7f6e6e60d21e2a6
Reviewed-on: https://code.wireshark.org/review/33071
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-05-24 17:05:39 +00:00
Guy Harris 03af0ad709 Enable -Wpointer-sign if we're enabling additional compiler warnings.
Or, rather, *disable* it only if we're *not* enabling additional
compiler warnings.

Change-Id: I95c23385a365e0e24f932ea5c680b287b5f717e0
Reviewed-on: https://code.wireshark.org/review/33237
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-05-16 21:15:00 +00:00
João Valverde 4c5d2f5ccf CMake: Add libpcap imported library target
Change-Id: I5326b87784817fb353329e2d686fe0515c32f6cb
Reviewed-on: https://code.wireshark.org/review/33038
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: João Valverde <j@v6e.pt>
2019-05-03 21:56:45 +00:00
João Valverde 186f985793 CMake: Check for and use system SpeexDSP library
Change-Id: I8443379d23a2946dd21c12e5e0bd5464ab73ca25
Reviewed-on: https://code.wireshark.org/review/31857
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2019-05-02 21:12:01 +00:00
Gerald Combs cec5991f40 Windows: Modernize our WSAStartup usage.
Make sure we link each application that calls WSAStartup with ws2_32.lib.
Pass version 2.2 to WSAStartup. Wikipedia says it was introduced in 1996,
so we should be OK.

Ping-Bug: 15711
Change-Id: I431839e930e7c646669af7373789640b5180ec28
Reviewed-on: https://code.wireshark.org/review/33033
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Tomasz Moń <desowin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-05-01 17:51:59 +00:00
Fabrice Fontaine 900b9f1379 CMake: add USE_STATIC option
USE_STATIC will:
 - 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:

    /usr/lib

  to the file:

    /home/fabrice/br-test-pkg/br-arm-full-static/target/usr/bin/tshark

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

Change-Id: I242dc1a091cc211ee891568a2dee5080c9974fba
Ping-Bug: 15713
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Reviewed-on: https://code.wireshark.org/review/32945
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-04-23 23:19:40 +00:00
Dániel Bakai 9ce60b173b Add brotli decompression support for HTTP and HTTP2 dissectors.
Change-Id: I9c09f55673187f6fee723fcd72798fb6b9958b03
Reviewed-on: https://code.wireshark.org/review/32745
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-04-22 15:24:46 +00:00
Peter Wu 7950811438 CMake: fix Windows build when all binaries are disabled
CLEAN_C_FILES is empty if all BUILD_xxx options are disabled.

Bug: 15662
Change-Id: I133b4d00336eb17f7eaeb0d6517ed83c30180373
Reviewed-on: https://code.wireshark.org/review/32895
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-20 06:07:45 +00:00
Peter Wu 8fd2e102a5 CMake: silence -Wunsafe-loop-optimizations for GCC 7
Clang does not implement this option, so do not bother checking it
there. GCC 6 is fine, GCC 7 is broken and GCC 8 is fixed again.

Change-Id: I3bc9ff4e934e05b1b3ce7d4c4a41bf40d6e38655
Reviewed-on: https://code.wireshark.org/review/32904
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-20 06:06:24 +00:00
Peter Wu 8c26217548 CMake: bail out if minimum GLib version is not satisfied
Require glibconfig.h to be found and extract the version from this file,
this has been present since the original GLib commit and is still
present in the meson build system introduced with 2.53.4.

Bug: 15706
Change-Id: I2e938a339d48d6815ed7cc46462735b93418377f
Reviewed-on: https://code.wireshark.org/review/32894
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-04-19 17:29:11 +00:00
Gerald Combs ba40851b27 Windows: Use an lz4 DLL built with vcpkg.
Update the Windows build environment to use lz4 packages built from a
VS 2017 command prompt with

    set LZ4_VERSION=1.8.3
    vcpkg remove lz4:x86-windows lz4:x64-windows
    vcpkg install lz4:x86-windows lz4:x64-windows
    vcpkg export lz4:x86-windows --output=lz4-%LZ4_VERSION%-win32ws --zip
    vcpkg export lz4:x64-windows --output=lz4-%LZ4_VERSION%-win64ws --zip

The packages also include a PDB, so copy it to the build directory and
add it to the PDB .zip.

Change-Id: Icea512405d2085e5b271fa4a3ba8c0fe318b8cb5
Reviewed-on: https://code.wireshark.org/review/32785
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>
2019-04-09 04:28:36 +00:00
Gerald Combs 7c5f59dcf7 CMake: Require pod2man and pod2html.
Require the POD package. Some platforms ship POD translators as a
separate package instead of shipping them with Perl.

Bug: 15513
Change-Id: Ie277f9296d06063581512bc4c2df1d3158117f2c
Reviewed-on: https://code.wireshark.org/review/32685
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-04-03 16:55:15 +00:00
Gerald Combs a6da14982b NSIS: Fix our extra installer location.
We know the native Windows library path early on in the configure
process. Use it to set the location of the Npcap and USBPcap installers
instead of trying to derive it from the GLib DLL path.

Change-Id: I02d48e115b374fb6080a7fe8017cba789254d5f1
Reviewed-on: https://code.wireshark.org/review/32475
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-03-18 23:47:38 +00:00
Gerald Combs acc96e5206 Windows: Start using a `vcpkg export` bundle.
Create a library bundle using `vcpkg export ... --zip` as described at
https://vcpkg.readthedocs.io/en/latest/users/integration/#export-command.

The bundle includes the following packages:

gettext     0.19-8
glib        2.52.3-13
libffi      3.1-4
libiconv    1.15-5
liblzma     5.2.4
libxml2     2.9.9-4
pcre        8.41-1
zlib        1.2.11-5

It also includes a CMake toolchain file which we might want to make use
of in the future.

This means we no longer compile Zlib locally. Update the CMake environment
accordingly and remove zlib from win-setup.ps1.

It includes PDBs, so add them to the PDB .zip.

Change-Id: I0a94904a86d836e990019dab62af506573be1f35
Reviewed-on: https://code.wireshark.org/review/31377
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-03-18 22:22:44 +00:00
Peter Wu ba1ef0ec3d Re-implement "Map" feature for Endpoints
This feature was removed in v2.5.1rc0-427-gf529ab5d0a, anticipating that
MaxMind would remove support for it in 2019. They have however changed
their mind and maintained latitude and longitude information.

They recommend displaying an accuracy radius, but the reported values
are 50, 100, 200 and 1000km. When implemented literally, a marker in
Ireland would cover the whole island plus mainland, so I have instead
opted to use a fixed radius of 1km at deeper zoom levels.

The old ipmap.html file was outdated and had broken tiles, I rewrote a
new one from scratch using the light-weight Leaflet library combined
with tiles from OpenStreetMap. This is more mobile-friendly and secure
(https, SRI). To improve handling of nearby or overlapping nodes,
clustering is used (individual nodes can still be inspected).

Browser compatibility results: IE8 is unusable, IE9 partially works
(tooltips sometimes disappear and the cluster radius control is gone),
IE11 works. Of course Firefox 65 and Chromium 72 have no issues.

The map popup description in the generated GeoJSON structure is now
split in several properties, allowing presentation to be handled by the
HTML page instead of the C code.

Bug: 14693
Change-Id: If2ec9c518f7723ac0ab27b6272463356875a0ff2
Reviewed-on: https://code.wireshark.org/review/31952
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-02-16 21:11:12 +00:00
Gerald Combs 23c9a1e036 Convert the FAQ to Asciidoctor and remove old help files.
Convert our self-generating FAQ to Asciidoctor via the following steps:

- `help/faq.py > /tmp/faq.html`.
- `pandoc -t asciidoc -o docbook/faq.adoc /tmp/faq.html`.
- Manually clean up the markup using a text editor.

Question and answer content was left intact. Removing or updating
obsolete content will have to be done in a separate change.

The Asciidoctor project uses the .adoc extension, so start using it here
as well.

The contents of the "help" directory appear to have been used for
offline support in help_url.c, but that functionality was removed in
2008 in 242e3b78bc. Its content is covered in the User's Guide and man
pages so remove it.

Change-Id: I9060eefe97cfc137f8b414077c30f814379b576a
Reviewed-on: https://code.wireshark.org/review/32014
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-02-14 23:11:15 +00:00
Gerald Combs 1c27d782ba CMake: Move the PLUGIN_PATH_ID definition.
Define PLUGIN_PATH_ID where we use it. ENABLE_APPLICATION_BUNDLE is
defined later on, so test for APPLE instead.

Change-Id: I16c3ac3dc0e483fbf89cb1a2cacb2afb416d656f
Reviewed-on: https://code.wireshark.org/review/32016
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-02-14 02:23:32 +00:00
Gerald Combs aedf6fe1c5 macOS: Fix our plugin path.
In CMake we only used PROJECT_RELEASE_VERSION to construct our plugin
path, so rename it to PLUGIN_PATH_ID. Use a dash to separate version
numbers on macOS in order to allow code signing and a period elsewhere.

In the C code we only used VERSION_RELEASE to construct our plugin path,
so rename it to PLUGIN_PATH_ID.

Change-Id: I02abc591d7857269e8d47b414b61df4b28a25f2d
Reviewed-on: https://code.wireshark.org/review/32013
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-02-13 23:55:10 +00:00
Peter Wu e4a6f87088 CMake: disable relocatable builds when dumpcap is being built
dumpcap with capabilities/setuid currently does not start due to missing
libwsutil when installed to a non-standard prefix such as /usr/local.

Bug: 15490
Change-Id: If7427ba9625d3702ab8aac2deeaf37b6d3fda2a0
Reviewed-on: https://code.wireshark.org/review/31995
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-02-13 11:18:30 +00:00
Guy Harris ce7619040f Indicate what changes to make if we remove the version component.
Change-Id: I32fff5c34cfdb15a8102d2657e3380cf66928f66
Reviewed-on: https://code.wireshark.org/review/32002
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-13 03:25:57 +00:00
Guy Harris aa1f314464 Fix directory containing compiled plugins in macOS.
They weren't getting put in the version-number subdirectory, so the
plugin loader wasn't finding them.

If that causes problems with codesign, then we need to either

	1) figure out how to make it work with codesign

or

	2) for macOS, not put plugins in a version-number subdirectory
	   ***AND*** change the plugin loading process not to look for
	   compiled in a version-number subdirectory.

Change-Id: I58d344b728d05369d35edef4e4e530f10034e930
Reviewed-on: https://code.wireshark.org/review/32000
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-13 03:05:11 +00:00
Gerald Combs 6fef7cdc84 MacOS: Bundle and packaging updates
Update the code signing portions of the packaging scripts to match newer
versions of macOS.

Change-Id: I5e03611d8db61416955e797edcadfcff1404cc38
Reviewed-on: https://code.wireshark.org/review/31996
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-02-12 21:04:19 +00:00
Peter Wu f54a625682 CMake: clear cache variables when a library has changed
On Windows, whenever win-setup.ps1 installs new libraries, the old
paths become invalid. As a workaround the user can remove CMakeCache.txt
completely or manually delete entries. Removing the whole file might
lose custom options and clearing individual entries is tedious. Let's
handle this automatically.

Some HAVE_xxx variables from check_function_exists calls in PCAP and
ZLIB, and one from check_symbol_exists in KERBEROS are not cleared.
Those special cases would require too much work, the user should
manually clear their cache in this case if needed.

Fixes my local build since CARES, KERBEROS and LibXml2 were updated.
Special care was necessary for LibXml2 as it will not set cache variable
LIBXML2_LIBRARY when LIBXML2_LIBRARIES is already set.

Change-Id: Ic793bdb67161504aadadf221bd7740a0ca31db63
Link: https://www.wireshark.org/lists/wireshark-dev/201902/msg00028.html
Reviewed-on: https://code.wireshark.org/review/31960
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-02-11 05:06:10 +00:00
Peter Wu 07910e841e RPM: respect options for disabling Qt, SpanDSP and BCG729
"%bcond_without" enables a feature by default. Be sure to explicitly
disable features to match the requested configuration.

Change-Id: I90687f35bcd953670e147be9e70af03aaeaef5dc
Ping-Bug: 14606
Reviewed-on: https://code.wireshark.org/review/31933
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-02-10 14:50:49 +00:00
Gerald Combs 0173337c91 CMake: Make sure we deploy Qt PDBs on Windows.
Pass "--pdb" to windeployqt 5.6 and later.

Add a note about installing the "Qt Debug Information Files" component
to the Developer's Guide.

Change-Id: I81329bc9f9131050b1076fe275445b6325c24794
Reviewed-on: https://code.wireshark.org/review/31921
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>
2019-02-07 04:41:04 +00:00
Uli Heilmeier af3c6115f2 CMake: Fix build without LibXml2
This is still needed when LibXml2 is missing, otherwise the build fails with:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.

Fixes: v2.9.1rc0-625-gd17e218918 ("CMake: Update FindLibXml2.cmake")
Change-Id: I06fc2c18aa82dd553d5a10604c1a874c9a2e88a8
Reviewed-on: https://code.wireshark.org/review/31896
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-02-05 15:35:48 +00:00
Gerald Combs 2ed12a238b 2.9 → 3.1.
Change-Id: Iea6b55037bfb62d2e9b333148cbdc55fcd53dfa2
Reviewed-on: https://code.wireshark.org/review/31888
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-02-05 01:21:10 +00:00
João Valverde d17e218918 CMake: Update FindLibXml2.cmake
Change-Id: I55f77910be642535cba128900c2af40fa6824f04
Reviewed-on: https://code.wireshark.org/review/31874
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2019-02-04 10:14:36 +00:00
João Valverde 1bb1ffa9ca CMake: Install documentation to docdir
Change-Id: I6860f2ba8c09daff3a72e44f0c41a1b19fb79218
Reviewed-on: https://code.wireshark.org/review/31852
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2019-02-03 10:43:27 +00:00
João Valverde c2eddffb84 CMake: Fix DOCDIR on Unix
User guides are installed to doc/Wireshark. Use doc/wireshark instead.

Remove leftover variable CPACK_PACKAGE_NAME.

Change-Id: I9a1d6bdc7d8f0b48c61e43679285d5ba83904a63
Reviewed-on: https://code.wireshark.org/review/31851
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2019-02-02 16:53:49 +00:00
Peter Wu 3bbf2c5e64 CMake: describe purpose of MaxMindDB
Change-Id: I7a3ec64d772ee5fc0d3b040702dfc0de8da93250
Reviewed-on: https://code.wireshark.org/review/31836
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-31 13:16:12 +00:00
Peter Wu 298da5213b CMake: describe the purpose of NL
Change-Id: I9bfb2400445399088ff67eab39178e38daf85499
Reviewed-on: https://code.wireshark.org/review/31835
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-31 13:15:58 +00:00
Peter Wu 87e5269c69 CMake: rewrite FindSystemd.cmake file
Clarify that this is only needed for the sdjournal extcap interface and
report the found version in the CMake output.

Change-Id: I40bc540631bda32d0b92e4fcd59d8c1726606d86
Reviewed-on: https://code.wireshark.org/review/31834
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-31 13:15:47 +00:00
João Valverde 1260f3edea CMake: Minor standard output improvements
Change-Id: I7677220ec49d7b04f61e2a7287dac3a744f1c6c6
Reviewed-on: https://code.wireshark.org/review/31786
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2019-01-29 15:03:25 +00:00
João Valverde 4f46a2af88 CMake: Set a direct rpath for libraries
Instead of using "$ORIGIN/../lib" just use "$ORIGIN".

Also be explicit in configuring the relative RPATH. We don't want
to assume a default relative path, in case more targets are addded,
out of caution.

Change-Id: I3b7f5e8de7be8bb30aca3b433212113d876c4163
Reviewed-on: https://code.wireshark.org/review/31647
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-22 00:55:40 +00:00
Peter Wu 6a7865e969 CMake: strip directory prefixes from __FILE__ macros
Depending on the build location, the full source and/or build directory
is currently visible in error messages (for example, DISSECTOR_ASSERT).
Remove these to help with reproducible builds and have shorter messages.

A similar option (-fdebug-prefix-map) is also needed, but it affects
external debugging tools and is therefore better left to distributors
(Debian and Arch Linux do this for example).

Bug: 15163
Change-Id: Icd8559bef2035f295aefbfc57ba6a342bfe76a41
Reviewed-on: https://code.wireshark.org/review/31645
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-21 13:29:41 +00:00
João Valverde a37388fbb6 CMake: Remove unnecessary check for CMAKE_INSTALL_RPATH
CMAKE_INSTALL_RPATH is set inside the if() block and not before.

Change-Id: Id8a863ca9bf5fed367de3fa7681a9a269d3f4f07
Reviewed-on: https://code.wireshark.org/review/31646
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-21 12:01:56 +00:00
Uli Heilmeier 03d67b8867 CMake: Fix LIBXML2 handling
Since commit a3991874eb cmake fails
when LIBXML2 is not found.
LIBXML2_INCLUDE_DIR is used but not set.

This commit sets LIBXML2_INCLUDE_DIR.

Change-Id: Ieb8b4accb5360d397b961fbd311ae349aac2c658
Reviewed-on: https://code.wireshark.org/review/31638
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2019-01-20 22:39:26 +00:00
Peter Wu 5dd86a0a7e CMake: do not set RPATH when installing to a system directory
When built with -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib
(as is done by many Linux distributions), do not set an unnecessary
RPATH. This was the case before v2.9.0rc0-2727-g697623411c.

Relocatable builds will still be possible with the default options as
/usr/local/lib is typically not considered a system library path.

Change-Id: Ic6ff1760183c20d3f9f9fb787604e888e116534e
Reviewed-on: https://code.wireshark.org/review/31602
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-20 21:59:42 +00:00
João Valverde a3991874eb CMake: Replace PACKAGELIST magic
This is more explicit and easier to read with slightly better locality
while using less code.

Also less awkward when the package doesn't fit the narrow package list
expectations.

The ws_find_package() macro doesn't include all the status messages. The
choice was to rely on standard find_package() and feature_summary() output
and be less verbose.

Avoid polluting the CLI build interface. Per target include paths and
macro definitions are preferred.

Because this patch intentionally removes the global CMAKE_*_FLAGS
and include_directories() usage in favor of target properties, some
untested build configurations may inadvertently break because of
missing ${PACKAGE}_INCLUDE_DIRS or ${PACKAGE}_DEFINITIONS. This
required a manual review of dependencies that might have been
incomplete.

${PACKAGE_VAR}_LINK_FLAGS seems to be unused.

Changing the CMake Qt code to use more modern CMake component syntax
is left as future work.

Change-Id: I3ed75252189a6e05a23ed6e619088f519cd7ed78
Reviewed-on: https://code.wireshark.org/review/31496
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-20 11:50:10 +00:00
Peter Wu f3f97e976b CMake: set CMAKE_BUILD_RPATH_USE_ORIGIN
Tested with cmake v3.13.3-952-gf4c17c041, the resulting binaries indeed
contain $ORIGIN and are invariant of the build directory.

Change-Id: I5dad9493a6d54a0b03a3494fce69cc69a25b2f84
Ping-Bug: 15163
Reviewed-on: https://code.wireshark.org/review/31586
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-18 11:25:12 +00:00
Peter Wu 17cdfe9d77 CMake: silence CMP0083 warning from future CMake 3.14
The current development version of CMake started emitting warnings due
to the use of CMAKE_POSITION_INDEPENDENT_CODE without setting CMP0083.

Change-Id: Id6747c00fea7a1d28e5ba900ba4578fe89f40f83
Reviewed-on: https://code.wireshark.org/review/31579
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-17 22:28:14 +00:00
Gerald Combs 7fa8215feb Windows: Use a c-ares DLL built with vcpkg.
Update the Windows build environment to use c-ares packages built from
a VS 2017 command prompt with

    set CARES_VERSION=1.15.0
    vcpkg install c-ares:x86-windows c-ares:x64-windows
    vcpkg export c-ares:x86-windows --output=c-ares-%CARES_VERSION%-win32ws --zip
    vcpkg export c-ares:x64-windows --output=c-ares-%CARES_VERSION%-win64ws --zip

The packages also include a PDB, so  copy it to the build directory and
add it to the PDB .zip.

Change-Id: I1887ca89d897bea184144315219b366096519961
Reviewed-on: https://code.wireshark.org/review/31376
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-01-14 21:31:08 +00:00
Gerald Combs 290214adc9 tarball+RPM: Fetch our version from CMake.
Move git-export-release.sh to packaging/source. Have the source and RPM
packaging derive version information from CMake's VERSION variable. This
brings them in line with the rest of our packaging and avoids having to
read chicken entrails^W^Wgit output.

Make sure we always generate wireshark.spec.

Bug: 15359
Change-Id: I188efda489c94449a10a612abebf9c2872c305cb
Reviewed-on: https://code.wireshark.org/review/31504
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-01-14 17:41:43 +00:00
Dario Lombardo c3d198c401 dfilter: add string() function.
This function can convert non-string fields into strings. This allows the
user to apply string functions (like contains and matches) to non-string fields.

Examples:

string(frame.number) matches "[13579]$" => for odd frames
string(eth.dst) matches "aa\.bb\.cc\.dd\.ee\..." => to match a group of stations
string(snmp.name) matches "^1.2.3.4" => for all OIDs under a specific node

Change-Id: I18173f50ba5314ecdcd1e4b66c7e8ba5b44257ee
Reviewed-on: https://code.wireshark.org/review/31427
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-14 16:00:29 +00:00
Peter Wu 252938ed25 CMake: remove --clean from rpmbuild invocation
This allows for inspection of the build artifacts for a RPM build.
It is consistent with the deb-package target not executing --post-clean.

Change-Id: I63e3c571c893a104b5cfa98a0c67c8fdca03a964
Reviewed-on: https://code.wireshark.org/review/31538
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-14 15:21:45 +00:00
Peter Wu 4de0ea38cd CMake: change static qtui library into an object library
Save 800ms and avoids a synchronization point (improves build
parallelism) by directly adding object files to the wireshark binary.

Change-Id: I7d1484c65a26f3f6874474b61d38ba474aba8347
Reviewed-on: https://code.wireshark.org/review/31512
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-12 18:20:52 +00:00
Peter Wu 5cc461490d CMake: use object libraries to avoid redundant builds
Some source files are duplicated via add_executable. Assuming that these
are not affected by target-specific preprocessor macros, they can be
built only once and shared among executables.

In one configuration, this reduces the number of object files by 55
(cli_main.c and version_info.c alone were built 15 times each).

Removes the version dependency from each target since the 'version_info'
target can now declare this dependency. Remove CLEAN_C_FILES from extcap
since it is not used to set -Werror. Due to removing some files from
wireshark_FILES (and others), these are no longer part of checkAPIs
though. Hopefully that is acceptable.

Change-Id: I0a3f1ffb950e70a6176c96d867f694fbc6476f58
Reviewed-on: https://code.wireshark.org/review/31509
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: João Valverde <j@v6e.pt>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-12 18:20:44 +00:00
João Valverde 16953eca30 CMake: Remove legacy workaround for GTK+Zlib
Right now only the GTK+ 2.24.23 and GnuTLS 3.4.11 packages in trunk contain
include/zconf.h, these are used by master-2.6 but not current master.

Change-Id: If4e0407c83432fa0780e0ac8a2e15b92dbca8f17
Reviewed-on: https://code.wireshark.org/review/31505
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-01-12 12:03:14 +00:00
Peter Wu 3cc0cfc48c CMake: try harder to find the right Python version
The FindPythonInterp module does not verify that a discovered 'python'
program is actually Python 3. Replace this deprecated module by a modern
version that was introduced with CMake 3.12.

Remove PYTHON_EXECUTABLE from WSDG now that it is much more likely that
CMake discovers the right version.

Change-Id: I1f8438baced3d5bf9e1e2732980ad177d3257ca3
Reviewed-on: https://code.wireshark.org/review/31468
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-10 06:42:08 +00:00
Gerald Combs 1243976ccd Move make-version.pl to tools.
Move make-version.pl to the tools directory.

Change-Id: I7c3ec8951a682d45d650e3fdb1580d90bf19e8b4
Reviewed-on: https://code.wireshark.org/review/31473
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>
2019-01-10 05:18:29 +00:00
Peter Wu fd4d41fc32 CMake: remove LocatePythonExecutable.cmake for Windows
Cygwin is now unsupported, so remove special handling for it and rely on
FindPythonInterp.cmake to locate an appropriate version.

This patch can only cause issues if the PATH environment variable
contains the Cygwin binary directory without any native Python version
appearing before that. In that case, either remove Cygwin from PATH or
add the native Python (e.g. C:\Python37) earlier in PATH.

Change-Id: Ia5554e5a83d06a941dacf4a28d41d84fca4fe99d
Reviewed-on: https://code.wireshark.org/review/31453
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
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>
2019-01-09 04:22:27 +00:00
Peter Wu aac30ba2d1 CMake,WSDG: Remove Cygwin support
Declare Cygwin as unsupported and remove all supporting code. Simplify
some Chocolatey notes in the WSDG.

Remove FindPerl.cmake as it only existed to force use of Wireshark's
bundled FindCygwin.cmake (bug 13922). FindXSLTPROC.cmake special
handling for Cygwin was also removed, in theory this could cause issues
when the PATH contains a Cygwin xsltproc, but it's unsupported anyway.

Change-Id: Iabfac2b4a9fd930530505d27bdba618bdb8f7f34
Reviewed-on: https://code.wireshark.org/review/31452
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-09 04:21:50 +00:00
Peter Wu 2e411dba93 test: allow running pytest without specifying the tests directory
This allows `pytest` to be executed from the top-level source or build
directory (or any other directory below).

Change-Id: Ib7af2ea2aaf01319d6839d2dc67228fbb5a7bc34
Reviewed-on: https://code.wireshark.org/review/31370
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-05 06:46:54 +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
p11-kit.

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
Reviewed-on: https://code.wireshark.org/review/30855
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-12-29 10:40:16 +00:00
Dario Lombardo 5444b41530 test: add suite_outputformats for json output regression testing.
This suite uses different output formats to check against fixed
samples.

Change-Id: I8adccfefea35a6d3cfacf3da61e8a72d830ed3a0
Reviewed-on: https://code.wireshark.org/review/31056
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2018-12-26 19:32:47 +00:00
Atli Guðmundsson a051c12f2c Added a generic dissector validator and some ASTERIX unit tests that use it.
This patch extends the test suite with:
* a way for tests to check if a given byte sequence dissects into an expected dissection result.

Unit tests included:
* ASTERIX I019
* ASTERIX I063
* ASTERIX I065

Change-Id: Ib168382ec15b0b610ff5913806120ba1bf1d1503
Reviewed-on: https://code.wireshark.org/review/31083
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-12-26 16:52:40 +00:00
Gerald Combs 25e1e2c848 CMake: Don't bundle our libraries at compile time.
Setting LIBRARY_OUTPUT_DIRECTORY to Wireshark.app/Contents/Frameworks
for each of our libraries ends up installing a fully versioned .dylib
along with soversion and unversioned symlinks, which is more than we
want and which wastes disk space when osx-app.sh dsymifies our
libraries.

Leave LIBRARY_OUTPUT_DIRECTORY unset and depend on osx-app.sh to copy
our libraries into place.

Bug: 15361
Change-Id: If0fbaa796b4be806e2aa13887e511a330fe55df5
Reviewed-on: https://code.wireshark.org/review/31139
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-12-20 20:34:39 +00:00
Joakim Karlsson f01a9d9fe8 CMake: make use of sdjournal build flag
With this change CMake will not build sdjournal when
feature turned off

Change-Id: I896c8286b95abdf7ec668c4ab6c8dfacc930be03
Reviewed-on: https://code.wireshark.org/review/31086
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-12-19 18:31:19 +00:00
Gerald Combs dca4c992fc CMake: More VERSION_GREATER_EQUAL fixes.
Change-Id: Id6cc4f05f564383b2844aa00ebd21d204e4320db
Reviewed-on: https://code.wireshark.org/review/31063
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-12-16 17:36:54 +00:00
Gerald Combs 985fd11798 CMake: VERSION_GREATER_EQUAL didn't appear until 3.7.
Change-Id: Ib650129bfc4d686f49e8f2cf58f4978ef98dc5c0
Reviewed-on: https://code.wireshark.org/review/31059
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-12-16 09:34:51 +00:00
Gerald Combs 22bd32bde6 CMake: Fixup some logic in CMakeLists.txt
Fix the check for !APPLE && CMAKE_OSX_DEPLOYMENT_TARGET.

Change-Id: Ib6b33935062a03e2f53180431de2c0a3c8005fe5
Reviewed-on: https://code.wireshark.org/review/31058
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-12-16 00:40:08 +00:00
Gerald Combs e13d8be962 CMake: Make sure we use the same minimum macOS version everywhere.
Add a MIN_MACOS_VERSION variable. Update it and sanity check it
according to CMAKE_OSX_DEPLOYMENT_TARGET and our Qt version. Use it to
set our minimum macOS version in various places.

Change-Id: Icaf0dbe463f34d182986868021e2b56d2239da38
Reviewed-on: https://code.wireshark.org/review/31048
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-12-15 07:38:08 +00:00
Guy Harris a34cc98b2a Put the main() and wmain() routines for CLI programs into a separate file.
That means that code is only in one place, rather than having copies of
it in each of those programs.

CLI programs that, on Windows, should get UTF-8 arguments rather than
arguments in the local code page should:

	include the top-level cli_main.h header;

	define the main function as real_main();

	be built with the top-level cli_main.c file.

On UN*X, cli_main.c has a main() program, and just passes the arguments
on to real_main().

On Windows, cli_main.c has a wmain() function that converts the UTF-16
arguments it's handed to UTF-8 arguments, using WideCharToMultiByte() so
that it doesn't use any functions other than those provided by the
system, and then calls real_main() with the argument count and UTF-8
arguments.

Change-Id: I8b11f01dbc5c63fce599d1bef9ad96cd92c3c01e
Reviewed-on: https://code.wireshark.org/review/31017
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-12-13 00:52:11 +00:00
Gerald Combs 17b721e451 2.9.0 → 2.9.1.
Change-Id: I5c1a26f234289edeb9e29f5b8a8bdd220bd49ecf
Reviewed-on: https://code.wireshark.org/review/31028
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-12-13 00:40:18 +00:00
Gerald Combs 4d6509854c Packaging: Add initial support for AppImage.
Add an "appimage" target that will create an AppImage package. Current
AppImage tools assume that you only have one executable, so add
a custom AppRun wrapper that will let you run our associated CLI
utilities via symlinks, e.g.

    ln -s ./Wireshark-3.2.1-x86.appimage capinfos
    ./capinfos --help

Packaging requires both linuxdeployqt and appimagetool, although we
might be able to reduce this to just linuxdeployqt:

    https://github.com/probonopd/linuxdeployqt
    https://github.com/AppImage/AppImageKit

I haven't done much testing beyond running Wireshark and
capinfos. There are undoubtedly issues that need to be fixed.

Bug: 14464
Change-Id: Ic004ba1962e6a8630ebb017349d9b2c0462fd5fe
Reviewed-on: https://code.wireshark.org/review/30953
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-12-12 21:02:44 +00:00
Peter Wu 39ec5f8ec2 CMake: allow nested structures to be initialized via { 0 }
This is already permitted since C89 and popular compilers seem to
support it (including Clang 3.0 - 7.0, GCC 4.1.2 - 8.2 and MSVC 2015).
GCC used to be buggy: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119

C89 6.5.7. Initialization: "only enough initializers from the list are
taken to account for the members of the subaggregate".

Change-Id: Ic59b9fe71e2d3ce60b4b7d1074f8d84af01a817a
Reviewed-on: https://code.wireshark.org/review/30968
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-09 07:13:16 +00:00
Peter Wu f7def1d07f Revert "CMake: Fix Windows help install target"
This reverts commit 8992760c68.

Breaks the "make clean" target as it tries to remove the "help"
directory. Since this change, the macOS builds started failing tests as
well (init.lua and colorfilters seems not to be applied).

Change-Id: I3fce346e04875e667680a4ed9ba3beca8054a168
Reviewed-on: https://code.wireshark.org/review/30950
Reviewed-by: João Valverde <j@v6e.pt>
2018-12-07 02:01:40 +00:00
Peter Wu ceef87c550 CMake: limit -Wextra-semi to C++ only
Saves a check and removes a GCC warning from CMakeError.log:

    cc1: warning: command line option ‘-Wextra-semi’ is valid for C++/ObjC++ but not for C

Change-Id: I76d027e7b5703b06237ac70eb340c4a09322e09e
Fixes: v2.9.0rc0-958-g866ddb1b18 ("Add -Wextra-semi to (clang) C and C++ flags to make sure the buildbots will find this.")
Reviewed-on: https://code.wireshark.org/review/30948
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2018-12-06 23:22:52 +00:00
João Valverde 697623411c CMake: Use $ORIGIN with RPATH
Make our package relocatable on Unix systems.

Linux, Solaris and FreeBSD are known to support $ORIGIN.

Change-Id: Ibcdda33d62c075bfa867d006cb6aaf5824609011
Reviewed-on: https://code.wireshark.org/review/30896
Petri-Dish: João Valverde <j@v6e.pt>
Reviewed-by: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-12-03 23:54:15 +00:00
João Valverde c3741a653b CMake: Simplify CMAKE_INSTALL_DATADIR usage
Change-Id: I414aa551b8e9315a654f4da62b882e787d4f6d53
Reviewed-on: https://code.wireshark.org/review/30904
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-12-03 22:35:37 +00:00
João Valverde 8992760c68 CMake: Fix Windows help install target
We can't install from DATAFILE_DIR on this platform, we
must use CMAKE_BINARY_DIR.

Do that and try to keep this thing intact.

Ping-Bug: 15301
Change-Id: I5c0b787f8b1a148dda52f26242ab681e3c3a0d44
Reviewed-on: https://code.wireshark.org/review/30879
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-12-02 22:00:38 +00:00
Pascal Quantin 4adaeee0eb Win32: update the zlib 1.2.11 CMake file
- get rid of the CMP0048 deprecation warning
- fix the absolute install path (João Valverde)

Change-Id: If2353987483b17b38a43a2400b97f1446c312e28
Reviewed-on: https://code.wireshark.org/review/30886
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-12-02 16:12:57 +00:00
João Valverde 0ceead5335 CMake: Avoid link_directories()
Change-Id: Ia5fbf638dfef9150978f74c6dd4d54e207483a5c
Reviewed-on: https://code.wireshark.org/review/30852
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-12-01 03:11:05 +00:00
João Valverde 8efc2b8f44 CMake: We require version > 2.8.12
Change-Id: Ic2e8565792bd581724c5a80b382e3f125519d56d
Reviewed-on: https://code.wireshark.org/review/30851
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-12-01 02:50:55 +00:00
João Valverde dd457b0878 CMake: Generate cmake target exports on Windows
CMake requires zlib to be added to the exports via epan and wiretap
targets.

Ping-Bug: 15301
Change-Id: I5cfe746e67c195eb83b1d159a2cc2a645c8c47ea
Reviewed-on: https://code.wireshark.org/review/30793
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-11-30 10:52:58 +00:00
Gerald Combs 2bcc8dbf26 NSIS: Install NPcap instead of WinPcap.
Install NPcap 0.99-r7 instead of WinPcap in the NSIS installer. Update
and/or remove installer text, variables, and variable names accordingly.

Change-Id: Ied36f00c2516127969894f55698e70401dfffb4f
Reviewed-on: https://code.wireshark.org/review/30829
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-30 06:12:23 +00:00
Peter Wu bcd32b07e7 Drop support for GnuTLS 2.12.x, require GnuTLS 3.2 or newer
Upcoming changes need GnuTLS >= 3.0.2. Require GnuTLS 3.2 (or newer) for
licensing reasons. The Debian control file still mentions 3.2.14 because
older packages linked with a GMP library that was not GPLv2+ compatible.

RHEL6 only has 2.12.23, but is already unsupported anyway.

Change-Id: I024b2a734ebb16b73a624bb2435c254e963d8b7d
Reviewed-on: https://code.wireshark.org/review/30832
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-29 22:11:27 +00:00
João Valverde f4194b128f CMake: Change some install() paths to match NSIS package
Currently our Windows code looks for data files in the same
folder as the binary executable (presumably to make the
application relocatable, although it should be possible
to improve this with relative paths?).

Ping-Bug: 15301
Change-Id: I0fef4e87dc9d1d8edef81dd11755761fddd0fd12
Reviewed-on: https://code.wireshark.org/review/30819
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-11-29 03:19:53 +00:00
João Valverde a062ab81dd CMake: Enable install target on Windows (missing DLLs)
Ping-Bug: 15301
Change-Id: I3146f43bcbae1abe566d96c8e9196019931474e2
Reviewed-on: https://code.wireshark.org/review/30818
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: João Valverde <j@v6e.pt>
2018-11-29 02:36:58 +00:00
João Valverde 40352d75cd CMake: Fix some transitive link dependencies
libwireshark and libwiretap have their INTERFACE link dependencies
changed to the required set.

libwsutil keeps a default public visibility. Further work may
show some unneeded link requirements.

The executable dependencies are adjusted accordingly.

Change-Id: I3a534f72403819cac136ae47a3d80acee76e0fb3
Reviewed-on: https://code.wireshark.org/review/30815
Reviewed-by: João Valverde <j@v6e.pt>
2018-11-29 02:21:51 +00:00
João Valverde 8915deaef3 CMake: Workaround for broken install target on Windows (help)
The installation step cannot depend on CMAKE_CFG_INTDIR.
This step is executed in a cmake script without the build
tool so variables like $(Configuration) of Visual Studio
don't get substituted, breaking the installation.

Ping-Bug: 15301
Change-Id: Idc0c48b6dc440ad1d9b2d6a2824cc89190997b60
Reviewed-on: https://code.wireshark.org/review/30784
Reviewed-by: João Valverde <j@v6e.pt>
2018-11-25 03:02:52 +00:00
João Valverde 65c13f9b90 Install development headers on all platforms
Install headers to support plugins development on Windows.

Change-Id: I3161bd2f730edf62ab44fee6ce4fedbb9aee0d31
Reviewed-on: https://code.wireshark.org/review/30776
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-11-24 13:48:16 +00:00
Peter Wu ad21e3121f CMake: disable -Wmissing-field-initializers for broken compilers
AppleClang 9.1.0.9020039 is complaining about a "missing initializer" in
dumpcap.c. Rather than doing ugly things like one of the following:

    struct s x;
    memset(&x, 0, sizeof(x));
    struct s y = {.field=0};

just disable the warning (enabled via -Wextra) on broken compilers. The
minimum versions were determined using https://gcc.godbolt.org/

The special "universal zero initializer { 0 }" exception is explicitly
documented in the GCC manual (as shipped with GCC 8.2.1). Clang 6 does
not document it, but r314499 (as included with Clang 6) does implement
it and adds tests for it. (Xcode 10.0 seems based on Clang 6.0.1.)

Change-Id: I8e48d8c424a512ca36ef8c4f832ce81b3675232c
Reviewed-on: https://code.wireshark.org/review/30684
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-20 05:10:48 +00:00
Peter Wu 811d5f7fac Drop JSON-GLib completely
JSON-GLib was added in v2.9.0rc0-201-g511c2e166a, but is no longer
necessary since we have a home-grown JSON dumper (wsutil/json_dumper.h).
Remove the remaining traces and additionally remove GObject from
FindGLIB2.cmake since it was only added for JSON-GLib.

Change-Id: If9dfd2c60cec130f98109d100bdb6618bde06ba0
Reviewed-on: https://code.wireshark.org/review/30733
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-20 05:04:11 +00:00
Peter Wu 923d719f2b CMake: call cmake_minimum_required before project
cmake_minimum_required() MUST be called even before project(), otherwise
some policies will not be correctly set. On the macOS build on Travis
for example, CMP0025 was accidentally set to "OLD" which resulted in
CMAKE_C_COMPILER_ID being reported as "Clang" instead of "AppleClang".

Change-Id: I20065e621628cde24946edb519d719f527936d87
Reviewed-on: https://code.wireshark.org/review/30685
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-18 07:20:41 +00:00
Peter Wu e9f7bb5127 Require Python 3, drop Python 2 support
Python 3 is widely available. All major Linux distributions support it.
RHEL is covered via EPEL (which is already required for cmake3). Drop
support for Python 2 in order to reduce maintenance costs. The main
motivation is being able to simplify the tests.

CMake is updated to search for Python >= 3.4 and will fail if
unavailable (generating dissectors.c requires Python, so it is quite an
important piece to have).

The documentation is updated to reflect the Python 3.7 paths used by
Chocolatey. Tested the git-review installation instructions in Windows 7
x64 without a previous Chocolatey installation.

macOS brew now installs Python 3 (its dependencies are already installed
by python@2 for libxml2). The macOS (non-brew variant) is updated to use
the official 64-bit installer to install Python 3.

Change-Id: I80b1e36957f338e0dad1bfcc173b6418682cddba
Reviewed-on: https://code.wireshark.org/review/30192
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-07 20:46:59 +00:00
Gerald Combs 8b977a43d6 Move condition logic to dumpcap.c
Move the condition logic from capture_stop_conditions.c to dumpcap.c.
Remove capture_stop_conditions.[ch] and conditions.[ch].

Switch duration values to doubles.

Change-Id: Ifa74fb13ec8fc923b0721597a6cf071d72069ea0
Reviewed-on: https://code.wireshark.org/review/30440
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-01 05:09:10 +00:00
Peter Wu 9f472ea150 CMake: fix broken oss-fuzz build due to the -pie option
check_function_exists (as used by FindZLIB.cmake) seems to fail with the
-pie option as well, do not try to enable it when building for oss-fuzz.

Change-Id: I7d7e0fce1972483a14ac0a91a9f144f22c5ae8a0
Fixes: v2.9.0rc0-2349-g895ad30b5a ("CMake: Fix -pie linker test")
Reviewed-on: https://code.wireshark.org/review/30431
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-10-30 14:33:29 +00:00
João Valverde 895ad30b5a CMake: Fix -pie linker test
Fix wrong argument order on invocation of check_c_linker_flag().

Change-Id: If4b016b428983580f3fbd00433bee904db97b2a3
Reviewed-on: https://code.wireshark.org/review/30397
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-10-28 09:48:25 +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 build.sh 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
Reviewed-on: https://code.wireshark.org/review/30228
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-20 07:00:43 +00:00
Peter Wu 021b305bcb CMake: limit the -pie linker option to executables
WS_LINK_FLAGS also apply to libraries, but -pie has no effect on them.

Change-Id: I9c7fde228c5faf20edf0ad45692577070b24a280
Reviewed-on: https://code.wireshark.org/review/30239
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-18 20:04:32 +00:00
Gerald Combs 573e842002 Windows: Make our program details more consistent.
Use a single template file for most of our program resources. Encode
our resource files as UTF-8. Add resources to extcap/*.exe.

Replace a regex with concatenation.

Change-Id: I0ed49086618127ca4fdef69272f849d8f16e4dab
Reviewed-on: https://code.wireshark.org/review/30088
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-10-10 15:40:21 +00:00
Guy Harris 237cbb1823 Put the Windows-specific system library settings in CMakeLists.txt.
We already do that for the macOS-specific system libraries; do it for
the Windows-specific system libraries as well.

Change-Id: I4646cbf5043406a9b6be70307b51df2fbe0329dd
Reviewed-on: https://code.wireshark.org/review/30066
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-08 04:14:45 +00:00
Guy Harris a679ae6f79 Use wsetargv.obj, and wmain() rather than main(), on Windows.
Doing so for command-line programs means that the argument list doesn't
ever get converted to the local code page; converting to the local code
page can mangle file names that *can't* be converted to the local code
page.

Furthermore, code that uses setargv.obj rather than wsetargv.obj has
issues in some versions of Windows 10; see bug 15151.

That means that converting the argument list to UTF-8 is a bit simpler -
we don't need to call GetCommandLineW() or CommandLineToArgvW(), we just
loop over the UTF-16LE argument strings in argv[].

While we're at it, note in Wireshark's main() why we discard argv on
Windows (Qt does the same "convert-to-the-local-code-page" stuff); that
means we *do* need to call GetCommandLineW() and CommandLineToArgvW() in
main() (i.e., we duplicate what Qt's WinMain() does, but converting to
UTF-8 rather than to the local code page).

Change-Id: I35b57c1b658fb3e9b0c685097afe324e9fe98649
Ping-Bug: 15151
Reviewed-on: https://code.wireshark.org/review/30051
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-07 18:57:54 +00:00
Guy Harris 3db32bcb5d Revert "Use CMAKE_EXE_LINKER_FLAGS to set link flags on executables."
This reverts commit 84447550ef.

Reason for revert: CMake's documentation for the flags variables is
close to content-free, giving no indication what the link flags used
in the link will be, given a combination of various CMAKE.*LINKER_FLAGS
variables and LINK_FLAGS properties.  That makes it extremely difficult
to determine why this change happens to cause some executables to
be linked with "/INCREMENTAL" and others to be linked with
"/INCREMENTAL:YES", even though we add "/INCREMENTAL:NO" to
WS_LINK_FLAGS and add WS_LINK_FLAGS to CMAKE_EXE_LINKER_FLAGS - or
why *not* setting CMAKE_EXE_LINKER_FLAGS and instead using LINK_FLAGS
*doesn't* cause that to happen.

Maybe it's an issue of CMAKE_EXE_LINKER_FLAGS vs.
CMAKE_EXE_LINKER_FLAGS_<CONFIG>, but the documentation doesn't
clearly indicate whether, for example, the link flags for a particular
executable target are a combination of CMAKE_EXE_LINKER_FLAGS, the
CMAKE_EXE_LINKER_FLAGS_<CONFIG> flag for the configuration of this
build, and the LINK_FLAGS property of the target, if any.  That's
the most *obvious* behavior to implement, but if that's the behavior
that's implemented, I'm not sure why the change being reverted had the
effect it did.

Change-Id: I6a73fe88be65378d506a89460f7362076233f319
Reviewed-on: https://code.wireshark.org/review/30023
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
2018-10-04 18:45:14 +00:00
Guy Harris 84447550ef Use CMAKE_EXE_LINKER_FLAGS to set link flags on executables.
Just set CMAKE_EXE_LINKER_FLAGS to include ${WS_LINK_FLAGS}, and also
set it to include setargv.obj on Windows.

This is a bit simpler.

Change-Id: Idf9c632d9d3bff1ec6e70396641319155e08aa4f
Reviewed-on: https://code.wireshark.org/review/30004
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-03 20:04:16 +00:00
Guy Harris 105f2d68d8 You have to add setargv.obj as a link flag, not as a library.
Change-Id: Iab00c28b8fdb5649a115fb7f006ba176d4a4223e
Reviewed-on: https://code.wireshark.org/review/29986
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-02 21:06:58 +00:00
Guy Harris 97972ea9ff We should only link executables with setargv.obj.
Libraries shouldn't be linked with it.

See if this fixes the weird problems I'm having with mergecap -
including, apparently, the mergecap from the buildbots - when run with
wildcard arguments, terminating before it gets to main() (making it hard
to try to debug bug 15151).

Change-Id: Ie793b0ea8157186a121106636ac8b782457c09f5
Reviewed-on: https://code.wireshark.org/review/29985
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-02 20:34:43 +00:00
Gerald Combs fdecc62c73 CMake: Add a systemd RPM check.
Change-Id: Ib679994f5af129254865daad211913a6b068de12
Reviewed-on: https://code.wireshark.org/review/29968
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-10-02 04:42:03 +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-on: https://code.wireshark.org/review/29479
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-01 08:58:13 +00:00
Jeff Morriss 074f8c492c RPM: optionally use ccache to speed up (re)builds.
Installing and enabling ccache makes testing RPM builds (which always do a
complete build) much less painful.

Change-Id: Ie9ab1794614701cdbe261089f81398c2b7d1f027
Reviewed-on: https://code.wireshark.org/review/29812
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: Gerald Combs <gerald@wireshark.org>
2018-09-24 20:41:56 +00:00
Jeff Morriss 4b4c11944c RPM packaging: maxminddb is optional.
Don't require the RPM to include maxminddb if we couldn't find it.  Treat it
like the other optional packages: enable it in the RPM iff we found it.

IOW if cmake ran and will build Wireshark [without maxminddb] you'll also be
able to build an RPM [without maxminddb].

Change-Id: I012b75ae44e9289275b68db2eb804fc45bb0d330
Reviewed-on: https://code.wireshark.org/review/29807
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2018-09-24 15:57:17 +00:00
Guy Harris a6dc0c27fc Don't use -Werror with Apple's llvm-gcc.
Its handling of warnings, and of warnings-treated-as-errors, is horribly
broken; once you've asked for a warning, and have specified -Werror,
there appears to be nothing whatsoever that you can do to keep that
warning from being an error *everywhere* in the code.

Prior to change Ib591a1d6beaa13337d927a446b4d8d5e687ff610, the tests for
warnings were all failing on the macOS buildbot, so *no* warnings were
being requested.

With this change, a warning won't be reported as an error, but at least
it'll be reported.

(We should probably switch to using Clang on the macOS buildbot at some
point; I don't know whether the version of Clang currently on the
buildbot is safe to use, but if we ever run a newer version of Xcode,
which doesn't come with llvm-gcc - which may involve running a newer
version of macOS on the buildbot as well - it's presumably safe, given
that it's the only compiler Apple shipped.)

Change-Id: I677967cb87b91f68f08de546e59abff1dbd6788b
Reviewed-on: https://code.wireshark.org/review/29623
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-12 04:22:33 +00:00
Guy Harris 4bab4b2e0c OK, try to prevent -Wunused-function warnings with llvm-gcc as well.
Change-Id: I53e48eb14d157eacd24322fb978f039e57377ed8
Reviewed-on: https://code.wireshark.org/review/29622
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-12 03:23:12 +00:00
Guy Harris 69a01b650a With llvm-gcc, just don't do -Wshorten-64-to-32.
If you specify -Werror and -Wshorten-64-to-32, there does not appear to
be any way to get llvm-gcc *NOT* to treat those warnings as errors - not
with pragmas, and not even with -Wno-error=shorten-64-to-32.

Change-Id: Ia82df3f548085cca8d187c4b43c02060b87f0542
Reviewed-on: https://code.wireshark.org/review/29620
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-12 01:28:57 +00:00
Guy Harris 2f65fbae4e -Wcomma isn't supported by llvm-gcc, so don't make it a non-error.
Replace a tab in an arguments string with a space while we're at it.

Change-Id: Iee6ce920fbd7a883fb23bc798abb7f965e3757e6
Reviewed-on: https://code.wireshark.org/review/29619
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-12 00:50:55 +00:00
Guy Harris a8024f1dc0 Just spaces between -W arguments.
Ninja, at least, complains about tabs.

Change-Id: I65c3458dadc7096773084864d5e3970d1d9d580d
Reviewed-on: https://code.wireshark.org/review/29618
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-11 23:15:56 +00:00
Guy Harris 8e0d8acadc WERROR_COMMON_FLAGS isn't a list, so don't treat it as one.
Change-Id: Iea0b39a61fade5ac87ed31efaf8c1c7a90aa4fb7
Reviewed-on: https://code.wireshark.org/review/29617
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-11 22:11:52 +00:00
Guy Harris b09f27ce0f Add the -Wno-error= flags to the correct variable.
Change-Id: I61896b959da1a7cbdb0faab99b60b57d1c00cbb7
Reviewed-on: https://code.wireshark.org/review/29616
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-11 21:40:27 +00:00
Guy Harris 87887802ef Put the -Wno-error= options after -Werror.
It appears that -Werror overrides them, at least with llvm-gcc; I guess
the options are evaluated in order.

Change-Id: I0fd9e544a8e191a8950e17e97513912034763645
Reviewed-on: https://code.wireshark.org/review/29615
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-11 21:11:21 +00:00
Guy Harris 7533398f65 OK, try just suppressing the "-Wunused-function" warning with llvm-gcc.
Was Apple trying to release a game for Mac OS X, somewhat resembling
Whack-A-Mole, when they went into the lab and had Igor help them stitch
together the GCC front end and the LLVM back end?

Change-Id: If08392c3d244a83f50f62b4d7c878ae9a274ec4b
Reviewed-on: https://code.wireshark.org/review/29614
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-11 20:46:43 +00:00
Guy Harris f7346284ac More selectively prevent warnings from becoming errors.
Always use -Werror if it's supported, even with Apple's llvm-gcc, and
only use -Wno-error= with llvm-gcc.  Use -Wno-error= with all the errors
we get in the buildbot.

Change-Id: I6797f064d2d354f979e24fcb04f592e9313af721
Reviewed-on: https://code.wireshark.org/review/29612
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-11 19:43:15 +00:00
Guy Harris b7685821c1 Don't use -Werror with llvm-gcc.
Apple's llvm-gcc appears not to support suppressing warnings with
pragmas, so, if we're building on a Mac (we check for APPLE), and we're
not using Clang, we don't turn on -Werror, because we rely on those
pragmas to suppress otherwise-unremovable warnings in order to build
warning-free.

Change-Id: I43bd1ab42918c6ba22643b4a2d4cc3618c25434b
Reviewed-on: https://code.wireshark.org/review/29609
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-11 18:36:11 +00:00
João Valverde 0d123e5a24 CMake: Remove some redundant and overly verbose code
The original reason for having a WARN_FLAGS set of variables has
been lost.

Change-Id: I3eae3cf9d0bad5f3895f6fee59c2c64183c8f244
Reviewed-on: https://code.wireshark.org/review/29526
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-11 05:05:37 +00:00
João Valverde 23c106b86c Fix the build on the OSX buildbot
Change-Id: Ia3efd8d4fb002cffadeb86620eea4bdceb1357b6
Reviewed-on: https://code.wireshark.org/review/29584
Reviewed-by: João Valverde <j@v6e.pt>
2018-09-10 23:07:08 +00:00
João Valverde a93698a4ff Remove the tshark -z compare feature
- It cannot support IPv6.
  - Non-standard use (specifically recommended against in the RFCs)
of the IPv4 fragment ID field.
  - Has a narrow and non-obvious use case, IMO.
  - It is not supported in the Qt GUI.
  - Significant maintenance burden for an obscure feature.

Change-Id: Icaf429269dc42f78c38b8d20001508132499faf8
Reviewed-on: https://code.wireshark.org/review/29239
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-09-09 23:55:19 +00:00
João Valverde 414e1c19b2 CMake: Use more descriptive name than WS_LD_FLAG_VALID0, 1, etc.
Change-Id: Iacd0696189a6b6988bd62af3bd188d97dc50b787
Reviewed-on: https://code.wireshark.org/review/29523
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-09-09 22:39:49 +00:00
João Valverde 911f7fed61 CMake: We require version greater than 2.8.9.
Change-Id: Ia092da9b9bc87c75b6b97a117efc7a0e4b58d29c
Reviewed-on: https://code.wireshark.org/review/29509
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-09-09 17:49:00 +00:00
João Valverde eeb71e75b8 CMake: Remove Qt specific code for warnings
These warnings should already be suppressed for Qt with -isystem.

Change-Id: I9b5640f1b6da9fa8039deb2810eda3d878779c38
Reviewed-on: https://code.wireshark.org/review/29500
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-09-09 13:21:10 +00:00
João Valverde 642f0c9f1d CMake: Remove unused variable
Change-Id: I05d5ac3112ee3b09d1935dde2073e65d55430946
Reviewed-on: https://code.wireshark.org/review/29501
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-09 06:17:41 +00:00
João Valverde 6ab8d4607a CMake: Add function to test compiler flags
Remove all the duplicate code. Each test result is cached so it
needs an unique variable to store the result.

Change-Id: Ib591a1d6beaa13337d927a446b4d8d5e687ff610
Reviewed-on: https://code.wireshark.org/review/29485
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-09-09 01:52:44 +00:00
Peter Wu d703310749 cmake: optionally require Lua 5.1 or newer
doc/README.wslua reports support for 5.1 and 5.2 only. Even RHEL6 ships
with Lua 5.1, so it makes not sense to maintain support for Lua 5.0.

Change-Id: I34a8084c7fba19d631b90ce5d5a28198be6a7850
Reviewed-on: https://code.wireshark.org/review/29448
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-07 04:02:36 +00:00
Gerald Combs c15ada34b1 Update tools help using a script.
Update docbook/wsug_src/*.txt using tools/update-tools-help.py. This
removes a lot of unwanted behavior that came with updating via a CMake
target.

Change-Id: I0a24f425e9673ef7bd074210d7047654c6755e79
Reviewed-on: https://code.wireshark.org/review/29416
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-09-05 15:28:43 +00:00
João Valverde 4d6c253ca9 CMake: Add debian package target
Change-Id: I114c861e5537a010d622b31d0c335752b45f3d2e
Reviewed-on: https://code.wireshark.org/review/29360
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-31 05:52:59 +00:00
Peter Wu b55c20a1b1 CMake: fix dmg_package target since CMake 3.12
The Resources directory was removed a while back. Since CMake 3.12, the
copy_directory command will fail when the source directory is missing.
Reported by anta_tw in the #wireshark IRC channel at Freenode.

Change-Id: I4de087dd2833e79a806c8a0c9a28024848e1e03f
Fixes: v2.1.0rc0-2347-g4aa049019a ("OS X: Remove GTK+ packaging.")
Reviewed-on: https://code.wireshark.org/review/29304
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-08-29 23:51:10 +00:00
João Valverde d0b97a420d CMake: Modernize config-file package support
A CMake config-file package provides support for downstreams using
CMake and Wireshark libraries to easily configure the libwireshark
dependency with:
  find_package(Wireshark CONFIG [REQUIRED])
  target_link_libraries(foo epan)

The FindWireshark.cmake file is no longer needed.

See cmake-package(7) for more details on CMake's package system.

Change-Id: Ie8af1d44417a99dd08d37959f7b2ffca88572ec2
Reviewed-on: https://code.wireshark.org/review/29208
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-08-25 18:07:21 +00:00
João Valverde e75905a583 CMake: Add dumpcap group option to installation
Change-Id: I2718776a908ae5f9c6c475a110f9170b812b392d
Reviewed-on: https://code.wireshark.org/review/29282
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-08-25 18:06:56 +00:00
João Valverde 5e9d1e4e65 CMake: Change installation path for modules
This is one of the CMake standard paths on Unix and avoids polluting the
$libdir/wireshark folder.

Change-Id: I6e5fd81e95b52e585e92306aca18dfb2426668ca
Reviewed-on: https://code.wireshark.org/review/29255
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-08-24 14:39:08 +00:00
João Valverde f0b41190eb CMake: Clean up and homogenize plugin dir configuration
Change-Id: If43c7b124afdf6471164675f8a0c55a76e998ea1
Reviewed-on: https://code.wireshark.org/review/29254
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-08-23 08:33:56 +00:00
João Valverde 7d76d0ce28 Revert "CMake: Clean up plugin dirs"
Broke system (global) binary plugin path.

This reverts commit 450ff674a6.

Change-Id: I5353d2f3acf4450aed243040ef71425a71542a08
Reviewed-on: https://code.wireshark.org/review/29240
Reviewed-by: João Valverde <j@v6e.pt>
2018-08-22 00:49:16 +00:00
João Valverde 450ff674a6 CMake: Clean up plugin dirs
Change-Id: Ie41366205db19b8a9714ad5259c3f958e1e9ee95
Reviewed-on: https://code.wireshark.org/review/29233
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-08-21 23:06:38 +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
Stig Bjørlykke f435c36423 CMake: Remove a debug message
Remove what appears to be a debug message from CMake.

Change-Id: If6d12ca07d3c3b5f012a7e7ee530f7db18c813e5
Reviewed-on: https://code.wireshark.org/review/29215
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-21 11:04:01 +00:00
Guy Harris 6409732b77 Include dumpcap amongst the programs built with -Werror.
Change-Id: Ia946b4e99d9ddbbced8cc9515a098ca2ce4931ef
Reviewed-on: https://code.wireshark.org/review/29113
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-08-12 19:58:49 +00:00
Peter Wu caa8efa0d2 tests: add regression tests for Follow TCP Stream
Verified that the tests failed without the fixes for the linked bugs.
The tests have full statement coverage(*1) for check_follow_fragments
and follow_tcp_tap_listener. For details and Scapy script, see:
https://git.lekensteyn.nl/peter/wireshark-notes/commit/crafted-pkt/badsegments.py?id=4ecf9d858b49e76d8a9c29df01ce1bd523ae6704

 (*1) except for `if (data_length <= data_offset) { data_length = 0; }`

Change-Id: I625536df375272cf6c9116231194c39df1217fae
Ping-Bug: 13700
Ping-Bug: 14944
Reviewed-on: https://code.wireshark.org/review/28618
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-07-06 12:11:09 +00:00
Gerald Combs fe94133f0d Remove code specific to older versions of Visual Studio.
Remove -DBUILD_WINDOWS and sections of code that we no longer use.

Bug: 14715
Change-Id: Iae1a950e2f52f4ce45fcf0ae5dea06c1172c3a28
Reviewed-on: https://code.wireshark.org/review/28466
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-06-26 22:30:50 +00:00
Gerald Combs 2d8e8b9574 CMake: Make the pdb_zip_package target passive.
Remove the pdb_zip_package target's dependency on epan, otherwise we
might end up triggering a build which creates a mismatch.

Change-Id: I1e077e5f119273ee80a89c30f54e29fdb242e082
Reviewed-on: https://code.wireshark.org/review/28457
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-06-26 18:22:53 +00:00
Gerald Combs 724519d8f9 Fix shellcheck issues in debian-setup.sh.
Change-Id: I54956ea4de5e07f1d2a705f9b77624d6c25511a6
Reviewed-on: https://code.wireshark.org/review/28438
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-06-26 11:53:14 +00:00
David Kreitschmann 11ba10dd4b Fix build paths for cmake's Xcode project generator on macOS.
Multi-configuration generators (such as Xcode or VS) append the current build configuration to most paths (eg. Debug/Release). Currently this results in inconsistent paths for the application bundle and the included command line tools. This commit sets the correct path information for multi-configuration generators for macOS application bundles. The standard Makefile behaviour is untouched.

One Windows specific configuration was changed, as it was conflicting with these changes. This needs to be checked before merging.

Additionally the wrapper scripts are omitted for Xcode, as the path to the binaries depends on the configuration chosen in Xcode. Therefore it is not viable to create these scripts in the cmake run.

Bug: 11816

Change-Id: Ib43d82eb04600a0e2f2b020afb44b579ffc7a7c9
Reviewed-on: https://code.wireshark.org/review/28291
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-21 03:33:03 +00:00
Gerald Combs 17604f15a1 CMake+macOS: Make sure we're using the right Qt tools.
Qt5CoreConfigExtras.cmake sets Qt5::qmake. Use it to find the
corresponding path to macdeployqt and use those in osx-app.sh.

Change-Id: I2e67f0126e272fc95d40476b9bfc83ab38d73cee
Reviewed-on: https://code.wireshark.org/review/28359
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-06-21 03:32:27 +00:00
Gerald Combs 293be57265 Test: Add sharkd tests.
Change-Id: I0e5049700ab9285196ce6b4567bd2d034529e763
Reviewed-on: https://code.wireshark.org/review/28327
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-06-21 03:30:30 +00:00
Gerald Combs ccd2512602 CMake+macOS: Allow the use of ENV{CMAKE_PREFIX_PATH}.
If we find /usr/local/opt/qt5, pass it as a PATHS option to find_package
instead of adding it to the CMAKE_PREFIX_PATH CMake variable. This
allows setting a Qt path via the CMAKE_PREFIX_PATH environment variable.

Change-Id: I5d23fcd092c0ea137482253f3f86c1a6d27f7a5e
Reviewed-on: https://code.wireshark.org/review/28341
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-06-20 09:19:49 +00:00
Gerald Combs d88c5df0cf Test+CMake: Make our test grouping more fine-grained.
Split our tests by suite_*.group_* instead of suite_*. There are quite a
few dfilter tests and this should make them more parallelizable.

Change-Id: I52371409618cda70dc99811e8de1fb1ad9d9a3b6
Reviewed-on: https://code.wireshark.org/review/28329
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-06-18 19:36:26 +00:00
Joerg Mayer 866ddb1b18 Add -Wextra-semi to (clang) C and C++ flags to make sure the buildbots will find this.
Fix all warnings that come up.

Change-Id: Ib426e79f7c75152589a3c2af153de35ca5d63783
Reviewed-on: https://code.wireshark.org/review/28268
Petri-Dish: Jörg Mayer <jmayer@loplof.de>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2018-06-15 11:17:37 +00:00
João Valverde 722d6b06f6 Rewrite make-{dissectors,taps} in Python
Having these build tools in machine code poses problems when cross-compiling.
The most significant being that we need to find the host and build GLiB
dependencies at compile-time.

There is no noticeable speed difference between the Python and C implementation.

Ping-Bug: 14622
Change-Id: Id13f823c7f4abf51edfa291e703028873748989f
Reviewed-on: https://code.wireshark.org/review/28130
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-06-11 17:01:05 +00:00
Gerald Combs bfb7028ba9 More shellcheck fixes.
Change-Id: Iee9e464b3935d4c8a09fa9954f73496eae33f30f
Reviewed-on: https://code.wireshark.org/review/28092
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-06-11 16:35:08 +00:00
Gerald Combs f8092f96b3 Qt: Move wireshark-qt.cpp back to ui/qt/main.cpp.
The Qt UI's main module started out as ui/qt/main.cpp but was moved to
the top-level directory in order to appease Autotools. We don't need to
do that any more, so move it back.

Change-Id: Ic5bc0ed5b754e36cc2b9e682f2ca097781233dfd
Reviewed-on: https://code.wireshark.org/review/28090
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-06-08 03:50:22 +00:00
Gerald Combs 4905983845 More shellcheck checks and fixes.
Remove a libtool check while we're here.

Change-Id: I813add2031480f34ce89f268b541f8939016c2c7
Reviewed-on: https://code.wireshark.org/review/28066
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-06-07 18:11:12 +00:00
Gerald Combs 9031281672 CMake: Get rid of FULL_SO_VERSION
gd2e0724afc moved our library versions into their own variables named
FULL_SO_VERSION. They're no longer used and interfere with
tools/release-update-debian-soversions.sh so remove them.

Fix some shellcheck warnings in release-update-debian-soversions.sh
while we're here.

Bug: 14778
Change-Id: I0eb0bb4ab4c482bdb8a94f8c18aa04c6c83c781b
Reviewed-on: https://code.wireshark.org/review/28068
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-06-07 04:01:37 +00:00
Peter Wu c82883c1d6 cmake: fix DTD, Diameter and radius dependencies
Ensure that source files are copied whenever these change.

Change-Id: I77e1ebdac3567fe69f5236f4469355a7182ef159
Fixes: v2.5.0rc0-2471-g99b7776d5f ("CMake: Copy multiple data files at a time.")
Reviewed-on: https://code.wireshark.org/review/28057
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-06-06 13:56:40 +00:00
João Valverde 64a2b4101a Move make-taps and make-dissectors to tools/
make-taps and make dissectors are build tools so that is the natural
location for them.

See also 99ec2b58eb68ab8530245dd13485612695ba064a and bug 14622.

Change-Id: I754848ea1c614bfa7121c44d89136ac3cba8a734
Reviewed-on: https://code.wireshark.org/review/27928
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-05-31 13:35:27 +00:00
Martin Kaiser d8c19f8593 CMake: clarify that perl is mandatory
Perl is required for generating version.h. It is therefore a mandatory
requirement for building on both Windows and Unix.

Bug: 14764
Change-Id: I0bc86f5c463148b8070166b677d2ec349c461488
Reviewed-on: https://code.wireshark.org/review/27915
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-31 04:38:05 +00:00
Guy Harris 8f6c3ee8e1 Boost the maximum frame size.
Lemon gets this error on its Parse() function, at least on FreeBSD 11.1
with its version of Clang.

Change-Id: I4fc1674373af5c0016ee953b61066bf6b24b7ad6
Reviewed-on: https://code.wireshark.org/review/27905
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-29 23:58:41 +00:00
Dario Lombardo 25a95709a1 extcap: set EXTCAP_DIR in the root cmake file and propagate it.
The EXTCAP_DIR must be known in the root file to be set in config.h
and it's still needed in extcap/ to install the binaries, hence we
need caching it as well.

Bug: 14724

Change-Id: I58bac7de7a00e06c23fe8c8f1a7e3d299de6a560
Reviewed-on: https://code.wireshark.org/review/27776
Reviewed-by: Mikael Kanstrup <mikael.kanstrup@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-24 13:58:13 +00:00
Joakim Karlsson 790d490249 CMake: remove GIT_BIN_PARAM
Added in adb731c1cd but never worked,
and later corrected in e21da73826.
Correction however gave cygwin user problems with the perl optional parameter
which droped qoutes around the path. But since the orginal commit never worked
as intended in the beginning, it's assume safe to remove.

Change-Id: I825a4e53b257d47601c330b210ac5ffb6870e0d9
Reviewed-on: https://code.wireshark.org/review/27758
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-24 04:15:00 +00:00
João Valverde 03aae2267f CMake: Fix unset VERSION_RELEASE variable in wireshark.pc
Change-Id: I81358833f0527f55312aaab7a3dea68f9b128178
Reviewed-on: https://code.wireshark.org/review/27698
Reviewed-by: João Valverde <j@v6e.pt>
2018-05-22 05:56:10 +00:00
Gerald Combs 2ecf69f773 Test: Be more paranoid about our log output.
Run our CTest tests with PYTHONIOENCODING=UTF-8.

If someone runs our tests manually and their output encoding isn't
UTF-8, print replacement characters instead of failing with an error.

Open our log files with "errors='backslashreplace'" in case their
contents aren't UTF-8.

Change-Id: Ifa4d12c2b5e272cf3903f3e0c6102e4d961562f1
Reviewed-on: https://code.wireshark.org/review/27686
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-05-21 18:03:42 +00:00
Dario Lombardo 7655e0bad6 cmake: move extcap sections to extcap/CMakeLists.txt.
Change-Id: Ie7d9f6ad3d8b788e0d22e3ce15159fc46f5a93e8
Reviewed-on: https://code.wireshark.org/review/27638
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-19 06:20:47 +00:00
Gerald Combs 4a01a952ed Remove older Visual Studio suport.
Remove conditional checks for Visual Studio 2013 and earlier from
CMakeLists.txt.

Remove the VSVersion flag from win-setup.ps1. We haven't used it in
quite a while.

Change-Id: Iea80f8cd566f4909e1bac2d0a620488255c4d0a7
Reviewed-on: https://code.wireshark.org/review/27607
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-05-17 04:14:19 +00:00
Guy Harris d08d0a87c5 Eliminate some unneeded header checks.
sys/stat.h and sys/types.h date back to V7 UNIX, so they should be
present on all UN*Xes, and we're assuming they're available on Windows,
so, unless and until we ever support platforms that are neither UN*Xes
nor Windows, we don't need to check for them.

Remove the CMake checks for them, remove the HAVE_ values from
cmakeconfig.h.in, and remove all tests for the HAVE_ values.

Change-Id: I90bb2aab37958553673b03b52f4931d3b304b9d0
Reviewed-on: https://code.wireshark.org/review/27603
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-16 22:03:09 +00:00
Gerald Combs 1feea92ef3 CMake: Skip more header checks on Windows.
Prepopulate our header variables at the top of CMakeLists.txt. Add
HAVE_STDINT_H and HAVE_STDDEF_H.

Change-Id: I78cbe9d6dc3775caad5c565de0100863a9dc8054
Reviewed-on: https://code.wireshark.org/review/27587
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-05-16 18:41:21 +00:00
Guy Harris 322f163cbd Update a comment.
Change-Id: I0ea38f9d5c0e474cf669857d427310e56d1fb7a6
Reviewed-on: https://code.wireshark.org/review/27582
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-16 17:16:31 +00:00
Peter Wu 4c1690ac47 CMake: require at least CMake 3.5
CMake 3.11 with the Ninja generator started complaining about CMP0058
related to ui/qt/CMakeFiles/qtui_autogen.dir/RCCstock_iconsInfo.cmake
amd other files (AUTORCC). While the policy could be set explicitly,
let's try to modernize the CMake configuration:

- Drop CMP0042, if this gives issues with macOS, then it must be solved
  in a different way using non-deprecated methods.
- Drop CMP0054 and ensure that all if("${foo}") and if(${foo}) are
  converted to if(foo).
- Remove string comparison against "-NOTFOUND", it already evaluates to
  false in an if condition.
- Use CXX_STANDARD/CXX_STANDARD_REQUIRED for Qt 5.7 and newer.
- Assume that copy_if_different can accept multiple sources (CMake 3.5).
- Consistency: Out of the 60 CMake 3.11 FindXxx.cmake files that use
  find_library, 34 contain "XXX_LIBRAR" while 16 contain "Xxx_LIBRAR".
  Let's assume uppercase variables (now custom MaxMindDB include dirs
  are correctly used).

CMake 3.5 was chosen as the next version because of its wide support.
Ubuntu 14.04 ships with cmake3 3.5.1, Debian jessie-backports has 3.6.2,
EPEL for CentOS/RHEL6 includes cmake3 3.6.1 and SLES12 SP2 has 3.5.

Change-Id: I2fa7b94bf8cc78411f414987d17bab3a33dfb360
Reviewed-on: https://code.wireshark.org/review/27444
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-15 10:28:09 +00:00
Joakim Karlsson e21da73826 CMake: fix Git binary parameter
if (${GIT_EXECUTABLE}) never worked, hence the variable GIT_BIN_PARAM never had
any value, and by so never added the Optional git-bin parameter
to make-version.pl

Make-version.pl now handle optional git-bin argument with value.

Change-Id: I089539a3d33455b8de09928b54e0ea39d1aecbb8
Reviewed-on: https://code.wireshark.org/review/27485
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-05-15 09:06:43 +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
Reviewed-on: https://code.wireshark.org/review/27313
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-05-14 10:44:37 +00:00
Gerald Combs 17190a1ed2 List some removed features in the release notes.
Require Qt 5.2 in CMakeLists.txt. Remove some old Qt 4 checks.

Change-Id: I06814b3776b488d55a0ce1a26aaada43fb5e096c
Reviewed-on: https://code.wireshark.org/review/27446
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-05-11 16:11:14 +00:00
Gerald Combs f7e879c5cf CMake: Remove FindFreetype.
Remove the FindFreetype module. It was required by the FindGTK2 module,
but it's no longer used.

Change-Id: Id7575d024b5c13b5800989434a994e3a0dcb2b26
Reviewed-on: https://code.wireshark.org/review/27450
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-05-11 15:19:25 +00:00
Gerald Combs f72481a144 Test: Make sure we run our display filter tests.
Change the test suite list in CMakeLists.txt to a static list. Add a
CTest coverage unit test.

Change-Id: I8459f320a2d0707618d6d56abdfce80274fddd2d
Reviewed-on: https://code.wireshark.org/review/27377
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-05-06 23:56:41 +00:00
Guy Harris 8db1616ec3 Get rid of more autotoolsisms.
Change-Id: I124732adf3c3da511c206932544b4d533404cfc5
Reviewed-on: https://code.wireshark.org/review/27332
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-04 19:14:34 +00:00
Peter Wu e7cd78d4b3 CMake: check for /Qspectre before using it
The linked blog entry for /Qspectre suggests intention to include
/Qspectre support for VS 2015 Update 3, but this has not happened yet
(at least, not with VS Community 2015 14.0.23107.178).

Change-Id: I001c8fa512457f1edc753b460634f13d2ff0ed7a
Fixes: v2.5.1rc0-611-g0ebcd27377 ("Trust CMake's Visual C++ version detection.")
Reviewed-on: https://code.wireshark.org/review/27225
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-05-02 23:02:46 +00:00
AndersBroman 65c1283d77 rpm-package: Use version.h to generate version string in RPM
Packaging.

Change-Id: I463be4523f789406ff0cb3a1a325d6937db63b3d
Reviewed-on: https://code.wireshark.org/review/27179
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-02 10:44:44 +00:00
Gerald Combs 58da452d22 Test: Remove the Bash test scripts.
They've been replaced by the Python scripts.

Change-Id: I8add9c9ea0a6bdd68b2fa3841977863c0ea9a761
Reviewed-on: https://code.wireshark.org/review/27243
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-02 04:09:26 +00:00
Gerald Combs 9b3be1711f test: Miscellaneous fixups.
In util_slow_dhcp.py, open stdout as O_BINARY on Windows.

Have ctest pass --verbose to test.py.

Call config.canCapture at test time so that we don't inadvertently skip
some tests.

Stringify our dumpcap config check.

Fix our Gcrypt variable.

Change-Id: I884ec23ddfc7c28b79d4a860c6c43c308598e6db
Reviewed-on: https://code.wireshark.org/review/27182
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-04-27 17:15:19 +00:00
Gerald Combs 0ad4239249 Start porting our test scripts to Python. Add ctest support.
Create Python versions of our various test shell scripts. Add CMake
tests for each suite. Tests can now be run directly via test.py, via the
"test" target, or via ctest, e.g.

  ctest --verbose --jobs 3

Add a testing chapter to the Developer's Guide.

Add a way to disable ctest in dpkg-buildpackage.

Suites completed:
- capture
- clopts
- decryption
- dissection

Remaining suites:
- fileformats
- io
- mergecap
- nameres
- text2pcap
- unittests
- wslua

Change-Id: I8936e05edefc76a86b6a7a5da302e7461bbdda0f
Reviewed-on: https://code.wireshark.org/review/27134
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-04-26 19:27:19 +00:00
Guy Harris 27a6715242 Put references to autotools in the past tense.
In CMake files, we don't do some checks that our autotools scripts did;
speak of those in the past tense, as the autotools scripts are gone.
(Leave the comments there, to note that we *might* have to reinstate
those tests, although they're for old versions of macOS and GCC.)

In CMake files, we use some #defines because that's what autotools did;
speak of those in the past tense as well.

Change-Id: I594fe8225cf94b5087093febc11f6b0a7e42e7cd
Reviewed-on: https://code.wireshark.org/review/27149
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-25 16:54:34 +00:00
Jakub Zawadzki 4a488919e3 oss-fuzzshark: use install directory for headers. Install missing one.
From compilation log:
  epan/ipv4.h:19:10: fatal error: 'wsutil/inet_ipv4.h' file not found
  tools/oss-fuzzshark/fuzzshark.c:27:10: fatal error: 'version_info.h' file not found

Change-Id: I3e147e014ae398ae07e64aec5a6535a8f9e357a3
Reviewed-on: https://code.wireshark.org/review/27076
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-24 03:49:15 +00:00
Gerald Combs 631fec3e1b CMake: Doxygen and API reference target updates.
The DOXYGEN_* variables which we use to create doxygen.cfg are native
paths and are not compatible with Cygwin. We could try to make them
compatible, but given that we're trying to migrate away from Cygwin set
"DOXYGEN_EXECUTABLE" to "DOXYGEN_EXECUTABLE-NOTFOUND" if "cyg" is anywhere
in its path.

Add the wsar_html* targets to "Docs" and exclude them from Visual Studio's
default build.

Change-Id: Id23a3c43a9f4f1edb2d827bbf36a3a7eb64f0212
Reviewed-on: https://code.wireshark.org/review/27100
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-04-24 03:45:15 +00:00
Guy Harris 6eecb31030 Fix up handling of the Kerberos package.
On Ubuntu 16.04, and possibly other versions of Ubuntu, and on Debian
and other Debian derivatives, packages for MIT and Heimdal Kerberos can
both be installed at the same time - including developer packages.
Collisions between headers and libraries are handled by putting them in
subdirectories of the system include and library directory and having
their .pc files add -isystem flags to point to the appropriate include
directory and -L flags to point to the appropriate library directory.

CMake's pkg-config support, however, only looks for -I flags, not
-isystem flags, in pkg-config output (using --cflags-only-I), so it
doesn't get the directory in which to look for the headers, and just
uses the results of --libs-only-l to get a list of library names and
does nothing with the results of --libs-only-L, causing it not to look
for libraries in the directory in which to look for the libraries.

We fix this by:

If FindKERBEROS.cmake found Kerberos with pkg-config, have it set
KERBEROS_DEFINITIONS to the "other" compiler flags, which includes the
-isystem flag.

For all packages, adding the <PACKAGE>_DEFINITIONS values to
CMAKE_C_FLAGS and CMAKE_CXX_FLAGS so that they're used when compiling.

If FindKERBEROS.cmake found Kerberos with pkg-config, having it search
for each of the libraries in KERBEROS_LIBRARIES using find_library()
with KERBEROS_LIBDIR and KERBEROS_LIBRARY_DIRS as hints, and
re-assembling the resulting full paths into KERBEROS_LIBRARIES.

Change-Id: Ie18b56b76934f542bd12dc737631c0190026d18a
Reviewed-on: https://code.wireshark.org/review/27071
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-22 03:04:19 +00:00