Commit Graph

6694 Commits

Author SHA1 Message Date
Martin Mathieson 1408dd3b50 Last batch of changes from PVS-Studio scan.
/opt/SourceCode/wireshark/epan/dissectors/packet-flip.c	155	warn	V547 Expression 'chksum_hdr_chksum == computed_chksum' is always false.
/opt/SourceCode/wireshark/epan/dissectors/packet-zbee-zcl-meas-sensing.c	1295	err	V590 Consider inspecting the '(value > 0x0000) || (value > 0xfffd)' expression. The expression is excessive or contains a misprint.
/opt/SourceCode/wireshark/ui/qt/lte_rlc_statistics_dialog.cpp	504	warn	V668 There is no sense in testing the 'channel_item' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error.

Bug: 16335
Change-Id: Ief19a82e84bd16df33c453d6cc30db37f1c589ea
Reviewed-on: https://code.wireshark.org/review/37150
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2020-05-05 18:41:30 +00:00
Aurelien Aptel 9e299c1166 ui/capture.h: add missing include to fix build with GCC 9.3
ui/capture.h has a function prototype using capture_file struct
without it being defined yet. This fails to compile with recent
GCC (9.3.1)

Bug: 16547
Change-Id: I84f932de2e7ed70f14aa157b9c3b1d1f80b0016f
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-on: https://code.wireshark.org/review/37024
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-05-04 11:22:22 +00:00
Guy Harris c9735a3da9 Generate a dummy description if we don't have an interface name.
Just have a display name and description of "(Unknown)" if we have no
display name, no description, *and* no interface name.

Change-Id: I8403779c17c1e6d96d5ba29941081f560ad5339c
Reviewed-on: https://code.wireshark.org/review/37086
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-05-03 21:22:17 +00:00
Guy Harris bd963200ce Clean up some issues with get_iface_list_string().
Remove an assignment of NULL to a variable when it's in a branch of code
where the variable's already known to be NULL.  Found by PVS-Studio.

Pull get_display_name_for_interface() into the one place it's used.
That:

    allows us to eliminate a test as, inside the loop where it's called,
    the loop index is what's passed to it, and the loop tests whether
    it's in range, so the test will never fail;

    means we just set interface_opts once, for both of the places it's
    used.

Then we fix that code so that it sets interface_opts->descr to a
generated descriptive name if it *is* null, rather than if it's *not*
null.

That should clean up some issues found by 1) PVS-Studio and 2) me.

Change-Id: I4188ca8f5c7306477ef11117016691d1c9f0267f
Reviewed-on: https://code.wireshark.org/review/37082
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-05-03 20:45:29 +00:00
Martin Mathieson 0b1e27ec77 voip_calls: Fix leak of GString from unistim handling.
/opt/SourceCode/wireshark/ui/voip_calls.c	3786	err	V773 The function was exited without releasing the 'g_tmp' pointer. A memory leak is possible.

Tested with unistim_call.pcap from SampleCaptures.

Bug: 16335
Change-Id: I8518a3e277e8acec15e09ca5f36672b5bdd181fe
Reviewed-on: https://code.wireshark.org/review/37028
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-05-03 19:07:53 +00:00
Martin Mathieson 6ba8bd037f Some more issues identified by PVS-Studio.
/opt/SourceCode/wireshark/epan/dissectors/packet-osc.c	367	err	V562 It's odd to compare 0 or 1 with a value of 0.
/opt/SourceCode/wireshark/epan/dissectors/packet-rpc.c	960	note	V576 Incorrect format. Consider checking the eighth actual argument of the 'proto_tree_add_subtree_format' function. The SIGNED integer type argument is expected.
/opt/SourceCode/wireshark/epan/dissectors/packet-rpc.c	980	note	V576 Incorrect format. Consider checking the third actual argument of the 'proto_item_append_text' function. The SIGNED integer type argument is expected.
/opt/SourceCode/wireshark/epan/dissectors/packet-rpc.c	2473	note	V576 Incorrect format. Consider checking the fourth actual argument of the 'col_prepend_fstr' function. The SIGNED integer type argument is expected.
/opt/SourceCode/wireshark/epan/dissectors/packet-rpc.c	2482	note	V576 Incorrect format. Consider checking the fourth actual argument of the 'col_append_fstr' function. The SIGNED integer type argument is expected.
/opt/SourceCode/wireshark/epan/dissectors/packet-rpc.c	2633	note	V576 Incorrect format. Consider checking the fourth actual argument of the 'col_append_fstr' function. The SIGNED integer type argument is expected.
/opt/SourceCode/wireshark/epan/dissectors/packet-rpc.c	2650	note	V576 Incorrect format. Consider checking the fourth actual argument of the 'col_prepend_fstr' function. The SIGNED integer type argument is expected.
/opt/SourceCode/wireshark/epan/dissectors/packet-stun.c	565	warn	V1051 Consider checking for misprints. It's possible that the 'reported_length' should be checked here.
/opt/SourceCode/wireshark/epan/dissectors/packet-umts_fp.c	4126	warn	V1051 Consider checking for misprints. It's possible that the 'reported_length' should be checked here.
/opt/SourceCode/wireshark/epan/dissectors/packet-umts_fp.c	4942	warn	V1051 Consider checking for misprints. It's possible that the 'reported_length' should be checked here.
/opt/SourceCode/wireshark/ui/voip_calls.c	1444	err	V773 The 'comment' pointer was assigned values twice without releasing the memory. A memory leak is possible.
/opt/SourceCode/wireshark/wsutil/filesystem.c	1531	err	V773 The function was exited without releasing the 'files' pointer. A memory leak is possible.
/opt/SourceCode/wireshark/wsutil/filesystem.c	1717	err	V773 The function was exited without releasing the 'files' pointer. A memory leak is possible.

Bug: 16335
Change-Id: I8df3ba6d070823dcb43c4152d9156358f701e8dc
Reviewed-on: https://code.wireshark.org/review/37069
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-05-03 19:04:30 +00:00
Gerald Combs bf3d14ca4e [Automatic update for 2020-05-03]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: Iee0627e305ea5b5b9b01c69175a0ea8a52195586
Reviewed-on: https://code.wireshark.org/review/37062
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-05-03 08:08:59 +00:00
Guy Harris 582ad24c38 Remove some single-SHB assumptions.
Make wtap_file_get_shb() take a section number argument, and update code
that called it.  In most cases, we convert the code to iterate over
sections; in cases where a big code change would be required, we
temporarily pass it 0 and mark the code as "needs to be updated for
multiple sections".

Eliminate cf_read_section_comment(); in calls outside file.c, other code
directly calls the libwiretap routines it calls and, inside file.c, we
just transplant the code and then fix it not to assume a single SHB.

Change-Id: I85e94d0a4fc878e9d937088759be04cb004e019b
Reviewed-on: https://code.wireshark.org/review/37000
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-05-01 19:46:42 +00:00
Roland Knall adb8feee6d Qt: Allow renaming personal profile
If a personal profile has the same name as a global profile (which
is usually the case if it has been copied without changing the name
afterwards), there was a bug where renaming the profile was no longer
possible.

Bug: 16423
Change-Id: Idafd216d007179a4c6221eafc2ff296d277d5b1d
Reviewed-on: https://code.wireshark.org/review/36902
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-04-30 11:19:41 +00:00
Martin Kaiser 7bd3f8a58f LteMacStatisticsDialog: fix memory leaks
Remember the delegates that we use and free them explicitly
in the destructor.

Change-Id: Iba07c3e9952dc152d94468b6b7c7e2c2a74c1f65
Reviewed-on: https://code.wireshark.org/review/36965
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-29 03:35:44 +00:00
Martin Kaiser 8025250313 WlanStatisticsDialog: fix memory leaks
Remember the delegates that we use and free them explicitly
in the destructor.

Change-Id: I79698eb6ee4f565efcb3f02ac6239914c6acf3f5
Reviewed-on: https://code.wireshark.org/review/36964
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-29 03:35:35 +00:00
Pascal Quantin 50806f2f1b Qt: workaround a C4138 warning generated by MSVC2019
MSVC falsely reports a '*/' found outside of comment warning

Change-Id: I41366c9760f6b698a1c6a4309cdfa2f9828bb0c2
Reviewed-on: https://code.wireshark.org/review/36961
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-04-28 16:06:31 +00:00
Roland Knall 7fcac9c955 Qt: Fix export of dissection
Exporting dissected bytes did not consider the
selection of packets on Windows, if multiple
packets had been selected

Bug: 16516
Change-Id: I9d914fe1fed22f842d73caea397a3f37ffc0d523
Reviewed-on: https://code.wireshark.org/review/36958
Reviewed-by: Roland Knall <rknall@gmail.com>
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-04-27 16:00:03 +00:00
Martin Kaiser 64b6b68efa TCPStreamDialog: prevent access to uninitialized memory
If we launch a TCPStreamDialog in a situation where we can't select a
corresponding tcp stream, we leave the constructor before graph_
is initialized.

Later on, the destructor calls graph_segment_list_free(&graph_).
This requires that graph_ was initialized before.

Make sure that we initialize graph_ in the constructor, regardless
of errors.

(There's other aspects of this issue. We shouldn't be able to
launch a TCPStreamDialog when we have no tcp stream...)

Change-Id: I7b4ddadca8f699d30ec45f0fe6021ae9d36ced53
Reviewed-on: https://code.wireshark.org/review/36935
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-26 06:13:54 +00:00
Martin Kaiser d8137cc1be ProfileTreeView: fix a memory leak
In the constructor, we allocate a delegate for the name column and assign
it by calling QAbstractItemView::setItemDelegateForColumn(). This does
not pass ownership of the delegate to QAbstractItemView, it's still
up to us to free the delegate.

ASAN warns about this

Indirect leak of 48 byte(s) in 1 object(s) allocated from:
...
    #1 ... in ProfileTreeView::ProfileTreeView(QWidget*) ui/qt/widgets/profile_tree_view.cpp:46:17
    #2 ... in Ui_ProfileDialog::setupUi(QDialog*) ui/qt/qtui_autogen/include/ui_profile_dialog.h:67:31
    #3 ... in ProfileDialog::ProfileDialog(QWidget*) ui/qt/profile_dialog.cpp:59:13
    #4 ... in MainWindow::on_actionEditConfigurationProfiles_triggered() ui/qt/main_window_slots.cpp:2239:36

Add a destructor for ProfileTreeView and free the delegate there.

Change-Id: I2a76abb7ec174c91ad15bfac91f2b47bea29f511
Reviewed-on: https://code.wireshark.org/review/36934
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-26 06:13:45 +00:00
Gerald Combs dddb086f58 Docs+help: Remove "-m".
Support for the -m (monospace font) flag was removed from Wireshark in
2.3/2.4 in g37252634c4. Remove it from the man page and help output.

Change-Id: Idaafeb6cd30d7deea6086a065168c91affd6f0ad
Reviewed-on: https://code.wireshark.org/review/36926
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2020-04-25 13:57:11 +00:00
Guy Harris ba50c5a5f6 Check the validator in ExtArgText::isValid().
The validator doesn't prevent the input focus from being transferred out
of the QLineEdit, and it merely prevents the user from entering a value
that's considered "invalid" rather than "not valid but "intermediate"".

For QIntValidator(), values that have more digits than the maximum value
are "invalid", but values that have the same number of digits but that
are larger are just "intermediate".

This means the user will be able to send such a value to the extcap
module.

So we explicitly check the validator in ExtArgText::isValid(), so that
1) we provide visual feedback (at least to people who can detect a red
background) for out-of-range values that don't have too many digits and
2) prevent them from being treated as valid and passed to the extcap
module.

Bug: 16510
Change-Id: Ie5b90cf5dbb57c91744f6a28a71674b65ef21bb6
Reviewed-on: https://code.wireshark.org/review/36914
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-04-24 11:27:39 +00:00
Andre Luyer 30f4f1b056 Qt: update import via GUI to match import features using text2pcap
Update "Import From Hex Dump" via GUI to allow the same timestamp format as
supported by the command line tool text2pcap. Added support for:
  %F Equivalent to %Y-%m-%d (the ISO 8601 date format).
  %s The number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).

