summaryrefslogtreecommitdiff
path: root/capture_sync.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-05-13 17:37:39 +0000
committerGuy Harris <guy@alum.mit.edu>2010-05-13 17:37:39 +0000
commit1c18115bd3e8a0b1a56ab8effcf5843240bde0c6 (patch)
tree29698446c6b8deeebed235c4337365c42d7d3f4a /capture_sync.c
parent951485bf355f1e9269bf62803190931618d7a047 (diff)
downloadwireshark-1c18115bd3e8a0b1a56ab8effcf5843240bde0c6.tar.gz
Fetch an indication of whether the interface supports capturing in
monitor mode at the same time that we fetch its list of link-layer types. Support fetching that list in monitor mode, as the list may be different in regular and monitor mode. If the interface supports monitor mode, when printing the list of link-layer types, indicate whether they're fetched in monitor mode or not, as tcpdump 4.1.x does. svn path=/trunk/; revision=32789
Diffstat (limited to 'capture_sync.c')
-rw-r--r--capture_sync.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/capture_sync.c b/capture_sync.c
index 6fe6fd1fc9..f412c4e51a 100644
--- a/capture_sync.c
+++ b/capture_sync.c
@@ -889,13 +889,15 @@ sync_interface_list_open(gchar **msg) {
}
/*
- * Get an linktype list using dumpcap. On success, *msg points to
+ * Get interface capabilities using dumpcap. On success, *msg points to
* a buffer containing the dumpcap output, and 0 is returned. On failure,
* *msg points to an error message, and -1 is returned. In either case,
* *msg must be freed with g_free().
*/
int
-sync_linktype_list_open(const gchar *ifname, gchar **msg) {
+sync_if_capabilities_open(const gchar *ifname, gboolean monitor_mode,
+ gchar **msg)
+{
int argc;
const char **argv;
@@ -913,10 +915,12 @@ sync_linktype_list_open(const gchar *ifname, gchar **msg) {
return -1;
}
- /* Ask for the linktype list */
+ /* Ask for the interface capabilities */
argv = sync_pipe_add_arg(argv, &argc, "-i");
argv = sync_pipe_add_arg(argv, &argc, ifname);
argv = sync_pipe_add_arg(argv, &argc, "-L");
+ if (monitor_mode)
+ argv = sync_pipe_add_arg(argv, &argc, "-I");
argv = sync_pipe_add_arg(argv, &argc, "-M");
#if 0