Commit Graph

6699 Commits

Author SHA1 Message Date
Andre Luyer 3afd332455 tshark/wireshark: Fix check ring buffer option for packets
tshark and wireshark did not allow only -b packets:value option, while dumpcap does.
This change adds the same check in tshark and wireshark as in dumpcap.

Quick fix for issue mentioned at https://ask.wireshark.org/question/23437/why-does-tshark-b-packetsvalue-not-work/


(cherry picked from commit 9f8e6b1acb)
2021-07-04 20:49:52 +00:00
Gerald Combs bf35c11265 [Automatic update for 2021-07-04]
Update manuf, services enterprise numbers, translations, and other items.
2021-07-04 16:12:00 +00:00
Guy Harris bb4c32b75e wireless timeline: add a destructor to free the hash table.
Destroy the hash table if we're destroying the timeline widget, so that
it doesn't leak.


(cherry picked from commit ad3e6b1be6)
2021-06-28 21:41:31 +00:00
Guy Harris 5318290a05 wireless_timeline: make sure the hash table is always allocated.
At least on my Mac, if I start up Wireshark, start a capture
(non-monitor-mode) on the Wi-Fi adapter, add a comment to the SHB and
the first packet while it's capturing, stop the capture, and try to save
it, it warns that the wireless timeline hash table pointer is null.

Allocate it in the constructor.


(cherry picked from commit 693a02e760)
2021-06-28 10:01:40 +00:00
Uli Heilmeier ad6a337dde QT: Fix printer dialog
Fix EXC_BAD_ACCESS error by using printer variable.


(cherry picked from commit ea20002a07)
2021-06-09 05:34:56 +00:00
Gerald Combs 13546c7a18 CMake: Update autogen properties.
Set the AUTOMOC, AUTOUIC, and AUTORCC properties for the qtui and
wireshark targets to match what we currently do in master. This should
keep us from running moc and uic on unwanted targets.
2021-05-25 21:58:05 +00:00
Pascal Quantin 113062025d Qt: fix some Qt 5.15.2 deprecation warnings
(cherry picked from commit fb2414ae6d)
2021-05-25 20:28:48 +00:00
Guy Harris 82b0eac6af PortsModel: don't populate it by doing a lot of weird string-pushing.
When enumerating port-to-name entries, the callback to
wmem_map_foreach() gets passed:

- a key, which is the port number for the entry;
- a value, which is a pointer to a structure containing pointers to port
names for various transport protocols;
- a user data pointer.

That's sufficient (if you work around some C++ annoyances) to append a
row to a PortsModel, if the user data pointer is a pointer to the
PortsModel.

The existing code, instead, appended to a QStringList of lines (in
effect, undoing the effort of the code that read the services file and
filled in the wmem_map, re-generating a set of lines) in the callback,
and then iterated over all the lines, splitting them with blanks and
appending rows.

Looking at that made my eyeballs bleed so badly that I decided not to
spend any time figuring out why it wasn't working.

So I just make the callback just append rows, avoiding all the
string-pushing.

Fixes #17395.


(cherry picked from commit 6e95a0aa47)
2021-05-18 09:41:00 +00:00
Gerald Combs b45185f1c0 [Automatic update for 2021-05-09]
Update manuf, services enterprise numbers, translations, and other items.
2021-05-09 09:53:41 +00:00
Guy Harris 347f60c37b tap_export_pdu: we don't have packet flags, don't claim that we do.
We don't set rec.rec_header.packet_header.pack_flags, so don't set
WTAP_HAS_PACK_FLAGS in the presence flags.  (Copy-and-pasteo?)


(cherry picked from commit faf2e62db8)
2021-04-29 21:55:16 +00:00
Gerald Combs 19d03ef4ac CMake: Enable AUTO{MOC,UIC,RCC} according to our CMake version.
As noted in be2b0fc810, we need to set CMAKE_AUTO* before searching for
Qt packages when using 3.20.0 and later. However, this fails if we're
using CMake 3.9.6 or earlier. Set CMAKE_AUTO* where needed depending on
our CMake version.

Ping #17314.

(cherry picked from commit a80ea46ff7)

Conflicts:
	ui/qt/CMakeLists.txt
2021-04-19 12:27:02 -07:00
naf eee907aeb5 QT ByteViewText: calculate string widths consistently to prevent clipping
For QT >5.11, stringWidth() uses horizontalAdvance, which gives different
(longer) widths than the old boundingRect().width() method.

Other locations use the boundRect().width() method directly, resulting
in underestimating line widths and clipping the last characters in
the byte view window.

Fix by forcing all width calculations to use stringWidth().
Closes #17087.

(cherry picked from commit 95f3d1b075)

Conflicts:
	ui/qt/widgets/byte_view_text.cpp
