Commit Graph

1224 Commits

Author SHA1 Message Date
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
Joerg Mayer 7853d0e354 Remove a few obsolete references to gtk from checkapi and faq.py
Change-Id: Ice9aec64fddbed94c7be96575c6e1bc800e8ac9e
Reviewed-on: https://code.wireshark.org/review/27067
Petri-Dish: Jörg Mayer <jmayer@loplof.de>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2018-04-21 23:34:40 +00:00
Guy Harris 37a35312b1 Get rid of unused variable.
Change-Id: I1b51872e5330722c514a553e571b2eeb56fbade7
Reviewed-on: https://code.wireshark.org/review/27063
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-20 21:43:10 +00:00
Peter Wu b887fd4919 CMake: fix build with json-glib with gold linker
JSON-GLIB depends on GObject. To avoid "undefined reference to
'g_object_unref'" with the gold linker, include gobject directly.
As the files are included with the GLib package, adjust FindGLIB2.cmake.

Change-Id: I007d30b89cc07d8746cee6b619832a722f086105
Fixes: v2.9.0rc0-201-g511c2e166a ("tshark: add -G elastic-mapping report.")
Reviewed-on: https://code.wireshark.org/review/27007
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-04-19 08:08:11 +00:00
Dario Lombardo 511c2e166a tshark: add -G elastic-mapping report.
This option generates an ElasticSearch mapping file as described here:
https://www.elastic.co/blog/analyzing-network-packets-with-wireshark-elasticsearch-and-kibana

It leverages the Glib-json library.

Change-Id: Iff25f991e87d3da07bf06654e353fb785799dde9
Reviewed-on: https://code.wireshark.org/review/26848
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2018-04-18 08:57:39 +00:00
Gerald Combs 2e63957031 CMake: API reference fixes.
Fixup a dependency and make sure we create the API reference from
scratch.

Change-Id: I832d1772eb8b4f07cab6f04d164cac10c70ab3bb
Reviewed-on: https://code.wireshark.org/review/26990
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-04-17 17:29:37 +00:00
Gerald Combs ad84eec866 Switch the Doxygen API reference build to CMake.
Switch to a single Doyxgen configuration which was generated using a
recent version of Doxygen and customized to suit our needs. Add
wsar_html and wsar_html_zip targets to CMake. Update some Doxygen markup
and documentation as needed.

Change-Id: Ic8a424b292c35a26f74ae0b53322265683e56e69
Reviewed-on: https://code.wireshark.org/review/26976
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-17 03:46:05 +00:00
Gerald Combs c8cf127375 Add a destination directory flag to git-export-release.
Add a destination directory flag to git-export-release.sh. Use it to
replace the current "dist" target. Use it in the RPM section to avoid a
symlink.

Change-Id: I30ae76b3ab1a995d232e748b79aa37440f90f854
Reviewed-on: https://code.wireshark.org/review/26974
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-17 03:43:38 +00:00
Peter Wu 3a30bc3bb5 RPM: enable rpm target even if git is not available
Change-Id: Ic6a7d656aeb0ae30c5e1cc1d8f12ed5ad43f73d7
Reviewed-on: https://code.wireshark.org/review/26968
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-16 15:29:43 +00:00
Dario Lombardo 71ddbb69f5 RPM: support building from out-of-tree directories.
When building the RPM from a directory at the same level as the
source (like in mdkir build;cmake ../wireshark;make rpm-package)
we can't rely on the retrieval of the git version. However the
wireshark export dir still have it and we can get it from there.

Change-Id: Id6bcb453ec3a65977fc092c610e99e8dd01f613a
Reviewed-on: https://code.wireshark.org/review/26957
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-16 08:53:30 +00:00
Roland Knall 9c5049a80b Gtk: Remove source code
Removing all gtk source code, except for main.? which will remain
for the official removal during SFUS18

Change-Id: I4273baf207df1eaaa4b94623cfd10bf74b1fc4a4
Reviewed-on: https://code.wireshark.org/review/26937
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-04-15 05:45:32 +00:00
Roland Knall d347091da9 Qt: Fix MacOSX menu entries
Remove various menu items added automatically on Mac OS X. The following
menu items have been removed:

- Edit / Start Dictation
- Edit / Emoji & Symbols
- View / Enter Fullscreen Mode
- View / Show Tab Bar - Hide Tab Bar

Bug: 13366
Change-Id: I44deae7ee8ea7a43926820e4f5d0517ece246939
Reviewed-on: https://code.wireshark.org/review/26823
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-04-09 15:44:22 +00:00
Gerald Combs 55f6f6593c CMake: More Qt4 removal.
Remove some Qt major version checks. Remove the ENABLE_QT5 option.

Change-Id: I891bc90956a2ea2cd5a7c50c56d9fcbfc963d6c2
Reviewed-on: https://code.wireshark.org/review/26785
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-04-09 01:35:28 +00:00
AndersBroman b30e3d4267 glib: Require 2.32 or newer.
Change-Id: Idaf90865d04532912a968fc2e05523aec14c4991
Reviewed-on: https://code.wireshark.org/review/26745
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-05 13:31:45 +00:00
AndersBroman 36dc5781ba GTK Cmake: Remove the option to build the GTK UI.
Change-Id: If702717b559a727388d83ce82c0fc2967c662ff0
Reviewed-on: https://code.wireshark.org/review/26747
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-05 13:31:22 +00:00
Anders 9e02a0b65b CMake RPM build: Try to get rid of %globals in favor of %bcond.
Change-Id: I051fb722b0c4161b373f04a79288faa41a61c3cc
Reviewed-on: https://code.wireshark.org/review/26735
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-04 17:02:02 +00:00
Gerald Combs 1dd1b507d1 CMake: Add a note about passing /external to Visual C++.
According to

