Commit Graph

7658 Commits

Author SHA1 Message Date
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
João Valverde 25d4a099f7 Remove WS_DISABLE_ASSERT
Assertions can be enabled/disabled using WS_DISABLE_DEBUG. The extra
granularity afforded by WS_DISABLE_ASSERT seems unnecessary.
2023-01-12 00:59:15 +00:00
John Thacker 06ba704058 Qt: Accept ColoringRulesDialog after writing colors
Instead of connecting ColoringRulesDialog's buttonBox accepted()
signal to two different slots (once in the .ui file, and one
automatically from a name), accept the dialog only after writing
the colors.

This prevents starting to recolor the PacketList before the new color
list has been been written.

Fix #12475. Fix #15471.
2023-01-11 17:11:49 -05:00
Martin Mathieson fc013d9bd6 Set unique exit codes for processes 2023-01-11 09:56:26 +00:00
Gerald Combs 0f824b8b34 [Automatic update for 2023-01-08]
Update manuf, services enterprise numbers, translations, and other items.

services failed.
2023-01-09 03:16:38 +00:00
John Thacker 0c24b0ae72 Qt: Remove duplicate column reset and cache invalidation
The filterPackets method calls file.c/cf_filter_packets,
which calls rescan_packets, which sends signals when done that
eventually calls the PacketList::captureFileReadFinished

PacketList::captureFileReadFinished invalidates all the column
strings after the rescan may have updated their information
(e.g., delta time to previous displayed packet), so it is not
necessary to reset the column strings a second time explicitly
in filterPackets.

Commit 38cde83a5c added the reset
to filterPackets, but commit bbe5fc1028
added the invalidateAllColumnStrings to captureFileReadFinished
that made the prior commit unnecessary.
2023-01-07 09:05:17 -05:00
John Thacker da3a48f820 Qt: Add a pref for column text caching, and have it affect sorting
Introduce a preference for the number of rows whose column text can
be cached, and allow sorting of the packet list only when the
number of displayed rows can fit in the cache. This preference only has
an effect for sorting based on columns that require dissection and
caching the column text. This reduces the number of dissections from
O(N log N) to N. Subsequent sorts are even faster.

Columns based on frame data are unaffected, as they sort much faster
as dissection is not required.

Set the size of the QCache introduced in 8c6854fb65 based
on this preference.

Send a temporary status message to the status bar if we try to sort
but there are too many rows, explaining why sorting did not happen and
that the layout preferences can be changed.

Ping #18741
2023-01-07 13:20:24 +00:00
João Valverde df30299aff dftest: Add -h and improve output format
Experiment with removing the type from the instruction output.

This information is also available with the -s option flag.

Rename -t to -s.
2023-01-06 01:43:42 +00:00