Commit Graph

7783 Commits

Author SHA1 Message Date
John Thacker da5b21f5ec Save time-shifted time stamps when writing out a capture file
If a time shift has been applied to frames, save the time-shifted
value to the newly written file.

If we're doing Save/Save As, so that the newly written file replaces
the currently open file, make sure to clear the shift offset from
the frame data, for the same reason that we mark the file as no longer
being modified. If we're Exporting packets and not changing the
currently open capture file, leave the shift offset the same.

If there's color rules based on the frame protocol, recolorize.
We also really should reapply the current filter, if any, if it
depends on something in the frame protocol.

Fix #14306
2023-05-31 21:34:43 -04:00
Gerald Combs 507330fbc6 CMake+Qt: Only copy our translation files on Windows
Copying to the macOS application bundle breaks code signing on that
platform:

    Wireshark.app/Contents/MacOS/Wireshark: code object is not signed at all
    In subcomponent: /path/to/wireshark/wireshark/build/run/Wireshark.app/Contents/MacOS/translations/wireshark_zh_CN.qm
2023-05-31 11:35:21 -07:00
João Valverde 95355bd165 NSIS: Deploy Qt DLLs when cross-compiling
Deploy Qt DLLs when cross compiling using MinGW and Fedora Linux.
Currently the DLLs are read from a text file because windeployqt
in not available when cross-compiling from Linux.

The windeployqt-to-nsis.py script is modified to accept a text file
static mapping instead of invoking windeployqt.

We need to manually copy the Qt translation files, a task that
is also usually performed by windeployqt.

Fix some missing MinGW DLL dependencies (opus, winpthread).
2023-05-30 13:36:19 +00:00
Stig Bjørlykke b0c582a82f Qt: Start with a new QFont in setMonospaceFont
Always start with a new mono_font_ when setting the default font in
setMonospaceFont(), both when font_string is not given and when the
font name does not exist.

On macOS this will avoid getting .AppleSystemUIFont, which is not
a monospace font and not what we want.
2023-05-29 21:37:08 +00:00
João Valverde 0003d94086 NSIS: Skip Qt deployment and uninstaller when cross-compiling
Qt deployment does not work because windeployqt cannot be run
when cross compiling (unless Wine is used). Skip this step until
other solutions are investigated and this is fixed. This means
that the target system must have the Qt Windows SDK installed with
MinGW binaries.

Also skip crreating an installer. Has somewhat complicated requirements
for signing that currently don't work when cross-compiling.

This allows building a usable NSIS Windows installer from Fedora,
with the limitations mentioned above.

Ping #19108
2023-05-29 01:12:04 +00:00
Stig Bjørlykke 07350c6b38 Qt: Scroll to selected packet after column move
Restore current index after moving a column to fix scroll back
to the selected packet.

Fixes #16251
2023-05-28 17:56:14 +00:00
João Valverde f653e52e0f CMake: Try to use FindPython3.cmake again
Use FindPython3.cmake instead of the deprecated FindPythonInterp.cmake,
to make sure we actually find Python3.

Don't use the module with MSYS2 because it is buggy and exhibits broken
behaviour.

Run it earlier in the configuration, just as a precaution, so other
indirect calls to find python don't happen earlier.
2023-05-27 12:49:29 +01:00
João Valverde f0e4c5262d Revert "CMake: Replace deprecated module FindPythonInterp"
This reverts commit d6380e7ae4.

Turns out we were unwittingly still using FindPythonInterp
instead of FindPython3.cmake, via LocatePythonModule.cmake,
nd this commit actually enabled FindPython3.cmake. Also turns
out FindPython3.cmake is far too clever and very buggy with MSYS2.
It will usually not find the correct python binary and fail in many
suprising ways, depending on which combination of Python Windows
installations is present.
2023-05-26 22:55:47 +01:00
João Valverde d6380e7ae4 CMake: Replace deprecated module FindPythonInterp 2023-05-26 19:38:42 +00:00
João Valverde 8dc5d2d348 Fedora: Fix cross-compilation with mingw-wpcap
Fix various issues preventing compilation with Fedora's
MinGW WinPcap package.
2023-05-26 00:18:59 +01:00
j.novak@netsystem.cz 783eeb9a4c extcap: Remove duplicated bool value labels 2023-05-25 13:03:16 +00:00
John Thacker 5f51c4bb33 Decode As: Enable disabling a default dissector
Make it possible to use Decode As to set the current dissector
for an entry in a dissector table to NULL even if there is a
default dissector registered for that entry. (none) means (none)

