Commit Graph

2585 Commits

Author SHA1 Message Date
Martin Mathieson a5df18e51e Fix some spelling errors 2021-10-11 04:44:49 +00:00
Martin Mathieson d8b28f8040 Fix some field mask widths. 2021-10-07 21:33:49 +00:00
Evan Huus 07f5472aa7 to_str: scope tvb_ip_to_str 2021-10-07 10:25:12 -04:00
Martin Mathieson b240d5baa0 Ethercat: try to fix EEPROM Ctrl/Status bitmask fields
Fixes remaining errors detected by

./tools/check_typed_item_calls.py --mask
2021-10-06 04:53:50 +00:00
Evan Huus e578c6caee to_str: pull scope arg up into tvb_ether_to_str
There are a bunch of near-identical macros here, but I'm gonna change
one at a time or else the builder times out at the number of files
changed in one merge.
2021-10-04 17:10:17 +00:00
Evan Huus 3cdada3e7b guids: wmem-scope lookups
Avoids the use of the global unprotected packet memory pool and lets the
compiler enforce scoping.
2021-09-28 15:07:55 -04:00
Roland Knall 0c7d82d8b7 USBDump: Fix Memleak with error info
The memory block the error was written to was uninitialized
2021-09-24 06:57:28 +00:00
Martin Mathieson fee630dbdc Fix the lengths of some masks. 2021-09-22 09:38:09 +01: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 5f79503d67 Fix config.h include order
The header "config.h" needs to be the first header included in the
source file, no exceptions.
2021-09-20 20:16:52 +01: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
Guy Harris 3cb6403a4c wiretap: always allocate a block for a record.
Without that, you could add a comment to a record in a file format the
reading code for which doesn't allocate blocks, but the comment doesn't
get saved, as there's no block in which to save the comment option.

This simplifies some code paths, as we're either using the record's
modified block or we're using the block as read from the file, there's
no third possibility.

If we attempt to read a record, and we get an error, and a block was
allocated for the record, unreference it, so the individual file readers
don't have to worry about it.
2021-08-29 19:12:13 -07:00
Martin Mathieson 70e26d691e Some spelling fixes. 2021-08-27 22:21:40 +00:00
Vahap Emin Agaogullari c8d29e9f15 PROFINET: DCP Option dissection updated
DCP Frames with Reserved Option dissection changed
short time ago. There isn't a predefined suboption
for Reserved option in the standard. But in this
implementation it dissected like control suboption.
This is not true and creates malformed frames in some
dcp pcaps. This implementation is reverted.
Wireshark will dissect undefined bytes as paddings
just like before.
2021-08-26 05:28:35 +00:00
Guy Harris 1ab3711132 gryphon: explain in detail why we can't import tfs strings from libwireshark. 2021-08-25 17:29:59 -07:00
Evan Huus 9311982664 plugins: convert to pinfo->pool
Convert all plugin dissectors from wmem_packet_scope to pinfo->pool.
2021-08-25 14:30:47 +00:00
Guy Harris a70c120a04 gryphon: get rid of unused variables.
Found by cppcheck.
2021-08-25 08:57:47 +00:00
Martin Mathieson c0faa8f1da Some more dissector spellings. 2021-08-08 22:21:38 +01:00
ZhaoHao 272ed7a05a trailing whitespace 2021-08-06 06:53:38 +00:00
ZhaoHao 389e19f593 trail whitespace 2021-08-06 06:53:38 +00:00
ZhaoHao 7c27bce458 format the code 2021-08-06 06:53:38 +00:00
ZhaoHao eadcd5f080 add profidrive 2021-08-06 06:53:38 +00:00
João Valverde 7b845e7194 wsutil: rename bytestring_to_str() -> bytes_to_str_punct() 2021-07-29 17:23:05 +00:00
João Valverde 133b0c583f Move epan/wmem/wmem_scopes.h to epan/
This header was installed incorrectly to epan/wmem_scopes.h.

Instead of creating additional installation rules for a single
header in a subfolder (kept for backward compatibility) just
rename the standard "epan/wmem/wmem.h" include to
"epan/wmem_scopes.h" and fix the documentation.

Now the header is installed *correctly* to epan/wmem_scopes.h.
2021-07-26 14:56:11 +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
Evan Huus 57fcadf5af wimax: fix field abbrev
Fixes pre-commit warning
"wimax.dcd.dl_burst_profile_multiple_fec_types doesn't match PROTOABBREV"

All the other fields of this dissector use `wmx` not `wimax`.
2021-07-19 19:32:22 -04:00
Evan Huus f54493278f Delete various unused fields
Discovered during the build failure of
https://gitlab.com/wireshark/wireshark/-/merge_requests/3695
2021-07-17 16:35:41 -04:00
Gerald Combs 8834b470d0 CMake: Fixup SpanDSP's TIFF includes.
Add TIFF_INCLUDE_DIR to SPANDSP_INCLUDE_DIRS, but only if TIFF has been
found.

