From e80b40adbe823be084fb49cd84336939916120bb Mon Sep 17 00:00:00 2001 From: Dario Lombardo Date: Sat, 6 Jan 2018 21:39:26 +0100 Subject: extcap: remove conditional compilation. Change-Id: Ia54bba388755cf27a343fe6d69d244bf1ab897f9 Reviewed-on: https://code.wireshark.org/review/25186 Petri-Dish: Dario Lombardo Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall Reviewed-by: Anders Broman --- .gitlab-ci.yml | 12 ------ .travis.yml | 1 - CMakeLists.txt | 58 ++++++++++++----------------- CMakeOptions.txt | 1 - Makefile.am | 16 ++------ capchild/capture_ifinfo.c | 22 ----------- capchild/capture_sync.c | 11 ------ capture_opts.c | 28 -------------- capture_opts.h | 4 -- caputils/capture-pcap-util.c | 5 --- caputils/capture_ifinfo.h | 4 -- cmakeconfig.h.in | 3 -- configure.ac | 49 ++++-------------------- doc/README.extcap | 10 ++--- dumpcap.c | 18 +-------- epan/prefs.c | 4 -- epan/prefs.h | 2 - rawshark.c | 4 -- tfshark.c | 5 --- tshark.c | 18 --------- ui/commandline.c | 2 - ui/gtk/CMakeLists.txt | 8 +--- ui/gtk/Makefile.am | 7 +--- ui/gtk/about_dlg.c | 10 +---- ui/gtk/capture_dlg.c | 26 ------------- ui/gtk/capture_if_dlg.c | 2 - ui/gtk/main.c | 7 ---- ui/help_url.c | 2 - ui/help_url.h | 2 - ui/iface_lists.c | 8 +--- ui/qt/CMakeLists.txt | 36 +++++------------- ui/qt/Makefile.am | 30 ++++++--------- ui/qt/about_dialog.cpp | 9 +---- ui/qt/capture_filter_syntax_worker.cpp | 10 ----- ui/qt/capture_interfaces_dialog.cpp | 4 -- ui/qt/extcap_options_dialog.cpp | 4 -- ui/qt/extcap_options_dialog.h | 4 -- ui/qt/interface_frame.cpp | 12 +----- ui/qt/interface_frame.h | 2 +- ui/qt/interface_toolbar.cpp | 2 - ui/qt/main_welcome.cpp | 4 -- ui/qt/main_welcome.h | 4 -- ui/qt/main_window.cpp | 6 --- ui/qt/main_window.h | 2 - ui/qt/main_window_slots.cpp | 4 -- ui/qt/models/interface_tree_cache_model.cpp | 9 +---- ui/qt/models/interface_tree_model.cpp | 8 ---- ui/qt/models/interface_tree_model.h | 2 - ui/qt/splash_overlay.cpp | 7 +--- ui/qt/wireshark_application.cpp | 4 -- wireshark-qt.cpp | 6 --- wsutil/filesystem.c | 12 +----- 52 files changed, 75 insertions(+), 455 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 82223c8155..a0ab674b00 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,12 +34,6 @@ gcc-7: - apt-get install gcc-7 g++-7 -y - cmake -GNinja -DCMAKE_C_COMPILER=gcc-7 -DCMAKE_CXX_COMPILER=g++-7 .. - ninja -gcc-7-noextcap: - retry: 1 - script: - - apt-get install gcc-7 g++-7 -y - - cmake -GNinja -DENABLE_EXTCAP=OFF -DCMAKE_C_COMPILER=gcc-7 -DCMAKE_CXX_COMPILER=g++-7 .. - - ninja gcc-7-nopcap: retry: 1 script: @@ -94,12 +88,6 @@ clang-6.0: - apt-get install clang-6.0 -y - cmake -GNinja -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DCMAKE_C_FLAGS=-Wframe-larger-than=20000 .. - ninja -clang-6.0-noextcap: - retry: 1 - script: - - apt install clang-6.0 -y - - cmake -GNinja -DENABLE_EXTCAP=OFF -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DCMAKE_C_FLAGS=-Wframe-larger-than=20000 .. - - ninja clang-6.0-nopcap: retry: 1 script: diff --git a/.travis.yml b/.travis.yml index 1300c3751f..24755599cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,6 @@ env: - BUILD_CMAKE=yes - BUILD_CMAKE=yes CMAKE_OPTS="-DBUILD_wireshark_gtk=ON" - BUILD_CMAKE=yes CMAKE_OPTS="-DENABLE_PCAP=OFF" - - BUILD_CMAKE=yes CMAKE_OPTS="-DENABLE_EXTCAP=OFF" - BUILD_CMAKE=no AUTOTOOLS_OPTS="--with-gtk=3" matrix: exclude: diff --git a/CMakeLists.txt b/CMakeLists.txt index 14b53d61f4..b6100a9f6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1329,18 +1329,15 @@ if(BUILD_wireshark AND QT_FOUND) add_subdirectory( ui/qt ) endif() -if(ENABLE_EXTCAP) - # Target platform locations - # UN*X in general, including macOS if not building an app bundle: - # $DESTDIR/lib/wireshark/extcap - # Windows: $DESTDIR/extcap - # macOS app bundle: Wireshark.app/Contents/Resources/share/wireshark/extcap - set(HAVE_EXTCAP 1) - if (WIN32) - set(EXTCAP_DIR "extcap") - else () - set(EXTCAP_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/${CPACK_PACKAGE_NAME}/extcap") - endif() +# Target platform locations +# UN*X in general, including macOS if not building an app bundle: +# $DESTDIR/lib/wireshark/extcap +# Windows: $DESTDIR/extcap +# macOS app bundle: Wireshark.app/Contents/Resources/share/wireshark/extcap +if (WIN32) + set(EXTCAP_DIR "extcap") +else () + set(EXTCAP_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/${CPACK_PACKAGE_NAME}/extcap") endif() if(LIBSSH_FOUND) @@ -1577,18 +1574,11 @@ set(SHARK_COMMON_SRC frame_tvbuff.c sync_pipe_write.c version_info.c + extcap.c + extcap_parser.c + extcap_spawn.c ) -# sources for external capture interfaces -if(ENABLE_EXTCAP) - set(SHARK_COMMON_SRC - ${SHARK_COMMON_SRC} - extcap.c - extcap_parser.c - extcap_spawn.c - ) -endif() - set(TSHARK_TAP_SRC ${CMAKE_SOURCE_DIR}/ui/cli/tap-camelsrt.c ${CMAKE_SOURCE_DIR}/ui/cli/tap-comparestat.c @@ -1976,14 +1966,12 @@ foreach(_install_file ${INSTALL_FILES}) list(APPEND copy_data_files_depends "${_output_file}") endforeach() -if(ENABLE_EXTCAP) - # Ensure "run/extcap" exists - add_custom_command(OUTPUT "${DATAFILE_DIR}/extcap" - COMMAND ${CMAKE_COMMAND} -E make_directory - "${DATAFILE_DIR}/extcap" - ) - list(APPEND copy_data_files_depends "${DATAFILE_DIR}/extcap") -endif() +# Ensure "run/extcap" exists +add_custom_command(OUTPUT "${DATAFILE_DIR}/extcap" + COMMAND ${CMAKE_COMMAND} -E make_directory + "${DATAFILE_DIR}/extcap" +) +list(APPEND copy_data_files_depends "${DATAFILE_DIR}/extcap") # faq.txt is handled separately below. set(_help_source_files @@ -2815,7 +2803,7 @@ endif() add_custom_target(extcaps) -if(ENABLE_EXTCAP AND BUILD_androiddump) +if(BUILD_androiddump) if(EXTCAP_ANDROIDDUMP_LIBPCAP) if(HAVE_LIBPCAP) set(androiddump_LIBS @@ -2848,7 +2836,7 @@ if(ENABLE_EXTCAP AND BUILD_androiddump) add_dependencies(extcaps androiddump) endif() -if(ENABLE_EXTCAP AND BUILD_sshdump AND LIBSSH_FOUND) +if(BUILD_sshdump AND LIBSSH_FOUND) set(sshdump_LIBS wsutil ${GLIB2_LIBRARIES} @@ -2871,7 +2859,7 @@ elseif (BUILD_sshdump) #message( WARNING "Cannot find libssh, cannot build sshdump" ) endif() -if(ENABLE_EXTCAP AND BUILD_ciscodump AND LIBSSH_FOUND) +if(BUILD_ciscodump AND LIBSSH_FOUND) set(ciscodump_LIBS writecap wsutil @@ -2895,7 +2883,7 @@ elseif (BUILD_ciscodump) #message( WARNING "Cannot find libssh, cannot build ciscodump" ) endif() -if(ENABLE_EXTCAP AND BUILD_udpdump) +if(BUILD_udpdump) set(udpdump_LIBS ${GLIB2_LIBRARIES} ${CMAKE_DL_LIBS} @@ -2914,7 +2902,7 @@ if(ENABLE_EXTCAP AND BUILD_udpdump) add_dependencies(extcaps udpdump) endif() -if(ENABLE_EXTCAP AND BUILD_randpktdump) +if(BUILD_randpktdump) set(randpktdump_LIBS randpkt_core ui diff --git a/CMakeOptions.txt b/CMakeOptions.txt index dc262ff776..fdcb906c62 100644 --- a/CMakeOptions.txt +++ b/CMakeOptions.txt @@ -57,7 +57,6 @@ endif() option(ENABLE_STATIC "Build Wireshark libraries statically" OFF) option(ENABLE_PLUGINS "Build with plugins" ON) option(ENABLE_PLUGIN_IFDEMO "Build with plugin interface demo" OFF) -option(ENABLE_EXTCAP "Build with extcap hooks" ON) option(ENABLE_HTML_GUIDES "Build HTML User & Developer Guides" OFF) option(ENABLE_PDF_GUIDES "Build PDF User & Developer Guides" OFF) if(WIN32) diff --git a/Makefile.am b/Makefile.am index 1c7b6a2f4a..c33837d25a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -371,17 +371,15 @@ GENERATED_C_FILES = # All the generated files. GENERATED_FILES = $(GENERATED_C_FILES) $(GENERATED_HEADER_FILES) -EXTCAP_COMMON_SRC = \ - extcap.c \ - extcap_parser.c \ - extcap_spawn.c - # sources common for wireshark, tshark, and rawshark SHARK_COMMON_SRC = \ cfile.c \ file_packet_provider.c \ frame_tvbuff.c \ - sync_pipe_write.c + sync_pipe_write.c \ + extcap.c \ + extcap_parser.c \ + extcap_spawn.c # wireshark specifics WIRESHARK_COMMON_SRC = \ @@ -393,10 +391,6 @@ WIRESHARK_COMMON_SRC = \ summary.c \ version_info.c -if HAVE_EXTCAP -SHARK_COMMON_SRC += $(EXTCAP_COMMON_SRC) -endif - EPAN_EXTRA_LIBS = \ @C_ARES_LIBS@ \ @KRB5_LIBS@ \ @@ -838,9 +832,7 @@ plugins_subdir = plugins endif endif -if HAVE_EXTCAP extcap_subdir = extcap -endif DIST_SUBDIRS = \ capchild \ diff --git a/capchild/capture_ifinfo.c b/capchild/capture_ifinfo.c index 0fd61a0dba..44340b588d 100644 --- a/capchild/capture_ifinfo.c +++ b/capchild/capture_ifinfo.c @@ -34,9 +34,7 @@ #include "capchild/capture_session.h" #include "capchild/capture_sync.h" -#ifdef HAVE_EXTCAP #include "extcap.h" -#endif #include "log.h" #include @@ -111,13 +109,11 @@ capture_interface_list(int *err, char **err_str, void (*update_cb)(void)) /* Try to get our interface list */ ret = sync_interface_list_open(&data, &primary_msg, &secondary_msg, update_cb); if (ret != 0) { -#ifdef HAVE_EXTCAP /* Add the extcap interfaces that can exist, even if no native interfaces have been found */ g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Loading External Capture Interface List ..."); if_list = append_extcap_interface_list(if_list, err_str); /* err_str is ignored, as the error for the interface loading list will take precedence */ if ( g_list_length(if_list) == 0 ) { -#endif g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture Interface List failed. Error %d, %s (%s)", *err, primary_msg ? primary_msg : "no message", @@ -130,10 +126,7 @@ capture_interface_list(int *err, char **err_str, void (*update_cb)(void)) g_free(secondary_msg); *err = CANT_GET_INTERFACE_LIST; -#ifdef HAVE_EXTCAP } -#endif - return if_list; } @@ -146,7 +139,6 @@ capture_interface_list(int *err, char **err_str, void (*update_cb)(void)) g_free(data); for (i = 0; raw_list[i] != NULL; i++) { -#ifdef HAVE_EXTCAP if_parts = g_strsplit(raw_list[i], "\t", 7); if (if_parts[0] == NULL || if_parts[1] == NULL || if_parts[2] == NULL || if_parts[3] == NULL || if_parts[4] == NULL || if_parts[5] == NULL || @@ -154,14 +146,6 @@ capture_interface_list(int *err, char **err_str, void (*update_cb)(void)) g_strfreev(if_parts); continue; } -#else - if_parts = g_strsplit(raw_list[i], "\t", 6); - if (if_parts[0] == NULL || if_parts[1] == NULL || if_parts[2] == NULL || - if_parts[3] == NULL || if_parts[4] == NULL || if_parts[5] == NULL) { - g_strfreev(if_parts); - continue; - } -#endif /* Number followed by the name, e.g "1. eth0" */ name = strchr(if_parts[0], ' '); @@ -196,9 +180,7 @@ capture_interface_list(int *err, char **err_str, void (*update_cb)(void)) } if (strcmp(if_parts[5], "loopback") == 0) if_info->loopback = TRUE; -#ifdef HAVE_EXTCAP if_info->extcap = g_strdup(if_parts[6]); -#endif g_strfreev(if_parts); g_strfreev(addr_parts); if_list = g_list_append(if_list, if_info); @@ -211,11 +193,9 @@ capture_interface_list(int *err, char **err_str, void (*update_cb)(void)) } #endif -#ifdef HAVE_EXTCAP /* Add the extcap interfaces after the native and remote interfaces */ g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Loading External Capture Interface List ..."); if_list = append_extcap_interface_list(if_list, err_str); -#endif return if_list; } @@ -235,7 +215,6 @@ capture_get_if_capabilities(const gchar *ifname, gboolean monitor_mode, g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture Interface Capabilities ..."); -#ifdef HAVE_EXTCAP /* see if the interface is from extcap */ caps = extcap_get_if_dlts(ifname, err_str); if (caps != NULL) @@ -244,7 +223,6 @@ capture_get_if_capabilities(const gchar *ifname, gboolean monitor_mode, /* return if the extcap interface generated an error */ if (err_str != NULL && *err_str != NULL) return NULL; -#endif /* HAVE_EXTCAP */ /* Try to get our interface list */ err = sync_if_capabilities_open(ifname, monitor_mode, auth_string, &data, diff --git a/capchild/capture_sync.c b/capchild/capture_sync.c index 43fc2ac173..1588a5648e 100644 --- a/capchild/capture_sync.c +++ b/capchild/capture_sync.c @@ -91,9 +91,7 @@ #include #include #include -#ifdef HAVE_EXTCAP #include "extcap.h" -#endif #include "log.h" #ifdef _WIN32 @@ -252,14 +250,11 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, inf cap_session->fork_child = WS_INVALID_PID; -#ifdef HAVE_EXTCAP if (!extcap_init_interfaces(capture_opts)) { report_failure("Unable to init extcaps. (tmp fifo already exists?)"); return FALSE; } -#endif - argv = init_pipe_args(&argc); if (!argv) { /* We don't know where to find dumpcap. */ @@ -338,11 +333,9 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, inf interface_opts = &g_array_index(capture_opts->ifaces, interface_options, j); argv = sync_pipe_add_arg(argv, &argc, "-i"); -#ifdef HAVE_EXTCAP if (interface_opts->extcap_fifo != NULL) argv = sync_pipe_add_arg(argv, &argc, interface_opts->extcap_fifo); else -#endif argv = sync_pipe_add_arg(argv, &argc, interface_opts->name); if (interface_opts->cfilter != NULL && strlen(interface_opts->cfilter) != 0) { @@ -525,11 +518,9 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, inf #else si.dwFlags = STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW; si.wShowWindow = SW_HIDE; /* this hides the console window */ -#ifdef HAVE_EXTCAP if(interface_opts->extcap_pipe_h != INVALID_HANDLE_VALUE) si.hStdInput = interface_opts->extcap_pipe_h; else -#endif si.hStdInput = GetStdHandle(STD_INPUT_HANDLE); si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); @@ -1716,10 +1707,8 @@ sync_pipe_input_cb(gint source, gpointer user_data) #ifdef _WIN32 ws_close(cap_session->signal_pipe_write_fd); #endif -#ifdef HAVE_EXTCAP g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, "sync_pipe_input_cb: cleaning extcap pipe"); extcap_if_cleanup(cap_session->capture_opts, &primary_msg); -#endif capture_input_closed(cap_session, primary_msg); g_free(primary_msg); return FALSE; diff --git a/capture_opts.c b/capture_opts.c index f7eb768082..2cd8ed71f6 100644 --- a/capture_opts.c +++ b/capture_opts.c @@ -50,7 +50,6 @@ capture_opts_init(capture_options *capture_opts) capture_opts->default_options.linktype = -1; /* use interface default */ capture_opts->default_options.promisc_mode = TRUE; capture_opts->default_options.if_type = IF_WIRED; -#ifdef HAVE_EXTCAP capture_opts->default_options.extcap = NULL; capture_opts->default_options.extcap_fifo = NULL; capture_opts->default_options.extcap_args = NULL; @@ -63,7 +62,6 @@ capture_opts_init(capture_options *capture_opts) #endif capture_opts->default_options.extcap_control_in = NULL; capture_opts->default_options.extcap_control_out = NULL; -#endif #ifdef CAN_SET_CAPTURE_BUFFER_SIZE capture_opts->default_options.buffer_size = DEFAULT_CAPTURE_BUFFER_SIZE; #endif @@ -161,11 +159,9 @@ capture_opts_log(const char *log_domain, GLogLevelFlags log_level, capture_optio g_log(log_domain, log_level, "Snap length[%02d] (%u) : %d", i, interface_opts->has_snaplen, interface_opts->snaplen); g_log(log_domain, log_level, "Link Type[%02d] : %d", i, interface_opts->linktype); g_log(log_domain, log_level, "Promiscuous Mode[%02d]: %s", i, interface_opts->promisc_mode?"TRUE":"FALSE"); -#ifdef HAVE_EXTCAP g_log(log_domain, log_level, "Extcap[%02d] : %s", i, interface_opts->extcap ? interface_opts->extcap : "(unspecified)"); g_log(log_domain, log_level, "Extcap FIFO[%02d] : %s", i, interface_opts->extcap_fifo ? interface_opts->extcap_fifo : "(unspecified)"); g_log(log_domain, log_level, "Extcap PID[%02d] : %d", i, interface_opts->extcap_pid); -#endif #ifdef CAN_SET_CAPTURE_BUFFER_SIZE g_log(log_domain, log_level, "Buffer size[%02d] : %d (MB)", i, interface_opts->buffer_size); #endif @@ -203,10 +199,8 @@ capture_opts_log(const char *log_domain, GLogLevelFlags log_level, capture_optio g_log(log_domain, log_level, "Snap length[df] (%u) : %d", capture_opts->default_options.has_snaplen, capture_opts->default_options.snaplen); g_log(log_domain, log_level, "Link Type[df] : %d", capture_opts->default_options.linktype); g_log(log_domain, log_level, "Promiscuous Mode[df]: %s", capture_opts->default_options.promisc_mode?"TRUE":"FALSE"); -#ifdef HAVE_EXTCAP g_log(log_domain, log_level, "Extcap[df] : %s", capture_opts->default_options.extcap ? capture_opts->default_options.extcap : "(unspecified)"); g_log(log_domain, log_level, "Extcap FIFO[df] : %s", capture_opts->default_options.extcap_fifo ? capture_opts->default_options.extcap_fifo : "(unspecified)"); -#endif #ifdef CAN_SET_CAPTURE_BUFFER_SIZE g_log(log_domain, log_level, "Buffer size[df] : %d (MB)", capture_opts->default_options.buffer_size); #endif @@ -568,9 +562,7 @@ capture_opts_add_iface_opt(capture_options *capture_opts, const char *optarg_str interface_opts.console_display_name = g_strdup(if_info->name); } interface_opts.if_type = if_info->type; -#ifdef HAVE_EXTCAP interface_opts.extcap = g_strdup(if_info->extcap); -#endif free_interface_list(if_list); } else if (capture_opts->capture_child) { /* In Wireshark capture child mode, thus proper device name is supplied. */ @@ -578,9 +570,7 @@ capture_opts_add_iface_opt(capture_options *capture_opts, const char *optarg_str interface_opts.name = g_strdup(optarg_str_p); interface_opts.console_display_name = g_strdup(optarg_str_p); interface_opts.if_type = capture_opts->default_options.if_type; -#ifdef HAVE_EXTCAP interface_opts.extcap = g_strdup(capture_opts->default_options.extcap); -#endif } else { /* * Retrieve the interface list so that we can search for the @@ -619,9 +609,7 @@ capture_opts_add_iface_opt(capture_options *capture_opts, const char *optarg_str interface_opts.console_display_name = g_strdup(if_info->name); } interface_opts.if_type = if_info->type; -#ifdef HAVE_EXTCAP interface_opts.extcap = g_strdup(if_info->extcap); -#endif matched = TRUE; break; } @@ -633,9 +621,7 @@ capture_opts_add_iface_opt(capture_options *capture_opts, const char *optarg_str interface_opts.name = g_strdup(if_info->name); interface_opts.console_display_name = g_strdup(if_info->friendly_name); interface_opts.if_type = if_info->type; -#ifdef HAVE_EXTCAP interface_opts.extcap = g_strdup(if_info->extcap); -#endif matched = TRUE; break; } @@ -657,9 +643,7 @@ capture_opts_add_iface_opt(capture_options *capture_opts, const char *optarg_str interface_opts.name = g_strdup(if_info->name); interface_opts.console_display_name = g_strdup(if_info->friendly_name); interface_opts.if_type = if_info->type; -#ifdef HAVE_EXTCAP interface_opts.extcap = g_strdup(if_info->extcap); -#endif matched = TRUE; break; } @@ -676,18 +660,14 @@ capture_opts_add_iface_opt(capture_options *capture_opts, const char *optarg_str interface_opts.name = g_strdup(optarg_str_p); interface_opts.console_display_name = g_strdup(optarg_str_p); interface_opts.if_type = capture_opts->default_options.if_type; -#ifdef HAVE_EXTCAP interface_opts.extcap = g_strdup(capture_opts->default_options.extcap); -#endif } free_interface_list(if_list); } else { interface_opts.name = g_strdup(optarg_str_p); interface_opts.console_display_name = g_strdup(optarg_str_p); interface_opts.if_type = capture_opts->default_options.if_type; -#ifdef HAVE_EXTCAP interface_opts.extcap = g_strdup(capture_opts->default_options.extcap); -#endif } } @@ -701,7 +681,6 @@ capture_opts_add_iface_opt(capture_options *capture_opts, const char *optarg_str interface_opts.has_snaplen = capture_opts->default_options.has_snaplen; interface_opts.linktype = capture_opts->default_options.linktype; interface_opts.promisc_mode = capture_opts->default_options.promisc_mode; -#ifdef HAVE_EXTCAP interface_opts.extcap_fifo = g_strdup(capture_opts->default_options.extcap_fifo); interface_opts.extcap_args = NULL; interface_opts.extcap_pid = INVALID_EXTCAP_PID; @@ -713,7 +692,6 @@ capture_opts_add_iface_opt(capture_options *capture_opts, const char *optarg_str #endif interface_opts.extcap_control_in = g_strdup(capture_opts->default_options.extcap_control_in); interface_opts.extcap_control_out = g_strdup(capture_opts->default_options.extcap_control_out); -#endif #ifdef CAN_SET_CAPTURE_BUFFER_SIZE interface_opts.buffer_size = capture_opts->default_options.buffer_size; #endif @@ -1143,7 +1121,6 @@ capture_opts_del_iface(capture_options *capture_opts, guint if_index) g_free(interface_opts->console_display_name); g_free(interface_opts->cfilter); g_free(interface_opts->timestamp_type); -#ifdef HAVE_EXTCAP g_free(interface_opts->extcap); g_free(interface_opts->extcap_fifo); if (interface_opts->extcap_args) @@ -1153,7 +1130,6 @@ capture_opts_del_iface(capture_options *capture_opts, guint if_index) g_free(interface_opts->extcap_userdata); g_free(interface_opts->extcap_control_in); g_free(interface_opts->extcap_control_out); -#endif #ifdef HAVE_PCAP_REMOTE if (interface_opts->src_type == CAPTURE_IFREMOTE) { g_free(interface_opts->remote_host); @@ -1196,7 +1172,6 @@ collect_ifaces(capture_options *capture_opts) interface_opts.has_snaplen = device->has_snaplen; interface_opts.promisc_mode = device->pmode; interface_opts.if_type = device->if_info.type; -#ifdef HAVE_EXTCAP interface_opts.extcap = g_strdup(device->if_info.extcap); interface_opts.extcap_fifo = NULL; interface_opts.extcap_userdata = NULL; @@ -1212,7 +1187,6 @@ collect_ifaces(capture_options *capture_opts) #endif interface_opts.extcap_control_in = NULL; interface_opts.extcap_control_out = NULL; -#endif #ifdef CAN_SET_CAPTURE_BUFFER_SIZE interface_opts.buffer_size = device->buffer; #endif @@ -1281,9 +1255,7 @@ capture_opts_free_interface_t(interface_t *device) g_slist_foreach(device->if_info.addrs, capture_opts_free_interface_t_addrs, NULL); g_slist_free(device->if_info.addrs); -#ifdef HAVE_EXTCAP g_free(device->if_info.extcap); -#endif } } diff --git a/capture_opts.h b/capture_opts.h index 3e5a407359..17c049c00a 100644 --- a/capture_opts.h +++ b/capture_opts.h @@ -188,10 +188,8 @@ typedef struct interface_tag { if_info_t if_info; gboolean selected; gboolean hidden; -#ifdef HAVE_EXTCAP /* External capture cached data */ GHashTable *external_cap_args_settings; -#endif gchar *timestamp_type; } interface_t; @@ -216,7 +214,6 @@ typedef struct interface_options_tag { int linktype; gboolean promisc_mode; interface_type if_type; -#ifdef HAVE_EXTCAP gchar *extcap; gchar *extcap_fifo; GHashTable *extcap_args; @@ -230,7 +227,6 @@ typedef struct interface_options_tag { #endif gchar *extcap_control_in; gchar *extcap_control_out; -#endif #ifdef CAN_SET_CAPTURE_BUFFER_SIZE int buffer_size; #endif diff --git a/caputils/capture-pcap-util.c b/caputils/capture-pcap-util.c index 48d596f8ba..300f6e538b 100644 --- a/caputils/capture-pcap-util.c +++ b/caputils/capture-pcap-util.c @@ -288,9 +288,7 @@ if_info_new(const char *name, const char *description, gboolean loopback) if_info->friendly_name = NULL; /* default - unknown */ if_info->vendor_description = NULL; if_info->type = IF_WIRED; /* default */ -#ifdef HAVE_EXTCAP if_info->extcap = g_strdup(""); -#endif #ifdef _WIN32 /* * Get the interface type. @@ -555,10 +553,7 @@ free_if_cb(gpointer data, gpointer user_data _U_) g_free(if_info->name); g_free(if_info->friendly_name); g_free(if_info->vendor_description); -#ifdef HAVE_EXTCAP g_free(if_info->extcap); -#endif - g_slist_foreach(if_info->addrs, free_if_info_addr_cb, NULL); g_slist_free(if_info->addrs); g_free(if_info); diff --git a/caputils/capture_ifinfo.h b/caputils/capture_ifinfo.h index 65084b8d60..e9ffdf483b 100644 --- a/caputils/capture_ifinfo.h +++ b/caputils/capture_ifinfo.h @@ -38,9 +38,7 @@ typedef enum { IF_WIRELESS, IF_DIALUP, IF_USB, -#ifdef HAVE_EXTCAP IF_EXTCAP, -#endif IF_VIRTUAL } interface_type; @@ -59,9 +57,7 @@ typedef struct { GSList *addrs; /* containing address values of if_addr_t */ interface_type type; /* type of interface */ gboolean loopback; /* TRUE if loopback, FALSE otherwise */ -#ifdef HAVE_EXTCAP char *extcap; /* extcap arguments, which present the data to call the extcap interface */ -#endif } if_info_t; /* diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in index d60c411b6b..61a31929e3 100644 --- a/cmakeconfig.h.in +++ b/cmakeconfig.h.in @@ -29,9 +29,6 @@ /* Directory where extcap hooks reside */ #define EXTCAP_DIR "${EXTCAP_DIR}" -/* Define to 1 if we want to enable extcap */ -#cmakedefine HAVE_EXTCAP 1 - /* Define to 1 if we want to enable plugins */ #cmakedefine HAVE_PLUGINS 1 diff --git a/configure.ac b/configure.ac index 7206c1ec1a..763994b56f 100644 --- a/configure.ac +++ b/configure.ac @@ -2470,27 +2470,8 @@ dnl check for extcap directory - stolen from Amanda's configure.ac dnl dnl we don't wish to expand ${libdir} yet extcapdir="\${libdir}/wireshark/extcap" -AC_ARG_WITH(extcap, - AC_HELP_STRING( [--with-extcap@<:@=DIR@:>@], - [use extcap for external capture sources (installed in DIR, if supplied) @<:@default=yes, if possible@:>@]), -[ - if test "x$withval" = "xno"; then - have_extcap=no - elif test "x$withval" = "xyes"; then - have_extcap=yes - elif test "x$withval" != "xyes"; then - have_extcap=yes - extcapdir ="$withval" - fi -],[ - have_extcap=yes -]) -AM_CONDITIONAL(HAVE_EXTCAP, test "x$have_extcap" = "xyes") -if test "x$have_extcap" = "xyes" -then - AC_DEFINE(HAVE_EXTCAP, 1, [Define if external capture sources should be enabled]) - extcap_man="extcap.4" -fi +extcap_man="extcap.4" + AC_SUBST(extcap_man) AC_SUBST(extcapdir) @@ -2502,10 +2483,7 @@ AC_ARG_ENABLE(androiddump, [build androiddump @<:@default=yes@:>@]), androiddump=$enableval,enable_androiddump=yes) -if test "x$have_extcap" != xyes; then - AC_MSG_RESULT([no, extcap disabled]) - enable_androiddump=no -elif test "x$enable_androiddump" = "xyes" ; then +if test "x$enable_androiddump" = "xyes" ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -2538,10 +2516,7 @@ AC_ARG_ENABLE(sshdump, [build sshdump @<:@default=yes@:>@]), [],[enable_sshdump=yes]) -if test "x$have_extcap" != xyes; then - AC_MSG_RESULT([no, extcap disabled]) - enable_sshdump=no -elif test "x$have_libssh_pointsix" != xyes; then +if test "x$have_libssh_pointsix" != xyes; then AC_MSG_RESULT([no, libssh >= 0.6.0 not installed for development]) enable_sshdump=no elif test "x$enable_sshdump" = "xyes" ; then @@ -2568,10 +2543,7 @@ AC_ARG_ENABLE(ciscodump, [build ciscodump @<:@default=yes@:>@]), [],[enable_ciscodump=yes]) -if test "x$have_extcap" != xyes; then - AC_MSG_RESULT([no, extcap disabled]) - enable_ciscodump=no -elif test "x$have_libssh_pointsix" != xyes; then +if test "x$have_libssh_pointsix" != xyes; then AC_MSG_RESULT([no, libssh >= 0.6.0 not installed for development]) enable_ciscodump=no elif test "x$enable_ciscodump" = "xyes" ; then @@ -2598,10 +2570,7 @@ AC_ARG_ENABLE(randpktdump, [build randpktdump @<:@default=yes@:>@]), randpktdump=$enableval,enable_randpktdump=yes) -if test "x$have_extcap" != xyes; then - AC_MSG_RESULT([no, extcap disabled]) - enable_randpktdump=no -elif test "x$enable_randpktdump" = "xyes" ; then +if test "x$enable_randpktdump" = "xyes" ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -2625,10 +2594,7 @@ AC_ARG_ENABLE(udpdump, [build udpdump @<:@default=yes@:>@]), [],[enable_udpdump=yes]) -if test "x$have_extcap" != xyes; then - AC_MSG_RESULT([no, extcap disabled]) - enable_udpdump=no -elif test "x$enable_udpdump" = "xyes" ; then +if test "x$enable_udpdump" = "xyes" ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -3017,7 +2983,6 @@ echo " Install dumpcap with capabilities : $setcap_message" echo " Install dumpcap setuid : $setuid_message" echo " Use dumpcap group : $dumpcap_group_message" echo " Use plugins : $have_plugins" -echo " Use external capture sources : $have_extcap" echo " Use Lua library : $lua_message" echo " Build Qt RTP player : $qt_multimedia_message" echo " Build GTK+ RTP player : $portaudio_message" diff --git a/doc/README.extcap b/doc/README.extcap index 3ce07aa161..acd6ca7090 100644 --- a/doc/README.extcap +++ b/doc/README.extcap @@ -389,13 +389,9 @@ Messages with unknown control number or command will be silently ignored. DEVELOPMENT =========== -To have extcap support, extcap must be enabled. Moreover the specific extcap must -be compiled. Examples for autotools and cmake compiling the extcap plugin androiddump -are provided within wireshark. The extcap subsystem and the bundled extcaps are compiled -by default. - -autotools: ./configure --with-extcap --enable-androiddump -cmake: cmake -DENABLE_EXTCAP=ON -DBUILD_androiddump .. +To have extcap support, the specific extcap must be compiled. Examples for autotools and +cmake compiling the extcap plugin androiddump are provided within wireshark. +The extcap subsystem and the bundled extcaps are compiled by default. Additionally there is an example python script available in doc/extcap_example.py. diff --git a/dumpcap.c b/dumpcap.c index 7b4b554940..0bc0617fb6 100644 --- a/dumpcap.c +++ b/dumpcap.c @@ -98,9 +98,7 @@ #include "caputils/ws80211_utils.h" -#ifdef HAVE_EXTCAP #include "extcap.h" -#endif /* * Get information about libpcap format from "wiretap/libpcap.h". @@ -844,9 +842,7 @@ print_machine_readable_interfaces(GList *if_list) printf("\tloopback"); else printf("\tnetwork"); -#ifdef HAVE_EXTCAP printf("\t%s", if_info->extcap); -#endif printf("\n"); } } @@ -1493,13 +1489,9 @@ cap_pipe_open_live(char *pipename, #else /* _WIN32 */ char *pncopy, *pos; wchar_t *err_str; -#ifdef HAVE_EXTCAP char* extcap_pipe_name; #endif -#endif -#ifdef HAVE_EXTCAP gboolean extcap_pipe = FALSE; -#endif ssize_t b; int fd = -1, sel_ret; size_t bytes_read; @@ -1527,10 +1519,8 @@ cap_pipe_open_live(char *pipename, } } else { #ifndef _WIN32 -#ifdef HAVE_EXTCAP if ( g_strrstr(pipename, EXTCAP_PIPE_PREFIX) != NULL ) extcap_pipe = TRUE; -#endif if (ws_stat64(pipename, &pipe_stat) < 0) { if (errno == ENOENT || errno == ENOTDIR) @@ -1640,20 +1630,15 @@ cap_pipe_open_live(char *pipename, pcap_src->cap_pipe_err = PIPNEXIST; return; } -#ifdef HAVE_EXTCAP extcap_pipe_name = g_strconcat("\\\\.\\pipe\\", EXTCAP_PIPE_PREFIX, NULL); extcap_pipe = strstr(pipename, extcap_pipe_name) ? TRUE : FALSE; g_free(extcap_pipe_name); -#endif /* Wait for the pipe to appear */ while (1) { - -#ifdef HAVE_EXTCAP if(extcap_pipe) pcap_src->cap_pipe_h = GetStdHandle(STD_INPUT_HANDLE); else -#endif pcap_src->cap_pipe_h = CreateFile(utf_8to16(pipename), GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); @@ -1718,11 +1703,10 @@ cap_pipe_open_live(char *pipename, b = cap_pipe_read(fd, ((char *)&magic)+bytes_read, sizeof magic-bytes_read, pcap_src->from_cap_socket); -#ifdef HAVE_EXTCAP /* jump messaging, if extcap had an error, stderr will provide the correct message */ if (extcap_pipe && b <= 0) goto error; -#endif + if (b <= 0) { if (b == 0) g_snprintf(errmsg, errmsgl, "End of file on pipe magic during open."); diff --git a/epan/prefs.c b/epan/prefs.c index b0ac5c8162..e44f47d0b5 100644 --- a/epan/prefs.c +++ b/epan/prefs.c @@ -2983,9 +2983,7 @@ prefs_register_modules(void) { module_t *printing, *capture_module, *console_module, *gui_layout_module, *gui_font_module; -#ifdef HAVE_EXTCAP module_t *extcap_module; -#endif struct pref_custom_cbs custom_cbs; @@ -2994,7 +2992,6 @@ prefs_register_modules(void) return; } -#ifdef HAVE_EXTCAP /* GUI * These are "simple" GUI preferences that can be read/written using the * preference module API. These preferences still use their own @@ -3010,7 +3007,6 @@ prefs_register_modules(void) "Save arguments on start of capture", "Save arguments on start of capture", &prefs.extcap_save_on_start); -#endif /* GUI * These are "simple" GUI preferences that can be read/written using the diff --git a/epan/prefs.h b/epan/prefs.h index 2eead89225..2eb7fbbfbd 100644 --- a/epan/prefs.h +++ b/epan/prefs.h @@ -245,9 +245,7 @@ typedef struct _e_prefs { gint st_sort_defcolflag; gboolean st_sort_defdescending; gboolean st_sort_showfullname; -#ifdef HAVE_EXTCAP gboolean extcap_save_on_start; -#endif } e_prefs; WS_DLL_PUBLIC e_prefs prefs; diff --git a/rawshark.c b/rawshark.c index 68dedaddd4..19982787c5 100644 --- a/rawshark.c +++ b/rawshark.c @@ -90,9 +90,7 @@ #include "caputils/capture-pcap-util.h" -#ifdef HAVE_EXTCAP #include "extcap.h" -#endif #ifdef HAVE_LIBPCAP #include @@ -836,9 +834,7 @@ main(int argc, char *argv[]) clean_exit: epan_free(cfile.epan); epan_cleanup(); -#ifdef HAVE_EXTCAP extcap_cleanup(); -#endif wtap_cleanup(); return ret; } diff --git a/tfshark.c b/tfshark.c index ddc770d051..2b4f9e9785 100644 --- a/tfshark.c +++ b/tfshark.c @@ -62,10 +62,7 @@ #include #include #include - -#ifdef HAVE_EXTCAP #include "extcap.h" -#endif #include #include @@ -999,9 +996,7 @@ clean_exit: destroy_print_stream(print_stream); epan_free(cfile.epan); epan_cleanup(); -#ifdef HAVE_EXTCAP extcap_cleanup(); -#endif output_fields_free(output_fields); output_fields = NULL; diff --git a/tshark.c b/tshark.c index 687b6c14d5..7d0b453199 100644 --- a/tshark.c +++ b/tshark.c @@ -119,9 +119,7 @@ #include #include -#ifdef HAVE_EXTCAP #include "extcap.h" -#endif #ifdef HAVE_PLUGINS #include @@ -562,10 +560,8 @@ about_folders(void) { const char *constpath; char *path; -#if defined(HAVE_LIBSMI) || defined(HAVE_GEOIP) || defined(HAVE_EXTCAP) gint i; gchar **resultArray; -#endif /* "file open" */ @@ -612,7 +608,6 @@ about_folders(void) printf("%-21s\t%s\n", "Global Lua Plugins:", get_plugins_dir()); #endif -#ifdef HAVE_EXTCAP /* Extcap */ constpath = get_extcap_dir(); @@ -621,7 +616,6 @@ about_folders(void) printf("%-21s\t%s\n", "Extcap path:", g_strstrip(resultArray[i])); g_strfreev(resultArray); -#endif #ifdef HAVE_GEOIP /* GeoIP */ @@ -919,9 +913,7 @@ main(int argc, char *argv[]) #ifdef HAVE_PLUGINS register_all_plugin_tap_listeners(); #endif -#ifdef HAVE_EXTCAP extcap_register_preferences(); -#endif /* Register all tap listeners. */ for (tap_reg_t *t = tap_reg_listener; t->cb_func != NULL; t++) { t->cb_func(); @@ -1367,9 +1359,7 @@ main(int argc, char *argv[]) * $ ./tools/valgrind-wireshark -n * much more useful. */ epan_cleanup(); -#ifdef HAVE_EXTCAP extcap_cleanup(); -#endif exit_status = EXIT_SUCCESS; goto clean_exit; case 'O': /* Only output these protocols */ @@ -1868,9 +1858,7 @@ main(int argc, char *argv[]) cmdarg_err("%s", err_msg); g_free(err_msg); epan_cleanup(); -#ifdef HAVE_EXTCAP extcap_cleanup(); -#endif #ifdef HAVE_PCAP_OPEN_DEAD { pcap_t *pc; @@ -1898,9 +1886,7 @@ main(int argc, char *argv[]) cmdarg_err("%s", err_msg); g_free(err_msg); epan_cleanup(); -#ifdef HAVE_EXTCAP extcap_cleanup(); -#endif #ifdef HAVE_PCAP_OPEN_DEAD { pcap_t *pc; @@ -2020,9 +2006,7 @@ main(int argc, char *argv[]) */ if (cf_open(&cfile, cf_name, in_file_type, FALSE, &err) != CF_OK) { epan_cleanup(); -#ifdef HAVE_EXTCAP extcap_cleanup(); -#endif exit_status = INVALID_FILE; goto clean_exit; } @@ -2199,9 +2183,7 @@ main(int argc, char *argv[]) funnel_dump_all_text_windows(); epan_free(cfile.epan); epan_cleanup(); -#ifdef HAVE_EXTCAP extcap_cleanup(); -#endif output_fields_free(output_fields); output_fields = NULL; 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 #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,13 +412,11 @@ 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: 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 #endif -#ifdef HAVE_EXTCAP #include -#endif #ifdef HAVE_LIBPORTAUDIO #include @@ -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 #include @@ -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 @@ -63,9 +61,7 @@ void CaptureFilterSyntaxWorker::start() { forever { QString filter; QSet active_dlts; -#ifdef HAVE_EXTCAP QSet 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 -#ifdef HAVE_EXTCAP #include #include #include @@ -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 -#ifdef HAVE_EXTCAP - #include #include #include @@ -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 #include "wireshark_application.h" -#ifdef HAVE_EXTCAP #include "extcap.h" -#endif #include #include @@ -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 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 -#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 toolbars = findChildren(); 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 menu_groups = QList() 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 ) { @@ -364,8 +361,6 @@ bool InterfaceTreeCacheModel::isAllowedToBeEdited(const QModelIndex &index) cons return false; #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* */ #include -#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 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 #endif @@ -1110,9 +1108,7 @@ void WiresharkApplication::ifChangeEventsAvailable() void WiresharkApplication::refreshLocalInterfaces() { -#ifdef HAVE_EXTCAP extcap_clear_interfaces(); -#endif #ifdef HAVE_LIBPCAP /* diff --git a/wireshark-qt.cpp b/wireshark-qt.cpp index a890a036f6..0ca3912661 100644 --- a/wireshark-qt.cpp +++ b/wireshark-qt.cpp @@ -57,9 +57,7 @@ #include -#ifdef HAVE_EXTCAP #include -#endif /* general (not Qt specific) */ #include "file.h" @@ -691,13 +689,11 @@ int main(int argc, char *qt_argv[]) in_file_type = open_info_name_to_type(ex_opt_get_next("read_format")); } -#ifdef HAVE_EXTCAP #ifdef DEBUG_STARTUP_TIME g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_INFO, "Calling extcap_register_preferences, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time); #endif splash_update(RA_EXTCAP, NULL, NULL); extcap_register_preferences(); -#endif splash_update(RA_PREFERENCES, NULL, NULL); g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_INFO, "Calling module preferences, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time); @@ -955,9 +951,7 @@ int main(int argc, char *qt_argv[]) recent_cleanup(); epan_cleanup(); -#ifdef HAVE_EXTCAP extcap_cleanup(); -#endif AirPDcapDestroyContext(&airpdcap_ctx); diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c index ee6940ef46..b78f8c9080 100644 --- a/wsutil/filesystem.c +++ b/wsutil/filesystem.c @@ -1077,7 +1077,6 @@ get_plugins_pers_dir_with_version(void) return plugin_pers_dir_with_version; } -#if defined(HAVE_EXTCAP) /* * Find the directory where the extcap hooks are stored. * @@ -1156,22 +1155,17 @@ static void init_extcap_dir(void) { } #endif } -#endif /* HAVE_EXTCAP */ /* * Get the directory in which the extcap hooks are stored. * - * XXX - A fix instead of HAVE_EXTCAP must be found */ const char * -get_extcap_dir(void) { -#if defined(HAVE_EXTCAP) +get_extcap_dir(void) +{ if (!extcap_dir) init_extcap_dir(); return extcap_dir; -#else - return NULL; -#endif } /* @@ -2257,10 +2251,8 @@ free_progdirs(void) g_free(plugin_pers_dir_with_version); plugin_pers_dir_with_version = NULL; #endif -#ifdef HAVE_EXTCAP g_free(extcap_dir); extcap_dir = NULL; -#endif } /* -- cgit v1.2.3