diff options
author | Ansuel Smith <ansuelsmth@gmail.com> | 2020-12-06 02:11:15 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2021-01-05 22:19:42 +0000 |
commit | ea28dfb5f9578294919ca4087f281cbdd45f68a9 (patch) | |
tree | c07718e2d1ed5775d263b3cc5c90eae0a6193ea2 /iwinfo_cli.c | |
parent | a17f5613c3622c85a7c8ab7db0e16be504cfff2a (diff) | |
download | iwinfo-ea28dfb5f9578294919ca4087f281cbdd45f68a9.tar.gz |
iwinfo: export ht and vht operation in scan results
Export ht and vht operation data in scan results. These additional data
can be usefull to check wifi channel utilizzation by neraby stations.
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Diffstat (limited to 'iwinfo_cli.c')
-rw-r--r-- | iwinfo_cli.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/iwinfo_cli.c b/iwinfo_cli.c index 0332bc2..ca003c4 100644 --- a/iwinfo_cli.c +++ b/iwinfo_cli.c @@ -323,6 +323,20 @@ static char * format_assocrate(struct iwinfo_rate_entry *r) return buf; } +static const char* format_chan_width(uint16_t width) +{ + switch (width) { + case 20: return "20 MHz"; + case 2040: return "40 MHz and upper or 20 MHz with intolerant bit"; + case 40: return "40 MHz or lower"; + case 80: return "80 MHz"; + case 8080: return "80+80 MHz"; + case 160: return "160 MHz"; + } + + return "unknown"; +} + static const char * print_type(const struct iwinfo_ops *iw, const char *ifname) { @@ -612,8 +626,27 @@ static void print_scanlist(const struct iwinfo_ops *iw, const char *ifname) format_signal(e->signal - 0x100), format_quality(e->quality), format_quality_max(e->quality_max)); - printf(" Encryption: %s\n\n", + printf(" Encryption: %s\n", format_encryption(&e->crypto)); + printf(" HT Operation:\n"); + printf(" Primary Channel: %d\n", + e->ht_chan_info.primary_chan); + printf(" Secondary Channel Offset: %s\n", + ht_secondary_offset[e->ht_chan_info.secondary_chan_off]); + printf(" Channel Width: %s\n", + format_chan_width(e->ht_chan_info.chan_width)); + + if (e->vht_chan_info.center_chan_1) { + printf(" VHT Operation:\n"); + printf(" Channel Width: %s\n", + format_chan_width(e->vht_chan_info.chan_width)); + printf(" Center Frequency 1: %d\n", + e->vht_chan_info.center_chan_1); + printf(" Center Frequency 2: %d\n", + e->vht_chan_info.center_chan_2); + } + + printf("\n"); } } |