Commit Graph

89686 Commits

Author SHA1 Message Date
John Thacker 3b9de4df3d tshark: Cache the interface list
For tshark, cache the interface list the first time it is retrieved,
instead of launching dumpcap once for each interface specified in
the capture options, and when getting each interfaces descriptive
name at the start of the capture. If the interface list changes
when in the middle of processing options before the capture starts
we have problems anyway.

On Windows, this means not getting multiple UAC pop-ups if
npcap is installed limited to Administrator privileges.

We can probably do this for the GUI as well, since the command
line options for capture are only parsed at startup.

Fix #16625
2023-11-25 09:32:03 -05:00
John Thacker c62e98c0f5 capture_opts: Don't retrieve the interface list for "-"
If "-" is passed as the interface, don't bother spawning dumpcap
and retrieving the interface list. It's time-consuming and can
spawn a UAC on Windows depending on how NPcap is installed.
Also, set the description of standard input as done in
get_interface_descriptive_name. (We still possibly want to override
it with the -X option later.)

Part of #17721
2023-11-25 08:51:34 -05:00
John Thacker f5cc6ebbe5 ui: Make sure to use user-specified interface descriptions
This check was intended in tshark and elsewhere, but the
user-specified descriptions weren't getting used.
2023-11-25 07:56:53 -05:00
John Thacker a36ec2a2f0 ui: Move the check for the ex-opt for stdin_descr
Move the check for the -X option for stdin_descr to
capture_dev_user_descr_find so that it gets picked up in
the comment field of the Manage Interfaces Dialog. It's
also a user specified description.
2023-11-25 07:17:16 -05:00
John Thacker 74101e73f5 Qt: Plug leak in ManageInterfaceDialog
parent the delegate for the pipe model
2023-11-25 06:53:04 -05:00
John Thacker 13a9f710eb tshark: Remove a useless call to get_interface_descriptive_name
get_interface_descriptive_name is slow, because it retrieves
the interface list. As called in tshark, it doesn't do anything,
because even though it changes interface_opts->descr, the
display_name is still set, so get_iface_list_string doesn't use it.

If the display_name were not set, then get_iface_list_string would
call get_interface_descriptive_name anyway. So either way it's
pointless.

We don't want get_iface_list_string to do extra interface list
retrievals by calling get_interface_descriptive_name in general,
but we probably do want to check the user-supplied description
(via prefs) and special user-supplied description of stdin (via -X),
which capture_opts fill_in_interface_opts_from_ifinfo doesn't do.
As it is, tshark makes extra retrievals of the interface list
and then doesn't do anything with the information.

Related to #16625
2023-11-25 11:24:03 +00:00
Martin Mathieson e508e9364d Fix some item filters 2023-11-25 10:52:39 +00:00
John Thacker 8237070fca ui: Have get_interface_descriptive_name take the capture_options
Instead of always calling capture_interface_list, have
get_interface_descriptive_name take the capture_options (which
we always have when calling it) as a parameter, and use the
get_iface_list() member of that. Generally that is the same
as calling capture_interface list, but if we cache the interface
list (e.g., when running tshark) it could be different.

We also probably should be looking through the already retrieved
interfaces in ifaces or all_ifaces most of the time before
doing another call to dumpcap, since we call this on interfaces
that are already set up. Passing in the capture_options allows
that change to be made later.

Related to #16625
2023-11-24 10:47:20 -05:00
Chris Brandson 3381725b71 Zigbee fix incorrect endianness on Smart Energy (SE) Tunnel Close Timeout Value
Zigbee values are little endian, however original implementation of Tunnel Close attribute used ENC_NA resulting in incorrect dissection

Cole Wu <colewu9712@gmail.com> provided this fix and data used to verify.
2023-11-24 08:54:04 +00:00
Giovanni Musto 4e8603b604 BLF: Implement a mechanism for linear read 2023-11-24 08:53:33 +00:00
John Thacker 2b18176645 Capture: Fix deserializing single if capabilities on Windows
Our get_json_string does not escape the string passed in as the
key (it expects it already escaped.) This causes issues on Windows.
Also ensure that whenever the error string pointer is passed in that
it gets a message if NULL caps are returned (tshark expects this.)
2023-11-23 19:38:54 -05:00
Giovanni Musto 39ed3527a5 BLF: Use binary search on log containers 2023-11-23 21:11:20 +00:00
John Thacker 0837f2015a wustil: Warn about passing NULL string to ws_label_strcpy
Don't crash (see #19496) but warn
2023-11-23 21:01:56 +00:00
John Thacker 697f37cf2b Capture: Get our capabilities list in one dumpcap call
Instead of calling dumpcap separately for each interface in
the list, make one dumpcap call.