This is different than disabling the dissector entirely, because
a dissector might be registered as default for multiple entries/ports,
and a user might want only to disable it for one entry, not in general.
Or, a dissector might have multiple registered dissectors and a
heuristic dissector, and a user might want to disable one dissector
registered value while still having the heuristic dissector enabled.

This is different than setting the dissector for the entry to Data,
because it still allows heuristic dissectors to get a chance.

This is different than setting a "Try heuristic sub-dissectors first"
preference, because it only affects the single entry in the tables,
instead of trying heuristic sub-dissectors first for all entries in
the table (and it works for all tables, even those that lack such a
preference.)

Move the default dissector to the top of the combobox so it is
still easy to reset to the default.

Fix #12098
2023-05-24 06:39:00 -04:00
João Valverde 4e70ea33af Fix build on case-sensitive filesystems
Rename some files to match case-sensitive paths on Fedora.
2023-05-24 02:49:28 +01:00
Gerald Combs caeedef803 Qt: Stop using flags to represent languages
As discussed at

https://www.flagsarenotlanguages.com/blog/

and

https://ux.stackexchange.com/questions/2472/how-to-graphically-represent-a-language

Flags don't correspond to languages very well in many cases. Don't add
them to our language list.

Add the Ioninc "language" icon from https://github.com/ionic-team/ionicons
and use it for the general "Use system setting" language item.

Remove an unneeded include.
2023-05-23 13:46:44 +00:00
John Thacker 1db595d1bd Decode As: Keep current handle and description consistent
Make the current dissector description and handle private
members of DecodeAsItem, and change them in tandem.
2023-05-22 07:24:14 -04:00
Gerald Combs 5eab2f8b63 [Automatic update for 2023-05-21]
Update manuf, services enterprise numbers, translations, and other items.
2023-05-21 16:23:42 +00:00
John Thacker 7ade1e36cb Qt: Only have a getter for the default dissector
The DecodeAsItem determines the default dissector programmatically
when the table or value is changed. Other classes don't need to update it.

There's a value for the default dissector for a table and value written to
the decode_as_entries configuration file, but that has never affected
anything, because the actual default dissector is used. It is only
useful for information when inspecting or viewing the file.
2023-05-20 23:28:04 -04:00
John Thacker 3a3abaec59 Qt: Decode As: Add values from all the layers as suggestions
When selecting a value for Decode As, values that appear in the
current packet are added as a combobox. Currently it only adds
the values from the last layer that contains a protocol. Add
the values from all the layers where the protocol appears to the
combobox instead.
2023-05-21 02:47:19 +00:00
Gerald Combs a7106f6e96 UI: Allow Arm64 updates on Windows 2023-05-18 23:57:59 +00:00
John Thacker 8cab0daed1 Qt: Redissect packets when applying a time shift
Packet fields like tcp.time_relative, smb2.time, and SRT tables depend
on file-scoped data from other frames often computed in the first pass.
Thus redissection is necessary after applying a time shift.

Fix #18999
2023-05-16 18:30:33 -04:00
Preben Guldberg 40fdd67664 View bytes as decimal or octal
An attempt at implementing request in issue #18615. Adding octal view
while at it, in case anybody happens to prefer that or compare with
reference data in octal.

Both decimal and octal view have three byte wide columns, which is
visually distinctive from hex view. Decimal uses leading spaces, which
makes it clearly different from octal view.

Some ternary operators previously done based on BYTES_HEX are now using
BYTES_BITS. This change is done as the new BYTES_DEC and BYTES_OCT have
more in common with BYTES_HEX and are either equivalent in context or
closer linked to BYTES_HEX (e.g. for calculating column widths).

