Have capture_info_ui_create() and capture_info_open() take a pointer to
the capture_opts structure as an argument, rather than just a pointer to the interface name. Don't declare a global "capture_opts" pointer, as we don't define it any more. svn path=/trunk/; revision=25570
This commit is contained in:
parent
2eb5983b47
commit
2a691a0aec
|
@ -142,7 +142,7 @@ capture_start(capture_options *capture_opts)
|
||||||
cf_callback_invoke(cf_cb_live_capture_prepared, capture_opts);
|
cf_callback_invoke(cf_cb_live_capture_prepared, capture_opts);
|
||||||
|
|
||||||
if(capture_opts->show_info)
|
if(capture_opts->show_info)
|
||||||
capture_info_open(capture_opts->iface);
|
capture_info_open(capture_opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -74,7 +74,7 @@ info_data_t info_data;
|
||||||
|
|
||||||
|
|
||||||
/* open the info */
|
/* open the info */
|
||||||
void capture_info_open(const char *iface)
|
void capture_info_open(capture_opts *capture_opts)
|
||||||
{
|
{
|
||||||
info_data.counts.total = 0;
|
info_data.counts.total = 0;
|
||||||
info_data.counts.sctp = 0;
|
info_data.counts.sctp = 0;
|
||||||
|
@ -92,7 +92,7 @@ void capture_info_open(const char *iface)
|
||||||
info_data.wtap = NULL;
|
info_data.wtap = NULL;
|
||||||
info_data.ui.counts = &info_data.counts;
|
info_data.ui.counts = &info_data.counts;
|
||||||
|
|
||||||
capture_info_ui_create(&info_data.ui, iface);
|
capture_info_ui_create(&info_data.ui, capture_opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
|
|
||||||
/* open the info - init values (wtap, counts), create dialog */
|
/* open the info - init values (wtap, counts), create dialog */
|
||||||
extern void capture_info_open(const char *iface);
|
extern void capture_info_open(capture_opts *capture_opts);
|
||||||
|
|
||||||
/* new file arrived - (eventually close old wtap), open wtap */
|
/* new file arrived - (eventually close old wtap), open wtap */
|
||||||
extern gboolean capture_info_new_file(const char *new_filename);
|
extern gboolean capture_info_new_file(const char *new_filename);
|
||||||
|
@ -62,7 +62,7 @@ typedef struct {
|
||||||
/** Create the capture info dialog */
|
/** Create the capture info dialog */
|
||||||
extern void capture_info_ui_create(
|
extern void capture_info_ui_create(
|
||||||
capture_info *cinfo,
|
capture_info *cinfo,
|
||||||
const gchar *iface);
|
capture_opts *capture_opts);
|
||||||
|
|
||||||
/** Update the capture info counters in the dialog */
|
/** Update the capture info counters in the dialog */
|
||||||
extern void capture_info_ui_update(
|
extern void capture_info_ui_update(
|
||||||
|
|
|
@ -90,7 +90,8 @@ pct(gint num, gint denom) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
capture_info_delete_cb(GtkWidget *w _U_, GdkEvent *event _U_, gpointer data _U_) {
|
capture_info_delete_cb(GtkWidget *w _U_, GdkEvent *event _U_, gpointer data) {
|
||||||
|
capture_opts *capture_opts = data;
|
||||||
#ifdef HAVE_AIRPCAP
|
#ifdef HAVE_AIRPCAP
|
||||||
airpcap_set_toolbar_stop_capture(airpcap_if_active);
|
airpcap_set_toolbar_stop_capture(airpcap_if_active);
|
||||||
#endif
|
#endif
|
||||||
|
@ -118,7 +119,7 @@ capture_info_ui_update_cb(gpointer data)
|
||||||
/* will keep pointers to the fields in the counts parameter */
|
/* will keep pointers to the fields in the counts parameter */
|
||||||
void capture_info_ui_create(
|
void capture_info_ui_create(
|
||||||
capture_info *cinfo,
|
capture_info *cinfo,
|
||||||
const gchar *iface)
|
capture_opts *capture_opts)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
GtkWidget *main_vb, *stop_bt, *counts_tb;
|
GtkWidget *main_vb, *stop_bt, *counts_tb;
|
||||||
|
@ -167,7 +168,7 @@ const gchar *iface)
|
||||||
* it might be less cryptic, but if a more descriptive name is
|
* it might be less cryptic, but if a more descriptive name is
|
||||||
* available, we should still use that.
|
* available, we should still use that.
|
||||||
*/
|
*/
|
||||||
descr = get_interface_descriptive_name(iface);
|
descr = get_interface_descriptive_name(capture_opts->iface);
|
||||||
title_iface = g_strdup_printf("Wireshark: Capture from %s", descr);
|
title_iface = g_strdup_printf("Wireshark: Capture from %s", descr);
|
||||||
g_free(descr);
|
g_free(descr);
|
||||||
cap_w_title = create_user_window_title(title_iface);
|
cap_w_title = create_user_window_title(title_iface);
|
||||||
|
|
|
@ -64,11 +64,6 @@ extern GString *runtime_info_str;
|
||||||
|
|
||||||
extern GtkWidget* airpcap_tb;
|
extern GtkWidget* airpcap_tb;
|
||||||
|
|
||||||
/** Global capture options type. */
|
|
||||||
typedef struct capture_options_tag * p_capture_options_t;
|
|
||||||
/** Pointer to global capture options. */
|
|
||||||
extern p_capture_options_t capture_opts;
|
|
||||||
|
|
||||||
extern void protect_thread_critical_region(void);
|
extern void protect_thread_critical_region(void);
|
||||||
extern void unprotect_thread_critical_region(void);
|
extern void unprotect_thread_critical_region(void);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue