Commit Graph

84047 Commits

Author SHA1 Message Date
Moshe Kaplan 1e352c3e7b manpage: Fix grammar errors and improve phrasing
Quickly review of fixing common grammatical errors in
the man pages.
2022-04-13 03:39:56 +00:00
João Valverde 0dba7456aa tests: Remove leftover debug print 2022-04-13 01:15:11 +01:00
Gerald Combs bcc286f341 UI: Rename the qt_logwolf directory to logwolf.
We might want to split the Wireshark-specific UI code into ui/wireshark,
but that can be done at another time.
2022-04-12 19:37:30 +00:00
Gerald Combs ca04f4c8cb Qt: Update our dynamic menu groups.
Add log-specific statistics groups, and use them to limit the dynamic
menu items in Wireshark and Logwolf.
2022-04-12 12:14:03 -07:00
João Valverde 8746eea297 dfilter: Try to resolve field reference instead of using a heuristic
Instead of using a heuristic to decide whether the form ${...} is
a macro or not, try to resolve the name to a registered protocol
field and use that instead.

This increases somewhat the surface for clobbering existing macro
names with new field registrations but we'll cross that bridge when
we get to it.

Rejecting protocol field types reduces this probability again but it
may not be intuitive to the user trying to mistakenly use a reference
to a protocol why it is parsed as a macro. The reasons for rejecting
FT_PROTOCOL types as not interesting field references are not
very strong but it seems reasonable.

$ dftest 'frame.number != ${frame.number}'
Filter: frame.number != ${frame.number}

Instructions:
00000 READ_TREE		frame.number -> reg#0
00001 IF_FALSE_GOTO	5
00002 READ_REFERENCE	${frame.number} -> reg#1
00003 IF_FALSE_GOTO	5
00004 ALL_NE		reg#0 != reg#1
00005 RETURN

$ dftest 'frame != ${frame}'
dftest: macro 'frame' does not exist
2022-04-12 14:03:18 +00:00
João Valverde 8355e96858 tests: Add test for display filter field reference 2022-04-12 14:03:18 +00:00
João Valverde 04c42eace3 tshark: Add a --selected-frame option
Add a selected frame option that does pretty much what the name
indicates.

This is not meaningful in the CLI but is useful to simulate the
selected frame action in the GUI for unit testing purposes. The
option is not documented for that reason.

A selected frame is used in display filters with field references.

$ tshark  -r ../test/captures/dhcp.pcap
    1   0.000000      0.0.0.0 → 255.255.255.255 DHCP 314 DHCP Discover - Transaction ID 0x3d1d
    2   0.000295  192.168.0.1 → 192.168.0.10 DHCP 342 DHCP Offer    - Transaction ID 0x3d1d
    3   0.070031      0.0.0.0 → 255.255.255.255 DHCP 314 DHCP Request  - Transaction ID 0x3d1e
    4   0.070345  192.168.0.1 → 192.168.0.10 DHCP 342 DHCP ACK      - Transaction ID 0x3d1e

$ tshark --selected-frame=2 -2 -Y 'frame.number <= ${frame.number}' -r ../test/captures/dhcp.pcap
    1   0.000000      0.0.0.0 → 255.255.255.255 DHCP 314 DHCP Discover - Transaction ID 0x3d1d
    2   0.000295  192.168.0.1 → 192.168.0.10 DHCP 342 DHCP Offer    - Transaction ID 0x3d1d
2022-04-12 14:03:18 +00:00
John Thacker 7a3c2252f5 hierarchy stats: Only increment the total packet count once per frame
The same hierarchy of protocols can appear multiple times in a frame,
for example if there are multiple PDUs for a protocol that begin in
that frame. Keep track of the last frame where we incremented our
stat node and use that to only increment it once per frame.

Add a "total number of PDUs with this hierarchy" statistic and
display it as a new final column in the GUI. Update the User Guide.

In the purpose of doing this, get rid of temporary variables and
increment the ph_stats_t members directly, since we pass that
into our functions already, and thus have access to the current
packet count.

Fix #17553. Fix #18034. Fix #12565.
2022-04-12 13:38:33 +00:00
John Thacker 4c7865c81b whois, finger: Dissect at FIN (or after) on first pass
The WHOIS and finger dissectors wait to dissect at FIN, but they
need to actually dissect at FIN (or at reassembled out of order
segments after FIN) on the first pass instead of returning without
dissecting.

Only add data reassembled at FIN to the tree if it was actually
reassembled at the FIN frame; if it was reassembled in the first pass
at a later frame due to out of order segments, it will be added there.

In addition to fixing first pass dissection, this also fixes the
case where the FIN segment is the first segment with data. Fix #18037.
2022-04-12 08:29:48 -04:00
Chuck Craft 3aee6ce9d6 ACN/rdmnet: add protocol check to TCP heuristic 2022-04-12 09:29:47 +00:00
João Valverde 03e41d4950 ftypes: Fix a macro argument 2022-04-12 09:41:58 +01:00
Anders Broman 096947337e PER:Add function to add "PER encoded lable" to the tree. 2022-04-12 08:33:36 +02:00
João Valverde 09696f1762 Try to fix a narrowing warning
"C:\Development\wsbuild64\Wireshark.sln" (default target) (1) ->
"C:\Development\wsbuild64\epan\dfilter\dfilter.vcxproj.metaproj" (default target) (18) ->
"C:\Development\wsbuild64\epan\dfilter\dfilter.vcxproj" (default target) (108) ->
       (ClCompile target) ->
