Commit Graph

553 Commits

Author SHA1 Message Date
João Valverde d1daf3fd10 CMake: Remove link test output line
The mode keyword STATUS needs to be capitalized, but this line is
mostly redundant with the check_c_source_compiles_output(), so
just remove it.

Change-Id: I7f29915a7ab2c4b5681e0159773d9216643f8a9c
Reviewed-on: https://code.wireshark.org/review/29524
Reviewed-by: João Valverde <j@v6e.pt>
2018-09-09 22:33:00 +00:00
João Valverde 500ac10999 CMake: Use upstream check compiler modules instead
CMake gives precedence to modules in CMAKE_MODULES_PATH (ours then).

It already includes CheckCCompilerFlags and CheckCXXCompilerFlags,
prefer uptream's instead, to benefit from bug fixes, etc.

Change-Id: I063c43cf29f5837c445e8281262356660594c4e5
Reviewed-on: https://code.wireshark.org/review/29484
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-08 06:11:49 +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
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 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
Guy Harris b622b1f5c1 Clean up tests.
On Windows with MSVC, just assume we have 64-bit file offset support,
including _fseeki64() and _ftelli64().

On UN*X, test for Large File Support and for fseeko()/ftello(), and for
what #defines are needed to enable them.

On Windows without MSVC, test for Large File Support, but assume we have
_fseeki64() and _ftelli64(); what *should* we be doing?

Clean up indentation and else()/endif() arguments while we're at it.

Change-Id: I801d1f4059abbed2d5123d2375a560634a9ee056
Reviewed-on: https://code.wireshark.org/review/28781
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-20 21:57:04 +00:00
Gerald Combs 977f4c2e68 CMake: Don't bother testing for _fseeki64 on Windows.
We don't appear to use it and if we ever do need it it's been available
since Visual Studio 2005 / MSVCR80.

Change-Id: Ifd44d78b96a21577ceea635653517a348ded50f7
Reviewed-on: https://code.wireshark.org/review/28778
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-07-20 19:20:11 +00:00
Pascal Quantin 40d180ec6d Lua: add include/lua-5.1 and include/lua-5.2 to CMake path suffixes
Bug: 14983
Change-Id: I8be206ace7f61c62e2e42bc53841067ec39e3a0a
Reviewed-on: https://code.wireshark.org/review/28726
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-07-16 17:39:57 +00:00
Dario Lombardo e4e0488da9 docbook: reduce ruby code duplication by introducing utils module.
Change-Id: I7e436db3cb86f5ebd0f5827c6da630303bc3f538
Reviewed-on: https://code.wireshark.org/review/28400
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-27 17:01:18 +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
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 0dcd8cd1a2 Asciidoctor: Remove underscores from macro names.
AsciiDoc allows dashes in macro names but not underscores. Current
versions of AsciiDoctor allow the inverse. Remove underscores to allow
for easier copying and pasting.

Remove asciidoc.conf while we're here. It's no longer used.

Change-Id: I32d8a4ec695b9e17a80ac720ee9faf62dbb362d3
Reviewed-on: https://code.wireshark.org/review/27787
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-05-24 20:00:56 +00:00
Gerald Combs a8b6c6fbcc Don't look for Asciidoctor PDF unless we find Asciidoctor.
Fix a doc string while we're here.

Change-Id: Ic67e40dc7e8d624a00b97fe40fe162e6f8633cfc
Reviewed-on: https://code.wireshark.org/review/27728
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-23 13:24:12 +00:00
Gerald Combs eed4961387 CMake: Search for asciidoctor-pdf separate from asciidoctor.
Search for asciidoctorj and asciidoctor-pdf and set
ASCIIDOCTOR_PDF_EXECUTABLE if either are found. Only enable the PDF
targets if we find ASCIIDOCTOR_PDF_EXECUTABLE.

Remove env.cmake since it's no longer needed.

Change-Id: Iee82b30eaa67d1ad3fd3a296d9997b0643a0cb4e
Reviewed-on: https://code.wireshark.org/review/27696
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-22 07:34:57 +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 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
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
Joakim Karlsson 5994c902b4 cmake: remove warnings -Werror=old-style-definition
see https://cmake.org/Bug/bug_relationship_graph.php?bug_id=15058

Change-Id: I325f476b145a542e987a13bedd1f95a7d8faba94
Reviewed-on: https://code.wireshark.org/review/27121
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-24 19:19:23 +00:00
Dario Lombardo 2132b8314d cmake: remove gtk find scripts.
Change-Id: I1645b664ddbf879e82bd4759d26993eab9f2490e
Reviewed-on: https://code.wireshark.org/review/27115
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-24 10:58:58 +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
Gerald Combs f70a7bf09b CMake: If we find Strawberry's xsltproc, un-find it.
Strawberry Perl ships with xsltproc but no DocBook XML files, which will
break the User's and Developer's Guide targets. Set XSLTPROC_EXECUTABLE
to XSLTPROC_EXECUTABLE-NOTFOUND if "strawberry" is anywhere in its path.

Change-Id: I070eaa247a24a1a79fcdb01256dd5812aa8f6fa8
Reviewed-on: https://code.wireshark.org/review/27101
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:43:59 +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
Pascal Quantin 4704b89aa1 Windows: add JSON-GLib library
Change-Id: I9b266bffc74779f9d28eabb5642644a2b0afa7cf
Reviewed-on: https://code.wireshark.org/review/27049
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-20 10:46:19 +00:00
Pascal Quantin 2b65e9e74b Windows: upgrade GLib to 2.52.2
Change-Id: If54ec9f8c62d95697a5703ea24cf3ad7c2d6112c
Reviewed-on: https://code.wireshark.org/review/27048
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-20 10:46:06 +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
Pascal Quantin aae825cf77 Remove remnants of WS_QT_BIN_PATH
Change-Id: If1152b285df143dd7cf75abf9ecbc2d0251306df
Reviewed-on: https://code.wireshark.org/review/27021
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-04-19 08:01:27 +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 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
Gerald Combs 80256442af More PortAudio removal.
Change-Id: Ib56212e09d41fc76494d8186c77541302700104c
Reviewed-on: https://code.wireshark.org/review/26952
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-04-15 16:49:53 +00:00
Joerg Mayer 0d31ec328f Check for HAVE_LZ4FRAME_H in the LZ4 detection process and use it
Change-Id: I919621b8c4c809eb181d563251eeb099b767ad82
Reviewed-on: https://code.wireshark.org/review/26940
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-15 05:34:08 +00:00
Peter Wu 2173309920 Revert "Docs: Reduce our TOC depth."
The Lua documentation has class names at its third level which is quite useful
to discover its documentation.

This reverts commit f5cd52c0fb.

