Commit Graph

208 Commits

Author SHA1 Message Date
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
Stig Bjørlykke 6a724c8d83 Free name string only when used.
svn path=/trunk/; revision=41479
2012-03-11 12:00:13 +00:00
Anders Broman 6df56f8542 From Martin Kaiser: capture dialogue: unitialized pointer is dereferenced, assigning an arbitrary dlt to a capture interface https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6914
svn path=/trunk/; revision=41369
2012-03-06 09:16:50 +00:00
Michael Tüxen 566dc82999 Fix CID 1373.
svn path=/trunk/; revision=41265
2012-03-01 15:10:45 +00:00
Anders Broman 53af6b37b6 Use GTK_COMBO_BOX_TEXT, compile failed when using GTK 2.24.10.
svn path=/trunk/; revision=41235
2012-02-29 11:56:36 +00:00
Chris Maynard 9528902271 Re-apply r40728 and fix Coverity CID 1371 UNINIT again.
svn path=/trunk/; revision=41199
2012-02-27 00:25:41 +00:00
Michael Tüxen a36c67130f Fix compilation (hopefully).
svn path=/trunk/; revision=41107
2012-02-21 12:56:52 +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 ed68db6e5d Fix tooltips (There is a hidden column).
svn path=/trunk/; revision=41051
2012-02-17 16:48:55 +00:00
Anders Broman d0b4fb05f0 From Sean Bright:
Wireshark crashes after editing interface settings from capture options dialog.

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

svn path=/trunk/; revision=41017
2012-02-13 18:58:14 +00:00
Chris Maynard 9f8003f490 Fix Coverity CID 1371: UNINIT.
svn path=/trunk/; revision=40728
2012-01-26 15:11:20 +00:00
Bill Meier 36209e8773 Fix error when building QtShark:
...\capture_opts.h(94) : error C2461: 'remote_host' : constructor syntax missing formal parameters


svn path=/trunk/; revision=40723
2012-01-25 18:03:50 +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 9465e9f0fa Another change for the recent changes (in both senses of "recent
changes" :-)).

svn path=/trunk/; revision=40566
2012-01-18 20:38:51 +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 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