Commit Graph

84006 Commits

Author SHA1 Message Date
Gerald Combs 37ccc2b0e5 GitLab CI: Build Logwolf in the Code Checks + Clang Warnings job. 2022-04-07 23:46:20 +00:00
Gerald Combs c5da4f661a Logwolf: Fix building on Windows.
Add a couple of missing resource files. Fix a couple of paths.
2022-04-07 23:28:54 +00:00
Roman Schmitz 545553e203 Update tools/macos-setup-brew.sh 2022-04-07 23:27:08 +00:00
Chuck Craft 0c316ec1a9 NSIS/Wix: missing preferences file for Bluetooth profile 2022-04-07 22:09:02 +00:00
Gerald Combs 54553de59d wsutil: Use a separate "extlog" directory for Logwolf extcaps.
If we're running in the Logwolf configuration namespace, look for
extcaps in a directory named "extlog". This paves the way for adding
log-specific capture utilities.
2022-04-07 21:41:36 +00:00
Joel Colledge ddbafcd9ba DRBD: Add support for dissecting DRBD on InfiniBand
InfiniBand and RDMA over Converged Ethernet (RoCE) are handled by the
infiniband dissector. Register DRBD as a dissector for infiniband
payloads.

Not yet implemented:
* Dissection of data payloads. For P_DATA and similar packets, the data
  payload is transmitted over multiple packets. Only the first packet
  containing the DRBD header is dissected.
* Dissection of the InfiniBand Immediate Data. DRBD uses this for
  sequence numbers and for indicating which stream the packet belongs
  to.
* Any attempt to associate packets into conversations. This could be
  achieved when the connection packets have been captured, but would be
  very difficult otherwise.
* An association with infiniband.cm.req.serviceid.dport. When using
  RoCE, this is the port that the user specifies for the connection, so
  it would be useful to associate it with the DRBD conversation and show
  it. Otherwise it is tricky to identify DRBD connections.
2022-04-07 19:13:14 +00:00
Thomas Jansen aac695d62e icmpv6: Fix dissection of PREF64 option for shorter prefixes
RFC 8781 shows in section 4 that the prefix field of the PREF64 option
header is always 96 bits (or 12 bytes), regardless of the prefix length
code that only specifies which parts of the prefix are significant. The
option itself thus always has a fixed length. Even if they are not used
in the significant part of the prefix itself, the unused bits are still
part of the prefix field of the PREF64 option and the offset must be
adapted accordingly.

The previous implementation would fail to correctly parse any PREF64
option with a PLC other than 0 (i.e. the full 96 bits) due to the unused
remaining bits in the option not being consumed.

Closes #18033.
2022-04-07 09:09:36 +00:00
Stig Bjørlykke bcb992c4fb nas_eps: Fix typo in function name
Fix typo in dissect_nas_eps_esm_msg().
2022-04-07 07:13:00 +00:00
Richard Sharpe 34f8420d1e ieee80211: Correct the dissection of the 802.11ax Capabilities device class.
The numbers were reversed.

Closes #18030
2022-04-06 18:31:50 -07:00
Matthias Ringwald c3c94ff4fd Bluetooth: print event code for unknown HCI events 2022-04-06 23:35:33 +00:00
João Valverde cc5726b63f dfilter: Remove leading colon special meaning
Instead of saying a leading colon will make any token a literal
value, say it is part of the syntax of bytes arrays. This is
useful to write bytes without a separator, and other potentially
ambiguous formats.

