Commit Graph

568 Commits

Author SHA1 Message Date
Gerald Combs 84ab55cf75 Docs+Packaging: Convert our man pages to Asciidoctor.
Convert doc/*.pod to Asciidoctor. This:

* Means we use the same markup for our man pages, the guides, and
  release notes.
* Lets us add versions to our man pages.
* Gives us more formatting options, e.g. AsciiDoc supports `commands`,
  nested lists and makes it easy to include version information. The
  manpage backend doesn't seem to support tables very well,
  unfortunately.

Convert our CMake configuration to produce *roff and html man pages
using Asciidoctor. Add a "manarg" block macro which makes our synopses
wrap correctly.

Similar to the release notes, guides, and FAQ, if Asciidoctor isn't
found the man pages won't be generated or installed.

Move Asciidoctor to the list of package build dependencies in various
places.

This commit includes the conversion script (pod2adoc.py), which will be
removed later.

Line count sanity check:

Man page         .pod .adoc
androiddump       260  280
asn2deb            93  105
capinfos          401  471
captype            54   55
ciscodump         241  269
dftest             42   42
dpauxmon          153  169
dumpcap           464  534
editcap           528  583
etwdump           136  156
extcap            157  181
idl2deb            91  103
idl2wrs           120  100
mergecap          206  207
mmdbresolve        75   75
randpkt           107  111
randpktdump       158  184
rawshark          558  610
reordercap         76   78
sdjournal         145  157
sshdump           272  302
text2pcap         274  312
tshark           2135 2360
udpdump           133  151
wireshark-filter  486  479
wireshark        2967 3420
2021-10-01 16:42:34 +00:00
João Valverde 6c5e56f752 Windows: Add preliminary support for MSYS2
If we are using MSYS2 we use those packages to build Wireshark
using MinGW-w64 and disable most or all of our win-setup.ps1 codepaths.

Fix GLib configuration. Disable copying of DLLs with MSYS2.

Some tests in the suite_capture test suite are failing with MSYS
MINGW64. That particular set of tests is way too brittle regarding
file system paths; more work is needed to improve that situation.
2021-09-27 16:45:58 +00:00
João Valverde f4c283298f Add compatibility fix for Minizip dependency 2021-09-23 14:19:02 +00:00
Gerald Combs 0b567bb27e Docs: Asciidoctor.js isn't yet suitable for our needs.
Reverse the text added in cdd6f2ec80 and note that we can't yet use
Asciidoctor.js to build our documentation. I'm not sure how I managed to
miss this in my initial tests, but Asciidoctor.js is missing Docbook,
PDF, and EPUB backends, and doesn't support Ruby macros.
2021-09-23 06:40:08 +00:00
João Valverde 76e31fe09e CMake: Add Doxygen search hint for Windows
This is where chocolatey installs doxygen.

  > choco install doxygen.install
2021-09-20 15:49:57 +00:00
João Valverde 750cc38669 epan: Remove some extraneous #ifdefs
If a macro identifier is not defined it evaluates to zero in an
expression, so the outer #ifdef is unnecessary and should be
avoided (the less the better).

Add a missing CMake comment while here.
2021-09-18 23:25:31 +01:00
Adrian Ratiu 49240e23b4 cmake: lemon: fix path to internal lemon tool
Wireshark fails to build when cross-compiling on Gentoo/ChromeOS
systems because the lemon command is not properly specified or
included in PATH, failing with:

/bin/sh: lemon: command not found

The relevant excerpt from build.ninja is:

COMMAND = cd ..._build/plugins/epan/mate && lemon -T.../tools/lemon/lempar.c
-d. .../plugins/epan/mate/mate_grammar.lemon

By specifying the full path to "lemon" we ensure it is
always searched and found in the correct location.
2021-08-31 19:19:05 +00:00
Chuck Craft eaa2cf0c21 Cmake: misplaced quote in epub asciidoctor_opts
Follow up to !3988
2021-08-29 11:21:54 +00:00
Gerald Combs 8c4543373a CMake: Use "'" instead of "’" in our guide filenames.
Use an apostrophe instead of RIGHT SINGLE QUOTATION MARK in our PDF and
EPUB filenames. Some programs (notably Okular) can't open filenames with
extended characters, at least on Windows.
2021-08-27 01:18:13 +00:00
Pascal Quantin 1b61474d9d CMake: include CheckFunctionExists in FindKERBEROS.cmake 2021-08-10 17:46:40 +02:00
Gerald Combs a6e0482a6f Docs: Give the PDF and EPUB guides descriptive filenames.
Use the document title for our PDF and EPUB filenames under the theory
that "Wireshark User’s Guide.pdf" is more obvious than "user-guide.pdf".
2021-08-03 22:18:06 +00:00
Gerald Combs b58edf3cb8 Docs: Add epub targets for the guides.
Add user_guide_epub and developer_guide_epub targets that generate
EPUB versions of the User's Guide and Developer's Guide.
Ping #17494.
2021-07-30 21:05:37 +00:00
João Valverde c0ae696253 CMake: Remove some unused definitions 2021-07-23 21:23:00 +01:00
Stefan Metzmacher 94ac641efa packet-kerberos: implement PAC Ticket checksum verification
We use some private functions from MIT kerberos:
- krb5_free_enc_tkt_part()
- decode_krb5_enc_tkt_part()
- encode_krb5_enc_tkt_part()
but we already do that for krb5int_c_mandatory_cksumtype(),
which is newer than the above functions.

We use all of them only under HAVE_KRB5_PAC_VERIFY,
so we don't seem to need additional configure tests.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2021-07-15 04:52:30 +00:00
Gerald Combs 8834b470d0 CMake: Fixup SpanDSP's TIFF includes.
Add TIFF_INCLUDE_DIR to SPANDSP_INCLUDE_DIRS, but only if TIFF has been
found.

Ping #17477.
2021-07-14 09:10:09 -07:00
Gerald Combs cdd6f2ec80 CMake+docs: Use Asciidoctor.js if it's available.
Add the executables shipped by the Asciidoctor.js project to
FindAsciidoctor.cmake, and update the Developer's Guide to match.
2021-06-23 05:28:55 +00:00
Gerald Combs 4609bc4ad5 CMake: Mark our plugin include directories PRIVATE.
Use target_include_directories to mark our local include directories
PRIVATE, similar to what we do elsewhere.
2021-06-22 22:17:42 +00:00
Gerald Combs b86ec10ca4 CMake: Fixup our glibconfig.h discovery.
On Windows, search for glibconfig.h in the vcpkg lib directory. Search
for it in the directory that contains libglib-2.0 on other platforms.
Avoid a side effect that caused us to search in `/lib` on non-Windows
platforms. Don't add GLIB2_LIBRARY to the search path -- that contains
the path to a file, not a directory.
2021-06-11 11:22:11 +00:00
Gerald Combs 6357f46bc6 Windows: Update GLib to 2.66.4.
Upgrade our vcpkg bundle to one that includes GLib 2.66.4 and libxml2
2.9.10.

Avoid running pkgconfig on Windows so that we don't find Strawberry
Perl's headers.
2021-06-10 03:48:28 +00:00
Gerald Combs 6bfab69d14 Windows: Switch from HTML Help to plain HTML.
Switch from HTML Help to plain HTML files. In the NSIS and WiX installers,
place the help assets in a directory with a friendly name.
2021-06-04 08:57:32 +00:00
João Valverde 9b13c4352d epan: Add SMI version 2021-05-25 20:10:37 +01:00
Tomasz Moń 4bd5830cda CMake: Add ENABLE_VLD option for MSVC
Calling cmake with -DENABLE_VLD=ON when building with Visual Studio,
results in debug configuration being linked to Visual Leak Detector.
By default, Visual Leak Detector outputs the leak summary to Visual
Studio debug window. When ENABLE_VLD is active, VLD is linked to all
wireshark libraries and executables.
2021-04-10 21:53:59 +00:00
João Valverde 7fee50274f Merge the caputils/ and capchild/ directories
The distinction between the different kinds of capture utility
may not warrant a special subfolfer for each, and sometimes the
distinction is not be clear or some functions could stradle
multiple "categories" (like capture_ifinfo.[ch]).

Simplify by having only a generic 'capture' subfolder. The
separate CMake libraries are kept as a way to reuse object code
efficiently.
2021-03-29 06:08:02 +01:00
Guy Harris 0cc59d38ab Replace the Large File Support CMake stuff.
The existing stuff doesn't appear to work (I tried it on 32-bit Ubuntu
18.04, and it did *not* add any flags to the compilation, as it appeared
not to conclude that they were necessary, even though they were).

Pull in the stuff from libpcap, which *does* appear to work.  (it does
so in my 32-bit Ubuntu testing).

This should fix #17301.

While we're at it, fix cppcheck.sh so that it doesn't attempt to run
cppcheck on files that have been deleted.
2021-03-22 12:11:26 +00:00
Peter Wu 2e0dda9e03 CMake: Reduce "Generating plugin.c" noise during the build
With Ninja, the build is unnecessarily noisy:

    [21/81] Generating plugin.c
    Generated plugin.c for l16_mono.
    [22/81] Generating plugin.c
    Generated plugin.c for G711.

Avoid writing `Generated plugin.c for G711` and generate a single line
such as `Generating plugins/codecs/G711/plugin.c` instead.

Do not write the absolute path to plugin.c, this should hopefully help
with reproducible builds that are independent of the build directory.
2021-01-07 10:19:04 +00:00
Pascal Quantin 86e23155fe Windows: upgrade libssh to 0.9.5
Closes #17065
2020-12-09 22:35:25 +00:00
Gerald Combs 3a42bf0de2 Windows: Upgrade brotli, libmaxminddb, lz4, and snappy.
Upgrade brotli to 1.0.9, libmaxminddb to 1.4.3, lz4 to 1.9.2, and snappy
to 1.1.8.
2020-12-01 08:32:44 +00:00
Gerald Combs f21cd2e23f wiretap: Convert ascend.y to Lemon.
Convert wiretap/ascend.y.in from Bison/YACC to Lemon and rename it to
wiretap/ascend_parser.lemon. Tighten up some of our scanning and
parsing. Make the indentation in it and related files consistent. Aside
from the recent IPv4 fragment offset changes, this produces identical
output to the 3.4 branch for the Ascend trace files I have here.

Remove the comment about supporting other commands. Another timeline
might have an Ascend that successfully pivoted to DSL or 15625B+1D
gigabit ISDN, but this one has neither.

This was our last/only Bison/YACC file, so remove Bison/YACC as a
development and packaging dependency and remove references to it from
the documentation.
2020-11-30 08:15:43 +00:00
João Valverde a76c11e290 CMake: Make pkg-config functions quiet 2020-10-19 16:10:33 +00:00
Gerald Combs 1a244f9de5 CMake: Configure our .y files for different Bison/YACC flavors.
Bison 3.4 and later generate deprecation warnings for the "%pure-parser"
directive. As https://git.savannah.gnu.org/cgit/bison.git/tree/NEWS says,

----
** Deprecated features

  The %pure-parser directive is deprecated in favor of '%define api.pure'
  since Bison 2.3b (2008-05-27), but no warning was issued; there is one
  now.  Note that since Bison 2.7 you are strongly encouraged to use
  '%define api.pure full' instead of '%define api.pure'.
----

Rename our .y files to .y.in, and modify FindYACC.cmake to detect newer
versions of Bison and configure our .y files with "%pure-parser" or
"%define api.pure" as needed. Squelches warnings from Bison in #16924.
2020-10-19 08:46:32 -07:00
Lin Sun 6136c719da RTP: opus playback
It's possible to play opus payload with libopus (https://opus-codec.org/).
Closes #16882.

Helped-by: Pascal Quantin <pascal.quantin@gmail.com>
Signed-off-by: Lin Sun <lin.sun@zoom.us>
Signed-off-by: Yuanzhi Li <ryanlee@mail.ustc.edu.cn>
2020-10-03 21:15:09 +00:00
João Valverde fd7739de6b CMake: Fix libssh >= 0.9.5 version detection
libssh 0.9.5 moved version macros to a different header file.

Closes #16845
2020-09-12 16:38:01 +01:00
Gerald Combs 6b4fae1a0b Windows: Switch from the WpdPack SDK to vcpkg's libpcap.
Switch from WinPcap's WpdPack SDK to a libpcap package built with vcpkg.
We explictly load wpcap.dll on Windows, so make sure we don't link with
pcap.lib.

Move timestamp code from capture-pcap-util-unix.c to
capture-pcap-util.c. Add timestap routines to capture-wpcap.c and make a
couple of other updates.

Change-Id: If0e3dbeb7378c42ed9e3f91b2f15add95d22a2bb
Reviewed-on: https://code.wireshark.org/review/37905
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>
2020-07-21 04:33:13 +00:00
Gerald Combs c0bb2c4e5b FindWinSparkle.cmake: Fix a comment.
Change-Id: If31ec4f771a8576b91005852d7443248b4be08f5
Reviewed-on: https://code.wireshark.org/review/37906
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-07-19 19:47:21 +00:00
Guy Harris 9296677472 extcap: assume we're using libssh 0.6 or later.
We require 0.6 or later in CMakeLists.txt, and both ssh_version() and
LIBSSH_VERSION having to be fed to SSH_STRINGIFY() date back before 0.5,
so just assume ssh_version() is available and LIBSSH_VERSION has to be
fed to SSH_STRINGIFY().

Change-Id: I4f62a720424383f88e0410cad07dbe67d0c69297
Reviewed-on: https://code.wireshark.org/review/37881
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-07-16 09:26:43 +00:00
Guy Harris a1d2d18cb8 extcap: get the libssh version string from the libssh.h header.
Thanks, libssh developers, for making it so straightforward!

This means we don't need to construct it in the CMake module that finds
libssh.

Change-Id: I6c173bf7c0671dfdfac423a7d01ecced7b69e851
Reviewed-on: https://code.wireshark.org/review/37878
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-16 08:18:58 +00:00
Guy Harris dccc382b4f Show the version of libssh being used, if possible.
If we have ssh_version(), then ssh_version(0) will return a string for
the version being used.

Change-Id: I0717f6d4d5c3fa04aa7938dc6bc0d4c8abfa95fd
Reviewed-on: https://code.wireshark.org/review/37875
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-07-15 23:43:22 +00:00
Dario Lombardo f793923a12 extcap: add libssh version info to sshdump and ciscodump.
Change-Id: I1e13cc3471e37514a0dd181abd4938607a057ec6
Reviewed-on: https://code.wireshark.org/review/37870
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-15 18:59:10 +00:00
Stefan Metzmacher 738e73a50e packet-kerberos: add support for decrypting KRB5 FAST messages
Currently this is only available for MIT Kerberos, but it
should be possible to implement the same using
krb5_crypto_fx_cf2() from Heimdal.

Change-Id: Ic3327dfde770f9345485bf97e2ac6045b909b64e
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/36472
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-05-26 11:42:42 +00:00
João Valverde 3a32757313 CMake: Fix FindGLIB2 for saner output
Apparently FindPackageHandleStandardArgs uses if(DEFINED ...) to test
VERSION_VAR, for somewhat obscure reasons. If we didn't find a suitable
GLib package we must not define GLIB2_VERSION, otherwise the status
output is confused and just generally wrong.

Change-Id: Iad4012e69a7c641c50d1e399bbfdb51583cb3b40
Reviewed-on: https://code.wireshark.org/review/36990
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>
2020-05-01 19:44:12 +00:00
Gerald Combs b7ea495e2e CMake: Increase our AsciidoctrJ JVM memory limits.
One of the builds recently failed with:

         Generating user-guide.pdf
         Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded

Change-Id: I542a39880dffcd3d7bbaec1a180c605b3011c2e2
Reviewed-on: https://code.wireshark.org/review/36966
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>
2020-04-29 03:34:56 +00:00
Pascal Quantin 02ef284140 CMake: fix another Windows specific warning reported by CMake 3.17
Newer version of CMake complains with warnings like the one below:

The package name passed to `find_package_handle_standard_args` (POWERSHELL)
does not match the name of the calling package (PowerShell).  This can lead
to problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.

Change the capitalization of the variables to match the filename.

Change-Id: I5bd763add92e9e279f8e28f31576acb5b9ea7776
Reviewed-on: https://code.wireshark.org/review/36833
Petri-Dish: Pascal Quantin <pascal@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
2020-04-13 20:41:30 +00:00
Gerald Combs fcd51deb99 Docbook: Fix an unterminated tag, other updates.
Remove nested example tags from the dissection chapter, including and
unbalanced one. Mark our source blocks with [source,c].

Enable syntax highlighting in the Developer's and User's guides. This
isn't supported in the DocBook backend (which we use to generate the
HTML guides), but it is in the PDF backend.

Add a comment about failing on warnings when we generate our guides.

Change-Id: Ieee29fe75364ca23769aa997f90126e31b72cc8b
Reviewed-on: https://code.wireshark.org/review/36767
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-04-09 22:07:57 +00:00
Pascal Quantin f48a62f4ef CMake: fix some warnings reported by CMake 3.17
Newer version of CMake complains with warnings like the one below:

The package name passed to `find_package_handle_standard_args` (MINIZIP)
does not match the name of the calling package (Minizip).  This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.

Change the capitalization of the variables to match the filename.

Change-Id: Ic3c88f33f5a2bfeba3fa3479df60210e67d25ff0
Reviewed-on: https://code.wireshark.org/review/36695
Petri-Dish: Pascal Quantin <pascal@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-05 07:56:57 +00:00
Pascal Quantin 2ba42a047e CMake: fix detection of Lua development package
See https://www.wireshark.org/lists/wireshark-dev/202003/msg00054.html

Change-Id: I10a854a4dcd5320fce8ca3e6ff5722225c56c5d9
Reviewed-on: https://code.wireshark.org/review/36494
Petri-Dish: Pascal Quantin <pascal@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-19 08:50:29 +00:00
Guy Harris d73c0be3bf Remove trailing whitespace.
Change-Id: I88117a93e64feb310ecd0f9f558656b29b83e815
Reviewed-on: https://code.wireshark.org/review/36384
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2020-03-13 00:07:14 +00:00
Guy Harris 0c889d6f5c Require at least libpcap 0.8/WinPcap 3.1.
2004 called, they want their libpcap/WinPcap back.

RHEL 6 initially shipped with libpcap 1.0; even old Enterprise(TM)
versions of OSes ship with something shinier than 0.7.x these days.

This lets us get rid of a bunch of #ifdefs and workaround code for
missing APIs.

Change-Id: I862cb027418b0a0c0f45a26979acea82f93f833b
Reviewed-on: https://code.wireshark.org/review/36383
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2020-03-13 00:05:07 +00:00
Gerald Combs acaba5ee7e CMake: Fix WinSparkle discovery.
g46b3753d53 changed "ws_find_package(WINSPARKLE ..." to
"ws_find_package(WinSparkle ..." in CMakeLists.txt in order to
fix an issue with case-sensitive folders.

This exposed a different issue in FindWinSparkle.cmake, where we
were passing "WINSPARKLE" to find_package_handle_standard_args. When
successful this would set WINSPARKLE_FOUND, which would in turn *not*
match WinSparkle_FOUND in ws_find_package, which means that we wouldn't
enable automatic updates.

Pass "WinSparkle" to find_package_handle_standard_args instead. Using
a mixed-case package name results in setting both PackageName_FOUND and
PACKAGENAME_FOUND, which fixes our various checks.

Bug: 16381
Change-Id: I46ef98194dc060ad37d9a30bff4d9e905713759e
Reviewed-on: https://code.wireshark.org/review/36079
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>
2020-02-12 13:42:38 +00:00
Guy Harris 20e9652179 Check for liblua-{version} as well as liblua{version}.
FreeBSD packages install liblua-{version}.

Change-Id: Ib28d2032a13baff9da42d61e3054a8b8e64b5cc9
Reviewed-on: https://code.wireshark.org/review/35994
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2020-02-01 00:40:56 +00:00
Jirka Novak 12a13a6926 RTP: decode iLBC payload
It is possible to decode iLBC payload. It uses libilbc library (https://github.com/TimothyGu/libilbc).

Bug: 16314
Change-Id: Id4cad7ae32305a0e94ef32beb24e07733d7f834e
Reviewed-on: https://code.wireshark.org/review/35686
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: Pascal Quantin <pascal@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-20 07:50:08 +00:00