There's still two calls, one to get the list of interfaces and
one to get the capabilities, which is partly because interfaces
that support monitor mode can indicate support for different
link-layer types depending on whether monitor mode is enabled,
and we have to check per-interface preferences for the name to
see if we want monitor mode.

This roughly doubles the speed to add interfaces at startup
in my testing on Windows and Linux, and should massively
reduce the number of UAC pop-ups when npcap is installed with
restrictions to administrative access.

Fix #16191. Related to #15082 (it improves the number of UACs,
but perhaps they could be reduced even further by having dumpcap
stay open for all the calls in the life of the program.)
2023-11-23 20:27:58 +00:00
John Thacker a8586fde3a gvcp: Don't try to add a NULL string to a column
This was caught as an invalid argument by g_strlcpy before 4.2,
but it was never a good idea.

Fix #19496
2023-11-23 13:47:51 -05:00
John Thacker 8defdda060 Qt: Fix View.. Reset Layout
Update View -> Reset Layout for 898ec16857
2023-11-23 07:32:09 -05:00
João Valverde 1506126169 dfilter: Fix diameter.3GPP-* filters
Manual revert of commit 0e82c6b4b8.

Fixes #19493.
2023-11-23 12:31:38 +00:00
Balint Reczey 2590f82a81 debian: Revert to listing Wireshark Self-made package as the maintainer 2023-11-23 09:22:11 +00:00
Balint Reczey 1b4f3f491d debian: Use strict generated shlibs instead of symbols files
Maintaining the symbols file on the master branch requires extra work,
while ABI stability is promised only on release branches

The shlibs system [1] offers a simpler approach. To ensure that only
compatible packages are installed to work together on the system the
dependencies are tightened in debian/rules.

[1] https://www.debian.org/doc//debian-policy/ch-sharedlibs.html#the-shlibs-system
2023-11-23 09:22:11 +00:00
Daniel McCarney 136ca4287d TLS: recognize ech_required alert
The draft-ietf-tls-esni-17 document[0] defines an update to the IANA TLS
alert registry in Section 11.2[1]:

> IANA is requested to create an entry, ech_required(121) in the
> existing registry for Alerts (defined in [RFC8446]), with the "DTLS-OK"
> column set to "Y".

This commit updates the existing `ssl_31_alert_description` array to
recognize alert 121 as "ECH Required".

[0]: https://datatracker.ietf.org/doc/html/draft-ietf-tls-esni-17
[1]: https://datatracker.ietf.org/doc/html/draft-ietf-tls-esni-17#section-11.2
2023-11-23 05:59:08 +00:00
Cal Turney 26630c3587 LBAs are zero-based thus one(1) must be added to them.
The existing Read Capicty sizes in dissect_sbc_readcapacity10()
are displayed in SI rather than Binary Prefixe format. Since the
byte capacity sizes are calculated in 1024-byte chunks, they must
be displayed as Binary Prefixes. These abbreviations are now
displayed in the Packet Detail and List panes.
2023-11-23 05:55:43 +00:00
Cal Turney 29445cbfdf iSCSI Read Capacity
1. Updated packet-scsi-sbc.c to try and make Ubuntu happy.
2. packet-tcp.c (from another MR) was accidentally included in this
   MR. The unchanged packet-tcp.c from master has been included in
   this commit.
2023-11-23 05:55:43 +00:00
Cal Turney 3852197510 WIP iSCSI Read Capacity fix for Ubuntu failure
Ubuntu failed pipeline
2023-11-23 05:55:43 +00:00
Cal Turney 99a9d40601 iSCSI Fix LBAs and display Binary Prefix sizes
LBAs are zero-based thus one(1) must be added to them.

