Commit Graph

82629 Commits

Author SHA1 Message Date
Gerald Combs e5088eea4a Tools: Fix a typo in win-setup.ps1. 2021-11-15 01:24:08 +00:00
Gerald Combs e3159ae631 macOS: Add a workaround for libpcre2.
Work around an issue with libpcre2 similar to what we do for libsnappy
and libssh.
2021-11-14 17:06:38 -08:00
Georg Sauthoff d8e33efb3c Fix maybe-uninitialized warnings
When compiling the current wireshark master branch (with the default
project provided CFLAGS) on Fedora 35, GCC 11.2.1 prints a few
`-Wmaybe-uninitialized` warnings.

This change fixes those.
2021-11-15 00:05:05 +00:00
João Valverde 848f4f8e97 dfilter: Cleanup some debug statements
Reduce the verbosity a bit, even with "noisy" level,
and remove some extraneous new lines.
2021-11-14 23:22:42 +00:00
João Valverde b59980bbff regex: Add a diagnostic message
Add a debug log message if pcre2_match() errors out.

Minor optimization with the use of pcre2_match_data_create().

Minor cleanup.
2021-11-14 23:05:53 +00:00
João Valverde 9bdccce574 More workarounds for Debian 2021-11-14 21:00:59 +00:00
João Valverde 274531820a Move regex code to wsutil 2021-11-14 21:00:59 +00:00
João Valverde b9f2e4b7fa Make PCRE2 a required dependency 2021-11-14 21:00:59 +00:00
João Valverde 9df5279af7 dfilter: Remove support for GRegex
PCRE2 is mature, widely used and widely available. Supporting two
different RE implementations, one of which is unmaintained, is
unnecessary and counter-productive.
2021-11-14 21:00:59 +00:00
João Valverde ed8a02af17 dfilter: Add support for PCRE2
PCRE2 is the future of PCRE. The only advantage of GRegex is that
it comes bundled with GLib, which is not an advantage at all.
PCRE2 is widely available, the GRegex abstractions layer are not a
good fit and abstract things that don't need abstracting or that we
could handle better ourselves, there are open bugs (#12997) and
maintenance is spotty at best.

GRegex comes with many of the problems of bundled code, aggravated by
the fact that it completely falls outside of our control.
2021-11-14 21:00:59 +00:00
João Valverde 6630fd5260 wsutil: Rename ws_return_ptr_if_null() macro
Rename to ws_return_val_if_null() because the name needs to be more
generic to indicate it should be used to return any kind of value,
not just pointers.

Increase the log level to something more appropriate because failing
any of these checks is considered to be a programming error.

Add the faulty variable name to the output message.

Add the macro ws_return_val_if_zero() for completeness.
2021-11-14 20:58:14 +00:00
Michael Tuexen 6587debb3b tools: building pcre2 requires cmake.
So move it after cmake...
2021-11-14 20:57:29 +01:00
Michael Tuexen 2d7bc59fae tools: actually call install_pcre2 in macos-setup.sh 2021-11-14 19:35:33 +01:00
Gerald Combs d8429d2065 Tools: Add PCRE2 to our setup scripts.
Add PCRE2 to the base package list in our various setup scripts.
2021-11-14 17:53:36 +00:00
Gerald Combs 41a247287e [Automatic update for 2021-11-14]
Update manuf, services enterprise numbers, translations, and other items.
2021-11-14 16:39:31 +00:00
João Valverde 77fa0fb23d dfilter: Fixup unexpected end of filter error message
Fixes e7ecc9b9e5.
2021-11-14 15:33:56 +00:00
Graham Bloice 79ebce20c0 dnp3: Fix PVS-Studio warnings
Fix a couple of warnings, suppress some false positives
2021-11-13 22:52:09 +00:00
João Valverde b90e5cf0c7 dfilter: Restore debug syntax tree display
Restore the test stnode representation that was lost in 2db36f8ce0.
2021-11-13 21:23:28 +00:00
João Valverde 01d1cc492e dfilter: Add default case to switch 2021-11-13 11:39:32 +00:00
Gerald Combs a99e1b2099 Tools: Switch a bunch of macos-setup URLs to HTTPS. 2021-11-12 21:25:48 +00:00
Guy Harris 6d96d8bbc2 Don't include config.h in the example plugin.
Wireshark's config.h isn't available to third-party plugins, and the
developers of the plugin might not even have their own config.h, so
don't include it in the example (if it *does* have its own config.h, the
developers will presumbly know that they should include it).
2021-11-12 12:53:21 -08:00
Guy Harris 2445180fa7 Don't use HAVE_CONFIG_H in sample code in the documentation.
We require config.h and don't define HAVE_CONFIG_H - it should *always*
be included.
2021-11-12 11:23:06 -08:00
João Valverde 2f98b349df We cannot use HAVE_CONFIG_H
We are not defining this macro symbol se we can't use it. We need
"config.h" and it must be an unconditional include.
2021-11-12 18:33:31 +00:00
João Valverde ca06d7e4fe Add an include sub-directory to the tree
Blind attempt to fix Debian package brokenness managing
headers separately from install rules.

