Commit Graph

2918 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
Gerald Combs eb5d17f2bc Windows: Upgrade libpcap, lz4, nghttp2, and snappy.
Upgrade libpcap to 1.10.1, lz4 to 1.9.3, nghttp2 to 1.44.0, and snappy
to 1.1.9.
2021-09-29 18:14:52 -07:00
Brian Sipos abd0f1183f COSE dissector from dtn-wireshark project 2021-09-29 08:51:13 +00:00
Martin Mathieson a156d7d05d Fix some spelling errors. 2021-09-28 09:50:58 +00:00
Tomasz Moń 7b82110092 USB HID: Parse bit fields with correct bit order
Implement little endian support for tvb_get_bits family of functions.
The big/little endian refers to bit numbering within an octet. In big
endian, the most significant bit is considered bit 0, while in little
endian the least significant bit is considered bit 0.

Add encoding parameters to proto tree bits format family functions.
Specify ENC_BIG_ENDIAN in all dissectors using these functions except in
USB HID that requires ENC_LITTLE_ENDIAN to work correctly.

When formatting bits values, always display most significant bit on the
leftmost position regardless of the encoding. This results in no gaps
between octets and makes the displayed value comprehensible.

Close #4478
Fix #17014
2021-09-26 18:16:28 +02:00
Martin Mathieson b84aa6b243 Fix some spelling errors. 2021-09-23 21:22:46 +00:00
Guy Harris 624ed977cb validate-clang-check: add yet another Windows-only file. 2021-09-23 03:39:11 -07:00
Martin Mathieson 543ea3968c ethercat: Fix some too-wide mask widths.
N.B. Some other issues spotted have been reported in
https://gitlab.com/wireshark/wireshark/~/issues/17605
2021-09-21 11:04:31 +01:00
João Valverde 8726c65267 win-setup.ps1: Be more lax about validating path separators
CMake file(TO_NATIVE_PATH) doesn't do the right thing on MinGW[1],
but Windows supports backslash and forward slash.

[1]https://gitlab.kitware.com/cmake/cmake/-/issues/5939
2021-09-20 14:38:03 +01:00
Martin Mathieson dd667dddf0 Some spelling fixes 2021-09-18 20:52:04 +00:00
João Valverde 8df2a73594 Use the musl in-tree getopt_long() everywhere
Besides the obvious limitation of being unavailable on Windows,
the standard is vague about getopt() and getopt_long() has many
non-portable pitfalls and buggy implementations, that increase
the maintainance cost a lot. Also the GNU libc code currently
in the tree is not suited for embedding and is unmaintainable.

Own maintainership for getopt_long() and use the musl implementation
everywhere. This way we don't need to worry if optreset is available,
or if the $OPERATING_SYSTEM version behaves in subtly different ways.

The API is under the Wireshark namespace to avoid conflicts with
system headers.

Side-note, the Mingw-w64 9.0 getopt_long() implementation is buggy
with opterr and known to crash. In my experience it's a headache to
use the embedded getopt implementation if the system provides one.
2021-09-17 00:43:54 +01:00
Chuck Craft 5b4c7e1c46 NEWS: multiple list indentation levels (nested lists) 2021-09-16 16:27:11 +00:00
Uli Heilmeier 2de4d40e22 setup-macos-brew: Extend to build dmg
Extend the script to be able to build a dmg bundle
2021-09-16 09:56:36 +00:00
Gerald Combs 55a67fd66a Tools: Migrate compress-pngs.sh to Python.
Migrate compress-pngs from a Bash script that ran Make to a Python
script, which should be usable on more platforms.

Add Efficient Compression Tool (ect) to the list of compressors.

Add the compressors to the various *-setup.sh scripts, but comment them
out for now.
2021-09-13 11:00:04 -07:00
Guy Harris 21339ceed0 make-pci-ids.py: make it executable.
It's a #! script, so it should be runnable from the command line without
explicitly running Python on it.
2021-09-11 10:21:05 +00:00
Guy Harris 76b08ea083 Fix spelling errors.
The Ubuntu build commented on some spelling errors in executable code
files.  Fix the errors that don't come from external files containing
the spelling errors (USB product and vendor IDs, PCI IDs, ASN.1
specifications), and fix some errors that don't show up in the
executable code files (e.g., in comments and variable names).
2021-09-11 10:01:27 +00:00
Guy Harris d4ed129727 pre-commit: skip some checks on idl2wrs.c.
Some checks intended for dissectors don't work well on dissector
*generators*, as they see stuff such as "value_string %s[]" in a format
string used to generate dissector code and get upset because the
purported value_string doesn't end with {0, NULL} (the generator *does*
put a {0, NULL} at the end, but the checker isn't clever enough to
figure that out).
2021-09-11 02:42:51 -07:00
Pascal Quantin 530ee0b365 Windows: upgrade Npcap to 1.55 2021-09-07 23:18:19 +02:00
Martin Mathieson fb02f423b1 Some spelling fixes 2021-09-03 22:45:06 +00:00
Alexis La Goutte bbcedb667c clang-check(tools): exit when set illegal option
and not when pass -c parameter, it is break some part of gitlab-ci (Clang Builder)
2021-09-02 16:06:17 +00:00
Evan Huus cdfab0d6e9 tvbuff: convert helper methods to pinfo->pool
A few of them just needed scratch memory, so allocate and free it
manually after doing any exception-raising checks.

A few others were returning memory, and needed conversion to accept a
wmem scope argument.
2021-09-01 03:54:52 +00:00
Adrian Ratiu 61e66c37ab cmake: lemon: allow overriding lemon CC setting
When cross-compiling wireshark the lemon tool should be built
using the host machine compiler to be run on the host. Before
cmake this was done via autotools CC_FOR_BUILD but cmake only
supports one compiler toolchain per build and requires some
workarounds like running cmake twice using separately defined
toolchains.

This gets ugly and complicated fast when considering multiple
toolchains, especially for a simple tool like lemon, so just
allow builds to override the C compiler and wipe the cflags.

This way systems like Gentoo/ChromeOS/Yocto with a properly
setup cross-compile environment can just point to the native
BUILD_CC or similar while minimizing complexity.
2021-08-31 19:19:05 +00:00
Martin Mathieson 70e26d691e Some spelling fixes. 2021-08-27 22:21:40 +00:00
Guy Harris d42ac7b4b5 check_tfs: we want os.path.commonprefix, not os.path.commonpath. 2021-08-25 01:24:31 -07:00
Guy Harris 9941c00a0f check_tfs: don't require plugins to use tfs.c true_false_strings.
To quote the comment in plugins/epan/gryphon/packet-gryphon.c, "Note:
using external tfs strings doesn't work in a plugin", so, for plugins,
don't check to make sure that the file doesn't define a
true_false_string that's the same as one defined by tfs.c.
2021-08-25 07:31:56 +00:00
Michael Tuexen 3d7729c6b3 tools: use glib version 2.68.4 on MacOS 2021-08-24 19:23:49 +00:00
Martin Mathieson d3b016a365 Remove trailing colons from item label names
This is a new check added to check_typed_item_calls.py --label

Ignoring cases where item type is FT_NONE, as fpr tjpse
text was appended that otherwise would lack a colon.
2021-08-23 08:32:56 +00:00
Martin Mathieson 927690e883 Fix some docbook spellings. 2021-08-20 10:43:01 +00:00
Gerald Combs 2683508b38 Windows: Upgrade c-ares to 1.17.2. 2021-08-15 18:45:33 +00:00
Martin Mathieson 545eab808e Fix some item label names with unbalanced parens/braces/brackets
Spotted by new check added to check_typed_item_calls.py --label
2021-08-14 21:24:13 +01:00
Martin Mathieson c0faa8f1da Some more dissector spellings. 2021-08-08 22:21:38 +01:00
Martin Mathieson 03c3c9a056 check_typed_item_calls: Add some ptvcursor_add...() calls
Fix up some NFAPI calls.
2021-08-08 17:47:42 +01:00
Jaap Keuter 9a35314d79 Generate a valid source file, with a newline at the end 2021-08-05 14:05:22 +00:00
Martin Mathieson 73a4ada071 A few documentation spelling fixes. 2021-08-02 17:40:55 +01:00
Martin Mathieson 6d02f1dcf9 Check scripts: split issues into errors and warnings
For CI, will now return error codes only for those issues
that are definitely bugs that will require fixing. i.e.

- if the type is not compatible with the call

- if a TFS is (case-sensitively) identical to a tfs.c entrywq
2021-07-31 16:06:32 +01:00
Guy Harris cc84bebcdc macos-setup: add the deployment flags when configuring with Meson.
We add them when configuring with autotools, so that we build GLib
appropriately for the OS versions we're targeting; do the same when
configuring with Meson.
2021-07-30 19:20:13 -07:00
Guy Harris 856c4f3af6 macos-setup: generate a .pc file for libffi if we have it.
If this version of macOS comes with a version of libffi, generate a .pc
file for it and install it in /usr/local/lib/pkgconfig, so that
pkg-config finds that version of libffi, and the GLib configuration
process - whether it's done with autotools or Meson - doesn't decide
that there is no libffi and fail or install its own libffi or whatever.
2021-07-30 18:54:04 -07:00
Guy Harris c8e17d7835 macos-setup: cleanups.
If we're running an external Python 3 package, pip3 will install scripts
in some directory under /Library; set MESON to point to the location
where Meson will be installed, and use that.

