aboutsummaryrefslogtreecommitdiffstats
path: root/capchild
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2018-01-06 21:39:26 +0100
committerAnders Broman <a.broman58@gmail.com>2018-01-08 05:50:15 +0000
commite80b40adbe823be084fb49cd84336939916120bb (patch)
treed712734b953f7df6f1f79519c7abc73029152e1d /capchild
parent6f93baced0fba7d07425e14ea698f4607964c6ed (diff)
extcap: remove conditional compilation.
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>
Diffstat (limited to 'capchild')
-rw-r--r--capchild/capture_ifinfo.c22
-rw-r--r--capchild/capture_sync.c11
2 files changed, 0 insertions, 33 deletions
diff --git a/capchild/capture_ifinfo.c b/capchild/capture_ifinfo.c
index 0fd61a0dba..44340b588d 100644
--- a/capchild/capture_ifinfo.c
+++ b/capchild/capture_ifinfo.c
@@ -34,9 +34,7 @@
#include "capchild/capture_session.h"
#include "capchild/capture_sync.h"
-#ifdef HAVE_EXTCAP
#include "extcap.h"
-#endif
#include "log.h"
#include <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,
diff --git a/capchild/capture_sync.c b/capchild/capture_sync.c
index 43fc2ac173..1588a5648e 100644
--- a/capchild/capture_sync.c
+++ b/capchild/capture_sync.c
@@ -91,9 +91,7 @@
#include <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;