summaryrefslogtreecommitdiff
path: root/dumpcap.c
diff options
context:
space:
mode:
authorMikael Kanstrup <mikael.kanstrup@gmail.com>2016-02-07 00:40:51 +0100
committerMichael Mann <mmann78@netscape.net>2016-03-01 15:23:44 +0000
commit9f27e5d7d19027ddf8f29c5a6a321912e7c2f9dd (patch)
treedf58180c18aa9d7c05086ac41d2beb445fcc8590 /dumpcap.c
parent7a1f75ed2f91f212317902020ab762ebaa3098ad (diff)
downloadwireshark-9f27e5d7d19027ddf8f29c5a6a321912e7c2f9dd.tar.gz
dumpcap: Add support for 802.11ac monitor modes
Add dumpcap support for configuring 80MHz, 80+80MHz, 160MHz monitor modes via nl80211. Change-Id: I2ae8955670c2a9b5051e2223d45ce522459f2c5f Reviewed-on: https://code.wireshark.org/review/13964 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 1783a4c6c6..4d91d3c6ab 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -486,7 +486,8 @@ print_usage(FILE *output)
#ifdef HAVE_BPF_IMAGE
fprintf(output, " -d print generated BPF code for capture filter\n");
#endif
- fprintf(output, " -k set channel on wifi interface <freq>,[<type>]\n");
+ fprintf(output, " -k set channel on wifi interface:\n"
+ " <freq>,[<type>],[<center_freq1>],[<center_freq2>]\n");
fprintf(output, " -S print statistics for each interface once per second\n");
fprintf(output, " -M for -D, -L, and -S, produce machine-readable output\n");
fprintf(output, "\n");
@@ -3648,23 +3649,33 @@ capture_loop_queue_packet_cb(u_char *pcap_opts_p, const struct pcap_pkthdr *phdr
static int
set_80211_channel(const char *iface, const char *opt)
{
- int freq = 0, type, ret;
+ int freq = 0;
+ int type = -1;
+ int center_freq1 = -1;
+ int center_freq2 = -1;
+ int args;
+ int ret;
gchar **options = NULL;
- options = g_strsplit_set(opt, ",", 2);
+ options = g_strsplit_set(opt, ",", 4);
+ for (args = 0; options[args]; args++);
if (options[0])
freq = atoi(options[0]);
- if (options[1]) {
+ if (args >= 1 && options[1]) {
type = ws80211_str_to_chan_type(options[1]);
if (type == -1) {
ret = EINVAL;
goto out;
}
}
- else
- type = -1;
+
+ if (args >= 2 && options[2])
+ center_freq1 = atoi(options[2]);
+
+ if (args >= 3 && options[3])
+ center_freq2 = atoi(options[3]);
ret = ws80211_init();
if (ret) {
@@ -3672,7 +3683,7 @@ set_80211_channel(const char *iface, const char *opt)
ret = 2;
goto out;
}
- ret = ws80211_set_freq(iface, freq, type);
+ ret = ws80211_set_freq(iface, freq, type, center_freq1, center_freq2);
if (ret) {
cmdarg_err("%d: Failed to set channel: %s\n", abs(ret), g_strerror(abs(ret)));