Change-Id: I2a2e82041ac46a1a9974727bbb1d5cbf6855a878
Reviewed-on: https://code.wireshark.org/review/26814
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-09 23:56:36 +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
AndersBroman 2bc030268c FindAsciidoctor: On SLES 12.2 the executable name is asciidoctor.ruby2.1
Change-Id: I609aae2335ee8171c1d54eb05cf4c184f2dc1eb0
Reviewed-on: https://code.wireshark.org/review/26775
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-07 05:34:32 +00:00
Peter Wu fdef405782 cmake: fix "cmake -E env" compatibility with older CMake
"cmake -E env" was added in CMake 3.1, but we currently support 2.8.12
at minimum. Add a best-effort replacement for older versions. There are
some limitations from CMake (see comments), but these should not affect
the current user (FindAsciidoctor.cmake).

Change-Id: I56c92aa9ad42fb3950dbdfd955d4ff902111e0d7
Fixes: v2.5.1rc0-76-g94a0f7c641 ("Switch from AsciiDoc to Asciidoctor.")
Reviewed-on: https://code.wireshark.org/review/26658
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-27 21:11:37 +00:00
Gerald Combs 1915ce6133 CMake: Skip some header checks on Windows.
Skip some header checks on Windows when we're sure they will always
be true.

Change-Id: I4ff7c867b9268a53692085553055dcbc0f90ae1d
Reviewed-on: https://code.wireshark.org/review/26452
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-13 06:07:25 +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
Dario Lombardo fdd426e410 spdx: more licenses converted.
Change-Id: Ia1650bc02511f7bd47fb90be91b623177f05bcbd
Reviewed-on: https://code.wireshark.org/review/26337
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-09 04:48:20 +00:00
Gerald Combs f52bb2bf27 CMake: Fixup our Chocolatey bin path discovery.
Search for choco.exe directly instead of using PATHS + PATH_SUFFIXES.
Look in %ChocolateyInstall%\bin first. CHOCOLATEY_BIN_PATH is the binary
path. There's no need to append /bin to it.

Change-Id: I732db398bd989bf12222a5cee2c79c0bd4161638
Reviewed-on: https://code.wireshark.org/review/26276
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-06 19:00:56 +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
Gerald Combs b2d3680558 CMake: Remove FindSH.
We haven't used SH_EXECUTABLE since the Asciidoctor migration.

Change-Id: I93e8245ea02ed994ebb62942d5ea4ec890e35a97
Reviewed-on: https://code.wireshark.org/review/26277
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-06 18:00:42 +00:00
Gerald Combs f5cd52c0fb Docs: Reduce our TOC depth.
Reduce the TOC depth so that it's not quite so huge.

Change-Id: I5748edf0e715961da57eff7e0ade6fad175ab24b
Reviewed-on: https://code.wireshark.org/review/26110
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-02-26 02:42:54 +00:00
Gerald Combs bfedd74e99 CMake: Try to avoid Strawberry Perl's xsltproc.
Search for Chocolatey's and Cygwin's respective xsltprocs before searching
%PATH%. Strawberry Perl doesn't include DocBook, which makes it useless
as far as we're concerned.

Another approach would be to look in various locations for an XML catalog
files and set %XML_CATALOG_FILES%. However, Cygwin's /etc/xml/catalog
contains Cygwin-specific URLs, e.g. file:///etc/xml/docbook and can't
be used with a non-Cygwin xsltproc.

Change-Id: Iaebfdff922a6574581b9bd207625f03598c166e0
Reviewed-on: https://code.wireshark.org/review/25794
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-02-14 20:23:43 +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 8ebbf99173 Remove Lynx.
Use tools/html2text.py to convert HTML to text.

Remove some now-obsolete documentation.

Change-Id: Ib21a1ab10c789182da5fcc68e98917a00f2fa650
Reviewed-on: https://code.wireshark.org/review/25733
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-02-12 19:19:11 +00:00
Gerald Combs 86376e8447 Fix ASCIIDOCTORJ_OPTS.
Avoid excessive quoting.

Change-Id: I0dd7593d464851bd34cfc7a5a99a21a2a826dd7a
Reviewed-on: https://code.wireshark.org/review/25732
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-02-11 19:06:39 +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
Guy Harris 121abba1a2 Have individual plugin CMakeLists.txt files add library dependencies.
This removes any knowledge of plugin types from
cmake/modules/WiresharkPlugin.cmake, so that it doesn't have to be
changed if we add a new plugin type.  Revert to the second argument to
add_plugin_library() and install_plugin() being the subfolder.

Change-Id: I668ab90b28c73a8b12ca8e3e906b8de2f9395ca5
Reviewed-on: https://code.wireshark.org/review/25585
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-04 02:03:58 +00:00
Guy Harris d5f52cfaf5 Don't link wiretap plugins with libwireshark.
Make the second argument to add_plugin_library() and install_plugin() be
a plugin type - currently, either "epan" or "wiretap" - and, based on
its value, set the subfolder and required libraries in
add_plugin_library() and the subfolder in install_plugin().  If it's not
one of the known values, fail.

Change-Id: I556863772c59330d2854fbb4673f544f8359dcd2
Reviewed-on: https://code.wireshark.org/review/25579
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-03 21:04:14 +00:00
Gerald Combs 787b93fd07 Docbook: Generate one PDF paper size.
Generate a single PA4-sized PDF. PA4 is the approximate intersection of
A4 and Letter[1]. This gives us one less file to build and distribute.

If you're printing out hard copies of the guides this wastes a few pages
compared to an A4-sized PDF, but if you're printing out hard copies of
the guides you've already made a strong commitment to waste paper.

Page counts:

    Guide    Size      Pages

    WSDG     A4        203
    WSDG     Letter    217
    WSDG     PA4       217

    WSUG     A4        192
    WSUG     Letter    204
    WSUG     PA4       205

[1] https://en.wikipedia.org/wiki/Paper_size#PA4_or_L4

Change-Id: If43d4b19947c77a51b3943a2b329dbab45025d79
Reviewed-on: https://code.wireshark.org/review/25438
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-01-23 22:15:01 +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
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
João Valverde e502d933c5 CMake: Remove incorrect comment
Change-Id: Ie58b172f5c465d92d8100ac39cfd8c905586e9f7
Reviewed-on: https://code.wireshark.org/review/25331
Reviewed-by: João Valverde <j@v6e.pt>
2018-01-15 22:03:05 +00:00
Gerald Combs 5639b8014a Use an enum for plugin types.
Make plugins.c the source of truth for plugin names. Where plugins
reside and what they do are two different things, so split the plugin
directory and description into two separate elements.

CMake creates portable[1] builds on Windows and macOS. That is, the
build-time directory layout is the same as the installation directory
layout. Adjust various plugin paths macOS accordingly.

[1] You have to run osx-app.sh on macOS to prepare the application
bundle, but the goal is to create a directory/bundle that can be moved
or copied to a different system and run in the new location.