While translations should be updated, I am unsure if this is automated.
Also, if attempted, lupdate picks up changes from unrelated commits.
2023-05-16 07:53:12 +00:00
John Thacker b4ba0f4782 Qt: Free rtpstream ids after done with them
rtpstream_id_free does not free the rtpstream id itself, only
its data (addresses).
2023-05-15 08:39:25 -04:00
John Thacker 66e3ea9519 Qt: Ensure AudioRoutingFilter is freed
Call the base constructor so that the AudioRoutingFilter is
parented, and make the comment in rtp_audio_stream.cpp regarding
temp_file_ being released by audio_output_ true.
2023-05-15 08:15:16 -04:00
John Thacker 3a0b4a8d10 Qt: Ensure the AudioSilenceGenerator is freed
Have AudioSilenceGenerator inherit the QIODevice constructor that
takes a parent, and pass the parent into the constructor when
creating it in RtpPlayerDialog. This ensures that it is deleted
appropriately when marker_stream_ is deleted.
2023-05-15 11:55:30 +00:00
John Thacker 14c3ee468b Qt: Stop after creating a Decode As item
Break out of a loop, just in case there are multiple decode as
tables for the same protocol. Prevents a memory leak.
2023-05-14 22:04:16 -04:00
Gerald Combs 7f916a8419 [Automatic update for 2023-05-14]
Update manuf, services enterprise numbers, translations, and other items.
2023-05-14 16:46:02 +00:00
John Thacker f2618f0154 Qt: Decode As: Update the default dissector string
When changing a Decode As row item's table or selector, update
the default dissector string to refer to the default for the
new value.

Make access to the table names and selectors in a DecodeAsItem
through getters and setters, keeping the elements private, so
that we can ensure this happens whenever the table or selector
is changed.
2023-05-14 13:31:59 +00:00
John Thacker ebbd943c85 Qt: Simplify Decode As handling
We want to default to the last Decode As table with an entry in
the packet. Since the list of layers is a doubly-linked list,
start with the tail and go backwards for simpler and faster logic.

Move the logic for how to create a DecodeAsItem from a decode_as_t
into the constructors.
2023-05-14 02:56:59 +00:00
John Thacker f8f9112f9a Qt: Fix leaks VOIP Calls Dialog
There's still one small leak because RTP streams pass ownership
of an rtpstream_info_t to sequence analysis, which doesn't know
how to free it.
2023-05-12 20:07:58 +00:00
John Thacker 59b7136065 Qt: Connect the Expert Info dialog filter checkbox signal manually
On the Expert Info dialog, connect the signal from the filter
checkbox being toggled manully, after setting the initial state
in the constructor. This prevents triggering an extra retap
during the constructor when the filter is initially set.
2023-05-11 22:19:32 +00:00
John Thacker 4c6b2e3cdd Qt: Plug leaks in RTP Analysis from Main Window
Free the data associated with the tap scanning for RTP streams after
the ids have been verified and it's no longer needed.

Free the actual rtpstream_id_t memory after they've been copied by
the RtpAnalysisDialog. As noted, rtpstream_id_free frees the
dynamically allocated data (the addresses), but not the object
itself.
2023-05-11 11:43:36 +00:00
John Thacker 926019add7 Qt: Free RTP stream tapinfo when destroying RtpStreamDialog
Fix leak in the RTP Streams window by freeing all the storage
in the tapinfo item.
2023-05-11 11:15:09 +00:00
John Thacker 3eddc1386f Qt: Add progress bar to RTP and VOIP dialogs
Add the progress bar for a currently loading/tapping file to
the button boxes for the RTP Streams and VOIP Calls dialogs.

Use delayedRetapPackets in the RTP Streams dialog so that the
window appears and fills in (with the progress bar) while loading
a large file, instead of waiting until tapping finishes before
appearing.
2023-05-11 01:15:20 +00:00
Guy Harris 554baf6294 Fix no-libpcap compilation. 2023-05-10 17:34:12 -07:00
John Thacker 37dd1d007b Qt: Avoid unnecessary retaps when creating RTP and VOIP dialogs
Similar to 5bc94bc02a. Don't use
the automatic connection set up by Qt uic but manually connect
the display filter checkbox signal to its slot. This allows us
to initialize the checkbox and filter status without calling the
slot and retapping the packets in the middle of constructor.

There's always an tap triggered at the end of the constructor,
so we don't want to do a second one before the dialog appears if
the main display filter is set.
2023-05-10 11:18:09 +00:00
Gerald Combs 4ce383d6d6 Finish removing RIPEMD160 support
Finish removing RIPEMD160 support, which was started in 2a285b75a1. As
noted in that commit, FIPS 140-2 will abort if it's enabled. It's been
deprecated by OpenSSL as well.
2023-05-09 16:11:03 +00:00
Stig Bjørlykke 1062e54fd5 prefs: Remove type of GUI preference
The type of GUI preference is unused.
Remove prefs.gui and rename prefs.gui_qt_* to prefs.gui_*.
2023-05-08 16:30:07 +00:00
Gerald Combs 10be3f8fe6 Qt: Make the debounce timer an advanced preference
Remove the debounce timer from the Appearance settings pane. The default
setting should be good enough for most people and the setting is still
available in the "Advanced" section if not.

