Commit Graph

89508 Commits

Author SHA1 Message Date
Gerald Combs adfbd315b6 GitHub CI: Use the latest version of macOS
Use the "macos-latest" image, otherwise we might run into support issues
with Homebrew.

[skip ci]
2023-11-09 12:15:37 -08:00
Gerald Combs 625c1a5ded GitLab CI: Always publish our Debian Stable APT Package artifacts 2023-11-09 09:06:18 -08:00
Anders Broman 0b69bfcafa ANSI-MAP: Add parameters to the OriginationRequest SET 2023-11-09 16:11:49 +01:00
Pascal Quantin 5eea10e4e4 GSM SIM: fix dissection of READ / UPDATE BINARY commands
Fixes #19472
2023-11-09 15:22:15 +01:00
Stig Bjørlykke 7161431cec Qt: Use QLineEdit border only on macOS
Only specify the AccordionFrame and InterfaceToolbar QLineEdit border
on macOS because the default looks ok on other platforms.
2023-11-09 14:31:39 +01:00
Joakim Karlsson 92753cb401 pfcp: correction of Outer Header IE bitshift 2023-11-09 09:58:53 +00:00
John Thacker b34ec48b1e Ethernet, PRP: Convert PRP to trailer dissector
Pass the "payload_offset" value to add_ethernet_trailer, as
used in ethertype (and generally 14 for full frames). This
allows computing the "frame length including addresses before
any tags or trailers were added" which is often where padding
actually starts. This fixes detection of padding vs trailier
with ISL (see Sample Captures page) as well as a large number
of tag formats (802.1AD, etc.), at least when PADDING_ZERO is set.
For PADDING_ANY, continue to use the old length method.

This also allows passing the payload length post-ethertype/length
field to the trailer subdissectors, which allows the PRP dissector
to be converted from a postdissector to a eth trailer heuristic
dissector.

When we are in "maybe FCS" mode, call the heuristic dissectors
twice if need be, once with and once without the putative FCS.
As these are heuristic dissectors, they can't indicate the number
of bytes consumed, so if there's a trailer but also an FCS later,
returning TRUE for the trailer prevents us from detecting an
FCS. (Some heuristic trailer dissectors have loops to deal with
possible padding after the trailer and will return TRUE the first
time; we still can't deal with this. Perhaps they should only
skip before zeros in their loops; in no case are multiple trailers
handled well, previously or now.)

Fix MACsec padding, trailer, and FCS detection when the short length
field is present by calling set_actual_length. The current workaround
has issues because it's only in effect for the next ethertype call
(where fcs_len is 0), not the previous one.

Don't allow computing the FCS when we don't actually have the
entire frame. Most tag dissectors calling the ethertype dissector
a second time set fcs_len to 0 because of this already.

Fix #15884, #17068, #17067

The first two will work automatically in default auto detect mode.
For #17067 this requires setting the "Fixed ethernet trailer length"
pref in ethernet to the PRP size; the more general problem of
autodetecting any FCS or trailer after the MACsec ICV (for non
short length) continues to need a different solution.

Add some relevant comments about still unsolved issues.
2023-11-09 09:19:10 +00:00
John Thacker 4ebb6e9893 tshark: Escape delimiter separated value in compliant ways
If the quote character appears in a field value, then escape
it by printing the character twice. When escaping whitespace
with the backslash character, also escape the backslash
character itself.

Add a ws_escape_csv function to wsutil and use it for tshark.
Adopt the existing static escape_string_len function so that
ws_escape_csv can use it while maintaining the same output
for the other ws_escape_ functions.

Fix #10284
2023-11-09 09:17:03 +00:00
Haiyun Liu 85262b5a89 ISO15765: Fix error in dissection of STmin
The units of STmin in the range 0xF1 – 0xF9 are even multiples of 100µs, where parameter
value 0xF1 represents 100µs and parameter value 0xF9 represents 900µs.
2023-11-09 09:15:46 +00:00
Ernst Oudhof 3d79f131e8 Fix AVP decryption in Radius dissector 2023-11-09 09:13:23 +00:00
Jaap Keuter 4fcceef21c Qt: Remove PINOs from Enabled Protocols dialog
PINOs are controlled through their parent protocol and cannot be
individually enable/disabled.
2023-11-09 09:08:52 +00:00
Maxence Younsi a9c1fa3a68 bmp: version 4 capacility expert info fix 2023-11-09 09:06:24 +00:00
Stig Bjørlykke bdaae9ddef Qt: Add QLineEdit border in AccordionFrame
Add a border and a border-radius to make the QLineEdit used in
AccordionFrame look better on macOS. This is a similar style as
used in DisplayFilterCombo.

