Commit Graph

7665 Commits

Author SHA1 Message Date
John Thacker 66fc2d4ee3 Qt: Actually ensure that rows are colorized
PacketListRecords should only report themselves as colorized when
colorized with the latest version of the coloring rules. Otherwise,
ensureRowColorized will not recolorize rows when the rules have changed.

This makes the minimap/intelligent scrollbar correctly update
colors in the background when the rules have changed. (Rows that
were being displayed were being updated, because the columnStrings
were invalidated at the same time, and when fetching the columnStrings
the colors would be updated if the rules had changed.)

Fix #17621
2023-02-09 15:27:58 +00:00
John Thacker 4f14745fce Qt: Fencepost error in minimap/intelligent scrollbar
The location of the next line should be based off one row larger
than the current row.

This fixes an issue where all the lines drawn in the intelligent
scrollbar are off by one - the color intended to be drawn for
the first packet never appears, the first packet corresponds to
the line for the second packet, etc., and there is a line at
the bottom that can never be colored in.

Fix #18850
2023-02-08 14:47:32 +00:00
João Valverde 84f963dfa2 Move ui/version_info.[ch] to wsutil 2023-02-07 23:17:37 +00:00
João Valverde c62aa67d2c Move ui/exit_codes.h to include/ 2023-02-07 10:12:08 +00:00
John Thacker fd183cb40b Qt: Add ability to cancel sorting
Add the ability to cancel sorting. Since we now parse user inputs
during the sort, test and set the capture file read lock. Try to
sort in PacketList::captureFileReadFinished, since now sorting during
thawing won't happen if it's in the middle of a rescan.

Fix #17640
2023-02-07 00:03:24 +00:00
João Valverde 7c156d9ac4 Add a #define HAVE_MSYSTEM and use it
In certain situations using __MINGW64__ is not correct.
We want to have the condition apply using MinGW-w64 but also
using MSYS2, which the __MINGW64__ condition alone does not
capture.

Add a HAVE_MSYSTEM C define and use it where appropriate.
2023-02-06 19:39:33 +00:00
João Valverde d9353d1684 Fix MSYS2 build
Fix:

```
FAILED: run/extcap/randpktdump.exe
cmd.exe /C "cd . && D:\a\_temp\msys64\ucrt64\bin\gcc.exe -fvisibility=hidden  -Wall -Wextra -Wpointer-arith -Wformat-security -fno-strict-overflow -fexcess-precision=fast -Wvla -Wattributes -Wpragmas -Wredundant-decls -Wunreachable-code -Wlogical-op -Wno-error=stringop-overflow= -Wno-error=deprecated-declarations -Wframe-larger-than=32768 -Wno-format-truncation -fdiagnostics-color=always -Wshadow -Wold-style-definition -Wstrict-prototypes -Wno-pointer-sign -march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -fmacro-prefix-map=D:/a/wireshark/wireshark/build/src/wireshark/= -fmacro-prefix-map=D:/a/wireshark/wireshark/build/src/build-UCRT64/= -O3 -DNDEBUG -pipe     -Wl,--as-needed  -municode CMakeFiles/cli_main.dir/cli_main.c.obj extcap/CMakeFiles/extcap-base.dir/extcap-base.c.obj extcap/CMakeFiles/randpktdump.dir/randpktdump.c.obj extcap/CMakeFiles/randpktdump.dir/__/resources/randpktdump.rc.obj -o run\extcap\randpktdump.exe -Wl,--out-implib,run\librandpktdump.dll.a -Wl,--major-image-version,0,--minor-image-version,0  run/librandpkt_core.a  run/libwiretap.dll.a  -lws2_32  run/libui.a  run/libwsutil.dll.a  D:/a/_temp/msys64/ucrt64/lib/libglib-2.0.dll.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
D:/a/_temp/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: run/libui.a(failure_message.c.obj):failure_messag:(.text+0x129): undefined reference to `__imp_wtap_strerror'
```

After this change:

```
[2177/2600] Linking C executable run/dumpcap
Warning: Unused direct dependencies:
	/usr/lib/libnl-route-3.so.200
	/home/jpv/code/wireshark/devel/build/run/libwiretap.so.0
