Commit Graph

7682 Commits

Author SHA1 Message Date
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 79c3a77752 Add macros to control lemon diagnostics
Rename flex macros using parenthesis (mostly a style issue):

DIAG_OFF_FLEX -> DIAG_OFF_FLEX()
DIAG_ON_FLEX  -> DIAG_ON_FLEX()

Use the same kind of construct with lemon generated code using
DIAG_OFF_LEMON() and DIAG_ON_LEMON(). Use %include and %code
directives to enforce the desired order with generated code
in the middle in between pragmas.

Fix a clang-specific pragma to use DIAG_OFF_CLANG().

DIAG_OFF(unreachable-code) -> DIAG_OFF_CLANG(unreachable-code).

Apparently GCC is ignoring the -Wunreachable flag, that's why
it did not trigger an unknown pragma warning. From [1}:

  The -Wunreachable-code has been removed, because it was unstable: it
  relied on the optimizer, and so different versions of gcc would warn
  about different code.  The compiler still accepts and ignores the
  command line option so that existing Makefiles are not broken.  In some
  future release the option will be removed entirely. - Ian

[1] https://gcc.gnu.org/legacy-ml/gcc-help/2011-05/msg00360.html
2022-11-20 10:11:27 +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 cfbe898dcc CMake: Disable -Werror for flex generated files 2022-11-17 10:23:12 +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
j.novak@netsystem.cz 3aafecb7b9 Main dialog: Wireshark stops extcap on exit if no packets received yet 2022-10-31 16:01:58 +00:00
Jaap Keuter 69daf2e339 QT: When opening files, filter on All Capture Files immediately 2022-10-31 14:35:49 +00:00
Jim Young 11990f258d Qt: Add ProgressFrame to the Expert Information dialog 2022-10-31 14:15:18 +00:00
Chuck Craft 81bd7b1415 Qt: filter_dialog - make Cancel button functional
Works properly when called from Capture/Display filter bookmark.
This change duplicates that code.
2022-10-31 14:14:00 +00:00
j.novak@netsystem.cz dd5f86c674 Capture options dialog: Fix start of capture by double click 2022-10-31 14:07:49 +00:00
Roland Knall c59804f25f Qt: Prevent dangling object for profile dialog
When running the profiles dialog from the main status bar,
some objects appear to be not cleaned up properly with Qt 6.
This will circumvent this, by creating an object for the
dialog and cleaning it on closing.

Fixes #18525
2022-10-31 10:10:42 +00:00
Gerald Combs a42d245c2b [Automatic update for 2022-10-30]
Update manuf, services enterprise numbers, translations, and other items.
2022-10-31 10:05:45 +00:00
Roland Knall ea41d58d47 Qt: TrafficTree - Add headers to CSV/YAML export
Exporting did not include the header information if exported via
CSV or YAML in the new dialogs. Adding those back
2022-10-30 17:13:44 +00:00
Roland Knall b4a738e069 Qt: Fix unexpected bytes suffix
Packets obviously have not a "bytes" suffix, therefore
it should be removed.

Fixes #18229
2022-10-30 16:37:11 +00:00
Roland Knall ea60fdcb31 TrafficTree: Fix wrong element choosen in context menu
The context menu falsely assigns the proxied index to the context menu
entries, therefore always selecting the wrong model index for the
resulting functions.

Fixes #18xxx
2022-10-30 10:07:13 +00:00
Gerald Combs 0ae3315f53 Qt: Make sure our font setting is backward compatible.
Qt5's QFont::fromString() isn't compatible with Qt6's QFont::toString().
If we were built with Qt5, don't try to process a font preference that
was created by Qt6.

Fixes #18553
2022-10-27 10:46:06 -07:00
Guy Harris 083b07d88d Fix profile import/export menu items.
1) In English-language menus, menu item text should use title case, with
most words capitalized.  (I leave it to the Transifexors to capitalize
appropriately for other languages.)

2) Menu items that pop up dialogs should have "..." at the end of the
text.
2022-10-28 01:13:43 -07:00
Gerald Combs d560dd3948 Qt: Fix our default font size on Windows.
It looks like we need to adjust our monospace font size differently in
Qt6 on Windows.
2022-10-27 10:29:47 -07:00
Chuck Craft c6e228bb17 Qt: Resolved Addresses - display filename if present 2022-10-24 00:07:09 +00:00
Gerald Combs 30905d9c50 [Automatic update for 2022-10-23]
Update manuf, services enterprise numbers, translations, and other items.
2022-10-23 16:46:15 +00:00
Guy Harris 1070328597 packet bytes: do a simpler test for "is this ASCII?"
Just test whether the octet has the 0x80 bit set.
2022-10-21 00:42:42 -07:00
Guy Harris de50666ec0 packet bytes: don't assume the unadorned "char" type is signed.
The C language does not guarantee that "char" is signed or unsigned; it
just states that it's "implementation-dependent".

At least some C compilers for some architectures make it unsigned, so
you need "signed char" to get a signed value.  In particular, it's
unsigned for most ARM compilers (compilers for Darwin-based OSes such as
macOS make it signed on all platforms, including ARM), which causes a
warning about "ba[i] < '\0'" always being false.

