extcap: remove conditional compilation.
authorDario Lombardo <lomato@gmail.com>
Sat, 6 Jan 2018 20:39:26 +0000 (21:39 +0100)
committerAnders Broman <a.broman58@gmail.com>
Mon, 8 Jan 2018 05:50:15 +0000 (05:50 +0000)
Change-Id: Ia54bba388755cf27a343fe6d69d244bf1ab897f9
Reviewed-on: https://code.wireshark.org/review/25186
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
52 files changed:
.gitlab-ci.yml
.travis.yml
CMakeLists.txt
CMakeOptions.txt
Makefile.am
capchild/capture_ifinfo.c
capchild/capture_sync.c
capture_opts.c
capture_opts.h
caputils/capture-pcap-util.c
caputils/capture_ifinfo.h
cmakeconfig.h.in
configure.ac
doc/README.extcap
dumpcap.c
epan/prefs.c
epan/prefs.h
rawshark.c
tfshark.c
tshark.c
ui/commandline.c
ui/gtk/CMakeLists.txt
ui/gtk/Makefile.am
ui/gtk/about_dlg.c
ui/gtk/capture_dlg.c
ui/gtk/capture_if_dlg.c
ui/gtk/main.c
ui/help_url.c
ui/help_url.h
ui/iface_lists.c
ui/qt/CMakeLists.txt
ui/qt/Makefile.am
ui/qt/about_dialog.cpp
ui/qt/capture_filter_syntax_worker.cpp
ui/qt/capture_interfaces_dialog.cpp
ui/qt/extcap_options_dialog.cpp
ui/qt/extcap_options_dialog.h
ui/qt/interface_frame.cpp
ui/qt/interface_frame.h
ui/qt/interface_toolbar.cpp
ui/qt/main_welcome.cpp
ui/qt/main_welcome.h
ui/qt/main_window.cpp
ui/qt/main_window.h
ui/qt/main_window_slots.cpp
ui/qt/models/interface_tree_cache_model.cpp
ui/qt/models/interface_tree_model.cpp
ui/qt/models/interface_tree_model.h
ui/qt/splash_overlay.cpp
ui/qt/wireshark_application.cpp
wireshark-qt.cpp
wsutil/filesystem.c

index 82223c815590cf14d7ddad6799ba7a0de88a1d67..a0ab674b007f80e67b7b80742d3539d6e719c903 100644 (file)
@@ -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:
index 1300c3751fcc88f784071e0bba5b69a73cf79737..24755599cd1e7934a789a3c2edc72ca4769b87e3 100644 (file)
@@ -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:
index 14b53d61f481632febb3bc9e97de0e71b73b6ba1..b6100a9f6b710046b1ee173031ec97d3a63ef670 100644 (file)
@@ -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
index dc262ff7764722856fcaf6156307c0dd2fd6a458..fdcb906c62b8cfdf6cfea8f3fa97688627ef2169 100644 (file)
@@ -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)
index 1c7b6a2f4a3fca1e78c5d49690ca4ca895c08bc6..c33837d25a511946a73988332e43b479770464ba 100644 (file)
@@ -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        \
index 0fd61a0dba12e3ed0d7a29eb07ea81eba6e4bbbd..44340b588d4fe6ffaa892bc88fb5f52dc0d06e72 100644 (file)
@@ -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 <caputils/capture_ifinfo.h>
@@ -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,
index 43fc2ac173360271bd39f087fb19be5494f177b7..1588a5648e37fce16b5932aee3be269fe72cfc51 100644 (file)
@@ -91,9 +91,7 @@
 #include <wsutil/filesystem.h>
 #include <wsutil/file_util.h>
 #include <wsutil/report_message.h>
-#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;
index f7eb7680828253bda108ae1365300873e66a8fc6..2cd8ed71f6799a7a7d8b5b3a6131134d87c98ba5 100644 (file)
@@ -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
     }
 }
 