While at it changed the following:
- Subsecond timestamp dot format (.) is now shown in the timestamp Example Label.
- A timestamp format without any format (%) now disables Import button.

The field "Timestamp format" in the GUI now accepts exactly the same formatting
as the text2pcap's -t time format option.

Change-Id: Ie48362f86ed3214288635767d1fc4161599d1907
Reviewed-on: https://code.wireshark.org/review/36417
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2020-04-22 21:31:48 +00:00
Roland Knall e74ce4e1bc Qt: Fix compilation error
and also remove unnecessary method

Change-Id: If6dfc5ae2f5ddab97926beeaa611372cd487b98a
Reviewed-on: https://code.wireshark.org/review/36900
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-04-21 11:37:53 +00:00
Roland Knall 9c75c1dc18 Qt: Allow folders for filter buttons
Filter buttons can be sorted into folders, by separating
different depths by the parent separator "&&". Context
menu for filter buttons work also in submenus, and the
depth of submenus is only limited by the character limit
for the label

Bug: 16498
Change-Id: I9c784a36e8c46eede11f679a4c1ac830213de7ce
Reviewed-on: https://code.wireshark.org/review/36885
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-04-21 11:05:44 +00:00
Alexis La Goutte 15b53b6892 wireshark_zip_helper(Qt): fix no previous prototype for function
wireshark_zip_helper.cpp:153:15: warning: no previous prototype for function 'qDateToDosDate' [-Wmissing-prototypes]

Change-Id: Ic9ffb4219321347c077e08931d6fe51bc1702a29
Reviewed-on: https://code.wireshark.org/review/36889
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-04-20 16:21:32 +00:00
Signat Sibirskiy c6411187a0 Qt: Fix filling bluetooth device address
When filling bd_addr from tap_device->bd_addr[], only the first
octet was used

Change-Id: I3cb281d96126d77e5e6862e44704c7f9ab34cb78
Reviewed-on: https://code.wireshark.org/review/36152
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-19 14:44:27 +00:00
Martin Kaiser d5ec6882fe ColumnPreferencesFrame: fix memory leaks
Delete model and proxy model in the destructor.

QAbstractItemView::setItemDelegate() does not take ownership of the delegate
that is passed to it. We have to store it ourselves and free it.

Change-Id: I5d08d16e94a162d2a25450aec05ef672d4eaf528
Reviewed-on: https://code.wireshark.org/review/36878
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-19 14:43:57 +00:00
Gerald Combs 53a313fff9 [Automatic update for 2020-04-19]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: If24a5f418d53424553a303957eea0133b9d718b2
Reviewed-on: https://code.wireshark.org/review/36881
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-04-19 08:20:07 +00:00
Roland Knall 73d2989f37 Qt: Remove unnecessary private variable
Variable is only needed locally, so it can be moved to the local
entity.

Change-Id: I790c1616e27d5e85b3dabbdc327e3f54fc663d25
Reviewed-on: https://code.wireshark.org/review/36863
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-17 06:26:33 +00:00
Martin Kaiser 759fb119a7 FrameInformation: fix a crash in the destructor
It's possible to create a FrameInformation object that's not backed by
any frame data. In this case, fi_ is NULL and loadFrameTree() does not
run a dissection. However, we run epan_dissect_cleanup() unconditionally
in the destructor, even if edt_ is uninitialized. This causes a crash
when wireshark is closed.

Convert edt_ into a pointer. Run the cleanup only if we ran the
dissection before.

The issue can be reproduced by applying a display filter that makes the
list of the packets smaller than the packet list window. Right click
onto an "empty" part of the packet list and select "Mark/Unmark Frame".
Exiting wireshark at this point causes a segmentation fault

Thread 1 "wireshark" received signal SIGSEGV, Segmentation fault.
tvb_free_chain (tvb=0xf000e000d000c) at ../epan/tvbuff.c:124
124			tvb_free_internal(tvb);
(gdb) bt
 #0  tvb_free_chain (tvb=0xf000e000d000c) at ../epan/tvbuff.c:124
 #1  0x00007ffff430491e in epan_dissect_cleanup (edt=0x555558075b48) at ../epan/epan.c:648
 #2  0x00005555558fa5a6 in FrameInformation::~FrameInformation (this=0x555558075b20,
         __in_chrg=<optimized out>) at ../ui/qt/utils/frame_information.cpp:57
 #3  0x00005555558fa5e9 in FrameInformation::~FrameInformation (this=0x555558075b20,
         __in_chrg=<optimized out>) at ../ui/qt/utils/frame_information.cpp:55
 ...
 #12 0x00005555559a74f7 in PacketList::~PacketList (this=0x55555602e930,
         __in_chrg=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:1130

Change-Id: I347dd4901b4e08c37008ff25ac1f20a67555d9fd
Reviewed-on: https://code.wireshark.org/review/36825
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-15 14:27:39 +00:00
Stig Bjørlykke 6b589151a2 Qt: Fix memory leak in TCP Stream Dialog
Do not copy addresses at when dialog opens, they will be initialized
in tapall_tcpip_packet(). Do not clear addresses when switching stream,
they will be properly removed in graph_segment_list_free().

Correctly free addresses in graph_segment_list_free() which is called
when switching stream and when closing the dialog. Free copied addresses
when switching direction (address swap).

Remove redundant and unused code.

Change-Id: I4328aa4df333f59c587f841b74a24dc71d329079
Reviewed-on: https://code.wireshark.org/review/36840
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Tomasz Moń <desowin@gmail.com>
2020-04-14 15:35:55 +00:00
Stig Bjørlykke 1f6449c05d Qt: Fix a memory leak in ByteViewTab
FieldInformation::parentField() allocated a new FieldInformation,
so ensure to delete this when done.

Change-Id: Id0f538cc696551ec47169103be823eb1e55d1777
Reviewed-on: https://code.wireshark.org/review/36823
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2020-04-13 13:29:15 +00:00
Martin Kaiser abcb95ffe2 PacketList: ignoreFrame: remove write-only variable
Like in markFrame, the integer list of selected rows is not used in
ignoreFrame. Remove it.

Change-Id: Ic2bf4b1d2d330767370a2e831e321e285cb00e91
Reviewed-on: https://code.wireshark.org/review/36805
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-13 10:20:24 +00:00
Martin Kaiser 7044c6101d PacketList: markFrame: remove write-only variable
The "rows" variable is populated with the indices of all selected rows.
It seems that rows is never read and can be removed.

(In parallel, there's QModelIndexList frames. This list is used
when it comes to actually marking the selected packets.)

Change-Id: If2b97a2f5d87fe24717b9ad56444e2a779e0b3fc
Reviewed-on: https://code.wireshark.org/review/36804
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-13 10:20:06 +00:00
Dario Lombardo 71f6d9411a Qt: don't use a widget if not set.
Bug: 16489
Change-Id: I9585120fb07f3c41ac2ddc7fb9eeb9b17542f5e8
Reviewed-on: https://code.wireshark.org/review/36789
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-04-13 01:10:24 +00:00
Jaap Keuter 8b7757811d Qt: fix endpoint map file creation and presentation
At least with Qt 5.12 on Debian/testing the following needs to be changed:
- The temporary file name created for the endpoint map file needs to be
  retrieved at least once when the file is open to be available later on.
- The temporary endpoint map file needs to remain on temporary storage
  because the external presentation process (web browser) needs to have
  access to it when it starts (asynchronously) and for as long as it needs.

Change-Id: I554110a5a3ffa48b44575b1cb45f5971baac5e9c
Reviewed-on: https://code.wireshark.org/review/36599
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-06 06:07:15 +00:00
Gerald Combs d28520a7e3 [Automatic update for 2020-04-05]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: Iceb3f6c0575ae29b6991023288177a633eaf050a
Reviewed-on: https://code.wireshark.org/review/36709
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-04-05 08:17:03 +00:00
Gerald Combs e37a7abf56 Remove duplicate status messages.
Adding back progress titles in g3069129fe5 revealed the fact that we had
duplicate messages in the Qt UI and in file.c. Remove the ones in file.c
in favor of the Qt UI, since the latter are translated.

Change-Id: I5ff8f1bd34e963e9e66c01420ad8c5fe9c2f0caa
Reviewed-on: https://code.wireshark.org/review/36646
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-02 08:13:06 +00:00
Guy Harris 0975bf792a Handle -k better on platforms that don't support it.
Have ws80211_init() return an indication that channel setting isn't
supported on those platforms.

In dumpcap, try to set up ws80211 before checking the channel argument
and, if it fails, report the failure, rather than failing because the
"convert channel name to channel code" routine fails.

See

    https://ask.wireshark.org/question/15535/dumpcap-k-is-not-accepting-channel-type-values/

for an example of confusion caused by the previous behavior.

Change-Id: I303f560704700bbcd4f0ecea041f8632744212f3
Reviewed-on: https://code.wireshark.org/review/36659
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-04-01 20:31:14 +00:00
Uli Heilmeier 8e5007442e QT/UI: Fix shortcut
Shortcut should be in text and not in tooltip

Bug: 16472
Change-Id: I2139eab83dfbca51126a555476948373fee15237
Reviewed-on: https://code.wireshark.org/review/36651
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-04-01 15:04:07 +00:00
Gerald Combs e2b695ddef Qt: Fix a deprecation issue.
Use QFontMetrics::horizontalAdvance instead of QFontMetrics::width with
newer versions of Qt.

Change-Id: I65b3f4a6349d5c6dcd19e1cb029f0c8ce83decd0
Reviewed-on: https://code.wireshark.org/review/36644
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jason Cohen <kryojenik2@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-03-31 21:21:22 +00:00
Gerald Combs 3069129fe5 Qt+wslua: Add back progress bar titles.
As part of the Qt migration we dropped support for showing progress bar
titles. Add them back.

Fix the title and task arguments in wslua.

Change-Id: I76f008ff1f73e868a9b3833d24d355513692ae8b
Reviewed-on: https://code.wireshark.org/review/36612
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-31 04:11:56 +00:00
Gerald Combs 1af213e4c4 [Automatic update for 2020-03-29]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I9749944a6e128698a124912d52614da72f6d2370
Reviewed-on: https://code.wireshark.org/review/36615
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-03-29 08:17:32 +00:00
Guy Harris fd88bfa348 Write the if_hardware option, if available, to pcapng files when capturing.
Change-Id: Ib9ff78d148a2364c84d84b4a9b020b3d783654a3
Reviewed-on: https://code.wireshark.org/review/36602
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-03-28 03:34:18 +00:00
Guy Harris 464d5688cc Don't build code to handle capturing if we don't have pcap.
Only build the capture information dialog if we're going to support
capturing; otherwise, that dialog never pops up.

Don't include ui/capture.h in ui/qt/wireshark_application.cpp if we
don't have pcap, either; it's not needed, and breaks compilation.

Change-Id: If9a52239fd2c81c37663be8044ecd67f4569d61b
Reviewed-on: https://code.wireshark.org/review/36585
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-03-26 08:33:50 +00:00
Guy Harris 30bad8e627 Have callback function pointers in a capture_session structure.
Instead of having programs that use the capchild library define
functions with known names, with the library routines calling back
routines with those names, have function pointers for those callbacks in
the capture_session structure, and have capture_session_init() set them.

Make the callback routines in TShark and in the ui library static.

Change-Id: Ia1ba6119c5ef7708e0f87b8420f200136ba41eae
Reviewed-on: https://code.wireshark.org/review/36583
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-03-25 23:16:06 +00:00
Gerald Combs 12d5041eb7 Qt: Fix Lua GUI issues and get rid of casts.
Define a FunnelStatistics dtor and use it to clear our funnel
operations. This keeps us from crashing if we quit while a ProgDlg or
TextWindow is visible.

In FunnelStatistics::progressDialogNew, pass in our parent MainWindow
instead of depending on capture_file_ having a valid window pointer.
This lets us use a ProgDlg without having to load a capture file.

