Commit Graph

3122 Commits

Author SHA1 Message Date
Guy Harris 8aa14236f8 Have the frame_tvbuff.c routines not use the global cfile.
Have the routines that create them take a pointer to a struct
packet_provider_data, store that in the tvbuff data, and use it to get
the wtap from which packets are being read.

While we're at it, don't include globals.h in any header files, and
include it in source files iff the source file actually uses cfile.  Add
whatever includes that requires.

Change-Id: I9f1ee391f951dc427ff62c80f67aa4877a37c229
Reviewed-on: https://code.wireshark.org/review/24733
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-08 08:31:41 +00:00
Guy Harris 797d2f6a87 Move the frame_set stuff back into the capture_file structure.
libwireshark now expects an epan_t to be created with a pointer to a
"packet provider" structure; that structure is opaque within
libwireshark, and a pointer to it is passed to the callbacks that
provide interface names, interface, descriptions, user comments, and
packet time stamps, and that set user comments.  The code that calls
epan_new() is expected to provide those callbacks, and to define the
structure, which can be used by the providers.  If none of the callbacks
need that extra information, the "packet provider" structure can be
null.

Have a "file" packet provider for all the programs that provide packets
from a file.

Change-Id: I4b5709a3dd7b098ebd7d2a7d95bcdd7b5903c1a0
Reviewed-on: https://code.wireshark.org/review/24731
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-08 03:32:25 +00:00
Gerald Combs 847585f938 More QVector fixes.
Change-Id: I710f9c9d5391a8f1252cc02fdd263a8dfedb31f6
Reviewed-on: https://code.wireshark.org/review/24730
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-12-08 02:22:00 +00:00
Gerald Combs 683087628b Qt: Fix ByteViewText compilation for Qt < 5.5.
Older versions of Qt don't let you pass a QVector to QVector::append.

Change-Id: I58d62c44aa915d4ffb8319e08db85eee069ecbb2
Reviewed-on: https://code.wireshark.org/review/24729
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-12-07 23:27:38 +00:00
Gerald Combs be8a400053 Qt: Use QTextLayout in ByteViewText.
Use QTextLayout to draw each line in ByteViewText instead of drawing
fragments ourselves. Build our pixel-to-byte-offset map when we draw our
first line, which should hopefully make it more accurate. This should
fix layout and hover issues on some systems.

Start moving common code to DataPrinter.

Mark prefs.gui_hex_dump_highlight_style GTK+ only.

Bug: 11844
Change-Id: Ifda16ae7dc1a5ea22570c0bfd0eb20cee621bfc9
Reviewed-on: https://code.wireshark.org/review/24717
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>
2017-12-07 19:00:35 +00:00
Gerald Combs 99ea13988d Qt: Speed up the splash overlay.
Instead of blurring the main welcome screen during startup, draw a dark
band under the progress bar. This reduces the startup time a bit here.

Port over a date check from the GTK+ UI.

Change-Id: I997d0fd2e4320702fe85ee2aea02ce835a423df9
Reviewed-on: https://code.wireshark.org/review/24711
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>
2017-12-06 00:46:38 +00:00
Gerald Combs abcb7ec875 Convert the file set dialog treewidget to a treeview+model.
Add a FilesetEntryModel and use it in FileSetDialog. This should be
faster than using a QTreeWidget. Move dialog updates and date
calculations out of the "add file" loop.

Bug: 11280
Bug: 14242
Change-Id: I702cef4fe91e739695fe805dc5e496bf3db411f1
Reviewed-on: https://code.wireshark.org/review/24708
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-12-05 18:27:23 +00:00
Martin Mathieson e5f884c8b0 Show retx prev and next framenum types as chevrons
Change-Id: I1641c70130a7562db9ea099770d8b5a7fe6e5532
Reviewed-on: https://code.wireshark.org/review/24676
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-04 05:51:55 +00:00
Martin Mathieson 5350fd741f RLC LTE graph: add comments clarifying tracer limitation
Change-Id: Ib6a79689ced9377b1ac00513810db2e86d26d83f
Reviewed-on: https://code.wireshark.org/review/24690
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-04 05:49:49 +00:00
Guy Harris ccc55bc80c Put the structure of a capture_file back in cfile.h.
The split isn't necessary now that epan no longer uses the capture_file
structure.

Change-Id: Ia232712a2fb5db511865805518e8d03509b2167f
Reviewed-on: https://code.wireshark.org/review/24693
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-04 05:35:36 +00:00
Guy Harris 1834dca365 Move the parts of a capture_file used by libwireshark to a new structure.
Embed one of those structures in a capture_file, and have a struct
epan_session point to that structure rather than to a capture_file.
Pass that structure to the routines that fetch data that libwireshark
uses when dissecting.

That separates the stuff that libwireshark expects from the stuff that
it doesn't look at.

Change-Id: Ia3cd28efb9622476437a2ce32204597fae720877
Reviewed-on: https://code.wireshark.org/review/24692
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-04 05:02:18 +00:00
Guy Harris eb8ffb74e2 Use cfile.h to define the capture_file type.
Have cfile-int.h declare the structure, and use it in files that
directly access the structure.

Have cfile.h just incompletely declare the structure and include it
rather than explicitly declaring it in source files or other header
files.

Never directly refer to struct _capture_file except when typedeffing
capture_file.

Add #includes as necessary, now that cfile.h doesn't drag in a ton of

Change-Id: I7931c8039d75ff7c980b0f2a6e221f20e602a556
Reviewed-on: https://code.wireshark.org/review/24686
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-03 18:54:37 +00:00
Gerald Combs 114c989fb3 [Automatic update for 2017-12-03]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I4a3a5f62e5024a4df19c12296ddd67012c9ff5c7
Reviewed-on: https://code.wireshark.org/review/24683
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-12-03 16:56:48 +00:00
Peter Wu bb4726abf2 Qt: fix crash when selecting field with composite data
The HTTP2 decompressed headers tab is composed from multiple TVBs, these
have a null "real_data" pointer. Do not access it directly but use an
accessor which Does The Right Thing™.

Change-Id: Ib974fed9782d60aa2b91e3e712ba737000b79b4b
Fixes: v2.5.0rc0-1627-g8a6ea0e454 ("Qt: Further cleanup ByteView")
Reviewed-on: https://code.wireshark.org/review/24658
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Alexander Gryanko <xpahos@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-11-30 02:53:34 +00:00
Martin Mathieson 52365a55e4 LTE L2 protocols: add FT_FRAMENUM_TYPE for most FT_FRAMENUM fields.
Missed out some that would probably result in too many links.
Added FT_FRAMENUM_RETRANS_PREV and FT_FRAMENUM_RETRANS_NEXT to enum,
these display as arrows like REQUEST and RESPONSE do.

Change-Id: I6e8d222955f2ba59a713e8a389837b55a1c7f262
Reviewed-on: https://code.wireshark.org/review/24600
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2017-11-29 21:21:09 +00:00
Peter Wu e29378b030 Qt: fix role check in AStringListListUrlProxyModel::data
Change-Id: I7c683449155f7dcb63731e6575cf92c30be78934
Fixes: v2.5.0rc0-1841-gd865871627 ("Qt: About Dialog move to QTreeView and fix copy")
Reviewed-on: https://code.wireshark.org/review/24637
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-11-29 03:53:26 +00:00
Guy Harris ae65dc20ea Report the actual *error* for CANT_GET_INTERFACE_LIST.
CANT_GET_INTERFACE_LIST does *NOT* mean "No remote interfaces found.",
as in "there are no remote interfaces"; a NULL return from
get_remote_interface_list() and an err value of 0 means that.
CANT_GET_INTERFACE_LIST means "something bad happened and the error
string says what it is".  Display that error string, so when people
report problems:

	https://github.com/the-tcpdump-group/libpcap/issues/666

they'll give the actual error message, and I'll fix my breakage of the
rpcap protocol negotiation:

	2972769d03

rather than just wondering what the problem was and asking the reporter
of the problem for more information.

Report anything other than "there are no remote interfaces" as an error,
not a warning.

Change-Id: Ia9381953d080e037254f21e47ee7ecc4619b7254
Reviewed-on: https://code.wireshark.org/review/24627
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-11-28 23:06:48 +00:00
Stig Bjørlykke 1e892a1db6 Qt: Small layout improvement in preferences
Make PacketList settings look like the StatusBar settings.
Remove unneeded QVBoxLayout.

Change-Id: Id1910b2cf4cc5d3ab52d2abd781045ad4033469a
Reviewed-on: https://code.wireshark.org/review/24618
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-11-28 21:09:58 +00:00
Michael Mann 9c6d2af0ae Qt: Add support for DCE/RPC in Decode As
DCE/RPC is a FT_GUID type, but has some special handling.  "Regular"
FT_GUID dissector tables still not supported.

Bug: 13122
Change-Id: I328776ffe5bbe87ecfbe6719f04d18b1b237a583
Reviewed-on: https://code.wireshark.org/review/24602
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-28 16:32:57 +00:00
Roland Knall d865871627 Qt: About Dialog move to QTreeView and fix copy
- Fix an issue, where the url was opened twice on Linux
- Make the filter case insensitive if so wished for
- Allow the copy to either copy the selected column (just Copy) or copy the complete row, with tab separation
- Move to QTreeView instead to make it similar to the rest of the tables

Change-Id: Ie6064f2ad2014e24546553c5febe63358e2f69ec
Reviewed-on: https://code.wireshark.org/review/24570
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jim Young <jim.young.ws@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-26 15:57:56 +00:00
Gerald Combs 9b7ad9c20e [Automatic update for 2017-11-26]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I2963633f86a87209eca574db52663ebbe732f9d9
Reviewed-on: https://code.wireshark.org/review/24590
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-11-26 08:16:20 +00:00
Martin Mathieson fdeaaa362a LTE MAC stats: make display filter field work
Change-Id: I76b97f4f67ba63f7479dffc1cf1267b39cefa4fa
Reviewed-on: https://code.wireshark.org/review/24582
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2017-11-25 15:35:28 +00:00
Stig Bjørlykke 89ae2826d6 Qt: AccordionFrame users keyPressEvent() fixes
- Declare keyPressEvent() virtual.
- Give keyPressEvent() to parent when done.

Change-Id: If1c05e86a5ab71dd239c025cdb2bcfb1ef484811
Reviewed-on: https://code.wireshark.org/review/24573
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-25 09:30:21 +00:00
Martin Mathieson e1f3d9dcbe LTE RLC Stats: make display filter field work.
Change-Id: Ic3c9ebb176bcc7c3973aca382c270aacac7283af
TODO: the same for LTE MAC Stats..
Reviewed-on: https://code.wireshark.org/review/24577
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-25 09:29:45 +00:00
Martin Mathieson cf110add65 RLC LTE stats: show UE and channel bw properly
Change-Id: I49edf405d61b15ba451f291c32b8fc3126a7e9d7
Reviewed-on: https://code.wireshark.org/review/24575
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-25 09:05:42 +00:00
Roland Knall 1ecad01420 Qt: About - implement copy&paste and urls
Make the URLs clickable again, and allow the copy/paste of
selected entries via context menu

Change-Id: I619059ca77c54314df31364de8ee7fce9dbc3ed3
Reviewed-on: https://code.wireshark.org/review/24569
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-24 11:02:24 +00:00
Stig Bjørlykke b99677dea9 Qt: Add key event to reject changes in AddressEditorFrame
Also give focus to the name field.

Change-Id: I409d48e513c04b510f1e3d838c05e1518e6d2e9d
Reviewed-on: https://code.wireshark.org/review/24547
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-24 05:17:28 +00:00
Roland Knall 73c01d6d05 Qt: Rewrite the About dialog to use models
Rewrite of the about dialog, to use QTableView and Models
instead of HTML files.

Everything is now model based, and the model is generic enough
to support any variation which can be put into a QStringList row.

Change-Id: Ie32bf66b2fe2a7754c0bf07205a7b068d46b0070
Reviewed-on: https://code.wireshark.org/review/24534
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-24 05:17:07 +00:00
João Valverde 8fa4a440a8 GTK: Remove packet editor
Removes limited experimental feature for deprecated UI.

Change-Id: Ib3ccfae89dd2a674ebbde346a442fa1cf6587f26
Reviewed-on: https://code.wireshark.org/review/24563
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-24 05:13:42 +00:00
Martin Mathieson e7b12d8550 LTE RLC graph: 'r' should reset, not zoom out
Change-Id: I34ad795b5c4f3f5d47b357d3af1de1f4b5fe481b
Reviewed-on: https://code.wireshark.org/review/24561
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-24 05:12:01 +00:00
Michael Mann 76d7b7a519 Qt: Add menu option to remove all packet comments
Bug: 14186
Change-Id: I8793078ea50379b2f9697787e6b7a8ab2d9e3e0e
Reviewed-on: https://code.wireshark.org/review/24558
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-23 20:45:41 +00:00
Stig Bjørlykke 80424d135f Qt: Make InterfaceFrame use QFrame
It's no need for InterfaceFrame to use AccordionFrame.

Change-Id: Iccef1bcf919d7e5ec2bf818802ef68c1faf4e4a3
Reviewed-on: https://code.wireshark.org/review/24548
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-23 14:49:19 +00:00
João Valverde 7540ac6938 Move the protocol registration routines back into libwireshark
Follow-up to b695b3e2f7.

Change-Id: I7e36519f2c3806c1205d05437671325080974257
Reviewed-on: https://code.wireshark.org/review/24524
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2017-11-21 20:21:50 +00:00
Roland Knall 1470aeef4c Qt: Remove merge issue from Drag Drop
Remove a remissent merge artefact

Change-Id: I4c53d4b2adef124712091c40efccc1cad3db3301
Reviewed-on: https://code.wireshark.org/review/24521
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-21 09:50:39 +00:00
Stig Bjørlykke 90e236fd09 Qt: Main Welcome hover sparkline color fix.
Use the default text color for sparkline in hovered items.  This makes
the selected item look the same as non-selected items when hovering.

This is related to g1ed38dc2.

Change-Id: I96ba349067cf7d398d11425cfa5ada5e5b4d587c
Reviewed-on: https://code.wireshark.org/review/24516
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-11-21 07:38:38 +00:00
Gerald Combs 23b6028e1d Qt: Remove an unused variable.
Change-Id: Iba1abe66cfa4d39e95cf85b9fc866789151127f9
Reviewed-on: https://code.wireshark.org/review/24517
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-11-21 00:23:12 +00:00
Gerald Combs dd562b503f Qt: Move the MIME init thread to WiresharkApplication.
The Qt 4.8 "Starting a Thread" document at
http://doc.qt.io/qt-4.8/threads-starting.html says,

"Note that you must create the QApplication (or QCoreApplication) object
 before you can create a QThread."

It looks like this changed some time around Qt 5.5 or 5.6, e.g.
https://codereview.qt-project.org/#/c/120793/, but just to be safe move
the MIME database initialization thread to WiresharkApplication. We
start reading the database later than I'd like, but it's still early
enough to make a difference here.

QMimeDatabase was added in Qt 5.0. Add version checks.

Change-Id: Ic80ebb8692e93b1e4aea7a8670f4fcf45e385b29
Reviewed-on: https://code.wireshark.org/review/24512
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-11-20 22:08:09 +00:00
Roland Knall 6917ec769e Qt: Fix various smalles issues with drag-drop
Cleanup adding a filter and implement some
sanity checks in the drop code

Change-Id: I1778be16abdea3f93ed11fc610962c4a23f10a2f
Reviewed-on: https://code.wireshark.org/review/24505
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-20 14:56:23 +00:00
Roland Knall 61bd626d5d Qt: Fix Activation of menus
Fixes the bug, where submenu items are not properly activated