The restriction in meaning to bytes and simple numeric values
should make the rules for handling a leading colon (specifically
ommiting it or not) saner without much loss of functionality.
2022-04-07 00:16:07 +01:00
João Valverde 0313cd02bc dfilter: Fix RHS bias for literal values
Fixes a3b76138f0.
2022-04-06 23:46:22 +01:00
João Valverde 7429832db4 Fix a log message 2022-04-06 23:42:04 +01:00
Jaap Keuter 8d646c1657 DHCPv6: Fix interpretation of user class data length fields
Closes #18032
2022-04-06 19:11:58 +00:00
Jorge Mora d681da2534 IWARP_DDP_RDMAP: add MPA error codes given by RFC6581 2022-04-06 18:55:55 +00:00
Jorge Mora c59315c45a IWARP_DDP_RDMAP: add MPA error codes given by RFC5044
Add error type name mapping for the LLP (Lower Layer Protocol).
Add error code name mapping for the MPA Error type.
2022-04-06 18:55:55 +00:00
Jorge Mora 6630bee851 IWARP_DDP_RDMAP: fix error codes for RDMA layer
Display the error code name only if it is not an RDMA Local
Catastrophic error type.
2022-04-06 18:55:55 +00:00
Jorge Mora d4cfae1b72 IWARP_DDP_RDMAP: change Terminate header bits to set-notset 2022-04-06 18:55:54 +00:00
Jorge Mora 72b44d13ea IWARP_DDP_RDMAP: fix Terminate opcode tree hierarchy
The Terminate Control tree should be under the Terminate tree.
2022-04-06 18:55:54 +00:00
Jorge Mora 63c1b032c8 IWARP_DDP_RDMAP: fix Terminate layer name mapping 2022-04-06 18:55:54 +00:00
João Valverde c30a417528 dflter: Add test 2022-04-06 18:37:23 +01:00
João Valverde 5584aba326 dfilter: Fix slice using range [:j]
Fixes:

$ dftest 'frame[:10] contains 0xff'
dftest: ":10" is not a valid range.
2022-04-06 18:35:10 +01:00
João Valverde a6f37323e6 dfilter: Clean up lexical scanning 2022-04-06 18:11:27 +01:00
João Valverde 6057d1a6e2 dfilter: Add more IPv6 tests 2022-04-06 18:09:12 +01:00
João Valverde 8108e67de7 dfilter: Fix memory leak with leading colon
When retrying fvalue_from_literal() we were leaking the error
message string.

Refactor the code to avoid the retry. This assumes the only
valid use of a leading ':' with a literal is for an IPv6 address.

Bytes with leading ':' are supported but the colon is skipped,
so the parser doesn't see it.

Fixes df0fc8b517.
2022-04-06 18:09:12 +01:00
Gerald Combs 85be944ebe CMake: Make sure Logwolf includes dumpcap on macOS.
Copy dumpcap into Logwolf's application bundle.
2022-04-06 09:08:12 -07:00
Gerald Combs a0ae42e33b wiretap: Update a comment.
Wireshark's file formats are now listed in WiresharkInfo.plist.in.
2022-04-06 07:44:33 -07:00
John Thacker c2e1ee2e57 tcp: Rework out of order dissection to dissect sooner
Rework the out of order dissection to store the out of order
segments and add them to reassemblies only after the gaps are filled.
This allows reassembly of contiguous segments to be dissected when
they can, instead of having to wait for all segment gaps to be
filled. In cases where a segment has an erroneous later sequence number,
this prevents reassembly from being completely halted.

It is now guaranteed that when the subdissector is called that the
segment from the current frame is either the first segment of the
MSP or has bytes that were requested from the last call of the
subdissector. This makes it easier to split MSPs in a later commit.
MSPs now always have the first segment with the sequence number,
so MSP_FLAGS_MISSING_FIRST_SEGMENT and first_frame_with_seq are
obsolete and can be removed later.

This fixes a long standing TODO in the out of order test in
suite_dissection.py

Dissection is more consistent between the first pass and later
passes, though there is more to be done.
2022-04-06 08:41:58 -04:00
John Thacker 444e3f230c tcp reassembly: Add fragment_add_out_of_order 2022-04-06 07:53:02 -04:00
John Thacker 4e184104af exceptions: Add an expert warning for FragmentBoundsError
FragmentBoundsErrors aren't malformed, but add an expert warning
at the PI_NOTE level to hint to users that they may want to turn
on reassembly preferences.
2022-04-06 07:17:14 -04:00
João Valverde 12c8cc32f0 dfilter: Fix parsing of some IPv6 compressed addresses
Fix parsing of some IPv6 addresses and add tests.