Change-Id: Icf9d02e61918fdf1404468baf52542910edf2743
Reviewed-on: https://code.wireshark.org/review/25166
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-01-11 00:58:43 +00:00
Gizem Yurdagul fbeca26f03 CMake: Additional default Cygwin location
On 64bit Windows, Cygwin installer sets the installation path as
"C:/tools/cygwin64", add this to the set of default locations when searching
for Cygwin.

Change-Id: I2d6ff0dfb18f24a595583c5a9c4b05d573e05e75
Reviewed-on: https://code.wireshark.org/review/25029
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2017-12-28 10:47:40 +00:00
João Valverde 6159c2be18 CMake: Replace generator expression with variable
Should fix OSX buildbot.

Change-Id: I52abdeab8c547079edc8aec6a0c6e12e928838c6
Reviewed-on: https://code.wireshark.org/review/24873
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2017-12-17 13:03:14 +00:00
João Valverde f3444ed0f9 plugins: Remove moduleinfo.h
Micro version bump for mate to homogenize it between CMake and autotools.
The cmake macro doesn't handle the "a" suffix and it doesn't seem worth
implementing.

Change-Id: Ib022c6aa170623b83a9700e4fa098c60a9cddfab
Reviewed-on: https://code.wireshark.org/review/24847
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2017-12-17 11:47:17 +00:00
João Valverde ee8ca2e1d7 plugin.rc.in: Cleanup some unnecessary code
Also add comment noting that MSVC_VARIANT is not the same thing as
CMAKE_GENERATOR.

Change-Id: Icc0f4a491786e4045c650509957655ef41352b29
Reviewed-on: https://code.wireshark.org/review/24846
Reviewed-by: João Valverde <j@v6e.pt>
2017-12-17 11:47:07 +00:00
João Valverde adde937ed7 plugins: Remove redundant plugin.rc.in files
plugin.rc is Windows specific, also add condition to reflect that.

Change-Id: Ibbb7dab77dd1f277e2302c8f931218ca433f8c72
Reviewed-on: https://code.wireshark.org/review/24833
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2017-12-15 22:09:04 +00:00
João Valverde 995812c5f1 Refactor plugin registration and loading
Put different types of plugins (libwiretap, libwireshark) in different
subdirectories, give libwiretap and libwireshark init routines that
load the plugins, and have them scan the appropriate subdirectories
so that we don't even *try* to, for example, load libwireshark plugins
in programs that only use libwiretap.

Compiled plugins are stored in subfolders of the plugin folders, with
the subfolder name being the Wireshark minor version number (X.Y). There is
another hierarchical level for each Wireshark library (libwireshark, libwscodecs
and libwiretap).

The folder names are respectively plugins/X.Y/{epan,codecs,wiretap}.

Currently we only distribute "epan" (libwireshark) plugins.

Change-Id: I3438787a6f45820d64ba4ca91cbe3c8864708acb
Reviewed-on: https://code.wireshark.org/review/23983
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2017-12-14 08:43:57 +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 40fc796818 Fix the configuration check for remote-capture support in libpcap.
In autotools, if we find pcap_open(), define HAVE_PCAP_REMOTE, so we
build the remote capture support.

In both autotools and CMake, only check for pcap_setsampling() if we
have pcap_open(), as the compile fails if we have pcap_setsampling() but
don't have remote capture.

Change-Id: I0e7b78a2d372ea658a19ed2f6493532928c36872
Reviewed-on: https://code.wireshark.org/review/24680
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-03 06:24:30 +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 fe0c2b0485 Rewrite make-dissector-reg.py in C
The output compares equal to make-dissector-reg.py and the regex
should be more robust (multiline, complete start of function definition).

The primary motivation is to clean up the python script. This small
binary results in much cleaner code. The python script is used only
to generate plugin code, therefore it is renamed.

Also in my casual measurements the C code is much faster (without cache)
than the python script with the cache.

Change-Id: Id4e8cac3c836d56775aba4819357a95ef19bcb85
Reviewed-on: https://code.wireshark.org/review/24497
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-20 06:03:08 +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 d6b3fcfeab CMake: Fix error from bab9abfb7d
Fix a cut and paste error

Change-Id: I28fa3644d5b7969c8009f5722f270c8fa566dd34
Reviewed-on: https://code.wireshark.org/review/24491
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2017-11-19 12:20:29 +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
Graham Bloice b6d6eb9097 CMake: Detection of HTMHelp
CMake erroneously reports that HTMLHelp wasn't found

The override of FindHTMLHelp.cmake now uses
FIND_PACKAGE_HANDLE_STANDARD_ARGS to do this correctly.

Change-Id: I1bd24964365dea00af213092872e24cbfb5ee07d
Reviewed-on: https://code.wireshark.org/review/24281
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-07 23:01:44 +00:00
Peter Wu ddf6526256 FindPOD.cmake: look for pod2man.bat
Strawberryperl 5.26.1.1 installs "pod2man.bat" but not "pod2man" so
find_program cannot locate it.

Change-Id: Iebfe2efec220085b15a4d73681da9cc7ea6a5360
Reviewed-on: https://code.wireshark.org/review/23913
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-15 00:12:57 +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
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 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
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 a338f87f33 CMake: Use GNUInstallDirs module instead of our own
Change-Id: I42f62824f226b091ff9bb86ce5c222333f98d783
Reviewed-on: https://code.wireshark.org/review/23379
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-03 20:13:44 +00:00
Gerald Combs f8d0a7f003 CMake: We no longer support Visual C++ 2005 or 2008.
Change-Id: Ide3688366aa3c38d48ff29224dbfc0fdb7bf1b7a
Reviewed-on: https://code.wireshark.org/review/23277
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-29 01:55:00 +00:00
Ahmad Fatoum aca55a29f7 Add hardware timestamping support
pcap provides a pcap_set_tstamp_type function, which can be used to request
hardware timestamps from a supporting kernel.

This patch adds support for aforementioned function as well as two new
command line options to dumpcap, wireshark and tshark:

    --list-time-stamp-types
                             List time stamp types supported for the interface
    --time-stamp-type <type>
                             Change the interface's timestamp method

Name choice mimics those used by tcpdump(1), which already supports this
feature. However, unlike tcpdump, we provide both options unconditionally.
If Wireshark was configured without pcap_set_tstamp_type being available,
--list-time-stamp-types reports an empty list.

Change-Id: I418a4b2b84cb01949cd262aad0ad8427f5ac0652
Signed-off-by: Ahmad Fatoum <ahmad.fatoum@siemens.com>
Reviewed-on: https://code.wireshark.org/review/23113
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-22 07:55:26 +00:00
Gerald Combs 9f7f401f32 CMake: Remove an unused variable.
Remove a variable apparently left over from the DocBook→AsciiDoc
transition.

