Commit Graph

48 Commits

Author SHA1 Message Date
Roland Knall cfd5457ec0 extcap: Add regular expression validation support
Regular expressions follow the Qt Regex syntax, which is
 formulated after the Perl Regex syntax. A more detailed
 overview of the possible rules can be found at:
 http://doc.qt.io/qt-4.8/qregexp.html

 If a required option is present, even the double-click on
 the interface will first start the options dialog (Qt only)

 Required fields are marked bold and put first in the dialog.
 Additionally if validation failes (which it will if a required
 field is kept empty, but also if a non-required textfield is
 violating the defined regex), the label of the field is marked
 with red.

Change-Id: If04a1146d0dfa778332ab2a39122c7a6ee1e93d2
Reviewed-on: https://code.wireshark.org/review/12914
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>
2016-01-05 14:41:12 +00:00
Gerald Combs b152ca3c20 Qt: Show physical interfaces first.
List physical interfaces before virtual (extcap) interfaces in the main
window. As cool and interesting as the randpkt interface is, I'm not
sure it should come before interfaces with live traffic.

Resize our columns once instead of each time we add an interface.

Change-Id: I917532ab1d76b48c3e307d1f5a1c6c02def4e8aa
Reviewed-on: https://code.wireshark.org/review/12933
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>
2015-12-30 05:34:39 +00:00
Peter Wu e3dd3f97f1 Qt: fix memleaks related to interface dialog
Also fix a not-so-problematic recent files "leak" when quitting
Wireshark.

Change-Id: I8556b07c197f0934f93d6da8c573c47fbd3fc060
Reviewed-on: https://code.wireshark.org/review/12529
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>
2015-12-16 05:43:58 +00:00
Mikael Kanstrup 3120d1f801 Fix memory leaks in all_ifaces when interface list changes
Valgrind report leaks of several allocations like these:
590 bytes in 50 blocks are possibly lost in loss record 29,818 of 31,670
   at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0xCB9C8A7: __vasprintf_chk (vasprintf_chk.c:82)
   by 0xA3D8DCA: g_vasprintf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4)
   by 0xA3B846C: g_strdup_vprintf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4)
   by 0xA3B850B: g_strdup_printf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4)
   by 0x6F4B51: scan_local_interfaces (iface_lists.c:254)
   by 0x6EF3D8: iface_mon_handler2 (iface_monitor.c:113)
   by 0xBE56F1D: ??? (in /lib/libnl-3.so.200.3.0)
   by 0xBA16F19: ??? (in /usr/lib/libnl-route-3.so.200.3.0)
   by 0xBE54E5E: nl_cache_parse (in /lib/libnl-3.so.200.3.0)
   by 0xBE585CA: nl_msg_parse (in /lib/libnl-3.so.200.3.0)
   by 0x6EF372: iface_mon_handler (iface_monitor.c:123)

When the list of network interfaces is updated allocations done
for global_capture_opts.all_ifaces elements leak memory. Fixed by
introducing a helper function to be used for removing an interface_t
element from all_ifaces array. While at it also fixed misc leaks when
updating individual allocated records of all_ifaces elements.

Change-Id: I035e6936a44edeef2ebe4780931c14cde99e93a4
Reviewed-on: https://code.wireshark.org/review/12209
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-12-11 10:38:32 +00:00
Stig Bjørlykke e75f74add6 Qt: Check capture filter only once when selecting interface(s)
Changed to only check capture filter once (for each active DLT) when
changing selected interface(s).  This optimizes filter checking and
avoids a "No interfaces selected" error when processing unselected
interfaces before selected.

Added a small optimization fetching device_name outside loop.

