Commit Graph

37 Commits

Author SHA1 Message Date
Bill Meier 427790ed8f From Peter Hatina: Fix for: Gtk3 widgets are not properly expanded.
(Part of suggested patch for WIreshark 1.8 applied to trunk instead)

See: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8315

From me: Add an XXX xomment about how, on Windows, closing the top_level
Wireshark window while the capture_interfaces dialog window is open
will leave the associated dumpcap process running.


svn path=/trunk/; revision=48122
2013-03-06 00:33:58 +00:00
Bill Meier 1fb0ac3983 Fir Gtk 3.8 & newer: gtk_scrolled_window_add_with_viewport() ==> gtk_container_add().
svn path=/trunk/; revision=48065
2013-03-04 19:20:39 +00:00
Anders Broman 6bf8fcfad4 Avoid a packet rescan if we don't have an AirPcap adapter.
svn path=/trunk/; revision=47945
2013-02-28 17:55:07 +00:00
Bill Meier 708de14dc8 Replace gtk_table...() with ws_gtk_grid...().
svn path=/trunk/; revision=47020
2013-01-10 16:29:30 +00:00
Irene Rüngeler 12a6a5dce3 Set the icon for the wireless device if the decription name contains Wi-Fi
svn path=/trunk/; revision=46615
2012-12-19 09:51:20 +00:00
Bill Meier 4dacdedbe7 Fix several [-Wshadow] warnings;
Also: Do some minor whitespace and formatting changes.

svn path=/trunk/; revision=46185
2012-11-25 21:07:07 +00:00
Guy Harris bd976ae6c0 On UN*X, if an interface has a description, use it as the "friendly
name".  If it doesn't have a description, on OS X, use the System
Configuration framework to attempt to get a "friendly name" for
interfaces.

If a loopback device doesn't have a friendly name, give it "Loopback" as
the friendly name.

Move the "turn a CFString into a mallocated C string" routine into
common code, as it's used in more than one place.

svn path=/trunk/; revision=46131
2012-11-22 06:02:49 +00:00
Anders Broman 28474fe8ef From Mike Garratt:
Friendly Names for interfaces on Windows

Notes on the changes the patch covers:
* if_info_t struct: addition of friendly_name
* Dumpcap Interface list format changes:
  + Win32: "dumpcap -D" shows friendly_name in place of descript if known
  + All: machine interface "dumpcap -D -Z none" includes friendly_name in the
list in addition to the existing parameters
* interface_options struct: addition of console_display_name
  + When an interface name is displayed in a console, it will typically be the
console_display_name (instead of name). 
  + console_display_name is used as the basis of the autogenerated temp
filenames
  + console_display_name is typically set to the friendly_name if known,
otherwise it is set to the interface name
* Enhancements to capture_opts_add_iface_opt() (the function which process -i
options).
  + Can now specify the interface using its name and friendly_name
  + Interface name matching is case insenstive
  + Name matching first attempts exact matching, then falls back to prefix
matching
    (e.g. dumpcap -i local)
  + Validates interface names, instead of blindly sending them off to
winpcap/libpcap
  + Interface specification by number is still supported.
* capture_opts_trim_iface() has been refactored:
  + Instead of repeating a decent chunk of the cost in
capture_opts_add_iface_opt(), it calls capture_opts_trim_iface() to specify the
interface.
* introduction of capture_win_ifnames.[ch] (windows only code)
  + Implements static function GetInterfaceFriendlyNameFromDeviceGuid() - a
windows version independant function to convert an interface guid into its
friendly name.  Uses published api functions on windows vista and higher, but
falls back to unpublished API functions on older windows releases.
  + void get_windows_interface_friendlyname(/* IN */ char
*interface_devicename, /* OUT */char **interface_friendlyname); - extracts the
GUID from the interface_devicename, then uses
GetInterfaceFriendlyNameFromDeviceGuid() to do the resolution
* Auto temp filename generation:
  + Now uses wireshark_pcapng_* or  wireshark_pcap_* depending on file format
  + Basis temp filename format on console_display_name
  + Win32: if console_display_name is a windows interface guid, extracts
numbers from GUID here (instead of in interface option processing) 

GUI CHANGES:
* Dialog that displays when you click the "Manage Interfaces" button (within
Capture Options dialog) has been renamed from "Add new interfaces" to
"Interface Management"
* ui/gtk/capture_dlg.c: new_interfaces_w variable renamed to
interface_management_w
* Win32: Local Interfaces tab on Interface Management dialog, shows includes
friendly name as far left column
* Interface Management dialog defaults to larger size on win32 - so it fits
without resizing local interfaces tab
* Interface Management dialog now saves preferences when you click the apply
button (local hidden interfaces was not persisting across restarts)
* Tweaks: "Interface Details" dialog (Interface list->Capture Interfaces ->
Details):
  + "Friendly Name" renamed to "NDIS Friendly Name"
  + Added "OS Friendly Name" to the top of the list
* Win32: The "Capture Interfaces" dialog now shows the friendly name instead of
device guid
* Welcome screen:
  + The height of the interface list scrollbox dynamically adjusts & updates to