Change-Id: Ieb6e2fd282ab71227bc5d33c200f04051acf529b
Reviewed-on: https://code.wireshark.org/review/23077
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-08-14 20:28:10 +00:00
Gerald Combs dc69a8446e CMake: Don't look in WOW6432Node.
CMake should check both the 32-bit and 64-bit views automatically.

Change-Id: I856814efcd660260c734c7956ad00ee43a8f666f
Reviewed-on: https://code.wireshark.org/review/22936
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-04 05:56:46 +00:00
Gerald Combs 7c5ff646dc Look for Cygwin in one more place.
Add "HKLM\SOFTWARE\WOW6432Node\Cygwin\setup" to the Cygwin search paths.

Change-Id: I302ecea67dd580449b450136c027ac37adf586d3
Reviewed-on: https://code.wireshark.org/review/22893
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-08-01 22:28:29 +00:00
Pascal Quantin 3e54cabf81 Add G.729 decoding based on bcg729 library
Bug: 13635
Change-Id: Ic22a0719a59da13e51425aeb747e88caca0d6512
Reviewed-on: https://code.wireshark.org/review/22808
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-07-30 05:22:35 +00:00
Ike Gilbert 76762d69b5 Windows: fix generation with CMake 3.9.0
By using CMake FindPerl.cmake module, CYGWIN_INSTALL_PATH variable
gets overwritten, bypassing our modified FindCygwin.cmake.
Let's package our own version FindPerl.cmake to avoid this.

Bug: 13922
Change-Id: If68e96ba312c2c6fa417721e7aec2ae6e5179a81
Reviewed-on: https://code.wireshark.org/review/22834
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-29 19:52:20 +00:00
Guy Harris 9ea364c389 Require at least c-ares 1.5.0 when configuring.
That way, if you have an older version, we fail at configure time, with
what should be a message indicating that your c-ares is too old, rather
than at compile time, with what might provoke users to ask "what am I
doing wrong?" or "what do I need to fix?" or "why is my compile
failing?" or....

Change-Id: I911574c4d90174b6bd074c5ef537557d47b199dc
Reviewed-on: https://code.wireshark.org/review/22752
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-21 12:39:26 +00:00
Gerald Combs ab0b3ecf86 CMake: Escape shell command quotes.
Escape shell command quotes so that what appears to be "unquoted_legacy"
behavior doesn't kick in.

Ping-Bug: 12305
Change-Id: I4763df2fbc58b80d6e4e3ec15f78c16fa1cf3853
Reviewed-on: https://code.wireshark.org/review/22732
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-07-20 18:00:43 +00:00
Gerald Combs a6652a2778 CMake: Fix the WiX search path.
Look for WiX executables in $WIX/bin instead of $WIX.

Change-Id: Id55eb8e73403d2beed55d64e9bdc6812308c359f
Reviewed-on: https://code.wireshark.org/review/22423
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-06-27 17:34:22 +00:00
Guy Harris e61d2f6243 On UN*X, make sure we can find inflate() in libz.
For example, on at least some versions of Fedora, if you have a 64-bit
machine, have both the 32-bit and 64-bit versions of the run-time zlib
package installed, and have only the *32-bit* version of the zlib
development package installed, it'll find the header, and think it can
use zlib, and will use it in subsequent tests, but it'll try and link
64-bit test programs with the 32-bit library, causing those tests to
falsely fail.  Hilarity ensues.

Change-Id: Ic2536e8a652ef96e2a3923c1faa61f6c8c06bf58
Reviewed-on: https://code.wireshark.org/review/22417
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-27 07:48:58 +00:00
Guy Harris 9a1d16b553 Don't check for inflatePrime() on Windows.
On Windows, we build libz as part of the Wireshark build process, so we
don't necessarily *have* a libz library to search or inflatePrime() at
this point; the search fails on the buildbots, for example.

So, on Windows, we just assume we have a new enough version of libz, so
that it has inflatePrime().

Bug: 13850
Change-Id: Ied0909f4a591ff3312d83a2a2ed41e3cd12218e8
Reviewed-on: https://code.wireshark.org/review/22413
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-27 03:16:04 +00:00
Guy Harris a0dfbccdfc Rename FindOS_X_FRAMEWORKS.cmake for the new OS name.
It's now FindMACOS_FRAMEWORKS.cmake.

(But is it actually *used*?  CMakeLists.txt does the check itself.)

Change-Id: I6e972869b94da959dc7c9a3fccacfbd35e0e992c
Reviewed-on: https://code.wireshark.org/review/22163
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-16 08:55:57 +00:00
Guy Harris 5039d0e576 Change some names to reflect Apple's new UNIX-for-Macs name.
{OS_X,os_x} -> {MACOS,macos}.

Change-Id: Icebea6ab566c65996ee97bacb88fac7e84ec32de
Reviewed-on: https://code.wireshark.org/review/22161
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-16 08:50:22 +00:00
Anders 0dc32776d0 Simplify the search for HTMLHelp.
Change updated as per https://gitlab.kitware.com/cmake/cmake/issues/16950#note_277462

Change-Id: I794e6cf7af3d1affa7ee5182374b6f22d9acdf33
Reviewed-on: https://code.wireshark.org/review/22051
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-10 16:11:12 +00:00
Gerald Combs 6a16f158c8 CMake: Look for Python in more places.
According to PEP 514, Python.org's Windows installer stores its
installation path in

HKEY_LOCAL_MACHINE\Software\Python\<Company>\<Tag>\InstallPath

where <Tag> is the value of sys.winver. Newer versions of python add "-32"
and "-64" to the version in order to allow side by side installations.
Adjust LocatePythonExecutable accordingly.

Change-Id: I8c7f8b4c31b37e7f687ce9909f97d62a779cfa91
Reviewed-on: https://code.wireshark.org/review/22048
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-06-08 22:41:20 +00:00
Graham Bloice fce2f2bb1f CMake: Add local copy of FindHTMLHelp.cmake
Add a local copy of FindHTMLHelp.cmake to search for hhc.exe that
includes the 32 bit program files locations "Program Files (x86)"
as this is where hhc.exe normally lives.

Change-Id: Ic5917a0765786ac483a7d4ef457043319d0e8501
Reviewed-on: https://code.wireshark.org/review/22037
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2017-06-08 13:30:54 +00:00
Gerald Combs 027aae1cd3 Revert "More 2.4 initialization."
This reverts commit c60a6580c9.

Wrong branch.

Change-Id: I846b26d09bf1ab99d3f42baf35f1a63f1dd806d2
Reviewed-on: https://code.wireshark.org/review/21967
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-06-05 15:03:58 +00:00
Gerald Combs c60a6580c9 More 2.4 initialization.
Change-Id: Iac4c02068eb462854b66c1561f4dfa2601bb18bf
Reviewed-on: https://code.wireshark.org/review/21966
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-06-05 15:03:06 +00:00
Pascal Quantin 46ef2dabfd Windows: update LZ4 to 1.7.5 and USBPcap to 1.2.0.1
Change-Id: I02eb4c255a0794b650f566abdadcac16e97196af
Reviewed-on: https://code.wireshark.org/review/21609
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-12 03:07:31 +00:00
Guy Harris 6f1e6d24c6 Revert "Revert "Get rid of HAVE_REMOTE.""
This reverts commit 8cd1fd0c99.