Define and use the _funnel_ops_id_t struct so that we don't have to cast
void pointers in a bunch of places.

Change-Id: I38dd3f254b705ddf82f7421a14d27b8c3ef7bc98
Reviewed-on: https://code.wireshark.org/review/36538
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-25 08:32:16 +00:00
Gerald Combs 428735ce9e [Automatic update for 2020-03-22]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: Ia5e7f2ad5422ba028b3205b8c2a5fe568578d828
Reviewed-on: https://code.wireshark.org/review/36528
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-03-22 08:17:10 +00:00
Guy Harris 8e76178fcd Fix reporting of interface-list-fetching errors.
If the attempt to fetch the list of local interfaces failed, the model
will be empty, so "model is empty" doesn't imply "no interfaces found".
First, check whether there was an error, and report the error string;
otherwise, if the list is empty, report "No interfaces found." (and fix
the capitalization while we're at it) and, otherwise, return an empty
string.

Also, if pcap support wasn't configured in at compile time, skip all
that, and just return a string indicating that.

Change-Id: I498226888272e1bdede2355cc902f8a74b0cce72
Reviewed-on: https://code.wireshark.org/review/36446
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2020-03-16 06:51:50 +00:00
Tomasz Moń eb7774e4c1 Qt: Improve tcptrace graph drag responsiveness
Subclass QCPErrorBars with implementation that never accepts clicks.
This prevents a lot of square root computations in QCustomPlot
mousePressEvent handle and results in usable tcptrace graph.

An alternative solution to the poor performance problem could be using
QCP::srmCustom SelectionRectMode. I don't know how to implement graph
drag with QCP::srmCustom, and thus I went with simple subclass approach.

Bug: 16281
Change-Id: Id4178e59bdbd2222db4669d0635ff741ebde839f
Reviewed-on: https://code.wireshark.org/review/36413
Petri-Dish: Tomasz Moń <desowin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-16 05:05:48 +00:00
Tomasz Moń 1d20a875e4 Qt: Fix bug causing hidden columns to be displayed
Set capture file for model and header before columnsChanged() is called
to prevent skipping model reset in PacketListModel::resetColumns() due
to cap_file_ being NULL.

Do not strech last section in packet list header. This prevents
QHeaderViewPrivate::resizeSections() from messing up the column sizes
via resize events. For some reason (unknown to me) underlying
QHeaderView implementation has different idea about the number of
visible columns than our code.

Ping-Bug: 16063
Change-Id: I482c1080adb418b7922ee99d357d4962dc086026
Reviewed-on: https://code.wireshark.org/review/36120
Petri-Dish: Tomasz Moń <desowin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-03-15 12:07:06 +00:00
Gerald Combs ee39cd988f [Automatic update for 2020-03-15]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: Ib60abbe864e82b50de408d4b89236f022cae6ffc
Reviewed-on: https://code.wireshark.org/review/36426
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-03-15 08:17:19 +00:00
Gerald Combs 9f6fad0a46 WSUG: Update the I/O Graphs section.
Update the I/O Graphs section of the User's Guide. Use the name "I/O
Graphs" consistently.

Update the image thanks to Chuck Craft.

Ping-Bug: 16359
Change-Id: I6b60fd1b79a849e4467c7ca7927279e16dd6e671
Reviewed-on: https://code.wireshark.org/review/35762
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-13 04:38:29 +00:00
Gerald Combs 73ea612d25 Qt: Fill in our UAT delegate editor backgrounds.
Set setAutoFillBackground(true) for a bunch of our editors where
appropriate, similar to g4a2cd15aa5.

Change-Id: Ic87275e3be90af55b8352eb4742559d526dec2b6
Reviewed-on: https://code.wireshark.org/review/36386
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-13 04:38:01 +00:00
Guy Harris f77c677f18 Fix some places where we forgot to mention Npcap.
Mostly comments, but a few messages.

Change-Id: Iff7380eb15f064bf6a3078e131c70987e36bca44
Reviewed-on: https://code.wireshark.org/review/36381
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2020-03-12 18:59:44 +00:00
Rasmus Jonsson d8ac2a046b Qt: Re-highlight packet bytes when re-selecting packet tree item
Emit the fieldSelected signal when the currently selected dissection
tree item is clicked. This causes the corresponding bytes in the
packet bytes tab to be re-selected.

Change-Id: I9168163f6734ef05ed3196c291a813125d8e86c6
Reviewed-on: https://code.wireshark.org/review/36303
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-03-09 18:38:17 +00:00
Stig Bjørlykke a2dc713c11 Qt: Fix Copy Description from context menu
Fix Copy->Description from context menu in Packet List and
Packet Dialog. This was broken in gf6534b8a.

Align MainWindow::actionEditCopyTriggered() using the same procedure.

Improve ProtoTree::ctxCopyVisibleItems().

Bug: 16323
Change-Id: I564b73c027019bc59629aa84098db8f307e92d40
Reviewed-on: https://code.wireshark.org/review/36339
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-09 04:47:54 +00:00
Guy Harris 839209d219 Fix formatting of the start time and elapsed time.
There's no

    QString arg(uint a, int fieldWidth = 0, QChar fillChar = QLatin1Char(' '))
        const

version of the arg method of QString, there's only

    QString arg(uint a, int fieldWidth = 0, int base = 10,
        QChar fillChar = Latin1Char(' ')) const

so if you don't pass the base argument, it turns the QChar into an int
(presumably using the unicode method, so that ends up being 0x20 or 32),
passes it as the base argument (so it does the conversion base-32 -
that's <= 36, so it's a valid value for the base argument), and defaults
the fillChar argument to space.

Add 10 as the base argument, so it behaves correctly.

Bug: 16429
Change-Id: If4872d6d55aa5d9a7489219622d4190827e65d34
Reviewed-on: https://code.wireshark.org/review/36337
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2020-03-08 19:13:22 +00:00
Stig Bjørlykke 2e2b537381 Qt: Keep profile selection when renamed
Keep the list selection when renaming a profile in the
Profiles dialog.

Bug: 15966
Change-Id: Ifda223b2286ef49ba46830954872e9303e27a089
Reviewed-on: https://code.wireshark.org/review/36322
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-03-08 11:51:58 +00:00
Jaap Keuter 40b8293d43 Qt: add new protocol name when reporting deprecation
When entering a deprecated protocol name in the filter a warning is
placed in the status bar to this effect. The new protocol name is
not reveiled though, leaving the user in doubt what to use.
This change adds the new protocol name to the text in the status bar.

Change-Id: Ib892f79893471065eca81c7cf17e165256fdc9a9
Reviewed-on: https://code.wireshark.org/review/36086
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-03-08 11:51:19 +00:00
Stig Bjørlykke 86337a8e69 Qt: Don't hijack Ctrl+C for copy packet list entry as plain text
Don't hijack Ctrl+C / Cmd+C for copy Packet List entry as plain text
in the main window because this will affect using this shortcut in
other dialogs.

Ctrl+C will now copy the selected row in the Packet List (without
the headers), or the selected entry in the Packet Details, and it
also works correctly in other dialogs.

This was introduced in gb3f240dbf8.

Change-Id: I99d87f49c436a6dbf98e51d638a09c15a18bcc72
Reviewed-on: https://code.wireshark.org/review/36280
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-05 17:17:26 +00:00
Gerald Combs 53246cee24 Qt: Add missing breaks.
Add missing breaks pointed out by Pascal.

Change-Id: I5dc17ec15fcf6d102ab2f97fec84c04905c68c79
Reviewed-on: https://code.wireshark.org/review/36271
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
2020-03-03 22:14:22 +00:00
Gerald Combs 4a2cd15aa5 Qt: Fill in our item delegate editor backgrounds.
As the documentation for QAbstractItemDelegate::createEditor says,

"The view's background will shine through unless the editor paints its
own background (e.g., with setAutoFillBackground())."

Set setAutoFillBackground(true) for a bunch of our editors where the
underlying widget's background was showing.

Change-Id: I77e96548e99c74a73c89f8037c1f894a6a5584f1
Reviewed-on: https://code.wireshark.org/review/36260
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-03 06:19:02 +00:00
Gerald Combs a42fde90c1 [Automatic update for 2020-03-01]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I14e268fb0be2a1a85e10a4ff7b5f0b0559489f3a
Reviewed-on: https://code.wireshark.org/review/36246
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-03-01 08:20:11 +00:00
Dylan Ulis 612568d7b3 Edit Resolved Name: Allow user to remove name
User can remove the previously set name, just by editing the current
name, and removing all text (empty string). Empty strings are skipped by
the name resolution code.

Bug: 11221
Change-Id: Id9c64885b5dd82fd72dd16b25a0f8046b8102a11
Reviewed-on: https://code.wireshark.org/review/36206
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-01 06:49:20 +00:00
Tomasz Moń 04a86e99e4 Qt: Fix import profile from directory crash
Do not append separator to import directory path. Calling QFileInfo()
constructor with string ending in directory separator results in
creating QFileInfo instance for file with empty filename.

Bug: 16410
Change-Id: I4fe248fcdb0c0c67843652475ae58c2a473a9fa8
Reviewed-on: https://code.wireshark.org/review/36238
Petri-Dish: Tomasz Moń <desowin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-01 06:48:21 +00:00
Tomasz Moń c07a48b6d3 Qt: Fix profile zip import on Windows
Do not use QDir::separator() as a directory separator. QT internally
uses "/" as separator on all systems, including Windows. The zip files
were not unzipped into target directory because splitting path on
QDir::separator() in ProfileModel::cleanName() returned only one part
(there weren't any "\' in file name, only "/").

Qt documentation for QDir::separator() mentions:
  "You do not need to use this function to build file paths.
   If you always use "/", Qt will translate your paths to conform to
   the underlying operating system. If you want to display paths to
   the user using their operating system's separator use
   toNativeSeparators()."

Bug: 16410
Change-Id: I9627684f58f4c1da24b6eec8958a2542fe07d915
Reviewed-on: https://code.wireshark.org/review/36237
Petri-Dish: Tomasz Moń <desowin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-02-29 10:15:29 +00:00
Roland Knall 4fe7fbd51d Qt: Changes ProfileModel assert
The assert mistakenly crashed the import

Bug: 16410
Change-Id: I385f4ba9b842f0f25d6ffe30db6065946fd55d84
Reviewed-on: https://code.wireshark.org/review/36233
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-02-28 20:34:03 +00:00
Gerald Combs cead73576d macOS: Expand a comment.
Change-Id: I4755c2ca44bc33954e3ea69c6ea2b7dc0983db4c
Reviewed-on: https://code.wireshark.org/review/36232
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-02-28 16:40:02 +00:00
Tomasz Moń eabc9356c2 Qt: Do not display alerts on repeated failed reads
If read from capture file fails, set a flag that result in subsequent
read attempts to not display alert box on read failure.

This solves endless "An error occurred while reading the capture file"
error when the underlying trace file becomes unavailable. Now it is
possible for the user to close the capture file.

Bug: 4811
Change-Id: I411bbb3fb717bc994ab1f5e3805e2c8b4ee09c5e
Reviewed-on: https://code.wireshark.org/review/36114
Petri-Dish: Tomasz Moń <desowin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-02-28 04:54:15 +00:00
Gerald Combs b3871fb864 macOS: Software update fixes.
Run our software update checks in the foreground.

Post NSApplicationWillTerminateNotification prior to exiting the
application. This *should* start the automatic updater if a new version
of Wireshark was downloaded in the background, but is difficult to test
without a fully signed and notarized application bundle.

Bug: 16416
Change-Id: I212dbb42e1cafff713ff195b448c2799750bc6ac
Reviewed-on: https://code.wireshark.org/review/36221
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-02-28 04:50:38 +00:00
Rasmus Jonsson b1a4aac543 Qt: fix packet list selection regression
When adding or removing a filter, the currently selected packet
is deselected. beginResetModel/ endResetModel were used which
reset the QModelIndex, now changed back to dataChanged/
headerDataChanged as before.

Bug: 16414
Change-Id: Ia8fa91e3378bdc0792382184e75e59900397e8b9
Reviewed-on: https://code.wireshark.org/review/36204
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-02-27 10:52:26 +00:00
Guy Harris 1ed9ddd26a Fix some typoes in comments.
Change-Id: I951e183e24bf77e0f2f09266e2dc5db7a4caf0ec
Reviewed-on: https://code.wireshark.org/review/36211
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2020-02-27 05:33:15 +00:00
Guy Harris cd6134da90 Add ws_strtoi() and ws_strtoui() routines and use them.
Those fetch gint and guint values, respectively, rather than values with
specified sizes in bits.

This should squelch Coverity CID 1457357.

Change-Id: Ia8f100bd3fe90c266e24a4346f80b2667c653b93
Reviewed-on: https://code.wireshark.org/review/36177
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2020-02-25 08:27:52 +00:00
Dylan Ulis 7b99a82bf8 Edit Resolved Name: Don't add duplicate IPs
1. Switch list of manually resolved names from a list to a map
   (IP Address --> Custom Hostname)
2. If an address was already in the list, just update the old entry.
Previously this added a new entry anytime somebody would edit a
hostname.
3. Display the previous hostname in the GUI
4. Remove unused manually_resolve_cleanup()

Bug: 11221
Change-Id: I42d5b6267eb6613bdf7783865bc2d30d6bda1147
Reviewed-on: https://code.wireshark.org/review/36059
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-02-24 07:45:00 +00:00
Martin Mathieson ce0d780c3f Some more issues spotted by PVS-Studio in bug 16335.
Trivial, mostly just redundant assignments or
format specifiers.

Change-Id: Iaf33f24d2af5a48a5e1b797e582bf936914c8daa
Reviewed-on: https://code.wireshark.org/review/36154
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2020-02-23 21:43:51 +00:00
Gerald Combs 7620ba7f72 [Automatic update for 2020-02-23]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I1293c3db1c2739a9db34507eba6f8ab5eea8005c
Reviewed-on: https://code.wireshark.org/review/36160
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-02-23 08:20:06 +00:00
Dario Lombardo c544f7e3f4 Qt: initialize members (CID: 1457926).
Change-Id: I4c890db567a3668525bcf9915cb5687e2019c5c1
Reviewed-on: https://code.wireshark.org/review/36125
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-02-17 20:52:43 +00:00
Tomasz Moń d400dbe476 Qt: Remove unnecessary processEvents() call
MainWindow::captureFileReadStarted() is called inside event handlers.
There isn't any actual processing after the captureFileReadStarted() is
called so in most cases the code will quickly return to the event loop.
In case of cf_read() callbacks, there is dedicated "slow processing"
detection implemented that eventually leads to processEvent() call in
update_progress_dlg().

Change-Id: Icfefa0ba7bf1bec43014e30756d0eec4078d389c
Reviewed-on: https://code.wireshark.org/review/36113
Petri-Dish: Tomasz Moń <desowin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2020-02-16 13:51:34 +00:00
Gerald Combs fbd88490dd [Automatic update for 2020-02-16]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: Iafb3ddef40951bd50f2695ae87e6e9f7b9a0965e
Reviewed-on: https://code.wireshark.org/review/36116
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-02-16 08:19:46 +00:00
Tomasz Moń c129c28d3a Qt: Allow creating new files in extcap fileselect
If mustexist property is absent or set to false, allow the user to
specify the filename.

Add Clear button next to file selection. Previously cancelling file
selection when mustexist was false would clear the entry. However,
if mustexist was true, there was no easy way to clear the entry.

Change-Id: I367756fb868b4040a7203f1eb8c92b6bfaf29901
Reviewed-on: https://code.wireshark.org/review/35643
Petri-Dish: Tomasz Moń <desowin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-02-15 15:43:32 +00:00
Gerald Combs d7bbe384f5 Test+Qt: Add an automatic update check.
Add software_update_info() to the software update module, which returns
the name of our update library if we have one. Use it to add automatic
update information to the compiled information in `wireshark --version`.

Add a "release" test suite, which contains a test for automatic updates.

Ping-Bug: 16381
Change-Id: I867a96bdcfde8be541eca2dc0e84b5000276e7dd
Reviewed-on: https://code.wireshark.org/review/36107
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-02-15 11:13:25 +00:00
Tomasz Moń 2c1d660940 Qt: Access I/O Graph settings via UAT interface
All I/O Graph instances share the same configuration. The code was
accessing the UAT underlying number of items variable (num_io_graphs_)
directly but the actual rows were accessed indirectly via UAT interface.
This could lead to UAT missynchronization and in turn an out of range
index access in IOGraphDialog::createIOGraph().

Fix the issue by not using the num_io_graphs_ directly.

Bug: 16373
Change-Id: Ifbc0fddb619d23f31f32aa46c4ae613954a8b780
Reviewed-on: https://code.wireshark.org/review/36106
Petri-Dish: Tomasz Moń <desowin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-02-15 11:08:44 +00:00
Martin Mathieson e30f0d0920 Some issues spotted by PVS-Studio in bug 16335. Many more remain
Change-Id: If856e25af8e33eeef5b9e595f1f6820459892b17
Reviewed-on: https://code.wireshark.org/review/36110
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-02-15 11:06:41 +00:00
Jaap Keuter 74c2bcbe9b Qt: Restore space and add tooltips
Followup on commit 33bb4b0c22 adding back
the lower end spacer, moving the language selection to the bottom and
also adding tooltips with variable information.

Change-Id: I55c7e39d3a524bb17ccfad55a0e8bf844a500408
Reviewed-on: https://code.wireshark.org/review/36072
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-02-12 07:50:41 +00:00
Jaap Keuter 33bb4b0c22 Qt: Add window title settings the preferences dialog
In case of multiple instances it can be helpful to have an extra identifier
in the window title. These facilities are present and working, yet the
identifiers are not easily modifiable (only through the Advanced preference
page). This changes exposes these setting in the normal Appearance
preference page.

Change-Id: Ib6d7b18d29932edaed7419b44e4edc2f99134cbf
Reviewed-on: https://code.wireshark.org/review/36068
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-02-10 07:45:57 +00:00
Dario Lombardo a20fea02fc Qt: add initializers.
CID: 1457926, 1446253.

Change-Id: Ia9e727fd9d030b6a5db74aa5a9343c66df8c5e9b
Reviewed-on: https://code.wireshark.org/review/36065
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-02-09 17:27:48 +00:00
Gerald Combs 6e7918319b [Automatic update for 2020-02-09]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I717a08bf08aadac91f2a63b4681388bf0d038d7b
Reviewed-on: https://code.wireshark.org/review/36060
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-02-09 08:19:22 +00:00
Dario Lombardo fca18e2e5c Qt: fix compilation without pcap.
Fix a regression introduced in 1e4c4f2209
when compiling without pcap.

Change-Id: Ifda13a135285737a459155020134937069ac5d34
Reviewed-on: https://code.wireshark.org/review/36047
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-02-07 17:05:48 +00:00
Gerald Combs 1e4c4f2209 Qt: Make it possible to hide welcome screen warnings.
The "The NPF driver isn't running. You may have trouble" warning dialog
is now redundant, so remove it along with the "privs.warn_if_no_npf"
recent setting.

Add a more general "sys.warn_if_no_capture" recent setting along with a
getter for SimpleDialog's "Don't show this message again." string. Use
them to add a "Don't show this..." link to the main welcome warning
label.

Change-Id: Idffb800761eebf04b75e4be3f6bf7727dd468949
Reviewed-on: https://code.wireshark.org/review/36042
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Tomasz Moń <desowin@gmail.com>
2020-02-07 07:36:03 +00:00
Peter Wu 55f83324ef Qt: simplify decode_as_ action in the packet details view
Use the "create_new" property convention similar to PacketList. Fix a
"QWidget::insertAction: Attempt to insert null action" warning in the
packet dialog while at it.

Change-Id: I29b3b113aba92634b1b9a3427e2313fca30633eb
Reviewed-on: https://code.wireshark.org/review/36023
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-02-05 04:34:36 +00:00
Peter Wu 6bbd61860b Qt: make Decode As from packet list functional again
The "create_new" property was never set which prevented a new row from
being created once the dialog is opened.

Change-Id: I19c793ebd219bb58cb34f4d67451660ace51aa32
Fixes: v3.1.1rc0-254-gf402b4cdaa72 ("Qt: PacketList call DecodeAsDialog directly")
Reviewed-on: https://code.wireshark.org/review/36020
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-02-05 04:34:20 +00:00
Peter Wu 995672e8b6 Qt: allow Resolved Addresses search filter to be cleared
Allow the filter in the Resolved Address dialog to be cleared to disable
filtering without requiring the dialog to be reopened.

Change-Id: I8164d42ac763f8b7faf23821633e129feba69790
Fixes: v3.1.1rc0-244-g743f8598cd0b ("Qt: Rework Resolved Addresses dialog")
Reviewed-on: https://code.wireshark.org/review/36027
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-02-04 14:22:25 +00:00
Peter Wu 0596047e3f Qt: fix missing IP hosts in Resolved Addresses dialog
Fix several issues in the Resolved Addresses dialog:
 - Missing IP hosts because the list was populated with one
   tab-separated item while the caller expected space-separated items.
 - Fix duplicate entries due to the "values" list not being cleared.
 - Remove IPv4/IPv6 Hash Tables since these are a superset of IPv4/IPv6
   Hosts, except that the former also includes mappings without a known
   name (e.g. 8.8.8.8 -> 8.8.8.8).
 - Fold both IPv4 and IPv6 hosts into one as before. Users like me
   usually look for any IP match, regardless of the address family.
 - Minor optimizations: do not construct the label every time.
 - Rename "Mac Address" [sic] to simply "Address", that covers both IP
   addresses and MAC addresses.

Bug: 16366
Change-Id: I6253fc01da7b6429ce093e7db9fe58e235b7c137
Fixes: v3.1.1rc0-244-g743f8598cd0b ("Qt: Rework Resolved Addresses dialog")
Reviewed-on: https://code.wireshark.org/review/36022
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-02-04 04:12:11 +00:00
Gerald Combs b014062f07 [Automatic update for 2020-02-02]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: If4760fccbb8cf11750e307c7e1b0eb18af11e049
Reviewed-on: https://code.wireshark.org/review/36005
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-02-02 08:20:35 +00:00
Allan Møller Madsen 1592679ed8 Bluetooth HCI: Add support for Bluetooth v5.2
Dissection of all new HCI commands and events added in
the newly released Bluetooth specification version 5.2.
Bluetooth Device Dialog updated to also show ISO buffer
size and amount.

Change-Id: I3a459760cbe5f6c4f985621cee40dbbe5e473d39
Signed-off-by: Allan Møller Madsen <almomadk@gmail.com>
Reviewed-on: https://code.wireshark.org/review/35957
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-31 05:13:15 +00:00
Orgad Shaneh eb0dcc984f RTP: Fix rtpdump export
Broke by 87973bf516.

RtpStreamDialog allocates its own rtpstream_info_t, and copies the original stream's info.

Then RtpStreamDialog::on_actionExportAsRtpDump_triggered calls
rtpstream_save with this copy.

On save, reset_tap_listeners is called, and it clears all the tree items,
destroying the allocated copy *before* it is used for the actual export.

Trace:
1   rtpstream_info_free_all                             tap-rtp-common.c       104
2   RtpStreamTreeWidgetItem::~RtpStreamTreeWidgetItem   rtp_stream_dialog.cpp  85
3   RtpStreamTreeWidgetItem::~RtpStreamTreeWidgetItem   rtp_stream_dialog.cpp  86
4   QTreeModel::clear()
5   RtpStreamDialog::tapReset                           rtp_stream_dialog.cpp  309
6   rtpstream_reset_cb                                  tap-rtp-common.c       172
7   reset_tap_listeners                                 tap.c                  418
8   cf_retap_packets                                    file.c                 2243
9   rtpstream_save                                      rtp_stream.c           97
10  RtpStreamDialog::on_actionExportAsRtpDump_triggered rtp_stream_dialog.cpp  515

Bug: 16351
Change-Id: I54d37a2c97997395936df94ee5481b0d6d198aed
Reviewed-on: https://code.wireshark.org/review/35979
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-30 08:24:50 +00:00
Guy Harris 0c112e2e24 Fix indentation.
Change-Id: Ib80213ecb5c02d64f107706971c646decc601e8d
Reviewed-on: https://code.wireshark.org/review/35967
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2020-01-27 23:47:07 +00:00
Dario Lombardo 59108b1683 Qt: replace QRegExp with QRegularExpression in FilterListModel.
The new class has a more powerful support for non-greedy regexps
(required in this case).

See: https://doc.qt.io/qt-5/qregularexpression.html#notes-for-qregexp-users

Bug: 16336
Change-Id: I4684fbf6aeeb55707d325775de487246ac398c2d
Reviewed-on: https://code.wireshark.org/review/35858
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-26 19:32:58 +00:00
Gerald Combs 32fc20eef4 [Automatic update for 2020-01-26]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: Ia2638e04521c540628ae47b275c4829b2f548b6c
Reviewed-on: https://code.wireshark.org/review/35949
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-01-26 08:19:58 +00:00
Alexander Meier eb4e2cca69 IO Graph does no return to 0 if there are no fields for y
IO Graph used to show a value of 0 if there are no relevant
fields/packets when using SUM, MAX, MIN or LOAD. This is an
issue because you can not distinguish if there was a value
of 0 or if there was not even a relevant field/packet. With
this patch IO Graph shows no point in the interval if there
is no relevant field/packet when using SUM, MAX, MIN or LOAD.

Change-Id: I9b17447cb38efe6dbf9299ec67aac999cfa744a3
Reviewed-on: https://code.wireshark.org/review/35859
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-25 10:04:50 +00:00
Martin Mathieson 0290bd3592 HTTP: share dissector status value_string array with tshark HTTP stats
Change-Id: I6de4a8b691922f7c4a8141b581b9f3c8ca112b60
Reviewed-on: https://code.wireshark.org/review/35942
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2020-01-24 22:38:17 +00:00
Guy Harris 0b64a3afc0 Fix the check for ws_fdopen() failure.
If tf.handle() fails, it returns -1; we shouldn't call ws_fdopen() on
its return value.  (I'm not sure whether it can fail, but this code is
all a bit twisty.)

If tf.handle() succeeds, and we hand its return value to ws_fdopen(),
and we get back NULL, *that* indicates that ws_fdopen() failed.

This should fix Coverity CID 1457929, preventing a FILE leak.

Change-Id: I23bb04579d26928037f8b9284b7741affc3596f7
Reviewed-on: https://code.wireshark.org/review/35940
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2020-01-24 18:51:33 +00:00
Martin Mathieson 8a79d27010 SIP: share dissector status value_string array with tshark SIP stats
Change-Id: I8f12310f69aa5393ba8ad37e498845f2a1f17693
Reviewed-on: https://code.wireshark.org/review/35927
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2020-01-24 16:10:43 +00:00
Aymeric Moizard 6fceff7240 RTP Stream Analysis: fix wrong values for clock drift and freq drift.
The drift values should use the relative time (arrivaltime) instead
of the absolute time (current_time) otherwise, the values are wrong.

Bug: 16343
Change-Id: Icdc65476ab68ce51088314b7c9de939c86472ae9
Reviewed-on: https://code.wireshark.org/review/35908
Reviewed-by: Aymeric Moizard <amoizard@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-24 13:36:13 +00:00
Dario Lombardo 084a887a30 Fix compilation with gcc-9.
gcc-9 spotted some NULL pointer usages.

Bug: 16319
Change-Id: I3e4ac57705f1852c43299f5e924fc642a2c56a3a
Reviewed-on: https://code.wireshark.org/review/35733
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-21 04:44:31 +00:00
Alexis La Goutte 6693067290 rtp_play_dialog(.cpp): avoid Dead Store false positive
Value stored to 'left' is never read

Change-Id: I6d1a996427d26a2a16510ed6446749aed23cca39
Reviewed-on: https://code.wireshark.org/review/35871
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-20 14:07:43 +00:00
Jeroen Roovers f605e9466b ui: Define plugins_add_description() unconditionally
Since commit 5dfde7ff ("Print extcap plugins with "tshark -G
plugins"."), compiling with -DENABLE_LUA=no -DENABLE_PLUGINS=no fails.
The definition of plugins_add_description() is guarded by HAVE_PLUGINS
|| HAVE_LUA, but that definition is used without such guards for extcap
right below, resulting in:

ui/qt/about_dialog.cpp:137:29: error: 'plugins_add_description' was not
declared in this scope

Fix this by removing the guards around plugins_add_description().

Change-Id: Ieaddfed923ae3782ade28b2f5004b6a34220659a
Fixes: 5dfde7ff83
Reviewed-on: https://code.wireshark.org/review/35852
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-20 07:50:37 +00:00
Gerald Combs 7f45131a4d [Automatic update for 2020-01-19]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I4b4f69d4e797a49e627932adab8bcc5b75767f34
Reviewed-on: https://code.wireshark.org/review/35863
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-01-19 08:19:42 +00:00
Stig Bjørlykke e9031028fc Qt: Support ampersand in profile name
An ampersand in the menu item text is used as shortcut, so use "&&" to
get a real ampersand.

Change-Id: I333c65bb55cfa01ab60d41df20f443701067e42d
Reviewed-on: https://code.wireshark.org/review/35851
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-01-18 17:46:20 +00:00
Alexander Meier 0f57ad35c8 IO Graph shows unsigned values correctly
IO Graph used to show unsigned integer values not correctly when using
SUM, MAX, MIN or LOAD. For example was the uint32 0x9b37d2b8 shown as
about -1_679_000_000 while it should be shown as 2_604_126_904.
This patch fixes the incorrect type conversions so that unsigned
integer are shown properly in IO Graph.

Change-Id: Ib361e63cce9e088bfdd4b3d3186725c67d33f1bd
Reviewed-on: https://code.wireshark.org/review/35550
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-18 12:17:24 +00:00
Gerald Combs 82032fe375 Qt+Windows: Remove the DBAR check.
Remove the check for Dell Backup and Recovery. The check was hacky and
obnoxious. At this point it's hopefully safe to assume systems with DBAR
installed are either running Windows 7 and no longer supported or have
upgraded to a safer version.

Change-Id: I458172885870edc34ec707a7748280e0eeed59b9
Reviewed-on: https://code.wireshark.org/review/35815
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-15 04:48:04 +00:00
Stig Bjørlykke e816edd1ea Qt: Add a missing separator in packet tree context menu
The packet tree context menu for Copy should have a separator after
the "As Filter" entry. This is a regression from a previous refactoring.

Change-Id: Ie43ae71019608d28af0eed8490aab654c7e6d6f1
Reviewed-on: https://code.wireshark.org/review/35802
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-01-14 09:48:52 +00:00
Jim Young e85cbd57c6 Qt: Suppress warning: unused parameter 'actions'
In set_action_shortcuts_visible_in_context_menu() the parameter
'actions' is only used by a subset of Qt versions. Mark it unused
in the other cases.

Change-Id: I210eafcdffb8484751b656f58cc7813cb98d259f
Reviewed-on: https://code.wireshark.org/review/35800
Petri-Dish: Jim Young <jim.young.ws@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-01-14 06:33:49 +00:00
Gerald Combs 8b9f718dee Qt: Set AA_DisableWindowContextHelpButton.
Set the Qt::AA_DisableWindowContextHelpButton attribute so that dialogs
don't show a help button in their title bars.

Bug: 16327
Change-Id: Iae1005cc9bd1b426ab6b3144ae54964171322419
Reviewed-on: https://code.wireshark.org/review/35781
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-01-13 20:57:16 +00:00
Gerald Combs 48024b102d Qt: Make sure shortcuts are visible in context menus.
As of Qt 5.10, context menu shortcuts can be hidden:

https://bugreports.qt.io/browse/QTBUG-61181

Add set_action_shortcuts_visible_in_context_menu to qt_ui_utils and call
it for our context menus as needed. For Qt 5.{10,11,12} it calls
QAction::setShortcutVisibleInContextMenu(true).

For Qt 5.13 and later, call
QStyleHints::setShowShortcutsInContextMenus(true) in
WiresharkApplication.

Change-Id: Ie8941951c3a9801b4642f4ce15ac217e37d1300f
Reviewed-on: https://code.wireshark.org/review/35761
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-01-13 18:58:28 +00:00
Gerald Combs e7a8c94aa7 Qt: Add a splitter to the I/O Graphs dialog.
Add a vertical splitter, with the graph and hint label in the top part
and the graph list in the bottom.

Change-Id: Ib297b5c9c7da121b86bf3c5c4299985882ca5b8d
Reviewed-on: https://code.wireshark.org/review/35765
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-13 07:42:55 +00:00
Gerald Combs b92bf7c981 Qt: Update our main window capture warnings.
Check to see if npcap.sys or npf.sys are running and show a warning if
they aren't. Don't show any warnings if we were compiled without libpcap.

Separate the "show a warning" logic from the "show the interface list"
logic.

Change-Id: I86f2fdc17d02fc0c87004c936c8a78f65ae2dd28
Reviewed-on: https://code.wireshark.org/review/35739
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2020-01-12 22:48:53 +00:00
Dylan Ulis d5cfa99217 Allow Multiselection of packets to work during live captures
During live capture, the previous logic was to jump to row 1 when there is no
'current_frame'. When multiselect is active, there is no 'current_frame', so
it would always jump back to row 1, when >1 packet was selected.

Bug: 16293
Change-Id: Id1c9eb36fcae83f67ae342be6f9dfc1405ce7025
Reviewed-on: https://code.wireshark.org/review/35747
Reviewed-by: Michael Mann <mmann78@netscape.net>
2020-01-12 22:33:42 +00:00
Stig Bjørlykke c84bbf4853 Qt: Add error message when create profiles dir fails
Include the error message when creating the profiles directory fails.

Change-Id: I00157282b16e5152632a208357695047bed55539
Reviewed-on: https://code.wireshark.org/review/35759
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-01-12 21:17:44 +00:00
Gerald Combs a8c90e1767 [Automatic update for 2020-01-12]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: Ie93b6e343a90ab33b15e5be1814e9b988101ee28
Reviewed-on: https://code.wireshark.org/review/35750
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-01-12 08:19:18 +00:00
Orgad Shaneh bc8140be0b Fix build and deprecation warnings with Qt 5.14
Change-Id: I1fa6b5d3105288d25717a9fe4ae93ad3f471aaca
Reviewed-on: https://code.wireshark.org/review/35727
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-01-10 08:42:21 +00:00
Roland Knall 1bbac91d33 Qt: Fix related packet delegate
Recent updates broke the related packet delegate in such a way,
that the direction arrow for the current packet was shown, but
no indicator for any other packet. This fix resets the packet
indicator properly, if a new frame is selected.

Note: This means, that the caller has to reset the delegate,
but this was the original behavior anyway

Bug: 16316
Change-Id: Ief2396c65303a2226ad9fdd87969b667b2f1274d
Reviewed-on: https://code.wireshark.org/review/35720
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-10 04:59:07 +00:00
Gerald Combs e3a92cf8f6 Qt+Win32: Tell the user to install Npcap/WinPcap if needed.
If we don't have local interfaces on Windows, show a message in the main
welcome screen and link to Npcap and WinPcap. Use consistent wording
and layout in the macOS equivalent.

Change-Id: Ifc9ee2e29ba197667bd95f39390be5684bb334ae
Reviewed-on: https://code.wireshark.org/review/35724
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-10 04:58:45 +00:00
Gerald Combs 999e63543f Qt: Add elements back to the tcptrace graph.
Segment and SACK elements in the tcptrace graph are plotted using
QCustomPlot's error bars. This part of QCP's API changed from version 1
to 2, and were #ifdef'ed out as part of the switch to QCP 2.0.1. Update
our code to use the new API.

Bug: 16281
Change-Id: Ieae2808686ddc631e0cd18c0c32fc7a2c0f396b7
Reviewed-on: https://code.wireshark.org/review/35726
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-10 04:57:52 +00:00
Roland Knall 936a844cc3 Qt: Fix PacketListHeader column
Due to changes in #35206, if you have a lot of columns the display
of all columns may be hindered depending on your screen resolution.

With this change, displaying the column information can be disabled
via a Preferences->Layout checkbox element. Additionaly, the column
information will always be displayed as a tooltip element

Bug: 16317
Change-Id: Ib8c0fc0a84deaca96631270b320f3a530ba87d89
Reviewed-on: https://code.wireshark.org/review/35706
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-01-09 12:32:34 +00:00
Pascal Quantin 23a6fab52e Qt: remove codecs from about Wireshark dialog
Codecs were moved to plugins in g63af1da7e7, they are no more embedded in a library.

Change-Id: Id5448d2f83b1b4f7b1aac2620390f99da9327167
Reviewed-on: https://code.wireshark.org/review/35701
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
Petri-Dish: Pascal Quantin <pascal@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-09 07:15:11 +00:00
Jirka Novak 3b781dbab5 rtp_player_dialog: Route audio for a stream to left/right speaker in RTP player
Column 'Play' added to player. Double click on a stream in the column changes
audio routing for the stream.
When soundcard supports only one channel, there are Mute/Play option. When
soundcard supports two or more channels, there are Mute/L/L+R/R options.
Muted channel is drawn with dotted line.

Change-Id: If120c902195da46f98a1663c589f20c6a1da0ba7
Reviewed-on: https://code.wireshark.org/review/35687
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-08 11:50:16 +00:00
Gerald Combs 6785c9ad04 Qt: Don't plot zero values in I/O scatter plots
We don't currently distinguish between missing and zero values in I/O
graphs. This can be problematic in scatter plots since the plot points
tend to show up as chartjunk which overwhelms the X axis. In plain,
non-calculated plots assume that zero values mean "missing" and omit
those points.

Describe this in the User's Guide, but comment the text out for now
pending a full update to the I/O Graph section.

Switch to title case in our default graphs. Make the TCP Errors graph
red by default.

Change-Id: I92dcbf05f58ae0b7b7734fa8dfc342424bbea114
Reviewed-on: https://code.wireshark.org/review/35645
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-07 12:42:48 +00:00
Jirka Novak 71fb8bebfe rtp_player: Player is able to set start of audio play by double click
Patch adds ability to set start of audio play by double clicking on waveform.
Patch fixes unreported issue with placing waveform at incorrect place when switched relative/absolute time mode (check/uncheck Time of Day).

Change-Id: Ib8ce24aea870e2443e033afbb6d6e9fbcf222431
Reviewed-on: https://code.wireshark.org/review/35621
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-07 09:38:14 +00:00
Jirka Novak c1f5b4d2d9 rtp_analysis_dialog: Improved codec recognition during saving of audio to .au
I found that when codec is negotiated to nonstandard payload id, it was
reported as unsupported even was supported. Patch fixes it.

Change-Id: I4eb14fc22f83eb42300fc67baee8456dff65d191
Reviewed-on: https://code.wireshark.org/review/35575
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-07 09:18:59 +00:00
Jirka Novak 888137161c voip_calls_dialog/voip_calls: Fix for duplicated entries after retap
Issue seen from 2.6:
1) Open pcap with any VoIP call
2) Open Telephony->VoIP calls
3) Select one or more calls
4) Press Flow Sequence - sequence is shown
5) Close Flow Sequence
6) Press Play Streams - Play dialog is shown
7) Close Play dialog
8) Press Flow Sequence - sequence is shown, but all entries are duplicated

