Commit Graph

84024 Commits

Author SHA1 Message Date
João Valverde 4d9470e7dd dfilter: Add location tracking to scanner and use it to report errors
Add location tracking as a column offset and length from offset
to the scanner. Our input is a single line only so we don't need
to track line offset.

Record that information in the syntax tree. Return the error location
in dfilter_compile(). Use it in dftest to mark the location of the
error in the filter string. Later it would be nice to use the location
in the GUI as well.

$ dftest "ip.proto == aaaaaa and tcp.port == 123"
Filter: ip.proto == aaaaaa and tcp.port == 123
dftest: "aaaaaa" cannot be found among the possible values for ip.proto.
	ip.proto == aaaaaa and tcp.port == 123
	            ^~~~~~
2022-04-10 10:09:51 +01:00
João Valverde da19379eb5 dfilter: Create the syntax node in the scanner and pass that
Revert to passing a syntax node from the lexical scanner to the grammar
parser. Using a union is not having a discernible advantage and requires
duplicating a lot of properties of syntax nodes.
2022-04-10 09:54:03 +01:00
Matthias Ringwald d23fec2116 bluetooth: show packet status in info column 2022-04-09 22:57:34 +02:00
Matthias Ringwald 50de7dd6ca bluetooth: show SCO packet type in col_protocol 2022-04-09 19:10:44 +02:00
João Valverde fb9a176587 dfilter: Allow grouping arithmetical expressions with { }
This removes the limitation of having only two terms in an
arithmetic expression and allows setting the precedence using
curly braces (like any basic calculator).

Our grammar currently does not allow grouping arithmetic expressions
using parenthesis, because boolean expressions and arithmetic
expressions are different and parenthesis are used with the former.
2022-04-08 23:12:04 +01:00
Gerald Combs 73770c61b4 Qt: Add a null pointer check.
Don't assume the main window has an SCTP menu.
2022-04-08 19:57:13 +00:00
Chuck Craft b52437ba28 WSUG/tshark: protocol summary and output with "-e" 2022-04-08 19:40:43 +00:00
Gerald Combs b5fef40379 Git: Fix our debian ignore.
We create a top-level symlink to packaging/debian in GitLab CI, so only
ignore that.
2022-04-08 19:24:18 +00:00
Chuck Craft 6e9b19dcb0 Qt: only Show/Export Packet Bytes when field is selected and has_packet_bytes
This will also exclude generated [] and Lua added fields.
2022-04-08 18:47:42 +00:00
Pascal Quantin b7ba126644 F1AP: upgrade dissector to v16.9.0 2022-04-08 16:41:20 +00:00
Pascal Quantin ab71cb51ff XnAP: id-TargetNodeID is a protocol IE 2022-04-08 16:11:40 +00:00
Pascal Quantin 894762b654 X2AP: fix a typo 2022-04-08 15:42:00 +00:00
Pascal Quantin 82f268789c E1AP: upgrade dissector to v16.9.0 2022-04-08 17:12:15 +02:00
Pascal Quantin 3bf9bc6326 XnAP: upgrade dissector to v16.9.0 2022-04-08 16:45:15 +02:00
Pascal Quantin c9353fdece NGAP: upgrade dissector to v16.9.0 2022-04-08 14:16:59 +00:00
Pascal Quantin 4b42dcf3c0 X2AP: upgrade dissector to v16.9.0 2022-04-08 13:46:58 +00:00
Pascal Quantin e101aa6e78 S1AP: upgrade dissector to v16.9.0 2022-04-08 15:22:29 +02:00
John Thacker f0f0f05060 editcap: Document use of stdin and stdout
Editcap accepts '-' for stdin or stdout, document that. Also change
an incorrect statement that claims that the '-v' flag writes to
standard output; it writes to standard error.
2022-04-07 20:57:08 -04:00
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