index 3e5a407359083e83daff9ce76162219c01731f25..17c049c00a447798eb46bd4bd1f1483586ed0828 100644 (file)
@@ -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
index 48d596f8ba76de69fcd5b575ad7c1da73d03d540..300f6e538b769b04ccc4f6956e0313c3136969a6 100644 (file)
@@ -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);
index 65084b8d6033294e4253049656a221cab1c96b55..e9ffdf483b2f58c01e18dfda1e875c253739ef88 100644 (file)
@@ -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;
 
 /*
index d60c411b6bcb9b2dac39afa8ab4a51b65d2d45b0..61a31929e3de4f6e8628f1d87e0efb8452aab575 100644 (file)
@@ -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
 
index 7206c1ec1a1827c582fec1c0085fdd49d48aedab..763994b56fceb5514ff32b0baf6235bd7f2b0803 100644 (file)
@@ -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"
index 3ce07aa16164a4b674a642ce66c7c9b1a02eb006..acd6ca70900128ea34dbac1bdfe7f18ea60681eb 100644 (file)
@@ -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.
 
index 7b4b554940b3d0a3fed29ac2ea6d2bc77a87a3d8..0bc0617fb67c3675d807b828b9e55a8264499994 100644 (file)
--- 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.");
index b0ac5c816281268fd661fe65a6e9579fb69e1a6a..e44f47d0b5dbd7596c2d0b51dd199a7142a6e108 100644 (file)
@@ -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
index 2eead89225e3d9cbee0482359e4ec8f32afa6385..2eb7fbbfbd119a26a3d26c7f322510c458a79d97 100644 (file)
@@ -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;
index 68dedaddd4a77d1d9adb7d445407603feb605916..19982787c517b67aa1c591b9e8f557dce3843a99 100644 (file)
@@ -90,9 +90,7 @@
 
 #include "caputils/capture-pcap-util.h"
 
-#ifdef HAVE_EXTCAP
 #include "extcap.h"
-#endif
 
 #ifdef HAVE_LIBPCAP
 #include <setjmp.h>
@@ -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;
 }
index ddc770d05168b48bd285bca3dac0bd79d9e82e1b..2b4f9e9785b5b9768f113a419e1c0d1450eb9a7a 100644 (file)
--- a/tfshark.c
+++ b/tfshark.c
 #include <epan/tap.h>
 #include <epan/stat_tap_ui.h>
 #include <epan/ex-opt.h>
-
-#ifdef HAVE_EXTCAP
 #include "extcap.h"
-#endif
 
 #include <wiretap/wtap-int.h>
 #include <wiretap/file_wrappers.h>
@@ -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;
index 687b6c14d553e4bda781c6bcb93ce8dd23e31aed..7d0b453199ab4be95516161b98e459592ca4036b 100644 (file)
--- a/tshark.c
+++ b/tshark.c
 #include <wsutil/str_util.h>
 #include <wsutil/utf8_entities.h>
 
-#ifdef HAVE_EXTCAP
 #include "extcap.h"
-#endif
 
 #ifdef HAVE_PLUGINS
 #include <wsutil/plugins.h>
@@ -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;
index 8d81c8d1a9ebbb92ec6b116daf4da5dd7e40a49a..66e4d63d2354377b54250aed99f772e0091c460c 100644 (file)
@@ -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) {
index 8f92e08819bb3fbf92939d7fda6d0989fefe32fc..c4d34b6a43a6db1b07bb1f7b02fbebf8812c4f91 100644 (file)
@@ -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
index 33cfe073eef01fc0abdf4f3fc6c64171395125d5..23d70fb8b2f7baec328945a1d761f521f0c4f318 100644 (file)
@@ -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)
 
index 5d90c1b4ba9b659321a45e9ed9835b54c7231f59..5f0548c4fd1dd556bbd9277f338a7c9e3f5134e4 100644 (file)
@@ -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 */
index 6a64c3a13d5081d9dfd2741549a0e1d215ce7908..798bc0e5b90bbb86531d2213f0fad34a1ee38dea 100644 (file)
 #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;
index 99461a4823c5f81435f4d63a17e1cf5eb0d3a694..b894e99d3dfeedd90fe8292604a92070a6730fb9 100644 (file)
@@ -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:
index 3153a214e28bcff8d2870a140c2ea6ac572fc6bf..8f0c7c40ab5c9275fe95ed10958849854bc04839 100644 (file)
@@ -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);
 