Making HAVE_REMOTE a config.h #define is a really horrible idea.  It's *NOT* a configuration option.

Instead, HAVE_REMOTE should be defined by other mechanisms, as was done in 79eab8ca07.

Change-Id: I4632b63bd73a25a27c5f4686d2baf3e0beddecb3
Reviewed-on: https://code.wireshark.org/review/21604
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-11 18:19:12 +00:00
Jörg Mayer 8cd1fd0c99 Revert "Get rid of HAVE_REMOTE."
This reverts commit d13b8ea13c.

This will only work with git HEAD of libpcap, but not with any release versions of libpcap or winpcap (the *pcap includes require the define, not Wireshark).

Change-Id: I08e5ec66e3642dc02f793c83ffc4363bb348202c
Reviewed-on: https://code.wireshark.org/review/21603
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2017-05-11 18:09:04 +00:00
Guy Harris d13b8ea13c Get rid of HAVE_REMOTE.
We never test for it - we test for HAVE_PCAP_REMOTE - so there's no need
to set it in config.h.

While we're at it, note that "PCAP" in "HAVE_PCAP_REMOTE" can refer to
libpcap as well as WinPcap, given that, at least in the tip of the
master branch, you can configure remote support in libpcap, although
it's not enabled by default (it needs to be vetted for security, as it
increases the attack surface of a machine running the server *and* of an
application using libpcap with remote support).

Change-Id: I3c96cf16bbda19ec7c085f74cffc6f125198d45b
Reviewed-on: https://code.wireshark.org/review/21589
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-10 21:16:29 +00:00
Peter Wu 50a1f90398 FindPOD.cmake: look for pod2html.bat
Strawberryperl 5.24.1.1 installs "pod2man", "pod2man.bat" and
"pod2html.bat", but not "pod2html" so find_program cannot locate it.

Change-Id: Id52ee7e77bbbfc8c2fcc6ab66c498d4818f54bf8
Reviewed-on: https://code.wireshark.org/review/21350
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-04-26 21:52:34 +00:00
Peter Wu 35f620c533 cmake: make Cygwin optional
Cygwin is not needed if the documentation is not built (i.e. asciidoc,
docbook, xsltproc are not needed). Via Chocolatey the following packages
can be installed: git, winflexbison, strawberryperl.

Change-Id: Ib13d144321cf6d2ed5c3346a2ae271de983deada
Reviewed-on: https://code.wireshark.org/review/21316
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-04-26 21:52:15 +00:00
Peter Wu 46b105d513 Remove runlex.sh script, just run lex directly
This removes the need for sh (and Cygwin) on Windows to build Wireshark.

runlex.sh (added in commits 5be4499a and 517d6d57) was added because
older flex had quirks with its options (and the --header(-file) option
was not available). The minimum required flex version for reentrant
scanners (2.5.6) does not have these issues though, so remove the step.

Change-Id: I73c82bb329e2130481efca94809dc60b86dcbafe
Reviewed-on: https://code.wireshark.org/review/21315
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-04-26 21:51:18 +00:00
Peter Wu a8d9777161 cmake: remove dependency on sed
runlex.sh does not need sed anymore since v2.3.0rc0-2386-g64f83641ad.
Since building docs already depends on Perl, let's use Perl instead.

Change-Id: Id7e923e47001cfd32c8cef89960377026464f2ee
Reviewed-on: https://code.wireshark.org/review/21314
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-04-26 21:50:44 +00:00
Roland Knall 39167ab2c9 cmake: FixLibXML2 include
Add default setting for the libraries entry, to satisfy windows builds,
if no libxml2 has been found

Change-Id: I3db026b6b8446eb42c7f30ee63c00a07600948fa
Reviewed-on: https://code.wireshark.org/review/21221
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-04-19 13:24:24 +00:00
Ahmad Fatoum cfab5ef035 Add libxml2 as optional dependency
This can be used by dissectors that need to parse out-of-band
configuration.

Change-Id: I13c0a2f408fb5c21bad7ab3d7971e0fa8ed7d783
Reviewed-on: https://code.wireshark.org/review/20912
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-04-19 10:41:55 +00:00
Pascal Quantin 74784bdb3e Update Windows binaries to GeoIP 1.6.10 with a local GeoIP_free function
This solves a crash occurring when trying to free memory allocated by
GeoIP (cross-compiled with mingw(32|64)) with MSVC function

Bug: 13598
Change-Id: I757cff13660bd485d7ea91d10660e9bf86404728
Reviewed-on: https://code.wireshark.org/review/21090
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-14 17:53:09 +00:00
Peter Wu aa9a0b3bf8 cmake: fix sporadic WSDG build failure on Windows
The Windows builds (using msbuild) fail sporadically when building
documentation (target developer_guides). The problem is that the targets
"developer_guide_pdf_a4" and "developer_guide_html" both depend on
developer-guide.xml and msbuild does not notice that the file has
already been generated by the generate_developer-guide.xml target.

For a discussion of the problem, see
https://gitlab.kitware.com/cmake/cmake/issues/16767

To fix this, remove the "developer-guide.xml" dependency from
"developer_guide_xyz" (to prevent these targets from triggering building
"developer-guide.xml"). Instead, depend on a generated
"developer-guide.xml-stamp" file which is created by the
"generate_developer-guide.xml" target (but do *not* add it as output of
this target, otherwise we will have the original problem again).

This workaround is restricted to the MSVC generators because otherwise
it would trigger a CMP0058 policy warning when used with Ninja.

Change-Id: Idb3975cde35be2601b038a500d4886bbd3a684d7
Reviewed-on: https://code.wireshark.org/review/20812
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-04-12 04:18:18 +00:00
Guy Harris 357cfd3b03 A bunch of "{Mac} OS X" -> "macOS" changes.
Avoid anachronisms, however; there was no "macOS 10.0" or even "OS X
10.0", for example.  It was "Mac OS X" until 10.8 (although 10.7 was
sometimes called "OS X" and sometimes called "Mac OS X"), and it was "OS
X" from 10.8 to 10.11.

Change-Id: Ie4a848997dcc6c45c2245c1fb84ec526032375c3
Reviewed-on: https://code.wireshark.org/review/20933
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-05 19:16:22 +00:00
Gerald Combs b59c87f94a CMake: Move the search for libgcc_s to GLib.
Move the search for the libgcc_s_seh and _sjlj DLLs to the GLib directory.
That's the only place it currently exists on the 64-bit builder.