Update AddressEditorFrame, ColumnEditorFrame, FilterExpressionFrame
PreferenceEditorFrame, SearchFrame and GoToPacket.

Store the style_sheet in DisplayFilterEdit to be used in
alignActionButtons().
2023-11-09 07:15:03 +00:00
Stig Bjørlykke b2f5ac5123 Qt: Change InterfaceToolbarLineEdit border color
Change the border color to match the border of buttons and drop-downs.
2023-11-09 07:01:36 +00:00
Gerald Combs 3ab45fe831 GitLab CI: Make our Debian symbols downloadable 2023-11-08 16:27:57 -08:00
João Valverde cd757e0c16 Qt: Add macro name validator 2023-11-08 21:19:37 +00:00
João Valverde 3e8e39061f Qt: Remove an errant tr() 2023-11-08 21:19:37 +00:00
Martin Mathieson bc528a344e Fix some more copy/pasted filters 2023-11-07 06:12:31 +00:00
John Thacker 4d23680d25 Qt: Reduce the spacing between the two rows of the search frame
The default MacOS theme seems to have a lot of spacing. See if
this helps.

Related to !12279
2023-11-08 16:42:19 +00:00
João Valverde 7d87367e22 dfilter: Add a function-like macro syntax
Add an alternative macro notation as $mymacro(a,b,c,d). For me
this notation is more natural, I have difficulty remembering how
to use macros with ${mymacro:a;b;c} and it makes the filter
expression harder to understand.

For convenience and to simplify the code we also allow
curly braces to open/close macro argument lists and the semicolon
as an argument separator for the new syntax.

This added flexibility may be reevaluated and dropped later if it
turns out to be undesirable for some reason.
2023-11-08 15:48:00 +00:00
Stig Bjørlykke c568589189 Qt: SyntaxLineEdit state-icon top position
Arrange the SyntaxLineEdit state-icon to always be in the middle.
2023-11-08 13:35:06 +01:00
João Valverde c6af671324 dfilter: Add macro check 2023-11-08 11:47:23 +00:00
João Valverde 9ae752109c dftest: Add option to dump macros 2023-11-08 11:45:54 +00:00
João Valverde bc64efa538 dfilter: Replace macro UAT config file and update GUI
Remove the UAT macro usage. The UAT API is nifty for dissectors
but clunky for everything else.

This allows using a hash table to store macros, that is the natural
data structure for the use case (and faster).

It also allows using the existing filter GUI dialog, adapted for
display filter macros. The difference isn't huge but it's better
and less limited than the more generic UAT dialog, with room for
improvement. Changing the UAT dialog for filter specific
use cases is difficult.

The config file is renamed to "dmacros" and uses the same format
as "dfilter", that is more amenable and forgiving for hand-editing
than the UAT storage format.

There is some logic to convert the "dfilter_macros" UAT config
file to a "dmacros" filter config file, for backward-compatibility.
The conversion is only done if there is no existing "dmacros" file
in the profile folder.
2023-11-08 11:45:54 +00:00
John Thacker 4205d41163 TCP: Don't export PDUs that are desegmented in a later frame
When exporting PDUs from TCP, check to see if the subdissector fully
dissected the PDU, or whether it requested further desegmentation.
Only export the bytes that were actually dissected in the current
frame, if any. The rest will presumably be dissected later.

This should only matter on the first pass, e.g. one-pass tshark.

Fix #15686
2023-11-08 04:26:35 -05:00
Stig Bjørlykke d93cbe28f6 Qt: Add InterfaceToolbarLineEdit border
Add a border and a border-radius to make the LineEdit look better
on macOS. This is the same style as used in DisplayFilterEdit.
2023-11-08 09:52:25 +01:00
John Thacker 5880b2195e Qt: Fix Export Packet Dissections Help button, connections on non-Windows
We have to call findChild to find the QDialogButtonBox after setting
the option to use the Qt dialog instead of the native dialog, not
before. Otherwise, we might not find the QDialogButtonBox.