Also pass tokens as unparsed unless the user was specfic about
the semantic type. For example the IPv4 address 1.1.1.1 is also a
valid field, but 1.1.1.1/128 is not (because of the slash). However
choose not to enforce the distinction in the lexical scanner and pass
everything as unparsed unless the meaning is explicit in the syntax
with leading dot, colon, or between angle branckets.
2022-04-06 10:10:04 +01:00
Jirka Novak 411b3c1d78 Fix: Fixed issue with deadlock when same RTP dialog opened twice
RTP dialogs can stay opened, therefore calls of its functions are
protected by locks. There was issue that same mutex was used during
construction of the dialog and calling functions. It created possible
deadlock.
Change separates lock used for dialog creation and lock for function calls.
When function call lock is locked, new calls are ignored and warning is
printed to STDERR. Showing a dialog with warning looks too intrusive to me.

Fixes #18025
2022-04-06 07:16:59 +00:00
Maxim Sharabayko 0e269659ec srt: added reference to the internet draft 2022-04-06 05:52:10 +00:00
John Thacker f5567200fa tcp: Mark unreassembled PDUs as fragmented in tcp_dissect_pdus
PDUs on TCP streams can fail to be reassembled for a variety of reasons,
most of which can be determined by the TCP dissector before calling
a subdissector.  However, individual subdissectors can have their own
preference indicating not to desegment, and this cannot be handled until
the subdissector calls tcp_dissect_pdus(). Fix #18027.
2022-04-06 00:04:19 -04:00
João Valverde b4a0b30f88 Regenerate ASN.1 dissectors 2022-04-05 23:14:16 +01:00
Gerald Combs 798136f107 wsutil: Use the correct variable.
Check our configuration namespace, not its name.
2022-04-05 12:16:22 -07:00
João Valverde 7ed5d5036e dfilter: restore support for identifiers using hyphen
Restores support for filters such as "mac-lte", that was broken
in 330d408328.

This means we are not able to support arithmetic expressions with binary
minus without spaces.

$ dftest 'tcp.port == 1-2'
dftest: "1-2" is not a valid number.
2022-04-05 15:38:20 +01:00
Richard Sharpe 454552c149 ieee80211: Conform to ieee802.11-2016 for the Capability Info field.
The format and meaning of the bits in the Capability information field
has been different than what was implemented since at least 802.11-2016.

Defined in 9.4.1.4 Capability Information field.
2022-04-05 13:24:58 +00:00
João Valverde 8fb28f5161 dfilter: Minor grammar cleanup
Remove duplication for arithmetic expressions.
2022-04-05 12:04:37 +01:00
João Valverde 20afbd46ec dfilter: Remove existence test syntax tree nodes
After some experimentation I don't think these two existence tests
belong in the grammar, it's an implementation detail and removing it
might avoid some artificial constraints.
2022-04-05 12:04:37 +01:00
João Valverde fb08c4b4a8 dfilter: Replace bitwise sttype with arithmetic
Most of the bitwise codepaths are just duplicating code for
the arithmetic type. Parse bitwise expressions as arithmetic
instead.
2022-04-05 12:04:37 +01:00
João Valverde c98df5eef5 dfilter: Print syntax tree using dftest + format enhancements
Add argument to dfilter_compile_real() to save syntax tree text
representation.

Use it with dftest to print syntax tree.

Misc debug output format improvements.
2022-04-05 12:04:37 +01:00
João Valverde d91734ab6a dfilter: Fix range registers in DFVM dump 2022-04-05 12:04:37 +01:00
Kenrick Trip cb1b4fb966 Allow building with Qt without Xcode on macOS 2022-04-05 10:31:39 +00:00
Ahmet Alperen 498760b628 IEEE1905: Fix miscalculated offset 2022-04-05 03:28:50 +00:00
Chuck Craft 49c434d012 BER: breakout multi-octet length field 2022-04-05 02:27:00 +00:00
Gerald Combs 550434057e CMake: Make sinsp dependent on Logwolf.
Libsinsp runs on multiple platforms, so change our logic to find it if
we're building Logwolf.
2022-04-04 23:33:50 +00: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 4f3017c000 CMake: Add a jsoncpp include path.
Ubunutu (and presumably Debian) install jsoncpp's include files in
/usr/include/jsoncpp/json.
2022-04-04 21:57:54 +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