diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/capture_globals.h | 4 | ||||
-rw-r--r-- | ui/gtk/capture_dlg.c | 24 | ||||
-rw-r--r-- | ui/gtk/capture_if_dlg.c | 2 | ||||
-rw-r--r-- | ui/gtk/capture_info_dlg.c | 18 | ||||
-rw-r--r-- | ui/gtk/drag_and_drop.c | 2 | ||||
-rw-r--r-- | ui/gtk/main.c | 49 | ||||
-rw-r--r-- | ui/gtk/main_80211_toolbar.c | 1 | ||||
-rw-r--r-- | ui/gtk/main_statusbar.c | 48 | ||||
-rw-r--r-- | ui/gtk/main_statusbar_private.h | 2 | ||||
-rw-r--r-- | ui/iface_lists.c | 2 | ||||
-rw-r--r-- | ui/qt/main.cpp | 4 |
11 files changed, 86 insertions, 70 deletions
diff --git a/ui/capture_globals.h b/ui/capture_globals.h index 2bf0eeaa66..d388c6b48d 100644 --- a/ui/capture_globals.h +++ b/ui/capture_globals.h @@ -25,12 +25,16 @@ #ifndef __CAPTURE_GLOBALS_H__ #define __CAPTURE_GLOBALS_H__ +#include "../capture_session.h" + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ extern capture_options global_capture_opts; +extern capture_session global_capture_session; + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/ui/gtk/capture_dlg.c b/ui/gtk/capture_dlg.c index 547fea87e7..b79ded2717 100644 --- a/ui/gtk/capture_dlg.c +++ b/ui/gtk/capture_dlg.c @@ -555,7 +555,7 @@ capture_stop_cb(GtkWidget *w _U_, gpointer d _U_) airpcap_set_toolbar_stop_capture(airpcap_if_active); #endif - capture_stop(&global_capture_opts); + capture_stop(&global_capture_session); } /* restart (stop - delete old file - start) running capture */ @@ -567,7 +567,7 @@ capture_restart_cb(GtkWidget *w _U_, gpointer d _U_) airpcap_set_toolbar_start_capture(airpcap_if_active); #endif - capture_restart(&global_capture_opts); + capture_restart(&global_capture_session); } enum cfc_state_t { @@ -4715,7 +4715,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_) gtk_widget_set_sensitive(GTK_WIDGET(all_cb), if_present); /* Promiscuous mode row */ promisc_cb = gtk_check_button_new_with_mnemonic("Use _promiscuous mode on all interfaces"); - if (!global_capture_opts.session_started) { + if (!global_capture_session.session_started) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(promisc_cb), prefs.capture_prom_mode); } else { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(promisc_cb), get_all_prom_mode()); @@ -5233,7 +5233,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_) window_present(cap_open_w); cap_open_complete = TRUE; /* "Capture:Start" is now OK */ - global_capture_opts.session_started = TRUE; + global_capture_session.session_started = TRUE; } /* user pressed the "Start" button (in dialog or toolbar) */ @@ -5283,17 +5283,17 @@ capture_start_cb(GtkWidget *w _U_, gpointer d _U_) main_auto_scroll_live_changed(auto_scroll_live); /* XXX - can this ever happen? */ - if (global_capture_opts.state != CAPTURE_STOPPED) + if (global_capture_session.state != CAPTURE_STOPPED) return; /* close the currently loaded capture file */ - cf_close((capture_file *)global_capture_opts.cf); + cf_close((capture_file *)global_capture_session.cf); /* Copy the selected interfaces to the set of interfaces to use for this capture. */ collect_ifaces(&global_capture_opts); - if (capture_start(&global_capture_opts)) { + if (capture_start(&global_capture_opts, &global_capture_session)) { /* 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++) { @@ -5570,7 +5570,7 @@ create_and_fill_model(GtkTreeView *view) temp = g_strdup_printf("<b>%s</b>\n<span size='small'>%s</span>", device.display_name, device.addresses); } linkname = NULL; - if(global_capture_opts.session_started == FALSE && capture_dev_user_linktype_find(device.name) != -1) { + if(global_capture_session.session_started == FALSE && capture_dev_user_linktype_find(device.name) != -1) { device.active_dlt = capture_dev_user_linktype_find(device.name); } for (list = device.links; list != NULL; list = g_list_next(list)) { @@ -5583,10 +5583,10 @@ create_and_fill_model(GtkTreeView *view) if (!linkname) linkname = g_strdup("unknown"); pmode = capture_dev_user_pmode_find(device.name); - if (global_capture_opts.session_started == FALSE && pmode != -1) { + if (global_capture_session.session_started == FALSE && pmode != -1) { device.pmode = pmode; } - if(global_capture_opts.session_started == FALSE) { + if(global_capture_session.session_started == FALSE) { hassnap = capture_dev_user_hassnap_find(device.name); snaplen = capture_dev_user_snaplen_find(device.name); if(snaplen != -1 && hassnap != -1) { @@ -5606,10 +5606,10 @@ create_and_fill_model(GtkTreeView *view) } #if defined(_WIN32) || defined(HAVE_PCAP_CREATE) - if (global_capture_opts.session_started == FALSE && capture_dev_user_buffersize_find(device.name) != -1) { + if (global_capture_session.session_started == FALSE && capture_dev_user_buffersize_find(device.name) != -1) { buffer = capture_dev_user_buffersize_find(device.name); device.buffer = buffer; - } else if (global_capture_opts.session_started == FALSE) { + } else if (global_capture_session.session_started == FALSE) { device.buffer = DEFAULT_CAPTURE_BUFFER_SIZE; } #endif diff --git a/ui/gtk/capture_if_dlg.c b/ui/gtk/capture_if_dlg.c index 07cec6e7aa..1faec060fa 100644 --- a/ui/gtk/capture_if_dlg.c +++ b/ui/gtk/capture_if_dlg.c @@ -32,6 +32,8 @@ #include <epan/prefs.h> +#include "../capture_opts.h" +#include "../capture_session.h" #include "../capture_ifinfo.h" #include "../capture.h" #include "../capture-pcap-util.h" diff --git a/ui/gtk/capture_info_dlg.c b/ui/gtk/capture_info_dlg.c index 870f7a2045..2ec2118fbe 100644 --- a/ui/gtk/capture_info_dlg.c +++ b/ui/gtk/capture_info_dlg.c @@ -72,25 +72,25 @@ typedef struct { /* Workhorse for stopping capture */ static void -capture_info_stop(capture_options *capture_opts) +capture_info_stop(capture_session *cap_session) { #ifdef HAVE_AIRPCAP airpcap_set_toolbar_stop_capture(airpcap_if_active); #endif - capture_stop(capture_opts); + capture_stop(cap_session); } /* "delete-event" signal callback. Note different signature than "clicked" signal callback */ static gboolean capture_info_delete_cb(GtkWidget *w _U_, GdkEvent *event _U_, gpointer data) { - capture_info_stop((capture_options *)data); + capture_info_stop((capture_session *)data); return TRUE; } /* "clicked" signal callback */ static void capture_info_stop_clicked_cb(GtkButton *w _U_, gpointer data) { - capture_info_stop((capture_options *)data); + capture_info_stop((capture_session *)data); } static gboolean @@ -110,10 +110,10 @@ capture_info_ui_update_cb(gpointer data) /* create the capture info dialog */ /* will keep pointers to the fields in the counts parameter */ -void capture_info_ui_create( -capture_info *cinfo, -capture_options *capture_opts) +void +capture_info_ui_create(capture_info *cinfo, capture_session *cap_session) { + capture_options *capture_opts = cap_session->capture_opts; unsigned int i; GtkWidget *main_vb, *stop_bt, *counts_grid; GtkWidget *counts_fr, *running_grid, *running_label, *lb, *bbox, *ci_help; @@ -297,8 +297,8 @@ capture_options *capture_opts) stop_bt = (GtkWidget *)g_object_get_data(G_OBJECT(bbox), WIRESHARK_STOCK_CAPTURE_STOP); window_set_cancel_button(info->cap_w, stop_bt, NULL); - g_signal_connect(stop_bt, "clicked", G_CALLBACK(capture_info_stop_clicked_cb), capture_opts); - g_signal_connect(info->cap_w, "delete_event", G_CALLBACK(capture_info_delete_cb), capture_opts); + g_signal_connect(stop_bt, "clicked", G_CALLBACK(capture_info_stop_clicked_cb), cap_session); + g_signal_connect(info->cap_w, "delete_event", G_CALLBACK(capture_info_delete_cb), cap_session); ci_help = (GtkWidget *)g_object_get_data(G_OBJECT(bbox), GTK_STOCK_HELP); gtk_widget_set_tooltip_text(ci_help, "Get help about this dialog"); diff --git a/ui/gtk/drag_and_drop.c b/ui/gtk/drag_and_drop.c index a49ed17659..cb12955316 100644 --- a/ui/gtk/drag_and_drop.c +++ b/ui/gtk/drag_and_drop.c @@ -254,7 +254,7 @@ dnd_data_received(GtkWidget *widget _U_, GdkDragContext *dc _U_, gint x _U_, gin #ifdef HAVE_LIBPCAP /* if a capture is running, do nothing but warn the user */ - if((global_capture_opts.state != CAPTURE_STOPPED)) { + if((global_capture_session.state != CAPTURE_STOPPED)) { simple_dialog(ESD_TYPE_CONFIRMATION, ESD_BTN_OK, "%sDrag and Drop currently not possible!%s\n\n" diff --git a/ui/gtk/main.c b/ui/gtk/main.c index 580642478d..197fcce996 100644 --- a/ui/gtk/main.c +++ b/ui/gtk/main.c @@ -209,6 +209,9 @@ */ #define RC_FILE "gtkrc" +capture_options global_capture_opts; +capture_session global_capture_session; + capture_file cfile; static gboolean capture_stopping; @@ -980,7 +983,7 @@ main_do_quit(void) #ifdef HAVE_LIBPCAP /* Nuke any child capture in progress. */ - capture_kill_child(&global_capture_opts); + capture_kill_child(&global_capture_session); #endif /* Are we in the middle of reading a capture? */ @@ -1514,11 +1517,11 @@ static GList *icon_list_create( } static void -main_capture_cb_capture_prepared(capture_options *capture_opts) +main_capture_cb_capture_prepared(capture_session *cap_session) { static GList *icon_list = NULL; - set_titlebar_for_capture_in_progress((capture_file *)capture_opts->cf); + set_titlebar_for_capture_in_progress((capture_file *)cap_session->cf); if(icon_list == NULL) { icon_list = icon_list_create(wsiconcap_16_pb_data, wsiconcap_32_pb_data, wsiconcap_48_pb_data, wsiconcap_64_pb_data); @@ -1535,11 +1538,11 @@ main_capture_cb_capture_prepared(capture_options *capture_opts) } static void -main_capture_cb_capture_update_started(capture_options *capture_opts) +main_capture_cb_capture_update_started(capture_session *cap_session) { /* We've done this in "prepared" above, but it will be cleared while switching to the next multiple file. */ - set_titlebar_for_capture_in_progress((capture_file *)capture_opts->cf); + set_titlebar_for_capture_in_progress((capture_file *)cap_session->cf); main_set_for_capture_in_progress(TRUE); set_capture_if_dialog_for_capture_in_progress(TRUE); @@ -1553,9 +1556,9 @@ main_capture_cb_capture_update_started(capture_options *capture_opts) } static void -main_capture_cb_capture_update_finished(capture_options *capture_opts) +main_capture_cb_capture_update_finished(capture_session *cap_session) { - capture_file *cf = (capture_file *)capture_opts->cf; + capture_file *cf = (capture_file *)cap_session->cf; static GList *icon_list = NULL; /* The capture isn't stopping any more - it's stopped. */ @@ -1593,17 +1596,17 @@ main_capture_cb_capture_update_finished(capture_options *capture_opts) } static void -main_capture_cb_capture_fixed_started(capture_options *capture_opts _U_) +main_capture_cb_capture_fixed_started(capture_session *cap_session _U_) { /* Don't set up main window for a capture file. */ main_set_for_capture_file(FALSE); } static void -main_capture_cb_capture_fixed_finished(capture_options *capture_opts _U_) +main_capture_cb_capture_fixed_finished(capture_session *cap_session _U_) { #if 0 - capture_file *cf = capture_opts->cf; + capture_file *cf = (capture_file *)cap_session->cf; #endif static GList *icon_list = NULL; @@ -1637,7 +1640,7 @@ main_capture_cb_capture_fixed_finished(capture_options *capture_opts _U_) } static void -main_capture_cb_capture_stopping(capture_options *capture_opts _U_) +main_capture_cb_capture_stopping(capture_session *cap_session _U_) { capture_stopping = TRUE; set_menus_for_capture_stopping(); @@ -1649,7 +1652,7 @@ main_capture_cb_capture_stopping(capture_options *capture_opts _U_) } static void -main_capture_cb_capture_failed(capture_options *capture_opts _U_) +main_capture_cb_capture_failed(capture_session *cap_session _U_) { static GList *icon_list = NULL; @@ -1813,7 +1816,7 @@ main_cf_callback(gint event, gpointer data, gpointer user_data _U_) #ifdef HAVE_LIBPCAP static void -main_capture_callback(gint event, capture_options *capture_opts, gpointer user_data _U_) +main_capture_callback(gint event, capture_session *cap_session, gpointer user_data _U_) { #ifdef HAVE_GTKOSXAPPLICATION GtkosxApplication *theApp; @@ -1821,11 +1824,11 @@ main_capture_callback(gint event, capture_options *capture_opts, gpointer user_d switch(event) { case(capture_cb_capture_prepared): g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_DEBUG, "Callback: capture prepared"); - main_capture_cb_capture_prepared(capture_opts); + main_capture_cb_capture_prepared(cap_session); break; case(capture_cb_capture_update_started): g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_DEBUG, "Callback: capture update started"); - main_capture_cb_capture_update_started(capture_opts); + main_capture_cb_capture_update_started(cap_session); #ifdef HAVE_GTKOSXAPPLICATION theApp = (GtkosxApplication *)g_object_new(GTKOSX_TYPE_APPLICATION, NULL); gtkosx_application_set_dock_icon_pixbuf(theApp, gdk_pixbuf_new_from_inline(-1, wsiconcap_48_pb_data, FALSE, NULL)); @@ -1836,18 +1839,18 @@ main_capture_callback(gint event, capture_options *capture_opts, gpointer user_d break; case(capture_cb_capture_update_finished): g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_DEBUG, "Callback: capture update finished"); - main_capture_cb_capture_update_finished(capture_opts); + main_capture_cb_capture_update_finished(cap_session); break; case(capture_cb_capture_fixed_started): g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_DEBUG, "Callback: capture fixed started"); - main_capture_cb_capture_fixed_started(capture_opts); + main_capture_cb_capture_fixed_started(cap_session); break; case(capture_cb_capture_fixed_continue): g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_DEBUG, "Callback: capture fixed continue"); break; case(capture_cb_capture_fixed_finished): g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_DEBUG, "Callback: capture fixed finished"); - main_capture_cb_capture_fixed_finished(capture_opts); + main_capture_cb_capture_fixed_finished(cap_session); break; case(capture_cb_capture_stopping): g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_DEBUG, "Callback: capture stopping"); @@ -1857,11 +1860,11 @@ main_capture_callback(gint event, capture_options *capture_opts, gpointer user_d theApp = (GtkosxApplication *)g_object_new(GTKOSX_TYPE_APPLICATION, NULL); gtkosx_application_set_dock_icon_pixbuf(theApp, gdk_pixbuf_new_from_inline(-1, wsicon_64_pb_data, FALSE, NULL)); #endif - main_capture_cb_capture_stopping(capture_opts); + main_capture_cb_capture_stopping(cap_session); break; case(capture_cb_capture_failed): g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_DEBUG, "Callback: capture failed"); - main_capture_cb_capture_failed(capture_opts); + main_capture_cb_capture_failed(cap_session); break; default: g_warning("main_capture_callback: event %u unknown", event); @@ -2476,7 +2479,9 @@ main(int argc, char *argv[]) /* Set the initial values in the capture options. This might be overwritten by preference settings and then again by the command line parameters. */ - capture_opts_init(&global_capture_opts, &cfile); + capture_opts_init(&global_capture_opts); + + capture_session_init(&global_capture_session, (void *)&cfile); #endif /* Initialize whatever we need to allocate colors for GTK+ */ @@ -3131,7 +3136,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)) { + if (capture_start(&global_capture_opts, &global_capture_session)) { /* 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 5cfcb3a599..6f26ee07ea 100644 --- a/ui/gtk/main_80211_toolbar.c +++ b/ui/gtk/main_80211_toolbar.c @@ -45,6 +45,7 @@ #include "ui/gtk/old-gtk-compat.h" #include <ws80211_utils.h> +#include "capture_session.h" #include "capture_sync.h" static GtkWidget *tb80211_tb, *tb80211_iface_list_box, *tb80211_freq_list_box, *tb80211_chan_type_box, *tb80211_info_label; diff --git a/ui/gtk/main_statusbar.c b/ui/gtk/main_statusbar.c index 8c8866c5df..c3bff4781f 100644 --- a/ui/gtk/main_statusbar.c +++ b/ui/gtk/main_statusbar.c @@ -40,6 +40,7 @@ #include "../file.h" #ifdef HAVE_LIBPCAP #include "../capture_opts.h" +#include "../capture_session.h" #include "../capture_ui_utils.h" #include "../capture.h" #endif @@ -771,7 +772,7 @@ statusbar_cf_file_read_finished_cb(capture_file *cf) #ifdef HAVE_LIBPCAP static void -statusbar_capture_prepared_cb(capture_options *capture_opts _U_) +statusbar_capture_prepared_cb(capture_session *cap_session _U_) { static const gchar msg[] = " Waiting for capture input data ..."; statusbar_push_file_msg(msg); @@ -808,8 +809,9 @@ statusbar_get_interface_names(capture_options *capture_opts) } static void -statusbar_capture_update_started_cb(capture_options *capture_opts) +statusbar_capture_update_started_cb(capture_session *cap_session) { + capture_options *capture_opts = cap_session->capture_opts; GString *interface_names; statusbar_pop_file_msg(); @@ -825,10 +827,11 @@ statusbar_capture_update_started_cb(capture_options *capture_opts) } static void -statusbar_capture_update_continue_cb(capture_options *capture_opts) +statusbar_capture_update_continue_cb(capture_session *cap_session) { GString *interface_names; - capture_file *cf = (capture_file *)capture_opts->cf; + capture_options *capture_opts = cap_session->capture_opts; + capture_file *cf = (capture_file *)cap_session->cf; status_expert_update(); @@ -855,9 +858,9 @@ statusbar_capture_update_continue_cb(capture_options *capture_opts) } static void -statusbar_capture_update_finished_cb(capture_options *capture_opts) +statusbar_capture_update_finished_cb(capture_session *cap_session) { - capture_file *cf = (capture_file *)capture_opts->cf; + capture_file *cf = (capture_file *)cap_session->cf; /* Pop the "<live capture in progress>" message off the status bar. */ statusbar_pop_file_msg(); @@ -866,8 +869,9 @@ statusbar_capture_update_finished_cb(capture_options *capture_opts) } static void -statusbar_capture_fixed_started_cb(capture_options *capture_opts) +statusbar_capture_fixed_started_cb(capture_session *cap_session) { + capture_options *capture_opts = cap_session->capture_opts; GString *interface_names; statusbar_pop_file_msg(); @@ -882,9 +886,9 @@ statusbar_capture_fixed_started_cb(capture_options *capture_opts) } static void -statusbar_capture_fixed_continue_cb(capture_options *capture_opts) +statusbar_capture_fixed_continue_cb(capture_session *cap_session) { - capture_file *cf = (capture_file *)capture_opts->cf; + capture_file *cf = (capture_file *)cap_session->cf; gchar *capture_msg; @@ -896,10 +900,10 @@ statusbar_capture_fixed_continue_cb(capture_options *capture_opts) static void -statusbar_capture_fixed_finished_cb(capture_options *capture_opts _U_) +statusbar_capture_fixed_finished_cb(capture_session *cap_session _U_) { #if 0 - capture_file *cf = capture_opts->cf; + capture_file *cf = (capture_file *)cap_session->cf; #endif /* Pop the "<live capture in progress>" message off the status bar. */ @@ -911,10 +915,10 @@ statusbar_capture_fixed_finished_cb(capture_options *capture_opts _U_) } static void -statusbar_capture_failed_cb(capture_options *capture_opts _U_) +statusbar_capture_failed_cb(capture_session *cap_session _U_) { #if 0 - capture_file *cf = capture_opts->cf; + capture_file *cf = (capture_file *)cap_session->cf; #endif /* Pop the "<live capture in progress>" message off the status bar. */ @@ -1062,37 +1066,37 @@ statusbar_cf_callback(gint event, gpointer data, gpointer user_data _U_) #ifdef HAVE_LIBPCAP void -statusbar_capture_callback(gint event, capture_options *capture_opts, +statusbar_capture_callback(gint event, capture_session *cap_session, gpointer user_data _U_) { switch(event) { case(capture_cb_capture_prepared): - statusbar_capture_prepared_cb(capture_opts); + statusbar_capture_prepared_cb(cap_session); break; case(capture_cb_capture_update_started): - statusbar_capture_update_started_cb(capture_opts); + statusbar_capture_update_started_cb(cap_session); break; case(capture_cb_capture_update_continue): - statusbar_capture_update_continue_cb(capture_opts); + statusbar_capture_update_continue_cb(cap_session); break; case(capture_cb_capture_update_finished): - statusbar_capture_update_finished_cb(capture_opts); + statusbar_capture_update_finished_cb(cap_session); break; case(capture_cb_capture_fixed_started): - statusbar_capture_fixed_started_cb(capture_opts); + statusbar_capture_fixed_started_cb(cap_session); break; case(capture_cb_capture_fixed_continue): - statusbar_capture_fixed_continue_cb(capture_opts); + statusbar_capture_fixed_continue_cb(cap_session); break; case(capture_cb_capture_fixed_finished): - statusbar_capture_fixed_finished_cb(capture_opts); + statusbar_capture_fixed_finished_cb(cap_session); break; case(capture_cb_capture_stopping): /* Beware: this state won't be called, if the capture child * closes the capturing on its own! */ break; case(capture_cb_capture_failed): - statusbar_capture_failed_cb(capture_opts); + statusbar_capture_failed_cb(cap_session); break; default: g_warning("statusbar_capture_callback: event %u unknown", event); diff --git a/ui/gtk/main_statusbar_private.h b/ui/gtk/main_statusbar_private.h index 5dc1d93ad0..e4fbe7b99f 100644 --- a/ui/gtk/main_statusbar_private.h +++ b/ui/gtk/main_statusbar_private.h @@ -34,7 +34,7 @@ void statusbar_widgets_pack(GtkWidget *statusbar); void statusbar_widgets_show_or_hide(GtkWidget *statusbar); void statusbar_cf_callback(gint event, gpointer data, gpointer user_data); #ifdef HAVE_LIBPCAP -void statusbar_capture_callback(gint event, capture_options *capture_opts, +void statusbar_capture_callback(gint event, capture_session *cap_session, gpointer user_data); #endif diff --git a/ui/iface_lists.c b/ui/iface_lists.c index 4483033374..aec2e91ecf 100644 --- a/ui/iface_lists.c +++ b/ui/iface_lists.c @@ -39,8 +39,6 @@ #include "ui/capture_globals.h" #include "ui/iface_lists.h" -capture_options global_capture_opts; - /* * Used when sorting an interface list into alphabetical order by * their friendly names. diff --git a/ui/qt/main.cpp b/ui/qt/main.cpp index 19679a9bb6..c7e356d21e 100644 --- a/ui/qt/main.cpp +++ b/ui/qt/main.cpp @@ -811,7 +811,9 @@ int main(int argc, char *argv[]) /* Set the initial values in the capture options. This might be overwritten by preference settings and then again by the command line parameters. */ - capture_opts_init(&global_capture_opts, &cfile); + capture_opts_init(&global_capture_opts); + + capture_session_init(&global_capture_session, (void *)&cfile); #endif /* Register all dissectors; we must do this before checking for the |