Fixes adding the Help button to the Export Packet Dissections
dialog, and enabling the validity checks that disable the
save button when, e.g. an illegal range is entered.
2023-11-07 20:10:09 -05:00
João Valverde 398ef5f09b Use case-insensitive capture filter match 2023-11-08 01:03:07 +00:00
João Valverde 177cc29ea6 wsutil: Make filter lists dynamic and on-demand
Do not read the capture filter list unless needed.

Do not use a static list because the capture filter list can change during program execution
and we want to be able to read multiple copies whenever.

Improve the public API function names.
2023-11-08 01:03:07 +00:00
João Valverde cdd2d1902a tests: Use fixture for dftest command 2023-11-08 00:40:47 +00:00
Niels Widger 99a7079bc0 sharkd: Fix displayed delta times in "frames" method
As noted in #17923, commit c4731738 broke timereferences and displayed
delta time (`frame.time_delta_displayed`) in the `frames` method of
`sharkd`.  This commit adds back to `sharkd_session_process_frames`
the local variables `prev_dis_num`, `current_ref_frame` and
`ref_frame` which are used to determine the `frame_ref_num` and
`prev_dis_num` arguments to each call to `sharkd_dissect_request` in
the main loop of `sharkd_session_process_frames`.

Below is an example on `master` (`b7cc44eb34`, specifically) of a
`frames` request for packets 1 and 800 of the capture
`./test/captures/logistics_multicast.pcapng` where we ask for columns
`frame.time_relative`, `frame.time_delta` and
`frame.time_delta_displayed`:

    # ./cmake-build-debug/run/sharkd -
    Running as user "root" and group "root". This could be dangerous.
    Hello in child.
    {"jsonrpc":"2.0","id":1,"method":"load","params":{"file":"./test/captures/logistics_multicast.pcapng"}}
    load: filename=./test/captures/logistics_multicast.pcapng
    {"jsonrpc":"2.0","id":1,"result":{"status":"OK"}}
    {"jsonrpc":"2.0", "id":2, "method":"frames","params":{"filter":"frame.number==1||frame.number==800","column0":"frame.time_relative:1","column1":"frame.time_delta:1","column2":"frame.time_delta_displayed:1"}}
    {"jsonrpc":"2.0","id":2,"result":[{"c":["0.000000000","0.000000000","0.000000000"],"num":1},{"c":["191.872111000","0.193716000","0.193716000"],"num":800}]}

Note that the `frame.time_delta_displayed` column value for packet 800
is `0.193716000`, which is time difference between it and packet 799,
not packet 1.

Compare this to the same `frames` request using the changes from this
commit:

    # ./cmake-build-debug/run/sharkd -
    Running as user "root" and group "root". This could be dangerous.
    Hello in child.
    {"jsonrpc":"2.0","id":1,"method":"load","params":{"file":"./test/captures/logistics_multicast.pcapng"}}
    load: filename=./test/captures/logistics_multicast.pcapng
    {"jsonrpc":"2.0","id":1,"result":{"status":"OK"}}
    {"jsonrpc":"2.0", "id":2, "method":"frames","params":{"filter":"frame.number==1||frame.number==800","column0":"frame.time_relative:1","column1":"frame.time_delta:1","column2":"frame.time_delta_displayed:1"}}
    {"jsonrpc":"2.0","id":2,"result":[{"c":["0.000000000","0.000000000","0.000000000"],"num":1},{"c":["191.872111000","0.193716000","191.872111000"],"num":800}]}

Note that the `frame.time_delta_displayed` column value for packet 800
is now `191.872111000`, the time difference between it and packet 1.
This is the expected value since only packets 1 and 800 are visible
due to the request's `filter` parameter.

A new `test_sharkd_req_frames_delta_times` unit test has been added to
verify this fix and prevent it the bug from being accidentally
sneaking in again.  If this fix is accepted, this change should
probably be cherry-picked to the `release-4.2` branch.