If you repeat 6-7 multiple times, all entries are shown multiple times in 8

Patch adds missing clear of graph_analysis before retaping the stream.
Tested on master, but should be backported to as many stable branches as possible.

Change-Id: I9793f6e874defde2f377732d78689e957df71b33
Reviewed-on: https://code.wireshark.org/review/35672
Petri-Dish: Jim Young <jim.young.ws@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-07 04:46:43 +00:00
Dario Lombardo 2060e02021 Qt: don't use monospace fonts for licence dialog.
Authors and licence dialogs were using monospace fonts to resemble
GTK interface. Authors is not monospace anymore. Not using monospace
for license dialog makes the text look more similar to other dialogs
and more readable.

Change-Id: I5a62f0993d579af5b1db7dea351d9a10175a069d
Reviewed-on: https://code.wireshark.org/review/35663
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-01-06 22:59:35 +00:00
Jirka Novak 17cd230a03 voip_calls_dialog: avoiding of 'remove_tap_listener(): no listener ...' warning
When voip_calls_dialog is opened and then closed, mentioned warning is shown
because voip_calls_remove_all_tap_listeners is called twice in two different
methods. Removing of the call from one of method is not possible therefore
I introduced variable which tracks whether voip_calls_remove_all_tap_listeners
was already called or not.