Bug: 14232
Change-Id: I007010310dfa8a6c7eba3ba8cdf3eac74701b0ba
Reviewed-on: https://code.wireshark.org/review/24493
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-19 17:28:41 +00:00
Gerald Combs 1b79315aac [Automatic update for 2017-11-19]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I52c4830ef81733156fa4ce0de65330c8aacd8932
Reviewed-on: https://code.wireshark.org/review/24487
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-11-19 08:17:16 +00:00
João Valverde 1097e8020a autotools: Library build products don't need explicit cleaning
Change-Id: I5d68c05f2844d6c9ae486531b189dbf10bc09cff
Reviewed-on: https://code.wireshark.org/review/24484
Reviewed-by: João Valverde <j@v6e.pt>
2017-11-18 22:29:41 +00:00
Roland Knall 18d49f467d Qt: Properly reset the byteview
Reset the byteview on every load of a capture file, and on every
start/reset of a capture

Change-Id: I0edd30ffddc64484bc6f009d99dfc6fc1a3ceb59
Reviewed-on: https://code.wireshark.org/review/24468
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>
2017-11-18 07:23:48 +00:00
Gerald Combs 658578a5b9 Qt: Initialize QMimeDatabase in a worker thread.
As part of its initialization, QMimeDatabase parses the freedesktop.org
shared-mime-info database, which is a large-ish (2 - 4 MB) XML file.
This takes about 85 - 90 ms here.

We first access QMimeDatabase in our startup sequence when we load the
normal and capture application icons. Create a worker thread that
initializes QMimeDatabase as early as possible and load load the normal
and capture icons as late as possible.

Change-Id: I27e3d65d8ee1308a62d12d3ff7e1b95f82c2e75a
Reviewed-on: https://code.wireshark.org/review/24471
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-11-17 20:26:27 +00:00
Roland Knall 71cec74ccb Qt: Fix selection of elements
If two elements existed with the same filter expression, the first
element got selected allways. This is much more secure, as it only
takes the label into account. If the user by accident created two
buttons with the same filter expression, but different label and
wants to remove the second button, the first one no longer will be
removed instead of the second one.

Change-Id: I16130aa69cb853aedb9a5c9b0bbbb3eb64b467d1
Reviewed-on: https://code.wireshark.org/review/24399
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-11-17 14:10:29 +00:00
Gerald Combs ac1d52aff5 Register protocols and handoffs in separate threads.
Instead of interleaving protocol registrations and status callbacks in
the main thread, move protocol registrations to a worker thread. Do the
same with protocol handoffs. This *should* be safe since the status
callbacks only update the UI.

This reduces startup time by about 200ms on my laptop:

Run     OS    Thread?    Time
  1   macOS      N      340 ms
  2   macOS      N      260 ms
  3   macOS      N      252 ms
  4   macOS      Y      147 ms
  5   macOS      Y      146 ms
  6   macOS      Y      142 ms
  7   Win 7      N       80 samples
  8   Win 7      N       56 samples
  9   Win 7      N       75 samples
 10   Win 7      Y       31 samples
 11   Win 7      Y        2 samples
 12   Win 7      Y        0 samples

macOS was sampled using Instruments. Windows 7 was sampled using the
Visual Studio 2015 profiler.

We should do the same thing with our capture and tap event loops, but
that will likely require quite a bit more work.

Change-Id: Iac9a81d8f71668f5979b524744a03f6d80aee893
Reviewed-on: https://code.wireshark.org/review/24447
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>
2017-11-16 06:11:55 +00:00
Stig Bjørlykke 665eb78729 Qt: Add UAT move up and down buttons
Add two new buttons for moving entries up and down in the list.

Change-Id: I90e5c5812754391651885e2a622148cecc124099
Reviewed-on: https://code.wireshark.org/review/24413
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-16 06:10:47 +00:00
Stig Bjørlykke 8d9fbdf851 Qt: Show as much as possible of UAT pathLabel
Remove the horizontal spacer between buttons an path label in UAT
views to show as much as possible of the path label.

Change-Id: I99d21ff6a1d151c9fcf83200a88b34b2e0c8eb5d
Reviewed-on: https://code.wireshark.org/review/24444
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-11-15 15:09:40 +00:00
Stig Bjørlykke 129ffaf11b Qt: Update UAT clear button enabling
Check for enabling the clear button when loading a UatFrame.

Change-Id: Id9bbe4f99314d2798c4bccf10b57db99431a00fd
Reviewed-on: https://code.wireshark.org/review/24412
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-11-15 07:21:31 +00:00
Roland Knall 7c40580584 Qt: Really fix the packet list selection
Really fix the selection of a row in the packet list

Change-Id: I87ab36146bd9b2a130f443717ce73609a1c0b656
Reviewed-on: https://code.wireshark.org/review/24397
Reviewed-by: Roland Knall <rknall@gmail.com>
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-13 05:20:52 +00:00
Roland Knall 58a44aef23 Qt: ToolbarMimeData and display
Implement the mime data for the toolbar in the same fashion as it
has been done for the drag-drop of the field filter.

Change-Id: I2b1ac7f82b637c999f458700c9ab24a9e4dcbcb8
Reviewed-on: https://code.wireshark.org/review/24378
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-12 22:17:29 +00:00
Stig Bjørlykke 3105382bed Qt: Show ByteView for first packet
Change-Id: Ie5b09f0ac8db0adb999633f3367339b8f50eabe9
Reviewed-on: https://code.wireshark.org/review/24395
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-11-12 19:47:12 +00:00
Stig Bjørlykke b5a1145cf1 Qt: Select correct packet from list
Change-Id: Id29d74506f7f009b7f14a86d8fc7c299711c4c2c
Reviewed-on: https://code.wireshark.org/review/24393
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-11-12 19:35:38 +00:00
Roland Knall e13e2df9a1 Qt: Rename packetSelection to frameSelected
In order to consolidate the interfaces between certain parts of the UI,
the signal emitted after a frame change has occured, has to include the
number of the frame. This led to two signals for frame change, and therefore
packetSelection is to be removed.

Change-Id: I24e0e0890291d2243935b0c48387beb66904bfa3
Reviewed-on: https://code.wireshark.org/review/24377
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-12 17:18:44 +00:00
Roland Knall 447291d84a Qt: Fix DragDrop on ProtoTree
Fix two issues, first that you could not move the scrollbar as it would
initiate a drag-drop operation. Second, if you start a drag-drop operation
at the top of a field, it would select the field you move over as well.

Change-Id: I553785b1b6c586919e025d3042a876701f36860d
Reviewed-on: https://code.wireshark.org/review/24376
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-12 15:07:54 +00:00
Roland Knall 8e5436687a Qt: Clear up the label
The modifier key is a hidden option for now, with the label only
showing the filter expression and the description

Change-Id: I4c983ed0d4fadbd69f0836ecfc85ea8e1109478e
Reviewed-on: https://code.wireshark.org/review/24379
Reviewed-by: Roland Knall <rknall@gmail.com>
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-11-12 12:28:25 +00:00
Roland Knall 98ca698a37 Qt: Add Modifier to drop only field
Add a modifier to the drag-drop operation, to only drop the field
name as filter, instead of the complete filter expression

Change-Id: I9da96906575397191e821e3494a42e0f10d51f45
Reviewed-on: https://code.wireshark.org/review/24375
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-12 10:49:08 +00:00
Peter Wu e95623cd6b Qt: do not crash when selecting a field without tvb
If no tvb is attached to a field, crashing is not the expected result.

Change-Id: Ica0e95326cfcfeb015016770d1b930a9f0447066
Fixes: v2.5.0rc0-1627-g8a6ea0e454 ("Qt: Further cleanup ByteView")
Ping-Bug: 14205
Reviewed-on: https://code.wireshark.org/review/24370
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-12 09:43:37 +00:00
Gerald Combs 5bd8fb4131 [Automatic update for 2017-11-12]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I18adb8aceae2a8962697284087d43e3b30d133f1
Reviewed-on: https://code.wireshark.org/review/24371
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-11-12 08:11:18 +00:00
Peter Wu bce5b50f73 Qt: Fix use-after-free crashes when changing packets
QTabWidget::clear() is documented to remove all tabs without deleting
them. As a result, findByteViewTextForTvb will still find ByteViewText
children with freed tvbs. Fix this by deleting the tabs too.

Change-Id: I5b4fdc7154a3804e3bd5f360749e95d178ffe580
Bug: 14199
Fixes: v2.5.0rc0-1532-g56a130a152 ("ByteViewText: Remove epan dependancy")
Reviewed-on: https://code.wireshark.org/review/24339
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-11-11 08:59:28 +00:00
Peter Wu 7cbbbe0bde Qt: avoid undefined behavior in ProtoTree::eventFilter
UBSan complains about "ev" being a "QEvent" rather than a QMouseEvent.

Change-Id: I9e59ffbe16df2ef20b7856e6dd2d9ef246632de6
Fixes: v2.5.0rc0-1608-g4d6454e180 ("Qt: Drag n Drop Filter expression from Packet Tree")
Reviewed-on: https://code.wireshark.org/review/24338
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-11-11 08:58:25 +00:00
Michael Mann cb7e896a4a Add frame number to packet comment dialog
Bug: 14185
Change-Id: I9f52999339d3c34502d4e046e22f05a83fa773bb
Reviewed-on: https://code.wireshark.org/review/24330
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-11-10 03:57:17 +00:00
Dario Lombardo 50b91d0b4d qt: add constructor to proto_tree (CID: 1420705).
Change-Id: I60a07ef6c8006ad8f4b6a5f25c2b4f2b1cb32766
Reviewed-on: https://code.wireshark.org/review/24326
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-11-09 19:57:54 +00:00
João Valverde 3bc743a9fd autotools: Fix build for unknown Qt interface
Change-Id: Ibba717da1fa6cf9b87fc1972e83b0e637e54fd80
Reviewed-on: https://code.wireshark.org/review/24324
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2017-11-09 17:19:08 +00:00
Stig Bjørlykke c57ab694ec Qt: Give focus to preference value in PreferenceEditorFrame
Select the preference value text and give focus when editing
a single preference.

Ping-Bug: 14191
Change-Id: I8d5f91c40118b9d74f1a65f5311aa92dfeb3e1b7
Reviewed-on: https://code.wireshark.org/review/24306
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-11-09 07:36:20 +00:00
Stig Bjørlykke 25c5d830c9 Qt: Give focus to Title in ColumnEditorFrame
Select the title text and give focus to the title when Edit Column.

Bug: 14191
Change-Id: I04fc5f6bcc830a15ef43fa2d06a1a729df52e370
Reviewed-on: https://code.wireshark.org/review/24305
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-11-09 07:35:48 +00:00
Peter Wu 35a1907fe6 iograph: Use default graph values if io_graphs UAT file doesn't pass validation
Change-Id: I70c8ca7b5b31d284a12220fc6ce2a764ea9fbe6b
Fixes: v2.5.0rc0-631-g5b3e3ee587 ("Use UAT model for I/O graph")
Reviewed-on: https://code.wireshark.org/review/23366
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-08 22:07:44 +00:00
Roland Knall 8a6ea0e454 Qt: Further cleanup ByteView
This further separates ByteView and the rest of the system.

Using FieldInformation and DataPrinter, this is the final cleanup
of the ByteViewTab

Change-Id: If41521167527cf5664c2564cdd0d45fea0f3f612
Reviewed-on: https://code.wireshark.org/review/22783
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-08 20:20:31 +00:00
Roland Knall 4a1f8f5f27 Qt: ReleaseNotes and reformatting of Drag n' Drop
Added ReleaseNotes and changed the representation

Change-Id: Ica927368ef6c5d912a29e06733ad0a95e1886077
Reviewed-on: https://code.wireshark.org/review/24291
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-11-08 08:58:29 +00:00
Roland Knall 96735846be Qt: Clean Drag-n-Drop Mimetype for toolbar
Cleans up the mime type to use a class instead of a mimetype
string

Change-Id: I122ba9b39de86d8e263f2204715911a2b0ac75cd
Reviewed-on: https://code.wireshark.org/review/24286
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-08 07:26:03 +00:00
Roland Knall 4d6454e180 Qt: Drag n Drop Filter expression from Packet Tree
Drag and Drop a field from the packet tree to the displayfilteredit
or the toolbar and drop it there to either apply the filter (or prepare
it by holding down the Shift key) or create a new toolbar button

Change-Id: I42645a02223c71315e91e0d58eb1b54ebab4fd58
Reviewed-on: https://code.wireshark.org/review/24280
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-08 07:25:54 +00:00
Paul Offord d84d43372c Improvement to plugin_if_get_ws_info(...) functionality
A plugin can register an initialisation function to be called each time
Wireshark opens a new capture file. If plugin_if_get_ws_info(...) is
called from within the initialisation function it does not return the
name of the file being opened.  This is because
plugin_if_get_ws_info(...), through calls to a number of other
functions, gets the file name details from a capture_file structure.  At
the time of the call to the plugins initialisation function, the
capture_file structure in question has not yet been created.

This change ensures that if plugin_if_get_ws_info(...) is called from a
plugin's initialisation function, the name of the file to be open is
correctly returned. The change also fixes a bug where
plugin_if_ws_get(...) returns an incorrect file state if called from a
plugin initialisation function.

Bug: 14165
Change-Id: I28c85e480db96852e11bbaa14fb1f434b457ed52
Reviewed-on: https://code.wireshark.org/review/24251
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-07 11:50:23 +00:00
Simon Barber fa2649ac61 wireless_timeline: fix blank display
Sometimes when a file opens the timeline does not display, also sometimes when
zooming it disappears.

Change-Id: I141eaef5f332a1de9af133abbeccede7c1cf5502
Reviewed-on: https://code.wireshark.org/review/24209
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-11-07 10:39:24 +00:00
Roland Knall 68ead1d025 Qt: Fix drag-n-drop in toolbar
Fixing two crashes in the toolbar, first one only appeared on mac,
the second one happens every time the toolbar is removed or updated

Change-Id: Ic3075a5af1b4a566e09bbce9712c968c053cc727
Reviewed-on: https://code.wireshark.org/review/24244
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-05 08:28:10 +00:00
Gerald Combs aed3e66672 [Automatic update for 2017-11-05]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I4abb96429b1ad8c6d78a129efd453f3019669f4f
Reviewed-on: https://code.wireshark.org/review/24245
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-11-05 08:16:13 +00:00
Roland Knall 649c81b83c Qt: ByteViewTab Fix tabs creation
Fix creation of tabs

Change-Id: I11b22a3964f7c25c0c88b8ecd4eec1ad480fe800
Reviewed-on: https://code.wireshark.org/review/24202
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-10-31 14:45:21 +00:00
Roland Knall 56a130a152 ByteViewText: Remove epan dependancy
Remove all dependancy for the byte_view_text from the epan system,
and therefore cleanly separate data and display for further separation
of dissection and view

Change-Id: Id1ee91b93da4511afa95f24da4cbbf39cbb89b1f
Reviewed-on: https://code.wireshark.org/review/24050
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-10-31 11:42:21 +00:00
Michael Mann 63966ec5d5 Use endpoint_type in conversation tables and hostlists
Follow up to having conversions use endpoint_type instead of
port_type.

Change-Id: Ifd59a33bd8b9a013c242bce5fcceb09533f02c17
Reviewed-on: https://code.wireshark.org/review/24172
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-29 20:17:03 +00:00
Gerald Combs 930f634515 [Automatic update for 2017-10-29]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: Ia316bd89a4a8d08237b0e5eb9f0036dc5a6bad61
Reviewed-on: https://code.wireshark.org/review/24157
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-10-29 08:18:13 +00:00
Michael Mann 7dbc520d57 Privatize the conversation_key structure
The intention is to make it more transparent when making a switch
to an "endpoint" over address/port combination.

Change-Id: Ic424c32095ecb103bcb4f7f4079c549de2c8d9c4
Reviewed-on: https://code.wireshark.org/review/24148
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-28 19:22:24 +00:00
Michael Mann 23afd9a184 Convert to using find_conversation_pinfo where appropriate
This makes it easier to identify the simpler/common conversations