Fixes #17923.
2023-11-07 20:35:24 +00:00
Daisuke Matsuda 9daf31cc10 Infiniband dissector: Fix typo in comment of parse_DCCETH()
Signed-off-by: Daisuke Matsuda <matsuda-daisuke@fujitsu.com>
2023-11-07 20:33:37 +00:00
Daisuke Matsuda 186e6512f9 Infiniband dissector: Enable to parse ATOMIC Write operation packets
RDMA opcode "ATOMIC Write" was newly added in IBTA Specification 1.5. This
patch enables to parse ATOMIC Write operation packets.

Signed-off-by: Daisuke Matsuda <matsuda-daisuke@fujitsu.com>
2023-11-07 20:33:37 +00:00
Daisuke Matsuda 472de027ea Infiniband dissector: Enable to parse FLUSH operation packets
RDMA opcode "FLUSH" was newly added in IBTA Specification 1.5. This patch
enables to parse FLUSH operation packets.

Signed-off-by: Daisuke Matsuda <matsuda-daisuke@fujitsu.com>
2023-11-07 20:33:37 +00:00
Daisuke Matsuda f85da38c5a Infiniband dissector: Add definitions of FLUSH and ATOMIC Write
FLUSH and ATOMIC Write were newly added in IBTA Specification 1.5. This
patch adds the definitions of these new operations. Wireshark can now
distinguish the packets just like this:
  RRoCE 78 RC Flush QP=0x000017
  RRoCE 82 RC Atomic Write QP=0x000017

Signed-off-by: Daisuke Matsuda <matsuda-daisuke@fujitsu.com>
2023-11-07 20:33:37 +00:00
João Valverde b7cc44eb34 epan: Convert uat.h indentation to 4-space 2023-11-07 18:10:45 +00:00
João Valverde f4301d5113 dfilter: Remove an assertion
Avoid running the name check twice.
2023-11-07 18:09:56 +00:00
João Valverde 5113423596 dfilter: Reformat switch code style 2023-11-07 18:08:44 +00:00
João Valverde a1dd95456c dftest: Enable flex/lemon debugging with -D 2023-11-07 17:20:02 +00:00
João Valverde 1e532ee7c3 UAT: Add uat_destroy()
Allow freeing/removing a single loaded UAT.
2023-11-07 16:16:23 +00:00
João Valverde eed96b41fb Add support for comments in cfilters/dfilters 2023-11-07 16:15:42 +00:00
João Valverde 26785e7394 Remove support for deprecated "filters" configuration file
This "filters" file has not been used in a long time so no
release notes entry is warranted.
2023-11-07 16:15:42 +00:00
Ralph Boehme 0deeb8caf1 SMB2: dissect SMB2_FS_POSIX_INFO info level
Signed-off-by: Ralph Boehme <slow@samba.org>
2023-11-07 15:36:13 +00:00
Stig Bjørlykke 4d294c0b73 epan: Prepare dissectors for initialize static values to 0
Change checks for valid hf values to include 0 as not valid.
This will prepare the dissectors for a change to initialize
proto values to 0 instead of -1.
2023-11-07 14:34:17 +00:00
Stig Bjørlykke 5cedcc970b plugins: Initialize static proto values to 0
Update plugins to not initialize static proto values to -1.
2023-11-07 14:32:47 +00:00
Stig Bjørlykke eb4eeb07ca epan: Initialize static proto values to 0
Update epan to not initialize static proto values to -1.
2023-11-07 14:31:03 +00:00
Stig Bjørlykke 309a47997e tools: Initialize static proto values
Update tools to not initialize static proto values to -1.
This will update dissectors for asterix, ncp2222 and x11.
2023-11-07 14:29:11 +00:00
John Thacker b5644e111a Qt: Add DSBs info to capture file properties
Add the type and size of each DSB to the Capture File Properties
window.

Related to #14599, #15799.
2023-11-07 13:48:02 +00:00
Gabor Spaits 40219156f9 GTPv2: Add SCEF Reference Id Ext to Monitoring Event Extended 2023-11-07 12:47:19 +00:00
João Valverde 29090f6236 tests: Use tmp_path pytest fixture to create home dir
Don't blitz the temporary directory to make test results more
traceable and conform to pytest best practice.

Prefer the pytest method of creating a temporary directory in
the system tmpdir with roll-over, that won't be immediately destroyed.
2023-11-07 12:29:03 +00:00