Change-Id: Ic3c206cb7baf6612958d383880af296af019ffd8
Reviewed-on: https://code.wireshark.org/review/35660
Petri-Dish: Jim Young <jim.young.ws@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jim Young <jim.young.ws@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-01-06 09:07:20 +00:00
Gerald Combs b401c92615 [Automatic update for 2020-01-05]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I871629b91d38be26bfe448bf90dfbb47a97acdfa
Reviewed-on: https://code.wireshark.org/review/35652
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-01-05 08:20:10 +00:00
Gerald Combs e0a4e0e123 Qt: Update translations.
We added wireshark_es.ts in gd832145366 / change 35620. Sync up with
Transifex by running `tools/update-tx`.

Change-Id: I3e565cbc227b124e79bc759ab6a6a095fed8ce5d
Reviewed-on: https://code.wireshark.org/review/35635
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-01-03 17:24:17 +00:00
Gerald Combs d832145366 Qt: Add Spanish (es) translation assets.
Add an initial "es" Qt translation file and an accompanying flag image.
The image came from

https://en.wikipedia.org/wiki/File:Flag_of_Spain.svg

and is in the public domain.

(We already had a debian/po/es.po.)

Change-Id: I5378ad2cbffb2267389fc8ae6af6d591071e0144
Reviewed-on: https://code.wireshark.org/review/35620
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-01-03 08:27:21 +00:00
Jirka Novak 8a3572997f codecs API: Added description of API usage
Added API description clarifies when bytes/samples are used. New variable names
proposed and all existing codecs are adapted to it. Change is just renaming...

