Commit Graph

4813 Commits

Author SHA1 Message Date
João Valverde ae14849864 Windows: Use SpeexDSP binary package
Remove bundled code and use vcpkg binary library instead.
2022-12-16 11:11:28 +00:00
Roland Knall 18c2f29610 Qt: Limit copy of TrafficDialog to visible items
The traffic dialogs did not respect the filtered elements, when copying
data as CSV, Yaml or JSON

Fixes #18530
Fixes #18637
2022-12-15 16:39:54 +00:00
Roland Knall c1169d587c Qt: Fix Packet Comments shortcut
The shortcut for adding a new packet comment is not available
until the menu has first been shown, or a packet has been selected.

This is a bug, as it is not clear to the user, why the shortcut should
exist in one instance and not in the other. Therefore the shortcut is
always added.

It is not added in the .ui files, as this would trigger a new set of
translations.

Fixes #18673
2022-12-15 15:46:53 +00:00
Philipp Dittmann bca2b4dd9e Qt: Fix Qt 6.4 QMouseEvent deprecation
QMouseEvent constructor is deprecated in Qt 6.4. Changed to another
6.0 constructor.
2022-12-15 14:12:54 +00:00
Tomasz Moń c6ee65db6b
Qt: Display extcap uncheckable multicheck items as labels
Commit e1a8f0119e ("Extcap prefs: Editor remembers empty values")
inadvertently made the immutable checkbox visible next to uncheckable
multicheck items. Restore former behavior, that is display only labels
for uncheckable multicheck items, by setting unchecked state only for
checkable items.

Uncheckable items, since its introduction in commit 9c1225f735
("Modify multicheck to accept parent parameter."), were used to display
additional labels in USBPcap configuration options to aid user in
determining which individual device to filter on. Without the additional
information determining for example which "USB composite device" is of
interest to the user is really problematic.
2022-12-15 06:50:49 +01:00
Chuck Craft 2aa40d4488 Qt: crash on negative row in Conversations 2022-12-14 18:10:58 +00:00
Developer Alexander edf48633bb IO Graph: 3 new styles 2022-12-14 15:02:54 +00:00
Moshe Kaplan f413260df9 WSLUA: Add new lua function register_packet_menu()
This adds support to Wireshark for custom context menus for packets, so
that when a packet's context menu is opened (e.g., by right-clicking),
Wireshark can support doing things like "run a program" or
"open a URL" with a field from the packet as a parameter. Note that
this is similar to ArcSight's integration commands feature.

For example, it could be used like the following:

```
ROBTEX_URL = "https://www.robtex.com/dns-lookup/"
local function search_robtex(...)
    local fields = {...};

    for i, field in ipairs( fields ) do
        if (field.name == 'http.host') then
            browser_open_url(ROBTEX_URL .. field.value)
            break
        end
    end
end
register_packet_menu("Search host in Robtex", search_robtex, "http.host");
```

Fixes issue #14998
2022-12-07 18:47:14 +00:00
Gerald Combs 932f4ff893 Qt: Don't use QString::toLocal8Bit().
As the QString::toLocal8Bit() documentation says,

"On Unix systems this is equivalen to toUtf8(), on Windows the systems
current code page is being used."

This is problematic for the Packet Comments dialog, since the comments
need to be UTF-8 as per the pcapng specification. Use toUtf8() instead
there and in the Import Text dialog.

Remove the toLocal8Bit() calls from the Extcap Options dialog since they
weren'nt needed.

Blind attempt at fixing #18698.
2022-12-06 17:19:07 +00:00
Gerald Combs cb85a4b1a4 Qt: Convert our widgets and models to new-style signals & slots
Convert our remaining widget and model code to new-style signals and
slots.
2022-12-05 19:53:34 +00:00
Gerald Combs 0c1a10b02b Qt: Update an action name.
647978b8be renamed actionAnalyzeCreateAColumn to
actionAnalyzeApplyAsColumn. Update the packet list accordingly.
2022-12-05 10:03:18 -08:00
Gerald Combs 647978b8be Qt: Manually connect our "Analyze" menu actions. 2022-12-04 22:54:01 +00:00
Gerald Combs 5eb2a7f7b7 Qt: Miscellaneous ByteViewText fixes.
Don't use isEmpty() internally. Name a variable "em_width_" to match the
convention we use elsewhere. Use our viewport's font metrics.
2022-12-03 18:47:36 +00:00
João Valverde 967a3c3df9 Qt: Check field autocomplete for syntactical validity
Currently the autocompletion engine always suggests a protocol
field completion, even in places where it isn't syntactically
valid.