Change-Id: Icf55dacf061d9423e78cabeaf16aa539ccb619bb
Reviewed-on: https://code.wireshark.org/review/20162
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-02-17 20:27:03 +00:00
Gerald Combs a5a8fce06e Qt: Warn the user about DBAR 1.8 on Windows.
At startup, dig through the registry looking for shell extensions. If
any of them match known Dell Backup and Recovery DLL names and the DLL
version matches 1.8.*.*, show the user a warning dialog.

This is a bit extreme but I'm not sure what else to do. Dell is a popular
computer manufacturer and bug reports keep trickling in.

Change-Id: I6d1bd6c56850279356570154d231b07facb30cff
Bug: 12036
Ping-bug: 12701
Ping-bug: 13414
Reviewed-on: https://code.wireshark.org/review/16861
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-02-16 16:58:12 +00:00
Mark Phillips 64f83641ad Cleanup runlex.sh to use builtin POSIX functions instead of sed
Bug: 13412

Change-Id: If43b30a33dcc4f23ba2bcb3cce3d0feea0d9fe40
Reviewed-on: https://code.wireshark.org/review/20120
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-02-15 20:58:43 +00:00
Pascal Quantin 0b8a12fd51 Windows: update GnuTLS to 3.4.11 and Libgcrypt to 1.7.6
Also switch some third party libraries to stripped version to reduce size

Change-Id: If0fd06a85fb17fb3e35543bcc714c8a8a1ce20c6
Reviewed-on: https://code.wireshark.org/review/20117
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2017-02-15 17:32:36 +00:00
Graham Bloice 8234de5350 Fix release-notes.html generation
The ASCIIDOC_CONF_FILES setting for asciidoc was only generated
if any of the guides were being built.

Clean up a dup setting and some and blank lines in FindASCIIDOC

Change-Id: Ie8ab97db09e18cdb8d7e2a7bd4dcf8c288dd036f
Reviewed-on: https://code.wireshark.org/review/19291
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2016-12-15 20:56:21 +00:00
Gerald Combs dd816a1218 Update to WinSparkle 0.5.3.
Update our WinSparkle package to 0.5.3. This fixes a file deletion bug.
Note that WinSparkle now supports application shutdown callbacks, which
should let us fix bugs 9687 and 12989.

Bug: 13217
Change-Id: I4b5f325c6dc251ce167f7bd344bbf3ca5ad3fe14
Reviewed-on: https://code.wireshark.org/review/19230
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-12-13 01:52:16 +00:00
Pascal Quantin fc4bb7eb74 Change SpanDSP capitalization
Many capitalization can be found for this library (spandsp, Spandsp, SpanDSP),
let's use the one found in the library README and in its spec file.

Change-Id: Ia66b723e5d582a6218da1b6366b7d4859272f80c
Reviewed-on: https://code.wireshark.org/review/19122
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-12-07 00:51:14 +00:00
Peter Wu f5e22a1487 codecs: Add support for G.722 and G.726
Integrate the Spandsp library for G.722 and G.726 support. Adds support
for G.722 and all eight variants of G.726.

Note: this also fixes a crash in Qt (buffer overrun, reading too much
data) caused by confusion of the larger output buffer (resample_buff)
with the smaller input buffer (decode_buff). It was not triggered before
because the sample rate was always 8k, but with the addition of the new
codecs, a different sample rate became possible (16k).

Fix also a crash which occurs when the RTP_STREAM_DEBUG macro is enabled
and the VOIP Calls dialog is opened (the begin frame, start_fd, is not
yet known and therfore a NULL dereference could occur).

Passes testing (plays normally without bad RTP timing errors) with
SampleCaptures files: sip-rtp-g722.pcap and sip-rtp-g726.pcap. Tested
with cmake (Qt), autotools (Qt and GTK+) with ASAN enabled.

Bug: 5619
Change-Id: I5661908d193927bba50901079119eeff0c04991f
Reviewed-on: https://code.wireshark.org/review/18939
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-12-06 17:51:47 +00:00
Gerald Combs 7b5e77406d CMake: Update FindWiX.
The WiX Toolset installer sets the WIX environment variable. Search for
our WiX executables there first.

Change-Id: I5acc9cb369dc2bdbb071d35b5a39498c6db117a3
Reviewed-on: https://code.wireshark.org/review/19096
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-12-05 20:21:23 +00:00
Dario Lombardo 035e404fff cmake: add creation of version.conf to be shipped in tarball.
Change-Id: I2bb66844b29cd4805d201891ffba342d26ee475f
Reviewed-on: https://code.wireshark.org/review/18731
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-11-21 09:02:11 +00:00
Peter Wu 58c4a4e018 cmake/FindPCAP: fix use of bad cached function checks
When libpcap-dev is not installed, do not look for functions like
pcap_datalink_name_to_val since the negative result would be cached.
Then after installing libpcap-dev, the build would fail due to
redeclaration of functions.

Change-Id: Ifdbad09e9cf160383b16b6459693f7ea5d65b9c3
Reviewed-on: https://code.wireshark.org/review/18834
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-11-18 17:33:53 +00:00
Martin Kaiser 4e95d5fa8e cmake: fix the linker flags test for Visual Studio
ddd1c87d43 modified the order
of linker command line options. This broke the tests and made
invalid linker flags seem valid.

(Link target) ->
  LINK : warning LNK4044: unrecognized option '/Wl,--as-needed'; ignored [C:\wireshark\build3\wsutil\wsutil.vcxproj]
  LINK : warning LNK4044: unrecognized option '/pie'; ignored [C:\wireshark\build3\wsutil\wsutil.vcxproj]

The simple fix is to add specific options for Visual Studio and clang at the beginning of
the linker's command line options rather than at the end.

Change-Id: I6492ea1271e18be0d190e7579f47baecf6ac4d61
Reviewed-on: https://code.wireshark.org/review/18709
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-11-08 16:22:30 +00:00
Martin Kaiser ddd1c87d43 cmake: avoid leading space in linker options
This causes problems with cmake 2.8.9, which ships with Debian Wheezy.

Reorder the linker options to avoid a leading space. According to GNU
ld's manual, the order of linker options on the command line does not
matter. This should be the same for Visual Studio's cl.exe and for
clang's linker.

See
https://www.wireshark.org/lists/wireshark-dev/201604/msg00141.html
for more details about the problem.

Change-Id: Ieaf7425600d394f365b01747747665233693fea2
Reviewed-on: https://code.wireshark.org/review/18581
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-11-07 21:16:30 +00:00
Pascal Quantin 28bbd56591 Add SBC decoding support to Windows
Change-Id: Ibef872dff26c22e2834e958c496c33a5695bb131
Reviewed-on: https://code.wireshark.org/review/18394
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-22 17:35:54 +00:00
Peter Wu 53400e0d33 cmake/FindPOD: improve parallelism
HTML and manual pages can be generated in parallel.