Change-Id: I75dba64a49eb3f4369ec7160cb793dda4b44c810
Reviewed-on: https://code.wireshark.org/review/35576
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
2019-12-30 15:41:00 +00:00
Gerald Combs 4d14586385 [Automatic update for 2019-12-29]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: Iedf3b088beab75195cbf442854b1cae4d675db95
Reviewed-on: https://code.wireshark.org/review/35580
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-12-29 08:20:13 +00:00
Gerald Combs 17492b8a6b Qt: Use a neutral tone in an error message.
Don't yell at the user.

Change-Id: Ibedb0a1bf7ea13feeaf6fe4f2c78bd7f3d1e65b8
Reviewed-on: https://code.wireshark.org/review/35572
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2019-12-28 08:04:09 +00:00
dennisschagt b21276d9a0 Qt: Create directories recursively
Bug: 16143
Change-Id: Ibdd888157919315775637eb639158ea2e6cb26f0
Reviewed-on: https://code.wireshark.org/review/35561
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-12-25 22:44:53 +00:00
Alexander Meier 63a954320f Additional styles for IO Graph
This patch adds the styles Cross, Plus and Circle to IO Graph.

Change-Id: I72ff0134cd34a7e9b88a3e9c6a685526a0bca1db
Reviewed-on: https://code.wireshark.org/review/35555
Petri-Dish: Jim Young <jim.young.ws@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jim Young <jim.young.ws@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2019-12-24 13:38:24 +00:00
Gerald Combs 4df2bd988d Qt: Fix the Capture File Properties dropped format.
Fixup the formatting for the "Dropped packets" portion of the Capture
File Properties dialog. Fix a couple of other issues flagged by clang.

Change-Id: Ia1fad4bee37525a1a0cc25849abe34a0495f1ac8
Reviewed-on: https://code.wireshark.org/review/35552
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-12-23 18:16:17 +00:00
Jim Young 31570163d1 Revert "Qt: Fix dangling delete for sequence diagramm"
This reverts commit aa2145982f.

Each of the three delete calls added to the deconstructor
SequenceDialog::~SequenceDialog() results in Wireshark
crashing when the Flow dialog is closed.

Bug: 16260
Change-Id: Iecbd5dcc16be6eb451b8920b22ca2b9ccef7c7b0
Reviewed-on: https://code.wireshark.org/review/35521
Petri-Dish: Jim Young <jim.young.ws@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-12-22 12:08:44 +00:00
Orgad Shaneh 0442f7a2c3 UI: Fix compilation with Qt 5.14
Change-Id: I8adae4609ff2857cb12bc803839ebb2c6afbd264
Reviewed-on: https://code.wireshark.org/review/35517
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-12-21 20:25:51 +00:00
Michael Mann 2925fb0850 Use g_file_open_tmp within create_tempfile
Much better to use a known library than create it ourselves.

Also remove get_tempfile_path as it's not used.

Bug: 15992
Change-Id: I17b9bd879e8bdb540f79db83c6c138f8ee724764
Reviewed-on: https://code.wireshark.org/review/34420
Reviewed-by: Tomasz Moń <desowin@gmail.com>
Petri-Dish: Tomasz Moń <desowin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-12-20 19:26:38 +00:00
Huang Qiangxiong 623b347d1e Protobuf: add dissecting protobuf fields as wireshark fields preferences, etc.
Two enhancements and one fixed bug:

1. Add dissecting protobuf fields as wireshark (header) fields preferences. User
can input the full names of protobuf fields or messages in Filter toolbar for
searching.

2. Add 'protobuf_field' dissector table. Dissector based on protobuf can register
itself to 'protobuf_field' keyed with the full names of fields of BYETS or STRING
types.

3. A bug about search MESSAGE or ENUM type in context is fixed.

4. Another small enhancement is adding prefs_set_preference_effect_fields() which
can mark a preference that affects fields change (triggering FieldsChanged event).

See the linked bug for sample capture file and .proto files.

Ping-Bug: 16209
Change-Id: Ibc3c45a6d596a8bb983b0d847dd6a22801af7e04
Reviewed-on: https://code.wireshark.org/review/35111
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-12-19 05:04:17 +00:00
Gerald Combs b044c5f1de Qt: Don't crash when disabling all protocols.
Ensure that a protocol can be disabled before attempting to do so. Fixes
crash described at
https://ask.wireshark.org/question/13573/wireshark-crashes-in-the-enabled-protocols-dialog-box/

Change-Id: Ib774bb6d636e82b79c5a922272a39126da85b71d
Reviewed-on: https://code.wireshark.org/review/35489
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-12-18 17:34:24 +00:00
Gerald Combs d614ade782 De-camel-ize "Wireshark" in a few places.
The _wslua_main struct / WireShark class appears to have never been
used, so remove it.

Change-Id: Id80fb2c2065accedf632ea4cc467d566d10870de
Reviewed-on: https://code.wireshark.org/review/35480
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-12-18 04:31:03 +00:00
Peter Wu 5cfd8bca95 CMake: fix CMake 3.16 warning about CMP0071
Prevent a file from being processed by moc/uic as it is not needed. This
addresses a new CMake warning "Policy CMP0071 is not set: Let AUTOMOC
and AUTOUIC process GENERATED files."

