aboutsummaryrefslogtreecommitdiffstats
path: root/capture_sync.c
diff options
context:
space:
mode:
authorTomas Kukosa <tomas.kukosa@siemens.com>2007-12-04 11:19:29 +0000
committerTomas Kukosa <tomas.kukosa@siemens.com>2007-12-04 11:19:29 +0000
commit08bbd29c71b8068e419f95a7a8cb7332ef0a3a3d (patch)
treef0bdb59e0947e9cfeac882b6b58a4753af6511be /capture_sync.c
parent48537a7a6505e68faadbed9837a4159c2758d442 (diff)
Support for RPCAP features in GUI (from Boris Misenov, see Bug 1366)
- retrieving the list of remote PCAP interfaces - password authentication support - UDP data fransfer - packet sampling (available in WinPcap 4.x) etc. fix problem if non-default rpcap port is used svn path=/trunk/; revision=23750
Diffstat (limited to 'capture_sync.c')
-rw-r--r--capture_sync.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/capture_sync.c b/capture_sync.c
index d07f8a6151..b2cc825dd5 100644
--- a/capture_sync.c
+++ b/capture_sync.c
@@ -251,6 +251,12 @@ sync_pipe_start(capture_options *capture_opts) {
char sautostop_files[ARGV_NUMBER_LEN];
char sautostop_filesize[ARGV_NUMBER_LEN];
char sautostop_duration[ARGV_NUMBER_LEN];
+#ifdef HAVE_PCAP_REMOTE
+ char sauth[256];
+#endif
+#ifdef HAVE_PCAP_SETSAMPLING
+ char ssampling[ARGV_NUMBER_LEN];
+#endif
#ifdef _WIN32
char buffer_size[ARGV_NUMBER_LEN];
HANDLE sync_pipe_read; /* pipe used to send messages from child to parent */
@@ -352,6 +358,33 @@ sync_pipe_start(capture_options *capture_opts) {
if (!capture_opts->promisc_mode)
argv = sync_pipe_add_arg(argv, &argc, "-p");
+#ifdef HAVE_PCAP_REMOTE
+ if (capture_opts->datatx_udp)
+ argv = sync_pipe_add_arg(argv, &argc, "-u");
+
+ if (!capture_opts->nocap_rpcap)
+ argv = sync_pipe_add_arg(argv, &argc, "-r");
+
+ if (capture_opts->auth_type == CAPTURE_AUTH_PWD)
+ {
+ argv = sync_pipe_add_arg(argv, &argc, "-A");
+ g_snprintf(sauth, sizeof(sauth), "%s:%s", capture_opts->auth_username,
+ capture_opts->auth_password);
+ argv = sync_pipe_add_arg(argv, &argc, sauth);
+ }
+#endif
+#ifdef HAVE_PCAP_SETSAMPLING
+ if (capture_opts->sampling_method != CAPTURE_SAMP_NONE)
+ {
+ argv = sync_pipe_add_arg(argv, &argc, "-m");
+ g_snprintf(ssampling, ARGV_NUMBER_LEN, "%s:%d",
+ capture_opts->sampling_method == CAPTURE_SAMP_BY_COUNT ? "count" :
+ capture_opts->sampling_method == CAPTURE_SAMP_BY_TIMER ? "timer" :
+ "undef",
+ capture_opts->sampling_param);
+ argv = sync_pipe_add_arg(argv, &argc, ssampling);
+ }
+#endif
/* dumpcap should be running in capture child mode (hidden feature) */
#ifndef DEBUG_CHILD