Commit Graph

94 Commits

Author SHA1 Message Date
Jakub Zawadzki 78631020b8 Add wtap_pseudo_header union to wtap_pkthdr structure.
Use pkthdr instead of pseudo_header as argument for dissecting.

svn path=/trunk/; revision=45601
2012-10-16 21:50:57 +00:00
Guy Harris 73dd0321ea Get rid of the always-null and unused argument to
host_name_lookup_process().  If, in the future, we find that we need an
argument for changes we're making, we can add it then.

svn path=/trunk/; revision=45269
2012-10-02 21:13:59 +00:00
Jakub Zawadzki 49ce5e127b protect_thread_critical_region, unprotect_thread_critical_region are no-ops, cleanup code by removing them.
svn path=/trunk/; revision=45201
2012-09-28 21:36:21 +00:00
Gerald Combs 3994ddc357 Call fileset_file_closed from cf_cb_file_closed.
svn path=/trunk/; revision=45163
2012-09-26 23:40:56 +00:00
Gerald Combs 998da54456 Add a cf_cb_file_opened callback and use it instead of calling
fileset_file_opened directly from file.c. This makes the code a bit more
consistenent and makes it easier to port the File Set dialog to Qt.

svn path=/trunk/; revision=45162
2012-09-26 23:33:11 +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
Jörg Mayer 12a0aa4849 - Replace packet_list_recreate_visible_rows -> packet_list_recreate_visible_rows_list
- Replace new_packet_list_ -> packet_list_


svn path=/trunk/; revision=44765
2012-09-04 02:35:25 +00:00
Jörg Mayer 380fe63a6d Rename new_packet_list.[ch] to packet_list.[ch]
svn path=/trunk/; revision=44764
2012-09-04 01:57:36 +00:00
Jakub Zawadzki 78019edc99 cinfo.columns_changed is only used by ui/gtk, move it to cfile structure.
svn path=/trunk/; revision=44750
2012-09-03 15:12:49 +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 3a3b4a1fdc Add -A as command line option to wireshark and tshark.
svn path=/trunk/; revision=44339
2012-08-08 14:30:55 +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
Anders Broman 88f8b100a2 Analyze->Apply as Filter and Analyze->Prepare a Filter cause crashes
user_data is NULL in the callbacks from the menu_bar, and when preparing filters we need to find the filter widget with g_object_get_data(G_OBJECT(data), E_DFILTER_TE_KEY).
The object is saved in the global variable popup_menu_object.
Use that in the filter callbacks from the menu bar.
- remove unused widget from a couple of callbacks.

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

svn path=/trunk/; revision=43961
2012-07-24 15:03:59 +00:00
Anders Broman 3be9409ae8 From Jakub Zawadzki use gtk_box_pack_start isof gtk_container_add fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7377
svn path=/trunk/; revision=43790
2012-07-18 19:44:54 +00:00
Jörg Mayer ebccbb0829 Get rid of the problems described in bug7377
Bissecting shows, that the problem was introduced by commit

r43009 | etxrab | 2012-06-03 01:53:04 +0200 (So, 03 Jun 2012) | 1 line

From Evan Huus Convert a bunch more GTK-2 calls to their cross-version ws_ equivalent

To get the problems back, compile with -DBREAK_GTK3


svn path=/trunk/; revision=43787
2012-07-18 17:38:19 +00:00
Anders Broman 6980e9474b e_addr_resolve has a new member.
svn path=/trunk/; revision=43660
2012-07-11 10:39:49 +00:00
Jeff Morriss 8f12c9d7d7 First phase of fixing https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7380 :
Add a new name resolution option: whether or not use the configured (in the OS)
name resolver (e.g., DNS) to resolve network names.  When this option is disabled
but network name resolution is enabled then Wireshark will resolve only those
names that it can from local sources.  This includes (at least, AFAIK):

- name resolutions that Wireshark picks up on from DNS packets it decodes
- the "user hosts file" (~/.wireshark/hosts on *NIX)
- what Wireshark reads out of capture file (the PCAPNG name resolution block)

This new preference defaults to "use external resolvers" for backward
compatibility (so people turning on network name resolution will get the old
behavior).

This option can be set via Edit->Preferences and on the command line; there
remain several UIs (e.g., the "open capture file" dialog, the
View->Name Resolution menu, etc.) that don't have the new option yet.


Also expand on the "description" for the name resolution preferences: these
are used not only in the tooltips but are also written to the preferences
file.  The previous text didn't include enough context when written do the
preferences file.

svn path=/trunk/; revision=43605
2012-07-08 01:31:48 +00:00
Jakub Zawadzki c383e6f115 Fix logic typo, it should fix bug #7434
svn path=/trunk/; revision=43588
2012-07-06 17:02:08 +00:00
Jakub Zawadzki f31b3943c0 - e_addr_resolve is structure so pass it by pointer.
- name_resolve_concurrency must be only defined when used.

svn path=/trunk/; revision=43584
2012-07-06 07:34:08 +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
Jakub Zawadzki 8c1d02377e Fix bug #7425: Per-packet right-click network or MAC name resolution not working
proto_tree_draw() from r43189 is lazy, and it don't fills tree with all item labels.
To fix it, move 'gbl_resolv_flags' hack to proto_tree_model_get_value().

XXX could we pass resolving flags to proto_item_fill_label()?


