Search Linux Wireless

[PATCH] iw: scan: Improved handling of Country String environment values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The third octet in Country String (dot11CountryString) can be a reference
to one of the tables defined in IEEE 802.11 Annex E. The hexadecimal value
directly corresponds to a table with the same number.

Also added handling for non-country entity and hexadecimal printout of all
values for enhanced clarity.

Signed-off-by: Taavi Eomäe <taaviw@xxxxxxxxx>

---
 scan.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/scan.c b/scan.c
index faf406d..85798b8 100644
--- a/scan.c
+++ b/scan.c
@@ -661,10 +661,24 @@ static const char *country_env_str(char environment)
         return "Indoor only";
     case 'O':
         return "Outdoor only";
+    case 'X':
+        return "Non-country";
     case ' ':
         return "Indoor/Outdoor";
+    case 0x01:
+        return "Operating classes table E-1 (United States)";
+    case 0x02:
+        return "Operating classes table E-2 (Europe)";
+    case 0x03:
+        return "Operating classes table E-3 (Japan)";
+    case 0x04:
+        return "Operating classes table E-4 (Global)";
+    case 0x05:
+        return "Operating classes table E-5 (S1G)";
+    case 0x06:
+        return "Operating classes table E-6 (China)";
     default:
-        return "bogus";
+        return "Bogus";
     }
 }

@@ -673,7 +687,7 @@ static void print_country(const uint8_t type, uint8_t len, const uint8_t *data,
 {
     printf(" %.*s", 2, data);

-    printf("\tEnvironment: %s\n", country_env_str(data[2]));
+    printf("\tEnvironment: %s (%#.2x)\n", country_env_str(data[2]), data[2]);

     data += 3;
     len -= 3;
--
2.40.1






[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux