aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
diff options
context:
space:
mode:
authortuexen <tuexen@f5534014-38df-0310-8fa8-9805f1628bb7>2011-05-16 14:12:35 +0000
committertuexen <tuexen@f5534014-38df-0310-8fa8-9805f1628bb7>2011-05-16 14:12:35 +0000
commit10ed59226c20f7563d1ad17eb33adfa50c4d9c6b (patch)
treef986087dc05ce2788a7ec94da26fc77cec6dfcff /dumpcap.c
parent581c4fa21e6cb4675c278cf1cf46cd06ff6766f3 (diff)
Make pcap samping a per interface setting.
Use consistent naming of variables on capture_options. Make pcap sampling independent of remote capturing, since it seems to work local pcap devices using winpcap (at least that is what the documentation says). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37176 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 04c8838709..fac1f58025 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -2266,13 +2266,12 @@ capture_loop_open_input(capture_options *capture_opts, loop_data *ld,
}
#endif
-#if defined(HAVE_PCAP_REMOTE) && defined(HAVE_PCAP_SETSAMPLING)
- if ((capture_opts->sampling_method != CAPTURE_SAMP_NONE) &&
- (strncmp (interface_opts.name, "rpcap://", 8) == 0)) {
+#if defined(HAVE_PCAP_SETSAMPLING)
+ if (interface_opts.sampling_method != CAPTURE_SAMP_NONE) {
struct pcap_samp *samp;
if ((samp = pcap_setsampling(pcap_opts.pcap_h)) != NULL) {
- switch (capture_opts->sampling_method) {
+ switch (interface_opts.sampling_method) {
case CAPTURE_SAMP_BY_COUNT:
samp->method = PCAP_SAMP_1_EVERY_N;
break;
@@ -2285,12 +2284,12 @@ capture_loop_open_input(capture_options *capture_opts, loop_data *ld,
sync_msg_str = g_strdup_printf(
"Unknown sampling method %d specified,\n"
"continue without packet sampling",
- capture_opts->sampling_method);
+ interface_opts->sampling_method);
report_capture_error("Couldn't set the capture "
"sampling", sync_msg_str);
g_free(sync_msg_str);
}
- samp->value = capture_opts->sampling_param;
+ samp->value = interface_opts->sampling_param;
} else {
report_capture_error("Couldn't set the capture sampling",
"Cannot get packet sampling data structure");