The existing Read Capicty sizes in dissect_sbc_readcapacity10()
are displayed in SI rather than Binary Prefixe format. Since the
byte capacity sizes are calculated in 1024-byte chunks, they must
be displayed as Binary Prefixes. These abbreviations are now
displayed in the Packet Detail and List panes.
2023-11-23 05:55:43 +00:00
Cal Turney d8b8400c27 TCP: changed "[TCP segment of a reassembled PDU]"
Changed "[TCP segment of a reassembled PDU]"
     to "[TCP PDU reassembled in <frame>]" in the Packet List
This also fixes a bug where "[TCP segment of a reassembled PDU]" was
being displayed in segments that were not reassembled such as in
the case at the end of a capture where all of the segments of a PDU
are not present.
2023-11-23 05:55:43 +00:00
Jaap Keuter 455a21f751 RTCP: Add MCPTT values from TS 24.380 V17.7.0 2023-11-23 05:53:12 +00:00
Chris Brandson 120c5cce8d Fixed typo in zcl temp meas cluster
credit for change goes to Cole Wu <colewu9712@gmail.com>
2023-11-23 00:48:57 +00:00
Martin Mathieson 06d81f7b32 ZBee ZCL Closures: make a function static 2023-11-22 19:05:20 +00:00
John Thacker 30d0165bbd Try to fix tests on ARM64
Windows doesn't like printing to the logs from within pytest,
so lower the log levels a bit here. (The ARM64 build doesn't
seem to have interfaces, which causes a message currently.)
2023-11-22 09:53:00 -05:00
John Thacker e9de042644 Qt: Remember what monitor we last ran on when maximizing
Use Qt's save and restoreGeometry functions when trying to restore
to a maximized window state. Those functions do a better job
tracking on what screen we were maximized. It also will cause
the non-maximized size to be saved and restored even when starting
out maximized, insted of reverting to the default size when leaving
maximization.

Maybe in the future we would want to use these functions for all the
recent geometry handling. We would lose our current pref granularity
allowing size, position, and maximized status to each be saved or not.
(Do we need that?)

There are still some edge cases:
https://bugreports.qt.io/browse/QTBUG-77385
https://bugreports.qt.io/browse/QTBUG-70721
some of which are resolved in the latest Qt, but it's better than
the current handling.

Fix #12389
2023-11-22 08:28:20 -05:00
John Thacker 1fdb2720b1 Qt: Free the old splitter geometry values when saving new ones
Fixup a leak in 898ec16857
2023-11-22 08:05:46 -05:00
John Thacker 898ec16857 Qt: Save the main window QSplitter states and restore them
This is more accurate, because it accounts for the AccordionFrame
being open or closed, than looking at the visible pixel count.
Keep saving the older method that was also used for the GTK UI,
and fallback to it if this fails. That's also useful for a first
run and for people who switch back and forth with older versions.

Fix #19361
2023-11-22 10:03:46 +00:00
David Fort 002b40de89 rdp: fix indentation in file
There were various indentation schema in the file, the patch tries to normalize
things.
2023-11-22 09:26:34 +01:00
David Fort 6ec01c0583 rdp: various fixes and enhancements
This patch adds the parsing of:
* gcc cluster redirection flags
* the dynamic time zone fields in InfoClient PDU
* serverInfo PDU, interpreting the statusInfo

In ClientInfo, clientSessionId is a UINT32 so show it as such.
2023-11-22 09:26:34 +01:00
sofiane degoui 05accf6c9b Zigbee: Add support of window covering cluster 2023-11-22 07:30:50 +00:00
Dylan Ulis c16eaeb014 ENIP: Add TCP/IP Interface service 2023-11-22 07:29:21 +00:00
Dylan Ulis 2e41f52062 CIP Safety: Improve Analysis 2023-11-22 07:27:59 +00:00
John Thacker 0d93782443 dumpcap: Serialize machine readable interface caps as JSON
Serialize the machine readable version of the interface capability
output as JSON, using an array to support multiple interfaces.
When querying multiple interfaces, try all of them, exit with
success (unless unexpected errors occur) and report any per-interface
errors and exit codes inside the JSON rather than stopping after
the first interface with error.

Update capture_get_if_capabilities to process the JSON. It (and
sync_if_capabilities_open) still only query a single interface at,
but this will allow modification to handle multiple interfaces at
once later.