Change-Id: I2301e8bdc5ae1179a8ac0c24f412e5435993a764
Reviewed-on: https://code.wireshark.org/review/18281
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-10-20 23:36:24 +00:00
Peter Wu d399bfaa07 cmake/FindPOD: improve formatting, add modelines
CMake standard style is to use lowercase function names, do that.

Change-Id: I893825cfac0cc402177ffb1a0f43f0ffc6341c45
Reviewed-on: https://code.wireshark.org/review/18312
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-10-19 11:33:33 +00:00
Pascal Quantin 303948500f CQL: add LZ4/Snappy decompression support on Windows
Change-Id: I34374cf29357e2ed5062da1a5245b9adbabf732d
Reviewed-on: https://code.wireshark.org/review/18249
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-18 04:00:35 +00:00
Benoît Canet 47649d1c7f cql: add lz4 and snappy decompression
We do not use the STARTUP negotiation since a stream
can be captured in its middle but try to decompress
if the flag is present and fallback if it fails.

Change-Id: Iecbf49a45220b04be7808869c9884548eb1e7694
Signed-off-by: Benoît Canet <benoit@scylladb.com>
Reviewed-on: https://code.wireshark.org/review/17952
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-10-17 18:28:45 +00:00
Peter Wu a30dcd9951 cmake: fix missing docbook dependency
Running "ninja developer_guide_html" somehow did not produce a new HTML
docbook once wsluarm.ascii (a dependency of developer-guide.xml) was
modified.

It turns out that output file docbook/wsdg_html/index.html only had a
ordering-only dependency on target generate_developer-guide.xml. An
extra dependency is needed on the output file to ensure that the HTML
file gets rebuild on changes.

See the last note on
https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/

Fixes v2.1.0rc0-2137-gd544ecd ("cmake: fix parallel docbook build").

