Make HAVE_PCAP_REMOTE and HAVE_PCAP_SETSAMPLING independent

as in other places of the code. Such that this is consistently
used. While there, clean up some whitespaces.

This fix was provided by Irene Ruengeler which testing
remote capturing (with multiple interfaces).

svn path=/trunk/; revision=36112
This commit is contained in:
Michael Tüxen 2011-03-01 17:29:09 +00:00
parent 3fac9089cb
commit 5da016099a
2 changed files with 35 additions and 36 deletions

View File

@ -69,11 +69,11 @@ capture_opts_init(capture_options *capture_opts, void *cf)
capture_opts->datatx_udp = FALSE;
capture_opts->nocap_rpcap = TRUE;
capture_opts->nocap_local = FALSE;
#endif
#ifdef HAVE_PCAP_SETSAMPLING
capture_opts->sampling_method = CAPTURE_SAMP_NONE;
capture_opts->sampling_param = 0;
#endif
#endif
#if defined(_WIN32) || defined(HAVE_PCAP_CREATE)
capture_opts->buffer_size = 1; /* 1 MB */
#endif

View File

@ -57,7 +57,7 @@ typedef enum {
CAPTURE_AUTH_NULL, /**< No authentication */
CAPTURE_AUTH_PWD /**< User/password authentication */
} capture_auth;
#endif
#ifdef HAVE_PCAP_SETSAMPLING
/**
* Method of packet sampling (dropping some captured packets),
@ -72,7 +72,6 @@ typedef enum {
in N milliseconds */
} capture_sampling;
#endif
#endif
/** Capture options coming from user interface */
typedef struct capture_options_tag {
@ -101,11 +100,11 @@ typedef struct capture_options_tag {
gboolean datatx_udp; /**< Whether to use UDP for data transfer */
gboolean nocap_rpcap; /**< Whether to capture RPCAP own traffic */
gboolean nocap_local; /**< TODO: Whether to capture local traffic */
#endif
#ifdef HAVE_PCAP_SETSAMPLING
capture_sampling sampling_method; /**< PCAP packet sampling method */
int sampling_param; /**< PCAP packet sampling parameter */
#endif
#endif
#if defined(_WIN32) || defined(HAVE_PCAP_CREATE)
int buffer_size; /**< the capture buffer size (MB) */
#endif