Ping #17477.
2021-07-14 09:10:09 -07:00
Gerald Combs ff60fcf92d CMake: Adjust wsutil includes and linking.
Mark wsutil's includes SYSTEM PRIVATE. This exposed a lot of targets
that were indirectly picking up include paths via the wsutil target, so
add direct includes where needed. The G.722 and G.726 codecs were
implicilty including tiffio.h; find it explicitly instead.

Mark some of wsutil's libraries PRIVATE, but leave commonly-used ones
PUBLIC.

Ping #17477.
2021-07-14 03:56:05 +00:00
Chuck Craft a7d927a9e9 prefs_register_protocol_obsolete protocols with only obsolete prefs
Related to #17465 and !3526
2021-07-13 23:12:04 +00:00
Martin Mathieson 030d659f88 More mask checks and some fixes. 2021-07-11 14:55:55 +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 Tschoepe d3ec582c26 PROFINET: Ensure multiple submodules are parsed
GSML parsing has a bug related to multiple submodules,
such that, the first submodule found in the GSDML needs
to be the PROFIsafe element, otherwise the description
is not parsed.
2021-06-30 13:45:18 +00:00
Gerald Combs 4609bc4ad5 CMake: Mark our plugin include directories PRIVATE.
Use target_include_directories to mark our local include directories
PRIVATE, similar to what we do elsewhere.
2021-06-22 22:17:42 +00:00
João Valverde 8cf9791679 Replace some lingering references to g_log() 2021-06-19 02:34:36 +00:00
João Valverde 0e50979b3f Replace g_assert() with ws_assert() 2021-06-19 01:23:31 +00:00
João Valverde 39df3ae3c0 Replace g_log() calls with ws_log() 2021-06-16 12:50:27 +00:00
basakkalfa 7132fcaeb0 PROFINET: DCP SET Block with 0 Block Length
If there is DCP SET block with 0 block length, it is dissected
as erroneous block since DCP SET block can not have 0 block
length. Moreover, DCPBlockLength is not decoded if DCP option
and suboption is 0. However, each DCP block must have
Option/Suboption/DCPBlockLength. This is also fixed.
2021-06-09 05:23:16 +00:00
João Valverde 9ba97d12d6 Add ws_debug() and use it
Replace most instances of ws_debug_printf() except in
epan/dissectors and dissector plugins.

Some replacements use printf(), some use ws_debug(), and
some were removed because they were dead or judged to be
temporary.
2021-05-24 01:13:19 +00:00
Martin Tschoepe d9a93acc93 PROFInet: Correct handling for multiple APIs
When dissecting messages with multiple API types
within the same message, the parsing of the connect
request fails to take all elements into account.
This results in only partial parsing of the elements.

This fix ensures that all parts of the message are taken
into account and dissected correctly.
2021-05-23 20:47:50 +00:00
Guy Harris 57a1514ac7 Cast away the return value of g_strlcpy() and g_strlcat().
Most of the time, the return value tells us nothing useful, as we've
already decided that we're perfectly willing to live with string
truncation.  Hopefully this keeps Coverity from whining that those
routines could return an error code (NARRATOR: They don't) and thus that
we're ignoring the possibility of failure (as indicated, we've already
decided that we can live with string truncation, so truncation is *NOT*
a failure).
2021-04-30 03:19:19 -07:00
Gerald Combs a27391ab16 Plugins: Add missing prototypes.
Fixes -Wmissing-prototypes found by Clang.
2021-04-16 20:32:23 +00: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
Basak Kalfa e04ea5c108 PROFINET: Rsi dissection errors are fixed.
According to specification, size of PROFINETIOServiceResPDU
is calculated and checked under dissect_RSI_RSP_block
function. Moreover, dissect_rsi_blocks function is added and
type of PDU and operation number (Opnum) are checked before
dissection starts.
2021-04-10 08:09:18 +00:00
João Valverde d7401147b4 CMake: Remove non existent '/codecs' include path
The '/codecs' dir was removed in g63af1da7e7.

Avoid using include_directories(), prefer target_include_directories().
Remove some unnecessary CMAKE_CURRENT_*_DIR includes and some other
small cleanups while at it.
2021-03-29 00:00:57 +00:00
João Valverde 0fd2033ba2 plugin_ifdemo: Add missing QtMultimedia dependency
On my system I had to add a QtMultimedia dependency to get this plugin
to build.
2021-03-29 00:00:57 +00:00
João Valverde b807020537 'stats_tree' is not a dissector plugin (CheckAPI.pl) 2021-03-02 18:38:30 +00:00
João Valverde 8f7303df82 Fix checkapi stats_tree files
Should not include "plugin.c".
2021-03-01 21:19:40 +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
Vahap Emin Agaogullari e247ffa906 PROFINET: Multiple write in record dissection
COContainerContent dissects PDInterfaceMrpDataAdjust and
PDInterfaceMrpDataAdjust dissects remaining COContainerContent
because of offset problem. Offset problem is fixed.
2021-02-28 14:45:55 +00:00