https://blogs.msdn.microsoft.com/vcblog/2017/12/13/broken-warnings-theory/

/external: will let is ignore warnings in external headers.

Change-Id: Ib3000d7654ffab99a001b225ce6162aab88fc8fa
Reviewed-on: https://code.wireshark.org/review/26734
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-04-04 16:09:10 +00:00
Guy Harris 29973ebeb6 Pick up some compiler-specific flags from autotools.
Bug: 14554
Change-Id: Idf4585671ad2698bd51f65abadb1b1000ad56445
Reviewed-on: https://code.wireshark.org/review/26716
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-02 20:22:29 +00:00
Gerald Combs adb55d8ca4 2.5 → 2.9.
Change-Id: I9a6cd7a510f8ba5310a9cf8a2818903d4c03253f
Reviewed-on: https://code.wireshark.org/review/26712
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-04-02 19:30:15 +00:00
Guy Harris 35fed45a83 Don't bother with CMAKE_C_STANDARD.
It was introduced in CMake 3.1, so, unless we require CMake 3.1 or
later, we'd have to manually try to enable C99 support on pre-3.1
releases, so we might as well just do it manually all the time - it's
not clear that CMAKE_C_STANDARD does it much better, especially give
that, for example, it wasn't until CMake 3.9 that support for enabling
C99 support in IBM XL C was added.

Change-Id: I51038b90fd3d8ab5050c5da4441765b19db9091b
Reviewed-on: https://code.wireshark.org/review/26648
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-03-29 06:16:19 +00:00
Gerald Combs 1cd92c4961 CMake: Add an rpm-package target.
Copy the current wireshark.spec.in and update it for use with CMake.
Remove the Qt4, GTK+2, and GTK+3 options. Add Ninja and mmdbresolve
options.

The rpm-package target builds a tarball using git-export-release.sh and
therefore must be run from a git checkout. The RPM _prefix macro is set
to CMAKE_INSTALL_PREFIX, so you'll probably want to run

cmake -DCMAKE_INSTALL_PREFIX=/usr ...

Change-Id: Ib014494d8858a0059126404cd91528ded5d8a9f6
Reviewed-on: https://code.wireshark.org/review/26579
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-26 14:00:35 +00:00
Pascal Quantin ea59e4c75a Bump micro version to 2
Change-Id: I384db83e3c471cbb371e7af4d488dd03d7761125
Reviewed-on: https://code.wireshark.org/review/26497
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-03-16 13:07:42 +00:00
Gerald Combs 0ebcd27377 Trust CMake's Visual C++ version detection.
We can be reasonably certain that CMake sets CMAKE_C_COMPILER_ID,
MSVC12 and MSVC14 correctly. If we add a compiler flag based on those
variables don't bother passing it through check_c_compiler_flag or
check_cxx_compiler_flag. This speeds up CMake here quite a bit.

Change-Id: I3a681a8a9287b33353030fd37303aa32f04b79a9
Reviewed-on: https://code.wireshark.org/review/26475
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-03-14 21:49:52 +00:00
Gerald Combs 246f0bc012 Get rid of TestBigEndian and AC_C_BIGENDIAN.
Get rid of CMake's TestBigEndian and Autotools' AC_C_BIGENDIAN checks in
favor of G_BYTE_ORDER. We use G_BYTE_ORDER elsewhere and TestBigEndian
is noticeably slow on Windows.

Change-Id: Idc1326294db9cbee8f6b6b11c2028fc4d19acbf0
Reviewed-on: https://code.wireshark.org/review/26462
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-13 19:09:36 +00:00
Pascal Quantin 4e6d989df4 Add MaxMindDB 1.3.2 library to Windows
Change-Id: I328b6a05cc356be59ac63e80eae55a832bf76a47
Reviewed-on: https://code.wireshark.org/review/26347
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-03-09 11:20:41 +00:00
Gerald Combs 957845f5a4 CMake: Don't bother compiling zlibstatic.
We don't use zlibstatic so exclude it from ALL_BUILD and Wireshrk.sln.

Change-Id: I9656b6f1c35e43cce89c8879f4521f6dc4a5cbdf
Reviewed-on: https://code.wireshark.org/review/26349
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-08 02:20:58 +00:00
Gerald Combs 39a65995cc CMake: Exclude test targets from the default build.
For the Visual Studio generator, setting the EXCLUDE_FROM_ALL property on
a target excludes it from ALL_BUILD.vcxproj, but we additionally need
to set EXCLUDE_FROM_DEFAULT_BUILD to exclude it from Wireshark.sln.
Do so for the test targets.

Change-Id: Icd328f75d4927e5b7bb65b1833da4724f63476b6
Reviewed-on: https://code.wireshark.org/review/26345
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-07 23:27:06 +00:00
Dario Lombardo fe71e26af2 spdx: more licenses converted.
Change-Id: I3861061ec261e63b23621799e020e811ed78a343
Reviewed-on: https://code.wireshark.org/review/26333
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-07 15:56:44 +00:00
Gerald Combs 2eb6f3b5de CMake: Remove SH from the packate list.
Change-Id: Idafd85df598e0c58fc8252574ce0478b3e1464a9
Reviewed-on: https://code.wireshark.org/review/26278
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-06 18:19:57 +00:00
Gerald Combs a1da75c554 Transition from GeoIP Legacy to MaxMindDB.
MaxMind is discontinuing its legacy databases in April in favor of
GeoIP2, which use a newer database format (MaxMind DB). The reference C
library (libmaxminddb) is available under the Apache 2.0 license which
isn't quite compatible with ours.

Add mmdbresolve, a utility that reads IPv4 and IPv6 addresses on stdin
and prints resolved information on stdout. Place it under a liberal
license (MIT) so that we can keep libmaxminddb at arm's length. Add
epan/maxmind_db.[ch], which spawns mmdbresolve and communicates with it
via stdio.