svn path=/trunk/; revision=43550
2012-06-30 10:43:50 +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 1ae8203b46 No pcap, no interfaces to monitor.
svn path=/trunk/; revision=43530
2012-06-28 19:10:40 +00:00
Guy Harris 5e077c6d6c <wsutil/file_util.h> is needed on Windows.
svn path=/trunk/; revision=43529
2012-06-28 19:09:22 +00:00
Guy Harris 79e11663b1 <wsutil/file_util.h> is needed by ui/gtk/iface_lists.c on Linux as it
does a ws_stat64() to check for the existence of files in /sys.

It's *not* needed in ui/gtk/main.c any more, as that code was moved out
of ui/gtk/main.c.

svn path=/trunk/; revision=43525
2012-06-28 18:33:53 +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 1d1391ed47 From Pontus Fuchs:
Add an interface monitor that, on Linux distributions with libnl,
watches for interfaces to appear or disappear and, on such an event,
causes windows showing interface lists to update.

svn path=/trunk/; revision=43521
2012-06-28 16:21:51 +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 234628c616 No pcap, no interfaces, no interface lists to refresh.
svn path=/trunk/; revision=43516
2012-06-28 02:19:12 +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 3814106d7e From Michael Mann:
generic preferences implementation

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

svn path=/trunk/; revision=43484
2012-06-25 21:05:36 +00:00
Jörg Mayer 5cab183cfb Pontus Fuchs (via bug 6973):
Make the wireless toolbar actually appear.

svn path=/trunk/; revision=43465
2012-06-24 19:43:09 +00:00
Jörg Mayer bca451b663 capture_dlg.h:
- Replace airpcap_tb in comment
- Remove trailing whitespace
main.c:
- wireless_tb must always be defined now, even if compiling without
  HAVE_AIRPCAP

svn path=/trunk/; revision=43373
2012-06-19 16:13:11 +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
Anders Broman eeb63c1297 Revert:
airpcap_tb -> wireless_tb

svn path=/trunk/; revision=43360
2012-06-19 14:08:15 +00:00
Anders Broman 890a3f66ea airpcap_tb -> wireless_tb
svn path=/trunk/; revision=43359
2012-06-19 13:36:35 +00:00
Anders Broman 227eb36c83 Start to have an generic wireless toolbar. Sligtly modified patch from
Pontus Fuchs.

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

svn path=/trunk/; revision=43354
2012-06-19 12:42:06 +00:00
Guy Harris 480e2c351b Move some code to manipulate the toolbar and capture interface dialog
out of main_menubar.c into routines in main.c.

Move some routines that are only used by main.c into
main_menubar_private.h.

svn path=/trunk/; revision=43298
2012-06-17 00:00:25 +00:00
Guy Harris 8bd9df6671 Oops, main_packet_panes.h no longer exists.
svn path=/trunk/; revision=43297
2012-06-16 23:29:57 +00:00
Guy Harris 26d50fb7a0 There's not much of note in ui/gtk/main_packet_panes.c; just do those
operations directly in ui/gtk/main.c.

svn path=/trunk/; revision=43295
2012-06-16 23:10:06 +00:00
Guy Harris c22b539731 Rename clear_tree_and_hex_views() to main_clear_tree_and_hex_views(), as
it specifically works on the main window's tree and hex dump views (it
doesn't apply to packet windows - they are always showing data from a
particular packet), and move its declaration to main_packet_panes.h.

svn path=/trunk/; revision=43293
2012-06-16 21:37:24 +00:00
Guy Harris 75dba53ad6 Move some routines that specifically handle the main window's packet
panes to main_packet_panes.c.

Rename main_tree_view_new() to proto_tree_view_new() - it's not just for
creating the main window's protocol tree view, it's also for creating
protocol tree views in packet windows.

svn path=/trunk/; revision=43292
2012-06-16 21:30:24 +00:00
Guy Harris 57cc5fa784 ui/gtk/main_proto_draw.c isn't just used for the main window, it's also
used for popped-up packet windows, and it includes more than just code
to draw the protocol tree - it includes the hex dump pane code as well. 
Rename it packet_panes.c; the stuff specific to the main window should
be moved into a different file.

svn path=/trunk/; revision=43290
2012-06-16 20:52:04 +00:00
Guy Harris 21d35d275a In effect, disable closing the main window while a capture is being
stopped - there's no guaranteed way to make the UI's close button
inactive (on X11, it depends on whether the window manager allows that),
but we can just do nothing and return TRUE from the delete event handler
to ignore the delete event.

svn path=/trunk/; revision=43252
2012-06-14 03:50:39 +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 98ec2ab440 Update a comment to reflect new-packet-list reality.
svn path=/trunk/; revision=43242
2012-06-13 21:08:18 +00:00
Guy Harris 9fe3d4b4f3 If we do a Save or Save As with a move, don't reread the capture file,
just tweak the elements in the capture_file structure as necessary and
poke the UI to update stuff such as the windows title.

If we do a Save or Save As with a copy, don't reread the capture file,
just close the old wtap, open a wtap for the copy, and tweak the
elements in the capture_file structure as necessary and poke the UI to
update stuff such as the windows title.

Otherwise, don't do a full read-and-dissect pass on the capture file,
just close the old wtap, open a wtap for the new file, tweak the
elements in the capture_file structure as necessary and poke the UI to
update stuff such as the windows title, and rescan the file to update
the packet offsets (and cause Wiretap to regenerate, for a gzipped file,
the information needed to support fast random access to the gzipped
file).

This should speed up Save and Save As a bit, as well as removing some
glitches in the UI (e.g., you won't see the packet list disappear and
reappear).

svn path=/trunk/; revision=43101
2012-06-05 06:52:18 +00:00