the number visible interfaces.
    Up to 10 interfaces can be listed without a scroll bar, the minimum height
is for 2 interfaces. 
  + Win32: now shows just the Friendly Name if known - in place of
"Interfacename_Guid:(Description)"

svn path=/trunk/; revision=46083
2012-11-19 20:07:27 +00:00
Jeff Morriss 3729335973 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45016
2012-09-20 01:48:30 +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
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
Guy Harris 9d90dc5e8f Move if_list_comparator_alph() to iface_lists.c; it's used in several
places.

svn path=/trunk/; revision=43534
2012-06-28 20:52:26 +00:00
Guy Harris cccc9f0a2d If we don't have AirPcap, don't bother with the IF_AIRPCAP case; if we
ever add support for it on additional platforms, HAVE_AIRPCAP will be
defined.

svn path=/trunk/; revision=43533
2012-06-28 20:40:44 +00:00
Guy Harris 8381581aa1 capture_get_if_icon() is no longer platform-dependent; the
platform-dependent work is now done in get_interface_type().

That means we also don't need to protect the handling of IF_DIALUP or
even IF_AIRPCAP in #ifdefs, just in case we add support for those types
in other OSes.

Nothing's uisng the capture_ethernet_16.xpm image here, so don't bother
including it.  (Does *anybody* use it?  I couldn't find any uses, but
maybe we should use that.)

svn path=/trunk/; revision=43531
2012-06-28 20:06:37 +00:00
Guy Harris 5e7ca579ce Detangle the code that manages the interface list on the welcome screen:
fill_capture_box():

	if there are interfaces on which to capture, constructs the
	interface list, otherwise destroys the interface list and puts
	up a message.

    update_capture_box():

	updates the interface list to reflect current reality.

    welcome_if_panel_reload():

	if there is an interface list, and if there are interfaces on
	which to capture (so that we still want that list), updates the
	list by calling update_capture_box(), otherwise creates or
	destroys it by calling fill_capture_box() (as either it doesn't
	exist but now needs to or does exist but needs to go away).

Have refresh_local_interface_lists(), which re-fetches the list of local
interfaces and updates every interface list that includes local
interfaces, and refresh_non_local_interface_lists(), which only updates
interface lists that (also) include interfaces other than local
interfaces (such as pipes and remote interfaces).  Call them in the
apprpriate places (if we know the list of local interfaces has been
updated, call refresh_local_interface_lists(), otherwise, if we know
interfaces other than local interfaces have been added or removed, call
refresh_non_local_interface_lists()).

Don't have any routine that updates the interface list for one widget
update the interface list for any other widget; leave the global
updating of interface lists up to refresh_local_interface_lists() and
refresh_non_local_interface_lists() - only call one of them if any
interface lists are to be updated.

svn path=/trunk/; revision=43517
2012-06-28 08:13:21 +00:00
Guy Harris 9650d477b3 From Pontus Fuchs:
add a capture_dlg_refresh_if() routine to redraw the list of
	interfaces in the Capture -> Interfaces dialog if the lsit of
	known interfaces is updated, and have it do that not by
	destroying and reconstructing the entire dialog box, but just by
	destroying and reconstructing the table containing the
	interfaces and their statistics.

From me:

	have a refresh_interfaces_cb() routine in ui/gtk/main.c that
	scans the local interfaces and refreshes *all* the widgets that
	have interface lists;

	add a "Refresh Interfaces" item to the Capture menu that calls
	that;

	have the "Refresh" button in the "Manage Interfaces" window also
	call that;

	rename the Capture Options window routine dlg_window_present()
	to capture_dlg_window_present() to make it clearer *which*
	dialog it checks for;

	fix Pontus' patch to call capture_stat_stop() *before* nulling
	out the global pointer for the statistics cache - if it's called
	*after* nulling it out, the argument passed to
	capture_stat_stop() is null, and it doesn't kill off the dumpcap
	gathering the statistics so they just pile up (and, at least on
	OS X, chewing up BPF devices until you run out of BPF devices
	that have the right ownership and permissions for dumpcap to use
	as a normal user);

	if refreshing the interfaces fails to get an interface list,
	close the Capture Interfaces dialog.

svn path=/trunk/; revision=43515
2012-06-28 01:54:42 +00:00
Guy Harris f321db7c99 Rename the GArray of interfaces "if_array", to indicate what it really
is, and rename the routine that creates it to "make_if_array()".

svn path=/trunk/; revision=43514
2012-06-27 23:15:28 +00:00
Anders Broman 1992295e16 Revert:
airpcap_tb -> wireless_tb

Second try.

svn path=/trunk/; revision=43364
2012-06-19 14:37:46 +00:00
Guy Harris 9ff274758a capture_get_if_icon() no longer determines the interface type itself, it
relies on get_interface_type() having done so.  Thus, we no longer need
to include <sys/types.h> or <sys/stat.h> on Linux, as we aren't doing,
and haven't been doing, ws_stat64()s on Linux.

svn path=/trunk/; revision=43351
2012-06-19 09:59:45 +00:00
Anders Broman 4f5bdb67b2 From Pontus Fuchs:
If there are many interfaces the button bar is not visible
unless you manually resize the dialog. On a normal Linux PC
you can easily reach 15-20 interfaces due to USB monitor.