Migrate the preferences and documentation to MaxMindDB.

Change the IPv4 and IPv6 asnum fields to FT_UINT32s. Change the
geographic coordinate fields to FT_DOUBLEs.

Bug: 10658
Change-Id: I24aeed637bea1b41d173270bda413af230f4425f
Reviewed-on: https://code.wireshark.org/review/26214
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-06 18:02:21 +00:00
Graham Bloice 5b079291c4 Windows: Remove support for MSVC older than VS2015
Cleanup the support for older versions of Visual Studio

Change-Id: Ieb97d56e9bff6a5902433e8d99b27276bc7034f7
Reviewed-on: https://code.wireshark.org/review/26247
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-04 08:58:07 +00:00
Gerald Combs f529ab5d0a Remove the endpoint "Map" feature.
Remove the endpoint map and its button from the Qt and GTK+ UIs. It
depends on GeoIP Legacy for coordinate information and those databases
are being deprecated in favor of MaxMind DB. We *could* upgrade the code
to use mmdbresolve, but according to
https://dev.maxmind.com/geoip/geoip2/geolite2/ they're also going to
remove coordinate information from GeoLite2:

"In addition, in 2019, latitude and longitude coordinates in the
 GeoLite2 databases will be removed.* Latitude and longitude coordinates
 will continue to be provided in GeoIP2 databases. Please check back for
 updates."

Change-Id: I43e1593d282a0f1aae897b1f4724117d1496b21e
Reviewed-on: https://code.wireshark.org/review/26229
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-02 21:59:21 +00:00
Gerald Combs 1a0987904f Generalize our process spawning code.
Move the contents of extcap_spawn to ws_pipe. Rename various extcap_*
prefixes to ws_pipe_*. Open stdin when we spawn processes.

Change-Id: I9286295443ee955bb6328b0ed6f945ee0bb2a798
Reviewed-on: https://code.wireshark.org/review/26216
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-03-02 05:22:20 +00:00
Jaap Keuter 0fb38879af L16_mono: Add L16 monaural codec plugin as functional example
This codec plugin serves a dual purpose.
First it is to add L16 codec suppport to Wireshark.
Second it is an illustration of a basic codec plugin module.

Change-Id: I64394dab3257ae49dece0257b16cd969503918e2
Reviewed-on: https://code.wireshark.org/review/26131
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-28 12:04:29 +00:00
Gerald Combs 32e99b355d CMake: Add more .PDBs to pdb_zip_package.
Add .PDBs under the extcap and plugin directories to the
Wireshark-pdb-xxx.zip package.

Change-Id: Icc003a212f21c02bcf8ccf326b43cfebbf32a9a3
Reviewed-on: https://code.wireshark.org/review/26146
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-02-27 22:06:54 +00:00
Guy Harris b3bc6dcc02 I don't see a need to treat ipmap.html specially.
It's in the INSTALL_FILES list, and all of those end up being dropped
into the run directory, so there's no need to copy it individually; all
the data files, as enumerated in INSTALL_FILES, are expected to be in
the same directory, whatever it is, and that's what happens to those
files.

Change-Id: I58df330c7d6886c87d91c0e0df73000c028fc312
Reviewed-on: https://code.wireshark.org/review/26088
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-25 00:17:56 +00:00
Guy Harris e3db7c581c I don't think ipmap.html belongs in the same directory as the binaries.
Change-Id: I1a15ec77786f6a141e78c62885343f8cc51c73bf
Reviewed-on: https://code.wireshark.org/review/26059
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-23 19:20:32 +00:00
Guy Harris f4cd45f6fe Treat the text2pcap scanner as clean.
We now disable some warnings on Flex-generated code.

Change-Id: I8ff242dc17e7345e9d5883354e921642cb0118fd
Reviewed-on: https://code.wireshark.org/review/25823
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-16 23:26:01 +00:00
Guy Harris feb8f6b14d Make the DOCSIS dissector a built-in dissector.
Stuff that calls it is built in, and stuff it calls is built in, so
there's not much point in having it be a plugin; we already have
examples of plugin dissectors.

Change-Id: I512e0fda62faedb5f03f476fbece2e267e1d644f
Reviewed-on: https://code.wireshark.org/review/25775
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-13 20:15:19 +00:00
Gerald Combs 9cc4a3b967 CMake: Install the HTML guides.
Add a "FileInstall.cmake" module that installs files and directories.
Use it to install the chunked HTML guides.

Install the guides into CMAKE_INSTALL_FULL_DOCDIR. By default this is
/usr/local/share/doc/Wireshark. Define DOC_DIR to match.

Add explicit file and directory permissions to the default install
targets.

Remove the PDF install target.

Bug: 14258
Change-Id: I4712a4047a54627b7520b5bf5f191e0761d19606
Reviewed-on: https://code.wireshark.org/review/25737
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-02-13 06:18:34 +00:00
Gerald Combs 94a0f7c641 Switch from AsciiDoc to Asciidoctor.
Switch the markup text processor for files in the docbook directory from
AsciiDoc to Asciidoctor. Asciidoctor has several useful features (such
as direct PDF output) and is actively developed. It's written in Ruby
but that dependency can be sidestepped with AsciidoctorJ, a
self-contained bundle that only depends on the JRE.

The current toolchain targets require Python, AsciiDoc, DocBook XML,
DocBook XSL, Java, FOP, xsltproc, lynx, and the HTMLHelp compiler:

HTML: AsciiDoc → DocBook XML → xsltproc + DocBook XSL
Chunked HTML: AsciiDoc → DocBook XML → xsltproc + DocBook XSL
PDF: AsciiDoc → DocBook XML → xsltproc + DocBook XSL → FOP
HTMLHelp: AsciiDoc → DocBook XML → xsltproc + DocBook XSL → HHC