Fix that by compiling the preamble to the token under the cursor
and checking the returned error. If it is DF_ERROR_UNEXPECTED_END
that indicates a field or literal value was expected. Otherwise
a field replacement is not valid in this position.

Fixes #12811.
2022-12-01 22:50:09 +00:00
João Valverde a0d77e9329 dfilter: Return an error object instead of string
Return an struct containing error information. This simplifies
the interface to more easily provide richer diagnostics in the future.

Add an error code besides a human-readable error string to allow
checking programmatically for errors in a robust manner. Currently
there is only a generic error code, it is expected to increase
in the future.

Move error location information to the struct. Change callers and
implementation to use the new interface.
2022-11-28 15:46:44 +00:00
j.novak@netsystem.cz e67c71faba RTP Player: Fix: Playback marker do not move after resume with Qt6 2022-11-24 15:32:36 +00:00
John Thacker 5af4587255 QCustomPlot: Fix some warnings in upstream code
QPainter::HighQualityAntialiasing is obsolete and ignored
(https://doc.qt.io/qt-5/qpainter.html#RenderHint-enum) since
at least 5.6, so use Antialiasing instead, as indicated by the docs.
(https://doc.qt.io/archives/qt-5.6/qpainter.html#RenderHint-enum)

(ported from commit d0088585b3)
2022-11-23 01:02:25 +00:00
Alexis La Goutte 6959280581 QCustomPlot: Fix Clang Warnings
qcustomplot.cpp:34001:37: warning: The left operand of '-' is a garbage value [core.UndefinedBinaryOperatorResult]
qcustomplot.cpp:34001:37: warning: The right operand of '-' is a garbage value [core.UndefinedBinaryOperatorResult]

(ported from commit a0328bdb03)

qcustomplot.cpp:26643:9: warning: 1st function call argument is an uninitialized value [core.CallAndMessage]
qcustomplot.cpp:27752:11: warning: 1st function call argument is an uninitialized value [core.CallAndMessage]
qcustomplot.cpp:27779:11: warning: 1st function call argument is an uninitialized value [core.CallAndMessage]
qcustomplot.cpp:34087:7: warning: 2nd function call argument is an uninitialized value [core.CallAndMessage]

(ported from commit 075ee9138a)

qcustomplot.cpp:22400:17: warning: The left operand of '>' is a garbage value [core.UndefinedBinaryOperatorResult]
qcustomplot.cpp:22400:17: warning: The right operand of '>' is a garbage value [core.UndefinedBinaryOperatorResult]
qcustomplot.cpp:35170:17: warning: The left operand of '>' is a garbage value [core.UndefinedBinaryOperatorResult]
qcustomplot.cpp:35170:17: warning: The right operand of '>' is a garbage value [core.UndefinedBinaryOperatorResult]

(ported from commit 6fd4188804)
2022-11-23 01:02:25 +00:00
João Valverde ea7bec688a QCustomPlot: Try to fix -Wdocumentation-html warnings
Warning triggered using AppleClang 11.0.0.

/Users/buildslave/builds/UfJL1hoT/0/wireshark/wireshark/ui/qt/widgets/qcustomplot.cpp:16020:17: error: HTML tag 'tt' requires an end tag [-Werror,-Wdocumentation-html]
  parameter as <tt>QVariant(\ref QCPDataSelection)</tt>. All plottables that weren't touched by \a
               ~^~~
1 error generated.

(ported from commit 6d2aea45e4)
(ported from commit 3903740534)
2022-11-23 01:02:25 +00:00
John Thacker b262dd3d29 QCustomPlot: Fix clang warning on Qt5
Fix a shortening warning from qint64 to int on Qt5.
2022-11-23 01:02:25 +00:00
John Thacker 117fa55c04 QCustomPlot: Fix some clang code analysis warnings
Two dead stores and a possible call of memcpy with a null
destination.

(cherry picked from commit 67301b471a)
2022-11-23 01:02:25 +00:00
John Thacker f60e35e481 QCustomPlot: Fix spelling 2022-11-23 01:02:25 +00:00
Kevin Hogan c90ba8c1b1 QCustomPlot: Fix adaptive sampling performance on scatterplots
QCustomPlot's adaptive sampling decimates the data to be plotted based
on the screen resolution.  Specifically, if many data points fit within
the same pixel on the X (key) axis, then QCustomPlot attempts to plot
only the min value, the max value, and a few values in-between to
maintain a good "density" on the Y (value) axis.

The density QCustomPlot wants is about one datapoint for every 4 pixels
covered by the value range of a single X (key) pixel.  Unfortunately,
this calculation is flawed if all values also fit within a single pixel
on the Y (value) axis - so this change fixes that bug.

(cherry picked from commit 92e652ebfa)
2022-11-23 01:02:25 +00:00
João Valverde cb9a1479cd QCustomPlot: Fix clang -Wmisleading-indentation
(ported from commit e5cb4ddd87)
2022-11-23 01:02:25 +00:00
John Thacker e5dc339c18 QCustomplot: Fix clang -Wdocumentation 2022-11-23 01:02:25 +00:00
Gerald Combs b9b16e2f64 QCustomPlot: Fix qsizetype warnings
Starting with Qt 5.10 (our earliest supported version),
Qt has a qsizetype (alias of ssize_t) that functions
like size() and indexOf() return. On clang that does not
have the same size as an int, so cast it away in a number
of places.
2022-11-23 01:02:25 +00:00
John Thacker 498dc04278 Qt: Update QCustomPlot to 2.1.1
Remove a bunch of line ending whitespace from upstream to
get it to compile.

Fix #18654
2022-11-23 01:02:25 +00:00
John Thacker 646df7fe14 Qt: Fix crash when clicking on expanded entry in Expert Info Dialog
The root node has a NULL associated field_info struct, so check
for that.

Fix #18662
2022-11-21 20:36:41 -05:00
João Valverde 2128053e7c Qt: Improve log handler output
Use LOG_LEVEL_ECHO instead of LOG_LEVEL_WARNING for debug
output that is always displayed.

Add file/line/function information.
2022-11-21 12:23:50 +00:00
Gerald Combs f9e0e555e0 [Automatic update for 2022-11-20]
Update manuf, services enterprise numbers, translations, and other items.

services failed.
2022-11-20 16:46:55 +00:00
João Valverde 3903740534 Try to fix more -Wdocumentation-html warnings
/Users/buildslave/builds/UfJL1hoT/0/wireshark/wireshark/ui/qt/widgets/qcustomplot.cpp:16020:17: error: HTML tag 'tt' requires an end tag [-Werror,-Wdocumentation-html]
  parameter as <tt>QVariant(\ref QCPDataSelection)</tt>. All plottables that weren't touched by \a
               ~^~~
1 error generated.
2022-11-17 13:34:21 +00:00
João Valverde 6d2aea45e4 Try to fix an -Wdocumentation-html warnings
Warning triggered using AppleClang 11.0.0.
2022-11-17 12:34:42 +00:00
João Valverde 09718fb9b3 CMake: Move clang warnings
Move clang warnings to normal set. Let the CMake compatibility
check control the warning.

Fix or work-around -Wunreachable warnings in the code.
2022-11-17 01:35:16 +00:00
John Thacker 5362cc9b3e Fix build on OpenSUSE 15.3
On older Qt versions (5.12?) QVector needs to be included,
not just QObject. (It isn't needed on 5.15, possibly because
QVector is an alias for QList in newer Qt versions.)
2022-11-16 08:21:13 +00:00
John Thacker 6e041d9afa Qt: Fix typo in proto_tree_model
Don't take the address of a pointer in the foreach function.
Fixes the main status bar not updating properly because of
inability to find a field.
2022-11-14 11:36:43 -05:00
John Thacker b7ed46288a Qt: Speed up ProtoTreeModel with lots of items
When creating a ProtoNode, count the (non-hidden) children and put
them in a QVector. This saves time having to iterate through all
of a node's children (or the parent's children) each time the
model or view wants to get the row or index number. Create and
delete the needed ProtoNodes when the root node is changed, instead
of recreating them on demand from the proto_nodes (since they're no
longer a thin wrapper.)

Fix #18625
2022-11-14 06:28:16 -05:00
Gerald Combs 0bfdd0d954 [Automatic update for 2022-11-13]
Update manuf, services enterprise numbers, translations, and other items.
2022-11-13 18:12:27 +00:00
John Thacker 91279eb90e Qt: Add GeoIP latitude and longitude to Endpoints table
Fix #17049
2022-11-10 17:48:29 +00:00
Gerald Combs 85357ae721 Fix more unused variables and enable unused-but-set-variable errors.
Add -Werror=unused-but-set-variable to our default compiler flags and fix

```
epan/dissectors/packet-dcerpc-frsrpc.c:709:10: error: variable 'nb_chunk' set but not used [-Werror,-Wunused-but-set-variable]
        guint32 nb_chunk = 0;
                ^
```

```
epan/dissectors/packet-dcom-oxid.c:175:13: error: variable 'u32ItemIdx' set but not used [-Werror,-Wunused-but-set-variable]
    guint32 u32ItemIdx;
            ^
```

```
epan/dissectors/packet-l2tp.c:1775:104: error: parameter 'ccid' set but not used [-Werror,-Wunused-but-set-parameter]
static int dissect_l2tp_ericsson_avps(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 ccid)
                                                                                                       ^
```

```
epan/dissectors/packet-ldp.c:1922:19: error: variable 'ix' set but not used [-Werror,-Wunused-but-set-variable]
    guint8        ix;
                  ^
```

```
epan/dissectors/packet-nas_5gs.c:4757:14: error: variable 'curr_len' set but not used [-Werror,-Wunused-but-set-variable]
    guint i, curr_len;
             ^
```

```
epan/dissectors/packet-per.c:1769:6: error: variable 'extension_addition_entries' set but not used [-Werror,-Wunused-but-set-variable]
        int extension_addition_entries;
            ^
```

```
epan/dissectors/packet-rtitcp.c:618:11: error: variable 'messages_count' set but not used [-Werror,-Wunused-but-set-variable]
    guint messages_count, offset;
          ^
```

```
epan/dissectors/packet-tcp.c:2130:9: error: variable 'ackcount' set but not used [-Werror,-Wunused-but-set-variable]
    int ackcount;
        ^
epan/dissectors/packet-tcp.c:3317:12: error: variable 'nbOptionsChanged' set but not used [-Werror,-Wunused-but-set-variable]
    guint8 nbOptionsChanged = 0;
           ^
```

```
epan/dissectors/packet-zbee-zcl-se.c:11802:15: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
    for (gint i = 0; tvb_reported_length_remaining(tvb, *offset) >= 5; i++) {
              ^
```

```
ui/iface_lists.c:142:23: error: variable 'linktype_count' set but not used [-Werror,-Wunused-but-set-variable]
    gint              linktype_count;
                      ^
```

```
ui/voip_calls.c:456:15: error: variable 'item_num' set but not used [-Werror,-Wunused-but-set-variable]
    guint     item_num;
              ^
```

```
file.c:572:17: error: variable 'count' set but not used [-Werror,-Wunused-but-set-variable]
        guint32 count             = 0;
                ^
```

```
file.c:3667:24: warning: cast from 'const unsigned char *' to 'unsigned char *' drops const qualifier [-Wcast-qual]
        pd = (guint8 *)ws_mempbrk_exec(pd, buf_end - pd, pattern, &c_char);
                       ^
```

```
ui/qt/io_graph_dialog.cpp:1932:60: error: variable 'mavg_right' set but not used [-Werror,-Wunused-but-set-variable]
    unsigned int mavg_in_average_count = 0, mavg_left = 0, mavg_right = 0;
                                                           ^
```

```
ui/qt/stats_tree_dialog.cpp:166:9: error: variable 'node_count' set but not used [-Werror,-Wunused-but-set-variable]
    int node_count = 0;
        ^
```

```
ui/qt/models/profile_model.cpp:1142:13: error: variable 'entryCount' set but not used [-Werror,-Wunused-but-set-variable]
        int entryCount = 0;
            ^
```
2022-11-08 13:49:44 -08:00
Stig Bjørlykke 16afad10fb Qt: Fix a deprecated warning
warning: 'parentWidget' is deprecated: Use parent() with qobject_cast()
instead [-Wdeprecated-declarations]
2022-11-06 22:33:25 +00:00
Gerald Combs 0bfe5bed72 [Automatic update for 2022-11-06]
Update manuf, services enterprise numbers, translations, and other items.
2022-11-06 17:57:36 +00:00
Martin Mathieson b860351e7f Packet List: preserve horizontal scroll extent for PgUp/PgDn 2022-11-05 21:56:19 +00:00
John Thacker e449b560c0 epan: Properly generate filter expressions for custom columns
Properly generate filter expressions for custom columns by
using proto_construct_match_selected_string on each value and
then joining them together later instead of trying to split
the column expression value.

This ensures that escaping is done properly for display filter
strings, that commas internal to field values are not confused
with commas between occurrences, that for multifield columns
we can distinguish which field each value matches, etc.

It's not entirely clear whether AND or OR logic is appropriate
for multiple occurrences; currently OR is used.

Bump glib requirement to 2.54 for g_ptr_array_find_with_equal_func
(this doesn't drop support for any major distribution that already
meets our other library requirements, like Qt.)

Fix #18001.
2022-11-02 19:46:11 +00:00
Roland Knall fd7716542c Qt: Move generic methods to utils
Move the utils for checking for the last used directory and storing
it out of ProfileDialog, as they are not Profiles specific
2022-11-01 18:12:07 +00:00
Chuck Craft 91c0669fb7 Qt: KeyboardInputInterval - allow more relaxed typing for keyboardSearch
Gtk popped up a search box when typing in the tree view.
Most places in Qt, a Search: field was added to the dialog.
Looks possible to buffer keystrokes and do a string search in Qt.

Default value is 400ms (even on Windows). Average typing speed of
200 cpm = 300ms per character = too close to 400ms when searching
the protocol name in Preferences -> Protocols.
2022-11-01 17:39:16 +00:00
David Perry c18809a861 Change some `wmem_packet_scope()` to `pinfo->pool` 2022-11-01 14:03:44 +00:00
Eugène Adell 6759377b93 TCP: Overriding of the automatic SEQ Analysis 2022-11-01 10:01:35 +00:00
Roland Knall 5f46ce935e Profiles: Fix export crashing for single profile
When the classic profile has been cloned, and it contains
coloring rules, that are no longer valid or their syntax is
wrong, the export of single profiles will fail.

The reason for that is still being investigated. It seems
there might be an issue with selecting the right coloringfilter
to be selected.

This change only fixes the coloringrules file and the
index is selected from the base model instead
2022-10-31 18:53:50 +00:00
Nils Hanke 34a66401e8 UI: Only sort visible packets instead of all packets
Previously, Wireshark was sorting all packets in a capture,
regardless whether they were actually visible or not. If you
are working with large PCAPs & filters, this is a MASSIVE
performance drag. Therefore, this commit changes this
by only sorting the visible packets which boosts the
sorting performance in filtered views massively.
2022-10-31 16:50:11 +00:00
John Thacker 2ad4b5bb3c Qt: Generate filter expressions for columns with multiple occurrences
Generate filter expressions for columns with multiple occurrences
by using the membership operator (which is semantically OR).
It's not clear if this approach makes more sense than AND;
there's use cases for both.

Don't do this for multifield custom columns, since we don't know
which values were found by which field. That takes changing
the column logic in several places.

Ping #18001
2022-10-31 16:03:24 +00:00