```
2023-02-06 19:35:43 +00:00
j.novak@netsystem.cz 0c0f731c92 extcap: Fix of handling default values 2023-02-06 18:29:25 +00:00
João Valverde 02238edf92 Do not require using wsgcrypt.h
The reason to use wsgcrypt.h was to wrap it around DIAG_OFF()
macros and that should no longer be necessary.
2023-02-06 15:52:10 +00:00
João Valverde 71cfbd81b3 Remove wspcap.h and use config.h instead
Forcing the use of a dedicated header to replace pcap.h is
unnecessary code and mental overhead in this case. We can
use config.h instead for the same purpose of defining a
macro symbol before including pcap.h.
2023-02-06 15:05:36 +00:00
João Valverde b07ab25a1c CMake: Cleanup unnecessary linking with shared libraries 2023-02-06 15:04:46 +00:00
Gerald Combs 754ec536e5 [Automatic update for 2023-02-05]
Update manuf, services enterprise numbers, translations, and other items.
2023-02-05 16:47:29 +00:00
John Thacker 4bb43d5986 RTP Stream Dialog: Actually sort on packet loss
The packet loss column has been sorting on a private variable
that is never set(?!) and also is unsigned whereas the actual
lost number is signed. Get the calculated packet loss number
and sort by that. (Should this be sorting by the total number or
the percentage, since the column displays both? Total number is
first so let's use that.)

This should probably be some kind of Model/View instead.

Fix #16785.
2023-02-04 22:15:25 -05:00
John Thacker 15dfa3aa20 Qt: Fix order of ShowAs enums
The ShowAs enum should stay in the same order as the Items
are added to the ShowAs combobox, because setCurrentIndex()
is used with the enum values, e.g. when setting the value to
"Show As Image" when the bytes are an image.
Fixup c9e08b7be3
2023-02-01 21:18:58 -05:00
Gerald Combs 9d9d72f47b Qt: Fix Logray compilation with Qt 6.4
Copy+paste afa2579124 to fix

wireshark/ui/logray/logray_main_window_slots.cpp:1564:40: error: attempt to use a deleted function
            stats_tree_action->setData(cfg->abbr);
                                       ^
Qt/6.4.2/macos/lib/QtCore.framework/Headers/qvariant.h:199:5: note: 'QVariant<char *, false>' has been explicitly marked deleted here
    QVariant(T) = delete;
    ^
2023-01-31 14:03:04 -08:00
Gerald Combs 620dc806db [Automatic update for 2023-01-29]
Update manuf, services enterprise numbers, translations, and other items.

services failed.
2023-01-29 18:53:10 +00:00
Tomasz Moń 516c69b921
Qt: Allow caching columns while dissecting color
It is fine to dissect and cache columns data during color dissection if
it won't evict already cached data. There is rather high probability of
using the column data because color information is dissected in order.
2023-01-29 10:39:06 +01:00
Gerald Combs 6787835373 [Automatic update for 2023-01-22]
Update manuf, services enterprise numbers, translations, and other items.
2023-01-23 00:27:45 +00:00
Gerald Combs cd9f7b64c7 Logray: Remove the "Follow Stream" dialog
We don't reassemble log data into streams, so remove the "Follow" dialog
(for now, at least).
2023-01-22 23:36:23 +00:00
João Valverde 133bebb18b Qt: Fix build with Qt version < 5.14 2023-01-21 12:14:07 +00:00
João Valverde 39124f2f8f Fix Personal Extcap folder path
The personal extcap folder $XDG_CONFIG_DIR/wireshark on Linux is
inconsistent with the global extcap folder (lib/wireshark/extcap)
and personal plugins folder (.local/lib/wireshark/plugins) and also
the configuration folder should not contain architecture-specific files.

The extcap personal folder is changed from:

    .config/wireshark/extcap

to:

    .local/lib/wireshark/extcap
2023-01-20 22:30:26 +00:00
João Valverde d7427e73af Qt: Fix capitalization of About->Folder characterization
Capitalize Lua as a proper name.

Uncapitalize "Extcap Paths" for consistency.
2023-01-20 14:55:23 +00:00
João Valverde c66fc43e5b GUI: Ship authors as a Qt resource file 2023-01-20 13:35:03 +00:00
John Thacker 199ecf2983 Qt: Clear selection, not current, in drawCurrentPacket
QItemSelectionModel tracks both the selected index and the
current index.

PacketList redraws when the *selected* index changes, not
the current index. Clearing the current index, and then marking
the same packet as selected and current fires currentChanged but
not selectionChanged. So drawCurrentPacket needs to call
clearSelection(), not clearCurrentIndex(), in order to trigger
a redissection of the currently selected packet and update
the packet details.

For example, if you mark or unmark the currently selected frame,
this causes the packet details to update. Cf 52955b9c43,
which fixed the same issue but for Find Packet.

Fix #14330.
2023-01-19 19:51:37 -05:00
John Thacker 38fbccd33e Follow: Remove use of follow type from FollowStreamDialog
We can check if we have a follower. follow_type_t is still
used in the constructor, for now, since other parts call it.
2023-01-19 14:49:37 -05:00
João Valverde 2ab291b3b2 GUI: Ship license + acknowledgements as Qt resource 2023-01-19 19:14:32 +00:00
John Thacker 0a840b5dd8 Follow: Remove check for FOLLOW_TCP for fragments in Qt
Only TCP uses fragments, but we don't need to check FOLLOW_TCP
because the fragments pointers exist but are null if not being
used. See the similar code in epan/follow.c

Part of making it simpler for dissectors to register with Follow.
2023-01-19 18:34:45 +00:00
Mikael Kanstrup c4db402db5 Add follow websocket stream support
The websocket protocol masking feature makes follow TCP stream
on websocket traffic show masked payload. To easily view unmasked
and reassembled websocket payload add follow websocket stream
support.
2023-01-19 03:14:18 +00:00
João Valverde 06519be205 Install documentation (HTML manuals) to DOCDIR
Install documentation to DOCDIR instead of DATADIR.
The code must be fixed to open the Help URLs from
this new path.

This only affects Unix-like FHS platforms. Windows
installation does its own thing.

Needs testing with macOS packaging.
2023-01-19 01:40:59 +00:00
John Thacker a05104df66 Qt: Fix build on OpenSUSE 15.3
OpenSUSE requires explicitly including the QTime header.
Fixup 4d3d856d8f
2023-01-17 20:38:48 -05:00
John Thacker 4d3d856d8f Qt: Conversation/Endpoint table Filter by different QVariant types
Return the percentage in the UNFORMATTED_DISPLAYDATA converted
from our string so it it compares properly with an equality filter.

Use QVariant comparisons where appropriate so that Filter by
works as expected with types that are not integers, such as doubles
the City/Country strings from GeoIP, or when absolute start time
is used for conversation starts.

Fix #18738.
2023-01-17 16:47:19 +00:00
John Thacker 9afd2f23ef Qt: Plug credentials model memory leak 2023-01-17 13:25:02 +00:00
Stig Bjørlykke d851134d89 ui: Check occurrence when check for existing custom column
Add a check for occurrence in column_prefs_has_custom() to allow
"Apply as Column" if column already exists with occurrence set.
2023-01-17 08:34:09 +00:00
Gerald Combs 3bde296404 [Automatic update for 2023-01-15]
Update manuf, services enterprise numbers, translations, and other items.
2023-01-15 23:10:01 +00:00
John Thacker acf0ee420f Proto hierarchy stats: obtain capture file read lock
Obtain the capture file read lock when computing protocol hierarchy
stats to prevent segfaulting if the file is closed.

The protocol hierarchy stats are always computed on all the packets
of the current file that pass the current filter, so don't let it run
until a read or rescan is complete.

Since the protocol hierarchy stats use the common progress bar,
these two changes keep it from hijacking the progress bar when a
rescan is in progress, which led to anomolies with the stop button
behavior and clearing the progress bar when the stats were done
(but not the temporarily paused rescan.)

Make the stop button actually stop the protocol hierarchy stats.

In the future, the protocol hierarchy stats could perhaps use
process_specified_records from file.c

Fix #18787. Fix #18788.
2023-01-15 16:09:17 +00:00
John Thacker 0c3c3e9342 Qt: ElidedLabel escapes HTML
ElidedLabel escapes HTML after !9261, so use its own methods to make text
small and italicized instead of passing in rich text.

IOGraphDialog used to make an error message, if it existed, bold.
Perhaps ElidedLabel should have a way to have prepended bold
text for such usage.
2023-01-14 13:20:00 -05:00
John Thacker a25bcce10a Qt: Only autoset display filter when dialog is opened
Autoset "Limit to display filter" if a display filter is
present when the dialog is open, but do not re-enable it each
time the widget is updated, if the user has unchecked it.

[skip ci]

Fix #18461
2023-01-14 13:17:02 -05:00
John Thacker 4484736366 Qt: Set small text for ExpertInfoDialog filter
ElidedLabel has its own method to set small text and italicize.
After !9261, any HTML that is passed into it appears escaped,
which we don't want.
2023-01-14 12:19:45 -05:00
João Valverde a23bab971e MinGW: Disable -Wcast-function-type warnings 2023-01-14 14:52:53 +00:00
Gerald Combs ad3205000b Qt: Add a donation link to the welcome page 2023-01-14 02:09:55 +00:00
John Thacker a59a663618 Qt: Sort strings, like GeoIP country or city, in Endpoints
QVariant canConvert<double>() does not test that a particular QVariant
value can be converted to a double, but only that at least some values
of that type can convert. (Just checking the type is much faster than
actually trying the conversion; this is why convert() has a boolean
output parameter as well.) It thus always returns TRUE for strings even
for strings that fail to convert, and is not by itself a useful test
when trying to sort unknown types.

Luckily, we don't need to test this anyway. Set the default data role used
for sorting to UNFORMATTED_DISPLAYDATA, so the parent QSortFilterProxyModel
will handle QVariants that are numbers appropriately. In particular,
this makes the GeoIP city and country column strings in the Endpoints
table sort correctly.

Fix #18749
2023-01-13 19:13:02 -05:00
John Thacker 4307d13195 Qt: Fix selection of filter column in Conversation table
When converting from our columns as displayed to the canonical
list of columns, add 1 for the missing conversation ID if it
is not present (as opposed to if it is present.) Also change the
test for the total packets to account for the new conversation ID
column.

Related to #18738
2023-01-13 18:07:07 -05:00
João Valverde f3152af8a0 MinGW: Fix -Wsign-compare 2023-01-13 22:41:04 +00:00
João Valverde 215a2d7477 MinGW: Fix -Wformat-zero-length 2023-01-13 22:41:04 +00:00
João Valverde b94e7f953f MinGW: Fix -Wreturn-type
main.cpp:1087:1: error: no return statement in function returning non-void [-Werror=return-type]
 1087 | }
      | ^
2023-01-13 22:41:04 +00:00
João Valverde 6801490aea Qt: Fix AA_EnableHighDpiScaling Qt6 deprecation 2023-01-13 22:41:04 +00:00
João Valverde 5b54223ce5 version info: Fix extra space after "(" 2023-01-13 16:09:17 +00:00
John Thacker bf8f30eba4 Qt: Fix test for appending rows to UAT tables
We want to return with failure when the number of entries in
the row we're trying to append is greater than the number of
columns, not less than the number of rows in the table.

The IO Graph is the only place that uses appendEntry, and this
allows adding IO Graphs past the tenth graph.

Fix #18762
2023-01-13 09:02:47 +00:00
João Valverde d00bd20fea MSYS2: Fix system installation
Make the "ninja install" target in the MINGW64 shell work and
allow Wireshark to run from the msys2 installation, besides
the build directory.

To clarify the names used here MSYSTEM is the distribution with a
Linux-like environment for Windows. MINGW is the toolchain.

It is possible to use MinGW without MSYS2 and we generally select
the CMake variables WIN32/MSVC/MINGW/USE_MSYSTEM taking that into
consideration but that WIN32+MINGW platform is not supported at the
moment and it's unlikely to be supported in the near future.
2023-01-12 14:30:41 +00:00
João Valverde 4c9b0d846c CMake: Reverse debug macros
Originally WS_DISABLE_DEBUG was chosen to be
similar to G_DISABLE_ASSERT and NDEBUG.

However generator expressions are essential for modern CMake
but the syntax is weird and having to use negations makes it
ten-fold worse.

Remove the negation. Instead of changing the CMake variable
reverse the macro definition for WS_DISABLE_DEBUG.

The $<CONFIG:cgs> generator expression with multiple config arguments
requires CMake >= 3.19 so we can't use that yet for a further
syntactical simplification.
2023-01-12 00:59:15 +00:00