Change-Id: I7689c71994f13b29cf7f8561f7c993aa8298632d
Reviewed-on: https://code.wireshark.org/review/18225
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-10-17 14:33:04 +00:00
Balint Reczey b1cc056b12 Remove nghttp2 code and use system' nghttp2
Update debian, macos (setup / homebrew) download script
Update testsuite (don't try HPACK when build without nghttp2)

Change-Id: I365e5e17bc4fab4acd81b4c39ea7189a5d1ee112
Reviewed-on: https://code.wireshark.org/review/17347
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-13 19:26:10 +00:00
Graham Bloice 7514f98f56 Make Winflex\bison the preferred option
Cygwin flex\bison generate shortening warnings due to size_t on
Win 64.  The win flex\bison versions don't so find them first.

Change-Id: Ib68c84435f859325612410b72b6cf21cf106ecc2
Reviewed-on: https://code.wireshark.org/review/17763
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2016-09-18 09:57:06 +00:00
Gerald Combs 3c163637d6 WSUG: Fixup PDF images.
Pass relative image directory paths to xsltproc. The DocBook documentation
says you can use a URI, but trying to get that to work with CMake
and Windows appears to be a path to tears and undignified wails of
frustration.

Add attributes for our different types of images and use them so that
the PDFs don't scale our screenshots to an unusable size.

Change-Id: I786d09d9ef9be3d423b2af426a8867739ae12c1a
Reviewed-on: https://code.wireshark.org/review/17688
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-09-13 21:02:54 +00:00
Peter Wu e079862fad cmake: fix breakage with libnl2
I accidentally assumed that libnl2 works fine with just libnl.so, but
apparently the other libraries are also necessary.

Change-Id: I1636710ea3f41ed10a5ccb37106cae9e688abec9
Reviewed-on: https://code.wireshark.org/review/17654
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-12 12:10:19 +00:00
Peter Wu 7471b46768 cmake: fix libnl caching issue, make it more robust
Dario reported that the cmake build fails after installing libnl3-devel
(libnl-devel was already present). This results from a name collision
for NL_LIBRARY and NL_INCLUDE_DIR variables.

Initially these variables contained the values for libnl-1. When libnl3
is installed, these variables were not updated (because it was cached),
but HAVE_LIBNL3 would still be set, resulting in a header and feature
mismatch. Use separate variables for libnl1 and libnl3 to fix this.

Other fixes: also set HAVE_LIBNL for libnl1; fallback to libnl1 if
libnl3 is unusable (e.g. because libnl-route-3.0 is missing).

Change-Id: Icf0a03843ea870347ddf365f69bacf4883d07f6d
Reviewed-on: https://code.wireshark.org/review/17449
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-03 13:57:59 +00:00
João Valverde 640382c743 CMake: Allow setting per target compiler warnings
Setting our compiler warning flags in CMAKE_C_FLAGS does not allow
using different flags per target.

Allow for that possibility by setting the internal WS_WARNINGS_{C,CXX}_FLAGS
and using the COMPILE_OPTIONS property to set them.

This change is just setting mechanism and there should be no difference
in generated warnings.

The check_X_compiler_flag cmake test is changed to test each flag individually.
We need a list, not a space separated string, and the aggregate test is not
significant.

Change-Id: I59fc5cd7e130c7a5e001c598e3df3e13f83a6a25
Reviewed-on: https://code.wireshark.org/review/17150
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>
2016-08-23 21:33:09 +00:00
Pascal Quantin 8e1cc70fd5 Fix detection of NSIS/WiX install path when running a win64 CMake
On x86 system:
System32\cmd.exe
ProgramFiles=C:\Program Files

On x64 system:
System32\cmd.exe
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
Syswow64\cmd.exe
ProgramFiles=C:\Program Files (x86)
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files

Change-Id: I32d52219366b299f1e8099dc6d7737970dc398dd
Reviewed-on: https://code.wireshark.org/review/16346
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-07-09 07:22:09 +00:00
João Valverde a16d401b25 Remove Makefile.common files
Now that nmake build system has been removed they are not needed anymore.

Change-Id: I88075f955bb4349185859c1af4be22e53de5850f
Reviewed-on: https://code.wireshark.org/review/16050
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>
2016-06-30 11:04:17 +00:00
Pascal Quantin 6baa1b544c Remove Nmake build system
Change-Id: I3bd474f3cda9667dec66426b5729449953df3e61
Reviewed-on: https://code.wireshark.org/review/15777
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
2016-06-15 19:21:57 +00:00
Guy Harris eb4ed5a53c Clean up some messages.
We're checking for more than just a 64-bit off_t; we're checking for the
ability to do 64-bit seeks in files, even if, as on Windows, the APIs
are different.

Remove trailing white space and clean up some comments while we're at
it.

Change-Id: I6122b6d6b44ff5dd3a4d8268f9793193e65817ce
Reviewed-on: https://code.wireshark.org/review/15912
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-15 00:36:34 +00:00
Michael Mann c34996f970 Create a Wix Installer
This is intended to replace the NSIS installer for Windows.
It does not include installing WinPcap or USBPcap.  From the research I've done, it seems to make more sense to "bundle" them with Wix ("wrapper" installer that would include Wireshark, WinPcap and USBPcap installers together)

TODO:
1. Customize installer with Wireshark graphics
2. Better handling flexibility of installing VC CRT Merge module (need build script to provide appropriate macros).  Something like (or modifying existing) FindMSVC_REDIST.cmake.
3. Use Wireshark UpgradeProductCode for install/uninstall. Previous NSIS installer did not have an upgrade code, so there are some backwards compatibility concerns.
4. Uninstall considerations (removing whole directories - plugins, configuration profiles?).  NSIS needed to do more things "manually" than Wix does by default.  Need to merge as best as possible to handle backwards compatibility.

Many thanks to Brian Pratt for all the Wix help.

Change-Id: Ib50780214fc7707ba2a46fd96ba8797a1763fa0c
Reviewed-on: https://code.wireshark.org/review/14858
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-11 13:09:17 +00:00
Peter Wu 27646e1cb4 cmake: fix GTK3 detection via pkg-config
Put QUIET before the module name, otherwise FindPkgConfig tries to
locate a module named QUIET. This fixes a build failure that complains
about missing pango/pango.h.

Tested with GTK 3.20, CMake 3.5.2 on Arch Linux.

Change-Id: I76e487d0f4b7f9fbac4105521c349b392b680923
Reviewed-on: https://code.wireshark.org/review/15314
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-05-09 20:01:20 +00:00
Graham Bloice 2e23b506c7 Add checkAPI calls to CMake.
This generates a top level target, checkAPI, that is
excluded from the ALL build target, so must be run separately.

On Windows using a Visual Studio generator, call
msbuild /p:Configuration=RelWithDebInfo checkAPI.vcxproj

Change-Id: I44a57c564dcfc75499463b942436f4b920a82478
Reviewed-on: https://code.wireshark.org/review/14873
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2016-05-02 12:01:24 +00:00
Pascal Quantin ae316e2d88 Compile sshdump and ciscodump for Windows
Use libSSH 0.7.2 compiled with MinGW(32|64) and linked with zlib and gcrypt support

Change-Id: I7c17d1ba3dd1890e2f83c119f5ea851834807e43
Reviewed-on: https://code.wireshark.org/review/12117
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-25 07:22:28 +00:00
João Valverde ed6eecd79e [GTK] Check for xdg-open at run time
Remove HTML_VIEWER compile-time setting.

If xdg-open doesn't exist use user web browser preference as fallback.

Change-Id: I3b4a4a1a36b0192d75f2c97595f37d0d88a0941e
Reviewed-on: https://code.wireshark.org/review/14805
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: João Valverde <j@v6e.pt>
2016-04-09 23:40:51 +00:00
Guy Harris 59816ef00c Make the Flex scanners and YACC parser in libraries reentrant.
master-branch libpcap now generates a reentrant Flex scanner and
Bison/Berkeley YACC parser for capture filter expressions, so it
requires versions of Flex and Bison/Berkeley YACC that support that.

We might as well do the same.  For libwiretap, it means we could
actually have multiple K12 text or Ascend/Lucent text files open at the
same time.  For libwireshark, it might not be as useful, as we only read
configuration files at startup (which should only happen once, in one
thread) or on demand (in which case, if we ever support multiple threads
running libwireshark, we'd need a mutex to ensure that only one file
reads it), but it's still the right thing to do.

We also require a version of Flex that can write out a header file, so
we change the runlex script to generate the header file ourselves. This
means we require a version of Flex new enough to support --header-file.

Clean up some other stuff encountered in the process.

Change-Id: Id23078c6acea549a52fc687779bb55d715b55c16
Reviewed-on: https://code.wireshark.org/review/14719
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-03 22:21:29 +00:00
Gerald Combs 1e41221f31 CMake: Find asn2wrs.py once.
Load LocatePythonModule and use it to find asn2wrs once instead of every
time we cal the ASN2WRS function. This reduces the cmake run time by
about 3 to 4 seconds here.

Change-Id: I85f7dcca0b5891c9b4b23a76d017f8e504d6af60
Reviewed-on: https://code.wireshark.org/review/14614
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-03-24 18:41:39 +00:00
João Valverde 7a1d3f67ac Remove ADNS support
Relevant mailing list message:

  https://www.wireshark.org/lists/wireshark-dev/201503/msg00007.html

Change-Id: I0cff6d4d64fb52a651bcf6b28c183e43653b1cc2
Reviewed-on: https://code.wireshark.org/review/14519
Reviewed-by: João Valverde <j@v6e.pt>
2016-03-21 19:32:00 +00:00
Graham Bloice 92db934c7c Fix CMake target FOLDER properties
Add FOLDER properties to targets to clean up the presentation
in Visual Studio.

Change-Id: I35a175175db055443572c58a069879061fdcf0a3
Reviewed-on: https://code.wireshark.org/review/14528
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-03-20 14:03:12 +00:00
Gerald Combs a183726370 DocBook: Don't require xmllint.
Remove dependencies on xmllint. We don't write DocBook by hand any more
and we haven't used it in a long time in the CMake builds.

Change-Id: Ic07f03b00c4554c058eece0462b0925d565b6da1
Reviewed-on: https://code.wireshark.org/review/14506
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-03-18 23:26:51 +00:00
Gerald Combs ea42011e26 Add missing hints.
Change-Id: I49ee3080339e75e69e96e97c2a9069136772e3a0
Reviewed-on: https://code.wireshark.org/review/14296
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-03-02 18:57:31 +00:00
Gerald Combs 429c840fc9 Add Fop 2.1 to FindFOP.cmake.
Change-Id: I3d3bb3e6ae5cefb4bc439b922d228cb202f4f446
Reviewed-on: https://code.wireshark.org/review/14292
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-03-02 18:03:00 +00:00
Peter Wu d544ecd0ec cmake: fix parallel docbook build
Let targets depend on the generate_developer-guide.xml target instead of
the developer-guide.xml output file.

Change-Id: I66106ad69c9baedbd58a008b4dbbbf93b787c2c2
Reviewed-on: https://code.wireshark.org/review/14156
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-02-26 19:52:09 +00:00
Peter Wu 8d256d26d3 cmake: fix docbook dependency
After changing an asciidoc source file, the html files were not rebuilt
via 'ninja developer_guides'. It turns out that the
developer_guide_docbook target has an order-only dependency on
developer-guide.xml (and not the developer-guide.xml dependencies).

Fix this by adding an explicit dependency on the generated .xml file.

Change-Id: I4bdc0ebca8909caaab9cc0797cc35cc6260bfe43
Reviewed-on: https://code.wireshark.org/review/14065
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2016-02-23 23:31:11 +00:00