Commit Graph

2688 Commits

Author SHA1 Message Date
Martin Mathieson d17c018013 tools/check_typed_item_calls: check FT_BOOLEAN mask length 2022-12-15 13:28:05 +00:00
João Valverde 79c3a77752 Add macros to control lemon diagnostics
Rename flex macros using parenthesis (mostly a style issue):

DIAG_OFF_FLEX -> DIAG_OFF_FLEX()
DIAG_ON_FLEX  -> DIAG_ON_FLEX()

Use the same kind of construct with lemon generated code using
DIAG_OFF_LEMON() and DIAG_ON_LEMON(). Use %include and %code
directives to enforce the desired order with generated code
in the middle in between pragmas.

Fix a clang-specific pragma to use DIAG_OFF_CLANG().

DIAG_OFF(unreachable-code) -> DIAG_OFF_CLANG(unreachable-code).

Apparently GCC is ignoring the -Wunreachable flag, that's why
it did not trigger an unknown pragma warning. From [1}:

  The -Wunreachable-code has been removed, because it was unstable: it
  relied on the optimizer, and so different versions of gcc would warn
  about different code.  The compiler still accepts and ignores the
  command line option so that existing Makefiles are not broken.  In some
  future release the option will be removed entirely. - Ian

[1] https://gcc.gnu.org/legacy-ml/gcc-help/2011-05/msg00360.html
2022-11-20 10:11:27 +00:00
Martin Mathieson 709d65883f Fix some cppcheck issues 2022-11-18 10:07:57 +00:00
João Valverde cfbe898dcc CMake: Disable -Werror for flex generated files 2022-11-17 10:23:12 +00:00
João Valverde 09718fb9b3 CMake: Move clang warnings
Move clang warnings to normal set. Let the CMake compatibility
check control the warning.

Fix or work-around -Wunreachable warnings in the code.
2022-11-17 01:35:16 +00:00
John Thacker 1a04473ca8 opcua: Quiet a Coverity warning
It really shouldn't be possible to have a fragment head with
no fragment items here, but quiet Coverity CID 1516904 here.
2022-11-15 17:08:53 -05:00
John Thacker 4f3b028d94 epan: Separate fragment_head and fragment_item
Separate fragment_head and fragment_item into two
different types of structs.

Remove "offset" from fragment_head, which was unused,
making fragment heads 4 bytes smaller.

Remove fragment_nr_offset, datalen, reassembled_in,
reas_in_layer_num, and error from fragment_item,
making them 24 bytes smaller.

Change a few dissectors which were using fragment_head
and fragment_item indistinguishably.

Ping #17311
2022-11-14 01:18:11 +00:00
Tim Potter b484c41811 wimaxasncp: Fix dissection of message type in packet header
It looks like there was a cut&paste error a long time ago resulting
in the wimaxasncp.message_type field being incorrectly detected as
unused and commented out. Closes #18424.
2022-10-13 14:51:03 +00:00
Dirk Ziegelmeier 8f7d0b2af5 Fix issue #18391
Profinet PNIO-CM Connect Response Error Decode Incorrect
2022-10-11 11:28:54 +00:00
Guy Harris 3db17dab82 transum: expert infos are not Boolean fields.
They're of type FT_NONE, meaning that they do not have values, they're
just present or not.

Handle the TCP analysis fields "tcp.analysis.retransmission" and
"tcp.analysis.keep_alive", both of which are expert infos, by just
seeing if they're present or not.

Fixes a problem mentioned in a comment in merge request !8412.
2022-10-10 16:00:53 -07:00
David Perry 68a581afdc esl_eth: support nanosecond timestamps
Applies the patch from #18308, in lieu of original commenter doing so.

Closes #18308
2022-10-08 14:01:19 +00:00
Guy Harris b2cbc6f034 TRANSUM: fix fetching of Boolean values.
As of a change many years ago, Boolean values are stored as 64-bit (the
change was made to handle Boolean bitfields in 64-bit fields).  Fix the
extractor for Boolean values to fetch from the 64-bit unsigned integer
field, and, while we're at it, add a change that the field in question
really *is* a Boolean field (the functions used to fetch the value in
the other extractors do such a check).
2022-10-05 14:57:08 -07:00
David Perry b2ace05edc TRANSUM: claim 0 bytes of packet data
The TRANSUM post-dissector performs timing analysis, and does not
dissect any of the packet data; all its calls to `proto_tree_add_foo()`
claim 0 bytes. So this fix claims 0 bytes for the overall TRANSUM
protocol tree as well.