Change-Id: I7094f23e49156ee27f5f72c8e130308470f3e462
Reviewed-on: https://code.wireshark.org/review/24145
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-28 14:33:11 +00:00
Michael Mann 087faa2488 Always provide value for Decode As selector column
Previous logic required multiple values from the decode as structure in
order to provide an initial value.  This was incorrect and led to
values from protocol not selected showing in the selector column.

Change-Id: If1ad5085f4a6eb8d79fc5dd72be968188051ec4e
Reviewed-on: https://code.wireshark.org/review/24122
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-28 00:24:42 +00:00
Guy Harris 458c3c026e Add a ws_in6_addr typedef for struct e_in6_addr.
That allows a parallel typedef of ws_in4_addr for guint32.

Change-Id: I03b230247065e0e3840eb87635315a8e523ef562
Reviewed-on: https://code.wireshark.org/review/24073
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-10-26 08:50:34 +00:00
Eldon Stegall c7918da8a6 Improve http object export for URLs with long extensions
This allows the export of objects with extensions that may be longer
than the allowed file name of an export (due to underlying filesystem, etc).
The extension detection mechanism previously preserved everything in the file
name after the final ".", but in some cases (especially with long query strings)
this would exceed the allowed maximum file length, and simply refuse to export
the object. Now, if the length of the extension and duplicate number is longer
than the allowable file length, the extension is ignored, and the entire string
is truncated to allow an acceptable export filename.

Bug: 14130
Change-Id: I6fa0281519d031c07a9ac621002ac328f34f54cc
Reviewed-on: https://code.wireshark.org/review/23960
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>
2017-10-23 04:42:51 +00:00
Michael Mann 182d9deb08 Add "Apply as filter" button to Coloring Rules Dialog
Add a button to apply currently selected color as the display filter.

Bug: 14100
Change-Id: Ife3edeb577075f1fe30b649a5655ef5887684d8a
Reviewed-on: https://code.wireshark.org/review/24012
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-22 21:34:55 +00:00
Gerald Combs ce3ce9e70e [Automatic update for 2017-10-22]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I973703f2a82c96e47ec15512e223766404a6d3a1
Reviewed-on: https://code.wireshark.org/review/24021
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-10-22 17:06:16 +00:00
Gerald Combs b0432442c6 [Automatic update for 2017-10-22]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I2bc1e987630e05d2942e9405ab45e4c2f7452263
Reviewed-on: https://code.wireshark.org/review/24013
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-10-22 08:13:34 +00:00
Michael Mann 61380f9504 Add button in Qt UAT dialog/frame to remove all UAT entries at once.
Change-Id: If5a172cd69beeb0b9a22eb7f6b9e7cb25f350b49
Reviewed-on: https://code.wireshark.org/review/23968
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-21 16:33:03 +00:00
Peter Wu 0088d010ed Qt: fix crash after loading SRT dialog
TapParameterDialog::on_applyFilterButton_clicked first calls fillTree to
populate the table and endRetapPackets to add the results to GUI. The
table data must remain valid until closing the dialog since the user can
still interact with the GUI.

Change-Id: Ie3105be78d39c562af52f2b49081552063afcada
Ping-Bug: 14141
Reviewed-on: https://code.wireshark.org/review/23994
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-20 12:13:02 +00:00
Peter Wu 4273eced0c cmake: fix Qt build with CMake 3.0.0 and 3.0.1
AUTOUIC fails to generate some ui_*.h files because of a bug that was
fixed in CMake 3.0.2: https://cmake.org/Bug/view.php?id=14981

Change-Id: I964d991c7edefcea55ae43b0768a7fd3503f94a9
Fixes: v2.5.0rc0-1366-gdfa893b1cf ("cmake: set CMAKE_AUTOUIC and CMAKE_AUTORCC to avoid CMP0071 warning")
Reviewed-on: https://code.wireshark.org/review/23993
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-10-20 03:00:57 +00:00
Peter Wu dfa893b1cf cmake: set CMAKE_AUTOUIC and CMAKE_AUTORCC to avoid CMP0071 warning
CMake 3.10 adds CMP0071 which results in warnings about applying AUTOMOC
and AUTOUIC on generated files. It somehow tries to do this for files
generated by QT5_ADD_RESOURCES and QT5_WRAP_UI.

As a workaround, just convert from the legacy macros to the new method.
Autogenerated ui_*.h and moc_*.h will now also be shown in the "External
Dependencies" tab in Visual Studio

Change-Id: I36df2212bbf0f938fcd4560000031b6137db93ca
Reviewed-on: https://code.wireshark.org/review/23917
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-10-18 07:33:42 +00:00
Michael Mann 560945336c Bugfix Decode As dissector table selection.
Need to use UI name to select between different tables.

Change-Id: I2f25435e6ac1a2f1a15e651cd3ef1bbc9e860d89
Reviewed-on: https://code.wireshark.org/review/23952
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-17 03:29:32 +00:00
João Valverde 9764cd0a83 autotools: make maintainer-clean should allow rerunning 'configure'
Change-Id: Iedae94ffefe27b13b1967d69cacb757b5aa4576d
Reviewed-on: https://code.wireshark.org/review/23928
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-10-15 14:17:20 +00:00
Ahmad Fatoum 9d49e13166 Remove superfluous null-checks before strdup/free
NULL checks were removed for following free functions:

- g_free "If mem is NULL it simply returns"
  https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-free

- g_slist_free(_full)? "NULL is considered to be the empty list"
  https://developer.gnome.org/glib/stable/glib-Singly-Linked-Lists.html

- g_strfreev "If str_array is NULL, this function simply returns."
  https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strfreev

- g_slice_free "If mem is NULL, this macro does nothing."
  https://developer.gnome.org/glib/stable/glib-Memory-Slices.html#g-slice-free

- g_match_info_free "not NULL... otherwise does nothing"
  https://developer.gnome.org/glib/stable/glib-Perl-compatible-regular-expressions.html#g-match-info-free

- dfilter_free defined in Wireshark code. Returns early when passed NULL
  epan/dfilter/dfilter.c

They were also removed around calls to g_strdup where applicable:

- g_strdup "If str is NULL it returns NULL."
  https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strdup

Change-Id: Ie80c2db89bef531edc3aed7b7c9f654e1d654d04
Reviewed-on: https://code.wireshark.org/review/23406
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-10-15 12:38:51 +00:00
Peter Wu 1dea7f3dc1 Rename ui_util.h -> ws_ui_util.h
In preparation for possibly using AUTOUIC in CMake which treats "ui_*.h"
files specially, rename ui_util.h. No other changes.

Change-Id: Id026572c000b713ff0e9388dc7fff8d81d4df73e
Reviewed-on: https://code.wireshark.org/review/23916
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-15 01:14:26 +00:00
João Valverde 9bba3866ff CMake: Allow user build flags to override default build flags
Autotools has the very useful feature by design of allowing the user
to override the default build flags (you break it you keep it).

Apparently CMake applies COMPILE_OPTIONS target property after
CMAKE_{C,CXX}_FLAGS so that doesn't work here. Prepend our flags to those
variables instead to make it work then.

Specific target flag overrides can still be added with COMPILER_OPTIONS
(e.g: generated files with -Wno-warning) but this is less effective and
then we're back at the point where this overrides user flags. It's less
of a concern though.

Change-Id: I44761a79be4289238e02d4e781fef0099628817b
Reviewed-on: https://code.wireshark.org/review/23675
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-10-13 21:32:18 +00:00
Mikael Kanstrup 5a99830e21 Qt: Free dynamic menu actions at shutdown
Some menu actions registered at startup are not freed at shutdown
making Valgrind complain. Fix by clearing the lists holding them
and making sure all actions have a parent to free them.

Bug: 14071
Change-Id: I8d99d062d394a7262b0f9b7ddea4ed71049636ac
Reviewed-on: https://code.wireshark.org/review/23793
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-05 04:21:46 +00:00
Mikael Kanstrup 867e6f0e00 qt: Fix leaked dialogs
Some dialogs are allocated on heap but not freed when the dialog
boxes are closed. This means one dialog instance is leaked each
time opened/closed. Also dialogs being subclasses of
GeometryStateDialog means they might lack a parent reference and
are not automatically freed on application shutdown either.

Fix these leaks by letting the dialogs automatically destroy
themselves on close (via WA_DeleteOnClose).

Capture filter, display filter and capture interfaces dialogs are
also leaked on application shutdown. These dialogs are protected by
a NULL check that at least prevent multiple instances. Though
none of them are freed on application shutdown. Fix leaks by
freeing when main window is destroyed.

Bug: 14071
Change-Id: I8c5c5a75ad3c89abb5996941875ba5d616a22d9c
Reviewed-on: https://code.wireshark.org/review/23747
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-05 04:21:22 +00:00
cheloftus 70996dc669 Qt: add preference to restore display filter after Follow Stream
Added new user preference 'restore_filter_after_following_stream',
defaults to false.
When true, the current display filter is restored after following a stream.

Change-Id: I153107761003658c6d7f1464711da7b3adeb60a8
Reviewed-on: https://code.wireshark.org/review/22455
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-04 03:59:38 +00:00
Alexis La Goutte dcf7ca7abd interface_toolbar (Qt): fix commas at the end of enumerator lists are a C++11 extension [-Wc++11-extensions]
Change-Id: I36ea982656e45855b357e071bcca7c6f3d12d03f
Reviewed-on: https://code.wireshark.org/review/23825
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-03 11:45:21 +00:00
Martin Kaiser d8903ce397 simplify some include file paths
For both autotools and cmake, the top-level source directory is always
part of the search path for include files. For include files in this
directory, we can simply use the file name. There's no need for a
relative path.

Change-Id: Ibf46265d91b5cb9bff4fa791e5b1d69ee3c1e165
Reviewed-on: https://code.wireshark.org/review/23798
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-01 15:10:19 +00:00
Gerald Combs 797a9bf67d [Automatic update for 2017-10-01]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I5ba654c9fade87decd26995b5a2d38734dcfba3b
Reviewed-on: https://code.wireshark.org/review/23794
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-10-01 08:13:43 +00:00
João Valverde a269ae1b6a Rename "ws_version_info.h", also .c
It's not installed so like most other files it doesn't need or benefit
from the prefix.

Change-Id: I01517e06f12b3101fee21b68cba3bc6842bbef5c
Reviewed-on: https://code.wireshark.org/review/23751
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-26 17:32:08 +00:00
Mikael Kanstrup a8a3903e55 Qt: Free MainWindow at shutdown
MainWindow is allocated on heap on startup but not freed on shutdown.
Free the object at shutdown mainly to silent Valgrind.

When at it also fix two problems with the MainWindow destructor:
- Deleting main_ui_ triggers a currentChanged signal which in turn
  calls mainStackChanged that references the freed main_ui_ object.
  Prevent use after free error by disconnecting from the signal before
  freeing.

- Explicitly free file_set_dialog_ as no rparent perform the cleanup.

Bug: 14071
Change-Id: I9c1fbef04cf68bfffffea57ef298f4896d6583f9
Reviewed-on: https://code.wireshark.org/review/23739
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-25 23:37:56 +00:00
Mikael Kanstrup f3d9766cbc Qt: Fix leaked interfaces array in Wireless frame
The array of ws80211_interface:s is not freed when the wireless
frame is destroyed causing minor leaks. Fix leaks by freeing the
array using appropriate utility function.

Bug: 14071
Change-Id: I35ec578062bfee4a4f0d0ac05a6d7613996a8822
Reviewed-on: https://code.wireshark.org/review/23738
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-09-25 22:47:04 +00:00
Gerald Combs b44b7dee03 [Automatic update for 2017-09-24]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: Iad48b3a81e83cf56ccec6cfb9075169379a775f4
Reviewed-on: https://code.wireshark.org/review/23669
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-09-24 08:07:00 +00:00
Michael Mann e7cc0279ab Have sequence analysis properly use filters from taps.
Sequence analysis has its own "filtering" system that required its
tap functions to look for some "filter flags".  register_tap_listener()
already comes with a filter argument, so use that to simplify logic
of tap functions in dissectors.
Also have Qt GUI for Flow Graph look like other dialogs that have a
"Limit to display filter" checkbox.

Change-Id: I91d9d9599309786892f5b50c98692e52651e7174
Reviewed-on: https://code.wireshark.org/review/23659
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-23 03:42:14 +00:00
Michael Mann 5f667694d3 Add Flow Graph functionality to TShark
Add flow graph functionality to tshark through -z option.
Output is same as ASCII format saved from GUI.

Change-Id: Iee0bfea7215858e6488b4728581be28287e9ea1a
Reviewed-on: https://code.wireshark.org/review/23652
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-22 04:49:48 +00:00
Michael Mann 620d54b1e3 Complete move of tap-sequence-analysis.c functionality to sequence_analysis.c
Since dissectors are now populating the timestamp of the seq_analysis_item_t
structure within the tap function, don't have the sequence_anaylsis redo it
when writing an ASCII file.  This removes the need for the capture_file
parameter and simplifies the logic a bit.

Also just have GUI register the tap itself.  It will provide for some more
flexibility in the future.

Change-Id: I55b2f951b977ea70ac9f7eb4929245b0779e5f0e
Reviewed-on: https://code.wireshark.org/review/23650
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-21 22:16:09 +00:00
João Valverde 25ba538bc5 plugins: Be more descriptive in "about wireshark"->"folders"
Display separate entries for binary plugins and lua scripts.

This is explained in the user guide, that the binary folder is
a subfolder of the lua folder, but it's probably a good idea to be more
explicit about it, at the risk of cluttering the interface a bit.

Move GeoIP information down because it seems the least important.

Add helper functions to provide plugin version subdir.

Change some #ifdefs while at it for legibility.

Change-Id: Ieb8665df029b3c14de19e2c973bd9b1cc4ec4621
Reviewed-on: https://code.wireshark.org/review/23609
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-20 16:41:21 +00:00
Kevin Hogan f9207b0f6c Qt: Restore ability to display RTT by sequence number
Adds a checkbox to the TCP Stream Dialog's "Round-trip-time"
graph tab that allows user to choose sequence number
on the x-axis rather than time.

Bug: 13740
Change-Id: Iaf881318437c7eecd16cf6c1f8745283ce9b4a7d
Reviewed-on: https://code.wireshark.org/review/23376
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-20 08:43:02 +00:00
Mikael Kanstrup a17bbc1841 qt: Fix some leaked menu objects
Calling QPushButton.setMenu and QMenu.addMenu does not transfer ownership
of the menu. Fix some leaks by letting "receiving" object act parent
for the menu object.

Bug: 14071
Change-Id: Id4edaf895503ef5dd4597eac99c2cdd6ad09b2ff
Reviewed-on: https://code.wireshark.org/review/23600
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-20 05:48:06 +00:00
Michael Mann b5759cafae Integrate LBM UIM Flow dialog into "regular" Flow diagram.
Reduce all of the code duplication and just register the sequence
analysis functionality in LBM dissector.

Change-Id: I6cb5a7f0a92b04357334bbae301fa2d730a21994
Reviewed-on: https://code.wireshark.org/review/23630
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-20 04:48:40 +00:00
João Valverde 8db4ddd40c Rename get_plugin_dir() for consistency
WS_DLL_PUBLIC const char *get_plugin_dir(void);
WS_DLL_PUBLIC const char *get_plugins_pers_dir(void);

Opt for the plural form consistently (for public functions at least).

Change-Id: I8a5861ad7f90f9c87168bd3275bd9dbc5c83b749
Reviewed-on: https://code.wireshark.org/review/23608
Petri-Dish: João Valverde <j@v6e.pt>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-20 01:00:37 +00:00
Martin Kaiser 70263eade4 Qt: main window slots: don't connect setCaptureFile to DecodeAsDialog
The refactored DecodeAsDialog class has no setCaptureFile slot any more.
It seems it's always in the foreground and there's no way to change the
capture file while the DecodeAsDialog is active.

