Commit Graph

2662 Commits

Author SHA1 Message Date
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