Related to #16191, #15082
2023-11-22 07:25:34 +00:00
John Thacker 212cfe132c wsutil: Add wsjson function to get boolean
Add a json_get_boolean to parse booleans out of jsmn primitives
similar to the double parsing function.
2023-11-22 07:25:34 +00:00
Alexis La Goutte 3570a9a219 isakmp: update dh_group value_string with RFC8031 and RFC9385
Add new following dh group :

31 	Curve25519 [RFC8031]
32 	Curve448 [RFC8031]
33 	GOST3410_2012_256 [RFC9385]
34 	GOST3410_2012_512 [RFC9385]

https://www.iana.org/assignments/ikev2-parameters/ikev2-parameters.xhtml#ikev2-parameters-8
2023-11-22 07:23:08 +00:00
David Perry 24e7627fe4 Change some `wmem_packet_scope()` to `pinfo->pool`
As requested [here][1], help with removing calls to
`wmem_packet_scope()` in favour of references to `pinfo->pool`.

* Plugins chosen semi-alphabetically.
* When a calling function already has a `pinfo` argument, use that.
    * Remove `_U_` from its signature if it was there.
* If a function seems narrowly focused on getting and (possibly)
  returning memory, change the function signature to take a
  `wmem_allocator_t *`.
* If it seems more focused on packet-based operations, pass in a
  `packet_info *` instead and use `pinfo->pool` within.
* Some of the files in this MR still have references to
  `wmem_packet_scope()` where it would take significant work to remove.
  These will need revisiting later.

[1]: https://www.wireshark.org/lists/wireshark-dev/202107/msg00052.html
2023-11-22 07:22:10 +00:00
John Thacker 24c0cba235 doc: Mention rpcap fix in release notes
[skip ci]
2023-11-21 21:03:33 -05:00
John Thacker e425fb606c recent: Remove unused wlan_stats_pane geometry (GTK-only)
The Qt version of WlanStatisticsDialog has never used this.
2023-11-21 17:58:36 -05:00
Alexis La Goutte afb03fa515 GVCP: add ASCII (0x02) to Character Set value_string
Close: #19494
2023-11-21 20:45:45 +01:00
Günther Deschner 69f04acd3d DCERPC: update LSA idl from upstream variant, adds support for new calls
Guenther

Change-Id: I887028e1f87100828c168ee5c5bceaad58c87ed2
Signed-off-by: Guenther Deschner <gd@samba.org>
2023-11-21 14:51:00 +01:00
John Thacker c3548e3005 manuf: Add back the special case for all zeroes
These words from Jörg Mayer are as true today as they were
21 years ago in 49a2f32336,
"I still have yet to see a case when a MAC address starting
with 0:0:0 actually means Xerox", but there are lots of cases
where all zero OUIs, MAC-48s, EUI-64s, etc are used to mean
null.

[skip ci]
2023-11-21 12:31:18 +00:00
John Thacker ff447b1aec Qt: Store active remote hosts in a preference file
Store the active remote hosts in a preference file.
Use JSON because in addition to each host, we later may want
to save the per-interface settings (but the interfaces
available on a host could change without the host information
changing). Hosts and interfaces together have a tree-like data
structure that doesn't work with a UAT or other table.

Still TODO: password handling (cf. #17949 and extcap.), moving
this into a Model instead of a TreeWidget, getting rid of
remote_interface_dialog and handling all of this in
ManageInterfacesDialog through the model.

Fix #17484. Fix #8557.
2023-11-21 08:03:20 +00:00
John Thacker 2fa48bbbd5 Make recent remote interfaces a list
Storing every rpcapd host ever connected to in recent_common seems
unwise. Change it to a list, so we can have a max count and order.
Store the most recent 20. Maybe this could be a pref eventually.

Related to #17484.
2023-11-21 08:03:20 +00:00
Timo Warns ad6947eb71 GNSS: add dissector for EGNOS Message Server (EMS) files
Add dissector for EGNOS Message Server (EMS) files including entries
with EGNOS SBAS navigation messages.
2023-11-21 06:43:40 +00:00
Timo Warns cea4faac39 GNSS: add wiretap for EGNOS Message Server (EMS) files
Add a wiretap implementation for EGNOS Message Server (EMS) files.
2023-11-21 06:43:40 +00:00