2021-04-19 20:08:17 +02:00
Michael Tuexen 489fc40a49 Fix conversation table when using epoch based time
Ensure that if using tshark -q -t e -z conv,tcp the reported
start time is relative to the epoch time and not relative to
the time of the first packet in the capture file.

Thanks to Theresa Enghardt for reporting the issue and to
Peter Lei for initialy looking into it.

(cherry picked from commit f099bd179a)
2021-04-15 14:27:02 +02:00
Gerald Combs 6ef6e8f607 CMake: Enable AUTO{MOC,UIC,RCC} earlier.
Enable CMAKE_AUTOMOC, CMAKE_AUTOUIC, and CMAKE_AUTORCC before searching
for Qt packages. This is apparently required for CMake 3.20.0 and later.
Fixes #17314.

(cherry picked from commit be2b0fc810)

 Conflicts:
	ui/qt/CMakeLists.txt
2021-03-26 14:50:21 -07:00
Guy Harris b5d65c0074 Move still *more* headers outside of extern "C".
If a header declares a function, or anything else requiring the extern
"C" decoration, have it wrap the declaration itself; don't rely on the
header itself being included inside extern "C".

(cherry picked from commit 2820156fbd)
2021-03-16 15:03:17 -07:00
Michal Ruprich d0e6ad310b Moving glib.h out of extern C
(cherry picked from commit c8246c9973)
2021-03-16 02:07:58 -07:00
Guy Harris 7e0360206e Clean up "Export PDUs to File" code.
Combine exp_pdu_file_open() is called only by do_export_pdu(); just
combine them into one routine.

Get rid of the exp_pdu_t * argument to do_export_pdu(); instead, have
the exp_pdu_t structure be a local variable in that routine.  There's no
need to initialize exp_pdu_data.pkt_encap in
ExportPDUDialog::on_buttonBox_accepted() - do_export_pdu() already does
so.

The return value of do_export_pdu() isn't used; don't return anything.

(backported from commit 01151ec332)
2021-03-14 07:21:53 -07:00
Guy Harris 3d9603e051 tap_export_pdu: free err_info for WTAP_ERR_INTERNAL.
WTAP_ERR_INTERNAL also returns an err_info script describing the
internal error, so it should be freed to avoid leaking it.


(cherry picked from commit d4c55ba464)
2021-03-14 09:37:35 +00:00
John Thacker 4482949ddc export_pdu: set pkt_encap to a WTAP_ENCAP value, not a pcap LINKTYPE_ value.
rec.rec_header.packet_header.pkt_encap expects WTAP encapsulation types,
not PCAP encapsulation types, so don't call
wtap_wtap_encap_to_pcap_encap().

Also, set the output file encapsulation, and the link-layer type of the
fake interface, to exp_pdu_tap_data->pkt_encap rather than wiring it to
WTAP_ENCAP_WIRESHARK_UPPER_PDU (we set exp_pdu_tap_data->pkt_encap to
WTAP_ENCAP_WIRESHARK_UPPER_PDU, but this is a bit cleaner).

(backported from commit ea60a57826)
2021-03-13 23:18:12 -08:00
Gerald Combs 8c997a57da [Automatic update for 2021-02-28]
Update manuf, services enterprise numbers, translations, and other items.
2021-02-28 10:31:23 +00:00
Gerald Combs 077a9c9354 [Automatic update for 2021-02-21]
Update manuf, services enterprise numbers, translations, and other items.
2021-02-21 10:31:58 +00:00
Gerald Combs b2c58d020c Be more strict about opening URLs.
In the proto tree, copy URLs instead of opening them.

In the export dialog, enable previews only if the advertised MIME type
*and* the contents of the file are plain text, GIF, JPEG, or PNG.

Add warnings to the wslua browser_open_url and browser_open_data_file
documentation.

Fixes #17232.


(cherry picked from commit e99c9afce8)
2021-02-15 16:50:02 +00:00
Gerald Combs 564a52be19 [Automatic update for 2021-01-31]
Update manuf, services enterprise numbers, translations, and other items.
2021-01-31 10:30:58 +00:00
Gerald Combs 2248cba00c [Automatic update for 2021-01-24]
Update manuf, services enterprise numbers, translations, and other items.
2021-01-24 10:30:17 +00:00
Guy Harris 22cc9f3f7f dup() can fail; check whether it does.
If, for example, you run out of file descriptors, dup() can fail, and
ws_dup() is a wrapper around it on UN*X.  Don't just pass the result of
ws_dup() to ws_fdopen(); instead, save its result, check against -1 and,
if it's -1, give up, otherwise pass it to ws_fdopen().

This addresses Coverity CID 1471708.

Also, if ws_fdopen() fails, close the descriptor we got from ws_dup();
this closes a possible FD leak.