This change removes the AsciiDoc and FOP requirements and adds either
AsciidoctorJ or Asciidoctor + Ruby:

HTML: Asciidoctor → DocBook XML → xsltproc + DocBook XSL
Chunked HTML: Asciidoctor → DocBook XML → xsltproc + DocBook XSL
PDF: Asciidoctor
HTMLHelp: Asciidoctor → DocBook XML → xsltproc + DocBook XSL → HHC

Ideally we could generate all of these using AsciidoctorJ, Java, and
lynx. Unfortunately we're not there yet.

The release notes depend on several macros (ws-buglink, ws-salink,
cve-idlink, sort-and-group). Add Asciidoctor (Ruby) equivalents.

Remove the BUILD_xxx_GUIDES CMake options and add various output targets
automatically. This means that you have to build the various documentation
targets explicitly.

Change-Id: I31930677a656b99b1c6839bb6c33a13db951eb9a
Reviewed-on: https://code.wireshark.org/review/25668
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-02-11 18:22:09 +00:00
Gerald Combs 78b7da7716 CMake: Don't shadow PROCESSOR_ARCHITECTURE.
PROCESSOR_ARCHITECTURE is a standard Windows environment variable.
Rename the CMake variable WIRESHARK_TARGET_PROCESSOR_ARCHITECTURE.

Change-Id: I03109d45d6fb5f00742cd43085a9d33d9e5ddf1f
Reviewed-on: https://code.wireshark.org/review/25721
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-10 07:39:42 +00:00
Guy Harris 40a533abe1 Move summary.[ch] to libui.
Change-Id: I49f1eeb4fc3a90e436da116577a7d0c5ba982eee
Reviewed-on: https://code.wireshark.org/review/25657
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-07 08:29:52 +00:00
Gerald Combs c061522765 2.5.0 → 2.5.1.
Change-Id: I185a3f359acfe5dfd06c0b7f5fff3b6586be1ff9
Reviewed-on: https://code.wireshark.org/review/25647
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-02-06 23:55:46 +00:00
João Valverde ad76b31c3f Don't install test programs (fuzzshark and dftest)
These binaries are not intended for end-users.

Change-Id: I1e1ecd7424bbbe1b2935390e2daf7e3f1089ee28
Reviewed-on: https://code.wireshark.org/review/25594
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-02-04 16:02:51 +00:00
Gerald Combs 6adc7550a8 Note that /guard:cf requires CMake 3.9 or newer.
Change-Id: I775daafdba012deb2eac5cf8d895be55243d9440
Reviewed-on: https://code.wireshark.org/review/25554
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-02-02 00:14:14 +00:00
Jaap Keuter 27ae22bd25 usbdump: Add usbdump wiretap plugin as functional example
This wiretap plugin serves a dual purpose. One is to add usbdump file
reading capability to wiretap and therefore Wireshark and Tshark.
Second it is an illustration of a basic wiretap plugin module.

Change-Id: Iefbb156ea1bc5d90dabc1753942cdb9e393714ad
Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-on: https://code.wireshark.org/review/25487
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-30 05:44:38 +00:00
Peter Wu 9be01dc616 Qt 4.8 compatibility fixes
Add missing include headers, define Q_NULLPTR for all Qt objects (to
avoid having to include an ugly compat header), use old signal/slot
syntax (Q_SIGNALS are protected in Qt 4.8), disable Qt 5 log message
handler, etc.