The purpose of that test is to check for octets that correspond neither
to ASCII printable characters nor ASCII control characters; just test
with !g_ascii_isprint(ba[i]) && !g_ascii_iscntrl(ba[i]).  (Those are
macros, so it's not as if that adds any subroutine call overhead.)

Add some comments to explain what's being done in
ShowPacketBytesDialog::symbolizeBuffer() while we're at it.  (Not one of
the better uses of C++ polymorphism, giving "replace the octet at this
location with this sequence of octets" and "replace all octets equal to
this value with this sequence of octets" the same name, even though what
they do differs significantly.  I would have called one replace_at and
the other replace_all or something such as that, but the Qt developers
didn't ask me....)
2022-10-21 06:09:55 +00:00
Gerald Combs b2b76c2bae Qt: Add geolocation columns back to the Endpoints dialog.
Add geolocation columns back to the Endpoints dialog. Fix our
geolocation column alignments as well.

Fixes #18320.
2022-10-19 17:03:49 +00:00
Gerald Combs 0d59da3156 Qt: Fix the ByteViewText line height.
QFontMetrics::leading() was zero for Consolas on Windows in Qt5, but is
nonzero in Qt6. This revealed that we were inconsistently using height()
and leading() to calculate our line height. Just use lineSpacing()
instead.

Fixes #18438.
2022-10-19 01:06:37 +00:00
Gerald Combs 44a17f395f [Automatic update for 2022-10-16]
Update manuf, services enterprise numbers, translations, and other items.
2022-10-16 21:08:54 +00:00
Patricia Lindner ceed050c47 LTP: Enhance with generated items, sequence analysis, and statistics
This change adds computed values for reports, sequence analysis between
segments, conversation and endpoint taps, and a new statistics menu
and dialog.
2022-10-13 09:30:55 +00:00
John Thacker 87441e45d8 Qt: minizip and minizip-ng size compatibility issues
MS-DOS Date and MS-DOS Time are packed 16-bit values
(https://learn.microsoft.com/en-us/windows/win32/sysinfo/ms-dos-date-and-time)
and when combined they make a 32-bit value.

In the original minizip that comes with zlib, the combined dosDate
parameter is a uLong, which is 64 bits on LP64 platforms. In minizip-ng,
it is a uint32_t.

At one point, minizip-ng renamed the dosDate struct member of
zip_fileinfo to dos_date, but more recent versions changed it back
to dosDate for compatibility, except the size remains different,
so our compatibility check can't distinguish the size.

clang (and possibly other compilers) complain about shortening a 64 bit
unsigned long to a uint32_t so make the return value from our
qDateToDosDate a uint32_t as it should be to avoid warnings on
distributions with minizip-ng

Also the maximum year value that can be stored in the format is
127, since it occupies bits 9-15 of the MS-DOS Date. (There was
probably some confusion since the maximum year is 2107, but its
offset from 1980, not 1900.)
2022-10-12 22:03:34 -04:00
Gerald Combs f3f1556d45 Qt: Properly truncate our FieldInformation strings.
As the Qt6 QString::QString(const QByteArray &ba) documenation says:

"Note: any null ('\0') bytes in the byte array will be included in this
string, converted to Unicode null characters (U+0000). This behavior is
different from Qt 5.x."

Make sure FieldInformation::toString() truncates its display label byte
array before converting it to a QString.

Fixes #18428
2022-10-11 16:59:32 +00:00
João Valverde a19834b98c Windows: Store "gui.console_open" in the Windows registry
This removes the last dependency of the logging subsystem on the
preferences module. The latter is started much later than the former
and this is an issue.

The Windows-only preference "gui.console_open" is stored in the
registry as HKEY_LOCAL_USER\Software\Wireshark\ConsoleOpen. The semantics
are exactly the same. The preference is read by the logging subsystem
for initialization and then again by the preferences (read/write) so
the user can configure it as before.

The code to store the preference also in the preferences file was
kept, for backward compatibility and because it is not incompatible
with using the Registry concurrently.

The elimination of the prefs dependency also allows moving the Windows
console logic to wsutil and add the functionality to wslog directly,
thereby eliminating the superfluous Wireshark/Logray custom log handler.

To be able to read the ws_log_console_open global variable from
libwireshark it becomes necessary to add a new export macro
symbol called WSUTIL_EXPORT.
2022-10-11 14:25:04 +01:00
João Valverde 44d1cc6d4a GUI: Move log message to the correct place
Move the log message after parse_args().
2022-10-11 14:23:19 +01:00
João Valverde 1b12dc4b9e Add WS_DEPRECATED_X() function attribute
This adds a new attribute that allows declaring Wireshark
functions as deprecated.

Also disabe -Werror with deprecated declarations  Deprecated
declarations can be introduced suddenly with a new version
of an external dependency or a new internal deprecation and
that has its own timeline to fix. We should still be able to
build with -Werror in that case.
2022-10-10 20:27:33 +00:00
Alexis La Goutte 5a86ac3149 follow_stream_dialoag(qt): Fix Clang Analyzer Warning
Fix 3rd function call argument is an uninitialized value

stream_count is not longer initialized for QUIC (after g2762c64010 remove like other)
2022-10-10 11:57:29 +00:00
Gerald Combs 2a97e729dc [Automatic update for 2022-10-09]
Update manuf, services enterprise numbers, translations, and other items.
2022-10-10 08:13:49 +00:00
Gerald Combs a820b439b4 Qt+extcap: editselect value fixups.
Fix our value handling.
2022-10-09 00:44:27 +00:00
Gerald Combs 80656552c7 Update our capture control icons.
Add a standard "record" button icon for Logray. Add a corresponding
"restart" icon. Touch up the "stop" and "restart fin" icons.
2022-10-08 16:37:29 -07:00
João Valverde 3949d289d1 Add log init message to main() 2022-10-08 15:33:47 +00:00
Eugène Adell 9a6d496e64 Conversations dialog : rename the B to A packets column 2022-10-08 13:36:14 +00:00
João Valverde 9ab1f35641 Move print_hex_data_buffer() to wsutil
Move this generic function to wsutil so it can be used
by other libraries.
2022-10-08 12:39:04 +01:00
j.novak@netsystem.cz 2c56c0bad6 RTP Player: Fix: Only silence played on Windows with Qt 6.x 2022-10-08 09:30:52 +00:00
Gerald Combs 2b4fcae31f Qt+extcap: Add editable extcap selectors.
Add an "editselector" argument type, which lets the user override a
predefined selection list with a custom value.
2022-10-07 17:01:17 +00:00
Chuck Craft 3f83a3b364 Qt: Display filter edit - update status line only when on mainWindow.
There are many screens with a display filter edit box but they should
not wallop the status line on the main window. Display syntax errors
on the local window in "hints" area.
Only update Status Line message when editing a display filter in the
Filter toolbar or Find Packet toolbar.
2022-10-07 06:41:29 +00:00
João Valverde 09b27e5636 Qt: Disable -Werror for a deprecated declaration
Allow building with -Werror enable globally.
2022-10-04 17:35:55 +00:00
João Valverde 35c06ad742 CMake: Fix Qt -Werror compilation flag
All source files should have COMPILE_FLAGS applied, not just
ui/qt/*.cpp.

This fixes setting -Werror on the Qt build, since that is
the only custom C++ compilation flag we are using at the moment.
2022-10-04 17:08:31 +00:00
João Valverde ec54b1c611 Qt: Fix deprecation of QByteArray::count()
Use size() instead, which is exactly the same as count(), and
is not deprecated. Seems to exist in all out supported Qt
versions, as far as I can tell.

warning: ‘qsizetype QByteArray::count() const’ is deprecated: Use size() or length() instead. [-Wdeprecated-declarations]
  257 |     while ((int) (row_y + line_height_) < widget_height && offset < (int) data_.count()) {
      |                                                                           ~~~~~~~~~~~^~
2022-10-04 17:08:31 +00:00
João Valverde 9acfcd1f9b Qt: Fix setTextAlignment() deprecation
Cast away bogus deprecation created by deprecating
setTextAlignment(int, int) without fixing textAlignment()
to not return int.

```
error: ‘void QTreeWidgetItem::setTextAlignment(int, int)’ is deprecated: Use the overload taking Qt::Alignment [-Werror=deprecated-declarations]
  597 |             wn_ti->setTextAlignment(col, ws_dlg->statsTreeWidget()->headerItem()->textAlignment(col));
      |             ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/qt6/QtWidgets/qtreewidget.h:105:17: note: declared here
  105 |     inline void setTextAlignment(int column, int alignment)
      |                 ^~~~~~~~~~~~~~~~
```
2022-10-04 17:08:31 +00:00
João Valverde f0a633622d Qt: Remove workaround for Qt bug fixed in Qt 5.5.1 2022-10-04 17:06:54 +00:00
Ming Chen 01a3a19e15 Add copy as a Base64 string 2022-10-04 12:36:25 +00:00
Gerald Combs 45c6c79624 [Automatic update for 2022-10-02]
Update manuf, services enterprise numbers, translations, and other items.

services failed.
2022-10-02 16:43:23 +00:00
João Valverde afa2579124 Qt: Fix compilation with Qt 6.4
error: conversion function from 'gchar *' (aka 'char *') to 'QVariant' invokes a deleted function
            return entry->hostname;
                   ^~~~~~~~~~~~~~~
/usr/include/qt6/QtCore/qvariant.h:199:5: note: 'QVariant<char *, false>' has been explicitly marked deleted here
    QVariant(T) = delete;
    ^
2022-10-01 21:53:11 +01:00
Chuck Craft c4c38defa5 Qt: enabled/disabled protocols filtered list enable/disabled
Follow up to !8151
Calls to setData are wrapped with beginResetModel/endResetModel
so don't call emit dataChanged() (per Qt suggestion)

Fixes "As the loop is worked, the size of the parents shrinks
 with each item processed."
2022-09-30 22:46:16 -05:00
Gerald Combs 91bb68c86a Qt: Set a minimum width for our stream spinboxes.
Set a minimum width for the stream and substream number spinboxes in the
"Follow" and "TCP Stream Graphs" dialogs. This provides a larger click
target and should make editing easier.
Fixes #18265.
2022-09-29 16:42:56 +00:00
Jaap Keuter d8983b54ba Qt: plug resource leak in error path (CID-1504598) 2022-09-29 11:35:39 +00:00
Chuck Craft 5dfbc40b4b Qt: Analyze->Enabled Protocols search in enabled/disabled
Rearrange some of the code from ddb943bf so that searches in
`Only enabled protocols` or `Only disabled protocols` return
filtered results.
2022-09-29 11:14:17 +00:00
Jaap Keuter b092fa05da Replace the last of PROTO_ITEM_ macro calls with function calls 2022-09-29 05:59:12 +00:00
João Valverde 9345bcdae5 epan: Change signature of format_text()
Replace "const guchar *" with "const char *".
2022-09-28 19:28:28 +01:00
Gerald Combs 7d3a50a02e Qt: Fix our packet comment connections.
Use new-style connections for our packet comment actions. Fix our slots
to match 24a09965e6.
2022-09-28 10:19:31 -07:00
Gerald Combs f011e75025 Qt: Use new-style syntax for signal & slots connected by name.
Change anything that matches

    grep -Eir '(signal|slot) *\( *on_action' ui

to new-style connections so that we can catch any future direct
connection conversion issues at compile time.

Change a connection from on_actionCaptureOptions_triggered to
showCaptureOptionsDialog and make showCaptureOptionsDialog public. Fixes
an issue introduced in fcdb77dc.
2022-09-27 21:43:05 +00:00
João Valverde 6d06d4e46b Add some UTF-8 debug checks with a compile time flag
Some older dissectors that predate Unicode and parse text protocols
are prone to generate invalid UTF-8 strings. This is a bug and can have
safety implications.

For example passing invalid UTF-8 to proto_tree_add_string() is a
common bug. There are safeguards in format_text() but this should
not be relied on as a general solution to the problem.

For one, as the name implies, it is only used with representation of a
field value, which is not the same as the value itself of an FT_STRING field.
Issue #18317 shows another reason why.

For now this compile flag only enables extra checks for string ftypes,
which covers a subset of proto.h APIs including
proto_tree_append_string(). Later is should be extended to other
interfaces.

This is also not expected to be disabled for release builds because
there are still many dissectors that do not correctly handle strings.
More work is needed to 1) identify them and 2) fix them.

Ping #18317
2022-09-27 17:04:44 +00:00
j.novak@netsystem.cz bb4de1a046 RTP dialogs: Fix: Coloring of QTreeWidgetItem do not work 2022-09-27 09:48:40 +00:00
Gerald Combs fcdb77dce9 Qt: Manually connect our "Capture" menu actions. 2022-09-25 14:25:21 -07:00
Gerald Combs fc461d1592 Qt: Manually connect our "Go" menu actions. 2022-09-25 13:37:37 -07:00
Gerald Combs a135d741a7 Qt: Manually connect our "View" menu actions. 2022-09-25 19:50:34 +00:00
Gerald Combs 5d4e102b4c [Automatic update for 2022-09-25]
Update manuf, services enterprise numbers, translations, and other items.
2022-09-25 16:43:29 +00:00
Gerald Combs 24a09965e6 Qt: More menu action cleanup.
We use the convention "actionSomeThing" for action names. Rename some
member functions that used that convention.

Manually connect another action.
2022-09-24 16:03:00 -07:00
Gerald Combs de387814bb Qt: Manually connect our "File" menu actions. 2022-09-23 19:41:32 +00:00
Gerald Combs 720090fb86 Qt: Manually connect more "Edit" menu actions.
Followup to ce44047584.
2022-09-23 19:38:07 +00:00
Chuck Craft 2a189d0a08 Qt: if regex not valid don't attempt search
Search is tried as user enter regex string. Regex will be
 invalid as they type it (starts with "\" or fat fingered "*")
 If Wireshark is run from command line, error line is generated
 for every attempted match in the search list.
 ** (wireshark:8344) 00:29:15.353028 [GUI WARNING] --
 QString::contains: invalid QRegularExpression object
2022-09-22 12:47:08 -05:00
Pau Espin 0c7e8ce9a5 ui: Fix Qt deprecation messages
Related: https://gitlab.com/wireshark/wireshark/-/issues/18358
2022-09-21 16:29:10 +02:00
Gerald Combs ce44047584 Qt: Manually connect our "Edit" menu actions.
Use manual, new-style connections for each of our "Edit" menu actions.
KDE's clazy project recommends them over auto-connnections:

https://github.com/KDE/clazy/blob/1.11/docs/checks/README-connect-by-name.md

Use queued connections for the mark, ignore, and other actions that might
run a nested event loop.
Fixes #18344.
2022-09-20 16:39:30 +00:00
Chuck Craft c199b747aa Revert "Qt: only half of enabled/disabled protocols list is processed"
This reverts commit 248955d614.

It speeds up the loop when type_ is EveryWhere (see: enum SearchType)
but a hang or crash for other combinations of type_ and protocolType_.
2022-09-20 11:07:13 -05:00
Gerald Combs 0e462b9aae Qt: Fix some QRC paths. 2022-09-18 23:31:09 +00:00
Gerald Combs b92b66c0f4 [Automatic update for 2022-09-18]
Update manuf, services enterprise numbers, translations, and other items.
2022-09-18 16:45:13 +00:00
Chuck Craft 248955d614 Qt: only half of enabled/disabled protocols list is processed
In Only enabled/disabled protocols lists, the rowCount decreases
as item state is changed in the parent. An equlibrium point is
reached at halfway when rows processed == remaining size of list.
Grab a static rowcount before entering the loop.
2022-09-18 14:58:47 +00:00
Chuck Craft 246e753d69 Qt6: add toInt() to QVariant == Qt::Checked
A change in Qt6 "==" comparison for QVariant for not defined types.

Closes #18336
2022-09-14 20:49:54 +00:00
John Thacker cbb2213021 Qt: Fix memory leak in Decode As
The correct place to delete the dissector_info_t pointers added
to the editor is when destroyEditor is called. Override the
virtual function and delete the pointers for the colProtocol
index before calling the inherited function.

Fix #17127
2022-09-14 12:43:55 +00:00
John Thacker 2762c64010 follow: Have followers register their stream count function
Instead of having the UI have to know about each type of follow
stream, and how to retrieve its total number of streams, have
each follow type register a function that returns the total
number of stream. (The function can be NULL, for protocols like
SIP that do not use this.)

This gets us closer to making follow stream registration generic.
2022-09-14 00:03:07 +00:00
Guy Harris c9342873e5 Clarify dissector description, protocol short name, and protocol ong name.
Rename dissector_handle_get_long_name() and
dissector_handle_get_short_name() to
dissector_handle_get_protocol_long_name() and
dissector_handle_get_protocol_short_name(), to clarify that they fetch
names for the protocol that the dissector dissects, not for the
dissector *itself*.  Leave a deprecated
dissector_handle_get_short_name() wrapper, and export
dissector_handle_get_protocol_long_name(), as it's now used in some
dissectors.

Change some calls to dissector_handle_get_description() back to
dissector_handle_get_protocol_short_name(), as they appear to be made in
order to display a *protocol* name.

Rename some methods, variables, enums, and table column names to reflect
cases where the dissector description is being used.
2022-09-13 00:47:24 -07:00
Chuck Craft 87a7260bb0 Qt6: migrate obsolete currentIndexChanged(QString)
Similar to work done in !8070 and !8072 to move off a function
that was deprecated in Qt5 and obsoleted in Qt6. Also migrate to
syntax laid out in !4560 and !4565.
2022-09-12 22:10:11 +00:00
Guy Harris d4394de669 Give dissectors a descriptive string.
It defaults to the short name of the protocol dissected by the
descriptor, but it's now possible to register a dissector with an
explicit description.

This is mainly for use in the Decode As UI.  It handles the case where
the same protocol might have different "Decode As..."-specifiable
dissectors for different situations.
2022-09-12 21:05:14 +00:00
Gerald Combs 55de00662d Qt: Clean a couple of context menus.
Set the Qt::WA_DeleteOnClose property on our packet list header and
about dialog context menus.
2022-09-12 20:16:23 +00:00
Gerald Combs 834bf08290 Qt: Fix 29West dialog deletion.
Set the Qt::WA_DeleteOnClose attribute (which calls deleteLater())
instead of deleting dialogs under themselves.
Fixes #18334.
2022-09-11 12:44:46 -07:00
Gerald Combs f0fac9e793 [Automatic update for 2022-09-11]
Update manuf, services enterprise numbers, translations, and other items.
2022-09-11 19:29:51 +00:00
Guy Harris e5951765d8 Dissector names are not protocol names.
A given protocol's packet format may depend, for example, on which
lower-level protocol is transporting the protocol in question.  For
example, protocols that run atop both byte-stream protocols such as TCP
and TLS, and packet-oriented protocols such as UDP or DTLS, might begin
the packet with a length when running atop a byte-stream protocol, to
indicate where this packet ends and the next packet begins in the byte
stream, but not do so when running atop a packet-oriented protocol.

Dissectors can handle this in various ways:

For example, the dissector could attempt to determine the protocol over
which the packet was transported.

Unfortunately, many of those mechanisms do so by fetching data from the
packet_info structure, and many items in that structure act as global
variables, so that, for example, if there are two two PDUs for protocol
A inside a TCP segment, and the first protocol for PDU A contains a PDU
for protocol B, and protocol B's dissector, or a dissector it calls,
modifies the information in the packet_info structure so that it no
longer indicates that the parent protocol is TCP, the second PDU for
protocol A might not be correctly dissected.

Another such mechanism is to query the previous element in the layers
structure of the packet_info structure, which is a list of protocol IDs.

Unfortunately, that is not a list of earlier protocols in the protocol
stack, it's a list of earlier protocols in the dissection, which means
that, in the above example, when the second PDU for protocol A is
dissected, the list is {...,TCP,A,B,...,A}, which means that the
previous element in the list is not TCP, so, again, the second PDU for
protocol A will not be correctly dissected.

An alternative is to have multiple dissectors for the same protocol,
with the part of the protocol that's independent of the protocol
transporting the PDU being dissected by common code.  Protocol B might
have an "over a byte-stream transport" dissector and an "over a packet
transport" dissector, with the first dissector being registered for use
over TCP and TLS and the other dissector being registered for use over
packet protocols.  This mechanism, unlike the other mechanisms, is not
dependent on information in the packet_info structure that might be
affected by dissectors other than the one for the protocol that
transports protocol B.

Furthermore, in a LINKTYPE_WIRESHARK_UPPER_PDU pcap or pcapng packet for
protocol B, there might not be any information to indicate the protocol
that transports protocol B, so there would have to be separate
dissectors for protocol B, with separate names, so that a tag giving the
protocol name would differ for B-over-byte-stream and B-over-packets.

So:

We rename EXP_PDU_TAG_PROTO_NAME and EXP_PDU_TAG_HEUR_PROTO_NAME to
EXP_PDU_TAG_DISSECTOR_NAME and EXP_PDU_TAG_HEUR_DISSECTOR_NAME, to
emphasize that they are *not* protocol names, they are dissector names
(which has always been the case - if there's a protocol with that name,
but no dissector with that name, Wireshark will not be able to handle
the packet, as it will try to look up a dissector given that name and
fail).

We fix that exported PDU dissector to refer to those tags as dissector
names, not protocol names.

We update documentation to refer to them as DISSECTOR_NAME tags, not
PROTO_NAME tags.  (If there is any documentation for this outside the
Wireshark source, it should be updated as well.)

We add comments for calls to dissector_handle_get_dissector_name() where
the dissector name is shown to the user, to indicate that it might be
that the protocol name should be used.

We update the TLS and DTLS dissectors to show the encapsulated protocol
as the string returned by dissector_handle_get_long_name(); as the
default is "Application Data", it appeaers that a descriptive name,
rather than a short API name, should be used.  (We continue to use the
dissector name in debugging messages, to indicate which dissector was
called.)
2022-09-10 22:37:11 -07:00
Gerald Combs 8f34e3df98 Add Logray capture icons. 2022-09-10 23:35:27 +00:00
Gerald Combs 1a9842b423 Qt: Fix a variable name.
Don't use a trailing underscore for a local variable name.
2022-09-10 15:39:35 -07:00
Tomasz Moń 1a148b1133 Qt: Fix crash on copy as actions in protocols pane
Allocate FieldInformation on heap instead of stack so it is available
when copy action is triggered.

Fixes #18282
2022-09-10 22:35:55 +00:00
Tomasz Moń 6346cf945a Qt: Connect menu actions with Qt::QueuedConnection
Prevent crash due to premature menu object deletion caused by call to
QCoreApplication::processEvents() by executing the slot only after menu
handling has finished.

Fixes #18251 and #18270
2022-09-10 22:34:48 +00:00
John Thacker 2c37027762 Qt: Fix resolved addresses dialog sorting, filtering, Ethernet groups
Qt6 removed QComboBox:currentIndexChanged(QString), which had
previously been deprecated in favor of the version with an int.
Switch to using the supported function, so that the comboboxes
work.

The models used for the resolved addresses require that the
source models be set first before setting other properties,
so do that so that filtering works.

For some reason the portTypeModel has to indicate that the
port number column is numeric in order for the ports to
numerically sort instead of lexicographically, so do that too.

Add the Ethernet addresses in their specific groups (Addresses,
Manufacturers, Well-Known Hosts) instead of adding them all
to the Well-Known hosts groups, so that that filtering works.

Fix #18087
2022-09-09 01:03:36 +00:00
Gerald Combs 74ec0f0816 Qt+extcap: Make our capture error dialog less noisy.
Strip the timestamps and function names from extcap errors before
displaying them in a dialog. This keeps us from spewing

```
Error by extcap pipe: ** (falcodump:24913) 15:08:20.263535 [falcodump
WARNING] extcap/falcodump.cpp:593 -- main(): cloudtrail plugin error:
failed to list objects: ExpiredToken: The provided token has expired.
status code: 400, request id: M2PYJOT4JGVAA6B9, host id:
+4V8Q+DGV+80Jd3fdc7tODyVdTRvepNgCD9zuvXeL7kzvp2oikaoi9CLMW+UKt/
aR1G2UXIqyQ8=
```

at the user.

Check for warning messages and set our dialog type accordingly.
2022-09-08 10:20:48 -07:00
John Thacker 33fe76612a Qt: Don't use obsolete signal in DCE-RPC/ONC-RPC SRT
QComboBox::currentIndexChanged(QString) has been marked
obsolete for a while and finally removed in Qt 6 in favor
of currentIndexChanged(int) and currentTextChanged(const QString)

Use QComboBox::currentTextChanged(const QString) instead.
Also do a little bit of checking to see if the return value
of dcerpc_get_proto_sub_dissector is NULL.

Fix #18319.
2022-09-08 03:55:43 +00:00
Uli Heilmeier b81948f534 Qt: Fix implicit conversion
Fix

ui/qt/widgets/syntax_line_edit.cpp:160:51: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
            .arg(QString('~').repeated(loc_length - 1));
                              ~~~~~~~~ ~~~~~~~~~~~^~~
ui/qt/widgets/syntax_line_edit.cpp:159:40: warning: implicit conversion loses integer precision: 'qsizetype' (aka 'long long') to 'int' [-Wshorten-64-to-32]
            .arg(QString(' ').repeated(loc_start))
                              ~~~~~~~~ ^~~~~~~~~

when building with Qt 5.
2022-09-07 15:17:00 +00:00
John Thacker 2dfbed7a5f Qt: Connect ExportDissectionDialog to filesSelected
QFileDialog.accept() emits the filesSelected signal when the
dialog is accepted but before it calls QDialog.accept().
Connect our dialogAccepted function the filesSelected signal
instead of the accepted signal, so that all the exporting
happens sooner, before the ExportDissectionDialog gets
closed (and then deleted, since DeleteOnClose is set on the
dialog.)

This fixes use-after-free and segfaults in Qt 6.3 (which changed
things so that QDialog and widgets that inherit from it get closed
earlier.) Fix #18318
2022-09-07 00:54:42 +00:00
Jim Young 1e030a8f59 Qt: Avoid clipping the text label field in progressFrame 2022-09-06 17:05:38 +00:00
Gerald Combs ab4a4304ee Add Logray icons.
Add lricon.svg and lriconinst.svg, which provide the core graphic
element for the various Logray icons. Add lricon*.png, which were
created using the templates at
https://developer.apple.com/design/resources/. Add Logray.icns,
logray.ico, and lograyinst.ico, and use them in various packaging
resources.
2022-09-04 23:01:06 +00:00
Gerald Combs 56a101f4d4 [Automatic update for 2022-09-04]
Update manuf, services enterprise numbers, translations, and other items.
2022-09-04 16:43:03 +00:00
John Thacker 95b45b2555 Qt: Add percent-encoding to Show Packet Bytes
Add Percent-encoding to the list of encoding types that Show
Packet Bytes can handle.

There's a function added to glib 2.66 to handle this for arbitrary
bytes that might have internal nulls (and which allows the result
to be non UTF-8), but we don't require that version yet, so extend
the existing function.

Related to #1084
2022-09-03 17:25:28 +00:00
Gerald Combs fce0b28a39 [Automatic update for 2022-08-28]
Update manuf, services enterprise numbers, translations, and other items.
2022-08-28 16:44:11 +00:00
João Valverde fc952ac2f1 Qt: Increase file dialog size with a scale factor
By default Qt file dialogs are too small and cramped.

Fixes #18230.
2022-08-26 09:33:58 +00:00
Guy Harris 8195bdd340 Rename a bunch of things with "conversation".
A conversation in Wireshark might have two endpoints or might have no
endpoints; few if any have one endpoint.  Distinguish between
conversations and endpoints.
2022-08-25 20:02:20 -07:00
João Valverde f2073b6d74 Qt: Fix build with Logray and Qt6
Copied from 349787051e.
2022-08-25 21:55:46 +01:00
Angelo Spampinato 52e34b2531 Adding some SharkFest info to the welcome screen 2022-08-25 16:43:56 +00:00
John Thacker 66e19f9622 Qt: Silence warning
In the case that this is being called with an address type that
is neither IPv4 or IPv6, make sure that the char array used
to construct the QString is null terminated so that there's no
warning about using addr uninitialized or a possible strlen running
off the end.
2022-08-24 00:36:12 +00:00
John Thacker 7bf4144494 Qt: Enable compilation on gcc 12.1 and Qt6
gcc 12.1 thinks that there's a signed/unsigned qsize issue with
the Qt6 sources. Enable compilation until this gets fixed upstream.

/usr/include/qt6/QtCore/qarraydataops.h:98:17: error: ‘void* memcpy(void*, const void*, size_t)’ specified size between 9223372036854775808 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]
   98 |         ::memcpy(static_cast<void *>(this->end()), static_cast<const void *>(b), (e - b) * sizeof(T));
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-08-23 12:38:20 +00:00
Guy Harris d9e662bc54 Rename some functions and types for endpoint tables.
The "conversation table" mechanism supports two types of tables, one for
the "Conversations" menu item under "Statistics" and one for the
"Endpoints" menu item under "Statistics".  The first of them shows
statistics for conversations at various layers of the networking stack;
the second of them shows statistics for endpoints at various layers of
the networking stack.

The latter is *not* a table of hosts; an endpoint might be a host,
identified by an address at some network level (MAC, IP, etc.), or it
might be a port on a host, identified by an address/port pair.

Some data types, function names, etc. use "host" or "hostlist" or other
terms that imply that an endpoint is a host; change them to speak of
endpoints rather than hosts, using names similar to the corresponding
functions for conversations.

Provide wrapper functions and typedefs for backwards source and binary
compatibility; mark them as deprecated in favor of the new names.

Clean up some comment errors found in the process.
2022-08-23 09:55:14 +00:00
João Valverde 6b35aa0773 Qt: Add dfilter error location to tooltip
If display filter compilation fails and the expression has a syntax
error and associated location, it will be displayed in the filter
tooltip, using a textual underline.

As far as I can tell using a graphical squiggly underline seems extremely
difficult for an object inheriting from QLineEdit, so the tooltip
textual method was used instead.
2022-08-22 07:31:08 +00:00
John Thacker 00bfdf46a7 Qt: Fix export objects memory leak
The export object entries were never getting freed, creating a
pretty serious memory leak.

=1307558==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 2237664 byte(s) in 46618 object(s) allocated from:
    #0 0x55ac70d80457 in malloc (/home/johnthacker/wireshark-clang/run/wireshark+0x1a4a457) (BuildId: ad576854e9259fb05a7d0aacbff6e3e1f8e41157)
    #1 0x7fe8ff2f4278 in g_malloc (/lib64/libglib-2.0.so.0+0x5a278) (BuildId: 8a4c270219135729dff508e4bb3cc03099af40e8)
    #2 0x7fe910912ff4 in tap_push_tapped_queue /home/johnthacker/wireshark/epan/tap.c:366:15
    #3 0x7fe910711548 in epan_dissect_run_with_taps /home/johnthacker/wireshark/epan/epan.c:640:2
    #4 0x55ac7263288d in retap_packet /home/johnthacker/wireshark/file.c:2241:5
    #5 0x55ac7263201c in process_specified_records /home/johnthacker/wireshark/file.c:2207:14
    #6 0x55ac726315fc in cf_retap_packets /home/johnthacker/wireshark/file.c:2292:11
    #7 0x55ac712aed41 in ExportObjectDialog::show() /home/johnthacker/wireshark/ui/qt/export_object_dialog.cpp:173:15
...
Indirect leak of 1700955 byte(s) in 139854 object(s) allocated from:
    #0 0x55ac70d80457 in malloc (/home/johnthacker/wireshark-clang/run/wireshark+0x1a4a457) (BuildId: ad576854e9259fb05a7d0aacbff6e3e1f8e41157)
    #1 0x7fe8ff2f4278 in g_malloc (/lib64/libglib-2.0.so.0+0x5a278) (BuildId: 8a4c270219135729dff508e4bb3cc03099af40e8)
...
SUMMARY: AddressSanitizer: 3961187 byte(s) leaked in 186587 allocation(s).
2022-08-22 03:45:20 +00:00
Gerald Combs 70dbe58aea [Automatic update for 2022-08-21]
Update manuf, services enterprise numbers, translations, and other items.
2022-08-21 16:39:53 +00:00
Martin Mathieson eb197df564 RLC Graph: store secs in time_t 2022-08-20 19:56:34 +00:00
Gerald Combs a24f1cbd8d [Automatic update for 2022-08-14]
Update manuf, services enterprise numbers, translations, and other items.
2022-08-14 16:53:51 +00:00
John Thacker c7a136a5c0 epan: Rearrange column includes
Move all the declarations of routines that are internal and
not for use by dissectors from column-utils.h column-info.h
Move the column max length defines into column-utils.h because
dissectors might need that

Since packet.h already includes column-utils.h, dissectors don't
need to include column-utils.h anymore.
Remove or downgrade a few other column header includes that are
unnecessary.
2022-08-13 19:37:28 +00:00
Tomasz Moń d0a9de2af1
capture: Stop extcaps before dumpcap
Send SIGTERM on UNIX systems to all extcap processes when user requests
capture stop. Wait up to 30 seconds for extcaps to finish. If extcaps do
not finish in time, send SIGKILL to remaining extcaps.

Do not call TerminateProcess() on Windows in the same place where UNIX
SIGTERM is sent. Instead schedule extcap termination timeout to happen
as soon as control returns back to the event loop.

There is no universally agreed replacement for SIGTERM on Windows, so
just keep things simple (forcefully terminate like always) until we
have agreed on something.
2022-08-13 20:23:51 +02:00
John Thacker b5cea67768 Qt: Expert Info: Return TAP_PACKET_REDRAW if any ei is added
Any time an expert info is added to the Expert Info tap, the
Expert Info GUI tap listener needs to set TAP_PACKET_REDRAW.

draw_tap_listeners(FALSE) is called from MainApplication::updateTaps()
on a timer (controlled by a preference, defaulting to 3 seconds),
and that clears the Expert Info tap's need_redraw flag. The larger
a capture and the more expert infos, the more likely that the timer
can trigger while epan_dissect_run_with_taps() is still generating
more EI entries, but has already generated EIs of all severities
that are present in the capture. This prevents the expertInfoTreeView
from being redrawn at the end when the captureEvent is finished
retapping the packets.

Fix #18232. Fix #16591.
2022-08-13 10:55:32 +00:00
Chuck Craft a6813db329 Qt: traffic tables - tcp/udp port name resolution
Allow conversation/endpoint tabs that include IP address and
port number to resolve either or both. Currently IP address
(network) resolution is required to resolve tcp/udp ports.
2022-08-08 09:10:10 +00:00