Bug: 11671
Change-Id: I01ed7a99a2a9ced9a86774a78bec2ba27b4bb97c
Reviewed-on: https://code.wireshark.org/review/12268
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-11-29 19:00:28 +00:00
João Valverde c00420efa2 Move utf8_entities.h to wsutil
Change-Id: I6298b3de5f0a1cb988014ff16082eaf8c2a3c3c0
Reviewed-on: https://code.wireshark.org/review/10786
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>
2015-10-05 14:34:53 +00:00
Gerald Combs b4e972b729 Fix a bunch of leaks found by Valgrind.
Change-Id: I8862ed15d354aee487bacd80ab5fb4918423287e
Reviewed-on: https://code.wireshark.org/review/10487
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-09-11 20:37:09 +00:00
Guy Harris 1ac7de58c7 Resize the name column every time we re-display the interface tree.
Interfaces can appear and disappear, changing the maximum length of the
interface name column; resize it each time we reconstruct the tree.

Change-Id: I38b40f6c3ce51272e8bbb0c7f7fbaa7255886e0e
Reviewed-on: https://code.wireshark.org/review/9641
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-07-15 03:54:21 +00:00
Joerg Mayer 0619ed241c Finish removal of Q_UNUSED.
Todo: qcustomplot via upstream

Change-Id: I19cf98f1281ecb1f6efbb7d36c997d5aa43f5baf
Reviewed-on: https://code.wireshark.org/review/9547
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2015-07-07 22:17:22 +00:00
Gerald Combs df352c535f Use StockIcon to load toolbar icons.
StockIcon loads each available icon size.

Change-Id: Ia5604cc11ed8350e7f4f782312939cf30c94f548
Reviewed-on: https://code.wireshark.org/review/9030
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-06-22 21:05:53 +00:00
Martin Kaiser 2e3629afea fix the interface list in the main welcome screen
when no interfaces are available at startup, the number of columns in
the interface tree is set to 1
when new interfaces become available later, the column number is not
reset to the default value and we end up with an interface list whose
entries are not visible
reset the number of columns each time the interface list is updated

Change-Id: I267c5b47da6d5ae9e7769b1036622f79da4d97f2
Reviewed-on: https://code.wireshark.org/review/8996
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-06-22 20:55:37 +00:00
Martin Kaiser 77ed0387c6 (trivial) fix a spelling mistake in a comment
Change-Id: I3f9feab57032c8c701c4ea487c0f5acca428d5d9
Reviewed-on: https://code.wireshark.org/review/8995
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-06-20 23:02:02 +00:00
Roland Knall 5727ebe689 extcap: Implement QT extcap options
Implementing a button in the interface list, to bring up
 the extcap options dialog, as well as a dialog, which will
 be generated depending on the selected extcap options.