Change-Id: I8ed458099cdf29472dad29168786cf16b95595fa
Reviewed-on: https://code.wireshark.org/review/35468
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-12-17 00:10:26 +00:00
Jim Young 8fbe28b1f0 profiles: Try to better sync on disk config state
Profile specific column settings are split across the `preferences'
file and the `recent' file.  At any given moment the GUI column
settings held within the `preferences' file and the `recent' file
may be inconsistent with one another and with the GUI itself. These
inconsistencies occur because of when the GUI chooses to write
config changes to disk.

If Wireshark is not shutdown gracefully (for example when killed
or should crash) the column preferences saved on disk may not be
consistent between the current profile's `preferences` and `recent`
files and the most recently used profile may not be recorded within
the `recent_common' file. On restarting Wireshark these config file
inconsistencies can lead to unexpected artifacts.

Normally the column config state saved within the current profile's
`preferences' and `recent` files are made consistent when a
different profile is selected or when Wireshark is closed
gracefully.

This patch set attempts to improve the constancy of the on disk
config state with the GUI state by invoking the functions to write
the `recent' and `recent_common' files in a more timely manner.

Fix a typo while here.

Change-Id: I2af9d9eb2dcf9cc0d422e9840aa05f4f6b1aa086
Reviewed-on: https://code.wireshark.org/review/35407
Petri-Dish: Jim Young <jim.young.ws@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jim Young <jim.young.ws@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-12-16 05:34:28 +00:00
Jaap Keuter d90a22c1cc Reorganize long option values
For long options, without corresponding short options, to be processed
they need to be assigned a value, preferably outside of the range of
all possible short options. The code in various places tries to stay
clear of these low values, but further coordination is missing, easily
leading to issues when option processing code gets extended and/or
reorganized.

This change introduces a single location from where each catagory of
command line long option can derive a base value, which should minimize
potential option value collisions.

Change-Id: Ic8861a347d0050f74002de3aa1fcfb01202866e5
Reviewed-on: https://code.wireshark.org/review/35459
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-12-15 20:02:09 +00:00
Gerald Combs effe6ddaca [Automatic update for 2019-12-15]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: Id1d9cd2c1f311247df53f41397169ce0490bf7a7
Reviewed-on: https://code.wireshark.org/review/35443
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-12-15 08:20:38 +00:00
Jaap Keuter abd83d9961 cmdline: cleanup option string definitions
Option string composition has grown organically over time and is
depending on compilation options also. This results in somewhat complex
macro definitions and the use of the string concatenation feature of the
C compiler. This change tries to clean up some of this magic by removing
definitions of empty strings and merging of adjacent strings.

Change-Id: I968449ea9b564915bee468a0cac0e114983ceebe
Reviewed-on: https://code.wireshark.org/review/35429
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-12-13 22:29:01 +00:00
Gerald Combs 90e80ac6af Qt: Add some null checks.
Add some null checks identified by scan-build. Switch some dynamic_casts
to qobject_casts.

Change-Id: I2b97ee8cb71db4fc883b4081568f9a5db8af85b3
Reviewed-on: https://code.wireshark.org/review/35403
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-12-11 05:12:17 +00:00
Gerald Combs c5093fb227 Qt: Remove a comment.
Remove a comment that's no longer relevant as of g14e4759b56.

Change-Id: I919631810c37e34ebc0cf5b78ab4dfbee5f5c687
Reviewed-on: https://code.wireshark.org/review/35390
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-12-10 16:37:44 +00:00
Gerald Combs 14e4759b56 Qt: Bump our minimum Qt version from 5.2. to 5.3.
Change-Id: Id6b39125a56b95b94d6a0bb6436bf7b2d131f924
Reviewed-on: https://code.wireshark.org/review/35385
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-12-10 08:48:57 +00:00
Gerald Combs 50713161c3 Win32: Remove win32_save_as_statstree.
win32_save_as_statstree was GTK+-only.

Change-Id: Ief029cd1a702b0c17d9602bee8a2d75ee4c3c393
Reviewed-on: https://code.wireshark.org/review/35384
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2019-12-10 01:05:43 +00:00
Gerald Combs dc19356be2 Win32: Fixup our file dialog titles.
Add a "title" argument to each of the Win32 file dialog routines, and
pass in one constructed using wsApp->windowTitleString.

Change-Id: I5ff862bd28cd16093d99ae1559ecbaca907350da
Reviewed-on: https://code.wireshark.org/review/35383
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2019-12-10 01:04:47 +00:00
Dario Lombardo d884ff2cdc Qt: fix wrong checks.
If actions_ is NULL, it will be dereferenced in the next check.
Found by clang.

Change-Id: I11f1620fae0e330dbbb7e0cc57b398f473261899
Reviewed-on: https://code.wireshark.org/review/35373
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2019-12-10 01:01:53 +00:00
Gerald Combs ef67401c33 Win32: Remove some unused code.
Remove some code that's been #if 0'ed out since 2006 and 2012. Include
file.h instead of globals.h.

Change-Id: Ib4a84c03e112d732b25df4b7b26b54e029f717a4
Reviewed-on: https://code.wireshark.org/review/35378
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2019-12-10 01:00:18 +00:00
Gerald Combs 7c883dd771 Win32: Factor out win32_check_save_as_with_comments.
Stop using win32_check_save_as_with_comments and just use the
Qt equivalent on Windows. It started out as a static funtion in
file_dlg_win32.c and using the native Windows event loop may have been
required for GTK+, but neither of those apply now.

Change-Id: I66d7f1c6346df65b0fadb3aa9cba823c0e457703
Reviewed-on: https://code.wireshark.org/review/35382
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2019-12-10 00:59:00 +00:00
Gerald Combs fe647fb085 Win32: Fix the Export Packet Dissections dialog title.
Change-Id: I25c40511b369ce93e1be2887488fc5389fdafd07
Reviewed-on: https://code.wireshark.org/review/35346
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-12-08 15:05:09 +00:00
Gerald Combs 3bf0163506 [Automatic update for 2019-12-08]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I0e2ac1a7ba3c512926a8a66255416ef74dc59591
Reviewed-on: https://code.wireshark.org/review/35348
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-12-08 08:20:44 +00:00
Jim Young 1e3db49f05 recent.c: cfield might be NULL
Avoid crash in GUI when using Edit Column widget.

Bug: 16245
Change-Id: Ic98be3f98144dcfa9796fadd142180e3aaf84a9e
Reviewed-on: https://code.wireshark.org/review/35301
Petri-Dish: Jim Young <jim.young.ws@gmail.com>
Reviewed-by: Jim Young <jim.young.ws@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Craig Jackson <cejackson51@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-12-06 21:24:41 +00:00
Gerald Combs 839e615fcb WSUG: Update the capture chapter.
Update the capture interface and options portions of the capture
chapter.

Change-Id: Ie50731264dacba2663e1de8ae5fdda7f5fbae1e9
Reviewed-on: https://code.wireshark.org/review/35281
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-12-05 05:36:43 +00:00
Gerald Combs 7be2d964f0 Qt: We show preference panes using their module names.
PreferencesDialog::setPane takes a preference module name. Fix a
comparison in PrefModuleTreeView::setPane and update some variable names
in order to make things a bit more obvious.

Modernize some related code while we're here.

Bug: 16250
Change-Id: I8f4c7e5261a219e3f32e6e9a71574d81b1852219
Reviewed-on: https://code.wireshark.org/review/35304
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-12-04 20:31:59 +00:00
Michael Mann e253e62750 Use human-readable numbers for conversation stats
Bug: 15360
Change-Id: Iceaa5c2336cfb58966ef12f4267fcd09ae48bfe7
Reviewed-on: https://code.wireshark.org/review/31234
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-12-03 03:17:52 +00:00
Gerald Combs 997e21d1e9 Qt: Rename the Capture Interfaces dialog to Capture Options.
Rename Capture Interfaces to Capture Options to match its main menu
item. "Options" also more closely matches what the dialog actually does.

Fixup a help item URL while we're here.

Change-Id: Iec8bdfc9f7ae6fc4fd9e97bb366b63cff139f3a6
Reviewed-on: https://code.wireshark.org/review/35294
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-12-03 03:16:16 +00:00
Gerald Combs faf3118d45 [Automatic update for 2019-12-01]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I3baf4cf43786b1680c02514f10c526cf8dca8536
Reviewed-on: https://code.wireshark.org/review/35269
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-12-01 08:20:14 +00:00
Gerald Combs f6953e378a Qt: Remove a couple of private variables.
ByteViewText and ProtoTree only use mono_font_ in setMonospaceFont, so
there's not much use in declaring it private in each case.

Change-Id: I3ad986052f6e013988ce851420f7f6e7b47b7ea8
Reviewed-on: https://code.wireshark.org/review/35255
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-11-28 22:54:46 +00:00
Roland Knall 57d4161a66 Qt: Remove unneeded method
This is no longer needed, as it is handled by setMonospaceFont

Change-Id: I9834bcd1a188cd6f1cb8ad1abe568a9a50d831bc
Reviewed-on: https://code.wireshark.org/review/35253
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-28 15:54:37 +00:00
Peter Wu 2d12ec67a3 Qt: fix erratic expansion of tree item when switching packets
ProtoTree::setRootNode() is designed to update the model with the new
packet tree, and additionally expand tree items in its view. When the
current selected packet is changed, it must use this method to ensure
that collapsed trees are properly expanded. Fix this regression.

It was not entirely clear that framesSelected can no longer use previous
state, so document it explicitly. Remove the call to QTreeView::reset(),
it ends up calling QAbstractItemView::reset() which touches the
selection model that refers invalidated proto_node memory. The reset
function of the view is automatically called the model is reset, so the
call was not needed anyway.

Test: open test/captures/tls13-rfc8446.pcap, expand TLS, TLS Record, and
select "Content Type". Change from frame 1 to 2, and then 3. Observe
that the expanded state remains constant with no flickering. In frame 3,
observe that the tree remains expanded even if no item is selected.

Change-Id: I0c820711f1a62aa51ac100f8ac5c89265c51eb18
Fixes: v3.3.0rc0-6-gcfee0f8082 ("Qt: Remove frameSelect signal")
Reviewed-on: https://code.wireshark.org/review/35230
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-28 14:13:57 +00:00
Peter Wu 07a1753d44 Qt: focus the correct field when switching packets
Instead of just visually marking a field after switching packets, make
sure that it is also focused such that arrow up/down keys select the
expected fields instead of the root node (the Frame layer).

Change-Id: Ic16462198fb2189496f0cceeb5a5e885673636d2
Reviewed-on: https://code.wireshark.org/review/35236
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-27 06:35:13 +00:00
Gerald Combs f2dce23b40 Qt+macOS: Add /Volumes to the file dialog sidebar.
/Volumes is hidden on macOS, which means that it doesn't show up in Qt's
non-native file dialog. Add a constructor to WiresharkFileDialog that
adds /Volumes to the file dialog sidebar. Make CaptureFileDialog and
ExportDissectionDialog subclasses of WiresharkFileDialog.

Bug: 13840
Change-Id: I4d7da3948b203eb11fb64fa056eb42a448edf914
Reviewed-on: https://code.wireshark.org/review/35201
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-11-26 05:37:37 +00:00
Peter Wu 076334a70c Qt: fix packet selection when modifiers are pressed
When the Conversation Shortcut (Ctrl-1) was pressed, the current packet
suddenly became deselected. Similarly for Go to First Packet (Ctrl-Home)
and Go To Next Packet (Ctrl-.).

Changing the selection mode to ExtendedSelection has as side-effect that
setCurrentIndex is affected by modifiers such as Ctrl and Shift. Since
Ctrl acts as a toggle, the current selection becomes empty and no
packets are selected. Fix this by explicitly requesting the selection to
be replaced.

Tested as follows:

 1. wireshark -r test/captures/dhcp.pcap
 2. Select packet 3.
 3. Press Ctrl-1, Ctrl-2. (Colors change, the packet remains selected.)
 4. Press Ctrl-Home, Ctrl-Down, Ctrl-.
 5. Observe that the packet details list is populated.