The dangling connection caused a warning

QObject::connect: No such slot
DecodeAsDialog::setCaptureFile(capture_file*)
   in ../ui/qt/main_window_slots.cpp:2881
QObject::connect:  (sender name:   'MainWindow')
QObject::connect:  (receiver name: 'DecodeAsDialog')

Change-Id: Ibb12b9cdded3c6b7cca40ce08874bc4f1af4eec7
Reviewed-on: https://code.wireshark.org/review/23623
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-19 23:30:41 +00:00
Michael Mann dd5875c487 Sequence analysis (flow graph) optimizations for dissectors
1. Remove protocol member from seq_analysis_item_t.
It's not used by any GUI, so don't burden dissectors with populating it.

2. Allow any dissector to change colors display by flow graph

3. Provide helper functions that may be common if other dissectors
want to create sequence analysis.

Change-Id: I04fa3c9f3cf6879ab9a8d7d6f4896b4979d010d7
Reviewed-on: https://code.wireshark.org/review/23613
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-19 06:44:51 +00:00
Mikael Kanstrup 8a25ac7306 qt: Fix leaked style for OverlayScrollBar
The QWidget::setStyle method does not transfer ownership of supplied
style object. Fix leak by letting OverlayScrollBar free styles
created.

Bug: 14071
Change-Id: Ibc14cadfc6d012e8a909be21b4f8974009fa75f5
Reviewed-on: https://code.wireshark.org/review/23601
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-19 06:44:08 +00:00
Stig Bjørlykke 6bc4de9a26 Qt: Add key events to accept and reject changes in FilterExpressionFrame
Change-Id: Iba3fe50b3ca4953fc59ebd6235d04f6878d183a4
Reviewed-on: https://code.wireshark.org/review/23607
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-19 06:42:02 +00:00
Stig Bjørlykke f681855737 Qt: Fix FilterExpressionFrame layout
- Use QToolButton for "Filter Buttons Preferences..." button
- Remove QVBoxLayout layout for Cancel and OK buttons

Change-Id: Ic5d4e96ca1c421750dc45f81a7d15f8ad637649d
Reviewed-on: https://code.wireshark.org/review/23606
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-19 06:41:37 +00:00
Stig Bjørlykke 59fce46d01 Qt: Add key events to accept and reject changes in PreferenceEditorFrame
Change-Id: I4a9c4b80b0438cd33c38b274a24a3b1b5db46cb8
Reviewed-on: https://code.wireshark.org/review/23605
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-19 06:41:06 +00:00
Stig Bjørlykke 939ea8c8ed Qt: Make ColumnEditorFrame use FieldFilterEdit to get a autocomplete list
Change-Id: I81d5f46d572aa3f0fa1b5b94741697fc72554d2e
Reviewed-on: https://code.wireshark.org/review/23587
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-09-19 06:23:29 +00:00
Stig Bjørlykke 3cb95b0521 Qt: Add key events to accept and reject changes in ColumnEditorFrame
Change-Id: I5f9ee01ee3aca5b2d75136fff3d8dc3e90ca1a4e
Reviewed-on: https://code.wireshark.org/review/23585
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-09-19 06:23:21 +00:00
Jakub Zawadzki c41bab1f66 Move most of sequence analysis code from ui/ to epan/
Create registration system to allow creation of analysis items
to be localized to the dissector.  For now only frame (all) and
TCP are supported.
VOIP functionality will be covered in a separate patch.

Change-Id: I5b05ef6d5afff8d0b162b03a0f451ab810602e81
Reviewed-on: https://code.wireshark.org/review/23571
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-18 21:24:16 +00:00
João Valverde 88b88a0e80 Qt: Fix -Wimplicit-fallthrough with GCC
../../../ui/qt/models/decode_as_model.cpp: In member function ‘virtual QVariant DecodeAsModel::data(const QModelIndex&, int) const’:
    ../../../ui/qt/models/decode_as_model.cpp:155:13: error: this statement may fall through [-Werror=implicit-fallthrough=]

Change-Id: I29654a0f6ce6cce7bc778231bc8d6e602875104f
Reviewed-on: https://code.wireshark.org/review/23589
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-18 12:40:41 +00:00
Stig Bjørlykke ecb6c88c07 Qt: Improved ColumnEditorFrame validation checks
Use common validation checks for fieldsNameLineEdit and occurrenceLineEdit.
No need to check for COL_CUSTOM and empty occurrence because this will
give a valid value anyway.

Change-Id: I8981a15954e9a55a9a43e4a5760b34d83aa2e1ca
Reviewed-on: https://code.wireshark.org/review/23584
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-09-18 07:10:28 +00:00
Gerald Combs e8e8b0d0b4 [Automatic update for 2017-09-17]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I0b157ca377ef2e8f1a2502e51b542322dc0d36b2
Reviewed-on: https://code.wireshark.org/review/23580
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-09-17 08:07:06 +00:00
Joerg Mayer 6c4b9360e5 Fix the trivial fix.
Change-Id: I95743eb53a3f30206a496163dea3b79f92a54b4e
Reviewed-on: https://code.wireshark.org/review/23579
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2017-09-17 01:15:48 +00:00
Joerg Mayer b93ef37da2 _U_ is wrong in c++, as is Q_UNUSED (in most cases).
The correct way is to not name the variable.

interface_tree_cache_model.cpp is one of the exceptions: Use Q_UNUSED in a conditional compile, instead of unconditionally.

Change-Id: If561e632a3a60d2424f454202f233e9a63926e78
Reviewed-on: https://code.wireshark.org/review/23570
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2017-09-16 15:06:12 +00:00
Michael Mann 69250aa51e Add support for dissector tables of type FT_NONE.
This is for dissectors that have "payloads" that don't have
a unique identifier to determine a sub dissector.

For the command line parameter -d, specifying a selector is no longer
required for dissector tables of type FT_NONE.

Change-Id: I3370d9e0dc147deeca4f26b842fe35dc3bda876e
Reviewed-on: https://code.wireshark.org/review/22574
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-16 11:12:52 +00:00
Michael Mann d992e85fe8 Refactor Decode As dialog to use a model/delegate
The model provides a lot more flexibility and abstracting the
data from the view (dialog)

Noticeable changes from user perspective:
1. Value column doesn't always have a combobox.  If registered decode as
structure doesn't support multiple values, a simple edit box is used.
2. Existing value will always be a choice (default) in the Value combobox.
3. Duplicate values in Value combobox have been removed (for things like
UDP port where source port and dest. port are same)
4. When adding/copying a decode as item, only first column (table) is
editable, not the whole column.
5. Separator always present in Current protocol column to distinguish
"none" from rest of protocols.
6. "Current" protocol defaults to "default value" when first added to the
list instead of "none".

Noticeable changes from developer perspective:
1. Code is much more spread out, but most new additions (like DCE/RPC support)
should be limited to the model class (maybe delegate).  The dialog class
probably won't change much anymore.
2. decode_as_dialog.ui is much less useful because information is provided through
model and delegate.

Change-Id: I70a667cab2c07d251ab370430bc51e5c1f4a3a02
Reviewed-on: https://code.wireshark.org/review/22625
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-16 11:11:50 +00:00
Simon Barber 7cc677e561 wireless-timeline: handle generators that report incorrect MCS for some frames
Macbook and QCA generators sometimes report the minimum MCS for subframes
in an aggregate that have FCS errors.

Change-Id: I77d1a81f5b3d0e3d0755adcb889f1237b0257814
Reviewed-on: https://code.wireshark.org/review/23521
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-15 20:59:04 +00:00
Pascal Quantin 98d5174e1a Qt: initialize srt_data_ in constructor (CID 1417727)
Change-Id: I4977ff102f1ffb11a5ea956537dde3230b4323f7
Reviewed-on: https://code.wireshark.org/review/23550
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-15 14:59:23 +00:00
Stig Bjørlykke 577671a160 Qt: Don't show text as invalid in disabled widgets
In Interface Toolbar the text widget should not be shown as invalid
when the widget is disabled.

Change-Id: I100a338216b34874064cb9f808a36703157811a4
Reviewed-on: https://code.wireshark.org/review/23549
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-09-15 12:51:13 +00:00
Michael Mann b4d8b68d7c Fix: Segfault when "Update list of packets in real time" is unchecked
capture_file structure is not populated with "fixed" captures.  Qt menu
presumes it has a populated capture_file structure.  Just have menu
items be disabled until capture file is reloaded for display.

Bug: 13024
Change-Id: I9dfb5355c5d421f5344f97e1e9d5b4dd08b11c6e
Reviewed-on: https://code.wireshark.org/review/23095
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-12 11:32:02 +00:00
Pascal Quantin 2b8bd222b0 Qt: fix a segmentation fault when opening a capture using the menu entry
Regression introduced in g38b40acb2d

Change-Id: I48377345730eb52b03a2016407afda4bc0ff8a79
Reviewed-on: https://code.wireshark.org/review/23509
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2017-09-12 07:47:35 +00:00
Gerald Combs f5b7fcee5b Qt: SequenceDialog no longer emits goToPacket.
SequenceDialog no longer emits goToPacket as of g7fe45cc0ec. Don't try
to connect it in MainWindow.

Change-Id: I0f3e47a3cf7c1e29a64da7462c85179e29828c49
Reviewed-on: https://code.wireshark.org/review/23501
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-09-11 19:56:43 +00:00
João Valverde 69f0cb0cef wsutil: Initialize and store plugin personal dir
Obviate allocation on every call to get_plugins_pers_dir().

Change-Id: I089ae499f93739d490d4552f59b5db5996f7d26f
Reviewed-on: https://code.wireshark.org/review/23495
Petri-Dish: João Valverde <j@v6e.pt>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-11 16:48:49 +00:00
Pascal Quantin 18de993b7c Qt: free SRT table once the tree is filled
Change-Id: Ic1c55852399190f3a3c5b5bf90cf6d90517b247f
Reviewed-on: https://code.wireshark.org/review/23444
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-11 05:06:08 +00:00
Pascal Quantin 02b20a5a69 Qt: fix Diameter SRT statistics display
Diameter dynamically create the SRT entries during runtime.
Delay the SRT table addition to the end of dissection to properly handle
this use case.

Bug: 13442
Change-Id: Id498f8d9bb4a1d7c632c9a556239bf74d0530f2a
Reviewed-on: https://code.wireshark.org/review/23443
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-11 05:05:45 +00:00
Pascal Quantin 38b40acb2d Qt: fix a memory leak when exporting packets
Change-Id: I3c99ca838b3def4437ba92794881630b8cdd8cbd
Reviewed-on: https://code.wireshark.org/review/23472
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-11 00:52:48 +00:00
Stig Bjørlykke d38197bb67 Qt: Construct QRegExp only once
In Interface Toolbar lineedit the QRegExp only needs to be
constructed once, not for every validity check.

Change-Id: I39e9ab9c57b4ac64a0b9b601fa72646d8c420274
Reviewed-on: https://code.wireshark.org/review/23425
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-09-07 16:37:09 +00:00
João Valverde f091ed83f7 CMake: Try to fix build error with i18n.qrc dependency order
Change-Id: I7006b435508e72457413cd1b7c5bdf1b7b41ee5b
Reviewed-on: https://code.wireshark.org/review/23424
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-07 11:25:12 +00:00
Pascal Quantin d022091acf Qt: fix RTP/IAX2 reverse stream export to CSV
Bug: 14040
Change-Id: Idadfbd3b60124b5f7ac4ace275db94b10daf010a
Reviewed-on: https://code.wireshark.org/review/23409
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2017-09-06 14:47:41 +00:00
João Valverde 299bd4628a Fix unitialized variable warnings that popped up with -Og
Using GCC version 7.1.1.

Change-Id: I7447a48fc97efb1eb15a016a29165f69d37f40a6
Reviewed-on: https://code.wireshark.org/review/23399
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-05 22:31:01 +00:00
Stig Bjørlykke 209a78ea82 Qt: Interface Toolbar log dialog for each control
Have separate log dialogs for each control logger button.

Bug: 14033
Change-Id: Iaabcbe38da196ebed1302f66b77864f880121856
Reviewed-on: https://code.wireshark.org/review/23364
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-09-03 20:43:17 +00:00
Pascal Quantin b974952b4c endpoint_dialog.cpp: remove a useless break
Change-Id: I0aafbe27b54969e77ba4df3106b9f35809d848a4
Reviewed-on: https://code.wireshark.org/review/23335
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2017-08-31 19:51:38 +00:00
Jens Kilian e9b8a5839f Qt: Fix errors when compiling for Qt4.
This allows Wireshark to be built on RedHat EL 7.2, with Qt 4.8.5.

Bug: 13909
Change-Id: Ia39a288cc342afa2bd0217cb59dac84c3227086c
Reviewed-on: https://code.wireshark.org/review/23322
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-31 12:02:41 +00:00
Jim Young 6f28f1a59e Fix MacOS build
Commit 8d13f14f95 introduced a
preprocessor buglet affecting MacOS builds.  Change #if to #ifdef.

Change-Id: I3d76c83428658abcf382e18066be0e24309ecbba
Reviewed-on: https://code.wireshark.org/review/23317
Petri-Dish: Jim Young <jim.young.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jim Young <jim.young.ws@gmail.com>
2017-08-31 06:29:25 +00:00
Pascal Quantin c199952f5c extcap: fix parameters save in preferences file
Since g583150198b, extcap_arg structures holds a pointer to the current
preference value. So let's not update its value outside of the prefs API
otherwise the call to prefs_set_string_value() with pref_current done
afterwards will never notify the change and the updated value will not
be written in the preference file.
Moreover update ExtcapArgument::resetValue() method to have an empty
string instead of a NULL pointer. Otherwise prefs_set_string_value()
will not notify the change and save the restored default value in the
preference file either.

Change-Id: Ie70e79d471c75e25705c7654e420a7706ebc4032
Reviewed-on: https://code.wireshark.org/review/23308
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-31 04:34:39 +00:00
Gerald Combs 8d13f14f95 Qt: Temporarily disable DP scaling on non-macOS systems.
Enable device pixel scaling in QCustomPlot only on macOS. Blind attempt
at diagnosing / fixing bug 14012.

Change-Id: I95e38eaa072d69aef0fe1d642951603800c3a280
Ping-Bug: 14012
Reviewed-on: https://code.wireshark.org/review/23314
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-08-30 20:54:05 +00:00
Pascal Quantin 94ce35a9f9 Qt: check QVector size before accessing its content and not after
Bug: 14017
Change-Id: Ied38551c78b4593f60165d9e3b04bb3913d6b258
Reviewed-on: https://code.wireshark.org/review/23310
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-30 16:00:07 +00:00
Stig Bjørlykke 464679f80f extcap: Close control handles when done
Ensure the event handles are closed when done to avoid leakages.
Also improved the control reader to use WaitForSingleObject().

Change-Id: I1679d9c09e247b28117ec05c3e1b0f3ba0e99674
Ping-Bug: 13833
Reviewed-on: https://code.wireshark.org/review/23263
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-08-28 17:13:03 +00:00
Mikael Kanstrup 879920a2eb iface_lists: Remove locked field
It seems the locked field of interface_t was used to avoid
simultaneous updates of interface entries from either multiple
threads or most likely the recursive UI update callbacks
case later identified.

Since 802362e ("Avoid recursive scan_local_interfaces operation")
the recursive callback behavior is no longer happening. And as
code does not have consistent checks the locked field can anyway
hardly protect a multi-threaded case if such a case exists.

Remove the unnecessary locked field.

Ping-Bug: 13864
Change-Id: Idc393f702b82aa6014dd636572d00f0d67120bf3
Reviewed-on: https://code.wireshark.org/review/23262
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-08-28 16:53:32 +00:00
Mikael Kanstrup 8646596829 Fix leaks when active capture interface goes down
If an interface goes down while packet capture is ongoing
related interface_option element is not freed properly. Fix
by using the appropriate free function that both remove the
element and frees element members.

