aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2017-12-11 11:29:07 +0100
committerMichael Mann <mmann78@netscape.net>2017-12-11 16:49:20 +0000
commit51300b3c834a3877d567fb57ae78ec74ec8ba80d (patch)
treeab9b81f4e235bf054ac9a4db799753f48d5fcbca
parentc9546dfceb778dcabe7a830272add62e6ae1403e (diff)
fix compilation without pcap.
Fix a regression introduced by I09beab751c9c2917f017b6c082166d86ca693544. Change-Id: I57b971086470e836f4147500143c35494118e754 Reviewed-on: https://code.wireshark.org/review/24765 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--capture_opts.c15
-rw-r--r--ui/iface_lists.c6
-rw-r--r--ui/iface_lists.h14
-rw-r--r--wireshark-qt.cpp4
4 files changed, 30 insertions, 9 deletions
diff --git a/capture_opts.c b/capture_opts.c
index f7eb768..9e6991c 100644
--- a/capture_opts.c
+++ b/capture_opts.c
@@ -13,6 +13,10 @@
#include <stdio.h>
#include <stdlib.h>
+#if defined(HAVE_LIBPCAP) || defined(HAVE_EXTCAP)
+#include "capture_opts.h"
+#endif
+
#ifdef HAVE_LIBPCAP
#include <string.h>
@@ -21,7 +25,6 @@
#include <glib.h>
-#include "capture_opts.h"
#include "ringbuffer.h"
#include <wsutil/clopts_common.h>
@@ -34,8 +37,9 @@
#include "ui/filter_files.h"
static gboolean capture_opts_output_to_pipe(const char *save_file, gboolean *is_pipe);
+#endif
-
+#if defined(HAVE_LIBPCAP) || defined(HAVE_EXTCAP)
void
capture_opts_init(capture_options *capture_opts)
{
@@ -46,7 +50,9 @@ capture_opts_init(capture_options *capture_opts)
capture_opts->default_options.descr = NULL;
capture_opts->default_options.cfilter = NULL;
capture_opts->default_options.has_snaplen = FALSE;
+#ifdef HAVE_LIBPCAP
capture_opts->default_options.snaplen = WTAP_MAX_PACKET_SIZE_STANDARD;
+#endif
capture_opts->default_options.linktype = -1; /* use interface default */
capture_opts->default_options.promisc_mode = TRUE;
capture_opts->default_options.if_type = IF_WIRED;
@@ -103,8 +109,9 @@ capture_opts_init(capture_options *capture_opts)
capture_opts->has_file_interval = FALSE;
capture_opts->file_interval = 60; /* 1 min */
capture_opts->has_ring_num_files = FALSE;
+#ifdef HAVE_LIBPCAP
capture_opts->ring_num_files = RINGBUFFER_MIN_NUM_FILES;
-
+#endif
capture_opts->has_autostop_files = FALSE;
capture_opts->autostop_files = 1;
capture_opts->has_autostop_packets = FALSE;
@@ -118,7 +125,9 @@ capture_opts_init(capture_options *capture_opts)
capture_opts->output_to_pipe = FALSE;
capture_opts->capture_child = FALSE;
}
+#endif
+#ifdef HAVE_LIBPCAP
void
capture_opts_cleanup(capture_options *capture_opts)
{
diff --git a/ui/iface_lists.c b/ui/iface_lists.c
index e4294d2..965bb3f 100644
--- a/ui/iface_lists.c
+++ b/ui/iface_lists.c
@@ -414,17 +414,23 @@ fill_in_local_interfaces_worker(void *arg _U_)
g_async_queue_push(local_interface_done_q, GINT_TO_POINTER(TRUE));
return NULL;
}
+#endif
+#if defined(HAVE_LIBPCAP) || defined(HAVE_EXTCAP)
void
fill_in_local_interfaces_start(void)
{
+#ifdef HAVE_LIBPCAP
if (!local_interface_done_q) {
g_mutex_init(&global_capture_opts_mtx);
local_interface_done_q = g_async_queue_new();
}
local_if_thread = g_thread_new("fill_in_local_interfaces_worker", &fill_in_local_interfaces_worker, NULL);
+#endif
}
+#endif
+#ifdef HAVE_LIBPCAP
void
fill_in_local_interfaces_wait(void(*update_cb)(void))
{
diff --git a/ui/iface_lists.h b/ui/iface_lists.h
index 0c2738f..a0cfe62 100644
--- a/ui/iface_lists.h
+++ b/ui/iface_lists.h
@@ -12,6 +12,14 @@
extern "C" {
#endif /* __cplusplus */
+#if defined(HAVE_LIBPCAP) || defined(HAVE_EXTCAP)
+/*
+ * Update the global interface list in the background. Create it if we
+ * haven't done so already.
+ */
+extern void fill_in_local_interfaces_start(void);
+#endif
+
#ifdef HAVE_LIBPCAP
/*
* Used when sorting an interface list into alphabetical order by
@@ -25,12 +33,6 @@ extern gint if_list_comparator_alph(const void *first_arg, const void *second_ar
extern void scan_local_interfaces(void (*update_cb)(void));
/*
- * Update the global interface list in the background. Create it if we
- * haven't done so already.
- */
-extern void fill_in_local_interfaces_start(void);
-
-/*
* Wait for the global interface list creation to finish.
*/
extern void fill_in_local_interfaces_wait(void(*update_cb)(void));
diff --git a/wireshark-qt.cpp b/wireshark-qt.cpp
index 360ad10..26c5200 100644
--- a/wireshark-qt.cpp
+++ b/wireshark-qt.cpp
@@ -96,6 +96,10 @@
#include "caputils/capture-pcap-util.h"
+#if defined(HAVE_LIBPCAP) || defined(HAVE_EXTCAP)
+#include "ui/capture_globals.h"
+#endif
+
#include <QMessageBox>
#ifdef _WIN32