index 455c173b9c48e00e969c295b2de78ad009869925..a462429aa7e4bb32864bece9908784ba95ec191b 100644 (file)
@@ -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;
index d75898d7623bcc7f6421df053daa4f1f7e4bddb4..658dda90cf4b2614af6cb772e448d904c7b415cd 100644 (file)
@@ -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,
index a1b66745f181b3eab23d23b605bc22535112b906..e249029fe774815f2862ee95d3f03f908ab1374a 100644 (file)
@@ -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++;
index 7b4a8439ed2c6fde01dc9b4a0f784ba60ab58acc..ad09591e5639c66793423ed9712464722465eae8 100644 (file)
@@ -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
index da04af33b8455b5c507c11db642d71a81febf97c..419700ded56c7b4b60bc3db3d82b0f7e3e4db86e 100644 (file)
@@ -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,$^)
index cd2c6ec53615da9c18450ddffa25a70b12217782..3962636cabe1f9f09fb7d3584755efc1d13e9830 100644 (file)
@@ -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);
index b61f6dbbb4375475d0a2e519c6081f536d242225..be314a8edb109b70945905a67a2a2476346930cd 100644 (file)
@@ -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");
index db82e8287497486ef57836fac7c84dba84ff23c6..6e4939fb08f4fdaac1cfe201f337ce4272e9d24c 100644 (file)
@@ -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
index 61d717a138fec76b6c127045c715b7f89b0efaf7..3e16efcaae5cd492bdabf5e0bc132d859001c3a4 100644 (file)
@@ -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
  *
index 1b66ad51826559d5f905b20bd4c077075b81896e..8c3fbc879b00e141f45e6f967e5e720ef5e408b2 100644 (file)
@@ -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
 
 /*
index 8eccf78b9a17800c3bba32405931d685dcbe45b0..fa8492ea0d780264092ae7511ab5ca2ebe6fc469 100644 (file)
@@ -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 )
index a52a6af30460266d6f48974442f61ce31983ff72..cae659b1ab50018d7edc0afc2627de5ed7fbbfd4 100644 (file)
@@ -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
 
index 7012f72771ce710dd62b971243f3273ff4e39999..1678daf7c132f8da51670b61c6bc41ec5e8c66a9 100644 (file)
@@ -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()
index 523a99edceaa6e8e29322300556971bb788377b0..adad58a770b9f396c48fe29bdf1db8a053289e6a 100644 (file)
@@ -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()
 {
index b462f5fd3e9427a6534ebcb7cc23c286abf6d604..dff4420b37195145d4374bfbad092646c63e5d79 100644 (file)
@@ -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();
 };
 
index 6d43fba45c331e22d150062c31dc6c57dbd81411..5d06d149ddb5bb66494816fc4c4ade246fb5f27c 100644 (file)
@@ -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>()
index 7bb22555459c5dae3cd7bac37d2492f1ed9f3f84..a8ee4d48833047cb9f2b1fe46406490629966e60 100644 (file)
@@ -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
index c3e47754748dcf655f62d31446fc03ac713fbb6f..fe001cf35b55f6747bbc4912f4800184ef079cf2 100644 (file)
@@ -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()
 {
index b093478916cb42634df5caaf498f3bcb7851a153..e193f58a9edfa44ece111bfe140c09ccba328a97 100644 (file)
@@ -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;
 }
index c57859ad72e8c47a48be9e581a6ddad001004c12..bd96411e6d493b14fa83e6125995ed8f6c8bcf41 100644 (file)
@@ -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");
index a441b39e335c8c29d7914b0773c12e8893ff5107..b850078da60575f78f0a6555662cf24939005ea2 100644 (file)
@@ -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,
index b39a1e4a28c278e1daa041c059eb080d10b6c5e2..826e62e6a932dd88f61c4d9dca01656851391974 100644 (file)
@@ -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();
 
index d0fe96e436ff61c27e7b83deaa73b23dda169f67..3dab45e1baef408ab165658ca08dce271f54a7ec 100644 (file)
@@ -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
     /*
index a890a036f6eb254c84ef4e288fc6e09f241625ec..0ca39126610624868dfb5fc86a421c0feb20d7a1 100644 (file)
@@ -57,9 +57,7 @@
 
 #include <codecs/codecs.h>
 
-#ifdef HAVE_EXTCAP
 #include <extcap.h>
-#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);
 
index ee6940ef46ac39e025b68b74924d779291b44680..b78f8c9080162562ccbf1c4aa2bb69c1dce271bb 100644 (file)
@@ -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
 }
 
 /*