Global public headers that don't fit any of the Wireshark
libraries should be placed in include/.

Eventually the C files in the root dir should be placed somewhere
else as well (like src/) but this is not a priority.

Fixes #17726.
2021-11-12 17:33:13 +00:00
João Valverde 76c4ca4059 CMake: Remove globals.h from public headers
On closer inspection this doesn't seem to contain any public
interfaces.
2021-11-12 17:33:13 +00:00
João Valverde b8f9758742 MSYS2: Use system SpeexDSP package 2021-11-12 11:19:34 +00:00
Guy Harris c3599a9616 "register_dissector()" isn't just to let you write a Lua chained dissector.
It's to let other dissectors find the dissector being registered, so
that they can call it, for whatever reason.
2021-11-11 22:41:20 -08:00
Gerald Combs 3f8f22f472 Qt: Add some notes about cleaning up after ourselves. 2021-11-11 13:21:48 -08:00
Robert Shade 1f20b1cead RTPS: Fix the field name used for timestamp 2021-11-11 17:37:51 +00:00
Robert Shade f277ef5e27 RTPS: Enable dissection of PLAIN_CDR2 2021-11-11 17:16:47 +00:00
Stefan Battmer 599d3e2c94 gvsp: Added dissector support for various 'reserved' bytes
- Added dissector support for the various reserved fields of the container
- Adjusted some of the display strings
2021-11-11 17:02:14 +00:00
PaulTyler 6be988d9b2 RTPS: Fix Group GUID dissector bug.
Dissector was not correctly distinguishing between 12 byte and 16 byte Group GUIDs.
Code for dissecting Participant GUID used as guidance.
closes #17631.
2021-11-11 16:47:42 +00:00
Zoran Bošnjak adf48851b1 asterix: Sync with asterix-specs #dc8e48b56c 2021-11-11 13:47:10 +00:00
João Valverde a37295204f rawshark: Move a comment to the proper place 2021-11-11 09:51:52 +00:00
João Valverde 526ccff3d0 ftypes: Remove unused function declarations
Some registration function declarations were left behind,
remove them. While here move function declarations after
typedefs as is customary.
2021-11-11 09:50:29 +00:00
João Valverde fd78f1ed02 ftypes: Clean up duplicate struct field 2021-11-11 09:50:12 +00:00
João Valverde 5503d5e131 ftypes: Optimize a memory allocation
Avoid pre-allocating a large worst case size character buffer.
2021-11-11 03:56:04 +00:00
João Valverde 1a32a75a62 ftypes: Internal headers need to be internal
The header ftypes-int.h should not be used outside of epan/ftypes
because it is a private header.

