Commit Graph

45 Commits

Author SHA1 Message Date
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
Gerald Combs 98b0812341 Add a format_size function similar to g_format_size that renders a size
value in a human-readable format. Use it in the welcome screen, status
bar, and Win32 interface details.

Note that in the welcome screen and status bar we've switched from
customary binary prefixes to strict SI.

svn path=/trunk/; revision=45453
2012-10-10 19:17:31 +00:00
Evan Huus 560cdd7ed5 More unused variables caught by cppcheck.
svn path=/trunk/; revision=45211
2012-09-29 14:15:20 +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
Irene Rüngeler 5311957c0e Add refresh button, if interfaces are not found.
svn path=/trunk/; revision=44328
2012-08-08 07:53:57 +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 bd855826a9 Move the common parts of iface_lists.[ch] from ui/gtk/ to ui/. Leave the
GTK+-specific parts behind in capture_dlg.c.

svn path=/trunk/; revision=44196
2012-08-01 22:32:14 +00:00
Gerald Combs 02894a0be8 Move utf8_entities.h to the "ui" directory. Separate packet information
items with MIDDLE DOTs.

svn path=/trunk/; revision=44194
2012-08-01 19:18:49 +00:00
Anders Broman df0bef704a From Michael Mann:
Expand show version preference.
implementation of Steven's suggestion of a radio button (actually
dropdown) of the 4 possibilities. 

I changed  the default to  have the version on both in
the welcome screen and on the window as that's how it was and people tend not to change the preferences I think.

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

svn path=/trunk/; revision=44153
2012-07-31 07:27:39 +00:00
Evan Huus afec796598 Two little cleanups from cppcheck:
- unused variable
= don't trust GTK_IS_PROGRESS_BAR to provide the necessary parentheses

svn path=/trunk/; revision=43915
2012-07-22 15:58:36 +00:00
Jakub Zawadzki 98c2390515 Fix some clang warnings: implicit conversion from enumeration type 'GtkStateType' to different enumeration type 'GtkStateFlags' [-Werror,-Wconversion]
GTK_STATE_NORMAL and GTK_STATE_FLAG_NORMAL are both 0.

svn path=/trunk/; revision=43854
2012-07-20 11:10:29 +00:00
Anders Broman 1ae38887b6 From Evan Huus:
Grab-bag of unused variables.

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

svn path=/trunk/; revision=43616
2012-07-09 01:49:02 +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 879189564a Move the stuff to manage the global interface list and to update
displays of that list into a separate iface_lists.c file.

svn path=/trunk/; revision=43523
2012-06-28 18:16:18 +00:00
Guy Harris 4e893a71fe Make scan_local_interfaces() local to ui/gtk/main.c; widgets/windows
that want a list of interfaces should either call
fill_in_local_interfaces() to make sure the list has been populated at
least once or refresh_local_interface_lists() if they want the list to
be rescanned.

Also make get_interface_type() local to ui/gtk/main.c, as it's not
called from outside ui/gtk/main.c.

Don't declare fill_in_local_interfaces() or hide_interface() unless we
have pcap - we don't define them unless we have pcap.

svn path=/trunk/; revision=43518
2012-06-28 08:25:17 +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
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
Bill Meier a703450659 AFAICT '#include sys/types.h' is not needed for these files.
svn path=/trunk/; revision=42443
2012-05-05 20:51:14 +00:00
Guy Harris 53155a11c0 Get rid of the error code argument to scan_local_interfaces(); nobody
uses it once it's filled in.

From Evan Huus: in scan_local_interfaces(), pass NULL to
capture_interface_list(), as we don't use the error string (and don't
free it, either).

In fill_capture_box(), for CANT_GET_INTERFACE_LIST, include the error
string in the report, and free it, in all cases, when we're done with
it.

svn path=/trunk/; revision=42089
2012-04-15 23:03:58 +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
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 0f92a3a8d2 From Irene Ruengeler: Restore functinality of last patch.
svn path=/trunk/; revision=41719
2012-03-21 09:54:05 +00:00
Guy Harris 4690f02928 Handle bogus values of the error that *should* be coming from
scan_local_interfaces() (but, currently, isn't, as the code wasn't
correctly restructured).

svn path=/trunk/; revision=41710
2012-03-21 06:20:01 +00:00
Jeff Morriss 1ee4c9e8a0 activate_link_cb() is only defined and used if we have GTK 2.18 or higher; only prototype it when we have GTK 2.18 or higher.
svn path=/trunk/; revision=41701
2012-03-21 02:42:11 +00:00
Jeff Morriss 075491702b welcome_if_tree_load() is static and only called (and prototyped) if we HAVE_LIBPCAP, so don't define the function unless we HAVE_LIBPCAP.
svn path=/trunk/; revision=41698
2012-03-21 01:22:40 +00:00
Guy Harris 4fe63c565d Well, it doesn't recurse with that code there, but it doesn't fill in
the interface list box, either.  Remove the #if 0 for now.

svn path=/trunk/; revision=41696
2012-03-21 00:44:41 +00:00
Guy Harris 7405ba8145 The chimney stuff is Windows-only (not that we shouldn't offer the
ability to turn offloading off on UN*Xes as well...).

svn path=/trunk/; revision=41695
2012-03-21 00:36:44 +00:00
Guy Harris d43d1c0a6f Recursion, n. See "recursion".
svn path=/trunk/; revision=41694
2012-03-21 00:16:13 +00:00
Guy Harris b551749d28 welcome_if_tree_load() is not used outside ui/gtk/main_welcome.c; make
it static.

svn path=/trunk/; revision=41693
2012-03-21 00:09:45 +00:00
Guy Harris e64375d187 #ifdef out some variables used only if we have libpcap.
svn path=/trunk/; revision=41692
2012-03-21 00:01:42 +00:00
Guy Harris d230d1663f Just put both clear_capture_box() and fill_capture_box() under one
#ifdef HAVE_LIBPCAP/#endif.

svn path=/trunk/; revision=41691
2012-03-20 23:37:23 +00:00
Anders Broman 24298dca48 See if this fixes the OSX build
svn path=/trunk/; revision=41690
2012-03-20 23:03:48 +00:00
Anders Broman 14e0bdf07e See if this fixes the OSX build
svn path=/trunk/; revision=41689
2012-03-20 22:43:44 +00:00
Anders Broman f246d95f88 make it compile on Windows, \main_welcome.c(1024) : warning C4700: uninitialized local variable 'error' used seems like a logical error, hidden by init to zero. Need proper fix
svn path=/trunk/; revision=41688
2012-03-20 22:40:10 +00:00
Michael Tüxen 26dd77f0af From Irene Ruengeler: Make sure we can remove all interfaces and can
add local interfaces when there are none.
From me: Some whitespace cleanups.

svn path=/trunk/; revision=41687
2012-03-20 21:13:28 +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
Jeff Morriss a122d4616e 'error' is only used when we HAVE_LIBPCAP so only define it when that is the case.
svn path=/trunk/; revision=40716
2012-01-25 14:26:09 +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