diff options
Diffstat (limited to 'ui')
30 files changed, 35 insertions, 202 deletions
diff --git a/ui/commandline.c b/ui/commandline.c index 8d81c8d1a9..66e4d63d23 100644 --- a/ui/commandline.c +++ b/ui/commandline.c @@ -64,9 +64,7 @@ commandline_param_info_t global_commandline_info; -#if defined(HAVE_LIBPCAP) || defined(HAVE_EXTCAP) capture_options global_capture_opts; -#endif void commandline_print_usage(gboolean for_help_option) { diff --git a/ui/gtk/CMakeLists.txt b/ui/gtk/CMakeLists.txt index 8f92e08819..c4d34b6a43 100644 --- a/ui/gtk/CMakeLists.txt +++ b/ui/gtk/CMakeLists.txt @@ -44,6 +44,7 @@ set(WIRESHARK_GTK_SRC export_object_dlg.c export_pdu_dlg.c export_sslkeys.c + extcap_gtk.c filter_autocomplete.c file_dlg.c file_import_dlg.c @@ -185,13 +186,6 @@ if(PORTAUDIO_FOUND) endif() endif() -if(ENABLE_EXTCAP) - set(WIRESHARK_GTK_SRC - ${WIRESHARK_GTK_SRC} - extcap_gtk.c - ) -endif() - set(WIRESHARK_TAP_SRC ${CMAKE_CURRENT_SOURCE_DIR}/compare_stat.c ${CMAKE_CURRENT_SOURCE_DIR}/dcerpc_stat.c diff --git a/ui/gtk/Makefile.am b/ui/gtk/Makefile.am index 33cfe073ee..23d70fb8b2 100644 --- a/ui/gtk/Makefile.am +++ b/ui/gtk/Makefile.am @@ -55,6 +55,7 @@ WIRESHARK_COMMON_GTK_SRC = \ expert_comp_table.c \ export_object_dlg.c \ export_sslkeys.c \ + extcap_gtk.c \ filter_autocomplete.c \ file_dlg.c \ file_import_dlg.c \ @@ -176,6 +177,7 @@ WIRESHARK_COMMON_GTK_HDRS = \ export_object_dlg.h \ export_pdu_dlg.h \ export_sslkeys.h \ + extcap_gtk.h \ file_dlg.h \ file_import_dlg.h \ fileset_dlg.h \ @@ -261,11 +263,6 @@ BUILD_PIXBUF_CSOURCE = \ pixbuf-csource.c endif -if HAVE_EXTCAP -WIRESHARK_COMMON_GTK_SRC += extcap_gtk.c -WIRESHARK_COMMON_GTK_HDRS += extcap_gtk.h -endif - AM_CPPFLAGS = $(INCLUDEDIRS) $(WS_CPPFLAGS) $(GTK_CFLAGS) \ $(PORTAUDIO_INCLUDES) diff --git a/ui/gtk/about_dlg.c b/ui/gtk/about_dlg.c index 5d90c1b4ba..5f0548c4fd 100644 --- a/ui/gtk/about_dlg.c +++ b/ui/gtk/about_dlg.c @@ -39,9 +39,7 @@ #ifdef HAVE_LUA #include <epan/wslua/init_wslua.h> #endif -#ifdef HAVE_EXTCAP -#include "../../extcap.h" -#endif +#include "extcap.h" #include "../../log.h" #include "epan/register.h" @@ -258,9 +256,7 @@ splash_update(register_action_e action, const char *message, gpointer client_dat #ifdef HAVE_LUA ul_count += wslua_count_plugins (); /* get count of lua plugins */ #endif -#ifdef HAVE_EXTCAP ul_count += extcap_count() + 1; /* Count of extcap binaries + registration message */ -#endif } main_lb = (GtkWidget *)g_object_get_data(G_OBJECT(win), "protocol_label"); @@ -401,7 +397,7 @@ about_folders_page_new(void) char *path; static const gchar *titles[] = { "Name", "Folder", "Typical Files"}; GtkWidget *scrolledwindow; -#if defined(HAVE_LIBSMI) || defined(HAVE_GEOIP) || defined(HAVE_EXTCAP) +#if defined(HAVE_LIBSMI) || defined(HAVE_GEOIP) gint i; gchar **resultArray; #endif @@ -478,7 +474,6 @@ about_folders_page_new(void) "lua scripts"); #endif -#ifdef HAVE_EXTCAP /* extcap */ constpath = get_extcap_dir(); @@ -488,7 +483,6 @@ about_folders_page_new(void) about_folders_row(table, "Extcap path", g_strstrip(resultArray[i]), "Extcap Plugins search path"); g_strfreev(resultArray); -#endif #ifdef HAVE_GEOIP /* GeoIP */ diff --git a/ui/gtk/capture_dlg.c b/ui/gtk/capture_dlg.c index 6a64c3a13d..798bc0e5b9 100644 --- a/ui/gtk/capture_dlg.c +++ b/ui/gtk/capture_dlg.c @@ -84,10 +84,8 @@ #include "airpcap_dlg.h" #endif -#ifdef HAVE_EXTCAP #include "extcap.h" #include "ui/gtk/extcap_gtk.h" -#endif #include "globals.h" @@ -175,10 +173,7 @@ enum #define E_CAP_N_RESOLVE_KEY "cap_n_resolve" #define E_CAP_T_RESOLVE_KEY "cap_t_resolve" #define E_CAP_E_RESOLVE_KEY "cap_e_resolve" - -#ifdef HAVE_EXTCAP #define E_CAP_EXTCAP_KEY "cap_extcap_vbox" -#endif #define E_CAP_IFTYPE_CBX_KEY "cap_iftype_cbx" #ifdef HAVE_PCAP_REMOTE @@ -769,11 +764,9 @@ capture_all_filter_check_syntax_cb(GtkWidget *w _U_, gpointer user_data _U_) simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "The link type of interface %s was not specified.", device.name); continue; /* Programming error: somehow managed to select an "unsupported" entry */ } -#ifdef HAVE_EXTCAP /* Can't verify extcap capture filters */ if (device.if_info.extcap != NULL && strlen(device.if_info.extcap) > 0) continue; -#endif filter_text = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT(filter_cm)); if (strlen(filter_text) == 0) { colorize_filter_te_as_empty(filter_te); @@ -2473,9 +2466,7 @@ save_options_cb(GtkWidget *win _U_, gpointer user_data _U_) #ifdef CAN_SET_CAPTURE_BUFFER_SIZE GtkWidget *buffer_size_sb; #endif -#ifdef HAVE_EXTCAP GtkWidget *extcap_vbox = NULL; -#endif interface_t device; gpointer ptr = NULL; @@ -2497,9 +2488,7 @@ save_options_cb(GtkWidget *win _U_, gpointer user_data _U_) linktype_combo_box = (GtkWidget *) g_object_get_data(G_OBJECT(opt_edit_w), E_CAP_LT_CBX_KEY); -#ifdef HAVE_EXTCAP extcap_vbox = (GtkWidget *) g_object_get_data(G_OBJECT(opt_edit_w), E_CAP_EXTCAP_KEY); -#endif if (device.links != NULL) { if (ws_combo_box_get_active_pointer(GTK_COMBO_BOX(linktype_combo_box), &ptr)) { @@ -2530,7 +2519,6 @@ save_options_cb(GtkWidget *win _U_, gpointer user_data _U_) g_assert(filter_text != NULL); device.cfilter = filter_text; -#ifdef HAVE_EXTCAP if (device.external_cap_args_settings != NULL) g_hash_table_unref(device.external_cap_args_settings); @@ -2541,7 +2529,6 @@ save_options_cb(GtkWidget *win _U_, gpointer user_data _U_) #if 0 extcap_gtk_free_args(extcap_vbox); #endif -#endif #ifdef HAVE_PCAP_CREATE /* if dumpcap reported that the interface does not support monitor @@ -2579,8 +2566,6 @@ adjust_snap_sensitivity(GtkWidget *tb _U_, gpointer parent_w _U_) g_array_insert_val(global_capture_opts.all_ifaces, marked_interface, device); } -#ifdef HAVE_EXTCAP - static GtkWidget *build_extcap_options(const gchar *name, GHashTable *hash) { GtkWidget *ret_box = NULL; GList *arglist = NULL; @@ -2602,7 +2587,6 @@ static GtkWidget *build_extcap_options(const gchar *name, GHashTable *hash) { return ret_box; } -#endif /* * If we have an AirPcap "Wireless Settings" checkbox, have two columns @@ -2648,9 +2632,7 @@ void options_interface_cb(GtkTreeView *view, GtkTreePath *path, GtkTreeViewColum *compile_bt, #endif *bbox, *ok_but, *cancel_bt, -#ifdef HAVE_EXTCAP *extcap_vbox, -#endif *help_bt; GList *cf_entry, *list, *cfilter_list; @@ -2676,9 +2658,7 @@ void options_interface_cb(GtkTreeView *view, GtkTreePath *path, GtkTreeViewColum GtkCellRenderer *renderer; GtkListStore *store; const gchar *new_cfilter; -#ifdef HAVE_EXTCAP GHashTable *extcap_hash; -#endif window = (GtkWidget *)userdata; caller = gtk_widget_get_toplevel(GTK_WIDGET(window)); @@ -2706,9 +2686,7 @@ void options_interface_cb(GtkTreeView *view, GtkTreePath *path, GtkTreeViewColum #ifdef CAN_SET_CAPTURE_BUFFER_SIZE device.buffer = DEFAULT_CAPTURE_BUFFER_SIZE; #endif -#ifdef HAVE_EXTCAP device.external_cap_args_settings = NULL; -#endif model = gtk_tree_view_get_model(view); gtk_tree_model_get_iter (model, &iter, path); @@ -3082,7 +3060,6 @@ void options_interface_cb(GtkTreeView *view, GtkTreePath *path, GtkTreeViewColum } #endif -#ifdef HAVE_EXTCAP extcap_hash = device.external_cap_args_settings; extcap_vbox = build_extcap_options(device.name, extcap_hash); if (extcap_vbox != NULL) { @@ -3090,7 +3067,6 @@ void options_interface_cb(GtkTreeView *view, GtkTreePath *path, GtkTreeViewColum gtk_widget_show(extcap_vbox); } g_object_set_data(G_OBJECT(opt_edit_w), E_CAP_EXTCAP_KEY, extcap_vbox); -#endif /* Button row: "Start", "Cancel" and "Help" buttons */ bbox = dlg_button_row_new(GTK_STOCK_OK, GTK_STOCK_CANCEL, GTK_STOCK_HELP, NULL); @@ -3564,10 +3540,8 @@ add_pipe_cb(gpointer w _U_) device.if_info.addrs = NULL; device.if_info.loopback = FALSE; device.if_info.type = IF_PIPE; -#ifdef HAVE_EXTCAP device.if_info.extcap = NULL; device.external_cap_args_settings = NULL; -#endif #if defined(HAVE_PCAP_CREATE) device.monitor_mode_enabled = FALSE; device.monitor_mode_supported = FALSE; diff --git a/ui/gtk/capture_if_dlg.c b/ui/gtk/capture_if_dlg.c index 99461a4823..b894e99d3d 100644 --- a/ui/gtk/capture_if_dlg.c +++ b/ui/gtk/capture_if_dlg.c @@ -412,14 +412,12 @@ GtkWidget * capture_get_if_icon(interface_t *device) return xpm_to_widget(network_virtual_16_xpm); case IF_WIRED: return PIXBUF_TO_WIDGET(network_wired_pb_data, "/org/wireshark/image/toolbar/network_wired_16.png"); -#ifdef HAVE_EXTCAP case IF_EXTCAP: #ifdef _WIN32 if (strncmp(device->friendly_name, "USBPcap", 7) == 0) { return PIXBUF_TO_WIDGET(network_usb_pb_data, "/org/wireshark/image/toolbar/network_usb_16.png"); } #endif -#endif case IF_PIPE: case IF_STDIN: return PIXBUF_TO_WIDGET(pipe_pb_data, "/org/wireshark/image/toolbar/pipe_16.png"); diff --git a/ui/gtk/main.c b/ui/gtk/main.c index 3153a214e2..8f0c7c40ab 100644 --- a/ui/gtk/main.c +++ b/ui/gtk/main.c @@ -40,9 +40,7 @@ #include <getopt.h> #endif -#ifdef HAVE_EXTCAP #include <extcap.h> -#endif #ifdef HAVE_LIBPORTAUDIO #include <portaudio.h> @@ -2234,10 +2232,8 @@ main(int argc, char *argv[]) rtd_table_iterate_tables(register_response_time_delay_tables, NULL); new_stat_tap_iterate_tables(register_simple_stat_tables, NULL); -#ifdef HAVE_EXTCAP splash_update(RA_EXTCAP, NULL, (gpointer)splash_win); extcap_register_preferences(); -#endif splash_update(RA_PREFERENCES, NULL, (gpointer)splash_win); @@ -2634,10 +2630,7 @@ main(int argc, char *argv[]) #endif epan_cleanup(); - -#ifdef HAVE_EXTCAP extcap_cleanup(); -#endif AirPDcapDestroyContext(&airpdcap_ctx); diff --git a/ui/help_url.c b/ui/help_url.c index 455c173b9c..a462429aa7 100644 --- a/ui/help_url.c +++ b/ui/help_url.c @@ -239,11 +239,9 @@ topic_action_url(topic_action_e action) case(HELP_EXPERT_INFO_DIALOG): url = user_guide_url("ChAdvExpert.html"); break; -#ifdef HAVE_EXTCAP case(HELP_EXTCAP_OPTIONS_DIALOG): url = data_file_url("extcap.html"); break; -#endif case(HELP_STATS_SUMMARY_DIALOG): url = user_guide_url("ChStatSummary.html"); break; diff --git a/ui/help_url.h b/ui/help_url.h index d75898d762..658dda90cf 100644 --- a/ui/help_url.h +++ b/ui/help_url.h @@ -87,9 +87,7 @@ typedef enum { HELP_FOLLOW_STREAM_DIALOG, HELP_SHOW_PACKET_BYTES_DIALOG, HELP_EXPERT_INFO_DIALOG, -#ifdef HAVE_EXTCAP HELP_EXTCAP_OPTIONS_DIALOG, -#endif HELP_STATS_SUMMARY_DIALOG, HELP_STATS_PROTO_HIERARCHY_DIALOG, HELP_STATS_ENDPOINTS_DIALOG, diff --git a/ui/iface_lists.c b/ui/iface_lists.c index a1b66745f1..e249029fe7 100644 --- a/ui/iface_lists.c +++ b/ui/iface_lists.c @@ -184,9 +184,8 @@ scan_local_interfaces(void (*update_cb)(void)) temp.vendor_description = g_strdup(if_info->vendor_description); temp.loopback = if_info->loopback; temp.type = if_info->type; -#ifdef HAVE_EXTCAP temp.extcap = g_strdup(if_info->extcap); -#endif + /* Is this interface hidden and, if so, should we include it anyway? */ descr = capture_dev_user_descr_find(if_info->name); @@ -315,10 +314,9 @@ scan_local_interfaces(void (*update_cb)(void)) global_capture_opts.num_selected++; } -#ifdef HAVE_EXTCAP /* Extcap devices start with no cached args */ device.external_cap_args_settings = NULL; -#endif + if (global_capture_opts.all_ifaces->len <= count) { g_array_append_val(global_capture_opts.all_ifaces, device); count = global_capture_opts.all_ifaces->len; @@ -381,9 +379,7 @@ scan_local_interfaces(void (*update_cb)(void)) device.if_info.vendor_description = g_strdup(interface_opts->descr); device.if_info.addrs = NULL; device.if_info.loopback = FALSE; -#ifdef HAVE_EXTCAP device.if_info.extcap = g_strdup(interface_opts->extcap); -#endif g_array_append_val(global_capture_opts.all_ifaces, device); global_capture_opts.num_selected++; diff --git a/ui/qt/CMakeLists.txt b/ui/qt/CMakeLists.txt index 7b4a8439ed..ad09591e56 100644 --- a/ui/qt/CMakeLists.txt +++ b/ui/qt/CMakeLists.txt @@ -141,6 +141,10 @@ set(WIRESHARK_QT_HEADERS export_object_action.h export_object_dialog.h export_pdu_dialog.h + extcap_argument.h + extcap_argument_file.h + extcap_argument_multiselect.h + extcap_options_dialog.h file_set_dialog.h filter_action.h filter_dialog.h @@ -236,16 +240,6 @@ if(HAVE_PCAP_REMOTE) ) endif() -if(ENABLE_EXTCAP) - set(WIRESHARK_QT_HEADERS - ${WIRESHARK_QT_HEADERS} - extcap_argument.h - extcap_argument_file.h - extcap_argument_multiselect.h - extcap_options_dialog.h - ) -endif() - file(GLOB EXTRA_QT_HEADERS packet_list_record.h models/sparkline_delegate.h @@ -365,6 +359,10 @@ set(WIRESHARK_QT_SRC export_object_action.cpp export_object_dialog.cpp export_pdu_dialog.cpp + extcap_argument.cpp + extcap_argument_file.cpp + extcap_argument_multiselect.cpp + extcap_options_dialog.cpp file_set_dialog.cpp filter_action.cpp filter_dialog.cpp @@ -454,16 +452,6 @@ if(HAVE_PCAP_REMOTE) ) endif() -if(ENABLE_EXTCAP) - set(WIRESHARK_QT_SRC - ${WIRESHARK_QT_SRC} - extcap_argument.cpp - extcap_argument_file.cpp - extcap_argument_multiselect.cpp - extcap_options_dialog.cpp - ) -endif() - set(WIRESHARK_QT_TAP_SRC ${CMAKE_CURRENT_SOURCE_DIR}/expert_info_dialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/funnel_statistics.cpp @@ -508,6 +496,7 @@ set(WIRESHARK_QT_UI expert_info_dialog.ui export_object_dialog.ui export_pdu_dialog.ui + extcap_options_dialog.ui file_set_dialog.ui filter_dialog.ui filter_expression_frame.ui @@ -576,13 +565,6 @@ if(HAVE_PCAP_REMOTE) ) endif() -if(ENABLE_EXTCAP) - set(WIRESHARK_QT_UI - ${WIRESHARK_QT_UI} - extcap_options_dialog.ui - ) -endif() - set(WIRESHARK_QT_TS wireshark_de.ts wireshark_en.ts # lupdate -pluralonly diff --git a/ui/qt/Makefile.am b/ui/qt/Makefile.am index da04af33b8..419700ded5 100644 --- a/ui/qt/Makefile.am +++ b/ui/qt/Makefile.am @@ -57,6 +57,7 @@ NODIST_GENERATED_HEADER_FILES = \ ui_expert_info_dialog.h \ ui_export_object_dialog.h \ ui_export_pdu_dialog.h \ + ui_extcap_options_dialog.h \ ui_file_set_dialog.h \ ui_filter_dialog.h \ ui_filter_expression_frame.h \ @@ -120,6 +121,7 @@ NODIST_GENERATED_HEADER_FILES = \ ui_voip_calls_dialog.h \ ui_wireless_frame.h + # Generated C source files that we want in the distribution. GENERATED_C_FILES = @@ -271,6 +273,10 @@ MOC_HDRS = \ export_object_action.h \ export_object_dialog.h \ export_pdu_dialog.h \ + extcap_argument.h \ + extcap_argument_file.h \ + extcap_argument_multiselect.h \ + extcap_options_dialog.h \ file_set_dialog.h \ filter_action.h \ filter_dialog.h \ @@ -387,6 +393,7 @@ UI_FILES = \ expert_info_dialog.ui \ export_object_dialog.ui \ export_pdu_dialog.ui \ + extcap_options_dialog.ui \ file_set_dialog.ui \ filter_dialog.ui \ filter_expression_frame.ui \ @@ -608,6 +615,10 @@ WIRESHARK_QT_SRC = \ export_object_action.cpp \ export_object_dialog.cpp \ export_pdu_dialog.cpp \ + extcap_argument.cpp \ + extcap_argument_file.cpp \ + extcap_argument_multiselect.cpp \ + extcap_options_dialog.cpp \ file_set_dialog.cpp \ filter_action.cpp \ filter_dialog.cpp \ @@ -718,25 +729,6 @@ noinst_HEADERS = \ utils/tango_colors.h \ utils/variant_pointer.h -if HAVE_EXTCAP -NODIST_GENERATED_HEADER_FILES += \ - ui_extcap_options_dialog.h - -MOC_HDRS += \ - extcap_argument.h \ - extcap_argument_file.h \ - extcap_argument_multiselect.h \ - extcap_options_dialog.h - -UI_FILES += \ - extcap_options_dialog.ui - -WIRESHARK_QT_SRC += \ - extcap_argument.cpp \ - extcap_argument_file.cpp \ - extcap_argument_multiselect.cpp \ - extcap_options_dialog.cpp -endif wireshark-tap-register.c: $(WIRESHARK_QT_TAP_SRC) ../make-taps $(AM_V_GEN)../make-taps $@ $(filter %.cpp,$^) diff --git a/ui/qt/about_dialog.cpp b/ui/qt/about_dialog.cpp index cd2c6ec536..3962636cab 100644 --- a/ui/qt/about_dialog.cpp +++ b/ui/qt/about_dialog.cpp @@ -41,9 +41,7 @@ #include "wsutil/copyright_info.h" #include "version_info.h" -#ifdef HAVE_EXTCAP #include "extcap.h" -#endif #include <ui/qt/utils/qt_ui_utils.h> #include <ui/qt/utils/variant_pointer.h> @@ -131,7 +129,6 @@ PluginListModel::PluginListModel(QObject * parent) : AStringListListModel(parent wslua_plugins_get_descriptions(plugins_add_description, &plugin_data); #endif -#ifdef HAVE_EXTCAP GHashTable * tools = extcap_loaded_interfaces(); if (tools && g_hash_table_size(tools) > 0) { GList * walker = g_list_first(g_hash_table_get_keys(tools)); @@ -144,7 +141,6 @@ PluginListModel::PluginListModel(QObject * parent) : AStringListListModel(parent walker = g_list_next(walker); } } -#endif typeNames_ << QString(""); foreach(QStringList row, plugin_data) @@ -241,15 +237,12 @@ FolderListModel::FolderListModel(QObject * parent): appendRow( QStringList() << "Global Lua Plugins" << get_plugins_dir() << "lua scripts"); #endif -#ifdef HAVE_EXTCAP /* Extcap */ QStringList extPaths = QString(get_extcap_dir()).split(G_SEARCHPATH_SEPARATOR_S); foreach(QString path, extPaths) appendRow( QStringList() << "Extcap path" << path.trimmed() << "Extcap Plugins search path"); -#endif - #ifdef HAVE_GEOIP /* GeoIP */ QStringList geoIpPaths = QString(geoip_db_get_paths()).split(G_SEARCHPATH_SEPARATOR_S); @@ -348,7 +341,7 @@ AboutDialog::AboutDialog(QWidget *parent) : /* Plugins */ -#if defined(HAVE_PLUGINS) || defined(HAVE_LUA) || defined(HAVE_EXTCAP) +#if defined(HAVE_PLUGINS) || defined(HAVE_LUA) PluginListModel * pluginModel = new PluginListModel(this); AStringListListSortFilterProxyModel * pluginFilterModel = new AStringListListSortFilterProxyModel(this); diff --git a/ui/qt/capture_filter_syntax_worker.cpp b/ui/qt/capture_filter_syntax_worker.cpp index b61f6dbbb4..be314a8edb 100644 --- a/ui/qt/capture_filter_syntax_worker.cpp +++ b/ui/qt/capture_filter_syntax_worker.cpp @@ -29,9 +29,7 @@ #include "capture_opts.h" #include "ui/capture_globals.h" #endif -#ifdef HAVE_EXTCAP #include "extcap.h" -#endif #include "capture_filter_syntax_worker.h" #include <ui/qt/widgets/syntax_line_edit.h> @@ -63,9 +61,7 @@ void CaptureFilterSyntaxWorker::start() { forever { QString filter; QSet<gint> active_dlts; -#ifdef HAVE_EXTCAP QSet<guint> active_extcap; -#endif struct bpf_program fcode; pcap_t *pd; int pc_err; @@ -93,9 +89,7 @@ void CaptureFilterSyntaxWorker::start() { device = &g_array_index(global_capture_opts.all_ifaces, interface_t, if_idx); if (device->selected) { -#ifdef HAVE_EXTCAP if (device->if_info.extcap == NULL || strlen(device->if_info.extcap) == 0) { -#endif if (device->active_dlt >= DLT_USER0 && device->active_dlt <= DLT_USER15) { // Capture filter for DLT_USER is unknown state = SyntaxLineEdit::Deprecated; @@ -103,11 +97,9 @@ void CaptureFilterSyntaxWorker::start() { } else { active_dlts.insert(device->active_dlt); } -#ifdef HAVE_EXTCAP } else { active_extcap.insert(if_idx); } -#endif } } @@ -142,7 +134,6 @@ void CaptureFilterSyntaxWorker::start() { if (state == SyntaxLineEdit::Invalid) break; } -#ifdef HAVE_EXTCAP // If it's already invalid, don't bother to check extcap if (state != SyntaxLineEdit::Invalid) { foreach (guint extcapif, active_extcap.toList()) { @@ -165,7 +156,6 @@ void CaptureFilterSyntaxWorker::start() { g_free (error); } } -#endif emit syntaxResult(filter, state, err_str); DEBUG_SYNTAX_CHECK("known", "idle"); diff --git a/ui/qt/capture_interfaces_dialog.cpp b/ui/qt/capture_interfaces_dialog.cpp index db82e82874..6e4939fb08 100644 --- a/ui/qt/capture_interfaces_dialog.cpp +++ b/ui/qt/capture_interfaces_dialog.cpp @@ -132,7 +132,6 @@ public: } setText(col_link_, linkname); -#ifdef HAVE_EXTCAP if (device->if_info.type == IF_EXTCAP) { /* extcap interfaces does not have this settings */ setApplicable(col_pmode_, false); @@ -142,7 +141,6 @@ public: setApplicable(col_buffer_, false); #endif } else { -#endif setApplicable(col_pmode_, true); setCheckState(col_pmode_, device->pmode ? Qt::Checked : Qt::Unchecked); @@ -151,9 +149,7 @@ public: #ifdef SHOW_BUFFER_COLUMN setText(col_buffer_, QString::number(device->buffer)); #endif -#ifdef HAVE_EXTCAP } -#endif setText(col_filter_, device->cfilter); #ifdef SHOW_MONITOR_COLUMN diff --git a/ui/qt/extcap_options_dialog.cpp b/ui/qt/extcap_options_dialog.cpp index 61d717a138..3e16efcaae 100644 --- a/ui/qt/extcap_options_dialog.cpp +++ b/ui/qt/extcap_options_dialog.cpp @@ -28,7 +28,6 @@ #include <wireshark_application.h> -#ifdef HAVE_EXTCAP #include <QMessageBox> #include <QMap> #include <QHBoxLayout> @@ -506,9 +505,6 @@ void ExtcapOptionsDialog::storeValues() } } - -#endif /* HAVE_LIBPCAP */ - /* * Editor modelines * diff --git a/ui/qt/extcap_options_dialog.h b/ui/qt/extcap_options_dialog.h index 1b66ad5182..8c3fbc879b 100644 --- a/ui/qt/extcap_options_dialog.h +++ b/ui/qt/extcap_options_dialog.h @@ -25,8 +25,6 @@ #include <config.h> -#ifdef HAVE_EXTCAP - #include <QWidget> #include <QDialog> #include <QPushButton> @@ -75,8 +73,6 @@ private: void resetValues(); }; -#endif /* HAVE_EXTCAP */ - #endif // EXTCAP_OPTIONS_DIALOG_H /* diff --git a/ui/qt/interface_frame.cpp b/ui/qt/interface_frame.cpp index 8eccf78b9a..fa8492ea0d 100644 --- a/ui/qt/interface_frame.cpp +++ b/ui/qt/interface_frame.cpp @@ -30,9 +30,7 @@ #include <ui/qt/models/sparkline_delegate.h> #include "wireshark_application.h" -#ifdef HAVE_EXTCAP #include "extcap.h" -#endif #include <QFrame> #include <QPushButton> @@ -77,18 +75,14 @@ InterfaceFrame::InterfaceFrame(QWidget * parent) ifTypeDescription.insert(IF_WIRELESS, tr("Wireless")); ifTypeDescription.insert(IF_DIALUP, tr("Dial-Up")); ifTypeDescription.insert(IF_USB, tr("USB")); -#ifdef HAVE_EXTCAP ifTypeDescription.insert(IF_EXTCAP, tr("External Capture")); -#endif ifTypeDescription.insert(IF_VIRTUAL, tr ("Virtual")); proxyModel = new InterfaceSortFilterModel(this); sourceModel = new InterfaceTreeModel(this); QList<InterfaceTreeColumns> columns; -#ifdef HAVE_EXTCAP columns.append(IFTREE_COL_EXTCAP); -#endif columns.append(IFTREE_COL_NAME); columns.append(IFTREE_COL_STATS); proxyModel->setColumns(columns); @@ -266,9 +260,7 @@ void InterfaceFrame::resetInterfaceTreeDisplay() { ui->interfaceTree->setHidden(false); ui->lblNoInterfaces->setHidden(true); -#ifdef HAVE_EXTCAP ui->interfaceTree->resizeColumnToContents(proxyModel->mapSourceToColumn(IFTREE_COL_EXTCAP)); -#endif ui->interfaceTree->resizeColumnToContents(proxyModel->mapSourceToColumn(IFTREE_COL_NAME)); ui->interfaceTree->resizeColumnToContents(proxyModel->mapSourceToColumn(IFTREE_COL_STATS)); } @@ -311,7 +303,7 @@ void InterfaceFrame::on_interfaceTree_doubleClicked(const QModelIndex &index) if ( ! realIndex.isValid() ) return; -#if defined(HAVE_EXTCAP) && defined(HAVE_LIBPCAP) +#ifdef HAVE_LIBPCAP QString device_name = sourceModel->getColumnContent(realIndex.row(), IFTREE_COL_INTERFACE_NAME).toString(); QString extcap_string = sourceModel->getColumnContent(realIndex.row(), IFTREE_COL_EXTCAP_PATH).toString(); @@ -331,7 +323,7 @@ void InterfaceFrame::on_interfaceTree_doubleClicked(const QModelIndex &index) emit startCapture(); } -#if defined(HAVE_EXTCAP) && defined(HAVE_LIBPCAP) +#ifdef HAVE_LIBPCAP void InterfaceFrame::on_interfaceTree_clicked(const QModelIndex &index) { if ( index.column() == 0 ) diff --git a/ui/qt/interface_frame.h b/ui/qt/interface_frame.h index a52a6af304..cae659b1ab 100644 --- a/ui/qt/interface_frame.h +++ b/ui/qt/interface_frame.h @@ -93,7 +93,7 @@ private slots: void interfaceTreeSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected); void on_interfaceTree_doubleClicked(const QModelIndex &index); -#if defined(HAVE_EXTCAP) && defined(HAVE_LIBPCAP) +#ifdef HAVE_LIBPCAP void on_interfaceTree_clicked(const QModelIndex &index); #endif diff --git a/ui/qt/interface_toolbar.cpp b/ui/qt/interface_toolbar.cpp index 7012f72771..1678daf7c1 100644 --- a/ui/qt/interface_toolbar.cpp +++ b/ui/qt/interface_toolbar.cpp @@ -740,7 +740,6 @@ void InterfaceToolbar::startCapture(GArray *ifaces) if (!ifaces || ifaces->len == 0) return; -#ifdef HAVE_EXTCAP const QString &selected_ifname = ui->interfacesComboBox->currentText(); QString first_capturing_ifname; bool selected_found = false; @@ -792,7 +791,6 @@ void InterfaceToolbar::startCapture(GArray *ifaces) { updateWidgets(); } -#endif // HAVE_EXTCAP } void InterfaceToolbar::stopCapture() diff --git a/ui/qt/main_welcome.cpp b/ui/qt/main_welcome.cpp index 523a99edce..adad58a770 100644 --- a/ui/qt/main_welcome.cpp +++ b/ui/qt/main_welcome.cpp @@ -51,9 +51,7 @@ #define VERSION_FLAVOR "" #endif -#ifdef HAVE_EXTCAP #include <extcap.h> -#endif MainWelcome::MainWelcome(QWidget *parent) : QFrame(parent), @@ -331,12 +329,10 @@ void MainWelcome::interfaceSelected() emit interfacesChanged(); } -#ifdef HAVE_EXTCAP void MainWelcome::on_interfaceFrame_showExtcapOptions(QString device_name) { emit showExtcapOptions(device_name); } -#endif void MainWelcome::on_interfaceFrame_startCapture() { diff --git a/ui/qt/main_welcome.h b/ui/qt/main_welcome.h index b462f5fd3e..dff4420b37 100644 --- a/ui/qt/main_welcome.h +++ b/ui/qt/main_welcome.h @@ -76,9 +76,7 @@ signals: void pushFilterSyntaxStatus(const QString&); void popFilterSyntaxStatus(); void captureFilterSyntaxChanged(bool valid); -#ifdef HAVE_EXTCAP void showExtcapOptions(QString &device_name); -#endif void interfacesChanged(); public slots: @@ -95,9 +93,7 @@ private slots: void copyRecentPath(); void removeRecentPath(); -#ifdef HAVE_EXTCAP void on_interfaceFrame_showExtcapOptions(QString device_name); -#endif void on_interfaceFrame_startCapture(); }; diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp index 6d43fba45c..5d06d149dd 100644 --- a/ui/qt/main_window.cpp +++ b/ui/qt/main_window.cpp @@ -672,10 +672,8 @@ MainWindow::MainWindow(QWidget *parent) : connect(main_ui_->welcomePage, SIGNAL(captureFilterSyntaxChanged(bool)), this, SLOT(captureFilterSyntaxChanged(bool))); -#ifdef HAVE_EXTCAP connect(this->main_welcome_, SIGNAL(showExtcapOptions(QString&)), this, SLOT(showExtcapOptionsDialog(QString&))); -#endif #endif // HAVE_LIBPCAP @@ -2426,7 +2424,6 @@ void MainWindow::setForCaptureInProgress(bool capture_in_progress, GArray *iface // set_capture_if_dialog_for_capture_in_progress(capture_in_progress); #endif -#ifdef HAVE_EXTCAP QList<InterfaceToolbar *> toolbars = findChildren<InterfaceToolbar *>(); foreach (InterfaceToolbar *toolbar, toolbars) { if (capture_in_progress && ifaces) { @@ -2435,9 +2432,6 @@ void MainWindow::setForCaptureInProgress(bool capture_in_progress, GArray *iface toolbar->stopCapture(); } } -#else - Q_UNUSED(ifaces) -#endif } static QList<register_stat_group_t> menu_groups = QList<register_stat_group_t>() diff --git a/ui/qt/main_window.h b/ui/qt/main_window.h index 7bb2255545..a8ee4d4883 100644 --- a/ui/qt/main_window.h +++ b/ui/qt/main_window.h @@ -653,10 +653,8 @@ private slots: void on_actionContextWikiProtocolPage_triggered(); void on_actionContextFilterFieldReference_triggered(); -#ifdef HAVE_EXTCAP void extcap_options_finished(int result); void showExtcapOptionsDialog(QString & device_name); -#endif }; #endif // MAINWINDOW_H diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index c3e4775474..fe001cf35b 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -106,9 +106,7 @@ DIAG_ON(frame-larger-than=) #include "export_object_action.h" #include "export_object_dialog.h" #include "export_pdu_dialog.h" -#ifdef HAVE_EXTCAP #include "extcap_options_dialog.h" -#endif #include "file_set_dialog.h" #include "filter_action.h" #include "filter_dialog.h" @@ -3910,7 +3908,6 @@ void MainWindow::gotoFrame(int packet_num) } } -#ifdef HAVE_EXTCAP void MainWindow::extcap_options_finished(int result) { if (result == QDialog::Accepted) { @@ -3929,7 +3926,6 @@ void MainWindow::showExtcapOptionsDialog(QString &device_name) extcap_options_dialog->show(); } } -#endif void MainWindow::on_actionContextWikiProtocolPage_triggered() { diff --git a/ui/qt/models/interface_tree_cache_model.cpp b/ui/qt/models/interface_tree_cache_model.cpp index b093478916..e193f58a9e 100644 --- a/ui/qt/models/interface_tree_cache_model.cpp +++ b/ui/qt/models/interface_tree_cache_model.cpp @@ -186,14 +186,12 @@ void InterfaceTreeCacheModel::save() { device->hidden = saveValue.toBool(); } -#ifdef HAVE_EXTCAP else if ( device->if_info.type == IF_EXTCAP ) { /* extcap interfaces do not have the following columns. * ATTENTION: all generic columns must be added, BEFORE this * if-clause, or they will be ignored for extcap interfaces */ } -#endif else if ( col == IFTREE_COL_PROMISCUOUSMODE ) { device->pmode = saveValue.toBool(); @@ -237,10 +235,10 @@ void InterfaceTreeCacheModel::save() prefStorage[&prefs.capture_devices_descr] << QString("%1(%2)").arg(device->name).arg(content.toString()); bool allowExtendedColumns = true; -#ifdef HAVE_EXTCAP + if ( device->if_info.type == IF_EXTCAP ) allowExtendedColumns = false; -#endif + if ( allowExtendedColumns ) { content = getColumnContent(idx, IFTREE_COL_PROMISCUOUSMODE, Qt::CheckStateRole); @@ -352,7 +350,6 @@ bool InterfaceTreeCacheModel::isAllowedToBeEdited(const QModelIndex &index) cons if ( device == 0 ) return false; -#ifdef HAVE_EXTCAP InterfaceTreeColumns col = (InterfaceTreeColumns) index.column(); if ( device->if_info.type == IF_EXTCAP ) { @@ -365,8 +362,6 @@ bool InterfaceTreeCacheModel::isAllowedToBeEdited(const QModelIndex &index) cons #endif } #endif - -#endif return true; } diff --git a/ui/qt/models/interface_tree_model.cpp b/ui/qt/models/interface_tree_model.cpp index c57859ad72..bd96411e6d 100644 --- a/ui/qt/models/interface_tree_model.cpp +++ b/ui/qt/models/interface_tree_model.cpp @@ -41,9 +41,7 @@ /* Needed for the meta type declaration of QList<int>* */ #include <ui/qt/models/sparkline_delegate.h> -#ifdef HAVE_EXTCAP #include "extcap.h" -#endif const QString InterfaceTreeModel::DefaultNumericValue = QObject::tr("default"); @@ -144,12 +142,10 @@ QVariant InterfaceTreeModel::data(const QModelIndex &index, int role) const if ( device->cfilter && strlen(device->cfilter) > 0 ) return html_escape(QString(device->cfilter)); } -#ifdef HAVE_EXTCAP else if ( col == IFTREE_COL_EXTCAP_PATH ) { return QString(device->if_info.extcap); } -#endif else if ( col == IFTREE_COL_SNAPLEN ) { return device->has_snaplen ? QString::number(device->snaplen) : DefaultNumericValue; @@ -222,7 +218,6 @@ QVariant InterfaceTreeModel::data(const QModelIndex &index, int role) const return QVariant::fromValue((bool)device->hidden); } } -#ifdef HAVE_EXTCAP /* Displays the configuration icon for extcap interfaces */ else if ( role == Qt::DecorationRole ) { @@ -239,7 +234,6 @@ QVariant InterfaceTreeModel::data(const QModelIndex &index, int role) const return Qt::AlignRight; } } -#endif /* Displays the tooltip for each row */ else if ( role == Qt::ToolTipRole ) { @@ -362,12 +356,10 @@ QVariant InterfaceTreeModel::toolTipForInterface(int idx) const .arg(html_escape(device->addresses)) .replace('\n', ", "); } -#ifdef HAVE_EXTCAP else if ( device->if_info.type == IF_EXTCAP ) { tt_str = QString(tr("Extcap interface: %1")).arg(get_basename(device->if_info.extcap)); } -#endif else { tt_str = tr("No addresses"); diff --git a/ui/qt/models/interface_tree_model.h b/ui/qt/models/interface_tree_model.h index a441b39e33..b850078da6 100644 --- a/ui/qt/models/interface_tree_model.h +++ b/ui/qt/models/interface_tree_model.h @@ -41,10 +41,8 @@ typedef QList<int> PointList; enum InterfaceTreeColumns { -#ifdef HAVE_EXTCAP IFTREE_COL_EXTCAP, IFTREE_COL_EXTCAP_PATH, -#endif IFTREE_COL_NAME, IFTREE_COL_INTERFACE_NAME, IFTREE_COL_INTERFACE_COMMENT, diff --git a/ui/qt/splash_overlay.cpp b/ui/qt/splash_overlay.cpp index b39a1e4a28..826e62e6a9 100644 --- a/ui/qt/splash_overlay.cpp +++ b/ui/qt/splash_overlay.cpp @@ -33,9 +33,7 @@ #include "epan/wslua/init_wslua.h" #endif -#ifdef HAVE_EXTCAP -#include "../../extcap.h" -#endif +#include "extcap.h" // Uncomment to slow the update progress //#define THROTTLE_STARTUP 1 @@ -61,9 +59,8 @@ SplashOverlay::SplashOverlay(QWidget *parent) : #ifdef HAVE_LUA register_max++; #endif -#ifdef HAVE_EXTCAP register_max++; -#endif + so_ui_->progressBar->setMaximum(register_max); elapsed_timer_.start(); diff --git a/ui/qt/wireshark_application.cpp b/ui/qt/wireshark_application.cpp index d0fe96e436..3dab45e1ba 100644 --- a/ui/qt/wireshark_application.cpp +++ b/ui/qt/wireshark_application.cpp @@ -45,9 +45,7 @@ #include "log.h" #include "recent_file_status.h" -#ifdef HAVE_EXTCAP #include "extcap.h" -#endif #ifdef HAVE_LIBPCAP #include <caputils/iface_monitor.h> #endif @@ -1110,9 +1108,7 @@ void WiresharkApplication::ifChangeEventsAvailable() void WiresharkApplication::refreshLocalInterfaces() { -#ifdef HAVE_EXTCAP extcap_clear_interfaces(); -#endif #ifdef HAVE_LIBPCAP /* |