diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-05-13 17:37:39 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-05-13 17:37:39 +0000 |
commit | 9e5388ff1f5ae33a39dcc1cf2c1616bc30200fa0 (patch) | |
tree | 29698446c6b8deeebed235c4337365c42d7d3f4a /capture_opts.c | |
parent | 299f76cdbac5a6adc30ce6610c6850b6210b265e (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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32789 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'capture_opts.c')
-rw-r--r-- | capture_opts.c | 13 |
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); |