The functions fvalue_free() and fvalue_cleanup() need not and should
not be macros either.
2021-11-11 03:15:31 +00:00
Gerald Combs 37f1cf1a92 Tools: Let jq escape backslashes in gen-bugnote. 2021-11-11 02:41:32 +00:00
Gerald Combs 9f46ae74ff SHICP: Provide a valid string length.
Fixes #17723.
2021-11-10 18:27:34 -08:00
Gerald Combs 87b84b7813 Lua is a proper name. Fix its capitalization. 2021-11-11 01:08:51 +00:00
John Thacker 139c04f40a DLEP: Desegment messages over TCP
Handle multiple message PDUs in a single TCP segment, and DLEP messages
split across multiple segments. Fix #17669.
2021-11-11 00:13:23 +00:00
Роман Донченко 4c75a78f26 Refactor generate_authors.pl to remove the text duplicated from AUTHORS.src
Now the script just copies the corresponding sections from AUTHORS.src.
2021-11-10 23:59:21 +00:00
Роман Донченко 614c64b3b5 Synchronize the acknowledgements between AUTHORS.src and generate_authors.pl
Note that the Henrik Brix Andersen and Christophe Devine acknowledgements
were deliberately removed in 272becd8.
2021-11-10 23:59:21 +00:00
Роман Донченко b95be90d27 tools/generate_authors.pl: simplify repeated I/O code
By using the `open` pragma and `say` function, we can get Perl to do the
encoding, decoding and line termination for us.
2021-11-10 23:59:20 +00:00
Gerald Combs eda588d1a6 Revert "Qt: fix memory leaks found by Visual Leak Detector"
This reverts commit c2edb44a9a.

While we should definitely avoid leaking memory, this runs up against
the Qt code's assumption that it will always have valid epan data.

Fixes #17590.
Fixes #17719.
2021-11-10 11:48:26 -08:00
Gerald Combs 7a30021aef Revert "Qt: Fix epan cleanup exit crash"
This reverts commit 5f50fad289.
2021-11-10 11:48:09 -08:00
João Valverde 6f1b814e25 Fix some narrowing compiler warnings
C:\Development\wireshark\wireshark\epan\ftypes\ftype-integer.c(448,47): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data [C:\Development\wsbuild-msvc\epan\ftypes\ftypes.vcxproj]
C:\Development\wireshark\wireshark\epan\ftypes\ftype-integer.c(448,47): warning C4267:          guint32_to_str_buf(fv->value.uinteger, buf, size); [C:\Development\wsbuild-msvc\epan\ftypes\ftypes.vcxproj]
C:\Development\wireshark\wireshark\epan\ftypes\ftype-integer.c(448,47): warning C4267:                                                      ^ [C:\Development\wsbuild-msvc\epan\ftypes\ftypes.vcxproj]
C:\Development\wireshark\wireshark\epan\ftypes\ftype-integer.c(793,31): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data [C:\Development\wsbuild-msvc\epan\ftypes\ftypes.vcxproj]
C:\Development\wireshark\wireshark\epan\ftypes\ftype-integer.c(793,31): warning C4267:  guint64_to_str_buf(val, buf, size); [C:\Development\wsbuild-msvc\epan\ftypes\ftypes.vcxproj]
C:\Development\wireshark\wireshark\epan\ftypes\ftype-integer.c(793,31): warning C4267:                               ^ [C:\Development\wsbuild-msvc\epan\ftypes\ftypes.vcxproj]
C:\Development\wireshark\wireshark\rawshark.c(1140,24): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [C:\Development\wsbuild-msvc\rawshark.vcxproj]
C:\Development\wireshark\wireshark\rawshark.c(1140,24): warning C4267:         fs_len = strlen(fs_buf); [C:\Development\wsbuild-msvc\rawshark.vcxproj]
C:\Development\wireshark\wireshark\rawshark.c(1140,24): warning C4267:                        ^ [C:\Development\wsbuild-msvc\rawshark.vcxproj]
2021-11-10 16:13:17 +00:00
João Valverde 6ad14ac4fa ftypes: Remove fvalue_string_repr_len()
The implementation is pre-computing the length and using that
to allocate a buffer. This doesn't have any practical advantage
and is inefficient because the code is mostly doing the same work
twice. Remove the unnecessary length pre-computation step.
2021-11-10 16:02:45 +00:00
João Valverde b49abcb215 epan: Remove fvalue_string_repr_len() from the public API
This function is unnecessary. Clients are receiving a wmem-allocated
buffer and have no need to know the length apriori.
2021-11-10 16:01:21 +00:00