Change-Id: I1733dc6a8c1a121089a9c353aff10bc4a53e86de
Reviewed-on: https://code.wireshark.org/review/8224
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-05-05 09:35:10 +00:00
Gerald Combs 6e88978fd9 Qt: More #include → forward declarations.
Change-Id: Ib6de71f801cd3053374b6c867370acd594dcd396
Reviewed-on: https://code.wireshark.org/review/7089
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-13 02:31:16 +00:00
Michal Labedzki ad1977bc19 Qt: Fix non-translate-able text
Change-Id: I8c2376117ca1ac92c341ba938929af2d13e23f72
Reviewed-on: https://code.wireshark.org/review/5291
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-11-14 10:27:34 +00:00
Guy Harris 97a920cb21 Don't free global_capture_opts.ifaces_err_info.
Leave it around in case InterfaceTree::display() gets invoked without an
intervening call to scan_local_interfaces() (that would cause a
double-free) or in case scan_local_interfaces() gets called afterwards
(as it frees global_capture_opts.ifaces_err_info before setting it
again, so there's no leak there, but there would be a double-free).

This should prevent at least one crash I've seen.

Change-Id: Iedd3959b420c09971557c473cc87aefd4454078c
Reviewed-on: https://code.wireshark.org/review/4917
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-23 10:27:57 +00:00
Guy Harris 35b4487538 Handle empty interface lists when the list changes.
Don't assume that a change to the interface list is from a non-empty
interface list to a different non-empty interface list.

Change-Id: I94054ca0cf2661704aff1869385aa2155c19677d
Reviewed-on: https://code.wireshark.org/review/3193
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-25 03:00:43 +00:00
Guy Harris 4261109e1e Don't return an error string for NO_INTERFACES_FOUND.
Most callers of capture_interface_list() don't expect an error string
for NO_INTERFACES_FOUND, because that's not really an error, it's just a
statement of face (and perhaps an error of 0 should be returned), so
they don't bother freeing the error string, causing a leak.

Instead, have the one place that *did* expect it to return an error
string just put "No interfaces found" itself.

Also, have that place not check for an error string if interfaces *were*
found, as no error code or string is returned in that case.

Change-Id: I9cb8ed7ad22810b23e2251d2833d9b7ab02eec03
Reviewed-on: https://code.wireshark.org/review/3165
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-22 18:51:47 +00:00
Guy Harris c7a2c89e40 Rename ifListChanged to localInterfaceListChanged.
That better indicates that it reflects changes to the list of local
interfaces on the system, as supplied by libpcap/WinPcap, not to any
other interface list we maintain, such as lists of remote interfaces, or
the list of non-hidden interfaces.

Change-Id: Idf79b365e07f2e3eaa83c105ae9cd7ace54c435e
Reviewed-on: https://code.wireshark.org/review/3154
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-21 23:30:58 +00:00
Guy Harris d81a34cc24 Have the interface "tree" directly connect to ifListChanged.
Then have the capture interfaces dialog connect only *its* code to
update *its* list of interfaces to ifListChanged, rather than connecting
a routine that then emits interfaceListChanged.

This makes it the responsibility of each widget that displays local
interfaces to connect to the ifListChanged signal.

Change-Id: Iff8e8ca4202c8784eed58c8f05175d986a16baea
Reviewed-on: https://code.wireshark.org/review/3153
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-21 23:15:49 +00:00
Irene Ruengeler f3c5f14bc4 Manage Interfaces
- Add dialog to manage interfaces
- Add and delete pipes
- Hide local interfaces

Change-Id: I08323c306c2ea736f99e57c28e2fe3170a0c2216
Reviewed-on: https://code.wireshark.org/review/2613
Tested-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Tüxen <tuexen@wireshark.org>
2014-07-02 20:56:37 +00:00
Irene Ruengeler df8c4bf264 Capture Interfaces Dialog:
- allow to change the interface options in the table
- save the options to preferences when the dialog is left
- add a field for setting a capture filter for all selected interfaces
- add a "Compile BPF" button and a window to show the compiled filter output
- try to address Alexis' and Evan's comments

Change-Id: Ic1272e29183ec80e2d2f4b3e494c79dabe2c3b6f
Reviewed-on: https://code.wireshark.org/review/1946
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-12 05:54:59 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Alexis La Goutte 056a5edc21 Comment debug...
svn path=/trunk/; revision=53567
2013-11-25 15:43:16 +00:00
Alexis La Goutte 43b1f47695 From Thomas ERSFELD (GSoC13) : Add Capture interface dialog window
* Reuse sparkline from welcome
* Split settings in tab (!= GTK)
* No all feature work (Work In Progress...)
* ...

Comments (and review) are welcome !

svn path=/trunk/; revision=53563
2013-11-25 14:15:49 +00:00
Gerald Combs 564ca2d5e9 Try to fix Qt compilation when libpcap is disabled.
svn path=/trunk/; revision=52552
2013-10-11 21:26:26 +00:00
Gerald Combs 576a16004b When we display an error message in the interface list make sure it's
word-wrapped.

svn path=/trunk/; revision=52473
2013-10-09 17:58:39 +00:00
Gerald Combs 186babc6ba When we close a main window, delete the welcome screen, which in turn
deletes the interface list, which in turn kills off the dumpcap process
it may be running. This should hopefully keep us from leaving dumpcap
processes running in the background on Windows. (Am I the only one
running QtShark on that platform?)

svn path=/trunk/; revision=51485
2013-08-23 02:34:51 +00:00
Luis Ontanon 24a5467228 Propagate the main_window_update change of few commits ago into the qt client
:wq



svn path=/trunk/; revision=50198
2013-06-27 19:24:39 +00:00
Irene Rüngeler 7eda94d5b0 QT: Select default interface if none else is selected
svn path=/trunk/; revision=48816
2013-04-11 13:35:28 +00:00
Gerald Combs 46a454a94c Automatically size the interface column.
svn path=/trunk/; revision=46351
2012-12-03 20:38:32 +00:00
Gerald Combs 9e67335ea8 Update the interface list to reflect the recent interface name changes.
Allow multiple interface selections. Make sure we update the packet list
properly in a couple of places.

Use the right callback+signal to update capture statistics in the status
bar. Remove the global cfile from the main_statusbar.cpp

Add the version to the main window.

svn path=/trunk/; revision=46350
2012-12-03 19:58:55 +00:00
Guy Harris 1105a21a8c Fix another reference to the "description" member of an if_info_t (in
commented-out code).

svn path=/trunk/; revision=46134
2012-11-22 07:02:53 +00:00
Gerald Combs 64c6710857 Have InterfaceTree wait until the application is initialized to start
gathering statistics. This fixes behavior broken by the recent startup
changes.

Enable and disable the SplashOverlay delay via a #define.

svn path=/trunk/; revision=45934
2012-11-05 19:11:11 +00:00
Evan Huus bebce51b6b Display the "no interfaces" message in qtshark on any type of error,
as otherwise certain errors result in just a blank box. Also be sure to
free the error string after QT's got its own copy.

svn path=/trunk/; revision=45068
2012-09-23 14:54:53 +00:00
Alexis La Goutte 42ace71553 Add modelines for Qtshark file
svn path=/trunk/; revision=44766
2012-09-04 08:18:31 +00:00
Gerald Combs d6ce6168bb Initialize a variable so that we can quit. Remove some debugging
statements.

svn path=/trunk/; revision=44715
2012-08-31 22:50:44 +00:00
Gerald Combs 5c715fcc19 It ain't Wireshark unless we can capture.
Implement basic capture start and stop. Add a lot of menu items and
enable and disable them when appropriate. Rename a few variables.

Next step: Let the user select an interface (we just use the default for
now).

svn path=/trunk/; revision=44714
2012-08-31 22:25:51 +00:00
Gerald Combs c12c712d9c More welcome screen layout updates. Instantiate the welcome screen
automatically. Try to make the sparklines resolution independent.

svn path=/trunk/; revision=44555
2012-08-17 19:37:18 +00:00
Gerald Combs a63c89d004 Auto-expand the welcome screen layout. Get rid of or comment out
debugging items.

svn path=/trunk/; revision=44549
2012-08-17 02:37:58 +00:00
Gerald Combs 2fe5163ec3 Lay out the welcome screen using Qt Designer.
svn path=/trunk/; revision=44547
2012-08-17 00:58:50 +00:00
Gerald Combs 1500f3bd42 Fix sparlines on Windows. Unfortunately this means listing device IDs
(for now at least).

svn path=/trunk/; revision=44258
2012-08-04 00:37:04 +00:00
Gerald Combs a234d1215c Move capture_globals.h from ui/gtk/ to ui/. Show interface activity
using sparklines in the qtshark main window.

svn path=/trunk/; revision=44253
2012-08-03 23:30:47 +00:00
Gerald Combs fc1e1a9d4c Get rid of a couple of focus halos.
svn path=/trunk/; revision=44145
2012-07-30 21:46:38 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Alexis La Goutte fe840481ec Add i18n to QtShark
The goal is only to translate the Gui (Not dissector)
Actually, there is only a french translation.

To try, (if you are not French) launch qtshark with LANG=fr ./qtshark (in ui/qt folder)

Missing some feature :
* Add preference to select (force) your language
* Some Gui Text, it no available for translation
* Documentation about how to translate (Coming soon...)
* Your translation !

svn path=/trunk/; revision=41389
2012-03-07 10:16:33 +00:00
Jörg Mayer be706c6380 Move gtk to ui/gtk.
This looses the last checkin to gtk, will add this manually back.

svn path=/trunk/; revision=40518
2012-01-15 21:59:11 +00:00
Gerald Combs 23a520237b Add initial support for Qt along with a "ui" subdirectory.
svn path=/trunk/; revision=40378
2012-01-04 22:13:01 +00:00