Ping-Bug: 13864
Change-Id: I66a11d64615dc9648441b532e4ff658ea42a5acf
Reviewed-on: https://code.wireshark.org/review/23205
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-08-28 16:53:26 +00:00
Mikael Kanstrup 3b16cc8b21 iface_lists: Access ifaces member by reference
Change access of ifaces elements from by val to by reference.
With this change unnecessary copying of the whole struct is avoided
but even more important is that elements no longer have to be
removed and inserted whenever data is updated.

This change aims to make it more clear that ifaces elements shall
never directly be removed from the array. Instead use function
capture_opts_del_iface

NOTE: Code for GTK UI not updated

Ping-Bug: 13864
Change-Id: I04b65d5ee36526b30d959b8e5a2a48a3c7c4f15b
Reviewed-on: https://code.wireshark.org/review/23204
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-28 14:43:13 +00:00
Mikael Kanstrup 81c48eaccc Fix leak when removing interfaces from manage interfaces dialog
When removing interfaces from the manage interfaces dialog the
interface elements where not freed properly causing leaks.
Free the interface element when removed from the array.

Ping-Bug: 13864
Change-Id: I6beb222a5475278cfc6cb454a7c8b2c86f636f38
Reviewed-on: https://code.wireshark.org/review/23203
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-28 14:42:44 +00:00
Mikael Kanstrup 8873c7e494 iface_lists: Access all_ifaces member by reference
Change access of all_ifaces elements from by val to by reference.
With this change unnecessary copying of the whole struct is avoided
but even more important is that elements no longer have to be
removed and inserted whenever data is updated.

This change aims to make it more clear that all_ifaces elements
shall never be removed from the array without freeing resources
via the capture_opts_free_interface_t function.

NOTE: Code for GTK UI not updated

Ping-Bug: 13864
Change-Id: I36742cb1d5c8daa136c9d3732a044a7c8e5c7fe7
Reviewed-on: https://code.wireshark.org/review/23201
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-28 14:41:43 +00:00
Stig Bjørlykke 12c04e0529 Qt: Fix build without libpcap
Change-Id: I9b9b5de1beb23486ccc000feda54c2b20a33f4ad
Reviewed-on: https://code.wireshark.org/review/23251
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-08-28 06:37:09 +00:00
Håkon Øye Amundsen 018f6bff18 extcap: Interface Toolbar support on Windows
Add support for extcap control pipes on Windows.
Improved read loop in InterfaceToolbarReader.
Delay opening control pipes until extcap has opened the fifo pipe.
Make extcap_example.py work on Windows.

Bug: 13833
Change-Id: I4b47d25452637759b8a3be53be48eee5365bc0e4
Reviewed-on: https://code.wireshark.org/review/23211
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-28 05:48:01 +00:00
Ahmad Fatoum be69761c78 Fix requesting hardware timestamps without -k
The interface_options struct passed to dumpcap is populated
differently when running Wireshark with and without -k.

Previously, only with -k was there a valid pointer in
interface_opts.timestamp_type

Fixes: aca55a2 ("Add hardware timestamping support")
Signed-off-by: Ahmad Fatoum <ahmad.fatoum@siemens.com>
Change-Id: Ic7ecc5a1190c28197d6a7271f1b353f74d43ca61
Reviewed-on: https://code.wireshark.org/review/23160
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-22 12:18:12 +00:00
Gerald Combs edc63f5ef7 [Automatic update for 2017-08-20]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I676dc2814760f711a3d3b8b4979ef8a0077e26a1
Reviewed-on: https://code.wireshark.org/review/23141
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-08-20 08:07:25 +00:00
Dario Lombardo bc9bf64f8d Qt: fix compilation without pcap.
Change-Id: Ib8d21d63730ea6e18032b89ba0042ee7521645a8
Reviewed-on: https://code.wireshark.org/review/23078
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-15 14:44:11 +00:00
Gerald Combs f2a3a705e6 [Automatic update for 2017-08-13]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: Ie0e554e42e96a8b8f8c8ce7f4a9ea615276b49fb
Reviewed-on: https://code.wireshark.org/review/23056
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-08-13 08:11:00 +00:00
Alexis La Goutte f4781f3655 editor_file_dialog (qt/widgets): fix indent (use 4 spaces)
Change-Id: I507737879c2e24cdca6d305b8e3775967071f1c3
Reviewed-on: https://code.wireshark.org/review/23028
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-09 14:07:14 +00:00
Michael Mann 59e6c62893 io_graph_dialog.cpp: Remove graph_enabled_vs.
No longer necessary with model

Change-Id: If1516f264013fabe1211aa04fe054b15e235b36a
Reviewed-on: https://code.wireshark.org/review/23007
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-08 00:50:20 +00:00
Michael Mann 5b3e3ee587 Use UAT model for I/O graph
Convert from using TreeWidgetItems to UAT model/delegate.  More of the GUI
is "just handled" within the table.
Required to add support for "colors" and "protocol fields" to UAT types.
Also needed to add some hacks for "custom" UAT field handlers for
backwards compatibility with the existing UAT structure used.

Because UAT functionality was switched completely to the model, some
information in the table was "lost in translation" because the UATs
themselves aren't translated to other languages.

TODO:
2. Better "order of operations"?  A bunch of NULL/size checks needed to be added to prevent crashing.
Now with model/"view" should events/functions be reordered?

Bug: 13585
Change-Id: I2bbba78182317c4fada07b927c05d0c6f4cdc0fe
Reviewed-on: https://code.wireshark.org/review/22766
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-07 17:25:02 +00:00
Michael Mann ff7a6305a7 Use proper tab order for "file types" in UAT "table".
Directory and File "UAT types" have been using a separately launched
dialog, instead of an "editor", so it breaks "tab rules".  Create and
treat (File) dialog as an editor.

Change-Id: I983728abefb0cdd79899468a800328f1b56e2910
Reviewed-on: https://code.wireshark.org/review/22886
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-07 04:53:42 +00:00
Gerald Combs 912542f7be [Automatic update for 2017-08-06]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: Ie6f7676ccde9337cb479e448884b0240e3fd238c
Reviewed-on: https://code.wireshark.org/review/22961
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-08-06 08:08:09 +00:00
Michael Mann 839032dff8 simple_dialog.cpp: Fix missed Qt version wrapper.
check_box_ member was missing a #if (QT_VERSION > QT_VERSION_CHECK(5, 2, 0)) wrapper

Change-Id: Ibdddbe523b8e15c0af31fddfd3f251c24114d11a
Reviewed-on: https://code.wireshark.org/review/22959
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-06 02:56:24 +00:00
Uli Heilmeier 92adb99d00 QT: Add shortcuts for "Follow XXX Stream"
Add shortcut Ctrl+Alt+Shift+
T for "Follow TCP Stream"
U for "Follow UDP Stream"
H for "Follow HTTP Stream"
S for "Follow SSL Stream"