(cherry picked from commit 165792fb31)
2021-01-19 07:50:33 +00:00
Gerald Combs f8d662d787 Qt+tools: Fix most of our lupdate warnings.
Fix various warnings with the following changes:

Pass a list of include directories to lupdate. Fixes:

    ui/qt/proto_tree.cpp:57: Qualifying with unknown namespace/class ::ProtoTree

and similar warnings.

Use QT_TRANSLATE_NOOP instead of QT_TR_NOOP. Fixes:

    ui/qt/lte_rlc_statistics_dialog.cpp:993: tr() cannot be called without context
    ui/qt/lte_mac_statistics_dialog.cpp:911: tr() cannot be called without context
    ui/qt/font_color_preferences_frame.cpp:28: tr() cannot be called without context
    ui/qt/font_color_preferences_frame.cpp:29: tr() cannot be called without context
    ui/qt/font_color_preferences_frame.cpp:30: Discarding unconsumed meta data

Add Q_OBJECT to the class definition. Fixes:

    ui/qt/models/filter_list_model.cpp:120: Class 'FilterListModel' lacks Q_OBJECT macro

The following warnings were not fixed. This might require moving IOGraph
to its own file:

    ui/qt/io_graph_dialog.cpp:320: Qualifying with unknown namespace/class ::IOGraphDialog
    ui/qt/io_graph_dialog.cpp:555: Qualifying with unknown namespace/class ::IOGraphDialog
    ui/qt/io_graph_dialog.cpp:1059: Qualifying with unknown namespace/class ::IOGraphDialog
    ui/qt/io_graph_dialog.cpp:1485: Qualifying with unknown namespace/class ::IOGraphDialog