Have a meson-done file to indicate that Meson's been installed by us,
and uninstall it only if that's present.
2021-07-30 03:45:41 -07:00
Guy Harris 2fd29240c8 macos-setup: test whether /usr/bin/python3 works, not python3 in general.
We want to check whether *Apple* provides Python 3, not whether there's
a Python 3 installed; if there is no Apple-provided Python 3, but
there's somebody else's Python 3 installed, leave it alone, don't
uninstall it.
2021-07-29 14:50:10 -07:00
Guy Harris cc34e1c406 macos-setup: install and use Meson+Ninja to build newer versions of GLib.
Newer versions of GLib require Meson (they don't support autotools) and
Ninja (they use Ninja rather than Make).  Install Meson and, based on
the GLib version, use autotools+make or Meson+Ninja to build GLib.

Move up the installation of Python 3 so that it's available when we
install Meson, as Meson requires Python 3 and is installed with pip3.
2021-07-29 14:06:58 -07:00
Guy Harris c263b0a13e macos-setup: if Xcode provides Python 3, use it.
Only install an external Python 3 if /usr/bin/python3 doesn't work; on
at least some versions of macOS, /usr/bin/python3 is a wrapper to run
Python 3 from Xcode, and at least some versions of Xcode provide Python
3.
2021-07-29 19:44:20 +00:00
Martin Mathieson d34d1a1e13 More fussing with masks.
Mostly longer masks with odd numbers of digits.
2021-07-29 10:15:58 +00:00
Guy Harris c4d3716ce8 macos-setup: install the current version of Ninja.
1.10.2 is the latest version, and is the first version to ship as a fat
x86-64/ARM64 binary, so that we have native binaries for both platforms
supported by macOS.
2021-07-27 00:26:28 -07:00
Martin Mathieson a7b5eec265 check_typed_item_calls.py: check add_bitmask() functions 2021-07-26 10:31:15 +00:00
Martin Mathieson a975ef7203 check_typed_item_calls.py: Add a check for all-zeroes mask
When the mask value is 0x0, it effectively means there is no
mask, and that all bits count.

Fix found instances and replace them with 0x0.
2021-07-24 10:58:15 +00:00
Evan Huus d6d7dd1e56 First pass pinfo->pool conversion
Automated find/replace of wmem_packet_scope() with pinfo->pool in all
files where it didn't cause a build failure.

I also tweaked a few of the docs which got caught up.
2021-07-21 05:38:29 +00:00
Martin Mathieson 86e2fda11e check_typed_item_calls: fix typo 2021-07-11 17:15:44 +01:00
Martin Mathieson 030d659f88 More mask checks and some fixes. 2021-07-11 14:55:55 +00:00
João Valverde d48c7e9305 make-version.pl: Remove duplicate "-f" option 2021-07-09 22:25:20 +01:00
João Valverde ffcfc83ecb Rename version.h to be more descriptive
Version.h is too generic. This is specific to VCSVERSION and that
should be made more obvious and discoverable.
2021-07-09 18:27:41 +00:00
Martin Mathieson 9e5d051a8a check_typed_item_calls.py Some more mask checks
Fix a handful of (trivial) issues found.
2021-07-08 13:02:18 +00:00
Martin Mathieson 3dd7ba03fa tools/check_typed_item_calls.py: Add extra mask checks 2021-07-07 10:00:45 +01:00
Martin Mathieson 43077b96e8 Fix a few dissector spelling errors. 2021-07-06 07:52:21 +00:00
Pascal Quantin fa21433c35 Windows: upgrade Npcap to 1.50 2021-06-26 13:16:49 +02:00
João Valverde 3fb7a6e0d5 checkAPIs: __func__ is now part of C99, allow it 2021-06-25 22:06:32 +00:00
Chuck Craft 54baebad48 Lua: reconcile expert info groups; add PI_ASSUMPTION 2021-06-21 15:27:51 +00:00
Joerg Mayer 5fc88c671a Strip comment lines before validating format
Fixes the problem that a one line commit message followed by the default
comment lines was rejected.
2021-06-11 16:46:13 +02: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
Martin Mathieson 8775e2c694 check_static.py: remove unused option 2021-06-08 10:47:59 +01:00
Martin Mathieson abf3c0f2f9 Add some spelling words.
Fix one iee80211 typo.wq
2021-06-06 18:47:38 +01:00
Anders Broman e64bad71be Diameter: Update AVPs from 3GPP TS 29.272 V16.4.0
Amend the xml checking script to exlude one more AVP from the check and
make it easy to add more to the list.
 Courtesy of Christopher Maynard.
2021-06-03 15:49:38 +02:00
Joerg Mayer bf33998a30 Add missing space before ']' 2021-05-30 18:51:02 +02:00
Michael Tuexen 96aa5d9b68 macos-setup.sh: update sparkle 2021-05-29 01:41:15 +02:00
Michael Tuexen a889e8e04b macos-setup.sh: improve arm support
Disable on arm the usage of assember code in nettle and sbc, since this
doesn't compile (yet) on arm platforms.
2021-05-27 14:18:45 +02:00
Michael Tuexen bb327af305 macossetup.sh: fix syntax 2021-05-26 23:21:39 +02:00
Michael Tuexen c1518877fa macossetup.sh: whitespace fix 2021-05-26 23:20:44 +02:00
John Thacker 9bd450f507 macos: Update Python
Update Python from 3.9.3 to 3.9.5, since 3.9.3 was recalled due
to unintentional ABI compatiblity breakage:
(https://bugs.python.org/issue43710)
2021-05-26 03:50:03 +00:00
David Perry 162cba438d Don't try to install qt5-default
As of Debian bullseye and Ubuntu 21.04, `qt5-default` is no longer
available. This patch removes it and adds its dependencies instead
as suggested in <https://askubuntu.com/a/1335187/580576>.
2021-05-14 21:31:26 +00:00
Odysseus Yang c4b32c8f46 ETWDUMP: Update to support live capture
etwdump will read events from a live session with the params as the filter, also the params can be used as filter when reading from a etl file.
2021-05-13 21:17:09 +00:00
Gerald Combs dacbfc4ae9 Tools: Try to exit more gracefully from fuzzing.
If we catch a signal while we're fuzzing, exit with a successful status
and clean up after ourselves.
2021-05-11 11:07:27 -07:00
Anders Broman 71e6b0498a http: Add dissection of HTTP2-Settings
Closes #17370
2021-05-08 17:14:45 +00:00
Gerald Combs 4266e1e9ba Tools: Show only filenames when fuzzing.
Show only the basename of each capture file when fuzzing, which is less
noisy than the full pathname.
2021-05-07 14:21:09 -07:00
Tomas Kukosa 5af925e013 ITS: fix asn2wrs #.NO_EMIT
asn2wrs accepts #.NO_EMIT using module specific $Module$TypeName identifier
2021-05-06 07:36:08 +00:00
Gerald Combs d7bdd77a4c GitLab CI: Add a minimal fuzzing job.
Add a -t option to tools/fuzz-test.sh which lets you specify a maximum
fuzz time.

Add an initial "fuzz-test" job which fuzzes test/captures/* for 5
minutes. To do: Fuzz longer using our capture menagerie and report
failures.
2021-05-05 16:58:12 +00:00
Rickard Holmberg 4dd71cfbb6 Update to DICOM Edition 2021b 2021-05-03 19:51:19 +00:00
Gerald Combs c603a5f2c1 GitLab CI+tools: Make our clang version configurable.
Track our preferred version of clang using $CLANG_VERSION in
.gitlab-ci.yml. Update validate-clang-check.sh to accept a clang
version.
2021-04-30 21:32:00 +00:00
Guy Harris 4e9d2be9ae validate-clang-check: fix extracting the file basename. 2021-04-28 11:35:31 -07:00
Guy Harris 0d12050e5e validate-clang-check: fix some issues.
Not all shells support [[ ]] compound commands; it's not in the most
recent Single UNIX Specification I could see, and the
ubuntu-clang-other-tests job is reporting

    tools/validate-clang-check.sh: 18: [[: not found

Don't use [[ ]].

In addition, if you change extcap/etl.c, it tries to run clang-check on
it, but that file builds, and is only built, on Windows, so clang-check
fails dismally on UN*Xes.  Omit it for now.
2021-04-28 10:02:02 +00:00
Martin Mathieson 1b2fdeca13 PTP: Fix a couple of spelling errors 2021-04-27 10:01:37 +00:00
Pascal Quantin 1408db615b Windows: upgrade Npcap to 1.31 2021-04-25 13:08:52 +02:00
Martin Mathieson d75e9f95eb More trivial spellings. 2021-04-20 08:46:16 +00:00
Martin Mathieson 53c67e31e7 NVME: Fix some spellings
Also added some of its words to wireshark_words.txt
2021-04-19 09:24:38 +01:00
Pascal Quantin 0338a7afac Windows: upgrade Npcap to 1.30 2021-04-12 22:54:39 +02:00
Martin Mathieson d06287ec2e Some more spelling fixes.
Changed script to allow recursive search for multi-words.
2021-04-10 22:50:52 +00:00
John Thacker 69244cbb98 macos-setup: Update CMake, Qt, and Python
Update CMake (3.19.7), Qt (5.2.10), and Python (3.9.3) to later bugfix
versions of the current packages. CMake and Python have made tweaks in
the names of the binary packages that support different macOS versions.

Fixes downloading Python 3.9.2+ on macOS 11 after the package suffix
changed from -macos11.0.pkg to -macos11.pkg

Warn about the lack of Qt offline installers for version 5.15 and
greater.
2021-04-05 00:41:41 +00:00
Martin Mathieson dff0f997de check_static.py check symbols that could be static.
As discussed at
https://www.wireshark.org/lists/wireshark-dev/202101/msg00056.html
2021-04-03 18:19:00 +00:00
Martin Mathieson e83ee9b66a Add more common words to spelling dict. 2021-04-03 17:06:35 +00:00
Pascal Quantin 51170b91d2 asn2wrs.py: prevent adding several times BASE_VAL64_STRING
Fixes ITS dissector generation from ASN.1 description
2021-04-01 20:49:43 +00:00
Guy Harris 828b43491c macos-setup: the current Python is 3.9.2.
While we're at it, capitalize "Arm".  (That's how Arm Ltd. is spelling
it now, even in the architecture versions, e.g. "Armv8-A".)
2021-03-26 21:32:31 -07:00
Dario Lombardo f96886ebef
tools: add g_memdup to prohibited APIs. 2021-03-25 15:53:27 +01:00
Martin Mathieson 4981b10d0b Add a commit-msg that may be installed to verify commit msg line length. 2021-03-23 09:09:19 +00: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
Guy Harris b61fd6d76a dfilter, ftypes: get rid of FT_PCRE.
It's not a valid field type, it's only a hack to support regular
expression matching in packet-matching expressions.

Instead, in the packet-matching code, have a separate syntax tree type
for Perl-compatible regular expressions, and a separate instruction to
load one into a register, and have the "matching" operator for field
types take a GRegex * as the second argument.
2021-03-21 03:27:44 -07:00
Pascal Quantin f6e0de60db Windows: upgrade Npcap to 1.20 2021-03-17 20:46:52 +00:00
Guy Harris 5f0dc153dd debian-setup: include GCC and G++ in the basic list.
At least on my just-now-installed Kubuntu 20.04 VM, G++ wasn't installed
by default, and you need that to compile Wireshark (you can avoid it if
you're not building the GUI code, but the GUI code is Qt-based, so it's
in C++).  Add both GCC and G++ to the basic list.
2021-03-14 21:38:36 -07:00
Gerald Combs d23b0b82c4 GitLab CI: Fix our debian-stable version.
Run tools/make-version.pl in the build:debian-stable job.

Make sure make-version.pl updates debian/control correctly.
2021-03-13 16:36:35 +00:00
Dario Lombardo 686f141e2c tools: add more packages to brew script. 2021-03-10 16:28:16 +00:00
Gerald Combs 4b07a92103 Windows: Update our spandsp packages.
Use the versions of lrint and lrintf defined by Visual C++. This should fix

    91>C:\buildbot\builders\wireshark-master-64\wireshark-win64-libs\spandsp-0.0.6-win64ws\include\spandsp/fast_convert.h(320,5): error C2169: 'lrint': intrinsic function, cannot be defined (compiling source file C:\buildbot\builders\wireshark-master-64\windows-2019-x64\build\plugins\codecs\G726\G726decode.c) [C:\buildbot\builders\wireshark-master-64\windows-2019-x64\build\cmbuild\plugins\codecs\G726\g726.vcxproj]
    91>C:\buildbot\builders\wireshark-master-64\wireshark-win64-libs\spandsp-0.0.6-win64ws\include\spandsp/fast_convert.h(325,5): error C2169: 'lrintf': intrinsic function, cannot be defined (compiling source file C:\buildbot\builders\wireshark-master-64\windows-2019-x64\build\plugins\codecs\G726\G726decode.c) [C:\buildbot\builders\wireshark-master-64\windows-2019-x64\build\cmbuild\plugins\codecs\G726\g726.vcxproj]

for Visual C++ 16.9.1 and later.
2021-03-09 14:51:32 -08:00
João Valverde f13fd55663 rpm-setup.sh: Fix typo 2021-03-05 16:40:28 +00:00
João Valverde 7f105d3981 CMake: Use CheckAPI's abort/termoutput with dissectors only
I believe this was the original intention, to use these API restricitons
with dissectors only (not that I necessarily agree with that policy either),
and through copy-paste and lack of clear guidelines it spread to other
parts of the build.

Rename the checkAPI groups to make it very clear that this is dissector-only.

This doesn't mean, of course, that good programming practices shouldn't be
followed everywhere. In particular assertions need to be used properly.
Don't use them to catch runtime errors or validate input data.

This commit will be followed by another removing the various ugly hacks
people have been using to get around the checkAPI hammer.
2021-03-01 20:59:39 +00:00
Joerg Mayer 92b3edd798 macos-setup.sh: Starting with major 11, the minor SDK version no longer matters 2021-02-25 07:09:54 +00:00
Martin Mathieson cd77e5aa5f Some more spelling fixes.
Also add more words to dictionary file.
2021-02-21 09:59:04 +00:00
John Thacker 94488fc509 macos-setup: Require Qt 5.6 or later and macOS 10.8 or later
The minimum required version of Qt is now 5.6, and thus the minimum
required version of macOS is 10.8. Reflect that in macos-setup, and
remove version checks and older packages installed to support
Snow Leopard and Lion.
2021-02-20 19:17:31 +00:00
Darius Davis c9423a9a13 Fix some spelling errors and update word list.
Celcius -> Celsius.

ammendment, framenun and untunelled (with one 'n') are in wireshark_words.txt
but do not seem to be present in our codebase anymore (and are not
correctly-spelled words), so AFAIK they can be removed from the list.

Added a handful of words which don't seem to be in the dictionary on my host
but are real words and are in the codebase.

Removed two contractions which are now handled within tools/check_spelling.py .
2021-02-18 07:01:23 +00:00
Gerald Combs 99ef1b2643 make-manuf updates.
Strip A.S. and oü, similar to other business types. Strip forward
slashes as well, including A/S.

Change-Id: Icf436f8663dc9cddf220642913eea7a60285ebc1
2021-02-17 14:21:41 -08:00
Guy Harris a7256d50b5 wiretap: more work on file type/subtypes.
Provide a wiretap routine to get an array of all savable file
type/subtypes, sorted with pcap and pcapng at the top, followed by the
other types, sorted either by the name or the description.

Use that routine to list options for the -F flag for various commands

Rename wtap_get_savable_file_types_subtypes() to
wtap_get_savable_file_types_subtypes_for_file(), to indicate that it
provides an array of all file type/subtypes in which a given file can be
saved.  Have it sort all types, other than the default type/subtype and,
if there is one, the "other" type (both of which are put at the top), by
the name or the description.

Don't allow wtap_register_file_type_subtypes() to override any existing
registrations; have them always register a new type.  In that routine,
if there are any emply slots in the table, due to an entry being
unregistered, use it rather than allocating a new slot.

Don't allow unregistration of built-in types.

Rename the "dump open table" to the "file type/subtype table", as it has
entries for all types/subtypes, even if we can't write them.

Initialize that table in a routine that pre-allocates the GArray before
filling it with built-in types/subtypes, so it doesn't keep getting
reallocated.

Get rid of wtap_num_file_types_subtypes - it's just a copy of the size
of the GArray.

Don't have wtap_file_type_subtype_description() crash if handed an
file type/subtype that isn't a valid array index - just return NULL, as
we do with wtap_file_type_subtype_name().

In wtap_name_to_file_type_subtype(), don't use WTAP_FILE_TYPE_SUBTYPE_
names for the backwards-compatibility names - map those names to the
current names, and then look them up.  This reduces the number of
uses of hardwired WTAP_FILE_TYPE_SUBTYPE_ values.

Clean up the type of wtap_module_count - it has no need to be a gulong.

Have built-in wiretap file handlers register names to be used for their
file type/subtypes, rather than building the table in init.lua.

Add a new Lua C function get_wtap_filetypes() to construct the
wtap_filetypes table, based on the registered names, and use it in
init.lua.

Add a #define WSLUA_INTERNAL_FUNCTION to register functions intended
only for internal use in init.lua, so they can be made available from
Lua without being documented.

Get rid of WTAP_NUM_FILE_TYPES_SUBTYPES - most code has no need to use
it, as it can just request arrays of types, and the space of
type/subtype codes can be sparse due to registration in any case, so
code has to be careful using it.

wtap_get_num_file_types_subtypes() is no longer used, so remove it.  It
returns the number of elements in the file type/subtype array, which is
not necessarily the name of known file type/subtypes, as there may have
been some deregistered types, and those types do *not* get removed from
the array, they just get cleared so that they're available for future
allocation (we don't want the indices of any registered types to changes
if another type is deregistered, as those indicates are the type/subtype
values, so we can't shrink the array).

Clean up white space and remove some comments that shouldn't have been
added.
2021-02-17 21:54:28 +00:00
Martin Mathieson e5658ccb5c Spell checking script: reduce output.
- Ignore all hex numbers from within strings.
- Add a few more words to dict file
2021-02-17 09:36:23 +00:00
Caleb Chiu 6581899a84 NCSI: Squash commits of NCSI and PCI-IDS
NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b

Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string.
Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b.
Extends NCSI dissection to support Mellanox OEM commands.

NCSI: Use TFS for boolean mapped string and added AEN dissectors

1. Use the tfs defined in tfs.c
2. Refine the boolean mapped strings to be TFS style
3. Added dissectors for AEN

NSCI: Fixed erros with gcc 7.5.0

1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04
2. Sloved complaints of git pre-commit hook

NCSI: Add "0x" prefix for displaying HEX values

There are codes display HEX values without prefix, added "0x" to fix that.

PCI-IDS: Added PCI ID file and python script to convert it to C codes

1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/
2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c

PCI-IDS: Updated the PCI ID list to be Version 2021.01.11

NCSI: Remove trailing spaces and unused href entries

PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c

1. Renamed pci-ids-convert.py to make-pci-ids.py
2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c

PCI-IDS: Move internal structure to C file

1. Move pci_id_t and pci_vid_index_t from header file to C file.
2. Refined the comments of pci-ids.c
3. Renamed local variable index (shadow variable) to idx

PCI-IDS: Refined binary search codes

PCI-IDS: Moved pci-ids.[ch] to epan/

Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
Guy Harris 812c9f5b81 rpm-setup, WSDG: add a --install-rpm-deps option to install rpm-build.
This matches what deb-setup does - it has an --install-deb-deps optionto
install tools necessary to build a .deb.

Document it in the WSDG while we're at it.
2021-02-15 09:48:51 +00:00
Guy Harris 3c404abf2c rpm-setup: install libgcrypt by default.
Wireshark now requires it.
2021-02-15 08:14:14 +00:00
Guy Harris c0711693ab Enable -Wredundant-decls.
Add it to the default list of checks, and fix some errors it causes.
(Sadly, it doesn't work in CLang.)
2021-02-14 14:43:42 -08:00
Guy Harris 1cbafa47b9 wiretap: add a mechanism for built-in modules to have a register routine.
Currently, only pcapng has one, and it does nothing, but this mechanism
will be used more in the future.

Update comments in epan/dissectors/CMakeLists.txt and ui/taps.h while
we're at it.
2021-02-06 17:54:19 -08:00
Gerald Combs 08d3c6a4d3 Add an initial CONTRIBUTING file.
Add a standard CONTRIBUTING file which describes how you can contribute
to Wireshark. Make it Markdown with a .md extension since that's the
default in the GitLab UI and elsewhere.
2021-02-04 01:02:19 +00:00
Guy Harris b2db1517be Oops, put back accidentally deleted blank comment line. 2021-01-30 19:29:59 -08:00
Guy Harris 2c719d4517 Generate plugin.c for tap plugins.
Instead of having the source file containing the top-level registration
routine for the pinfo_stats_tree plugin checked into our repository,
generate it with tools/make-plugin-reg.py, as we do with other plugins.

While we're at it, fix a comment - "DLL" is a Windows term; the
equivalent term in UN*Xes would be "shared object" ("so" or ".so") or
"dynamic library" ("dylib" or ".dylib").
2021-01-30 19:06:22 -08:00
Martin Mathieson aa78bb8546 tools/check_spelling.py: Fix args handling 2021-01-25 12:25:54 +00:00
Moshe Kaplan 748d63712e rdps.py: Use string equality for comparing strings
In Python, `is` is meant for checking object equality,
not string equality. For more info, see
https://docs.python.org/3/reference/expressions.html#is
2021-01-25 11:32:12 +00:00
Moshe Kaplan 31546ad35d check_tfs.py: Avoid duplicating list entries
Avoid duplicating list entries and modifying a list during
iteration.
2021-01-25 11:14:22 +00:00
Moshe Kaplan e69a20f5c8 check_spelling.py: Avoid duplicating list entries
Avoid duplicating list entries and modifying a list during
iteration.
2021-01-25 10:54:31 +00:00
Moshe Kaplan 009ce4b331 check_typed_item_calls.py: Avoid duplicating list entries
Avoid duplicating list entries and modifying a list during
iteration.
2021-01-25 10:08:45 +00:00
Moshe Kaplan 9592d3fee9 check_typed_item_calls.py: Avoid mutating default arguments
Python only creates the default argument once and reuses it for
further invocations. Instead, of mutating the default list,
set the default argument to be None and then create a
list, if needed. For more info, see
https://docs.python-guide.org/writing/gotchas/
2021-01-25 09:27:59 +00:00
Gerald Combs 85a7938925 Qt+tools: Fix most of our lupdate warnings.
Fix various warnings with the following changes:

Pass a list of include directories to lupdate. Fixes:

    ui/qt/proto_tree.cpp:57: Qualifying with unknown namespace/class ::ProtoTree

and similar warnings.

Use QT_TRANSLATE_NOOP instead of QT_TR_NOOP. Fixes:

    ui/qt/lte_rlc_statistics_dialog.cpp:993: tr() cannot be called without context
    ui/qt/lte_mac_statistics_dialog.cpp:911: tr() cannot be called without context
    ui/qt/font_color_preferences_frame.cpp:28: tr() cannot be called without context
    ui/qt/font_color_preferences_frame.cpp:29: tr() cannot be called without context
    ui/qt/font_color_preferences_frame.cpp:30: Discarding unconsumed meta data

Add Q_OBJECT to the class definition. Fixes:

    ui/qt/models/filter_list_model.cpp:120: Class 'FilterListModel' lacks Q_OBJECT macro

The following warnings were not fixed. This might require moving IOGraph
to its own file:

    ui/qt/io_graph_dialog.cpp:320: Qualifying with unknown namespace/class ::IOGraphDialog
    ui/qt/io_graph_dialog.cpp:555: Qualifying with unknown namespace/class ::IOGraphDialog
    ui/qt/io_graph_dialog.cpp:1059: Qualifying with unknown namespace/class ::IOGraphDialog
    ui/qt/io_graph_dialog.cpp:1485: Qualifying with unknown namespace/class ::IOGraphDialog
2021-01-18 16:56:20 +00:00
Martin Mathieson 1979750a78 Spelling: avoid generated files with --commits 2021-01-16 22:59:12 +00:00
John Thacker 4c1e0dd1fb macos-setup: Support uninstall of QT versions 5.[10-14].x 2021-01-16 02:32:04 +00:00
John Thacker d612e19767 macos-setup: Allow installing QT 5.14
Allow QT version 5.14.x to be installed (if specified as a variable
on the command line.) Remove the ability to install 5.2.x, as QT 5.3
has been the minimum required version since the Wireshark 3.4 branch.
Note that QT no longer providers offline installers for the free releases
of 5.15 and later, so we'll have to come up with a different method.
(See http://download.qt.io/archive/qt/5.15/5.15.0/OFFLINE_README.txt
and https://www.qt.io/blog/qt-offering-changes-2020 )
2021-01-11 21:32:22 +00:00
Anders Broman c523356c3b Fix duplicated filter namecated fileter names 2021-01-11 19:20:10 +00:00
John Thacker eff595db67 macos-setup: Update Python for Big Sur and Apple Silicon (arm)
Python 3.9.1 is the first version of Python to support Big Sur and
Apple Silicon (https://www.python.org/downloads/release/python-391/),
and Python 3.7.6 is the last version with a 64-bit/32-bit binary installer
for macOS X 10.6 (Snow Leopard) to 10.8 (Mountain Lion) provided.
2021-01-08 12:04:24 +00:00
Pascal Quantin 15b574de49 LPP: upgrade dissector to v16.3.0 2021-01-07 11:48:43 +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
John Thacker d74bfc569e macos-setup: Update CMake for Apple Silicon
Apple Silicon requires CMake 3.19.2, but the binaries provided
for 3.19.2 only run on MacOS 10.10 and later, so we have more
bifurcation of the CMake we try to install. Get rid of some of
the old 2.x paths to compensate.
2021-01-05 22:00:58 +00:00
Rickard Holmberg 84eeeabde9 Update to DICOM Edition 2020e 2021-01-03 23:23:24 +01:00
John Thacker 3506735f08 macos: Clarify when xz support was added to tar
OS X 10.9 (https://opensource.apple.com/release/os-x-109.html) ships
with libarchive-29, which is compiled with LZMA/xz support; its default
[bsd]tar has xz support.  (Look for HAVE_LIBLZMA in config.h in
https://opensource.apple.com/source/libarchive/libarchive-29/)
OS X 10.8 (https://opensource.apple.com/release/mac-os-x-1084.html)
does not have xz support. Clarify the comment in case in the future
we decide we don't need to install xz-utils once the minimum macOS
version is 10.9 or greater.
2021-01-02 19:44:01 +00:00
Gerald Combs 894a70d079 Remove a bunch of duplicate manuf.tmpl entries.
Update make-manuf.py to print "Skipping duplicate IEEE ..." when the
organization names are the same. Remove duplicates by running

    tools/make-manuf.py | awk '/Skipping duplicate IEEE/ {printf "^%s\t\n", $1 }' > /tmp/duplicates.pat
    grep -v -f /tmp/duplicates.pat manuf.tmpl > manuf.tmpl.new ; mv manuf.tmpl.new manuf.tmpl
2021-01-01 10:27:35 +00:00
Martin Mathieson 41d6deb7c3 Scripts: Check that files exist.
Prompted by seeing an exception when files have been deleted by commits.
2020-12-31 12:02:42 +00:00
Dario Lombardo bf81d7c16a tools: skip deleted files in check_typed_item_calls.
Ref: #17114.
2020-12-30 13:40:01 +00:00
Dario Lombardo 93f6aa2c69 iLBC: fix deprecation type and cast.
Starting from libilbc 3.0.0 the type iLBC_decinst_t has been marked
deprecated.
Other fixes rely on function prototype requiring uint8_t pointer.
2020-12-28 12:45:41 +00:00
Michael Tuexen f918c3372c Bump Qt version to match what is used on the MacOS buildbot 2020-12-27 17:04:13 +01:00
Moshe Kaplan 6bce7b859a Detect and replace bad allocation patterns (more)
Extension of !1413, to improve regex, detect
additional opportunities to replace
`g_malloc` with `g_new`, and fix them.
2020-12-23 14:07:18 +00:00
Dario Lombardo 29b331bf0c make-version: use 0 as number of commits if they can't be obtained.
When running on gitlab-ci, the checkout of the project doesn't give
a complete repo. Then git describe fails at giving the number of commits.
In this case just use 0 instead of NULL.
2020-12-22 17:06:28 +00:00
Moshe Kaplan e16166a74c Detect and replace bad allocation patterns
Adds a pre-commit hook for detecting and replacing
occurrences of `g_malloc()` and `wmem_alloc()` with
`g_new()` and `wmem_new()`, to improve the
readability of Wireshark's code, and
occurrences of
`g_malloc(sizeof(struct myobj) * foo)`
with
`g_new(struct myobj, foo)`
to prevent integer overflows

Also fixes all existing occurrences across
the codebase.
2020-12-22 14:56:38 +00:00
Martin Mathieson e2593e2022 Call add item and tfs checking scripts in ubuntu pipeline
N.B. Neither of these scripts return an error code if issues are found.
2020-12-21 11:46:29 +00:00
Martin Mathieson eef4ba7ed7 More spelling fixes. 2020-12-20 16:31:18 +00:00
Guy Harris f3dc269df6 macos-setup: work around a botch in GLib "make distclean".
[skip ci]
2020-12-19 14:21:15 -08:00
Guy Harris 8b0d19c634 macos-setup: explain why we're running autoreconf on minizip.
[skip ci]
2020-12-18 23:53:47 -08:00
Guy Harris 0cdbdcc5a4 macos-setup: fix the name of the -done file for Minizip.
It's minizip-$installed_minizip_version-done, not
zlib-$installed_minizip_version-done; the tarball is
zlib-$installed_minizip_version.tar.gz, because it's a contributed file
in the zlib package, but we don't use zlib in the name of the -done
file.

[skip ci]
2020-12-18 23:45:28 -08:00
Guy Harris 806f524a10 macos-setup: do "make clean", not "make distclean", for zstd.
It has no configure script, so there's no need for "make distclean", and
the Makefile supplied with it has no "make distclean" rule; just do
"make clean".

[skip ci]
2020-12-18 23:19:40 -08:00
Guy Harris 1949b6a5ee macos-setup: don't configure p11-kit to use libffi.
See comment for an explanation.
2020-12-17 21:45:14 +00:00
Guy Harris 2db0c64034 macos-setup: remove tabs.
Consistenly use spaces for indentation.
2020-12-17 12:43:43 -08:00
Guy Harris ca13c3ce49 macos-setup: get rid of a debugging "set -x". 2020-12-16 23:23:13 -08:00
Guy Harris 9fbf79c045 macos-setup: various cleanups.
In uninstall_autoconf, when running uninstall subfunctions, pass the
arguments to the subfunctions.

When uninstalling Ninja, remove the "we've finished installing this"
indicator file.

Get rid of a debugging "set +x".
2020-12-16 18:14:30 -08:00
Guy Harris 190442d76e macos-setup: set SDKROOT when running xcrun.
That lets it find the right SDK path if you're not using the default
SDK.
2020-12-16 14:09:22 -08:00
Guy Harris f2af1ea66d macos-setup: fix uninstallation of libtasn1.
Fix a copy-and-pasteo.
2020-12-16 11:54:53 -08:00
Pascal Quantin 7b4abddef2 LPPa: upgrade dissector to v16.1.0 2020-12-16 12:02:37 +01:00
Pascal Quantin 4427c11571 NRPPa: upgrade dissector to v16.1.0 2020-12-16 09:54:06 +00:00
Pascal Quantin 099554adb0 extract_asn1_from_spec.pl: fix parsing with CRLF line ending 2020-12-16 04:48:53 +00:00
Martin Mathieson b7cb24c1fd check_typed_item_calls.py: some tweaks 2020-12-15 11:54:48 +00:00
Pascal Quantin 5ed3a4dc02 Windows: clean libpcap package 2020-12-14 19:23:22 +00:00
Pascal Quantin 0d11bbeeaf Windows: upgrade Npcap to 1.10 2020-12-14 19:44:35 +01:00
Guy Harris 02c5f50009 macos-setup: more cleanups.
Fix/update/expand some comments.

Do uninstalls for dependencies using CMake more similarly.

For LZ4, as it comes with a Makefile rather than any
autotools/CMake/etc. configuration, "make distclean" might not be
necessary, so, as it's not supported, just do "make clean".

For libssh, do all removes in the uninstall in a single command, and use
$DO_RM, so that it uses sudo iff /usr/local isn't writable by us.  In
addition, remove the build directory as the equivalent of "make
distclean".

As with libssh, so with brotli.
2020-12-13 00:44:24 -08:00
Guy Harris 7d01e3a74e macos-setup: clean up uninstallation of snappy.
For a CMake build done in a subdirectory of the source directory, the
equivalent of "make distclean" is "rm -rf {that subdirectory}".  Make it
so.

When uninstalling the stuff snappy installs with "rm -rf", use $DO_RM,
so it's done with sudo iff /usr/local isn't writable by us, just as
"make uninstall" is done with $DO_MAKE_UNINSTALL so it's done with sudo
iff /usr/local isn't writable by us.

Fix up the list of what to remove, now that we're building snappy as a
shared library, so that it removes shared libraries rather than the
non-existent static library.

Update a comment while we're at it, as Lua isn't the only dependency
that doesn't support "make uninstall".
2020-12-12 23:47:27 -08:00
Guy Harris e92119c608 macos-setup: build snappy as a shared library.
The older versions of snappy apparently used autotools and build a
shared library by default; for example, Wireshark 3.2.6 for macOS is
built with snappy, and includes a snappy dynamic library in the app
bundle.

The current version uses CMake and does *not* build a shared library by
default.  Instead, it builds a static library, which, when you try to
link it to a C-only shared library...

...does not work.

The linker sees that you're statically linking in a bunch of C++ .o
files and gets upset because it can't find C++ standard library routines
used by that code.

If it's a dynamic library, the library was itself already linked with
the C++ standard library, so the external references to that library
from the snappy library are already marked as having been resolved to
the extent that they're expected to be in the C++ standard library at
run time - and, when the dynamic snappy library is built, it's marked as
depending on the C++ standard library, so the run time linker will, when
it loads the snappy dynamic library, see that the C++ standard library
is required and will load it if it hasn't already been loaded.
2020-12-12 21:30:51 -08:00
Guy Harris 504f2ea42a Snappy uses CMake, and they didn't bother to provide an unintall target.
Or a distclean target, for that matter.

Do the best we can.

(libpcap and tcpdump support both autotools and CMake, and Wireshark
uses only CMake; all of them support an uninstall target in CMake.  Go
forth, read what they did, and sin no more.)
2020-12-12 15:51:10 -08:00
Guy Harris 2ecb606142 Work around more NeXTStEP-induced pain.
GNU libtool has a libtool program and a libtoolize program.

The development tools for NeXTStEP, apparently, had a libtool program as
well, and the current version of the development tools for the current
version of NeXTStEP, generally known as "Xcode for macOS", still have
that program.

This means that we do some renaming after installing GNU libtool, so
that its "libtool" becomes "glibtool" and its "libtoolize" becomes
"glibtoolize".

That meant we had to compensate for that when running autoreconf when
building and installing minizip.

It turns out we have to do that when running autogen.sh when building
and installing GLib as well.
2020-12-12 21:59:59 +00:00
Gerald Combs 404802dc34 Tools: skip commit validation for merge trains.
Skip commit validation if it looks like we're in a GitLab merge train.
2020-12-12 10:20:40 +01:00
Peter Eszlari 42a09ad02e Linux: rename metadata according to spec
https://www.freedesktop.org/software/appstream/docs/sect-Metadata-Application.html

https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s02.html#desktop-file-id
2020-12-10 18:11:12 +00:00
Pascal Quantin 86e23155fe Windows: upgrade libssh to 0.9.5
Closes #17065
2020-12-09 22:35:25 +00:00
Gerald Combs 3bf856868d Tools: Run `brew doctor` after installing Homebrew packages.
`brew doctor` doesn't take very long to run and might reveal issues that
need to be fixed.
2020-12-08 23:47:05 +00:00
Pascal Quantin a16c1697dc Windows: update libs cleanup paths 2020-12-07 22:14:27 +01:00
Gerald Combs f506d971b8 Windows: Upgrade c-ares and nghttp2.
Upgrade c-ares to 1.17.1 and nghttp2 to 1.42.0.
2020-12-05 10:36:15 -08:00
Jaap Keuter 27acec97e9 Lemon: import fresh lemon from upstream
- get latest lemon from upstream (SQLite)
- update and apply the patches
- introduce CC0-1.0 license indication
- update documentation
2020-12-04 08:32:58 +00:00
John Thacker fe1f947540 macOS: Enable PKCS #11 support when building with macos-setup.sh
Enable PKCS #11 support in macOS builds with macos-setup.sh (already
supported on macOS via Homebrew and on all other OSes with GnuTLS 3.4
or greater) by installing p11-kit (and its dependency libtasn1) and
building nettle and GnuTLS against it.
2020-12-02 07:55:42 +00:00
Joerg Mayer 77e9d7d3f9 macos-setup.sh: Update various software versions
Update versions of xz, lzip, gettext, libgpg, libgpg-error, libgcrypt, gnutls and gmp
to newest releases.

Also update glib but only to last version with autotools support - meson build is left
for another time.

Current versions of glib require a libpcre with unicode enabled which the Catalina system
version does not provide, so install the current version of libpcre as well.

Update some additional tools to commit 3a42bf0de2b9e35efcc3cea38153ab95cb71b352:
brotli, libmaxminddb, lz4, and snappy
2020-12-01 21:54:09 +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
Guy Harris 8e2815bfc0 Don't assume macOS version numbers are of the form 10.N.
Big Sur goes to 11, and it appears that next year's (San Juan Capistrano?)
will go to 12, and so on.

Split version numbers into major and minor, and do version-number
comparison (alas, whilst CMake has that built in, the Bourne shell
doesn't, and neither does the Bourne-again shell).

This should fix issue #17043.
2020-11-25 18:23:28 -08:00
Martin Mathieson df651aca91 Spelling improvements
Improve script by ignoring common contractions, dealing with
e.g. \n within strings, and finding multiple concatenated words even
when no camelCase is used.

Also includes some actual spelling fixes.
2020-11-22 11:30:24 +00:00
Jann Horn 785ef0f43d checkAPIs: Fix typo
Fix the typo'd header name in the error message.
2020-11-19 18:16:37 +00:00
Martin Mathieson e1b3fb0262 tools/check_typed_item_calls.py: check consecutive mask 2020-11-16 10:12:51 +00:00
Gerald Combs 01d5e8ee51 Tools: Update the usb.ids URL in make-usb.py.
The canonical location for the usb.ids file is
http://www.linux-usb.org/usb.ids. Unfortunately that site isn't
accessible over HTTPS so we were using https://usb-ids.gowdy.us/usb.ids
instead. *That* site is down, so switch to the Linux USB project's
SourceForge repository URL, which appears to house the assets for
www.linux-usb.org, including the usb.ids file.
2020-11-15 22:21:14 +00:00
Martin Mathieson 580de09849 Fix a few spelling mistakes. 2020-11-12 09:52:52 +00:00
John Thacker ac34f3e8b6 RPM+CI: Update and fix for Fedora 33, CentOS 8, OpenSUSE Leap 15.2
Re-enable Fedora build and add CentOS 8 and OpenSUSE 15.2 builds.
Fedora 33 does out of build tree cmake builds and needs spec file changes.
CentOS 8 has some changes with cmake and other packages that are similar to
older Fedora, and needs extra repositories enabled to get -devel packages
(still missing -devel for some optional libraries). OpenSUSE Leap 15.2 also
has some changes needed to build. Note that OpenSUSE Leap 15.1 is EOL
at the end of November 2020. Fixes #16971
2020-11-05 17:58:16 -05:00
Gerald Combs 30c392f166 Tools+test: Call python3 explicitly.
PEP 394[1] says,

"In cases where the script is expected to be executed outside virtual
 environments, developers will need to be aware of the following
 discrepancies across platforms and installation methods:

  * Older Linux distributions will provide a python command that refers
    to Python 2, and will likely not provide a python2 command.

  * Some newer Linux distributions will provide a python command that
    refers to Python 3.

  * Some Linux distributions will not provide a python command at all by
    default, but will provide a python3 command by default."

Debian has forced the issue by choosing the third option[2]:

"NOTE: Debian testing (bullseye) has removed the "python" package and
 the '/usr/bin/python' symlink due to the deprecation of Python 2."

Switch our shebang from "#!/usr/bin/env python" to "#!/usr/bin/env
python3" in some places. Remove some 2/3 version checks if we know we're
running under Python 3. Remove the "coding: utf-8" in a bunch of places
since that's the default in Python 3.

[1]https://www.python.org/dev/peps/pep-0394/#for-python-script-publishers
[2]https://wiki.debian.org/Python
2020-11-05 06:46:35 +00:00
Gerald Combs dd6b6f48dc Tools: Allow cherry pick lines in validate-commit.py.
Cherry picking tends to add an extra blank line to the commit message.
Update the body check in validate-commit.py to allow for this.
2020-11-04 21:01:52 +00:00
John Thacker 63d045e7eb rpm-setup: Find opus development package for OpenSUSE 2020-11-02 13:42:22 +00:00
John Thacker 25f1540d39 Add bcg729 to the optional RPMs installed when building 2020-11-01 13:04:28 +00:00
Tom Yan 00c09b8696 extract_asn1_from_spec.pl : fix ^END to ^END$ 2020-10-24 08:58:20 +00:00
Gerald Combs 6633ca1b90 Fuzz: Don't blame the latest commit.
The latest commit in a fuzz failure report *usually* isn't the problem.
Try to make that more clear.
2020-10-23 06:33:40 +00:00
Martin Mathieson a480d91a5b Revert temp changes to valgrind-wireshark.sh 2020-10-19 10:35:26 +00:00
Martin Mathieson bf245c5f68 PDML: speed up writing
Speed functions to print hex bytes, escape XML strings and
print out indents by avoiding specifier calls, and building
larger strings before calling fputs().

Someone mentioned this in the sharkfest chat yesterday.
Also, Ostinato relies upon this when importing from pcap.

An example capture I have has gone from 18 to 11 seconds.
2020-10-19 09:32:49 +00:00
Martin Mathieson cfa55d6a46 tools/check_type_item_calls.py: Check lengths
For calls to proto_tree_add_item(), compare length field in call
with length implied by type of item.
2020-10-17 22:38:02 +00:00
Moshe Kaplan 3dde70de2c .gitlab-ci: Generate cppcheck reports
Modify the cppcheck job to also generate cppcheck's reports
and provide them as artifacts to the user.
2020-10-15 19:39:11 +00:00
Martin Mathieson efd1f57057 cppcheck.sh: Suppress syntaxError
I've never seen anything useful in these - presumably code is build-tested.
2020-10-14 12:33:16 +00:00
Martin Mathieson 6894bccf03 check_tfs.py: Also match case insensitively
Fix up some issues where the words were the same except for
captitalisation.
2020-10-11 18:46:31 +00:00
Martin Mathieson 0ca5484aed check_typed_item_calls.py: Add some extra checks
Checks added for completeness, didn't uncover any current issues.
2020-10-09 21:20:12 +01: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
Guy Harris e013c5ec7f Clean up URLs.
Add ui/urls.h to define some URLs on various of our websites.  Use the
GitLab URL for the wiki.  Add a macro to generate wiki URLs.

Update wiki URLs in comments etc.

Use the #defined URL for the docs page in
WelcomePage::on_helpLabel_clicked; that removes the last user of
topic_online_url(), so get rid of it and swallow it up into
topic_action_url().
2020-10-02 20:13:42 -07:00
Gerald Combs 4105e65add Tools: Handle leading "#"s in gen-bugnote.
GitLab's version of Markdown denotes issue IDs with a leading "#".
2020-09-30 09:56:53 -07:00
Tom Yan c69d8dd410 extract_asn1_from_spec.pl: add version into exported asn file 2020-09-28 14:53:26 +00:00
Martin Mathieson 6dd9c098ad check_typed_item_calls.py: add --consecutive flag
Add a check to point out where consecutive items have the same filter
but different labels.  Quite a few of these look like bugs.

Also, make some REs raw strings, as identified as an issue in
https://gitlab.com/wireshark/wireshark/-/merge_requests/346
2020-09-28 08:01:21 +00:00
Pascal Quantin 0b99248593 Windows: upgrade Npcap to 1.00 2020-09-27 14:22:19 +02:00
Jeff Widman 8d7ebc732e Fix issues discovered by common python linters
Fix some issues discovered by common python linters including:
* switch `None` comparisons to use `is` rather than `==`. Identity !=
equality, and I've spent 40+ hours before tracking down a subtle bug
caused by exactly this issue. Note that this may introduce a problem if
one of the scripts is depending on this behavior, in which case the
comparison should be changed to `True`/`False` rather than `None`.
* Use `except Exception:` as bare `except:` statements have been
discouraged for years. Ideally for some of these we'd examine if there
were specific exceptions that should be caught, but for now I simply
caught all. Again, this could introduce very subtle behavioral changes
under Python 2, but IIUC, that was all fixed in Python 3, so safe to
move to `except Exception:`.
* Use more idiomatic `if not x in y`--> `if x not in y`
* Use more idiomatic 2 blank lines. I only did this at the beginning,
until I realized how overwhelming this was going to be to apply, then I
stopped.
* Add a TODO where an undefined function name is called, so will fail
whenever that code is run.
* Add more idiomatic spacing around `:`. This is also only partially
cleaned up, as I gave up when I saw how `asn2wrs.py` was clearly
infatuated with the construct.
* Various other small cleanups, removed some trailing whitespace and
improper indentation that wasn't a multiple of 4, etc.

There is still _much_ to do, but I haven't been heavily involved with
this project before, so thought this was a sufficient amount to put up
and see what the feedback is.

Linters that I have enabled which highlighted some of these issues
include:
* `pylint`
* `flake8`
* `pycodestyle`
2020-09-26 04:38:18 +00:00
Tom Yan d0256f168a extract_asn1_from_spec.pl : fix export of S1AP 2020-09-25 07:37:25 +00:00
Martin Mathieson fc64ba242a More dissector spelling fixes. 2020-09-24 16:40:51 +00:00
Tom Yan 68f59bd1f4 extract_asn1_from_spec.pl : update comments 2020-09-24 09:18:13 +00:00
Pascal Quantin b562109562 extract_asn1_from_spec.pl: fix export of X2AP, NGAP, XnAP, E1AP and F1AP
And remove S1AP as it does not use the ASN1START/ASN1STOP keywords.
2020-09-24 07:09:43 +00:00
Tom Yan 71223de4a3 Add : extract asn from (36|38)\.413|(36|38).423|38\.463|38\.473) 2020-09-24 05:33:59 +00:00
Gerald Combs 586121fad4 Shellcheck fixes.
Note that ChmodBPF requires a newer version of shellcheck. Fix an issue
found after upgrading to 0.7.1.
2020-09-21 22:09:13 +00:00
Martin Mathieson f962539374 check_typed_item_calls.py: Scan plugins folder too 2020-09-19 12:34:02 +00:00
Christian Kreibich c5d5023654 A Community ID implementation for Wireshark.
This adds a protocol post-dissector for Community ID support to
Wireshark/tshark: https://github.com/corelight/community-id-spec

The protocol is disabled by default. It establishes one new filter
value, "communityid".

Includes test cases and baselines to verify correct Community ID
strings based on similar testsuites in the existing Zeek and Python
implementations.
2020-09-16 09:25:38 -07:00
Gerald Combs 194b3b406a Update our issue tracker URL in some places.
Replace bugs.wireshark.org links with their equivalent
gitlab.com/wireshark/wireshark/issues links in the AsciiDoctor buglink
macro and the please_report_bug function. Update the bug URLs in
comments in the tools and test directories.
2020-09-16 01:29:07 +00:00
Guy Harris 3417380d65 ncp: fix display of DS_FULL_CLASS_DEFS.
The last item in the reply information is an ACL.  Display it as such.
2020-09-15 04:04:33 -07:00
Guy Harris 395d2e7425 NCP: add more comments to tools/ncp2222.py.
Point to more NCP and NDS documentation.
2020-09-15 02:08:48 -07:00
Martin Mathieson 82827278f7 More dissector string spelling fixes.
Finally, it is becoming difficult to find more.
2020-09-13 09:03:08 +01:00
Guy Harris 272502790b Add FT_STRINGZTRUNC.
FT_STRINGZPAD is for null-*padded* strings, where the field is in an
area of specified length, and, if the string is shorter than that
length, all bytes past the end of the string are NULs.

FT_STRINGZTRUNC is for null-*truncated* strings, where the field is in
an area of specified length and, if the string is shorter than that
length, there's a null character (which might be more than one byte, for
UCS-2, UTF-16, or UTF-32), and anything after that is not guaranteed to
have any particular value.

Use IS_FT_STRING() in some places rather than enumerating all the string
types, so that those places get automatically changed if the set of
string types changes.
2020-09-12 14:16:12 -07:00
Guy Harris 20ae645964 ncp: add a comment about possibly null-truncated strings.
In File Search Continue requests, the path is a single byte giving the
string length, followed by that many bytes containing the string value.

However, in at least some File Search Continue requests, the string
length value is longer than the string, and there's a NUL, followed by
other non-zero cruft, in the string.
2020-09-11 01:36:52 -07:00
Gerald Combs 9e36a4fadd tools: Migrate gen-bugnote to GitLab.
Update gen-bugnote to fetch issue titles from GitLab's issue API.
2020-09-09 00:56:38 +00:00
Georg Richter 2f1cf93174 MySQL: Added support for MariaDB protocol
MariaDB and MySQL are not longer drop-in compatible, they differ in very
different directions
for protocol and api. This patch contains support for MariaDB specific
commands and extensions:

- MariaDB specific character sets and collations (also updated MySQL
collations)
- MariaDB extended capabilities in greeting and login packets
- Support for MARIADB_STMT_BULK_EXECUTE command
- Removal of "5.5.5-" prefix in the version string.
2020-09-08 09:02:02 +02:00
Martin Mathieson d461bf3025 Yet more spelling fixes.
Includes small updates to the script and wireshark dictionary.
Probably the last spelling fixes from me for a while.
2020-09-07 16:35:13 +01:00
Martin Mathieson de115f6cd5 check_spelling.py: fix a variable name, and add a few dictionary words. 2020-09-07 09:36:53 +01:00
Martin Mathieson 22e02a9d06 Add spell-checking script.
check_spelling.py scans Wireshark source or documentation files,
using the general dictionary from pyspellcheck, augmented by the contents
of wireshark_words.txt.

Can scan:
- entire folders (recursively)
- individual files
- open files
- files affected by recent git changes
2020-09-06 18:47:58 +00:00
Uli Heilmeier 30e13d7717 Gitlab: Add templates for issues
Adding templates for reporting a Bug and Feature Request
Exclude .gitlab from checklicenses.py
2020-09-06 17:15:40 +00:00
Gerald Combs 7ab6440416 Tools: Clean up checkAPI and add ui/qt.
Remove the --check-addtext and --build flags. They were used for
checkAddTextCalls, which was removed in e2735ecfdd.

Add the sources in ui/qt except for qcustomplot.{cpp,h}. Fix issues in
main.cpp, rtp_audio_stream.cpp, and wireshark_zip_helper.cpp.

Rename "index"es in packet-usb-hid.c.
2020-09-05 07:41:29 +00:00
Gerald Combs fd075df3f8 tools: Make the "Allow commits" error more obnoxious.
Add ANSI codes and emoji so that the error stands out in the pipeline
output. Clarify the text.
2020-09-04 09:22:04 +00:00
Gerald Combs 7476911490 tools: Force "Allow commits from members..." in merge requests.
Add a verify_merge_request routine to validate-commit.py. If the
required CI_MERGE_REQUEST_XXX environment variables are set it uses them
to query the GitLab API to see if "allow_collaboration" is true in the
current merge request.

This is a ham-fisted way of ensuring that committers can rebase and can
be removed if and when https://gitlab.com/gitlab-org/gitlab/-/issues/23308
is fixed.
2020-09-02 18:44:05 -07:00
Gerald Combs 3e0ebabdec CI+tools: Install lintian.
Install lintian instead of devscripts (which pulls in lintian + many
other packages) in .gitlab-ci.yml. Add lintian to DEBDEPS_LIST in
debian-setup.sh.
2020-09-01 08:46:08 +00:00
Mikael Kanstrup 97ade16979 nl80211: Fix abbreviated field names for NAN
Python's lstrip apparently doesn't strip a prefix but instead strips
all supplied characters from beginning of a string. Using lstrip
in generate-nl80211-fields.py script to remove the 'nl80211_' prefix
happened to work for everything but a few NAN related enums.
Introduce a remove_prefix function and regenerate the nl80211
dissector code to fix the abbreviated field names for NAN.
2020-08-28 13:07:13 +02:00
Pascal Quantin 429fa65c80 Windows: upgrade Npcap to 0.9997 2020-08-26 18:52:41 +00:00
Gerald Combs 97dcaf97fc Convert Gerrit URLs to GitLab.
Convert various code.wireshark.org URLs to their
gitlab.com/wireshark/wireshark equivalents.

Change-Id: I0150d1bd14208eb451a7de818dce6573363b1d27
2020-08-24 23:31:32 +00:00
Dario Lombardo b586f25789
tools: rename validate-clang-check.py to validate-clang-check.sh.
This reflects the actual language used in the code (sh).
2020-08-24 14:26:23 +02:00
Gerald Combs 50550708cc Add merge request jobs to GitLab CI and migrate commit validation.
Copy the Buildbot petri dish builder steps to corresponding GitLab CI
jobs. Update validate-commit.py to look for old "Bug:" and "Ping-Bug:"
references and have it call `git stripspace` directly. tools/commit-msg
was specific to Gerrit, so remove it.

Change-Id: Icbc54709052f44c941db9ad6a5dcf596292782a2
2020-08-23 17:46:18 -07:00
Martin Mathieson 3b67c5b308 TFS: Add some commonly-defined string pairs to tfs.c
'check_tfs.py --common'    can look for tfs values that appear multiple times.
Current output prior to these dssector changes was:

('No Extension', 'Extension') appears 3 times in:  ['epan/dissectors/packet-bssap.c', 'epan/dissectors/packet-camel.c', 'epan/dissectors/packet-gsm_map.c']
('Optimised for signalling traffic', 'Not optimised for signalling traffic') appears 3 times in:  ['epan/dissectors/packet-gsm_a_gm.c', 'epan/dissectors/packet-gsm_map.c', 'epan/dissectors/packet-gtp.c']
('Data PDU', 'Control PDU') appears 3 times in:  ['epan/dissectors/packet-pdcp-lte.c', 'epan/dissectors/packet-pdcp-nr.c', 'epan/dissectors/packet-rlc-nr.c']
('Message sent to originating side', 'Message sent from originating side') appears 3 times in:  ['epan/dissectors/packet-q2931.c', 'epan/dissectors/packet-q931.c', 'epan/dissectors/packet-q933.c']
('User', 'Provider') appears 3 times in:  ['epan/dissectors/packet-q2931.c', 'epan/dissectors/packet-q931.c', 'epan/dissectors/packet-q933.c']

The first and last ones were made common, the others seem a little too specialised.

Checking some of the existing items in tfs.c (using QtCreator's 'Find Usages'),
some of the common items are used a lot, but many of them are not referenced.

Change-Id: Ia4006d2c4fa7cafbc3b004dc7a367a986dbeb0c4
Reviewed-on: https://code.wireshark.org/review/38177
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-08-17 02:58:01 +00:00
Martin Mathieson ce81473b7f check_tfs.py: Import subprocess module (needed for querying git)
Change-Id: I177000fb05bb9323ddbb280eb0b79c30cd60a3f3
Reviewed-on: https://code.wireshark.org/review/38170
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2020-08-15 16:08:53 +00:00
Martin Mathieson 42cac8dcfd check_typed_item_calls.py: add optional checks for labels and bitmask.
Most of the detected non-contiguous mask bitmasks seem to be valid - they often
represent multiple unassigned/reserved bits that have been conflated into
one hf item.

A set of exceptions has been added to the script - a couple of genuine
buts will be addressed presently in a separate commit.

Change-Id: I87fcf6ee532819097c2daf20b4b1338abb4402d8
Reviewed-on: https://code.wireshark.org/review/38103
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-08-15 05:50:39 +00:00
Joerg Mayer c3066b647e make-version.pl: Update sample output in comments to more modern git version 2.24.3 (Apple Git-128)
Change-Id: I2c204d315fd2648953b536a825f6c7d9c9b04827
Reviewed-on: https://code.wireshark.org/review/38138
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2020-08-13 19:53:15 +00:00
Martin Mathieson 9a7b30aea8 Fix tfs strings that have leading or trailing space characters.
Change-Id: I3e456e24f171ea2073806ad56606e6ce9092890c
Reviewed-on: https://code.wireshark.org/review/38096
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-08-09 13:31:33 +00:00
Pascal Quantin e9f6958c46 Windows: upgrade Npcap to 0.9996
Change-Id: Ia8f0f2ecada1a94c0bcdaaa5c560575ab945b002
Reviewed-on: https://code.wireshark.org/review/38098
Petri-Dish: Pascal Quantin <pascal@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
2020-08-09 13:22:33 +00:00
Martin Mathieson fd03c85d0f check_typed_item_calls.py: Look for items with the wrong type passed to APIs
Look for calls to certain proto APIs that require hf items of a certain type,
then check that the items passed in have one of the allowed types.

Currently takes around a minute to scan epan/dissectors.  There are
a few issues that have not yet been fixed..

Hopefully this can be added to the PetriDish at some point.

Change-Id: Ic9eadcc3f1de03223606b5dca1cb45edcbe95e85
Reviewed-on: https://code.wireshark.org/review/38039
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-08-08 09:55:18 +00:00
Martin Mathieson 1dd8bb2811 Find and fix dissectors that should be using a default tfs.
Found using tools/check_tfs.py, included in this commit.
Here are the reports that were fixed here:

Examining:
All dissector modules

epan/dissectors/packet-assa_r3.c tfs_mortisepins_flags - could have used tfs_high_low from tfs.c instead:  {High,Low}
epan/dissectors/packet-btle.c tfs_present_bit - could have used tfs_present_not_present from tfs.c instead:  {Present,Not Present}
epan/dissectors/packet-dhcp.c tfs_fqdn_s - could have used tfs_server_client from tfs.c instead:  {Server,Client}
epan/dissectors/packet-docsis-macmgmt.c mdd_tfs_on_off - could have used tfs_on_off from tfs.c instead:  {On,Off}
epan/dissectors/packet-docsis-macmgmt.c mdd_tfs_en_dis - could have used tfs_enabled_disabled from tfs.c instead:  {Enabled,Disabled}
epan/dissectors/packet-docsis-macmgmt.c req_not_req_tfs - could have used tfs_requested_not_requested from tfs.c instead:  {Requested,Not Requested}
epan/dissectors/packet-docsis-tlv.c on_off_tfs - could have used tfs_on_off from tfs.c instead:  {On,Off}
epan/dissectors/packet-docsis-tlv.c activation_tfs - could have used tfs_active_inactive from tfs.c instead:  {Active,Inactive}
epan/dissectors/packet-docsis.c ena_dis_tfs - could have used tfs_enabled_disabled from tfs.c instead:  {Enabled,Disabled}
epan/dissectors/packet-ecmp.c tfs_not_expected_expected - could have used tfs_odd_even from tfs.c instead:  {Odd,Even}
epan/dissectors/packet-erf.c erf_link_status_tfs - could have used tfs_up_down from tfs.c instead:  {Up,Down}
epan/dissectors/packet-h263.c on_off_flg - could have used tfs_on_off from tfs.c instead:  {On,Off}
epan/dissectors/packet-h263.c cpm_flg - could have used tfs_on_off from tfs.c instead:  {On,Off}
epan/dissectors/packet-interlink.c flags_set_notset - could have used tfs_set_notset from tfs.c instead:  {Set,Not set}
epan/dissectors/packet-ip.c tos_set_low - could have used tfs_low_normal from tfs.c instead:  {Low,Normal}
epan/dissectors/packet-ip.c tos_set_high - could have used tfs_high_normal from tfs.c instead:  {High,Normal}
epan/dissectors/packet-isakmp.c flag_r - could have used tfs_response_request from tfs.c instead:  {Response,Request}
epan/dissectors/packet-isis-lsp.c tfs_metric_supported_not_supported - could have used tfs_no_yes from tfs.c instead:  {No,Yes}
epan/dissectors/packet-kerberos.c supported_tfs - could have used tfs_supported_not_supported from tfs.c instead:  {Supported,Not supported}
epan/dissectors/packet-kerberos.c set_tfs - could have used tfs_set_notset from tfs.c instead:  {Set,Not set}
epan/dissectors/packet-mac-lte.c mac_lte_scell_status_vals - could have used tfs_activated_deactivated from tfs.c instead:  {Activated,Deactivated}
epan/dissectors/packet-p_mul.c no_yes - could have used tfs_no_yes from tfs.c instead:  {No,Yes}
epan/dissectors/packet-pgm.c opts_present - could have used tfs_present_not_present from tfs.c instead:  {Present,Not Present}
epan/dissectors/packet-rsl.c rsl_ms_fpc_epc_mode_vals - could have used tfs_inuse_not_inuse from tfs.c instead:  {In use,Not in use}
epan/dissectors/packet-sita.c tfs_sita_on_off - could have used tfs_on_off from tfs.c instead:  {On,Off}
epan/dissectors/packet-vines.c tfs_vine_rtp_no_yes - could have used tfs_no_yes from tfs.c instead:  {No,Yes}
epan/dissectors/packet-vnc.c button_mask_tfs - could have used tfs_pressed_not_pressed from tfs.c instead:  {Pressed,Not pressed}
27 issues found
Change-Id: I7e53b491f20289955c9e9caa8357197d9010a5aa
Reviewed-on: https://code.wireshark.org/review/38087
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-08-07 21:27:26 +00: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
Martin Kacer 9b5f07d829 json2pcap: Added pcap masking and anonymization support
The script includes the following changes:
- Added pcap masking and anonymization support
- Support to mask/anonymize only portion of field
- Added reading from stdin
- Changed json to ijson library to support large files
- Migrated from text2pcap to scapy for pcap generation
- Added version to script

The development repo is located here
https://github.com/H21lab/json2pcap

Change-Id: I8fc5e282caa604e188f05818f7a2f8875afb8b73
Reviewed-on: https://code.wireshark.org/review/37371
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2020-07-16 14:50:09 +00:00
Martin Mathieson 7e4ff6f826 cppcheck.sh and check_dissector_urls.py: Show which files are being examined.
Change-Id: Ib5ecb215050dea6bf2f03014d544dac49e56fe12
Reviewed-on: https://code.wireshark.org/review/37865
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2020-07-15 11:32:42 +00:00
Pascal Quantin d8db04bf5f Windows: upgrade Npcap to 0.9995
Change-Id: Ib06b0bc5b51513c008bfa126c87590c6836913ff
Reviewed-on: https://code.wireshark.org/review/37860
Petri-Dish: Pascal Quantin <pascal@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
2020-07-14 15:26:54 +00:00
Martin Mathieson 70119bb905 check_dissector_urls.py: Add options to control which files to scan
The intention is to try to run this on the Petri-dish buildbot,
where it could run with '--commits 1' to warn about files touched
in the most recent commit.

Change-Id: Ie924d39e093d1fef8cfbdf02d15bbede386b2862
Reviewed-on: https://code.wireshark.org/review/37826
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-12 05:05:08 +00:00
Tomas Kukosa 1257bd379a asn2wrs: support for (SIZE(A..B),...) constraint
Change-Id: Icf4c6c7c91cbdc22aff2363b0d21b24d123da482
Reviewed-on: https://code.wireshark.org/review/37824
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-12 05:02:56 +00:00
Peter Wu 1cbaaf3e8d tls: Update list of CT logs to 2020-05-29
Avoid string literals while at it to avoid -Wpointer-sign warnings with
GCC 10. This has the additional benefit of avoiding storing the trailing
NUL byte after the data, resulting in a tiny reduction in binary size.
This compound literal syntax is supported since C99 which is permitted
by doc/README.developer.

Change-Id: I35f4d3a46aa78e12915d92136f1de0891131bede
Reviewed-on: https://code.wireshark.org/review/37818
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-10 05:11:26 +00:00
Gerald Combs f0d456bf2d cppcheck: Fixup some comparisons.
Change-Id: I6901c31cdea7399bc18dbf968c14c477f71a90dd
Reviewed-on: https://code.wireshark.org/review/37777
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-07-08 01:56:18 +00:00
Gerald Combs e9a21e9f41 cppcheck: Bail if "-l <n>" or "-o" don't find any files.
If we've been passed "-l <n>" and the last <n> commits don't match any C
or C++ files or we've been passed "-o" and no files have been changed,
simply exit instead of testing the entire code base. We use "cppcheck.sh
-l <n>" in our CI system and the former behavior is much more useful
(and faster) than the latter.

Change-Id: I1127eabefa854d68f80b0a2dfd05e6895658abc0
Reviewed-on: https://code.wireshark.org/review/37773
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2020-07-07 18:18:45 +00:00
Martin Mathieson 45da818a53 Add internalAstError to suppressed errors from cppcheck.
cppcheck seems to get confused by the VALS() macro.

Change-Id: Iba59a4886a0461cea9797a09a10e67420b09af19
Reviewed-on: https://code.wireshark.org/review/37639
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2020-07-01 12:00:56 +00:00
Martin Mathieson 5258ceadb3 cppcheck: add a -o option to check modified or staged changes
Change-Id: I336400441302549967db048bedc70980b04c5030
Reviewed-on: https://code.wireshark.org/review/37613
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-30 06:28:48 +00:00
Martin Mathieson 14049d75fd cppcheck: add more include folders to look in.
Without this (particularly '.'), for some files it macro definitions cannot
be found the whole file is basically skipped.

Will make overall scan take quite a bit longer.

Change-Id: I7498b23ad9b27edd3a815c7fc51ef8501fa5a56a
Reviewed-on: https://code.wireshark.org/review/37567
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2020-06-28 14:47:44 +00:00