Bug: 13047
Change-Id: I0fdd5b4d20b976b56694821a9c11424eab40b2b3
Reviewed-on: https://code.wireshark.org/review/22930
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-05 18:31:46 +00:00
Gerald Combs f155beb094 Qt: Fixup the welcome screen stylesheet.
Pass in a QString argument only when we have a placeholder. Fixes a

    QString::arg: Argument missing: MainWelcome { ...

warning on Windows.

Change-Id: I42dd155252bd9fd4f21f0112b62044c7397c9810
Reviewed-on: https://code.wireshark.org/review/22934
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-04 05:56:18 +00:00
Michael Mann 6f12bf215f Fix copy/pasteo so Qt Model Source is displayed properly in Visual Studio
Change-Id: I81dbc6947f0d878d2c214541cf0d540444ea1592
Reviewed-on: https://code.wireshark.org/review/22867
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-30 15:48:41 +00:00
Alexis La Goutte 32b446d5a8 Define Q_NULLPTR as NULL if not already defined
it is not supported with Qt 4.x

Change-Id: Ie98d5e03d471869e08f5354a509c3317c7c780d7
Reviewed-on: https://code.wireshark.org/review/22831
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-07-30 05:21:37 +00:00
Stig Bjørlykke 66fff5df49 Qt: Add preference for show file load time in the status bar
This will leave more room for messages on smaller screens.  Set the
default OFF because this is probably only useful for developers.

Group Status Bar settings in the Layout frame.

Change-Id: Iea9a55b6c088aac10ee7680b1e8a882ed00c73be
Reviewed-on: https://code.wireshark.org/review/22824
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-07-29 05:39:37 +00:00
Stig Bjørlykke 4aae9331bc Qt: Add preference for show selected packet number
The information about the selected packet number is available from
the Number column and from the Frame entry in the Packet Details
so make the entry in the status bar optional.

Also remove duplicate "Packet:" entry, add the UTF8_MIDDLE_DOT
separator and rename the prefix to "Selected Packet:".

Bug: 13902
Change-Id: I0e7ba884bdcbdc87a5738223ef92f52e4ac195e5
Reviewed-on: https://code.wireshark.org/review/22807
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-27 19:29:34 +00:00
Gerald Combs f86f54eb90 Qt: SimpleDialog fixes and updates.
Add WiresharkApplication::mainWindow and use it to move the C
simple_dialog routines to simple_dialog.cpp.

In SimpleDialog, make sure our checkbox is initialized. Don't store our
parent widget (which might go away) in a static variable, just use
wsApp->mainWindow(). Make sure we use check boxes only in Qt 5.2 or
later.

Bug: 13275
Change-Id: I72a9715c59f2efd50f722197f416179e87bb6a8b
Reviewed-on: https://code.wireshark.org/review/22805
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-27 11:41:10 +00:00
Roland Knall 02e80019f2 Qt: Create models directory
Following the move for widgets and utils directory, moving models
and delegates to the utils directory. Guidelines for this directory are:

 - Implementation of a model
 - Implementation of a delegate
 - Utility class for data storage used by a model

Note: additionally all includes affected by this move have been changed
to absolute path includes, instead of relative ones.

Change-Id: I3bb868af7d3570437682b722a0cd46c906628570
Reviewed-on: https://code.wireshark.org/review/22790
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-07-26 12:22:04 +00:00
Roland Knall ea998190cf Qt: Fix Makefile.am for utils dir change
Fix Makefile.am

Change-Id: I31cdbc2af0659b247d22af7438300c44acfff63e
Reviewed-on: https://code.wireshark.org/review/22801
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-07-26 10:32:12 +00:00
Roland Knall ddfc1d37cc Qt: Move utils to separate utils directory
Following the move for widgets directory, moving utils
to the utils directory. Guidelines for this directory are:

 - Generic use but not a widget
 - Utility functionality used by many classes
 
 Note: additionally all includes affected by this move have been changed
 to absolute path includes, instead of relative ones.

Change-Id: I019ae4b6e6f6d06a5745a63ed195edbd36fb936b
Reviewed-on: https://code.wireshark.org/review/22602
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-07-26 10:11:55 +00:00
Michael Mann 95930c2d1f Add current packet to the status bar.
For users with lots of columns, they may loose track of the current frame/packet.

Bug: 13902
Change-Id: I4d937dc437e254a09d938733aef5f5678ede1095
Reviewed-on: https://code.wireshark.org/review/22772
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-07-26 10:10:12 +00:00
Michael Mann 07d8fad852 WirelessTimeline: move signals out of setPacketList().
Start to remove the dependency on PacketList by moving the signals
out of setPacketList and into MainWindow.

Change-Id: Ibbe5a5619e06809eb71aee5145c4b0f7d54382a2
Reviewed-on: https://code.wireshark.org/review/22798
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-07-26 10:09:34 +00:00
Gerald Combs c6ed05ec73 Qt: Make SimpleDialog a plain, non-QObject class.
Don't assume that the application is initialized when we create a
SimpleDialog.

Bug: 13275
Change-Id: Ieeb52430500570db88463069833855c3789f686b
Reviewed-on: https://code.wireshark.org/review/22778
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-07-25 04:56:10 +00:00
Stig Bjørlykke f2ffcdf3aa Qt: Compile InterfaceToolbar with Qt4
The InterfaceToolbar does not currently work with Qt4 because usage
of some Qt 5.2 features, but this should at least make it compile.

Change-Id: Id610e04d6c266556bfb84da5399e57a6c1fe9938
Ping-Bug: 13909
Reviewed-on: https://code.wireshark.org/review/22761
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-23 20:33:30 +00:00
Lars Christensen 88fbc26175 Inhibit unhandled Ctrl key presses being redirected to the display filter
Pressing the display filter shortcut Ctrl-/ inserts a '/' into the
LineEdit. On Windows QKeyEvent::text() contains a
printable character when Ctrl is held down and are being redirected
in MainWindow::eventFilter(). This patch filters events that has the
CtrlModifier.

Change-Id: Iefed962b7a2cc944a39b09de9d84b4522a39ff13
Reviewed-on: https://code.wireshark.org/review/22697
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-07-23 15:52:03 +00:00
Michael Mann 40d158eee3 Have UatFrame send out proper notifications.
UatFrame was originally written for filter expressions, so it still
had some "filter expression specific" functionality in it.
Move the "filter expression notifications" to the preferences dialog
and add support for proper notification if UAT affects fields or
dissection (like expert info UAT).

Change-Id: I84cd0c7923450692916bbc6c2cdce93a9830d722
Reviewed-on: https://code.wireshark.org/review/22758
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-22 12:16:04 +00:00
Gerald Combs 28dce11948 Qt RTP: Add the default device and adjust sample rates.
In the RTP player dialog, list the default audio device first, ensure
it's selected by default and ensure that the list items are unique.
According to

http://code.qt.io/cgit/qt/qtmultimedia.git/tree/src/plugins/windowsaudio/qwindowsaudiodeviceinfo.cpp?h=5.9

the default device on Windows uses the special WAVE_MAPPER id, which
appears to support various sample rates even when the underlying
hardware doesn't.

Ensuring the names are unique fixes an issue I'm seeing on a test
machine here.

When decoding, check to see if our sample rate is supported by our
output device and adjust accordingly.

Bug: 13906
Change-Id: Iddc0beb2459bfac42276ff29d227c2619b0a8d90
Reviewed-on: https://code.wireshark.org/review/22756
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-07-21 21:09:26 +00:00
Alexis La Goutte 421085cc4c .gitignore: move ui/qt/gitignore to root gitignore
Change-Id: I303c6998b7b825ebb89aa1a81296b1ad69786ec1
Reviewed-on: https://code.wireshark.org/review/22538
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2017-07-20 22:39:56 +00:00
João Valverde 3e37292c38 Remove line numbers (locations) from .ts files
To make translation updates less noisy.

Change-Id: I3efee819ea10bb326862e0f818bfd3cd7eff48e3
Reviewed-on: https://code.wireshark.org/review/22654
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2017-07-20 09:56:42 +00:00
Gerald Combs 0e0c9a1a7a Qt: Don't clobber the itemview hover behavior on Windows.
Change-Id: I47a8087a1d3303baec9b598135c3f8a3021dadbe
Reviewed-on: https://code.wireshark.org/review/22707
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-07-18 23:05:37 +00:00
Stig Bjørlykke 541b9a9387 Qt: Fix "Filter Button Preferences" shortcut
When Expert preference UAT was promoted to main preference tree
the entry for Filter Buttons was moved and the code for handling
prefs_pane_to_item_ was wrong.

This should be rewritten to a bulletproof solution.

Change-Id: I1d98aa75da7107ac2e50b29ff19c52dc516053a6
Fixes: v2.5.0rc0-386-gd4d30faeb8
Reviewed-on: https://code.wireshark.org/review/22676
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-18 02:43:46 +00:00
Gerald Combs 47c9cf8925 Qt: Simplify some version checks.
We require Qt5 at configure time on macOS, so we no longer need to
exclude Qt4 + macOS in the code.

Change-Id: I9e233f963526b0051bd846d171105c1d33d1c4cc
Reviewed-on: https://code.wireshark.org/review/22677
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-07-17 22:23:33 +00:00
Stig Bjørlykke 30f7014dfc Qt: Expand column preferences text edit fields to column width
When editing a custom column the text edit field should fill the column.

Change-Id: I5505238d13c4dbe26e9dbc4ae60fd602120f9596
Reviewed-on: https://code.wireshark.org/review/22657
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-07-17 04:15:08 +00:00
Guy Harris 4dd48721ee Rename cf_get_comment() to reflect what comment it gets.
Change-Id: Id3b0430a1d462b29833259462536ed4cb0424f77
Reviewed-on: https://code.wireshark.org/review/22662
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-07-17 03:49:33 +00:00
Guy Harris cdc01b89bf Rename section comment get/set routines.
Rename cf_read_shb_comment() to cf_read_section_comment(); an SHB is a
record type in a particular capture file format (pcapng), and not all
files that have per-file or per-file-section comments have something
called a Section Header Block.

Rename cf_update_capture_comment() to cf_update_section_comment();
pcapng, at least, supports multiple sections, although we don't curently
support that.

This also gives them matching names.

Change-Id: Idd8cb0f0fd9125b9626411274aebfb1ec0097665
Reviewed-on: https://code.wireshark.org/review/22659
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-07-17 03:38:45 +00:00
Gerald Combs 32ec45dc92 Qt: More Main Welcome interface tweaks.
ge036f4a282 didn't ensure that an interface was selected at app startup.

Change-Id: I0b04020a344aaf8e35766a45287fe263d1227c64
Reviewed-on: https://code.wireshark.org/review/22656
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-07-17 00:41:09 +00:00
Stig Bjørlykke 1ed38dc2be Qt: Main Welcome hover text color fix.
Use the default text color for hovered items.  This makes the
selected item look the same as non-selected items when hovering.

Change-Id: Ic9e18323326f088202207ac15f844e7849f7ebc9
Ping-Bug: 12636
Reviewed-on: https://code.wireshark.org/review/22632
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-07-16 19:40:22 +00:00
Stig Bjørlykke 7f23b51868 Qt: Expand IO Graph text edit fields to column width
When editing a IO Graph the text edit field should fill the column.

Change-Id: Idb5c9a7004d9be1b82e645ae2c1a3430c9c9e5f7
Reviewed-on: https://code.wireshark.org/review/22626
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-07-16 19:39:56 +00:00
Stig Bjørlykke d5c8145f54 Qt: Set IO Graph display filter when having Y field
Calling setFilter() between setValueUnits() and setValueUnitField()
will fail when having "Y Field" because check_field_unit() fails
with inconsistent values.  The display filter will then be ignored.

Call setFilter() first to ensure filter_ is set before setting
value units.  setFilter() does not depend on the value unit when
used to set the display filter.

Change-Id: Ibf2d37fddcce9fcf6febebfefa0b2518ae093737
Fixes: v2.3.0rc0-2930-g0ea51ad822 ("Qt: Fix uninitialized memory access in val_units_")
Reviewed-on: https://code.wireshark.org/review/22619
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-07-16 19:39:35 +00:00
Gerald Combs 87e7bc811c [Automatic update for 2017-07-16]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I01c07ea17d54e5518659abac5cd3c8c9ddfea5e6
Reviewed-on: https://code.wireshark.org/review/22647
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-07-16 17:05:26 +00:00
Dario Lombardo d4ae8032ed Qt: add initializers (CID 1162824).
Change-Id: I46f56fb99c75eebc6418fa7ac88995f49abedc91
Reviewed-on: https://code.wireshark.org/review/22645
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-16 16:12:17 +00:00
Peter Wu 4beb7430d4 Qt: refactor UatTreeView into something reusable
UatTreeView had two functions:
 1. Saner navigation functionality when pressing tab.
 2. Start editing when the currently selected item changes.

Since this tab navigation functionality is desired in more places,
extract this functionality. Add more documentation while at it and use
an alternative, declarative style to connect signals.

Move the second functionality to the caller since not all views need it.

Change-Id: Ibe886f2c2763dbe024614203a44b72173fbbce06
Reviewed-on: https://code.wireshark.org/review/22639
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-16 14:47:01 +00:00
Peter Wu bdff834631 Qt: show UAT description for header items
Be sure to display the extended description for UAT fields in the
tooltip for the column header like GTK+ did.

Change-Id: I294d2d3fb7f6d55df239129bea5d780b15deacc6
Reviewed-on: https://code.wireshark.org/review/22641
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-16 12:40:20 +00:00
Guy Harris 08e8a1ff1a Fix for building without libpcap and extcap.
(A further fix should be "don't put the "Capture" section into the
welcome screen if we have neither libpcap nor extcap".)

Change-Id: I83e65e6dc31040292af7fe88ccd73e485613c76f
Reviewed-on: https://code.wireshark.org/review/22634
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-07-16 03:21:27 +00:00
Peter Wu 569b1d4468 Qt: fix build without libpcap and without extcap
global_capture_opts is only defined when libpcap or extcap are enabled.

Change-Id: If692a7ac365b77d9efc52f589fef1aa906d5d14e
Fixes: v2.5.0rc0-425-ge036f4a282 ("Qt: Main Welcome behavior tweaks.")
Reviewed-on: https://code.wireshark.org/review/22629
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-07-16 02:42:04 +00:00
Gerald Combs e036f4a282 Qt: Main Welcome behavior tweaks.
Update the recent item list and interface tree style sheets so that
hovered items have a different background color. This should make it
more obvious that they can be clicked.

Select the default interface (or failing that, the first interface) at
application startup and focus on the interface tree. This should make it
less likely that the user will start typing in a capture filter with the
wrong (or no) interface selected.  Note that we should probably track
selected interfaces in the recent file instead of forcing the user to
select one via the preferences.

This should hopefully address some of the issues in bug 12636 and do so
without changing the layout (which we can do in another commit).

Change-Id: I96a417973f4270a70f41d04c40c4947a09613bdc
Ping-Bug: 12636
Reviewed-on: https://code.wireshark.org/review/22627
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-07-15 06:22:23 +00:00
Peter Wu b992e69c19 Qt: implement saner tab navigation for coloring rules dialog
The default QTreeView/QTreeWidget behavior for (Shift-)Tab navigation is
to select the previous/next row. For data entries with multiple columns
(such as the UAT dialog or the coloring rules dialog), column
navigation is closer to what a user would expect, so implement that.

Bug: 13856
Change-Id: Ib585030380f894e0be214a95107cb264afac7eee
Reviewed-on: https://code.wireshark.org/review/22561
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-07-15 06:17:38 +00:00
Gerald Combs b0ac5f449d Remove some unneeded includes.
Change-Id: I513936a74fe96211153fdf35f1832608b2cd053d
Reviewed-on: https://code.wireshark.org/review/22617
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-07-14 04:49:28 +00:00
Roland Knall ee699eb720 Qt: Move all utility widgets to widgets subdirectory
Move all utility widgets to the widgets subdirectory and
add separate source_group for their files

Correct some alphabetization in ui/qt/CMakeLists.txt noticed
during compare.

Change-Id: I2d664edc2b32f126438fb673ea53a5ae94cd43d1
Reviewed-on: https://code.wireshark.org/review/22531
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-11 21:30:29 +00:00
Michael Mann 354379095d Organize Qt source files for Visual Studio
Organize source into 5 categories:
moc Source Files - moc_* files
ui Header Files - Header files generated by .ui files
ui Files - .ui files
qrc Files - graphics? files
Header Files - Header files for Qt source headers

Change-Id: If32b8331592a2c685131ea9592893b7add1124ec
Reviewed-on: https://code.wireshark.org/review/22592
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-11 16:55:59 +00:00
Michael Mann d4d30faeb8 Promote Expert preference UAT to main preference tree.
"Expert" has been treated as a protocol "internally", but I
doubt users would consider it one.  Since the only preference
is a UAT, just make it its own leaf off of the main preference
tree (similar to Filter Expressions UAT) and not have it buried
with all of the protocols.

Change-Id: I385314d8791440e6ced3dbd71305ee75bc373e52
Reviewed-on: https://code.wireshark.org/review/22580
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-07-11 08:40:13 +00:00
Michael Mann 13b5f42b3b filter_expressions_preferences_frame -> uat_frame
There isn't anything "filter expression" specific about it and
there are a few other things that could take advantage of a
UatFrame.

Change-Id: I0d04d176caebf0c2d8043c3bf89a81668580eae8
Reviewed-on: https://code.wireshark.org/review/22570
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-09 21:38:22 +00:00
Peter Wu bdd0965820 Qt: replace zoom buttons by wheel zoom in Wireless Timeline
There are already "zoom" buttons on the main toolbar, remove the
additional, confusing wireless timeline zoom buttons.

Implement zoom functionality by the mouse wheel instead and center at
the cursor position rather than the current packet. Properly bound the
maximum zoom level too to avoid incorrect calculations.

Change-Id: Icafe84b6985138b0223abb69c975dfc94df2817a
Ping-Bug: 13769
Reviewed-on: https://code.wireshark.org/review/22496
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-07 23:19:59 +00:00
Stig Bjørlykke 7bacf534d8 Qt: Set tooltip on ByteViewTab
Set the tab name as tooltip on ByteViewTab.  This is useful when
having many tabs on a small screen.

Change-Id: Idb375f0b7d510ecb9b42cfccc6ebc4dd798f463b
Reviewed-on: https://code.wireshark.org/review/22549
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-07 23:16:30 +00:00
Roland Knall a2fe8be603 Qt: Add convenience function and cleanup
Add a convenience function for the displayfilter combobox
and clean up some code. On Linux, the AltModifier does not work
as it is being used by xDMs to move the window around. Setting
it to Shift.

Change-Id: I1ee9638c1cf37f40dc21f19c4e0860adc4629d4e
Reviewed-on: https://code.wireshark.org/review/22529
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-07-06 13:21:10 +00:00
Peter Wu b8af91af64 Qt: try harder to sort packet list columns as number
Properly sort columns by their numeric value even if they have a unit
string suffix or if there are multiple occurrences. These do not
strictly parse as a number, so use a more lenient matching approach.

Bug: 13827
Change-Id: I3a777448a98c70fdc05fb847b05f20e2bc6f4486
Reviewed-on: https://code.wireshark.org/review/22489
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jim Young <jim.young.ws@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-07-04 03:31:11 +00:00
Sake Blok 3803e00367 Add option to use wall-clock intervals
Add the "interval" option to "-b". Each new capture starts at the
exact start of a time interval. For instance, using -b interval:3600
will start a new capture file at each whole hour.

Changed the duration option in the GUI interfaces to use the new
interval option.

Change-Id: I0180c43843f5d2f0c2f50153c9ce42ac7fa5aeae
Reviewed-on: https://code.wireshark.org/review/22428
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Sake Blok <sake.blok@SYN-bit.nl>
2017-07-03 16:41:37 +00:00
Roland Knall 8020be30fd Qt: Drag/Drop Filter buttons to order
Allow the ordering of the filter buttons via drag/drop in
the toolbar

Change-Id: Id8793d6514bae36066a7a23d6890985665e753bd
Reviewed-on: https://code.wireshark.org/review/22422
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-06-28 15:09:03 +00:00
Roland Knall 9731b50bc5 Qt: Change wording of filter button context menu
Change the wording to make it more like the other option
menus

Change-Id: I0d071aecd80131e5304737a1746f3a41f546c8e4
Reviewed-on: https://code.wireshark.org/review/22441
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-06-28 15:08:50 +00:00
Peter Wu 6bc0ba8451 Qt: fix alloc-dealloc-mismatch while adding named pipe
ManageInterfacesDialog::on_addPipe_clicked uses g_new0 to create an
"interface_t" instance, but InterfaceTreeCacheModel uses qDeleteAll
which results in ASAN reporting "alloc-dealloc-mismatch (malloc vs
operator delete)".

To fix this, remove the dynamic allocation and make
InterfaceTreeCacheModel store the instance internally.

Change-Id: I9426dfc88d0a54a889bbbc9cf336c0a6af76920e
Reviewed-on: https://code.wireshark.org/review/22410
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-06-27 21:16:10 +00:00
Roland Knall 1426c44281 Qt: Context menu for toolbar filter buttons
Adds a context menu for the toolbar filter buttons, which allows for
opening the preference for the filter buttons, as well as direct edit,
removal and disable functionality

Change-Id: I5f2d132737c77804cf22834574dfe3c02f85fbdf
Reviewed-on: https://code.wireshark.org/review/22327
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-06-27 15:14:56 +00:00
Roland Knall 680d1df7a0 Fix Filter Tooltip button and frame
Make the frame into a two-row frame to better accomodate
the comments field, and reinstate the correct action for the
buttons

Change-Id: I171e4bc3c7f195b7179cd6b1c2ab4ab42ede9c04
Reviewed-on: https://code.wireshark.org/review/22405
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-06-26 14:33:37 +00:00
Michael Mann 7ecea31581 Change display filter button tooltip formatting.
Go from <expression>,<comment> to <comment>\n<expression>

Bug: 13814
Change-Id: I842e38798eba7ff87751733ce0b2befdc9c8c27f
Reviewed-on: https://code.wireshark.org/review/22395
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-26 06:27:24 +00:00
Michael Mann 5c60b517a7 Add support for comments for a display filter button
Add a field to the display filter button UAT to allow comments
to be displayed as part of the tooltip to the diplay filter
button

Bug: 13814
Change-Id: I74459e4102856258d31d6429e2fd924a9f798cd5
Reviewed-on: https://code.wireshark.org/review/22390
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-26 02:48:58 +00:00
Michael Mann 1b7f5d9f79 Convert filter expressions preference data to a UAT.
The filter expressions data was shoved into the preference file in a
very loose, non-arrayed form.  It's much easier to manage in code
(and for users in a separate file) as a UAT.

The GTK GUI was hacked to use the existing UAT dialog rather than
rewrite the pref_filter_expressions.c to support a UAT. Should
be okay since it's deprecated.

Change-Id: I688cebb4b7b6594878c1398365e79a205f1902d9
Ping-Bug: 13814
Reviewed-on: https://code.wireshark.org/review/22354
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-26 02:44:05 +00:00
Michael Mann 395775acce Sample deprecated filter -> Sample warning filter
"Warning" is a more appropriate name because filter may not
be as deterministic as user desires

Bug: 13834
Change-Id: Ie34e37db8866dc409f25df227a4d34e7c11d0058
Reviewed-on: https://code.wireshark.org/review/22392
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-25 22:51:47 +00:00
Gerald Combs 5f7902d165 [Automatic update for 2017-06-25]
Update manuf, services enterprise-numbers, translations, and other items.

Change-Id: I6febcb360b1b3e5e761086d422050e6ec95d5c45
Reviewed-on: https://code.wireshark.org/review/22384
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-06-25 08:09:35 +00:00
Stig Bjørlykke 578f2a15bb Qt: Restore multi custom column width and align
Put custom column field settings in quotes in the recent file to
support multi custom columns which contains space.  Otherwise the
space will be removed in prefs_get_string_list() and the field will
not match when reading the recent file.

Change-Id: Ic6e2b1e02d68970a4e11fbecbe55a7b10f8b10dd
Reviewed-on: https://code.wireshark.org/review/22349
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-22 15:57:12 +00:00
Michael Mann 29e726a606 Add support for "bool" and "display filter" types for UATs.
Filter expressions needs support for a checkbox (bool) and
string field that verifies display filters.

Change-Id: Idfbffd6cdb5abaee8914126a05d890e834c17306
Reviewed-on: https://code.wireshark.org/review/22340
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-22 13:07:11 +00:00
Peter Wu 16f70b9bb1 Qt: fix sorting of custom columns with multiple fields
Fields like "dns.time || http.time || smb.time" were sorted by column
number before. Recognize when all fields are numeric values and then try
to sort by number and otherwise fallback to a value comparison.

In theory sorting should now also be a bit faster for custom columns
because the columnn type is looked up once.

Change-Id: Id40d7cce8080d05823d74459fc493ec6ebf80956
Reported-by: Laura Chappell
Reviewed-on: https://code.wireshark.org/review/22317
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-21 21:00:44 +00:00
Peter Wu b44ad2a0fa Qt: display newlines in capture file comments
Due to the use of HTML, whitespace (including newline) are shown as
single horizontal space. Add a special case for newlines.

Bug: 13819
Change-Id: Iefa2af7d2948ed18a3b7f8f4ee8cb90100bf3460
Reviewed-on: https://code.wireshark.org/review/22306
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-21 16:14:00 +00:00
Peter Wu 4deb97f31f Fix filter for "Next Packet in Conversation"
The "Previous/Next Packet in Conversation" actions accidentally
overwrites more specific filters (like TCP port matching) by less
specific ones (like IP addresses). This resulted in strange behavior
where packets from different TCP streams were selected.

Change-Id: Ifa93064e1db3777fa3c12e2220bbb0b36b9478fe
Reported-by: Christian Landström
Reviewed-on: https://code.wireshark.org/review/22274
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-06-20 20:34:23 +00:00
Roland Knall 6b9b4bd968 Fix Toggle indicator for search
Removing the toggle indicator. Search behaves now the same as it
does for e.g. in SublimeText

Change-Id: I4523001b536caa116bcb989f0850aa769c6220f8
Reviewed-on: https://code.wireshark.org/review/22280
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-06-20 19:58:05 +00:00
Stig Bjørlykke 75f9247c2c Qt: Rename "Filter Expressions" to "Filter Buttons"
Change-Id: I7adcb1d28d239bbc25d8a7a5969b34c6db84e022
Reviewed-on: https://code.wireshark.org/review/22277
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-06-20 19:51:30 +00:00
Peter Wu 4d90f2e092 Qt: make Wireless Timeline a separate item
Do not put the wireless timeline in the main view with splitters, it has
a fixed size anyway and is not taken into account for layout and size
calculations for the panes.

Bug: 13776
Change-Id: I71da962950c3f1b215908674f4852afa76744343
Reviewed-on: https://code.wireshark.org/review/22242
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Simon Barber <simon.barber@meraki.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-20 13:49:01 +00:00
Stig Bjørlykke be4dbf840b Qt: Turn off auto scroll when going to a packet
When going to a packet (first, last, next, prev and specific) during
capture we must turn off auto scroll to let the packet be shown
in the packet list.

Change-Id: If1c615eb4d422c3b4c0418114064f7a4a0b75b35
Reviewed-on: https://code.wireshark.org/review/22244
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-20 02:26:04 +00:00
Jeff Morriss 4e46352657 Don't scroll back to the selected frame when we get name resolution updates.
With live or large capture files and asynchronous name resolution this can
cause serious scrolling issues as the name resolutions come in.

Bug: 12074
Change-Id: I1a5cca410c0608927b32e9e7107885370caf14d7
Reviewed-on: https://code.wireshark.org/review/22245
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-20 02:24:31 +00:00
Stig Bjørlykke 583c250467 Qt: Flush signals when disable protocols
When opening the enabled protocols dialog from a protocol preferences
menu we must flush app signals to ensure a redissect is done.

Change-Id: I512b8f6959aabcc15ccffc67615583ee9c60ceec
Reviewed-on: https://code.wireshark.org/review/22224
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-06-19 16:33:17 +00:00
Roland Knall d83176ed2e SearchBar - Focus on shortcut instead of closing
If the searchbar is already open focus on the bar and highlight
existing test, instead of closing an already open bar

Change-Id: I4f8ae2e903cb65c0ebca238f3bcc1c62b63b5c3b
Reviewed-on: https://code.wireshark.org/review/22223
Reviewed-by: Roland Knall <rknall@gmail.com>
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-19 15:23:15 +00:00
Anthony Coddington 193cef0bcb Attempt to clean up addr_resolv flags by removing DUMMY_ADDRESS_ENTRY
Replace with easier to understand and already present NAME_RESOLVED given dummy address is always filled.

Change-Id: If8464f89e88722aac70689749fe0d4a31c119db2
Bug: 13798
Reviewed-on: https://code.wireshark.org/review/22110
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-19 14:33:09 +00:00
Gerald Combs 1247693a99 [Automatic update for 2017-06-18]
Update manuf, services enterprise-numbers, translations, and other items.

Change-Id: I9a55ca147bd4e42b9caded98294597acfad99909
Reviewed-on: https://code.wireshark.org/review/22203
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-06-18 08:11:08 +00:00
Peter Wu 800a856fb4 Qt: fix hang on exiting Qt while loading capture file
testCaptureFileClose can also be invoked while reading an existing
capture file (the original comment only applied to GTK+, not Qt). When
the user quits Wireshark while reading an offline pcap, this could
result in a confusing "Unsaved packets" dialog. Fix this by checking the
actual capture session state.

After fixing this, the next issue is that cf_close trips on an assertion
("cf->state != FILE_READ_IN_PROGRESS"). To address this problem, do not
close the capture file immediately, but signal to the reader (cf_read)
that this should be done (similar to the quit logic in GTK+).

Bug: 13563
Change-Id: I12d4b813557bf354199320df2ed8609070fdc58a
Reviewed-on: https://code.wireshark.org/review/22096
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-06-17 14:22:04 +00:00
sfd 9dc4d271cd Fix the display of the IPv4 Hash Table in Resolved Addresses Dialog QT UI
Was sign extending the key to 64-bit in Linux.

GPOINTER_TO_UINT should not be stored in 'int', use guint.

Change-Id: Ib4a994fdda5d69a589d3cffce644584103f2cd1d
Reviewed-on: https://code.wireshark.org/review/22107
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-13 03:52:58 +00:00
Gerald Combs 1cf57230b7 [Automatic update for 2017-06-11]
Update manuf, services enterprise-numbers, translations, and other items.

Change-Id: Ia8c543f56fc9d09e78174d76144577a99359cc39
Reviewed-on: https://code.wireshark.org/review/22067
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-06-11 08:11:14 +00:00
Stig Bjørlykke f1496b6dff Qt: Wireless Timeline improvements
- Change keyboard shortcuts to Ctrl+Shift+[IOU]
- Use UTF8_MICRO_SIGN in tooltip text
- Change 0xffffffffffffffff with G_MAXUINT64
- Check for valid wlan_radio *ri before use
- Small whitespace cleanups

Change-Id: I9fa85c0d675ef3837510afaf5f1b723d89ac134c
Ping-Bug: 13769
Reviewed-on: https://code.wireshark.org/review/21993
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Simon Barber <simon.barber@meraki.net>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-06-07 13:09:03 +00:00
Stig Bjørlykke eb15222af2 Qt: Build wireless_timeline.cpp with -Wshorten-64-to-32
[...]/wireshark/ui/qt/wireless_timeline.cpp:190:50: error: implicit
   conversion loses integer precision: 'unsigned long' to 'guint' (aka 'unsigned int')
   [-Werror,-Wshorten-64-to-32]
     guint half_window = (end_tsf - start_tsf)/2;
           ~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~^~

Change-Id: I675408f8a6c0809588ce89b2b98e05d7bfb10ed9
Reviewed-on: https://code.wireshark.org/review/21969
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-06-05 17:52:44 +00:00
Simon Barber 21305e9835 Add a timeline view for packets, with the timing data used to generate the display
taken from the timing analysis done in the wlan_radio dissector. QT only.

The timeline background is light gray, white for packets displayed in the packetlist,
and blue for the currently selected packet. Packets are coloured according to the
colouring rules foreground colour. The timeline can be zoomed with controls on the
toolbar.

At higher zoom levels the duration (NAV) field is plotted as a horizontal line to the
right of a packet.

The height of a packet in the timeline is proportional to the RSSI.

The bottom half of the packet is only shown if it matches the display filter.

Todo:
Auto detect TSF timing reference point (start/end of packet)
Add a scrollbar
Add a ruler showing time
Improve handling of focus.
Do not display NAV for packets with bad FCS.
Show related packets graphically
Different Y axis modes
- bandwidth/channel use display
- different transmitters per line
- background color from coloring rules
Live capture support

Change-Id: Ic31fffb0d6854966361ade7abb5c0be50db9a247
Reviewed-on: https://code.wireshark.org/review/20043
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-05 11:25:51 +00:00
Guy Harris d0865fd619 Allow bigger snapshot lengths for D-Bus captures.
Use WTAP_MAX_PACKET_SIZE_STANDARD, set to 256KB, for everything except
for D-Bus captures.  Use WTAP_MAX_PACKET_SIZE_DBUS, set to 128MB, for
them, because that's the largest possible D-Bus message size.  See

	https://bugs.freedesktop.org/show_bug.cgi?id=100220

for an example of the problems caused by limiting the snapshot length to
256KB for D-Bus.

Have a snapshot length of 0 in a capture_file structure mean "there is
no snapshot length for the file"; we don't need the has_snap field in
that case, a value of 0 mean "no, we don't have a snapshot length".

In dumpcap, start out with a pipe buffer size of 2KB, and grow it as
necessary.  When checking for a too-big packet from a pipe, check
against the appropriate maximum - 128MB for DLT_DBUS, 256KB for
everything else.

Change-Id: Ib2ce7a0cf37b971fbc0318024fd011e18add8b20
Reviewed-on: https://code.wireshark.org/review/21952
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-05 05:28:26 +00:00
Gerald Combs 916f1a6cf0 [Automatic update for 2017-06-04]
Update manuf, services enterprise-numbers, translations, and other items.

Change-Id: I95d3c8d0ce5c4215730d461f00812d48fd697892
Reviewed-on: https://code.wireshark.org/review/21932
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-06-04 08:09:33 +00:00
Stig Bjørlykke e4c15408de Qt: Add version check for setTextInteractionFlags
This property was introduced in Qt 5.1.

Change-Id: I3446886d65fbeaf011a69071b605b044e5205b60
Reviewed-on: https://code.wireshark.org/review/21895
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-02 11:56:03 +00:00
Stig Bjørlykke 6751928e9c Qt: Enable unhiding all interfaces.
When having hidden interfaces it was not possible to unhide all
in the "Manage Interfaces" dialog because prefs.capture_devices_hide
was not updated when not having any hidden interfaces.

This bug was introduced in g6eee29bf.

Change-Id: If94c2e592eea60e6f1ef1ce2107ff9b2b27c3176
Reviewed-on: https://code.wireshark.org/review/21869
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-06-01 08:57:18 +00:00
Gerald Combs 6a37b542e4 Qt+prefs: Add a dark theme check and default colors.
Add prefs_set_gui_theme_is_dark and call it in the WiresharkApplication
constructor. Add a set of dark syntax color defaults.

We could alternatively add a preference for the syntax foreground color,
but that would imply adding a preference for the background color as
well.

Bug: 11131
Bug: 13738
Change-Id: Iefe135ed04e63372ed434c5b9759647c9f4046e3
Reviewed-on: https://code.wireshark.org/review/21827
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-01 08:07:05 +00:00
Stig Bjørlykke dc7b9cdb41 Qt: Disable -Wframe-larger-than= for ui_main_window.h
The generated Ui_MainWindow::setupUi() can grow larger than our configured
limit, so turn off -Wframe-larger-than= for ui_main_window.h.

Change-Id: I550ff30ebe566b711c63f7a9d0276e5b06244407
Reviewed-on: https://code.wireshark.org/review/21866
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-06-01 07:27:05 +00:00
Stig Bjørlykke 7f96ffe5d4 Qt: Capitalize "Select SACKs" in tcptrace graph.
Change-Id: I2d0b433fec482431f6ccfe6f8fe6576193fc7773
Reviewed-on: https://code.wireshark.org/review/21863
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-05-31 18:54:05 +00:00
Stig Bjørlykke 152996652d Qt: Add cast to QByteArray.resize()
Change-Id: I651cf6e625b8c757820a1e879f3fbde99746ba88
Reviewed-on: https://code.wireshark.org/review/21860
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-05-31 17:10:46 +00:00
Michael Mann 6c44f2017c Qt: Add support to verify extcap capture filter
Bug: 11668
Change-Id: Ib218d87c1905e53ffdab4e3dd6f93ba2c3d07c8b
Reviewed-on: https://code.wireshark.org/review/21770
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-05-30 18:10:03 +00:00
Stig Bjørlykke 10d7e391b3 Qt: Fix capture filter verification for non-extcap interfaces.
Change-Id: Id45052f21ebb290bf92c201370584156a65f2e19
Reviewed-on: https://code.wireshark.org/review/21777
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-29 15:33:02 +00:00
Pau Espin 866178eb1f GTK+Qt: Show Osmux Packet Counter on Telephony menu
Change-Id: I565b0d2d43dd98781f77a302a20bd841e3e4650e
Reviewed-on: https://code.wireshark.org/review/21598
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2017-05-28 18:50:06 +00:00
Jaap Keuter 2023f419f4 Qt: About dialog fails when configured without plugins
The about dialog compilation fails when plugins and LUA are disabled.
Add the missing preprocessor statements.
Also make the plugin tab really empty when there's nothing to report.

Change-Id: Idba0dc86e7110e56b2d949f517c966a121d28e47
Reviewed-on: https://code.wireshark.org/review/21768
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-27 12:20:02 +00:00
Michael Mann 9bd2b63968 Don't try to compile capture filter if pcap_compile isn't available.
This is most likely due to WinPcap not being installed.

Bug: 13672
Change-Id: Ic7069f98c7f8068cdc5045204c2e23ab56b3f7eb
Reviewed-on: https://code.wireshark.org/review/21757
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-25 22:14:45 +00:00
Gerald Combs 333711430a [Automatic update for 2017-05-21]
Update manuf, services enterprise-numbers, translations, and other items.

Change-Id: I4a0774a6aa3ecb101b7ca0a87571544dc936012d
Reviewed-on: https://code.wireshark.org/review/21723
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-05-21 08:15:14 +00:00
Stig Bjørlykke 6bc71e4d0a Qt: Add check for packet bytes
Disable menu items handling packet bytes if not having any.

Bug: 13723
Change-Id: I9cdb1185910f865c61a8ee74e3cf3177159bf315
Reviewed-on: https://code.wireshark.org/review/21710
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-05-19 21:31:50 +00:00
Stig Bjørlykke 4424a8e862 Qt: Check for no tvb in Show Packet Bytes
Bug: 13723
Change-Id: I145fe93fc05a9cfdc6c0fc949274a1e88dcf2f1e
Reviewed-on: https://code.wireshark.org/review/21709
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-05-19 21:31:23 +00:00
Gerald Combs d8df8415af [Automatic update for 2017-05-14]
Update manuf, services enterprise-numbers, translations, and other items.

Change-Id: Ia7833dc62cb4f4687da664b66eba6c5f31437f9a
Reviewed-on: https://code.wireshark.org/review/21630
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-05-14 08:14:09 +00:00
Guy Harris 635ae3d147 Don't include pcap headers if you don't have pcap.
Don't try to compile code that uses pcap if you don't have it.

Change-Id: Ifa98b4ff47783f5347cb6e1129bbf4e5cac35aab
Reviewed-on: https://code.wireshark.org/review/21611
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-12 02:24:45 +00:00
Guy Harris 7321183716 Put the HAVE_REMOTE hack into wsutil/wspcap.h, and include that file.
Have a header file that defines HAVE_REMOTE if HAVE_PCAP_REMOTE is
defined, and then includes pcap.h.  Replace all other includes of
pcap.h, and the definition of HAVE_REMOTE, with includes of that file.
Check for anything other than wspcap.h including pcap.h in checkAPIs.pl.

Change-Id: I3cbee8208944ad6f006f568b3fe3134e10b2a883
Reviewed-on: https://code.wireshark.org/review/21605
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-11 19:58:15 +00:00
Guy Harris 79eab8ca07 Force HAVE_REMOTE to be defined when including pcap.h with remote support.
WinPcap made the mistake of having stuff in its public header fines
depend on a configuration #define, HAVE_REMOTE; this means that we need
to forcibly define it when building with remote capture support.

The tip of the libpcap master branch does not have that botch; hopefully
future versions of libpcap-for-Windows will be based on that libpcap and
thus lack that botch as well.

Defining HAVE_REMOTE in config.h is not the right fix, as it makes it
look like a *Wireshark* configuration option that code in Wireshark
should test, rather than a *WinPcap* configuration option that the
pcap.h that ships with the WinPcap SDK should have been changed, as part
of the build process, to correctly define or not, so that users of
WinPcap don't have to define it themselves.

Change-Id: I62d1eca6d3c900d0dcc9fbc011db77f595a86313
Reviewed-on: https://code.wireshark.org/review/21593
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-11 10:57:22 +00:00
Peter Wu ab504191fc Qt: try harder to find a working monospace font
QFont::toString returned the default font (which might be unavailable),
leading to use of non-monospace fonts in the bytes view. Detect the
effective font instead and apply it to avoid this issue.

Add additional logic to invoke font detection when the configured font
is bad (for example, because of the bug or because a font has been
removed in meantime).

Bug: 13638
Change-Id: I8a625cf365c90119caebe8c4deada0df7426e53a
Reviewed-on: https://code.wireshark.org/review/21551
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
Petri-Dish: Jörg Mayer <jmayer@loplof.de>
Tested-by: Jörg Mayer <jmayer@loplof.de>
Reviewed-by: Ahmad Fatoum <ahmad@a3f.at>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-08 03:07:43 +00:00
Gerald Combs 2aa3adf559 [Automatic update for 2017-05-07]
Update manuf, services enterprise-numbers, translations, and other items.

Change-Id: Iae34b6ae74e4b6f891756732107aa1fdfa9ffa51
Reviewed-on: https://code.wireshark.org/review/21541
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-05-07 15:19:29 +00:00
Jaap Keuter 8e52cfb891 Qt: Inhibit Disable Protocol when applicable
The packet details context menu allows you, through the Protocol
Preferences sub menu to manipulate (disable) the protocol dissection
through the Disable <protocol>... option. This opens up the appropriate
dialog and select the applicable protocol.
This fails for protocols which have their can_toggle flag reset (e.g.
the frame protocol). The dialog opens, but the protocol can't be found,
hence the top item is selected.

Instead disable the menu option for protocols which can't have their
enabled state toggled.

Change-Id: Ifa83f656a8ab747f379d3ca0114520e5efed4b67
Reviewed-on: https://code.wireshark.org/review/21494
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-04 21:20:42 +00:00
Stig Bjørlykke 527c31fdc9 Qt: Fix build without extcap
Change-Id: Ibfcdb719408c0172ae78bf3b2761ff551ff6313c
Reviewed-on: https://code.wireshark.org/review/21461
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-05-02 12:37:04 +00:00
Stig Bjørlykke 741d4f5898 Qt: Interface Toolbar improvements
- Select one of the capturing interfaces when start capture
- Only send user changed control values when start capture
- Don't show hidden interfaces
- Allow a toolbar with no interfaces
- Renamed button role "reset" to "restore"
- Improved control number validation
- Updated documentation

Change-Id: Icc8d04043c95c1f3ef8d7cdc3b251be4471cba0a
Reviewed-on: https://code.wireshark.org/review/21445
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-05-02 09:34:01 +00:00
Gerald Combs 5de615c0a7 [Automatic update for 2017-04-30]
Update manuf, services enterprise-numbers, translations, and other items.

Change-Id: I491517d8801f9b5d3d3084102ed35b418460e4b6
Reviewed-on: https://code.wireshark.org/review/21427
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-04-30 15:16:57 +00:00
Stig Bjørlykke 8012dcc712 Qt: Remove semicolon behind Q_UNUSED macro
Change-Id: Ief5f7bca5d110df8958307b58fc11bf740787dfd
Reviewed-on: https://code.wireshark.org/review/21349
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-04-26 06:30:21 +00:00
Stig Bjørlykke 81bad32f2c Qt: Remove semicolon behind Q_UNUSED macro, part 2
Change-Id: Id27a93c9a76b554bb2e98199d08d3d9604550889
Reviewed-on: https://code.wireshark.org/review/21348
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-04-26 06:27:37 +00:00
Stig Bjørlykke 30d98d1ea9 Qt: Remove semicolon behind Q_UNUSED macro
Change-Id: I75ff975216da23447b94bc513671ac269c52b7dc
Reviewed-on: https://code.wireshark.org/review/21342
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-04-26 06:11:32 +00:00
Stig Bjørlykke 3b5cfa9a77 Qt: Don't use _U_ for unused parameters in C++
Change-Id: If7acab5f438bb20b053fdcfef86b2f06765b5321
Reviewed-on: https://code.wireshark.org/review/21341
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-04-26 06:11:20 +00:00
Guy Harris f493bad8a2 Fix no-extcap build.
Change-Id: I9f01264bf5f0c28a4d871f6d983e9efed1c23259
Reviewed-on: https://code.wireshark.org/review/21347
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-26 04:48:42 +00:00
Dario Lombardo 0557fe1446 Qt: fix compilation without pcap.
Change-Id: Ia0fe79157f21fd0b1c0e5195c902ae07c55ca253
Reviewed-on: https://code.wireshark.org/review/21343
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-25 23:14:00 +00:00
Stig Bjørlykke f9f2b84e65 Qt: Make text in SimpleDialog selectable by mouse
This makes it easier to copy error messages.

Change-Id: I39284d9b2d716336c6fc4b211e5346abcebf0aee
Reviewed-on: https://code.wireshark.org/review/21326
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-04-25 08:06:21 +00:00
Stig Bjørlykke 77751c94f1 Qt: Add interface toolbar support
An extcap utility can provide configuration for controls to use in a
GUI interface toolbar.  This controls are bidirectional and can be
used to control the extcap utility while capturing.

This is useful in scenarios where configuration can be done based on
findings in the capture process, setting temporary values or give other
inputs without restarting current capture.

Todo:
- Add support for Windows

Change-Id: Ie15fa67f92eb27d8b73df6bb36f66b9a7d81932d
Reviewed-on: https://code.wireshark.org/review/19982
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-04-25 06:19:39 +00:00
Guy Harris e52c95c6c8 Move UI-only stuff out of libwireshark.
Packet ranges are used only in the UI; move the packet range stuff into
libui.

Don't pass a print_args_t structure to libwireshark packet-printing
routines, just pass the few parameters they need.  Move the declaration
of print_args_t into file.h.

Change-Id: Icff5991eea7d7d56f33b4716105895263d275bcf
Reviewed-on: https://code.wireshark.org/review/21308
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-24 03:38:21 +00:00
Gerald Combs 69762f5d1c [Automatic update for 2017-04-23]
Update manuf, services enterprise-numbers, translations, and other items.

Change-Id: If8e6efa61c4c2808c51c585b0c61fd76a321c3fd
Reviewed-on: https://code.wireshark.org/review/21298
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-04-23 15:17:54 +00:00
Guy Harris 9e9d284d91 Have separate routines for open-for-reading and open-for-writing errors.
Expand comments while we're at it.

Change-Id: I6dcc791eab1c9e323a9572f3d54720d223bdd64b
Reviewed-on: https://code.wireshark.org/review/21252
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-20 18:24:20 +00:00
Peter Wu 9b0b2c3d59 Qt: show relative time for the IO Graph in an appropriate unit
The GTK+ UI performs automatic formatting of the units (us, ms, s) based
on the magnitude of the value (for MIN/MAX/SUM calculations). Internally
the numbers are stored as integers (microseconds).

The Qt UI did not have this formatting feature yet and would therefore
display the values as-is (in microseconds). This patch rescales the Y
value and appends an appropriate label (s, ms or us).

With multiple graphs, rescaling is disabled completely for simplicity
(GTK+ would still try to find an appropriate unit prefix if there are
multiple time graphs).

Bug: 12828
Change-Id: I26ed68fc3497e06ac283a618fee8b673b1b0cf71
Reviewed-on: https://code.wireshark.org/review/21062
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-04-20 15:18:36 +00:00
Peter Wu 691d803037 Qt: Prevent moving other columns on drag and drop
This workaround prevents moving around other columns during drag and
drop and also transfers the sorting order to the new position.

Bug: 13183
Ping-Bug: 13540
Change-Id: I4609c63557bf3abf06ba417ac1b40cac22a82abc
Reviewed-on: https://code.wireshark.org/review/21022
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-04-20 15:06:19 +00:00
Max Dmitrichenko ba3fbc5adb memory leak: Qt code doesn't pass 'parent' argument to some Qt class constructors
found with valgrind

Change-Id: I2d73bd50a6f0e13b1817c8a518189c0e56558f72
Reviewed-on: https://code.wireshark.org/review/21227
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-04-20 11:24:20 +00:00
Xiaochuan Sun d13c6d9628 remove unnecessary guint64 cast in IO graph
Change-Id: I35d666a5a9fb5813706c312334f1552703c9475c
Reviewed-on: https://code.wireshark.org/review/21214
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-19 04:51:08 +00:00
Guy Harris 1015fa0431 Have a common "capture file close alert box" routine.
Take cf_close_failure_alert_box() and put it into libui, with the name
cfile_close_failure_alert_box().  Use it not only in file.c but also
in ui/export_pdu_ui_utils.c, ui/gtk/file_import_dlg.c, and
ui/qt/import_text_dialog.cpp where the error we get back isn't
necessarily an errno.

Have ui/gtk/file_import_dlg.c and ui/qt/import_text_dialog.cpp also use
cfile_open_failure_alert_box() on open errors.

Change-Id: I987f339a23ea58609390306a319923e7f92d5c07
Reviewed-on: https://code.wireshark.org/review/21203
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-18 21:02:54 +00:00
Stig Bjørlykke 1b7677e32f CMake: Sort entries
Put additional_toolbar in sorted position.

Change-Id: I483bca72265a5932f54ccf882c6659e94be5d95b
Reviewed-on: https://code.wireshark.org/review/21183
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-04-18 10:57:28 +00:00
Stig Bjørlykke 951cf710e8 Qt: AdditionalToolbars is a menu
Rename actionViewAdditionalToolbars to menuAdditionalToolbars
because this is a menu, not an action.

Change-Id: I85e45c065f415ffa008792f04127d81283e54b7e
Reviewed-on: https://code.wireshark.org/review/21181
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-04-18 09:21:30 +00:00
Ahmad Fatoum b478df61f5 Qt: Provide both file save and open preferences
This is a breaking change.

prefs_register_filename_preference hasn't been differentiating
between files to be saved and ones to be opened.

On GTK, a neutral dialog is used, so no problems there.
On Qt, a save dialog has been always used, even in dissectors that
were reading configuration files without modification.

prefs_register_filename_preference now takes an argument to indicate
whether UI could be a save dialog with a warning on overwriting
a file, or whether it's a general purpose open file dialog.

Qt now does this. Previously no warning was shown on overwriting a file,
so it may be used for opening files too without irritating the user.
This has been changed, as non-destructive reads should now use
the open dialog.

Dissectors were changed accordingly.

Change-Id: I9087fefa5ee7ca58de0775d4fe2c0fdcfa3a3018
Reviewed-on: https://code.wireshark.org/review/21086
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-04-17 10:51:10 +00:00
Gerald Combs b2219bbccb [Automatic update for 2017-04-16]
Update manuf, services enterprise-numbers, translations, and other items.

Change-Id: I8165b1b2db0f81049a88dd17163a4367f04f83cc
Reviewed-on: https://code.wireshark.org/review/21142
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-04-16 15:17:00 +00:00
Guy Harris 4d2d423106 Rename routines to clarify what they do.
XXX_prime_with_YYY makes it a bit clearer than does XXX_prime_YYY that
we're not priming YYY, we're priming XXX *using* YYY.

Change-Id: I1686b8b5469bc0f0bd6db8551fb6301776a1b133
Reviewed-on: https://code.wireshark.org/review/21031
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-12 04:56:49 +00:00
Guy Harris c079255539 Add an API to let a postdissector specify fields whose values it needs.
Currently, this is only used to determine whether a protocol tree needs
to be built on the first pass or not - if there are postdissectors that
need fields, it does - but eventually we should be able to use it to
prime the dissection to deliver those fields in cases where we don't
need the *entire* protocol tree (rather than using a hack such as
cooking up a fake tap with a fake filter to do that).

Update MATE and TRANSUM to use it.

Clean up code to check whether we need a protocol tree, and add comments
before that code indicating, in each case, what the criteria are.

The array of postdissectors includes a length, so we don't need to
separately keep track of the number of postdissectors.

Clean up indentation while we're at it.

Change-Id: I71d4025848206d144bc54cc82941089a50e80ab7
Reviewed-on: https://code.wireshark.org/review/21029
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-12 04:31:19 +00:00
Peter Wu 73e24b31de Qt: mark bool and enum prefs as changed when modified via the menu
When preferences are modified, these must be marked to ensure that the
"prefs_changed" callback for Lua dissectors is invoked.

Bug: 13536
Change-Id: Ib93b2920ebefbc1532d3c6cd097f802a45ec6f35
Reviewed-on: https://code.wireshark.org/review/21016
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-11 19:28:08 +00:00
Guy Harris 6b3714254d Pull all the "load settings" calls into a epan_load_settings() routine.
That way, nothing using libwireshark needs to know what settings need to
be loaded, they just call epan_load_settings().

Change-Id: I9390e259e286fc4f5acaeaac2767e4c3c4b656af
Reviewed-on: https://code.wireshark.org/review/20983
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-09 22:40:30 +00:00
Guy Harris 7d5ce06cbe Pull the error reporting into {read,save}_filter_list.
Change-Id: I4d9582661f2f1728d400eeb2a1b1dea98f32ce7f
Reviewed-on: https://code.wireshark.org/review/20982
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-09 17:57:52 +00:00
Gerald Combs 05c501373d [Automatic update for 2017-04-09]
Update manuf, services enterprise-numbers, translations, and other items.

Change-Id: I147cbfa4c9cca70ad581d2e3c149473afd243086
Reviewed-on: https://code.wireshark.org/review/20978
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-04-09 17:00:54 +00:00
Guy Harris 77cad8561c Move the filter file reading code to libui.
It doesn't belong in libwireshark, as it doesn't affect dissection, but
it *does* belong in libui, as it's helper code for the UIs.

Change-Id: I8a5e0640a299a08e9ec1917dd253197438ebfdbc
Reviewed-on: https://code.wireshark.org/review/20974
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-09 04:25:52 +00:00
Guy Harris 62b342443d Pull the error-reporting code for preference files into read_prefs().
No need to duplicate it in N different programs.

Update comments while we're at it.

Change-Id: I3096cbe5448a19363eff6303bdd54e522dae9336
Reviewed-on: https://code.wireshark.org/review/20973
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-09 03:03:25 +00:00
Guy Harris 23a7890b6a Pull the code to save enabled/disabled lists into libwireshark.
It's identical in the GTK+ and Qt UIs, and it should just be done in
libwireshark.

Rename some routines to just speak of enabled_and_disabled_lists, so we
don't have to say enabled_and_disabled_protos_and_heuristic_dissectors
or something such as that.

Clean up indentation.

Change-Id: Ief2e612d9e1b60d8d0123b6bd3409dce5faf6495
Reviewed-on: https://code.wireshark.org/review/20970
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-09 02:00:37 +00:00