Change-Id: I17f00e7fbc6e63ad52b6a0543fd850b473e506a2
Fixes: v3.1.1rc0-762-gb3f240dbf8 ("Qt: Multiselection in PacketList")
Reviewed-on: https://code.wireshark.org/review/35203
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-25 13:38:37 +00:00
Stig Bjørlykke 6433e12474 Qt: Show all column types in context menu
Show all column types in the column context menu to improve usability
even more when show/hide columns. This is a follow-up to the improvement
to show custom column field names.

Change-Id: I0838c7ae6eec59960a0a70b485c372855e242dc0
Reviewed-on: https://code.wireshark.org/review/35206
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-25 12:17:10 +00:00
Peter Wu 40897b0234 Qt: prevent inline completion from happening for filters
Commit v3.1.0rc0-1170-ga854811c4a replaced the deprecated
`setAutoCompletion(false)` call by `setCompleter(0)`. However, the
former has as side-effect that it prevents setLineEdit from creating a
custom completer. setCompleter on the other hand had no effect since
there was no existing completer.

To fix the issue, remove the completer after it is set by setLineEdit.
This has no effect on the completer from CaptureFilterEdit and
DisplayFilterEdit instances since they override the completer from
QLineEdit. To avoid any confusion, SyntaxLineEdit::setCompleter (and
completer) should probably be renamed, these are not used by QComboBox
since it is not marked as virtual method.

Bug: 16132
Change-Id: Iad619122eddb43eb4963347982bf65dacd29629b
Fixes: v3.1.0rc0-1170-ga854811c4a ("Qt: fix more more Qt 5.13 deprecation warnings")
Reviewed-on: https://code.wireshark.org/review/35198
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-25 12:16:34 +00:00
Peter Wu c9bb676118 Qt: fix crash on Next/Previous Packet in Conversation without selection
Protect against a NULL edt pointer. That can occur when the packet
details view is empty, e.g. when no packet is selected.

Bug: 16228
Change-Id: Ie9621db4b84b504e4d9cee2add5004df2e383970
Reviewed-on: https://code.wireshark.org/review/35204
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-25 06:42:54 +00:00
Peter Wu 27f9606932 Qt: fix display filter completion with few recent entries
If 1) the recent filters menu has less than 10 entries and 2) the cursor
position is not at the end of the filter, then completion would fail.
Additionally, pressing Enter on filters with syntax errors would also
end up being saved, unintentionally.

Fix these by disabling automatic addition of entries by Qt.

Change-Id: I612c6cb8f317beb5459919b5c65b837db6150d07
Reviewed-on: https://code.wireshark.org/review/35150
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-11-24 18:28:23 +00:00
Gerald Combs a700bb9acb [Automatic update for 2019-11-24]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: Ice92b8e00fdab9b0a3eccf817734cf08ea14fbe1
Reviewed-on: https://code.wireshark.org/review/35192
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-11-24 08:20:43 +00:00
Roland Knall 8f90446db5 Qt: Refactor ExportObjectsDialog
Add the following features:

- search now operates live (enter text changes the list live)
- filter by content-types
- Preview certain content types directly from the dialog

Change-Id: If47b64d475dd3e77485a28e8443a3e139e9bd1a4
Reviewed-on: https://code.wireshark.org/review/35182
Reviewed-by: Roland Knall <rknall@gmail.com>
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-11-22 05:10:16 +00:00
Jirka Novak 37f3c65ca5 rtp_analysis_dialog.cpp: save any supported codec as .au
Change improves Wireshark ability to save rtp streams. It allows a user
to save any supported codec with 8 kHz rate. In real, it means G.711 and
G.729 for now.
There is no hardcoded codec limitation during save anymore. If code detects
unsupported codec or rate during save, it replaces samples with silence and
reports it. Therefore any added codec in future will be supported.

Note to RTP saving:
RTP streams (there can be up to two of them for save) can contain multiple
codecs in each direction - some of it can be supported and some
unsupported. What should be exported then?
Till my patch save do not run and a user received nothing even part of stream
was OK/encoded with supported codec.
Therefore I managed the code to start with export and do its best.
Unknown codec/part is replaced with silence and user is warned after
export. Therefore a user will get:
a) audio - when all codecs are supported (no warning)
b) mix audio/silence - when some codecs are supported (warning)
c) only silence - when no codec is supported (warning)

BTW same output user sees/gets in RTP player for years.

Change-Id: Id938d419f5841af46d2d2d3ddfaf1ec9a0235bcc
Reviewed-on: https://code.wireshark.org/review/35105
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-21 16:06:49 +00:00
Roland Knall c55dd79d2c Qt: Further cleanup goToPacket
Change-Id: Idf98deb3f7c34adff8e58ea243c63aa094234f46
Reviewed-on: https://code.wireshark.org/review/35181
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-21 15:28:23 +00:00
Roland Knall 59ce14522b Qt: Fix nullpointer access
Due to changes with the frameSelect, this null pointer check
now fails or more on the point is more obvious. It was masked
previous

Change-Id: I11c3f3440e39742bce963d1ef8bdd27076baa700
Reviewed-on: https://code.wireshark.org/review/35177
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-21 12:05:56 +00:00
Roland Knall cfee0f8082 Qt: Remove frameSelect signal
As all frameSelect signals now transport a QList<int> of selected
frames, use this instead

Change-Id: I1888e45a4df997920aebde9706ca0ae803bdba03
Reviewed-on: https://code.wireshark.org/review/35176
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-21 10:59:05 +00:00
Gerald Combs 48725641c9 Qt: Remove a duplicate variable.
WiresharkDialog defines cap_file_, so there's no need to define it in
TrafficTableDialog.

Change-Id: I71e50da152de619fea71382400820990a05febc1
Reviewed-on: https://code.wireshark.org/review/35169
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-11-21 00:18:29 +00:00
Roland Knall f211624fa6 Qt: Display selected rows in overlay bar
Indicate all selected rows in the overlay bar for the PacketList

Change-Id: Icddf8607b59bde12701a7e7983df6acbf26e0d23
Reviewed-on: https://code.wireshark.org/review/35161
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-20 16:22:02 +00:00
Roland Knall 0d534873dc Qt: Speed up selection handling
Improve the speed for selection checks in PacketList and MainWindow

Change-Id: Ic3a413624463a798b5d13102965f75c7b1347b5f
Reviewed-on: https://code.wireshark.org/review/35160
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-20 16:21:51 +00:00
Mike78 b7ce4e3f7a Qt: Include Column Headings with Edit -> Copy -> Plain Text / CSV
Bug: 16215
Change-Id: Ie59aa354be055831055a294724f8d7b800d35d90
Reviewed-on: https://code.wireshark.org/review/35153
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-20 15:04:15 +00:00
Guy Harris 9de7cd9f03 Remove "..." from end of Edit > Copy > As XXX menu items.
"..." at the end of a menu item means "this pops up a dialog, asking you
for more information so it can do XXX"; those items just copy without
asking the user anything.

Change-Id: I8bc42a468d4c5605a27ae3414ecabd30ea97d87e
Reviewed-on: https://code.wireshark.org/review/35148
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-11-20 04:25:59 +00:00
Guy Harris 309bf5b547 Make sure Copy > As Text and Copy > As CSV add a final newline.
Bug: 16214
Change-Id: Idb691c1fbb33b2fabca5726c159b1f754668c1ae
Reviewed-on: https://code.wireshark.org/review/35147
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-11-20 02:46:45 +00:00
Guy Harris 141e2ffcf0 Note that Qt imposes a maximum frame number of 2^31-1.
Nothing in libwireshark limits frame numbers to 2^31-1 - they're stored
as unsigned ints and thus can go up to 2^32-1.  That doesn't fit with
the way QTreeView works, as the model is ultimately from a subclass of
QAbstractItemModel, and that uses ints, not unsigned ints, for row
numbers.

Change-Id: I174c3ccdb5e86ea5897643560936c301fcc78c54
Reviewed-on: https://code.wireshark.org/review/35141
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-11-19 22:03:52 +00:00
Guy Harris fc18fbd522 Raise a question in a comment.
In PacketList::selectedRow, will we ever have a current index but not a
selection model?

Change-Id: Ie4a4a78b836876d6a890b2a0a5e5cba2de02a870
Reviewed-on: https://code.wireshark.org/review/35140
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-11-19 21:22:34 +00:00
Roland Knall 193150fdb7 Qt: Fix compile order for PacketListRecord
Change-Id: I58f125d7d883652ac3de019bbf3b64986fd1c642
Reviewed-on: https://code.wireshark.org/review/35137
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-19 15:26:34 +00:00
Roland Knall c07aad1015 Qt: Speedup Packetlist
Make dataChanged more specific and remove unnecessary iteration
in case of recoloring

Change-Id: I1ee270623b1cb8ac3907a5d45d6a8c4c5027c322
Reviewed-on: https://code.wireshark.org/review/35135
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-19 14:18:11 +00:00
Roland Knall 1078904981 Qt: Remove unnecessary parent check
parent.column() will allways be -1, due to ::parent returning
QModelIndex() and therefore parent being invalid all the time.

Change-Id: Ibb0482b4204523dba71a2be4f078da4f11fcaf71
Reviewed-on: https://code.wireshark.org/review/35134
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-19 12:08:15 +00:00
Roland Knall effbcdcbfb Qt: Remove unused progress update
The progress update is no longer being used, due to the
fact that dissection is handled differently. Removing it,
as well as corresponding signals

The code was removed in https://code.wireshark.org/review/c/34679/

Change-Id: I043c4535ce3dbec66c5822ddbad8e648307d0738
Reviewed-on: https://code.wireshark.org/review/35133
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-19 11:55:16 +00:00
Roland Knall 962f8d0c7e Qt: Handle emptying selections
Clicking in an empty area of the Packet List to "unselect" the packet
selection, left one packet indicated as selected (by having a single
field active, but not highlighted). This is fixed, by selecting this
entry.

If the last line is being deselected, not index is set as active, as
it has been in previous versions of the Qt interface

Bug: 16216
Change-Id: Ib5353a7e59b09a4f816655e1dd65a20d6c6d1a13
Reviewed-on: https://code.wireshark.org/review/35132
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-19 09:37:06 +00:00
Gerald Combs 5b78bbfc02 Qt: Update ColorUtils::themeLinkBrush.
Qt 5.12.6 fixed the dark mode link color on macOS. Update themeLinkBrush
accordingly.

Ping-Bug: 15511
Change-Id: I9d89bf3ef9c8a9b8c14dc5f435b9cdbb30fca2aa
Reviewed-on: https://code.wireshark.org/review/35126
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-18 21:23:51 +00:00
Gerald Combs e8ef656842 Qt: Remove an unneeded connection.
Fixes

Change-Id: I259e5bea0d0475d1bbb0c584b125a4ea819dda64
12:31:07.342     Main Warn QObject::connect: No such slot AboutDialog::copyToClipboardTriggered() in ../ui/qt/about_dialog.cpp:300
12:31:07.342     Main Warn QObject::connect:  (sender name:   'copyToClipboard')
12:31:07.342     Main Warn QObject::connect:  (receiver name: 'AboutDialog')
Reviewed-on: https://code.wireshark.org/review/35129
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-18 21:23:08 +00:00
Roland Knall aa2145982f Qt: Fix dangling delete for sequence diagramm
Change-Id: I452bc718988dbb2f4dfbba037320b7b914efe380
Reviewed-on: https://code.wireshark.org/review/35120
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-17 23:32:45 +00:00
Roland Knall c8b0968c77 Qt: Drag and drop label text changed
The name was used instead of the filter

Change-Id: Id27d7ac45ecc9487183b33d56bea3f99290ce410
Reviewed-on: https://code.wireshark.org/review/35121
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-17 23:17:34 +00:00
Roland Knall 8633ca6a88 Qt: Correct drag and drop with column header
Drag and Drop used the wrong filter name, fixing by using the correct one
and re-establish the feature

Change-Id: I7b3722c8087b4af7f2ea74f833ea130cbec0d19e
Reviewed-on: https://code.wireshark.org/review/35118
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-17 22:44:48 +00:00