Fixes #18241
2022-09-29 11:17:36 +00:00
Jaap Keuter b092fa05da Replace the last of PROTO_ITEM_ macro calls with function calls 2022-09-29 05:59:12 +00:00
Anders Broman 83a0ec0647 opcua: Squelch a couple of warnings by adding casts. 2022-09-07 08:19:39 +00:00
Guy Harris 8195bdd340 Rename a bunch of things with "conversation".
A conversation in Wireshark might have two endpoints or might have no
endpoints; few if any have one endpoint.  Distinguish between
conversations and endpoints.
2022-08-25 20:02:20 -07:00
Gerald Combs f854083fd8 Falco Bridge: Add a NULL check. 2022-08-19 04:38:05 +00:00
Gerald Combs ec1986cb97 Falco Bridge: Update to match falcosecurity-libs 0.8.0.
Update sinsp-span to use the current Falco libs APIs. Update the
FindSinsp CMake module to use pkg-config.
2022-08-15 16:21:47 -07:00
Chuck Craft bbb9610cb3 pluginifdemo: Qt5->Qt6; bump version to 0.0.2 2022-08-15 05:07:46 +00:00
David Perry 43d499ca45 Use `register_dissector()` for more protocols 2022-08-09 18:50:08 +00:00
João Valverde 80f16015e2 epan: Refactor floating point display types
Remove the redundant BASE_FLOAT field display type. The name
BASE_FLOAT is meaningless and the value aliased to BASE_NONE.

Require BASE_NONE instead of BASE_FLOAT (corresponding to
the printf() %g format).

Add new float display types using BASE_DEC, BASE_HEX and BASE_EXP
corresponfing to %f, %a and %e respectively.

Add support for BASE_CUSTOM with floats.
2022-08-02 13:16:46 +00:00
Uli Heilmeier 54b4be9015 ECATMB: Add SDO Information to CANopenType
Fixes #18220
2022-07-23 16:16:27 +02:00
Gerald Combs 75efbb1ac4 Rename Logwolf to Logray
Switch to the name "Logray" for the log analyzer. Rays are biological
cousins of sharks and more people like the name "Logray" in a completely
unscientific survey here. Apologies for any inconvenience this might
cause.
2022-07-06 15:04:25 +00:00
Martin Mathieson eab62aa768 Fix some spellings. 2022-07-06 09:02:37 +01:00
John Thacker 4d57854294 ethercat: Fix EEPROM Ctrl/Status bitmask fields
When the field width was corrected by commit
b240d5baa0, the masks got messed
up. There's 4 reserved bits that don't have fields and the bits
are in Little Endian order. Fix #18132.
2022-06-16 03:51:59 +00:00
Roland Knall 2cf938cfa8 tap: Adding flags for tap_packet
This allows flags to be passed by the registering listener
to the collection of information
2022-06-10 05:46:15 +00:00
Stig Bjørlykke 4fa4cad396 irda: Use correct conversation_new() options
Fix conversation_new() options after they was changed/improved
in commit 709593ee.
2022-06-09 20:59:17 +00:00
Dirk Ziegelmeier 66b73ddd11 Profinet plugin: Dissect writing I&M1 and I&M2, too 2022-05-31 15:29:24 +00:00
Dirk Ziegelmeier 1438336c1d Profinet plugin: Decode more error codes
according to PN Protocol 2.4MU3 April 2022
2022-05-31 15:29:24 +00:00
Gerald Combs be929e162d epan: Allow conversations based on arbitrary element lists.
Add conversation_new_full and find_conversation_full, which take
arbitrary element lists instead of fixed addresses and ports.

Update the comments in conversation.h to be more Doxygen-conformant.
Update README.dissector.

