Fix building without extcap enabled
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>
Fri, 18 Mar 2016 17:31:09 +0000 (17:31 +0000)
committerJoão Valverde <j@v6e.pt>
Mon, 21 Mar 2016 17:10:21 +0000 (17:10 +0000)
Using cmake -DENABLE_EXTCAP=no or ./configure --without-extcap.

Some documentation fixes too.

Change-Id: Iebf9c843d67e10a32de1a62904de8f88b872ec99
Reviewed-on: https://code.wireshark.org/review/14522
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
23 files changed:
CMakeLists.txt
Makefile.am
Makefile.common
Makefile.nmake
configure.ac
doc/Makefile.am
extcap.c
extcap.h
ui/gtk/Makefile.am
ui/gtk/Makefile.common
ui/gtk/Makefile.nmake
ui/help_url.c
ui/help_url.h
ui/qt/Makefile.am
ui/qt/Makefile.common
ui/qt/about_dialog.cpp
ui/qt/interface_tree.cpp
ui/qt/interface_tree.h
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

index 4230191aafebda5bae4b81d751da64f34a32ac23..f609b8e04576c598c36a4b1e62ca279d2ec3884c 100644 (file)
@@ -2328,7 +2328,7 @@ if (WIN32)
        endif()
 endif()
 
-if(BUILD_androiddump)
+if(ENABLE_EXTCAP AND BUILD_androiddump)
        if(EXTCAP_ANDROIDDUMP_LIBPCAP)
                if(HAVE_LIBPCAP)
                        set(androiddump_LIBS
@@ -2357,7 +2357,7 @@ if(BUILD_androiddump)
        install(TARGETS androiddump RUNTIME DESTINATION ${EXTCAP_DIR})
 endif()
 
-if(BUILD_sshdump AND LIBSSH_FOUND)
+if(ENABLE_EXTCAP AND BUILD_sshdump AND LIBSSH_FOUND)
        set(sshdump_LIBS
                wsutil
                ${GLIB2_LIBRARIES}
@@ -2382,7 +2382,7 @@ elseif (BUILD_sshdump)
        #message( WARNING "Cannot find libssh, cannot build sshdump" )
 endif()
 
-if(BUILD_randpktdump)
+if(ENABLE_EXTCAP AND BUILD_randpktdump)
        set(randpktdump_LIBS
                randpkt_core
                wiretap
index 1a70f64973dfcb7ccc38dc0c87a1226e6ba81cf1..5bc155e581a3d81fa6e6d787071ce6d14d544da5 100644 (file)
@@ -362,6 +362,10 @@ endif              # HAVE_PLUGINS
 
 include Makefile.common
 
+if HAVE_EXTCAP
+SHARK_COMMON_SRC += $(EXTCAP_COMMON_SRC)
+endif
+
 if ENABLE_STATIC
 EXTRALINKFLAGS = -Wl,-static -all-static
 else
@@ -1391,7 +1395,7 @@ SUBDIRS = \
        @wireshark_SUBDIRS@     \
        ui/cli                  \
        randpkt_core            \
-       extcap                  \
+       @extcap_subdir@         \
        .                       \
        doc
 
index a9fa08e2696f3e5737ea90e24bd45df3e2f4801a..06236d09d06c80ad4ccfa2a4a592db54b0bf6e39 100644 (file)
@@ -40,19 +40,23 @@ GENERATED_C_FILES =
 # All the generated files.
 GENERATED_FILES = $(GENERATED_C_FILES) $(GENERATED_HEADER_FILES)
 
+EXTCAP_COMMON_SRC = \
+       extcap.c                \
+       extcap_parser.c
+
+EXTCAP_COMMON_INCLUDES = \
+       extcap.h                \
+       extcap_parser.h
+
 # sources common for wireshark, tshark, and rawshark
 SHARK_COMMON_SRC =     \
        cfile.c                 \
        frame_tvbuff.c          \
-       sync_pipe_write.c       \
-       extcap.c                \
-       extcap_parser.c
+       sync_pipe_write.c
 
 # corresponding headers
 SHARK_COMMON_INCLUDES =        \
        cfile.h                 \
-       extcap.h                \
-       extcap_parser.h         \
        file.h                  \
        fileset.h               \
        frame_tvbuff.h          \
@@ -166,5 +170,6 @@ dumpcap_INCLUDES = \
 # this target needed for distribution only
 noinst_HEADERS =       \
        $(SHARK_COMMON_INCLUDES) \
+       $(EXTCAP_COMMON_INCLUDES) \
        $(WIRESHARK_COMMON_INCLUDES) \
        $(dumpcap_INCLUDES)
index 720019aa454459bc987f1371cb9a6777208c357c..110d96624d727fef53cef9f3c619c6a0013ef187 100644 (file)
@@ -51,7 +51,7 @@ CFLAGS=$(WARNINGS_ARE_ERRORS) $(GENERATED_CFLAGS)
 
 include Makefile.common
 
-wireshark_gtk_OBJECTS = $(WIRESHARK_COMMON_SRC:.c=.obj)
+wireshark_gtk_OBJECTS = $(WIRESHARK_COMMON_SRC:.c=.obj) $(EXTCAP_COMMON_SRC:.c=.obj)
 tshark_OBJECTS = $(tshark_SOURCES:.c=.obj)
 tfshark_OBJECTS = $(tfshark_SOURCES:.c=.obj)
 rawshark_OBJECTS = $(rawshark_SOURCES:.c=.obj)
@@ -1502,6 +1502,7 @@ install-all: install-generated-files
 checkapi_local:
        $(PERL) tools/checkAPIs.pl -build \
        $(WIRESHARK_COMMON_SRC) \
+       $(EXTCAP_COMMON_SRC) \
        $(TSHARK_TAP_SRC) \
 #      $(EXTRA_wireshark_SOURCES)
 
index 3438dcb3152075f0272386e16625e0b201c2b3ad..1d50639bb8d9c9458fc07e5ddad6c20738710c68 100644 (file)
@@ -2300,77 +2300,6 @@ fi
 AC_SUBST(rawshark_bin)
 AC_SUBST(rawshark_man)
 
-dnl androiddump check
-AC_MSG_CHECKING(whether to build androiddump)
-
-AC_ARG_ENABLE(androiddump,
-  AC_HELP_STRING( [--enable-androiddump],
-                 [build androiddump @<:@default=yes@:>@]),
-    androiddump=$enableval,enable_androiddump=yes)
-
-if test "x$enable_androiddump" = "xyes" ; then
-       AC_MSG_RESULT(yes)
-else
-       AC_MSG_RESULT(no)
-fi
-
-AC_ARG_ENABLE(androiddump_use_libpcap,
-  AC_HELP_STRING( [--enable-androiddump-use-libpcap],
-                 [build androiddump using libpcap @<:@default=no@:>@]),
-    androiddump_use_libpcap=$enableval,enable_androiddump_use_libpcap=no)
-
-if test "x$enable_androiddump_use_libpcap" = "xyes" ; then
-       AC_DEFINE(ANDROIDDUMP_USE_LIBPCAP, 1, [Androiddump will use Libpcap])
-fi
-
-if test "x$enable_androiddump" = "xyes" ; then
-       androiddump_bin="androiddump\$(EXEEXT)"
-       androiddump_man=""
-else
-       androiddump_bin=""
-       androiddump_man=""
-fi
-AC_SUBST(androiddump_bin)
-AC_SUBST(androiddump_man)
-
-dnl sshdump check
-AC_MSG_CHECKING(whether to build sshdump)
-
-AC_ARG_ENABLE(sshdump,
-  AC_HELP_STRING( [--enable-sshdump],
-                 [build sshdump @<:@default=yes@:>@]),
-    sshdump=$enableval,enable_sshdump=yes)
-
-if test "x$enable_sshdump" = "xyes" ; then
-       AC_MSG_RESULT(yes)
-else
-       AC_MSG_RESULT(no)
-fi
-
-dnl randpktdump check
-AC_MSG_CHECKING(whether to build randpktdump)
-
-AC_ARG_ENABLE(randpktdump,
-  AC_HELP_STRING( [--enable-randpktdump],
-                 [build androiddump @<:@default=yes@:>@]),
-    randpktdump=$enableval,enable_randpktdump=yes)
-
-if test "x$enable_randpktdump" = "xyes" ; then
-       AC_MSG_RESULT(yes)
-else
-       AC_MSG_RESULT(no)
-fi
-
-if test "x$enable_randpktdump" = "xyes" ; then
-       randpktdump_bin="randpktdump\$(EXEEXT)"
-       randpktdump_man=""
-else
-       randpktdump_bin=""
-       randpktdump_man=""
-fi
-AC_SUBST(randpktdump_bin)
-AC_SUBST(randpktdump_man)
-
 # Enable/disable echld
 AC_ARG_ENABLE(echld,
   AC_HELP_STRING( [--enable-echld],
@@ -3097,9 +3026,66 @@ 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_subdir="extcap"
+  extcap_man="extcap.4"
 fi
+AC_SUBST(extcap_subdir)
+AC_SUBST(extcap_man)
 AC_SUBST(extcapdir)
 
+dnl androiddump check
+AC_MSG_CHECKING(whether to build androiddump)
+
+AC_ARG_ENABLE(androiddump,
+  AC_HELP_STRING( [--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
+       AC_MSG_RESULT(yes)
+else
+       AC_MSG_RESULT(no)
+fi
+
+AC_ARG_ENABLE(androiddump_use_libpcap,
+  AC_HELP_STRING( [--enable-androiddump-use-libpcap],
+                 [build androiddump using libpcap @<:@default=no@:>@]),
+    androiddump_use_libpcap=$enableval,enable_androiddump_use_libpcap=no)
+
+if test "x$enable_androiddump" = "xyes" -a "x$enable_androiddump_use_libpcap" = "xyes" ; then
+       AC_DEFINE(ANDROIDDUMP_USE_LIBPCAP, 1, [Androiddump will use Libpcap])
+fi
+
+if test "x$enable_androiddump" = "xyes" ; then
+       androiddump_bin="androiddump\$(EXEEXT)"
+       androiddump_man=""
+else
+       androiddump_bin=""
+       androiddump_man=""
+fi
+AC_SUBST(androiddump_bin)
+AC_SUBST(androiddump_man)
+
+dnl sshdump check
+AC_MSG_CHECKING(whether to build sshdump)
+
+AC_ARG_ENABLE(sshdump,
+  AC_HELP_STRING( [--enable-sshdump],
+                 [build sshdump @<:@default=yes@:>@]),
+    sshdump=$enableval,enable_sshdump=yes)
+
+if test "x$have_extcap" != xyes; then
+       AC_MSG_RESULT(no, extcap disabled)
+       enable_sshdump=no
+elif test "x$enable_sshdump" = "xyes" ; then
+       AC_MSG_RESULT(yes)
+else
+       AC_MSG_RESULT(no)
+fi
+
 if test "x$enable_sshdump" = "xyes" ; then
        if  test "x$have_good_libssh" = "xyes" ; then
                sshdump_bin="sshdump\$(EXEEXT)"
@@ -3117,6 +3103,33 @@ fi
 AC_SUBST(sshdump_bin)
 AC_SUBST(sshdump_man)
 
+dnl randpktdump check
+AC_MSG_CHECKING(whether to build randpktdump)
+
+AC_ARG_ENABLE(randpktdump,
+  AC_HELP_STRING( [--enable-randpktdump],
+                 [build androiddump @<:@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
+       AC_MSG_RESULT(yes)
+else
+       AC_MSG_RESULT(no)
+fi
+
+if test "x$enable_randpktdump" = "xyes" ; then
+       randpktdump_bin="randpktdump\$(EXEEXT)"
+       randpktdump_man=""
+else
+       randpktdump_bin=""
+       randpktdump_man=""
+fi
+AC_SUBST(randpktdump_bin)
+AC_SUBST(randpktdump_man)
+
 dnl libtool defs
 #
 # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
index 66ad3335cb46dc300fbe2ad02738a1ed166faa96..d26a5fb0c5fa7ec1c761054649efb290116d8220 100644 (file)
@@ -75,7 +75,9 @@ man1_MANS = \
        @sshdump_man@           \
        @randpktdump_man@
 
-man4_MANS = @wiresharkfilter_man@
+man4_MANS = \
+       @extcap_man@            \
+       @wiresharkfilter_man@
 man_MANS =
 
 # Build these in case a developer wants to read them and for the Debian
@@ -86,7 +88,8 @@ noinst_DATA = asn2deb.1 asn2deb.html idl2deb.1 idl2deb.html idl2wrs.1 idl2wrs.ht
 pkgdata_DATA = AUTHORS-SHORT $(top_srcdir)/docbook/ws.css wireshark.html \
        tshark.html wireshark-filter.html capinfos.html editcap.html \
        mergecap.html reordercap.html text2pcap.html dumpcap.html androiddump.html \
-       sshdump.html randpktdump.html rawshark.html dftest.html randpkt.html
+       sshdump.html randpktdump.html rawshark.html dftest.html randpkt.html \
+       extcap.html
 
 #
 # Build the short version of the authors file for the about dialog
@@ -134,7 +137,7 @@ POD_CSS_URL ?= $(top_srcdir)/docbook/ws.css
        --noindex                                               \
        $< > $@
 
-# This rule needs to stay separate because of the --section option.
+# These rules need to stay separate because of the --section option.
 wireshark-filter.4: wireshark-filter.pod ../config.h
        $(AM_V_POD2MAN)$(POD2MAN)                       \
        --section=4                                     \
@@ -142,6 +145,13 @@ wireshark-filter.4: wireshark-filter.pod ../config.h
        --release=$(VERSION)                            \
        $(srcdir)/wireshark-filter.pod > wireshark-filter.4
 
+extcap.4: extcap.pod ../config.h
+       $(AM_V_POD2MAN)$(POD2MAN)                       \
+       --section=4                                     \
+       --center="The Wireshark Network Analyzer"       \
+       --release=$(VERSION)                            \
+       $(srcdir)/extcap.pod > extcap.4
+
 # These rules need to stay separate because each man page has a separate
 # title.  Using GNU make's pattern rules would allow these to be removed
 # but at the cost of portability.
@@ -159,6 +169,13 @@ wireshark-filter.html: wireshark-filter.pod ../config.h $(top_srcdir)/docbook/ws
        --noindex                                                               \
        $(srcdir)/wireshark-filter.pod > wireshark-filter.html
 
+extcap.html: extcap.pod ../config.h $(top_srcdir)/docbook/ws.css
+       $(AM_V_POD2HTML)$(POD2HTML)                                             \
+       --title="extcap - The Wireshark Network Analyzer $(VERSION)"            \
+       --css=$(POD_CSS_URL)                                                    \
+       --noindex                                                               \
+       $(srcdir)/extcap.pod > extcap.html
+
 capinfos.html: capinfos.pod ../config.h $(top_srcdir)/docbook/ws.css
        $(AM_V_POD2HTML)$(POD2HTML)                                     \
        --title="capinfos - The Wireshark Network Analyzer $(VERSION)"  \
index d60d6aa0b505eb6e4940eb2db8692e1ff4f1fc57..a04faea01db1a9a89745ca274d3cbebc8ffd96d5 100644 (file)
--- a/extcap.c
+++ b/extcap.c
@@ -49,8 +49,6 @@
 
 #include "capture_opts.h"
 
-#ifdef HAVE_EXTCAP
-
 #include "extcap.h"
 #include "extcap_parser.h"
 
@@ -1064,7 +1062,6 @@ void extcap_debug_arguments ( extcap_arg *arg_iter )
     }
 }
 #endif
-#endif
 
 /*
  * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
index 9701ae52e3528b26206dec317104437f9f6a7f68..509e007a5eadecd00bcb91d3628202fc05030d17 100644 (file)
--- a/extcap.h
+++ b/extcap.h
@@ -35,8 +35,6 @@
 
 #include <ui/capture_ui_utils.h>
 
-#ifdef HAVE_EXTCAP
-
 /* As boolean flags will be allowed any form of yes, true or any number != 0 (or starting with 0)
  * The regex will be matched case-insensitive, so only the lower-case is defined here. */
 #define EXTCAP_BOOLEAN_REGEX "^.*([yt1-9])"
@@ -110,8 +108,6 @@ extcap_cleanup(capture_options * capture_opts _U_);
 
 #endif
 
-#endif
-
 /*
  * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
  *
index 7a97c0afaa19d58c35323adc4e9ad7c909213b6b..a2fab6fc5b455ac93e64ca7be263bf0c94a0ca43 100644 (file)
@@ -32,6 +32,11 @@ 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 c33c1d88ffdb93d6eedb34de5228cd1b0ea0a000..248b249f3ea6d274f083861dd4771626ca4f28a6 100644 (file)
@@ -57,7 +57,6 @@ 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       \
@@ -181,7 +180,6 @@ 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           \
index 8d8f2ce73f9a67f2aab129379d24d43f5dbd2025..f2cf3968eee12dd3e15f042cb2150d56b348e1eb 100644 (file)
@@ -36,7 +36,8 @@ WIRESHARK_CLEAN_LIBGTKUI_SRC = \
        airpcap_gui_utils.c \
        capture_if_details_dlg_win32.c \
        main_airpcap_toolbar.c \
-       pixbuf-csource.c
+       pixbuf-csource.c \
+       extcap_gtk.c
 
 WIRESHARK_LIBGTKUI_SRC = \
        $(WIRESHARK_CLEAN_LIBGTKUI_SRC)
index 2120c241436773a4ee18006b8fd9fe253a613e40..0a10666afcded7edfe6a351138a75c8959dd66bb 100644 (file)
@@ -268,9 +268,11 @@ 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 = user_guide_url("ChExtcapOptions.html");
         break;
+#endif
     case(HELP_STATS_SUMMARY_DIALOG):
         url = user_guide_url("ChStatSummary.html");
         break;
index cd5db0d08f17bea4f88c3cd8339cc026284f66d5..b88b560357ba37e55c5285283c2b3c5c88cae557 100644 (file)
@@ -86,7 +86,7 @@ typedef enum {
     HELP_FOLLOW_STREAM_DIALOG,
     HELP_SHOW_PACKET_BYTES_DIALOG,
     HELP_EXPERT_INFO_DIALOG,
-#if HAVE_EXTCAP
+#ifdef HAVE_EXTCAP
     HELP_EXTCAP_OPTIONS_DIALOG,
 #endif
     HELP_STATS_SUMMARY_DIALOG,
index 33c0231ef4c1cbad0a4d3c597ebfa95ad1d99b6e..9940f270f83769df569ec567c0c7494b60c35343 100644 (file)
@@ -43,6 +43,26 @@ MAINTAINERCLEANFILES = \
        $(NODIST_GENERATED_FILES)       \
        Makefile.in
 
+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
+
 #
 # Build "wireshark-tap-register.c", which contains a function
 # "register_all_tap_listeners()"
index 24428a020f7c970a58dbfbb82d8ecc2013a449cb..469850ca1e099ef43d47faca257f342de50e068c 100644 (file)
@@ -49,7 +49,6 @@ 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    \
@@ -180,10 +179,6 @@ MOC_HDRS = \
        export_dissection_dialog.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 \
@@ -302,7 +297,6 @@ 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      \
@@ -451,10 +445,6 @@ WIRESHARK_QT_SRC = \
        export_dissection_dialog.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       \
index 5e9258b9df66d63679a725b6afe4657c8bd28608..8752e385f36bc032ccabffcddfb7b4e1d131ed10 100644 (file)
@@ -119,6 +119,7 @@ const QString AboutDialog::plugins_scan()
                 .arg(short_file);
     }
 
+#ifdef HAVE_EXTCAP
     GHashTable * tools = extcap_tools_list();
     if (tools && g_hash_table_size(tools) > 0) {
         QString short_file;
@@ -136,6 +137,7 @@ const QString AboutDialog::plugins_scan()
             walker = g_list_next(walker);
         }
     }
+#endif
 
     return plugin_table;
 }
index b696e09df9ab81eae41a4bca9e721d955779e7ac..5095a984f01002a83231ff3fca42be010a731083 100644 (file)
@@ -159,7 +159,7 @@ void InterfaceTree::display()
 {
 #ifdef HAVE_LIBPCAP
     interface_t device;
-#if HAVE_EXTCAP
+#ifdef HAVE_EXTCAP
     QIcon extcap_icon(StockIcon("x-capture-options"));
 #endif
 
@@ -209,7 +209,7 @@ void InterfaceTree::display()
 
         ti->setData(IFTREE_COL_NAME, Qt::UserRole, QString(device.name));
         ti->setData(IFTREE_COL_STATS, Qt::UserRole, qVariantFromValue(&ti->points));
-#if HAVE_EXTCAP
+#ifdef HAVE_EXTCAP
         if (device.if_info.type == IF_EXTCAP) {
             if (extcap_has_configuration((const char *)(device.name), FALSE)) {
                 ti->setIcon(IFTREE_COL_EXTCAP, extcap_icon);
@@ -248,7 +248,7 @@ void InterfaceTree::display()
     resizeColumnToContents(IFTREE_COL_NAME);
     resizeColumnToContents(IFTREE_COL_STATS);
 
-#if HAVE_EXTCAP
+#ifdef HAVE_EXTCAP
     resizeColumnToContents(IFTREE_COL_EXTCAP);
 #endif
 
index decba6a92970cc8983773b427008662406f6b641..62c76d90fd9a01df6fc60e9d739ed1ba36fa13ce 100644 (file)
@@ -41,7 +41,7 @@ typedef QList<int> PointList;
 
 enum InterfaceTreeColumns
 {
-#if HAVE_EXTCAP
+#ifdef HAVE_EXTCAP
     IFTREE_COL_EXTCAP,
 #endif
     IFTREE_COL_NAME,
index 263fde5f49eba37a27ada9eb289342c7f19beab7..696f681204795e376f1ac4cab3ab9318c80f3b24 100644 (file)
@@ -53,7 +53,7 @@
 #define VERSION_FLAVOR ""
 #endif
 
-#if HAVE_EXTCAP
+#ifdef HAVE_EXTCAP
 #include <extcap.h>
 #endif
 
@@ -165,7 +165,7 @@ MainWelcome::MainWelcome(QWidget *parent) :
     connect(wsApp, SIGNAL(appInitialized()), this, SLOT(appInitialized()));
     connect(welcome_ui_->interfaceTree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),
             this, SLOT(interfaceDoubleClicked(QTreeWidgetItem*,int)));
-#if HAVE_EXTCAP
+#ifdef HAVE_EXTCAP
     connect(welcome_ui_->interfaceTree, SIGNAL(itemClicked(QTreeWidgetItem*,int)),
             this, SLOT(interfaceClicked(QTreeWidgetItem*,int)));
 #endif
@@ -306,7 +306,7 @@ void MainWelcome::interfaceSelected()
 void MainWelcome::interfaceDoubleClicked(QTreeWidgetItem *item, int)
 {
     if (item) {
-#if HAVE_EXTCAP
+#ifdef HAVE_EXTCAP
         QString extcap_string = QVariant(item->data(IFTREE_COL_EXTCAP, Qt::UserRole)).toString();
         /* We trust the string here. If this interface is really extcap, the string is
          * being checked immediatly before the dialog is being generated */
@@ -323,9 +323,9 @@ void MainWelcome::interfaceDoubleClicked(QTreeWidgetItem *item, int)
     }
 }
 
+#ifdef HAVE_EXTCAP
 void MainWelcome::interfaceClicked(QTreeWidgetItem *item, int column)
 {
-#if HAVE_EXTCAP
     if (column == IFTREE_COL_EXTCAP) {
         QString extcap_string = QVariant(item->data(IFTREE_COL_EXTCAP, Qt::UserRole)).toString();
         /* We trust the string here. If this interface is really extcap, the string is
@@ -335,8 +335,8 @@ void MainWelcome::interfaceClicked(QTreeWidgetItem *item, int column)
             emit showExtcapOptions(device_name);
         }
     }
-#endif
 }
+#endif
 
 void MainWelcome::updateRecentFiles() {
     QString itemLabel;
index d6d7f13c84ea3519e344bfa2ce05e2e225b5f879..1c142cc1eb21f562444e48c91a92a3f496e33085 100644 (file)
@@ -68,7 +68,7 @@ signals:
     void pushFilterSyntaxStatus(const QString&);
     void popFilterSyntaxStatus();
     void captureFilterSyntaxChanged(bool valid);
-#if HAVE_EXTCAP
+#ifdef HAVE_EXTCAP
     void showExtcapOptions(QString &device_name);
 #endif
 
@@ -78,7 +78,7 @@ public slots:
 private slots:
     void appInitialized();
     void captureFilterTextEdited(const QString capture_filter);
-#if HAVE_EXTCAP
+#ifdef HAVE_EXTCAP
     void interfaceClicked(QTreeWidgetItem *item, int column);
 #endif
     void interfaceDoubleClicked(QTreeWidgetItem *item, int column);
index e604c5c708147a891de01e700a926cb6d2292326..8789776c2cf1ea718f215fc3cfbb45d85af86f2c 100644 (file)
@@ -646,7 +646,7 @@ MainWindow::MainWindow(QWidget *parent) :
     connect(main_ui_->welcomePage, SIGNAL(captureFilterSyntaxChanged(bool)),
             this, SLOT(captureFilterSyntaxChanged(bool)));
 
-#if HAVE_EXTCAP
+#ifdef HAVE_EXTCAP
         connect(this->main_welcome_, SIGNAL(showExtcapOptions(QString&)),
                 this, SLOT(showExtcapOptionsDialog(QString&)));
 #endif
index c13dab5cc4492dc9e0dc70ee934168ff8bb1d7de..88f0c074e6584521d33d5a1b932d39dd85867540 100644 (file)
@@ -608,7 +608,7 @@ private slots:
 
     void changeEvent(QEvent* event);
 
-#if HAVE_EXTCAP
+#ifdef HAVE_EXTCAP
     void extcap_options_finished(int result);
     void showExtcapOptionsDialog(QString & device_name);
 #endif
index ba179977f98d632d21a1ffc05c2a9f023be53795..7bed427c2bc949a1f723b169345ffc4c0b0fd247 100644 (file)
@@ -96,7 +96,7 @@
 #include "expert_info_dialog.h"
 #include "export_object_dialog.h"
 #include "export_pdu_dialog.h"
-#if HAVE_EXTCAP
+#ifdef HAVE_EXTCAP
 #include "extcap_options_dialog.h"
 #endif
 #include "filter_action.h"