Add a vbox so that you get a scrollbar for the interface table
instead of on the window. This way the button bar is always
visible.

Also increase the default height to handle 20 interfaces.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7379

svn path=/trunk/; revision=43345
2012-06-19 06:08:58 +00:00
Guy Harris e1ec927708 Disable some menu items and toolbar items while we're waiting for a
capture to stop, so that we don't try to quit while we're in the middle
of quitting or try to stop or restart the capture we're in the middle of
stopping.

svn path=/trunk/; revision=43250
2012-06-14 02:19:46 +00:00
Guy Harris 9c44d87610 Have a main_update_for_unsaved_changes() routine that, if changes are
made to the capture file (adding/removing/editing comments, for now) or
if a capture file with unsaved changes are unsaved, updates the menu
bar, the toolbar, *and* the titlebar, which now has a GNOME-style "*" to
indicate unsaved changes.

Make set_menus_for_capture_file() a private interface between main.c and
main_menubar.c, and have its callers, such as
main_update_for_unsaved_changes(), be responsible for updating the
toolbar as well.

svn path=/trunk/; revision=43051
2012-06-04 02:24:42 +00:00
Anders Broman dbc4b09004 From Evan Huus Convert a bunch more GTK-2 calls to their cross-version ws_ equivalent
svn path=/trunk/; revision=43009
2012-06-02 23:53:04 +00:00
ruengeler 618afe1a77 Get rid of GTK warning when START was hit in the "Capture Interfaces Dialog" while a device was hidden.
svn path=/trunk/; revision=42204
2012-04-23 11:06:21 +00:00
Michael Tüxen 937df7af18 From Irene Ruengeler: Fix a warning when capturing.
svn path=/trunk/; revision=41897
2012-04-02 17:15:58 +00:00
Stig Bjørlykke 6e1194d7ba User data is not used in capture_prepare_cb and capture_do_cb.
svn path=/trunk/; revision=41792
2012-03-27 06:57:21 +00:00
Jeff Morriss ce8d32d5bb Get things compiling if we HAVE_AIRPCAP.
svn path=/trunk/; revision=41789
2012-03-27 02:30:51 +00:00
Michael Tüxen b1fa4c19e6 From Irene Ruengeler:
* Add support in the GUI for pipes.
* Allow the local interfaces to be rescanned via the GUI.
* Allow remote interfaces to be added and deleted.
The GUI can be extended to support other ways of capturing.

svn path=/trunk/; revision=41105
2012-02-21 11:59:41 +00:00
Michael Tüxen fe30e4ad2e Fix from Irene Ruengeler: Show correct details in the interface dialog on
Windows.

svn path=/trunk/; revision=41042
2012-02-16 20:22:34 +00:00
Michael Tüxen eca83b8a0c Address warnings reported by Bill.
svn path=/trunk/; revision=40718
2012-01-25 16:32:51 +00:00
Michael Tüxen 14b1a44c0f Third try. This time pipes and stdin are supported and the
test scripts are passed.

Use a global list containing all interfaces and only change
properties of the entries when changes are made in the GUI.
Do not misuse the list of interfaces specified on the command
line anymore.

This patch does not provide any new functionality, it just
provides the base for future extensions like removing
remote interface, mulitple airpcap devices and multiple
pipes.

This patch was provided by Irene Ruengeler.

svn path=/trunk/; revision=40715
2012-01-25 13:04:32 +00:00
Michael Tüxen 4fece25e7f We need a 3rd try. (After learning how to run the testuite on Windows locally).
svn path=/trunk/; revision=40695
2012-01-24 17:12:56 +00:00
Michael Tüxen 08d6785412 Second try. This time pipes and stdin are supported.
Use a global list containing all interfaces and only change
properties of the entries when changes are made in the GUI.
Do not misuse the list of interfaces specified on the command
line anymore.

This patch does not provide any new functionality, it just
provides the base for future extensions like removing
remote interface, mulitple airpcap devices and multiple
pipes.

This patch was provided by Irene Ruengeler.


svn path=/trunk/; revision=40693
2012-01-24 16:05:26 +00:00
Guy Harris dacb4133e8 Restructure the recent file code so that recent.c is GUI-independent;
move it to the top-level source directory for now, and move
ui/gtk/recent.h to the ui directory.

svn path=/trunk/; revision=40561
2012-01-18 19:38:34 +00:00
Guy Harris d7b2aad043 Move some headers for UI stuff, and the alert_box.c UI-specific file, to
the ui directory.  (Perhaps some other files that would be used by all
flavors of Wireshark, for any GUI toolkit or for someting such as
ncurses, and not for any command-line tool such as TShark, should be
moved there as well.)

Shuffle some #includes to put the "ui/XXX.h" includes together.

svn path=/trunk/; revision=40529
2012-01-16 01:07:52 +00:00
Jörg Mayer 89ac6f314f More .. -> ../.. changes after gtk/ move
svn path=/trunk/; revision=40523
2012-01-15 22:40:03 +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