aboutsummaryrefslogtreecommitdiffstats
path: root/capture_opts.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_opts.c
parent951485bf355f1e9269bf62803190931618d7a047 (diff)
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_opts.c')
-rw-r--r--capture_opts.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/capture_opts.c b/capture_opts.c
index 96bec3c9af..23297b60eb 100644
--- a/capture_opts.c
+++ b/capture_opts.c
@@ -81,9 +81,7 @@ capture_opts_init(capture_options *capture_opts, void *cf)
capture_opts->snaplen = WTAP_MAX_PACKET_SIZE; /* snapshot length - default is
infinite, in effect */
capture_opts->promisc_mode = TRUE; /* promiscuous mode is the default */
-#ifdef HAVE_PCAP_CREATE
capture_opts->monitor_mode = FALSE;
-#endif
capture_opts->linktype = -1; /* the default linktype */
capture_opts->saving_to_file = FALSE;
capture_opts->save_file = NULL;
@@ -549,13 +547,18 @@ capture_opts_add_opt(capture_options *capture_opts, int opt, const char *optarg_
}
void
-capture_opts_print_link_layer_types(GList *lt_list)
+capture_opts_print_if_capabilities(if_capabilities_t *caps,
+ gboolean monitor_mode)
{
GList *lt_entry;
data_link_info_t *data_link_info;
- fprintf_stderr("Data link types (use option -y to set):\n");
- for (lt_entry = lt_list; lt_entry != NULL;
+ if (caps->can_set_rfmon)
+ fprintf_stderr("Data link types when %sin monitor mode (use option -y to set):\n",
+ monitor_mode ? "" : "not ");
+ else
+ fprintf_stderr("Data link types (use option -y to set):\n");
+ for (lt_entry = caps->data_link_types; lt_entry != NULL;
lt_entry = g_list_next(lt_entry)) {
data_link_info = (data_link_info_t *)lt_entry->data;
fprintf_stderr(" %s", data_link_info->name);