summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorLuis Ontanon <luis.ontanon@gmail.com>2013-06-27 17:10:50 +0000
committerLuis Ontanon <luis.ontanon@gmail.com>2013-06-27 17:10:50 +0000
commit0bdc0efc46ec66a298306aae253225c702ed6bea (patch)
tree1d6db93f3252994330777f123cb3d038518080e9 /ui
parentb450609a5561db9ddfc23b41c742979f5c4b3a32 (diff)
downloadwireshark-0bdc0efc46ec66a298306aae253225c702ed6bea.tar.gz
get main_window_update out of the way... pass an update_cb to the capture_sync stuff
... as per the XXX comment removed from tshark.c this was a mess to keep the linker happy... I couldn't! I did this without even understanding whether calling main_window_update was realy necessary in most cases. I guess nothing or more specific update cbs would be best. svn path=/trunk/; revision=50188
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk/capture_dlg.c6
-rw-r--r--ui/gtk/main.c8
-rw-r--r--ui/gtk/main_80211_toolbar.c3
-rw-r--r--ui/gtk/main_welcome.c5
-rw-r--r--ui/gtk/prefs_capture.c15
-rw-r--r--ui/gtk/voip_calls.c9
-rw-r--r--ui/iface_lists.c10
-rw-r--r--ui/iface_lists.h4
8 files changed, 35 insertions, 25 deletions
diff --git a/ui/gtk/capture_dlg.c b/ui/gtk/capture_dlg.c
index 5b1c467cc8..1ac27b3ead 100644
--- a/ui/gtk/capture_dlg.c
+++ b/ui/gtk/capture_dlg.c
@@ -5298,7 +5298,7 @@ capture_start_cb(GtkWidget *w _U_, gpointer d _U_)
this capture. */
collect_ifaces(&global_capture_opts);
- if (capture_start(&global_capture_opts, &global_capture_session)) {
+ if (capture_start(&global_capture_opts, &global_capture_session, main_window_update)) {
/* The capture succeeded, which means the capture filter syntax is
valid; add this capture filter to the recent capture filter list. */
for (i = 0; i < global_capture_opts.ifaces->len; i++) {
@@ -5796,7 +5796,7 @@ capture_prep_monitor_changed_cb(GtkWidget *monitor, gpointer argp _U_)
if_string = g_strdup(device.name);
monitor_mode = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(monitor));
- caps = capture_get_if_capabilities(if_string, monitor_mode, NULL);
+ caps = capture_get_if_capabilities(if_string, monitor_mode, NULL, main_window_update);
if (caps != NULL) {
g_signal_handlers_disconnect_by_func(linktype_combo_box, G_CALLBACK(select_link_type_cb), NULL );
@@ -6020,7 +6020,7 @@ void
refresh_local_interface_lists(void)
{
/* Reload the local interface list. */
- scan_local_interfaces();
+ scan_local_interfaces(main_window_update);
/* If there's an interfaces dialog up, refresh it. */
if (interfaces_dialog_window_present())
diff --git a/ui/gtk/main.c b/ui/gtk/main.c
index 981a316be8..49d7c0db87 100644
--- a/ui/gtk/main.c
+++ b/ui/gtk/main.c
@@ -2293,7 +2293,7 @@ main(int argc, char *argv[])
break;
case 'D': /* Print a list of capture devices and exit */
#ifdef HAVE_LIBPCAP
- if_list = capture_interface_list(&err, &err_str);
+ if_list = capture_interface_list(&err, &err_str,main_window_update);
if (if_list == NULL) {
switch (err) {
case CANT_GET_INTERFACE_LIST:
@@ -2800,7 +2800,7 @@ main(int argc, char *argv[])
}
#ifdef HAVE_LIBPCAP
- fill_in_local_interfaces();
+ fill_in_local_interfaces(main_window_update);
if (start_capture && list_link_layer_types) {
/* Specifying *both* is bogus. */
cmdarg_err("You can't specify both -L and a live capture.");
@@ -2870,7 +2870,7 @@ main(int argc, char *argv[])
device = g_array_index(global_capture_opts.all_ifaces, interface_t, i);
if (device.selected) {
#if defined(HAVE_PCAP_CREATE)
- caps = capture_get_if_capabilities(device.name, device.monitor_mode_supported, &err_str);
+ caps = capture_get_if_capabilities(device.name, device.monitor_mode_supported, &err_str, main_window_update);
#else
caps = capture_get_if_capabilities(device.name, FALSE, &err_str);
#endif
@@ -3133,7 +3133,7 @@ main(int argc, char *argv[])
to use for this capture. */
if (global_capture_opts.ifaces->len == 0)
collect_ifaces(&global_capture_opts);
- if (capture_start(&global_capture_opts, &global_capture_session)) {
+ if (capture_start(&global_capture_opts, &global_capture_session,main_window_update)) {
/* The capture started. Open stat windows; we do so after creating
the main window, to avoid GTK warnings, and after successfully
opening the capture file, so we know we have something to compute
diff --git a/ui/gtk/main_80211_toolbar.c b/ui/gtk/main_80211_toolbar.c
index 6b08d4cd16..0d244bc9a0 100644
--- a/ui/gtk/main_80211_toolbar.c
+++ b/ui/gtk/main_80211_toolbar.c
@@ -43,6 +43,7 @@
#include "ui/recent.h"
#include "ui/gtk/old-gtk-compat.h"
+#include "ui/ui_util.h"
#include "ui/gtk/main_80211_toolbar.h"
#include <ws80211_utils.h>
@@ -175,7 +176,7 @@ tb80211_do_set_channel(char *iface, int freq, int type)
freq_s = g_strdup_printf("%d", freq);
type_s = ws80211_chan_type_to_str(type);
ret = sync_interface_set_80211_chan(iface, freq_s, type_s,
- &data, &primary_msg, &secondary_msg);
+ &data, &primary_msg, &secondary_msg, main_window_update);
/* Parse the error msg */
if (ret && primary_msg) {
diff --git a/ui/gtk/main_welcome.c b/ui/gtk/main_welcome.c
index 215c6fa20c..fd39bbedb9 100644
--- a/ui/gtk/main_welcome.c
+++ b/ui/gtk/main_welcome.c
@@ -47,6 +47,7 @@
#include "ui/recent.h"
#include "ui/simple_dialog.h"
#include "ui/utf8_entities.h"
+#include "ui/ui_util.h"
#include "ui/gtk/gui_utils.h"
#include "ui/gtk/color_utils.h"
@@ -1068,7 +1069,7 @@ static void fill_capture_box(void)
/* run capture_interface_list(), not to get the interfaces, but to detect
* any errors, if there is an error, display an appropriate message in the gui */
- capture_interface_list(&error, &err_str);
+ capture_interface_list(&error, &err_str,main_window_update);
switch (error) {
case CANT_GET_INTERFACE_LIST:
@@ -1297,7 +1298,7 @@ welcome_new(void)
g_object_set_data(G_OBJECT(welcome_hb), CAPTURE_VIEW, topic_capture_to_fill);
#ifdef HAVE_LIBPCAP
- fill_in_local_interfaces();
+ fill_in_local_interfaces(main_window_update);
fill_capture_box();
/* capture help topic */
diff --git a/ui/gtk/prefs_capture.c b/ui/gtk/prefs_capture.c
index df54c62f90..010984c6e6 100644
--- a/ui/gtk/prefs_capture.c
+++ b/ui/gtk/prefs_capture.c
@@ -37,6 +37,7 @@
#include "ui/capture_globals.h"
#include "ui/iface_lists.h"
#include "ui/simple_dialog.h"
+#include "ui/ui_util.h"
#include "ui/gtk/prefs_capture.h"
#include "ui/gtk/prefs_dlg.h"
@@ -160,7 +161,7 @@ capture_prefs_show(void)
/*
* XXX - what if we can't get the list?
*/
- if_list = capture_interface_list(&err, NULL);
+ if_list = capture_interface_list(&err, NULL, main_window_update);
combo_list = build_capture_combo_list(if_list, FALSE);
free_interface_list(if_list);
if (combo_list != NULL) {
@@ -1076,7 +1077,7 @@ ifopts_description_to_val (const char *if_name, gboolean monitor_mode, const cha
if_capabilities_t *caps;
int dlt = -1;
- caps = capture_get_if_capabilities(if_name, monitor_mode, NULL);
+ caps = capture_get_if_capabilities(if_name, monitor_mode, NULL, main_window_update);
if (caps != NULL) {
if (caps->data_link_types != NULL) {
GList *lt_entry;
@@ -1186,9 +1187,9 @@ ifopts_edit_ifsel_cb(GtkTreeSelection *selection _U_,
* to the interface capabilities of the selected interface
*/
#ifdef HAVE_PCAP_CREATE
- caps = capture_get_if_capabilities(if_name, monitor_mode, NULL);
+ caps = capture_get_if_capabilities(if_name, monitor_mode, NULL, main_window_update);
#else
- caps = capture_get_if_capabilities(if_name, FALSE, NULL);
+ caps = capture_get_if_capabilities(if_name, FALSE, NULL, main_window_update);
#endif
if (caps != NULL) {
#ifdef HAVE_PCAP_CREATE
@@ -1304,7 +1305,7 @@ ifopts_edit_monitor_changed_cb(GtkToggleButton *tbt, gpointer udata)
gtk_list_store_set (list_store, &list_iter,
DEF_MONITOR_MODE_COLUMN, monitor_mode,
-1);
- caps = capture_get_if_capabilities(if_name, monitor_mode, NULL);
+ caps = capture_get_if_capabilities(if_name, monitor_mode, NULL, main_window_update);
#else
/* no monitor-mode support */
caps = capture_get_if_capabilities(if_name, FALSE, NULL);
@@ -1620,7 +1621,7 @@ ifopts_options_add(GtkListStore *list_store, if_info_t *if_info)
#ifdef HAVE_PCAP_CREATE
/* get default monitor mode setting */
monitor_mode = prefs_capture_device_monitor_mode(if_info->name);
- caps = capture_get_if_capabilities(if_info->name, monitor_mode, NULL);
+ caps = capture_get_if_capabilities(if_info->name, monitor_mode, NULL, main_window_update);
#else
/* no monitor-mode support */
caps = capture_get_if_capabilities(if_info->name, FALSE, NULL);
@@ -1774,7 +1775,7 @@ ifopts_if_liststore_add(void)
int err;
gchar *err_str;
- if_list = capture_interface_list(&err, &err_str); /* if_list = ptr to first element of list (or NULL) */
+ if_list = capture_interface_list(&err, &err_str, main_window_update); /* if_list = ptr to first element of list (or NULL) */
if (if_list == NULL) {
if (err != NO_INTERFACES_FOUND) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_str);
diff --git a/ui/gtk/voip_calls.c b/ui/gtk/voip_calls.c
index 0798cb1b7b..d3599f7883 100644
--- a/ui/gtk/voip_calls.c
+++ b/ui/gtk/voip_calls.c
@@ -74,6 +74,9 @@
#endif /* HAVE_LIBPORTAUDIO */
+#define DUMP_PTR1(p) printf("#=> %p\n",p)
+#define DUMP_PTR2(p) printf("==> %p\n",p)
+
const char *voip_call_state_name[8]={
"",
"CALL SETUP",
@@ -1526,7 +1529,8 @@ q931_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
/* remove this LRQ/LCF call entry because we have found the Setup that match them */
g_free(tmp_listinfo->from_identity);
g_free(tmp_listinfo->to_identity);
- g_free(tmp2_h323info->guid);
+ DUMP_PTR2(tmp2_h323info->guid);
+ g_free(tmp2_h323info->guid);
list2 = g_list_first(tmp2_h323info->h245_list);
while (list2)
@@ -1745,6 +1749,7 @@ static void add_h245_Address(h323_calls_info_t *h323info, h245_address_t *h245_
static void free_h225_info(gpointer p) {
h323_calls_info_t *tmp_h323info = (h323_calls_info_t *)p;
+ DUMP_PTR2(tmp_h323info->guid);
g_free(tmp_h323info->guid);
if (tmp_h323info->h245_list) {
@@ -1843,6 +1848,8 @@ H225calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
tmp_h323info = (h323_calls_info_t *)callsinfo->prot_info;
g_assert(tmp_h323info != NULL);
tmp_h323info->guid = (e_guid_t *)g_memdup(&pi->guid, sizeof pi->guid);
+ DUMP_PTR1(tmp_h323info->guid);
+
tmp_h323info->h225SetupAddr.type = AT_NONE;
tmp_h323info->h225SetupAddr.len = 0;
tmp_h323info->h245_list = NULL;
diff --git a/ui/iface_lists.c b/ui/iface_lists.c
index 4741424859..0ec6efcad0 100644
--- a/ui/iface_lists.c
+++ b/ui/iface_lists.c
@@ -63,7 +63,7 @@ if_list_comparator_alph(const void *first_arg, const void *second_arg)
* those interfaces.
*/
void
-scan_local_interfaces(void)
+scan_local_interfaces(void (*update_cb)(void))
{
GList *if_entry, *lt_entry, *if_list;
if_info_t *if_info, *temp;
@@ -94,7 +94,7 @@ scan_local_interfaces(void)
}
/* Scan through the list and build a list of strings to display. */
- if_list = capture_interface_list(&err, NULL);
+ if_list = capture_interface_list(&err, NULL, update_cb);
count = 0;
for (if_entry = if_list; if_entry != NULL; if_entry = g_list_next(if_entry)) {
if_info = (if_info_t *)if_entry->data;
@@ -160,7 +160,7 @@ scan_local_interfaces(void)
}
device.type = if_info->type;
monitor_mode = prefs_capture_device_monitor_mode(if_info->name);
- caps = capture_get_if_capabilities(if_info->name, monitor_mode, NULL);
+ caps = capture_get_if_capabilities(if_info->name, monitor_mode, NULL, update_cb);
for (; (curr_addr = g_slist_nth(if_info->addrs, ips)) != NULL; ips++) {
temp_addr = (if_addr_t *)g_malloc0(sizeof(if_addr_t));
if (ips != 0) {
@@ -347,7 +347,7 @@ scan_local_interfaces(void)
* record how long it takes in the info log.
*/
void
-fill_in_local_interfaces(void)
+fill_in_local_interfaces(void(*update_cb)(void))
{
GTimeVal start_time;
GTimeVal end_time;
@@ -360,7 +360,7 @@ fill_in_local_interfaces(void)
if (!initialized) {
/* do the actual work */
- scan_local_interfaces();
+ scan_local_interfaces(update_cb);
initialized = TRUE;
}
/* log how long it took */
diff --git a/ui/iface_lists.h b/ui/iface_lists.h
index 8cc4888783..7930ab6c37 100644
--- a/ui/iface_lists.h
+++ b/ui/iface_lists.h
@@ -41,12 +41,12 @@ extern gint if_list_comparator_alph(const void *first_arg, const void *second_ar
* Get the global interface list. Generate it if we haven't
* done so already.
*/
-extern void fill_in_local_interfaces(void);
+extern void fill_in_local_interfaces(void(*update_cb)(void));
/*
* Update the global interface list.
*/
-extern void scan_local_interfaces(void);
+extern void scan_local_interfaces(void (*update_cb)(void));
extern void hide_interface(gchar* new_hide);
#endif /* HAVE_LIBPCAP */