C:/Development/wireshark/epan/dfilter/scanner.l(463,54): warning C4267: '+=': conversion from 'size_t' to 'int
       ', possible loss of data [C:\Development\wsbuild64\epan\dfilter\dfilter.vcxproj]
C:/Development/wireshark/epan/dfilter/scanner.l(463,54): warning C4267:         state->location.col_start += sta
       te->location.col_len; [C:\Development\wsbuild64\epan\dfilter\dfilter.vcxproj]
C:/Development/wireshark/epan/dfilter/scanner.l(463,54): warning C4267:
                           ^ (compiling source file C:\Development\wsbuild64\epan\dfilter\scanner.c) [C:\Development\ws
       build64\epan\dfilter\dfilter.vcxproj]
2022-04-11 22:23:13 +01:00
João Valverde 2f02cd6e19 dfilter: Handle missing error location more gracefully
If we don't have an offset, don't print anything with underline.

Also it can underline filters using macros correctly now.

$ tshark -Y 'ip and ${private_ipv4:ip.sr}' -r /dev/null
tshark: Left side of "==" expression must be a field or function, not "ip.sr".
    ip and ip.sr == 192.168.0.0/16 or ip.sr == 172.16.0.0/12 or ip.sr == 10.0.0.0/8
           ^~~~~
2022-04-11 21:03:06 +00:00
Yu Gao ceef8aa8ee fix the indent 2022-04-11 19:39:11 +00:00
João Valverde 24443fa33a tshark: Add underline to dfilter errors
$ tshark -Y 'frame.number == 123foobar and ip' -r /dev/null
tshark: "123foobar" is not a valid number.
    frame.number == 123foobar and ip
                    ^~~~~~~~~
2022-04-11 19:25:37 +00:00
Gerald Combs fb3bdffaba Logwolf: Remove a bunch of packet-specific menu items.
Remove the following statistics and utility menu items and dialogs:

- 29West / lbmr
- ANCP
- BACnet / BACapp
- Credentials
- DCCP
- DNS
- Firewall rules
- HART-IP
- HPFEEDS
- HTTP
- HTTP2
- QUIC
- RSerPool
- SOME/IP
- Sametime
- Service response time
- TCP
- UDP
- UDP Multicast
2022-04-11 19:10:01 +00:00
Gerald Combs 3b8ea97731 Debian: Add missing symbols. 2022-04-11 11:41:17 -07:00
Gerald Combs 4b556d6bc6 Qt+epan: Get log conversation filters working.
In conversation_filter.h, add a separate log_conv_filter_list. Use it in
register_log_conversation_filter and add conversation_filter_from_log.
It looks like we no longer use find_conversation_filter externally, so
remove it from the API.
2022-04-11 17:26:50 +00:00
Gerald Combs 58e31a2e77 Qt: Try to fix missing translations.
After splitting MainWindow into WiresharkMainWindow and
LogwolfMainWindow, a bunch of translations were marked "vanished". Do
the following in an attempt to restore them:

$ grep -c vanished ui/qt/*.ts
ui/qt/wireshark_de.ts:534
ui/qt/wireshark_en.ts:7
ui/qt/wireshark_es.ts:407
ui/qt/wireshark_fr.ts:367
ui/qt/wireshark_it.ts:534
ui/qt/wireshark_ja_JP.ts:534
ui/qt/wireshark_pl.ts:414
ui/qt/wireshark_ru.ts:513
ui/qt/wireshark_sv.ts:526
ui/qt/wireshark_tr_TR.ts:534
ui/qt/wireshark_uk.ts:264
ui/qt/wireshark_zh_CN.ts:455

$ git checkout 1c9538624f^ -- ui/qt/*.ts

$ sed -i -e 's,<name>MainWindow</name>,<name>WiresharkMainWindow</name>,g' ui/qt/*.ts

[ comment out `tx pull -f` in tools/update-tx ]

$ ./tools/update-tx -n

$ grep -c vanished ui/qt/*.ts
ui/qt/wireshark_de.ts:7
ui/qt/wireshark_en.ts:7
ui/qt/wireshark_es.ts:0
ui/qt/wireshark_fr.ts:5
ui/qt/wireshark_it.ts:7
ui/qt/wireshark_ja_JP.ts:7
ui/qt/wireshark_pl.ts:6
ui/qt/wireshark_ru.ts:7
ui/qt/wireshark_sv.ts:7
ui/qt/wireshark_tr_TR.ts:7
ui/qt/wireshark_uk.ts:2
ui/qt/wireshark_zh_CN.ts:6

$ ./tools update-tx

[ uncomment `tx pull -f` in tools/update-tx ]
2022-04-11 17:01:17 +00:00
Gerald Combs bd6ee4479f Tools: Make the Debian and RPM setup scripts more strict.
We use debian-setup.sh and rpm-setup.sh to build the containers in
https://gitlab.com/wireshark/wireshark-containers/. Make sure they fail
with a nonzero exit status, otherwise we might end up with an invalid
container image.

Make sure OPTIONS is defined in all of the setup scripts that use it.
2022-04-10 16:05:42 -07:00
Dylan Ulis 3890d822ba macOS Homebrew: Install PCRE2 2022-04-10 22:09:55 +00:00
Gerald Combs 1c9538624f [Automatic update for 2022-04-10]
Update manuf, services enterprise numbers, translations, and other items.
2022-04-10 19:23:47 +00:00
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