Commit Graph

168 Commits

Author SHA1 Message Date
Bill Meier 60b9be7c7b "Capture ! Options ! Manage Interfaces": Cleanup handling of Window epansion.
Improves 'expand' handling for both Gtk2 & Gtk3;

Adapted (with additions by me) from a proposed patch by Peter Hatina (Bug #8315).

Also:

1. Don't use gtk_widget_set_size() in several cases when a single use of
   gtk_window_set_default_size() for the "Manage Interfaces" window is sufficient.

2. Add an XXX comment as to a specific call to 'gtk_window_destroy_with_parent'
   actually being a no-op on Windows.

svn path=/trunk/; revision=48237
2013-03-11 01:11:38 +00:00
Anders Broman 5147d6cffa Use explicit casts.
svn path=/trunk/; revision=48187
2013-03-08 07:09:39 +00:00
Anders Broman dc505fd90e Make the prefernce settings work.
svn path=/trunk/; revision=48182
2013-03-07 22:57:11 +00:00
Irene Rüngeler 3a4d29498d Use if_string instead og if_string->name.
svn path=/trunk/; revision=48168
2013-03-07 14:11:45 +00:00
Irene Rüngeler ad61d2ca01 Use ifdefs for buffer size.
svn path=/trunk/; revision=48167
2013-03-07 13:16:48 +00:00
Michael Tüxen 15501fad2a Try to fix the buildbots.
The patch for capture_dlg.c is from Anders...

svn path=/trunk/; revision=48164
2013-03-07 12:06:55 +00:00
Irene Rüngeler cb42bc9fec Add buffersize and snap length to the preferences.
svn path=/trunk/; revision=48163
2013-03-07 09:16:55 +00:00
Jeff Morriss d0992bf8cd Add a #define for the default capture buffer size and use it.
svn path=/trunk/; revision=47942
2013-02-28 15:27:56 +00:00
Jeff Morriss 4e2090bdc9 From Anders: more places to increase the default capture buffer size.
svn path=/trunk/; revision=47939
2013-02-28 14:36:41 +00:00
Martin Kaiser b451f267b6 for an interface that does not support monitor mode, make sure that
monitor mode is not enabled

(this fixes the gui part but there's probably more to do)

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

svn path=/trunk/; revision=47399
2013-01-31 22:30:56 +00:00
Chris Maynard 394b6c1c00 Fix VS Studio Analysis warning C6244: Local declaration of 'iftype' hides previous declaration at line '1046'
svn path=/trunk/; revision=47213
2013-01-22 17:31:07 +00:00
Bill Meier 2dda8659ef Fix two issues related to conversion to use ws_gtk_grid...() [svn #47002].
svn path=/trunk/; revision=47154
2013-01-18 20:55:11 +00:00
Gerald Combs ae7ee61e84 Rename the "saved_val" preference element to "stashed_val" in order to
more clearly indicate that it's a copy of a preference value rather than
something we've saved in the preferences file. Update
prefs_pref_to_str() to handle default, stashed, and current prefs.

Create ui/preference_utils.[ch] and move some common routines there. Use
prefs_pref_type_name() in the GTK+ preferences dialog.

Make the "OK" button in the Qt preferences dialog work. We simply write
the prefs and redissect on "OK" and do nothing on "Cancel". This is
intentionally different from the Apply/OK/Cancel behavior in the GTK+
version.

Add a general "emitAppSignal" method to wsApp and use it for packet
dissection and preference changes.

Suggest that we might want to create a WsString class to make conversion
between QStrings, gchar *s, and GStrings easier.

svn path=/trunk/; revision=47139
2013-01-18 00:50:14 +00:00
Anders Broman 402906be13 Opening the capture options triggers a rescan of all the packets caused by the call to update_decryption_mode_list() for airpcap.
If we don't get the airpcap_if_list, don't do anything regarding air_pcap.

update_decryption_mode_list() should probably check if a change is taking place before rescaning all packets.

svn path=/trunk/; revision=47131
2013-01-17 12:21:57 +00:00
Irene Rüngeler 2dc365db46 Another solution to fix bug https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8183.
Now both windows are modal.

svn path=/trunk/; revision=47018
2013-01-10 12:44:52 +00:00
Irene Rüngeler 2a7031f12b Fix for bug 8183 reported by David Bergeron.
svn path=/trunk/; revision=47015
2013-01-10 09:27:07 +00:00
Anders Broman bf22d3ffd3 Use ws_gtk_grid...() instead of gtk_table...();
svn path=/trunk/; revision=47003
2013-01-09 19:10:47 +00:00
Guy Harris 6255cc03f0 Fix another discarded qualifier error.
Remove some redundant declarations/definitions from
ui/gtk/capture_dlg.h.

svn path=/trunk/; revision=46780
2012-12-26 12:24:55 +00:00
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings.

When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.

Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers.  Cast
away those warnings in some cases where an API we don't control forces
us to do so.

Enable a bunch of additional warnings by default.  Note why at least
some of the other warnings aren't enabled.

randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.

If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.

svn path=/trunk/; revision=46748
2012-12-26 05:57:06 +00:00
Evan Huus 52aff57285 Remove unneeded initializations, and one redundant if condition.
svn path=/trunk/; revision=46702
2012-12-22 21:14:13 +00:00
Irene Rüngeler 7f6519287e Make "Edit Interfaces Dialog" modal
-This line, and those below, will be ignored--

M    ui/gtk/capture_dlg.c

svn path=/trunk/; revision=46500
2012-12-11 16:55:17 +00:00
Irene Rüngeler 7cf0d9ed2b Capture Options Dialog: Update buttons for "Capture all in Prom. Mode" and "Capture on all interfaces"
Update filter string

svn path=/trunk/; revision=46499
2012-12-11 16:51:36 +00:00
Michael Tüxen 0f3f4eb79a Don't leak a string.
svn path=/trunk/; revision=46442
2012-12-07 12:58:19 +00:00
Irene Rüngeler df8cb34370 Fix Bug reported by Anders Broman concerning the capture filter.
svn path=/trunk/; revision=46440
2012-12-07 12:08:12 +00:00
Bill Meier 62d0eacfc7 Fix two more incorrect s/link/linkr/ done by me in SVN #46426.
svn path=/trunk/; revision=46428
2012-12-06 21:35:03 +00:00
Bill Meier 60fd1d6d27 Fix compile error;
svn path=/trunk/; revision=46427
2012-12-06 21:27:04 +00:00
Bill Meier ae68f42297 Fix [-Wshadow] warnings.
svn path=/trunk/; revision=46426
2012-12-06 20:59:53 +00:00
Bill Meier 7cd0417af5 Fix numerous instances of a variable/parameter name "shadowing" a library function name;
(At least some (gcc ?) compilers give a "shadow" warning for these).

svn path=/trunk/; revision=46402
2012-12-05 15:56:36 +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 6a5d8a1e65 Fix a reference to the "description" member of an if_info_t.
svn path=/trunk/; revision=46132
2012-11-22 06:54:35 +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
Evan Huus c103c2fe04 Fix some memleaks caught by cppcheck.
svn path=/trunk/; revision=45209
2012-09-29 14:03:36 +00:00
Evan Huus 813781f18c Remove some unused variables caught by cppcheck.
svn path=/trunk/; revision=45208
2012-09-29 13:57:57 +00:00
Chris Maynard 85ac1f3ffd Increase the default width of the capture options dialog so all columns are visible. Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7766
svn path=/trunk/; revision=45199
2012-09-28 20:43:40 +00:00
Guy Harris 8c174d2ae7 Just as we don't show the "Wireless Settings" button for non-AirPcap
adapters, we don't show the "Remote Settings" button for local adapters.
(Back when the buttons were in the Capture Options dialog, always having
the button there and making it sensitive or insensitive based on the
interface you specified may have made sense; now that it's in a dialog
popped up when you double-click on a particular interface, so the dialog
always applies to a particular interface, it no longer makes sense.)

Get rid of the unused E_OPT_REMOTE_BT_KEY key.

svn path=/trunk/; revision=45085
2012-09-24 07:41:19 +00:00
Guy Harris 777c3930f6 Do not display a "Wireless Settings" button for non-AirPcap interfaces;
it can confuse users, so that they ask why this is grayed out on their
non-Windows machine and ask how to enable it.

Nobody uses the AIRPCAP_OPTIONS_ADVANCED_KEY datum attached to the box
in which the button appears, so get rid of it.

svn path=/trunk/; revision=45056
2012-09-22 20:09:55 +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 66f962644a Display compile results output of single interface in scrollable window instead of simple dialog.
svn path=/trunk/; revision=44466
2012-08-13 09:53:00 +00:00
Irene Rüngeler cab84c7100 Set the focus to the filter text field and activate START afterwards.
svn path=/trunk/; revision=44465
2012-08-13 09:04:45 +00:00
Irene Rüngeler 1c1721539a Only activate the 'Compile selected BPFs' button, if interfaces are selected.
svn path=/trunk/; revision=44464
2012-08-13 08:09:03 +00:00
Michael Tüxen 734a304c92 Get the windows buildbots happy.
svn path=/trunk/; revision=44421
2012-08-10 14:19:43 +00:00
Irene Rüngeler 7bc3532099 Change window size and wrapping behavior.
svn path=/trunk/; revision=44420
2012-08-10 13:43:35 +00:00
Irene Rüngeler ab3dc72ea0 Change the font in the compile results window to monospace.
svn path=/trunk/; revision=44381
2012-08-09 14:48:22 +00:00
Irene Rüngeler 9fb3d27bee Add green bullet to indicate success.
svn path=/trunk/; revision=44378
2012-08-09 13:23:47 +00:00
Michael Mann e0e533d643 Have (almost) all preferences use the generic preferences API (per https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7402). This cleaned up a lot of hardcoded code and allows breaking up the prefs structure (or at least prevent it from growing too large) if desired.
Bugfixed problems mentioned in
http://www.wireshark.org/lists/wireshark-dev/201208/msg00001.html

Column preferences now support default '#' character

svn path=/trunk/; revision=44348
2012-08-08 16:54:02 +00:00
Irene Rüngeler bbd9a397f8 Make Ubuntu buildbot happy.
svn path=/trunk/; revision=44337
2012-08-08 13:34:50 +00:00
Irene Rüngeler 8c14e27381 Use list view instead of notebooks to display compile results.
svn path=/trunk/; revision=44335
2012-08-08 12:52:48 +00:00
Michael Tüxen f9d6206170 Make the Ubuntu buildbot happy.
svn path=/trunk/; revision=44302
2012-08-07 15:22:09 +00:00
Irene Rüngeler ff80e34de5 Fix bug when compiling several filters.
svn path=/trunk/; revision=44301
2012-08-07 14:38:27 +00:00
Jörg Mayer bb57fa3ec2 Fix
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/capture_dlg.c:209:19: error: ‘compile_bpf_w’ defined but not used [-Werror=unused-variable]


svn path=/trunk/; revision=44299
2012-08-07 13:51:10 +00:00
Irene Rüngeler 02648076ee Add window with notebooks to display bpf compile results.
svn path=/trunk/; revision=44298
2012-08-07 13:25:42 +00:00
Irene Rüngeler 0d40bf21fc Make Windows buildbot happy.
-This line, and those below, will be ignored--

M    ui/gtk/capture_dlg.c

svn path=/trunk/; revision=44294
2012-08-07 10:30:30 +00:00
Irene Rüngeler ed26851415 Make macos buildbot happy
svn path=/trunk/; revision=44293
2012-08-07 10:25:01 +00:00
Jörg Mayer 1899edcb46 Fix for
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/capture_dlg.c:4016:18: error: unused variable ‘all_compile_bt’ [-Werror=unused-variable]


svn path=/trunk/; revision=44291
2012-08-07 09:15:22 +00:00
Irene Rüngeler b092c105ed Add a filter for all selected interfaces to the capture options dialog.
svn path=/trunk/; revision=44290
2012-08-07 07:58:05 +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
Jeff Morriss 0114eca349 Remove another set-but-not-used variable.
svn path=/trunk/; revision=44252
2012-08-03 22:04:09 +00:00
Jeff Morriss 91b3e8e24a Remove set-but-unused variable.
svn path=/trunk/; revision=44249
2012-08-03 17:33:01 +00:00
Irene Rüngeler 2e1952678f Make the columns of the capture options dialog selectable. Changes are stored in the preferences file.
The ordering can be changed by dragging the column. The order is not stored.

svn path=/trunk/; revision=44239
2012-08-03 11:15:40 +00:00
Gerald Combs 15862a8fae Fix a variable name.
svn path=/trunk/; revision=44198
2012-08-02 00:04:44 +00:00
Gerald Combs ff2977fdd6 It looks like we haven't inserted anything into the cap_settings_history
hash table since r40715. Remove it and its associated functions.

C++-ize iface_lists.h.

svn path=/trunk/; revision=44197
2012-08-01 23:35:18 +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
Martin Kaiser 048fcbdf2f initialize required interface_t components of a newly created interface
this should fix crashes in the interface list handling when the
interface list contains pipes initliazed by scan_local_interfaces() or
add_pipe_cb()

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

svn path=/trunk/; revision=43922
2012-07-22 22:09:46 +00:00
Jakub Zawadzki ac46b9cf5b Fix some memory leaks of returned string from gtk_combo_box_text_get_active_text()
gtk_combo_box_text_get_active_text() and gtk_combo_box_get_active_text() [from old-gtk-compat.h]
returns *newly allocated string (...) must be freed with g_free().*

svn path=/trunk/; revision=43918
2012-07-22 21:06:46 +00:00
Anders Broman aa1dd4546d Shoul be gtk_box_pack_start(GTK_BOX (vbox), message_type_fr, TRUE, TRUE, 0);
svn path=/trunk/; revision=43828
2012-07-19 14:02:47 +00:00
Anders Broman d3ecc1431f gtk_container_add() -> gtk_box_pack_start().
svn path=/trunk/; revision=43825
2012-07-19 13:06:04 +00:00
Anders Broman 81531a65dd Change the button order in all places.
svn path=/trunk/; revision=43639
2012-07-10 07:50:34 +00:00
Anders Broman f090a73e9c From Michael Mann:
disable hide checkboxes with error messages

Updated preference dialog to include text if hide checkbox is disabled.

Used error message for "Local Interfaces" dialog.

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

svn path=/trunk/; revision=43622
2012-07-09 02:40:20 +00:00
Anders Broman 0696f30690 From Michael Mann:
GUI use external name resolver proliferation

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

svn path=/trunk/; revision=43615
2012-07-09 01:36:54 +00:00
Anders Broman c19583b72c From Michael Mann:
Generic preferences implementation - Printing and Name Resolution.

svn path=/trunk/; revision=43579
2012-07-06 04:48:36 +00:00
Guy Harris 3a4678b00f Separate the code for each column in the interface list with blank
lines.

svn path=/trunk/; revision=43549
2012-06-30 00:32:03 +00:00
Guy Harris 7546a033c7 Clarify *which* capture dialogs are handled by capture_dlg.c.
svn path=/trunk/; revision=43548
2012-06-29 22:52:13 +00:00
Jeff Morriss f01a28135f Clean up capture option tooltip spacing and remove an extraneous word (at the end of the monitor mode description). Also use sizeof for a buffer size.
svn path=/trunk/; revision=43547
2012-06-29 21:18:35 +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 05d6212a62 Make more routines static.
svn path=/trunk/; revision=43528
2012-06-28 19:08:11 +00:00
Guy Harris 6d5271b856 Make some routines static to ui/gtk/capture_dlg.c; they're not used
outside it.

svn path=/trunk/; revision=43527
2012-06-28 18:57:23 +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 28f866815a Update some refresh_interfaces_cb() calls appropriately.
svn path=/trunk/; revision=43520
2012-06-28 15:13:53 +00:00
Guy Harris b52000fc78 Comment/#ifdef out a currently-unused variable.
svn path=/trunk/; revision=43519
2012-06-28 15:11:01 +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 07d3f84d28 The symbolic names for column indices are unused outside of
capture_dlg.c; move them there.  (There are no routines exported by
capture_dlg.c that use them.)

svn path=/trunk/; revision=43436
2012-06-21 20:45:22 +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 eb03bb0290 Add some more routines to main.c that handle updates to "auto scroll in
live capture" and colorization, so that the ones in main_menubar.c don't
have to know about anything other than the main menubar.

Move some toolbar routines that should only be used by routines in
main.c into a main_toolbar_private.h header.

svn path=/trunk/; revision=43053
2012-06-04 03:15:05 +00:00
Anders Broman 55ad6f8b53 Get rid of mor hbox:es
svn path=/trunk/; revision=43039
2012-06-03 18:03:00 +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
Guy Harris 6014035703 Use GTK+'s GtkMessageDialog for the questions we ask in the process of
saving files, and run it modal (which we're already doing with the
GtkFileChooserDialog); this means less callback-based state machine
stuff, simplifying the code paths a bit.

If we're saving a file before closing it, don't bother reloading it
after saving it.

svn path=/trunk/; revision=42855
2012-05-25 21:25:55 +00:00
Guy Harris c2bb7956c2 "Save As" always saves everything and, when the save is done, makes the
new file the current file, as is the case in most if not all other GUI
applications.

A new "Export Specified Packets" menu option allows you to specify which
packets to write out, with the default being the displayed packets (and
those on which the displayed packets depend for, e.g.  reassembly), and
never makes the resulting file the current file.

The two operations are conceptually distinct.  Lumping them into one
menu item, with the default for "Save As" being "displayed packets only"
and thus making it behave like the latter operation, was causing some
confusion; see, for example, bug 6640.

Make the dialog popped up if you try to "Save As" or "Export Specified
Packets" on top of an existing file ask the "do you want to do this?"
question in the main part of the message, and note in the secondary text
that doing that will overwrite what's in the file; that matches what
TextEdit on OS X and the GNOME text editor say.

svn path=/trunk/; revision=42792
2012-05-22 22:17:57 +00:00
Guy Harris 4a9b825c49 Change the "user_saved" member of a capture_file structure to
"unsaved_changes", and have it be TRUE iff changes have been made to the
file since it was read - *not* if it's a temporary file from a live
capture.

Check the "is_tempfile" member, and the "unsaved_changes" member, when
appropriate.

Just have a set_toolbar_for_capture_file() routine that updates the
"save", "close", and "reload" toolbar as appropriate, given a
capture_file structure - absorb the function of
set_toolbar_for_unsaved_capture_file() into it.

svn path=/trunk/; revision=42721
2012-05-20 08:56:06 +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
Anders Broman 77074a5a37 From Evan Huus: - Make sure that unsupported link-layer types *always* have a dlt of -1 in the `device.links` list so that we can tell if they're unsupported. - When building the combo-box of link-layer types, make the unsupported ones insensitive (disabled), and be sure to default to a supported one if we have one. - Compiling a capture filter requires a supported link-layer type, so disable the 'Compile BPF' button if there are none. - It is not always a programming error to have no active pointer in the combo-box, as this can happen when all the available entries are unsupported (and thus disabled). Don't abort with g_assert_not_reached() when this happens. - Unlock the `pcap_compile_mtx` mutex in all cases after compiling a packet filter. This was causing a deadlock (complete program hang) if you tried to compile two different filters in a row on the same interface. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7135
svn path=/trunk/; revision=42410
2012-05-04 04:35:43 +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
Guy Harris cb8edf66a6 From Even Huus: free a strduped string. Fixes bug 7094.
svn path=/trunk/; revision=42074
2012-04-14 18:16:56 +00:00
Guy Harris de42012ffd If we don't even *have* a filter combo box, there's nothing we can check
or colorize; quit before we even *try* to get the link-layer header
type.

If we don't have an active link-layer header type, that probably means
we don't know what link-layer header types the interface provides, which
would be the case if it were a named pipe or an interface we can't open.
Don't crash in that case, just leave the filter combo box uncolored, to
indicate that we have no clue whether the filter is valid or not.

Fixes bug 7049.

svn path=/trunk/; revision=42059
2012-04-14 00:36:30 +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
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
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
Guy Harris 681c29c5d5 Don't close the currently loaded capture file in capture_start(), do so
in its callers; when starting a capture with "wireshark -k", there's no
capture file to close, and closing it might be provoking some UI actions
that cause crashes on Windows.

Don't copy the list of selected interfaces to the list of capture
interfaces in capture_start(), either, do that in the callers; we were
already doing that in one place and, in one of the remaining cases,
namely "wireshark -k", we should do so only if no capture interfaces
were supplied on the command line.  (I.e., the set of interfaces on
which we want to capture depends on where in the UI the capture is being
started.)

svn path=/trunk/; revision=41491
2012-03-11 20:08:54 +00:00