Change-Id: I449beb0b74050fdfb0fc5828d8fb74eedb2b45bf
Reviewed-on: https://code.wireshark.org/review/25469
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-01-25 17:17:13 +00:00
Gerald Combs 50b4ff6db8 CMake: Create directories one at a time.
Older versions of CMake don't support passing multiple arguments to `-E
make_directory`.

Change-Id: I62f76753a0ec1a96849de3a1131869f08303dbfc
Reviewed-on: https://code.wireshark.org/review/25458
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-01-24 21:05:44 +00:00
Gerald Combs 7e37a7db55 CMake: Compile and link flag updates.
Add /guard:cf and /Qspectre to the Visual C++ 2015 compile and link flags.

Don't bother trying to pass -Wl,--as-needed or -pie to Visual C++.

Remove some unneeded quotes.

Change-Id: I4d89d61ce9dd579e7cfbcd49df6116810bfb0178
Reviewed-on: https://code.wireshark.org/review/25356
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-01-24 11:43:56 +00:00
Gerald Combs 99b7776d5f CMake: Copy multiple data files at a time.
Copy the DTD, DIAMETER, RADIUS, and profile files all at once instead of
individually.

Change-Id: I7c75c4a784956b998a82fd627dd17843820096ff
Reviewed-on: https://code.wireshark.org/review/25439
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-01-24 05:08:27 +00:00
Gerald Combs 064bec8797 CMake: File copy updates.
Switch from `xcopy`-ing single files to `cmake -E copy_if_different`-ing
multiple files on Windows. Add a comment about using copy_if_different
for our data files.

Switch from `cmake -E copy` to `cmake -E copy_if_different` in a couple
of other places.

Change-Id: I6bf72f02a66c46a4440280305479f41ffb4e987a
Reviewed-on: https://code.wireshark.org/review/25402
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-01-21 13:14:52 +00:00
Jaap Keuter 2f759ce7a7 Update paths after dissector plugin move.
With the change in paths of the dissector plugins in the repository some
other paths require adjustment. These are the obvious changes remaining.

Change-Id: Id49ac6aaf1a29d9eb37f4c32226a4597d5e32edd
Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-on: https://code.wireshark.org/review/25343
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-01-16 19:02:28 +00:00
João Valverde 5352ef42f9 plugins: Add source tree subfolder for plugin library
This allows some simplification and makes things more consistent,
particularly for loading plugins from the build dir.

Also fixes the issue reported here:

https://www.wireshark.org/lists/wireshark-dev/201801/msg00061.html

Change-Id: I0d8a000ee679172bccad546a3b0c47a79486f44d
Reviewed-on: https://code.wireshark.org/review/25329
Petri-Dish: João Valverde <j@v6e.pt>
Reviewed-by: João Valverde <j@v6e.pt>
2018-01-16 08:51:37 +00:00
Gerald Combs 777932efc6 make-dissectors depends on copy_cli_dlls.
Have the make-dissectors CMake target explicitly depend on copy_cli_dlls,
otherwise we might try to create dissectors.c before libglib-2.0-0.dll
has been copied into place. It looks like this is what's been causing
our random Windows PD failures.

Change-Id: Ia2445f17abd2c73113ab269ba6c606f48e724d93
Reviewed-on: https://code.wireshark.org/review/25292
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-01-13 00:47:48 +00:00
Dario Lombardo e80b40adbe extcap: remove conditional compilation.
Change-Id: Ia54bba388755cf27a343fe6d69d244bf1ab897f9
Reviewed-on: https://code.wireshark.org/review/25186
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-08 05:50:15 +00:00
Peter Wu f8b67cb931 Rename dissectors.c.in and fix CMake on removals
"dissectors.c.in" is an input file for "make-dissectors" which outputs
"dissectors.c", but does not contain C code. Rename it to
"dissectors.in.txt" instead.

When a dissector is removed from the list, the dissectors.c file was not
properly generated even if CMake was re-run. Fix this by adding an
additional dependency on the input file. autotools likely suffers from
the same problem with removed files, I have not tried to fix that.

Restore's João's original approach using file(GENERATE) to avoid using
configure_file, this requires CMake 2.8.12.

Change-Id: Id07cd8ef502186a90d41b3bb77ed0d9c94845af9
Fixes: v2.5.0rc0-1763-gfe0c2b0485 ("Rewrite make-dissector-reg.py in C")
Reviewed-on: https://code.wireshark.org/review/24659
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>
2017-12-24 13:30:06 +00:00
Stig Bjørlykke 91f63908df cmake: Remove -Wcomma for C++ when using Qt >= 5.10
The Qt team introduced a lot of "Possible misuse of comma operator here"
warnings in qstring.h and qstringview.h in version 5.10.  Now we need to
fix the Qt source again.

Change-Id: I948ba5a224d4dca1ebb6a758100c064d501c1d4a
Reviewed-on: https://code.wireshark.org/review/24779
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-12-12 14:39:44 +00:00
João Valverde 5fc43fe63a Rewrite make-tap-reg.py in C
Change-Id: Ief5b1fffecc9712c01ff10292c403b7c84a5908a
Reviewed-on: https://code.wireshark.org/review/24756
Reviewed-by: João Valverde <j@v6e.pt>
2017-12-11 02:52:28 +00:00
Guy Harris 797d2f6a87 Move the frame_set stuff back into the capture_file structure.
libwireshark now expects an epan_t to be created with a pointer to a
"packet provider" structure; that structure is opaque within
libwireshark, and a pointer to it is passed to the callbacks that
provide interface names, interface, descriptions, user comments, and
packet time stamps, and that set user comments.  The code that calls
epan_new() is expected to provide those callbacks, and to define the
structure, which can be used by the providers.  If none of the callbacks
need that extra information, the "packet provider" structure can be
null.

Have a "file" packet provider for all the programs that provide packets
from a file.

Change-Id: I4b5709a3dd7b098ebd7d2a7d95bcdd7b5903c1a0
Reviewed-on: https://code.wireshark.org/review/24731
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-08 03:32:25 +00:00
Jakub Zawadzki 038aa2a616 Add fuzzshark to cmake/autotools.
Add fuzzshark target to make sure that oss-fuzzshark always build.

Change-Id: I802b679c18023daa1475a54bae722b5e90c72a59
Reviewed-on: https://code.wireshark.org/review/24716
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-12-07 23:26:52 +00:00
Peter Wu 3c6cb2f856 cmake: match include directories with autotools
Match closer the behavior of autotools which does not include epan in
its include paths by default.

Change-Id: I885bc7942490a5674c6ac75f9a8ea221555e3784
Reviewed-on: https://code.wireshark.org/review/24639
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-29 06:58:22 +00:00
João Valverde 7540ac6938 Move the protocol registration routines back into libwireshark
Follow-up to b695b3e2f7.

Change-Id: I7e36519f2c3806c1205d05437671325080974257
Reviewed-on: https://code.wireshark.org/review/24524
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2017-11-21 20:21:50 +00:00
Gerald Combs 0b2ecccd86 Add ThreadSanitizer configure-time options.
Add ENABLE_TSAN and enable-tsan options to CMake and Autotools
respectively which enable ThreadSanitizer, similar to AddressSanitizer
and UndefinedBehaviorSanitizer.

Change-Id: I79adf5c1516b0938f140bbf501c181bf14d7619b
Reviewed-on: https://code.wireshark.org/review/24515
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-11-21 16:55:18 +00:00
João Valverde 5968fc1cae Rename UseMakeDissectorReg.cmake
Change-Id: I2723e7f0309dbe21f23b65818fbea3a7eadf13d4
Reviewed-on: https://code.wireshark.org/review/24514
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2017-11-20 21:31:38 +00:00
João Valverde 262a84c384 Fix (and chop) static build option
This sets the scope of the static build option to Wireshark support
libraries only.

Before the patch:

Static plugins don't work with CMake and autotools.

autotools static build is broken, and most likely will always be, as
building Wireshark all-static is difficult and time-consuming.

After the patch:

For CMake Wireshark will be built with static or shared libraries and
dynamic plugins. Everything just works. CMake apparently doesn't want
you building static and shared libraries at the same time.

For autotools Wireshark will be built with shared libraries by default.
--disable-shared and --enable-static options work as usual. Dlopened
plugins are not built if --disable-shared is given to configure (to
disable shared libraries). This is a limitations imposed by libtool.

Tested on Linux. This removes broken support for building plugins
statically.

Change-Id: Ib8e8176976f136eea93a2ce8f9857b6cf9bec64c
Reviewed-on: https://code.wireshark.org/review/24241
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2017-11-19 20:16:50 +00:00
Graham Bloice bab9abfb7d CMake: Clean up Windows build
Remove options that aren't supported on Windows
Don't use pkgconfig on Windows

Change-Id: I79718a1c43f56a9ec88f690490931b80b727dd68
Reviewed-on: https://code.wireshark.org/review/24481
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-11-18 20:58:31 +00:00
João Valverde b695b3e2f7 Begin cleanup of make-dissector-reg.py
Move registration code to a new register.c file so it is readable.
Dissector load points are stored in a generated function pointer
array instead.

Simplify python script somewhat by not interleaving the plugin and
dissector logic.

Change-Id: I5ec21270f4e1550a5c911efa7f0dc4fc7fcb13a5
Reviewed-on: https://code.wireshark.org/review/24474
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-11-18 14:43:10 +00:00
Graham Bloice c43c58c434 CMake: Make Qt5 packages required if building Qt version
This stops folks failing when they don't have Qt
but are still attempting to build the Qt version.

Change-Id: I31eb9433b25ca9a717cd10bc165f3820ae31687e
Reviewed-on: https://code.wireshark.org/review/24406
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2017-11-14 16:46:07 +00:00
Guy Harris e38c89d3a7 Link with ZLIB_LIBRARIES if you link with wiretap.
Wiretap may use zlib; if it does, ZLIB_LIBRARIES is set to refer to
zlib.  On UN*X, you may be able to get away with linking a
dynamically-linked shared library with other dynamically-linked shared
libraries and not linking programs linked *with* that shared library
with those other shared libraries, but that may not work on Windows.

We link most programs that use wiretap with ZLIB_LIBRARIES; do so with
androiddump and randpktdump as well.

Bug: 14207
Change-Id: I8e94197e06f5fd0ff8c95aa509dbcc2ff2a44cd4
Reviewed-on: https://code.wireshark.org/review/24389
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-11-12 18:56:33 +00:00
João Valverde 62f705e844 autotools: Try to be clearer about --with-ssl and remove cruft
Change-Id: Iaf8c8a83ead1d6671bb9cadb6add56481ed98aaa
Reviewed-on: https://code.wireshark.org/review/24242
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2017-11-05 10:39:38 +00:00
Guy Harris a0973d0f94 Move the compiler version tests to ws_compiler_tests.h and use them elsewhere.
While we're at it, sort some header file lists, and clean up white
space.

Change-Id: If737dda45334fedf1df7295d8719ad9381daf7a1
Reviewed-on: https://code.wireshark.org/review/24089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-10-26 22:01:16 +00:00
Gerald Combs 0d9b8eaf08 Warn the developer if we're building with GTK+.
Move The Slowest Migration In The History Of Ever a little further
along.

Change-Id: Ib8b49708e7036dd412a7ffc8660ded9f681374c0
Reviewed-on: https://code.wireshark.org/review/24006
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>
2017-10-21 08:23:45 +00:00
Peter Wu f19a2c0b8c CMake: increase minimum required version to 2.8.11
Due to the use of target_include_directories (when sshdump or ciscodump
are enabled), the minimum required version is 2.8.11. The supported OS
versions do not change, but Debian Wheezy users must enable backports.

Change-Id: I883c81e5e81425ca1869f442686faf1e66a638f3
Reviewed-on: https://code.wireshark.org/review/23955
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-17 03:56:21 +00:00
Peter Wu a3ba3ba943 CMake: fix Qt build with CMake 2.8.12 and before
The Qt5Widgets_EXECUTABLE_COMPILE_FLAGS option is only needed for CMake
before 2.8.12 and before as documented by Qt, so this ugly piece can be
restricted to older CMake versions. That also helps avoiding exposing
the Qt 5.5.0 in Windows since that requires a much newer CMake version.

For those older versions, use COMPILE_FLAGS such that -fPIC is added
after -fPIE (the latter is enabled by CMAKE_POSITION_INDEPENDENT_CODE).

Tested with CMake 2.8.11, 2.8.12.2, 3.0.2 and 3.9.4 using Qt 5.9.2 and
GCC 7.2.0.

Change-Id: I4962f7f5a087ee5b8c79905dd3b2cce17c731bdf
Fixes: v2.1.0rc0-566-gd66d379ac8 ("Try retroactively applying the Qt folks' fix for QTBUG-47942.")
Reviewed-on: https://code.wireshark.org/review/23954
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-17 03:37:25 +00:00
Peter Wu d3f636ece0 cmake: fix CMP0026 deprecation warning in CMake 3.9
Since CMake 3.9, all policies before CMP0036 emit a warning. Fix the
warning by not relying on the old behavior (existence of the LOCATION
property).

Tested with Ninja, the cmake output, rules.ninja and build.ninja output
is identical (minus the deprecation warning).

Change-Id: I058699380b01a9c02d9b98fd485ce6ded427abe3
Reviewed-on: https://code.wireshark.org/review/23915
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-16 04:31:57 +00:00
Peter Wu 2cb717ec78 cmake: remove and reorder unused cmake policies
Current minimum CMake version has everything up to CMP0017 enabled by
default, remove older policies. CMP0011 had not effect, our
link_directories are already absolute paths.

Change-Id: I3af08ca75700de4a860fb4afd664824031e2c5f5
Reviewed-on: https://code.wireshark.org/review/23914
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-16 04:24:34 +00:00
João Valverde 9bba3866ff CMake: Allow user build flags to override default build flags
Autotools has the very useful feature by design of allowing the user
to override the default build flags (you break it you keep it).

Apparently CMake applies COMPILE_OPTIONS target property after
CMAKE_{C,CXX}_FLAGS so that doesn't work here. Prepend our flags to those
variables instead to make it work then.

Specific target flag overrides can still be added with COMPILER_OPTIONS
(e.g: generated files with -Wno-warning) but this is less effective and
then we're back at the point where this overrides user flags. It's less
of a concern though.

Change-Id: I44761a79be4289238e02d4e781fef0099628817b
Reviewed-on: https://code.wireshark.org/review/23675
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-10-13 21:32:18 +00:00
Gerald Combs 6172627534 Make osx-app.sh a configured file and remove Autotools targets.
Rename osx-app.sh to osx-app.sh.in and add the version to the plugin
path at configure time.

Instead up updating Autotools accordingly just remove the macOS
packaging targets. gf61c381b5a removed support for Autotools in
osx-app.sh and if anyone wants to build macOS packages I'd prefer that
they use the same toolchain as the buildbot.

Change-Id: Ide5205265bf8859a85b1afab68fa8f8285952bd3
Reviewed-on: https://code.wireshark.org/review/23839
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-06 04:33:55 +00:00
João Valverde 2777003e12 Add version check for plugin compatibility
Only plugins built for the same feature release (X.Y) are assured binary
compatibility. Make sure we don't try to run unsuitable code and, if so,
warn the user. This might happen for example if the user manually copies
a binary plugin to the wrong folder, intentionally or by accident.

I'm using "release version" to loosely mean not a patch release
(i.e: a feature release).

Change-Id: I896e9cbbd2d3843623fff6af8ef51002ec06f1f8
Reviewed-on: https://code.wireshark.org/review/23807
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-10-03 10:09:24 +00:00
João Valverde b7107bdf9d CMake: Fix extcap plugin directory
Fixes a338f87f33.

Change-Id: Ib1d36a43828bd5896b327e49693485288a536342
Reviewed-on: https://code.wireshark.org/review/23805
Reviewed-by: João Valverde <j@v6e.pt>
2017-10-01 21:13:28 +00:00
João Valverde 6e24d5f690 Unsplit "m2m" plugin (wimax mac-to-mac encapsulation)
... not to be confused with "machine-to-machine".

M2M seems to be a simple Wimax encapsulation protocol developed by Intel.
It's not documented publicly anywhere that I can find. The boilerplate to
code ratio is huge and it even includes a complete source file from the Wimax
dissector (yuck). Put it in the Wimax plugin instead.

Minor version number bump for wimax plugin.

Change-Id: I2694339dfe89be334093b257a5b34d1577f4dc20
Reviewed-on: https://code.wireshark.org/review/23790
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-01 16:05:05 +00:00
João Valverde f0e12f0fd3 Remove TPG plugin and dependencies
It doesn't build with autotools and CMake.

Under-documented and unmaintained. Seems to be a work-in-progress
that stalled.

Introduces spurious CMake dependency on yapp.

Change-Id: I0dca1ccbdfd683586c05765437d4b7804ab5cc70
Reviewed-on: https://code.wireshark.org/review/23758
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-28 12:26:01 +00:00
João Valverde a269ae1b6a Rename "ws_version_info.h", also .c
It's not installed so like most other files it doesn't need or benefit
from the prefix.

Change-Id: I01517e06f12b3101fee21b68cba3bc6842bbef5c
Reviewed-on: https://code.wireshark.org/review/23751
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-26 17:32:08 +00:00
João Valverde 69bfcbc67e CMake: Print build flags just before feature summary
Change-Id: I79cc1df1eb04c5ed9bed722f07fdea7db2adcede
Reviewed-on: https://code.wireshark.org/review/23674
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-24 12:27:28 +00:00
João Valverde cf4abe1376 CMake: Pretty print PACKAGELIST
Change-Id: Ib87e0d4111f466e660435acf871036c0f1bb1555
Reviewed-on: https://code.wireshark.org/review/23673
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-24 11:40:17 +00:00
João Valverde fd4dc6f115 plugins: Fixups for g9260461f4f
Put plugins in CMake build dir with a version subdir. This avoids some
weird special cases, however running with autotools from build dir
displays the wrong global folder in about->folders. Unfortunately
the hack to run from the autotools build dir is troublesome.

Various fixes for Windows builds.

Try to fix also build dir issue loading plugins on macOS with
ENABLE_APPLICATION_BUNDLE (blind).

Change-Id: Ic3c7c21f5850c12a53844202d61fa0592b45739c
Reviewed-on: https://code.wireshark.org/review/23657
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-23 17:49:08 +00:00
Gerald Combs 3c8750dfb3 Revert "CMake: Print a warning if CCACHE_CPP2 is unset."
CCACHE_CPP2 / run_second_cpp is enabled by default in ccache 3.3 and later. (Unfortunately our builders have 3.2.4 installed.)

This reverts commit ed1ecfb39c.

Change-Id: I3cc88fa70bb04db5ae254bc9b878ce379e47527d
Reviewed-on: https://code.wireshark.org/review/23658
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-09-22 22:08:41 +00:00
Gerald Combs ed1ecfb39c CMake: Print a warning if CCACHE_CPP2 is unset.
If we're compiling with clang and ccache, print a warning if CCACHE_CPP2
is unset. Doing so avoids generating a bunch of unwanted output when
warnings are enabled.

Change-Id: I6a796e8b910074ffa028ea45bc639b9461e1629e
Reviewed-on: https://code.wireshark.org/review/23646
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-22 04:50:31 +00:00
Michael Mann 5f667694d3 Add Flow Graph functionality to TShark
Add flow graph functionality to tshark through -z option.
Output is same as ASCII format saved from GUI.

Change-Id: Iee0bfea7215858e6488b4728581be28287e9ea1a
Reviewed-on: https://code.wireshark.org/review/23652
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-22 04:49:48 +00:00
Peter Wu ed15895221 cmake: look for Qt5 from Homebrew on macOS
When Qt5 is installed using Homebrew on macOS, Qt5 is not available in
the default prefix. Remove the hack from macos-setup-brew.sh and adjust
the search path instead. Note that is needed for development, "brew
install" has already set this option in the environment.

See https://github.com/Homebrew/homebrew-core/issues/8392

Change-Id: I57ea09b649a94c9a4cb18b1b2d334808e47ec27e
Reviewed-on: https://code.wireshark.org/review/23232
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-09-21 00:49:01 +00:00
Martin Kaiser ded1d1089a CMake: fix extcaps dependency list
When compiling the list of dependencies for the extcaps target, add only
those targets that we're actually building. If we skip an extcap, e.g.
because we're missing libraries to build it, don't add this extcap to
the dependency list.

This issue was observed on a Debian box that had no libssh-gcrypt-dev
package installed. Running cmake would create a warning about
non-existent dependencies of the extcaps target.

-- Configuring done
CMake Warning (dev) at CMakeLists.txt:3217 (add_dependencies):
  Policy CMP0046 is not set: Error on non-existent dependency in
  add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  The dependency target "ciscodump" of target "extcaps" does not exist.
This warning is for project developers.  Use -Wno-dev to suppress it.

Change-Id: I7335173fce9833423b0e9443589143cc1a122ac0
Reviewed-on: https://code.wireshark.org/review/23321
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-09-20 08:39:54 +00:00
Stig Bjørlykke 17651065a5 cmake: Add option to disable -Wframe-larger-than
In some editors (like Xcode) it's possible to turn on and off
ASAN and UBSAN independent of the settings in CMake.

This option will disable the -Wframe-larger-than= flag even if
ASAN or UBSAN are not turned on in CMake.

Change-Id: I70b1ae544fe87093d0f5ce7ceb191f33399191ea
Reviewed-on: https://code.wireshark.org/review/23567
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-09-17 17:20:34 +00:00
João Valverde 9260461f4f plugins: Use minor version number for plugin install path
Wireshark patch releases (X.Y.Z) are binary compatible so reflect
that in the plugin installation path.

By installing to $pkglibdir/plugins/X.Y out-of-tree plugins don't
need to be reinstalled with every patch release.

Change-Id: I9d1728e6fb12bcb51d2a723af22c750cb7a966cf
Reviewed-on: https://code.wireshark.org/review/23497
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-17 16:55:51 +00:00
João Valverde 978f6b4e1a plugins: Fix paths to match WSUG
The Wireshark User Guide seems to say:

Global lua plugins are in $pkglibdir/plugins
Personal lua plugins are in XDG_CONFIG_HOME/plugins

Global binary plugins are in $pkglibdir/plugins/$version
Personal binary plugins are in XDG_CONFIG_HOME/plugins/$version

Fix code to match that. This is a backward-incompatible change
for global lua plugins and personal binary plugins.

Adds a version subfolder to the personal plugin folder for binary plugins.

This allows for safe upgrades and side-by-side installations
with different prefixes (they no longer use the same personal dir).

Change-Id: Ie0f039113628a257625a9a9fb2cb30e532f5dd47
Reviewed-on: https://code.wireshark.org/review/23516
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-17 16:54:52 +00:00
João Valverde 21d2158a0b CMake: Initial work to install headers for the benefit of plugins
To be continued incrementally to fix gaps and omissions.

If we are willing to reorganize the source tree to have one or two header
include folders this could be simplified considerably.

It would also force developers to give more consideration to API issues,
which is a good thing.

See also e7ef19efc0.

Bug: 14062
Change-Id: I0759da2f9793cfb5cf92c9e231457bba43df4353
Reviewed-on: https://code.wireshark.org/review/23548
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-17 07:22:16 +00:00
Stig Bjørlykke 800c179dfa cmake: Add -Wcomma as a warning flag.
Change-Id: I90827ac2cd2277a969d25996392ad1627fc6c530
Reviewed-on: https://code.wireshark.org/review/23566
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-16 11:13:23 +00:00
João Valverde 83aabe5500 CMake: Fix RPATH after ga338f87f33
GNUInstallDirs uses lib64 on x86_64.

Change-Id: I4e124a6b501bf2166e7270abbff53d52c9115f45
Reviewed-on: https://code.wireshark.org/review/23496
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-11 19:11:50 +00:00
Guy Harris df21aa9025 Use cmake_push_check_state() and cmake_pop_check_state().
Change-Id: I70528d5f54f62a51bf6f438669cd70d5f0296ae5
Reviewed-on: https://code.wireshark.org/review/23435
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-08 11:34:29 +00:00
João Valverde c1ef4693de CMake: Make plugin installation path use PLUGIN_INSTALL_LIBDIR
Change-Id: I47f248f6ef56aba400054fa3ade2bf4d29eeb895
Reviewed-on: https://code.wireshark.org/review/23411
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-06 17:26:46 +00:00
João Valverde c6f99aea46 CMake: Move CPACK remnants and remove stale comment
Move required variables for better context.

Remove TODO comment. "To do" is "everything" to re-implement CPack because
(incomplete) support was dropped in g0831becc1a.

Change-Id: Ie21001940794e264527f35b5d4638830de02d97e
Reviewed-on: https://code.wireshark.org/review/23410
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-06 17:26:39 +00:00