(cherry picked from commit 85a7938925)
2021-01-18 16:57:04 +00:00
Gerald Combs 48f42d78b1 [Automatic update for 2021-01-17]
Update manuf, services enterprise numbers, translations, and other items.
2021-01-17 10:29:07 +00:00
John Thacker a666035948 Qt: Make the checkSaveAsWithComment dialog box appear.
Set the parent of the QMessageBox in the constructor instead of calling
QMessageBox::setParent(). The latter inherits from QDialog, and it
"clear[s] the window flags specifying the window-system properties for
the widget (in particular it will reset the Qt::Dialog flag)."
(See https://doc.qt.io/qt-5/qdialog.html#details )
This makes the dialog properly appear instead of attempting to save a file
with comments to a file type that does not support comments silently failing.
Fixes #17146.


(cherry picked from commit fb422bed91)
2021-01-12 11:29:27 +00:00
Stig Bjørlykke ee43965024 Qt: Fetch OverlayScrollBar sliderPosition from the real ScrollBar
In OverlayScrollBar return the real ScrollBar sliderPosition to ensure
the correct value is used when handling the actionTriggered signal in
vScrollBarActionTriggered().

This improves turning on and off auto scroll during capture when page
stepping using the packet list slider, because the value is propagated
after this signal.


(cherry picked from commit 7980f25f99)
2021-01-05 08:24:25 +00:00
Stig Bjørlykke 09d182d987 Qt: Connect QScrollbar::actionTriggered to OverlayScrollBar
This will fix the issue where auto scroll during capture is not turned
off when the scroll bar position is changed.


(cherry picked from commit a42ab09b72)
2021-01-02 22:10:45 +00:00
Jirka Novak 4bbab577e7 voip_calls_dialog/voip_calls: Fix for #16952
The fix solves issue #16952. It reverts commit 88813716 which introduced memory leak which causes the issue. The original issue with duplicating entries is solved too.
Because commit was cherry picked to 3.4.0 (might be in more branches), this patch should be cherry picked too.


(cherry picked from commit 71e3969d63)
2020-12-29 20:03:55 +00:00
Jirka Novak 0985a2ef2a VoIP: VoIP calls statistics are cleared when retap is issued
Every press of Play Stream or Prepare Filter caused incorrect increasing
of Packets count and added Comments.
The reason was that callinfo statistics were not clear before recap
therefore all new values were added to exiting ones.
Patch solves it.


(cherry picked from commit ff3fffcf5c)
2020-12-29 19:36:52 +00:00
Guy Harris d09878a74b Fix the way we get high-resolution time.
If we're not on Windows, use clock_gettime(CLOCK_REALTIME) *if* we have
it; otherwise, fall back on gettimeofday().

(Note: neither Linux, nor macOS, nor Windows necessarily "have"
particular APIs; particular *versions* of Linux distributions
(kernel+libc) have them, particular *versions* of macOS have them, and
particular *versions* of Windows+MSVC have them.

And Linux, Windows and macOS aren't the only platforms on which we run.)

Fixes #17101.


(cherry picked from commit ca99a821b4)
2020-12-20 22:31:49 +00:00
Guy Harris 10985f6e27 In Wireshark's version info, indicate whether we were built with Minizip.
We can't determine the version number, as there's nothing in the header
to indicate the version with which we were compiled, nor is there an API
to determine the version with which we're running.


(cherry picked from commit 6498bde741)
2020-12-19 06:42:39 +00:00
Gerald Combs 6b950fe6f0 Qt: Force layer backing on Big Sur when needed.
Make sure NSView.wantsLayer is true by setting QT_MAC_WANTS_LAYER=1 at
startup if we're running on Big Sur and we were built with a version of
Qt susceptible to QTBUG-87014. Fixes #17075?


(cherry picked from commit d4b40c0047)
2020-12-17 00:11:52 +00:00
Pascal Quantin b621801877 Qt: fix crash when opening/saving IP map on Windows
According to https://bugreports.qt.io/browse/QTBUG-20372 you need to close
a QFile before calling fclose, otherwise it leads to an unexpected behavior.
Let's duplicate the file handle to avoid this issue as suggested in
https://stackoverflow.com/questions/9465727/convert-qfile-to-file

Closes #17074


(cherry picked from commit 746051d099)
2020-12-12 14:44:34 +00:00
Jaap Keuter 747a03de06 Qt: Add missing break in Win32 file export init dialog function
(cherry picked from commit b09161d758807a6a08b5afcbfdb416ca0781a946)
2020-12-12 13:50:54 +00:00
Gerald Combs 862a55ae54 Win32: Add an include guard.
Add "#ifdef _WIN32" to file_dlg_win32.c so that it's ignored by
tools/validate-clang-check.sh.


(cherry picked from commit 6e1142c33a)
2020-12-12 12:49:43 +00:00
Pascal Quantin 81bcbf0ed6 Qt: create endpoint IP map in temp folder
Closes #17074


(cherry picked from commit 9fb03566c2)
2020-12-12 08:25:57 +00:00
Stig Bjørlykke b668d0a9d5 Qt: Support ampersand in funnel menu and button
An ampersand in the menu item or a button is used as shortcut, so
use "&&" to get a real ampersand.


(cherry picked from commit c84681aca2)
2020-12-09 10:14:35 +00:00
Stig Bjørlykke d5ea403f8d Qt: Fix packet bytes hover rectangle position
For Qt 5.11 and newer use horizontalAdvance() instead of boundingRect().width()
to calculate the width of a QString to position the hover rectangle position,
and to select which byte(s) to highlight.

Closes #17033.

(cherry picked from commit cb3b469d7f)
2020-12-09 09:54:16 +00:00
John Thacker db14720d63 qt+export objects: Don't sort the header in with the content types
The Export Objects Content-Type filter combobox should not sort the
header of "All Content-Types" in with the list of content types, but
should ensure that it is always the first item, especially as the first
item position is used to show all content. This is particularly an issue
in some localizations; e.g., すべてのコンテントタイプ alphabetizes
after actual content types. Fixes bug #17048


(cherry picked from commit 2d8dd9ed4f)
2020-12-04 08:30:54 +00:00
Orgad Shaneh 29e59a0e20 Qt: fix Qt 5.15 deprecation warning
QFont::ForceIntegerMetrics is deprecated.
2020-11-30 14:51:45 +00:00
Guy Harris 899899533c PacketListRecord: add an ensureColorized() method and use it.
Don't call the columnString() and discard the result in order to force
colorization; instead, add a separate method to force colorization and
use that.

This avoids the need to choose a column; we were using 1 as the column
number, but column numbers are zero-origin, so that's column 2, which
isn't guaranteed to exist (a crash ensued if it didn't).


(cherry picked from commit 58aea1de62)
2020-11-20 22:52:22 +00:00
Gerald Combs df635a196b [Automatic update for 2020-11-15]
Update manuf, services enterprise numbers, translations, and other items.
2020-11-15 19:12:07 +00:00
Gerald Combs 2714dd9e6f [Automatic update for 2020-11-08]
Update manuf, services enterprise numbers, translations, and other items.
2020-11-08 09:25:29 +00:00
Uli Heilmeier b3de664f2b QT: progress UI: Fix TextLabel string to loading
Change TextLabel to Loading for progress UI
Fixes: wireshark/wireshark#16987


(cherry picked from commit 48c09fe046)
2020-11-04 19:59:50 +00:00
Chuck Craft 5497552ab1 win32: fix MR180 - broke "-i -" input pipe
(cherry picked from commit 44241f694e)
2020-11-02 13:52:36 +00:00
Gerald Combs 746cf80cce [Automatic update for 2020-11-01]
Update manuf, services enterprise numbers, translations, and other items.
2020-11-01 17:35:58 +00:00
Gerald Combs a1909f2343 Qt: Add a recent item for packet diagram field values.
Fixes #16957.


(cherry picked from commit b1d18e41db)
2020-10-28 20:22:45 +00:00