Add comments to main_window_preferences_frame.ui noting that the
Language setting should be the last item, as in "if Wireshark is in a
language you can't read, go to this physical location in the UI."
2023-05-07 19:47:12 +00:00
John Thacker 5bc94bc02a Qt: Avoid an unnecessary retap when creating Conversations dialog
Don't use the automatic connections set up by Qt but manually
connect the display filter checkbox signal to the slot.
This enables us to initialize the checkbox and filter without
calling the slot and retapping the packets.

There is always a delayed retap triggered in the Conversations
or Endpoints dialog constructor. We don't want to do an extra
retap of the packets before the dialog appears if the main
display filter is set.

Related to #18292
2023-05-06 01:08:44 +00:00
John Thacker f5c4dcbbf9 Qt: Fixup Conversations and Endpoints dialog leak fix
Fixup !10488. The tap listeners are removed when a file is closed,
but the dialogs still need the data until the dialogs are closed.
So only reset the data when the dialogs are destroyed (or the taps
are reset.)
2023-05-06 01:08:08 +00:00
John Thacker 15fd2ddc8c columns: Migrate two-field columns to custom columns
Migrate some built in columns that correspond exactly to only two or
three fields to custom columns. The last time column customification
was done, multifield custom columns didn't exist. This simplifies
the GUI for most users, and also means that when these columns do
exist, "Apply as Filter" will work as expected.

COL_8021Q_VLAN_ID, COL_VSAN, COL_DCE_CALL, COL_TEI

Related to #13941
2023-05-05 11:05:20 +00:00
John Thacker 277b7f6346 Qt: Restore -z io,stat command line option
Restore the ability to open the I/O Graph window from Wireshark
from the command line with "-z io,stat", which was removed in !7115.

Fix #19042
2023-05-05 02:33:45 +00:00
John Thacker 27d5ad3e10 Qt: Fix leak in Conversations and Endpoints dialogs
Free the data associated with the conversation table when
destroying the ATapDataModel.

The example file in #18292 leaks over 25 MB each time the
Conversations window is opened and closed and 7.5 MB each
time the Endpoints dialog is opened and closed.
2023-05-01 11:31:17 -04:00
John Thacker a2af96aa17 Qt: Fix leak in status bar
The return from cf_get_display_name must be g_free'd, so call
gchar_free_to_qstring when converting it to a QString, as elsewhere.
2023-04-29 20:14:28 -04:00
John Thacker 91e516c5d5 epan: move deprecated column check to column file
Move the deprecated column check functions from the prefs
file to the (Wireshark internal use) column files. Make
them public so that the recent file checking can use them.

This keeps column handling in one place.

Make the recent file column width checking able to convert
a deprecated column to a custom column the same as the main
prefs file.
2023-04-29 12:06:32 +00:00
John Thacker 02582737dc ui: Fix leak
g_list_remove_link does not actually free a node, only remove
it from the list. Call g_list_free_1 in order to actually free
the node.
2023-04-25 18:33:44 +00:00
John Thacker 0cec05a14c Move init_report_message before opening recent file
Commit 1d6cf2f513 changed prefs
with syntax error to call report_warning instead of printing
a log warning, which produces a GUI pop-up in Wireshark.

However, that means that the report message handling routines need
to be init'ed earlier, before the recent or recent_common files
are read, or else a syntax error in one of the recent configuration
files causes a segfault from deferencing a null pointer.
2023-04-24 18:09:12 -04:00
John Thacker 932e487e61 import_text: Fix leak
get_profile_dir says "caller must free the returned string."
Do so by converting to a QString with gchar_free_to_qstring
2023-04-24 17:45:22 -04:00
John Thacker 34444ab324 text2pcap: Fix leak
Free the SHB headers and IDB interface data from the dump parameters
after we are done with them.
2023-04-24 08:05:27 -04:00
Gerald Combs 64cacd49fa [Automatic update for 2023-04-23]
Update manuf, services enterprise numbers, translations, and other items.

services failed.
2023-04-23 16:45:31 +00:00