Use the new functionality to add initial conversation support to the
Falco Bridge dissector.
2022-05-23 18:12:26 +00:00
Matthias Dietrich 7b53720999 Use proto_tree_add_item where possible 2022-05-21 07:52:07 +00:00
Matthias Dietrich cc4223f537 Add PA Profile 4.02 diagnostics codes 2022-05-21 07:52:07 +00:00
Matthias Dietrich 85eb9fba4d Dissect PA Profile IO data 2022-05-21 07:52:07 +00:00
Matthias Dietrich 225e90564d Resolve PA Profile 4.02 submodule names 2022-05-21 07:52:07 +00:00
Gerald Combs 6b07710188 Falco Bridge: API updates.
Update to the current (c02ae4b6) API.
2022-05-19 12:52:37 -07:00
Gerald Combs fd76c7ea80 Falco Bridge: Fix address field registration. 2022-05-19 11:16:56 -07:00
Gerald Combs f85d4a5763 Falco Bridge: Fix a couple of bugs.
Make sure a pointer is valid and only initialize our sinsp span once.
2022-05-03 19:29:51 -07:00
Gerald Combs 3336ec24ac Falco Bridge: Add typed address fields.
libsinsp currently only supports string and unsigned 64-bit integer
field types. For string fields that might contain a parseable address,
add ".v4" and ".v6" subtree items with a corresponding field type.

For example, the ct.srcip field now dissects as

Sysdig Event 1: 880 bytes
Falco Bridge
cloudtrail Plugin
    [ ... ]
    Source IP: 3.92.225.50
        [Source IP (IPv4): 3.92.225.50]
2022-04-29 12:13:34 -07:00
Gerald Combs 52db7e88bc Falco Bridge: Fix building on Windows.
Fix Falco plugin installation in multi-config environments. Fix FindSinsp
on Windows.  Ignore a couple of warnings for now.
2022-04-27 22:01:17 +00:00
Gerald Combs 0f695875ac Falco Bridge: Switch to the sinsp capabilities API.
falcosecurity/libs 448c380e switched from a plugin type to a more
generic capabilities enum.
2022-04-27 22:01:17 +00:00
Dirk Ziegelmeier c27d8bbedd Profinet plugin: Add severity according to PA Profile 4.02 2022-04-27 20:29:57 +00:00
Gerald Combs 2141f0f03b Falco Bridge: Update to match the current libsinsp API.
The extract_fields struct and calling convention changed, so update to
match. Extract all of our fields at once, which noticeably speeds up
dissection here.
2022-04-26 17:11:21 +00:00
Gerald Combs dbf3ac3701 CMake+Logwolf: Populate our Falco plugin directory.
Create plugins/<version>/falco and copy over the Cloudtrail plugin.
2022-04-25 12:07:48 -07:00
Vahap Emin Agaogullari 7e0d0eb418 PROFINET: TSN Dissection implemented
TSN Records for pn_io and
pn_dcp TSN Suboption dissected
2022-04-20 07:44:57 +00:00
Gerald Combs 87b0288b8d epan: Add the ability to add conversation filter protocols.
Convert our conversation protocols to a dynamic list and add
add_conversation_filter_protocol(). Use it in the Falco Bridge plugin to
add protocols with conversation filters.
2022-04-19 22:25:32 +00:00
Matthias Dietrich 86bc544fd3 PROFINET: Fix count of IO data objects and IOCS
Split the counts of IO data objects and IOCS between
input and output. Remove increment of IO data objects
in station information, sometimes leading to extremely
high and invalid number of IO data objects.
2022-04-16 13:57:16 +00:00
Matthias Dietrich dcffa0303a PROFINET: Split number of IOCS between in and out
Currently a single counter is used, but the number of
IOCS is not necessarily the same for input and output
CRs.
2022-04-16 13:57:16 +00:00
Gerald Combs 8528fca055 Falco Bridge: Misc cleanup.
Remove unused header definitions in packet-falco-bridge.h and move the
remaining content to packet-falco-bridge.c and conversation-macros.h.
Explicitly set our header files in CMakeLists.txt.
2022-04-13 13:51:06 -07:00
Gerald Combs 57172fe4cd CMake: Finish splitting ADD_PLUGIN_LIBRARY.
Rename add_plugin_library to add_wireshark_plugin_library and add a
backward compatibility wrapper. Make Falco Bridge a Logwolf plugin.
2022-04-04 23:10:57 +00:00
Gerald Combs 23ed784ce1 Falco Bridge: Fix a function declaration.
Fix

../plugins/epan/falco_bridge/packet-falco-bridge.c: In function ‘register_conversation_filters_mappings’:
../plugins/epan/falco_bridge/packet-falco-bridge.c:105:1: error: old-style function definition [-Werror=old-style-definition]
 register_conversation_filters_mappings()
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-04-04 21:21:10 +00:00