1#!/usr/bin/env python3 2# 3# Copyright 2017 - Google 4# 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16 17import itertools 18 19from enum import Enum, auto, unique 20 21BAND_2G = '2g' 22BAND_5G = '5g' 23CHANNEL_BANDWIDTH_20MHZ = 20 24CHANNEL_BANDWIDTH_40MHZ = 40 25CHANNEL_BANDWIDTH_80MHZ = 80 26CHANNEL_BANDWIDTH_160MHZ = 160 27WEP = 0 28WPA1 = 1 29WPA2 = 2 30WPA3 = 2 # same as wpa2 and wpa2/wpa3, distinguished by wpa_key_mgmt 31MIXED = 3 # applies to wpa/wpa2, and wpa/wpa2/wpa3, distinquished by wpa_key_mgmt 32ENT = 4 # get the correct constant 33MAX_WPA_PSK_LENGTH = 64 34MIN_WPA_PSK_LENGTH = 8 35MAX_WPA_PASSWORD_LENGTH = 63 36WPA_STRICT_REKEY = 1 37WPA_DEFAULT_CIPHER = 'TKIP' 38WPA2_DEFAULT_CIPER = 'CCMP' 39WPA_GROUP_KEY_ROTATION_TIME = 600 40WPA_STRICT_REKEY_DEFAULT = True 41WEP_STRING = 'wep' 42WPA_STRING = 'wpa' 43WPA2_STRING = 'wpa2' 44WPA_MIXED_STRING = 'wpa/wpa2' 45WPA3_STRING = 'wpa3' 46WPA2_WPA3_MIXED_STRING = 'wpa2/wpa3' 47WPA_WPA2_WPA3_MIXED_STRING = 'wpa/wpa2/wpa3' 48ENT_STRING = 'ent' 49ENT_KEY_MGMT = 'WPA-EAP' 50WPA_PSK_KEY_MGMT = 'WPA-PSK' 51SAE_KEY_MGMT = 'SAE' 52DUAL_WPA_PSK_SAE_KEY_MGMT = 'WPA-PSK SAE' 53SECURITY_STRING_TO_SECURITY_MODE_INT = { 54 WPA_STRING: WPA1, 55 WPA2_STRING: WPA2, 56 WPA_MIXED_STRING: MIXED, 57 WPA3_STRING: WPA3, 58 WPA2_WPA3_MIXED_STRING: WPA3, 59 WPA_WPA2_WPA3_MIXED_STRING: MIXED, 60 WEP_STRING: WEP, 61 ENT_STRING: ENT 62} 63SECURITY_STRING_TO_WPA_KEY_MGMT = { 64 WPA_STRING: WPA_PSK_KEY_MGMT, 65 WPA2_STRING: WPA_PSK_KEY_MGMT, 66 WPA_MIXED_STRING: WPA_PSK_KEY_MGMT, 67 WPA3_STRING: SAE_KEY_MGMT, 68 WPA2_WPA3_MIXED_STRING: DUAL_WPA_PSK_SAE_KEY_MGMT, 69 WPA_WPA2_WPA3_MIXED_STRING: DUAL_WPA_PSK_SAE_KEY_MGMT 70} 71WPA3_MODE_STRINGS = { 72 WPA3_STRING, WPA2_WPA3_MIXED_STRING, WPA_WPA2_WPA3_MIXED_STRING 73} 74 75SECURITY_STRING_TO_DEFAULT_TARGET_SECURITY = { 76 WEP_STRING: WEP_STRING, 77 WPA_STRING: WPA_STRING, 78 WPA2_STRING: WPA2_STRING, 79 WPA_MIXED_STRING: WPA2_STRING, 80 WPA3_STRING: WPA3_STRING, 81 WPA2_WPA3_MIXED_STRING: WPA3_STRING, 82 WPA_WPA2_WPA3_MIXED_STRING: WPA3_STRING 83} 84 85IEEE8021X = 1 86WLAN0_STRING = 'wlan0' 87WLAN1_STRING = 'wlan1' 88WLAN2_STRING = 'wlan2' 89WLAN3_STRING = 'wlan3' 90WLAN0_GALE = 'wlan-2400mhz' 91WLAN1_GALE = 'wlan-5000mhz' 92WEP_DEFAULT_KEY = 0 93WEP_HEX_LENGTH = [10, 26, 32, 58] 94WEP_STR_LENGTH = [5, 13, 16] 95WEP_DEFAULT_STR_LENGTH = 13 96AP_DEFAULT_CHANNEL_2G = 6 97AP_DEFAULT_CHANNEL_5G = 36 98AP_DEFAULT_MAX_SSIDS_2G = 8 99AP_DEFAULT_MAX_SSIDS_5G = 8 100AP_SSID_LENGTH_2G = 8 101AP_SSID_MIN_LENGTH_2G = 1 102AP_SSID_MAX_LENGTH_2G = 32 103AP_PASSPHRASE_LENGTH_2G = 10 104AP_SSID_LENGTH_5G = 8 105AP_SSID_MIN_LENGTH_5G = 1 106AP_SSID_MAX_LENGTH_5G = 32 107AP_PASSPHRASE_LENGTH_5G = 10 108INTERFACE_2G_LIST = [WLAN0_STRING, WLAN0_GALE] 109INTERFACE_5G_LIST = [WLAN1_STRING, WLAN1_GALE] 110HIGH_BEACON_INTERVAL = 300 111LOW_BEACON_INTERVAL = 100 112HIGH_DTIM = 3 113LOW_DTIM = 1 114 115# A mapping of frequency to channel number. This includes some 116# frequencies used outside the US. 117CHANNEL_MAP = { 118 2412: 1, 119 2417: 2, 120 2422: 3, 121 2427: 4, 122 2432: 5, 123 2437: 6, 124 2442: 7, 125 2447: 8, 126 2452: 9, 127 2457: 10, 128 2462: 11, 129 # 12, 13 are only legitimate outside the US. 130 2467: 12, 131 2472: 13, 132 # 14 is for Japan, DSSS and CCK only. 133 2484: 14, 134 # 34 valid in Japan. 135 5170: 34, 136 # 36-116 valid in the US, except 38, 42, and 46, which have 137 # mixed international support. 138 5180: 36, 139 5190: 38, 140 5200: 40, 141 5210: 42, 142 5220: 44, 143 5230: 46, 144 5240: 48, 145 # DFS channels. 146 5260: 52, 147 5280: 56, 148 5300: 60, 149 5320: 64, 150 5500: 100, 151 5520: 104, 152 5540: 108, 153 5560: 112, 154 5580: 116, 155 # 120, 124, 128 valid in Europe/Japan. 156 5600: 120, 157 5620: 124, 158 5640: 128, 159 # 132+ valid in US. 160 5660: 132, 161 5680: 136, 162 5700: 140, 163 # 144 is supported by a subset of WiFi chips 164 # (e.g. bcm4354, but not ath9k). 165 5720: 144, 166 # End DFS channels. 167 5745: 149, 168 5755: 151, 169 5765: 153, 170 5775: 155, 171 5795: 159, 172 5785: 157, 173 5805: 161, 174 5825: 165 175} 176FREQUENCY_MAP = {v: k for k, v in CHANNEL_MAP.items()} 177 178US_CHANNELS_2G = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] 179US_CHANNELS_5G = [ 180 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 181 132, 136, 140, 144, 149, 153, 157, 161, 165 182] 183 184LOWEST_5G_CHANNEL = 36 185 186MODE_11A = 'a' 187MODE_11B = 'b' 188MODE_11G = 'g' 189MODE_11N_MIXED = 'n-mixed' 190MODE_11N_PURE = 'n-only' 191MODE_11AC_MIXED = 'ac-mixed' 192MODE_11AC_PURE = 'ac-only' 193 194N_CAPABILITY_LDPC = object() 195N_CAPABILITY_HT20 = object() 196N_CAPABILITY_HT40_PLUS = object() 197N_CAPABILITY_HT40_MINUS = object() 198N_CAPABILITY_GREENFIELD = object() 199N_CAPABILITY_SGI20 = object() 200N_CAPABILITY_SGI40 = object() 201N_CAPABILITY_TX_STBC = object() 202N_CAPABILITY_RX_STBC1 = object() 203N_CAPABILITY_RX_STBC12 = object() 204N_CAPABILITY_RX_STBC123 = object() 205N_CAPABILITY_DSSS_CCK_40 = object() 206N_CAPABILITY_LSIG_TXOP_PROT = object() 207N_CAPABILITY_40_INTOLERANT = object() 208N_CAPABILITY_MAX_AMSDU_7935 = object() 209N_CAPABILITY_DELAY_BLOCK_ACK = object() 210N_CAPABILITY_SMPS_STATIC = object() 211N_CAPABILITY_SMPS_DYNAMIC = object() 212N_CAPABILITIES_MAPPING = { 213 N_CAPABILITY_LDPC: '[LDPC]', 214 N_CAPABILITY_HT20: '[HT20]', 215 N_CAPABILITY_HT40_PLUS: '[HT40+]', 216 N_CAPABILITY_HT40_MINUS: '[HT40-]', 217 N_CAPABILITY_GREENFIELD: '[GF]', 218 N_CAPABILITY_SGI20: '[SHORT-GI-20]', 219 N_CAPABILITY_SGI40: '[SHORT-GI-40]', 220 N_CAPABILITY_TX_STBC: '[TX-STBC]', 221 N_CAPABILITY_RX_STBC1: '[RX-STBC1]', 222 N_CAPABILITY_RX_STBC12: '[RX-STBC12]', 223 N_CAPABILITY_RX_STBC123: '[RX-STBC123]', 224 N_CAPABILITY_DSSS_CCK_40: '[DSSS_CCK-40]', 225 N_CAPABILITY_LSIG_TXOP_PROT: '[LSIG-TXOP-PROT]', 226 N_CAPABILITY_40_INTOLERANT: '[40-INTOLERANT]', 227 N_CAPABILITY_MAX_AMSDU_7935: '[MAX-AMSDU-7935]', 228 N_CAPABILITY_DELAY_BLOCK_ACK: '[DELAYED-BA]', 229 N_CAPABILITY_SMPS_STATIC: '[SMPS-STATIC]', 230 N_CAPABILITY_SMPS_DYNAMIC: '[SMPS-DYNAMIC]' 231} 232N_CAPABILITIES_MAPPING_INVERSE = { 233 v: k 234 for k, v in N_CAPABILITIES_MAPPING.items() 235} 236N_CAPABILITY_HT40_MINUS_CHANNELS = object() 237N_CAPABILITY_HT40_PLUS_CHANNELS = object() 238AC_CAPABILITY_VHT160 = object() 239AC_CAPABILITY_VHT160_80PLUS80 = object() 240AC_CAPABILITY_RXLDPC = object() 241AC_CAPABILITY_SHORT_GI_80 = object() 242AC_CAPABILITY_SHORT_GI_160 = object() 243AC_CAPABILITY_TX_STBC_2BY1 = object() 244AC_CAPABILITY_RX_STBC_1 = object() 245AC_CAPABILITY_RX_STBC_12 = object() 246AC_CAPABILITY_RX_STBC_123 = object() 247AC_CAPABILITY_RX_STBC_1234 = object() 248AC_CAPABILITY_SU_BEAMFORMER = object() 249AC_CAPABILITY_SU_BEAMFORMEE = object() 250AC_CAPABILITY_BF_ANTENNA_2 = object() 251AC_CAPABILITY_BF_ANTENNA_3 = object() 252AC_CAPABILITY_BF_ANTENNA_4 = object() 253AC_CAPABILITY_SOUNDING_DIMENSION_2 = object() 254AC_CAPABILITY_SOUNDING_DIMENSION_3 = object() 255AC_CAPABILITY_SOUNDING_DIMENSION_4 = object() 256AC_CAPABILITY_MU_BEAMFORMER = object() 257AC_CAPABILITY_MU_BEAMFORMEE = object() 258AC_CAPABILITY_VHT_TXOP_PS = object() 259AC_CAPABILITY_HTC_VHT = object() 260AC_CAPABILITY_MAX_A_MPDU_LEN_EXP0 = object() 261AC_CAPABILITY_MAX_A_MPDU_LEN_EXP1 = object() 262AC_CAPABILITY_MAX_A_MPDU_LEN_EXP2 = object() 263AC_CAPABILITY_MAX_A_MPDU_LEN_EXP3 = object() 264AC_CAPABILITY_MAX_A_MPDU_LEN_EXP4 = object() 265AC_CAPABILITY_MAX_A_MPDU_LEN_EXP5 = object() 266AC_CAPABILITY_MAX_A_MPDU_LEN_EXP6 = object() 267AC_CAPABILITY_MAX_A_MPDU_LEN_EXP7 = object() 268AC_CAPABILITY_VHT_LINK_ADAPT2 = object() 269AC_CAPABILITY_VHT_LINK_ADAPT3 = object() 270AC_CAPABILITY_RX_ANTENNA_PATTERN = object() 271AC_CAPABILITY_TX_ANTENNA_PATTERN = object() 272AC_CAPABILITY_MAX_MPDU_7991 = object() 273AC_CAPABILITY_MAX_MPDU_11454 = object() 274AC_CAPABILITIES_MAPPING = { 275 AC_CAPABILITY_VHT160: '[VHT160]', 276 AC_CAPABILITY_VHT160_80PLUS80: '[VHT160-80PLUS80]', 277 AC_CAPABILITY_RXLDPC: '[RXLDPC]', 278 AC_CAPABILITY_SHORT_GI_80: '[SHORT-GI-80]', 279 AC_CAPABILITY_SHORT_GI_160: '[SHORT-GI-160]', 280 AC_CAPABILITY_TX_STBC_2BY1: '[TX-STBC-2BY1]', 281 AC_CAPABILITY_RX_STBC_1: '[RX-STBC-1]', 282 AC_CAPABILITY_RX_STBC_12: '[RX-STBC-12]', 283 AC_CAPABILITY_RX_STBC_123: '[RX-STBC-123]', 284 AC_CAPABILITY_RX_STBC_1234: '[RX-STBC-1234]', 285 AC_CAPABILITY_SU_BEAMFORMER: '[SU-BEAMFORMER]', 286 AC_CAPABILITY_SU_BEAMFORMEE: '[SU-BEAMFORMEE]', 287 AC_CAPABILITY_BF_ANTENNA_2: '[BF-ANTENNA-2]', 288 AC_CAPABILITY_BF_ANTENNA_3: '[BF-ANTENNA-3]', 289 AC_CAPABILITY_BF_ANTENNA_4: '[BF-ANTENNA-4]', 290 AC_CAPABILITY_SOUNDING_DIMENSION_2: '[SOUNDING-DIMENSION-2]', 291 AC_CAPABILITY_SOUNDING_DIMENSION_3: '[SOUNDING-DIMENSION-3]', 292 AC_CAPABILITY_SOUNDING_DIMENSION_4: '[SOUNDING-DIMENSION-4]', 293 AC_CAPABILITY_MU_BEAMFORMER: '[MU-BEAMFORMER]', 294 AC_CAPABILITY_MU_BEAMFORMEE: '[MU-BEAMFORMEE]', 295 AC_CAPABILITY_VHT_TXOP_PS: '[VHT-TXOP-PS]', 296 AC_CAPABILITY_HTC_VHT: '[HTC-VHT]', 297 AC_CAPABILITY_MAX_A_MPDU_LEN_EXP0: '[MAX-A-MPDU-LEN-EXP0]', 298 AC_CAPABILITY_MAX_A_MPDU_LEN_EXP1: '[MAX-A-MPDU-LEN-EXP1]', 299 AC_CAPABILITY_MAX_A_MPDU_LEN_EXP2: '[MAX-A-MPDU-LEN-EXP2]', 300 AC_CAPABILITY_MAX_A_MPDU_LEN_EXP3: '[MAX-A-MPDU-LEN-EXP3]', 301 AC_CAPABILITY_MAX_A_MPDU_LEN_EXP4: '[MAX-A-MPDU-LEN-EXP4]', 302 AC_CAPABILITY_MAX_A_MPDU_LEN_EXP5: '[MAX-A-MPDU-LEN-EXP5]', 303 AC_CAPABILITY_MAX_A_MPDU_LEN_EXP6: '[MAX-A-MPDU-LEN-EXP6]', 304 AC_CAPABILITY_MAX_A_MPDU_LEN_EXP7: '[MAX-A-MPDU-LEN-EXP7]', 305 AC_CAPABILITY_VHT_LINK_ADAPT2: '[VHT-LINK-ADAPT2]', 306 AC_CAPABILITY_VHT_LINK_ADAPT3: '[VHT-LINK-ADAPT3]', 307 AC_CAPABILITY_RX_ANTENNA_PATTERN: '[RX-ANTENNA-PATTERN]', 308 AC_CAPABILITY_TX_ANTENNA_PATTERN: '[TX-ANTENNA-PATTERN]', 309 AC_CAPABILITY_MAX_MPDU_11454: '[MAX-MPDU-11454]', 310 AC_CAPABILITY_MAX_MPDU_7991: '[MAX-MPDU-7991]' 311} 312AC_CAPABILITIES_MAPPING_INVERSE = { 313 v: k 314 for k, v in AC_CAPABILITIES_MAPPING.items() 315} 316VHT_CHANNEL_WIDTH_40 = 0 317VHT_CHANNEL_WIDTH_80 = 1 318VHT_CHANNEL_WIDTH_160 = 2 319VHT_CHANNEL_WIDTH_80_80 = 3 320 321VHT_CHANNEL = { 322 40: VHT_CHANNEL_WIDTH_40, 323 80: VHT_CHANNEL_WIDTH_80, 324 160: VHT_CHANNEL_WIDTH_160 325} 326 327# This is a loose merging of the rules for US and EU regulatory 328# domains as taken from IEEE Std 802.11-2012 Appendix E. For instance, 329# we tolerate HT40 in channels 149-161 (not allowed in EU), but also 330# tolerate HT40+ on channel 7 (not allowed in the US). We take the loose 331# definition so that we don't prohibit testing in either domain. 332HT40_ALLOW_MAP = { 333 N_CAPABILITY_HT40_MINUS_CHANNELS: 334 tuple( 335 itertools.chain(range(6, 14), range(40, 65, 8), range(104, 145, 8), 336 [153, 161])), 337 N_CAPABILITY_HT40_PLUS_CHANNELS: 338 tuple( 339 itertools.chain(range(1, 8), range(36, 61, 8), range(100, 141, 8), 340 [149, 157])) 341} 342 343PMF_SUPPORT_DISABLED = 0 344PMF_SUPPORT_ENABLED = 1 345PMF_SUPPORT_REQUIRED = 2 346PMF_SUPPORT_VALUES = (PMF_SUPPORT_DISABLED, PMF_SUPPORT_ENABLED, 347 PMF_SUPPORT_REQUIRED) 348 349DRIVER_NAME = 'nl80211' 350 351CENTER_CHANNEL_MAP = { 352 VHT_CHANNEL_WIDTH_40: { 353 'delta': 354 2, 355 'channels': ((36, 40), (44, 48), (52, 56), (60, 64), (100, 104), 356 (108, 112), (116, 120), (124, 128), (132, 136), 357 (140, 144), (149, 153), (157, 161)) 358 }, 359 VHT_CHANNEL_WIDTH_80: { 360 'delta': 361 6, 362 'channels': 363 ((36, 48), (52, 64), (100, 112), (116, 128), (132, 144), (149, 161)) 364 }, 365 VHT_CHANNEL_WIDTH_160: { 366 'delta': 14, 367 'channels': ((36, 64), (100, 128)) 368 } 369} 370 371OFDM_DATA_RATES = {'supported_rates': '60 90 120 180 240 360 480 540'} 372 373CCK_DATA_RATES = {'supported_rates': '10 20 55 110'} 374 375CCK_AND_OFDM_DATA_RATES = { 376 'supported_rates': '10 20 55 110 60 90 120 180 240 360 480 540' 377} 378 379OFDM_ONLY_BASIC_RATES = {'basic_rates': '60 120 240'} 380 381CCK_AND_OFDM_BASIC_RATES = {'basic_rates': '10 20 55 110'} 382 383WEP_AUTH = { 384 'open': { 385 'auth_algs': 1 386 }, 387 'shared': { 388 'auth_algs': 2 389 }, 390 'open_and_shared': { 391 'auth_algs': 3 392 } 393} 394 395WMM_11B_DEFAULT_PARAMS = { 396 'wmm_ac_bk_cwmin': 5, 397 'wmm_ac_bk_cwmax': 10, 398 'wmm_ac_bk_aifs': 7, 399 'wmm_ac_bk_txop_limit': 0, 400 'wmm_ac_be_aifs': 3, 401 'wmm_ac_be_cwmin': 5, 402 'wmm_ac_be_cwmax': 7, 403 'wmm_ac_be_txop_limit': 0, 404 'wmm_ac_vi_aifs': 2, 405 'wmm_ac_vi_cwmin': 4, 406 'wmm_ac_vi_cwmax': 5, 407 'wmm_ac_vi_txop_limit': 188, 408 'wmm_ac_vo_aifs': 2, 409 'wmm_ac_vo_cwmin': 3, 410 'wmm_ac_vo_cwmax': 4, 411 'wmm_ac_vo_txop_limit': 102 412} 413 414WMM_PHYS_11A_11G_11N_11AC_DEFAULT_PARAMS = { 415 'wmm_ac_bk_cwmin': 4, 416 'wmm_ac_bk_cwmax': 10, 417 'wmm_ac_bk_aifs': 7, 418 'wmm_ac_bk_txop_limit': 0, 419 'wmm_ac_be_aifs': 3, 420 'wmm_ac_be_cwmin': 4, 421 'wmm_ac_be_cwmax': 10, 422 'wmm_ac_be_txop_limit': 0, 423 'wmm_ac_vi_aifs': 2, 424 'wmm_ac_vi_cwmin': 3, 425 'wmm_ac_vi_cwmax': 4, 426 'wmm_ac_vi_txop_limit': 94, 427 'wmm_ac_vo_aifs': 2, 428 'wmm_ac_vo_cwmin': 2, 429 'wmm_ac_vo_cwmax': 3, 430 'wmm_ac_vo_txop_limit': 47 431} 432 433WMM_NON_DEFAULT_PARAMS = { 434 'wmm_ac_bk_cwmin': 5, 435 'wmm_ac_bk_cwmax': 9, 436 'wmm_ac_bk_aifs': 3, 437 'wmm_ac_bk_txop_limit': 94, 438 'wmm_ac_be_aifs': 2, 439 'wmm_ac_be_cwmin': 2, 440 'wmm_ac_be_cwmax': 8, 441 'wmm_ac_be_txop_limit': 0, 442 'wmm_ac_vi_aifs': 1, 443 'wmm_ac_vi_cwmin': 7, 444 'wmm_ac_vi_cwmax': 10, 445 'wmm_ac_vi_txop_limit': 47, 446 'wmm_ac_vo_aifs': 1, 447 'wmm_ac_vo_cwmin': 6, 448 'wmm_ac_vo_cwmax': 10, 449 'wmm_ac_vo_txop_limit': 94 450} 451 452WMM_DEGRADED_VO_PARAMS = { 453 'wmm_ac_bk_cwmin': 7, 454 'wmm_ac_bk_cwmax': 15, 455 'wmm_ac_bk_aifs': 2, 456 'wmm_ac_bk_txop_limit': 0, 457 'wmm_ac_be_aifs': 2, 458 'wmm_ac_be_cwmin': 7, 459 'wmm_ac_be_cwmax': 15, 460 'wmm_ac_be_txop_limit': 0, 461 'wmm_ac_vi_aifs': 2, 462 'wmm_ac_vi_cwmin': 7, 463 'wmm_ac_vi_cwmax': 15, 464 'wmm_ac_vi_txop_limit': 94, 465 'wmm_ac_vo_aifs': 10, 466 'wmm_ac_vo_cwmin': 7, 467 'wmm_ac_vo_cwmax': 15, 468 'wmm_ac_vo_txop_limit': 47 469} 470 471WMM_DEGRADED_VI_PARAMS = { 472 'wmm_ac_bk_cwmin': 7, 473 'wmm_ac_bk_cwmax': 15, 474 'wmm_ac_bk_aifs': 2, 475 'wmm_ac_bk_txop_limit': 0, 476 'wmm_ac_be_aifs': 2, 477 'wmm_ac_be_cwmin': 7, 478 'wmm_ac_be_cwmax': 15, 479 'wmm_ac_be_txop_limit': 0, 480 'wmm_ac_vi_aifs': 10, 481 'wmm_ac_vi_cwmin': 7, 482 'wmm_ac_vi_cwmax': 15, 483 'wmm_ac_vi_txop_limit': 94, 484 'wmm_ac_vo_aifs': 2, 485 'wmm_ac_vo_cwmin': 7, 486 'wmm_ac_vo_cwmax': 15, 487 'wmm_ac_vo_txop_limit': 47 488} 489 490WMM_IMPROVE_BE_PARAMS = { 491 'wmm_ac_bk_cwmin': 7, 492 'wmm_ac_bk_cwmax': 15, 493 'wmm_ac_bk_aifs': 10, 494 'wmm_ac_bk_txop_limit': 0, 495 'wmm_ac_be_aifs': 2, 496 'wmm_ac_be_cwmin': 7, 497 'wmm_ac_be_cwmax': 15, 498 'wmm_ac_be_txop_limit': 0, 499 'wmm_ac_vi_aifs': 10, 500 'wmm_ac_vi_cwmin': 7, 501 'wmm_ac_vi_cwmax': 15, 502 'wmm_ac_vi_txop_limit': 94, 503 'wmm_ac_vo_aifs': 10, 504 'wmm_ac_vo_cwmin': 7, 505 'wmm_ac_vo_cwmax': 15, 506 'wmm_ac_vo_txop_limit': 47 507} 508 509WMM_IMPROVE_BK_PARAMS = { 510 'wmm_ac_bk_cwmin': 7, 511 'wmm_ac_bk_cwmax': 15, 512 'wmm_ac_bk_aifs': 2, 513 'wmm_ac_bk_txop_limit': 0, 514 'wmm_ac_be_aifs': 10, 515 'wmm_ac_be_cwmin': 7, 516 'wmm_ac_be_cwmax': 15, 517 'wmm_ac_be_txop_limit': 0, 518 'wmm_ac_vi_aifs': 10, 519 'wmm_ac_vi_cwmin': 7, 520 'wmm_ac_vi_cwmax': 15, 521 'wmm_ac_vi_txop_limit': 94, 522 'wmm_ac_vo_aifs': 10, 523 'wmm_ac_vo_cwmin': 7, 524 'wmm_ac_vo_cwmax': 15, 525 'wmm_ac_vo_txop_limit': 47 526} 527 528WMM_ACM_BK = {'wmm_ac_bk_acm': 1} 529WMM_ACM_BE = {'wmm_ac_be_acm': 1} 530WMM_ACM_VI = {'wmm_ac_vi_acm': 1} 531WMM_ACM_VO = {'wmm_ac_vo_acm': 1} 532 533UAPSD_ENABLED = {'uapsd_advertisement_enabled': 1} 534 535UTF_8_SSID = {'utf8_ssid': 1} 536 537ENABLE_RRM_BEACON_REPORT = {'rrm_beacon_report': 1} 538ENABLE_RRM_NEIGHBOR_REPORT = {'rrm_neighbor_report': 1} 539 540# Wireless Network Management (AKA 802.11v) features. 541ENABLE_WNM_TIME_ADVERTISEMENT = {'time_advertisement': 2, 'time_zone': 'EST5'} 542ENABLE_WNM_SLEEP_MODE = {'wnm_sleep_mode': 1} 543ENABLE_WNM_BSS_TRANSITION_MANAGEMENT = {'bss_transition': 1} 544ENABLE_WNM_PROXY_ARP = {'proxy_arp': 1} 545ENABLE_WNM_IPV6_NEIGHBOR_ADVERTISEMENT_MULTICAST_TO_UNICAST = { 546 'na_mcast_to_ucast': 1 547} 548 549VENDOR_IE = { 550 'correct_length_beacon': { 551 'vendor_elements': 'dd0411223301' 552 }, 553 'too_short_length_beacon': { 554 'vendor_elements': 'dd0311223301' 555 }, 556 'too_long_length_beacon': { 557 'vendor_elements': 'dd0511223301' 558 }, 559 'zero_length_beacon_with_data': { 560 'vendor_elements': 'dd0011223301' 561 }, 562 'zero_length_beacon_without_data': { 563 'vendor_elements': 'dd00' 564 }, 565 'simliar_to_wpa': { 566 'vendor_elements': 'dd040050f203' 567 }, 568 'correct_length_association_response': { 569 'assocresp_elements': 'dd0411223301' 570 }, 571 'too_short_length_association_response': { 572 'assocresp_elements': 'dd0311223301' 573 }, 574 'too_long_length_association_response': { 575 'assocresp_elements': 'dd0511223301' 576 }, 577 'zero_length_association_response_with_data': { 578 'assocresp_elements': 'dd0011223301' 579 }, 580 'zero_length_association_response_without_data': { 581 'assocresp_elements': 'dd00' 582 } 583} 584 585ENABLE_IEEE80211D = {'ieee80211d': 1} 586 587COUNTRY_STRING = { 588 'ALL': { 589 'country3': '0x20' 590 }, 591 'OUTDOOR': { 592 'country3': '0x4f' 593 }, 594 'INDOOR': { 595 'country3': '0x49' 596 }, 597 'NONCOUNTRY': { 598 'country3': '0x58' 599 }, 600 'GLOBAL': { 601 'country3': '0x04' 602 } 603} 604 605COUNTRY_CODE = { 606 'AFGHANISTAN': { 607 'country_code': 'AF' 608 }, 609 'ALAND_ISLANDS': { 610 'country_code': 'AX' 611 }, 612 'ALBANIA': { 613 'country_code': 'AL' 614 }, 615 'ALGERIA': { 616 'country_code': 'DZ' 617 }, 618 'AMERICAN_SAMOA': { 619 'country_code': 'AS' 620 }, 621 'ANDORRA': { 622 'country_code': 'AD' 623 }, 624 'ANGOLA': { 625 'country_code': 'AO' 626 }, 627 'ANGUILLA': { 628 'country_code': 'AI' 629 }, 630 'ANTARCTICA': { 631 'country_code': 'AQ' 632 }, 633 'ANTIGUA_AND_BARBUDA': { 634 'country_code': 'AG' 635 }, 636 'ARGENTINA': { 637 'country_code': 'AR' 638 }, 639 'ARMENIA': { 640 'country_code': 'AM' 641 }, 642 'ARUBA': { 643 'country_code': 'AW' 644 }, 645 'AUSTRALIA': { 646 'country_code': 'AU' 647 }, 648 'AUSTRIA': { 649 'country_code': 'AT' 650 }, 651 'AZERBAIJAN': { 652 'country_code': 'AZ' 653 }, 654 'BAHAMAS': { 655 'country_code': 'BS' 656 }, 657 'BAHRAIN': { 658 'country_code': 'BH' 659 }, 660 'BANGLADESH': { 661 'country_code': 'BD' 662 }, 663 'BARBADOS': { 664 'country_code': 'BB' 665 }, 666 'BELARUS': { 667 'country_code': 'BY' 668 }, 669 'BELGIUM': { 670 'country_code': 'BE' 671 }, 672 'BELIZE': { 673 'country_code': 'BZ' 674 }, 675 'BENIN': { 676 'country_code': 'BJ' 677 }, 678 'BERMUDA': { 679 'country_code': 'BM' 680 }, 681 'BHUTAN': { 682 'country_code': 'BT' 683 }, 684 'BOLIVIA': { 685 'country_code': 'BO' 686 }, 687 'BONAIRE': { 688 'country_code': 'BQ' 689 }, 690 'BOSNIA_AND_HERZEGOVINA': { 691 'country_code': 'BA' 692 }, 693 'BOTSWANA': { 694 'country_code': 'BW' 695 }, 696 'BOUVET_ISLAND': { 697 'country_code': 'BV' 698 }, 699 'BRAZIL': { 700 'country_code': 'BR' 701 }, 702 'BRITISH_INDIAN_OCEAN_TERRITORY': { 703 'country_code': 'IO' 704 }, 705 'BRUNEI_DARUSSALAM': { 706 'country_code': 'BN' 707 }, 708 'BULGARIA': { 709 'country_code': 'BG' 710 }, 711 'BURKINA_FASO': { 712 'country_code': 'BF' 713 }, 714 'BURUNDI': { 715 'country_code': 'BI' 716 }, 717 'CAMBODIA': { 718 'country_code': 'KH' 719 }, 720 'CAMEROON': { 721 'country_code': 'CM' 722 }, 723 'CANADA': { 724 'country_code': 'CA' 725 }, 726 'CAPE_VERDE': { 727 'country_code': 'CV' 728 }, 729 'CAYMAN_ISLANDS': { 730 'country_code': 'KY' 731 }, 732 'CENTRAL_AFRICAN_REPUBLIC': { 733 'country_code': 'CF' 734 }, 735 'CHAD': { 736 'country_code': 'TD' 737 }, 738 'CHILE': { 739 'country_code': 'CL' 740 }, 741 'CHINA': { 742 'country_code': 'CN' 743 }, 744 'CHRISTMAS_ISLAND': { 745 'country_code': 'CX' 746 }, 747 'COCOS_ISLANDS': { 748 'country_code': 'CC' 749 }, 750 'COLOMBIA': { 751 'country_code': 'CO' 752 }, 753 'COMOROS': { 754 'country_code': 'KM' 755 }, 756 'CONGO': { 757 'country_code': 'CG' 758 }, 759 'DEMOCRATIC_REPUBLIC_CONGO': { 760 'country_code': 'CD' 761 }, 762 'COOK_ISLANDS': { 763 'country_code': 'CK' 764 }, 765 'COSTA_RICA': { 766 'country_code': 'CR' 767 }, 768 'COTE_D_IVOIRE': { 769 'country_code': 'CI' 770 }, 771 'CROATIA': { 772 'country_code': 'HR' 773 }, 774 'CUBA': { 775 'country_code': 'CU' 776 }, 777 'CURACAO': { 778 'country_code': 'CW' 779 }, 780 'CYPRUS': { 781 'country_code': 'CY' 782 }, 783 'CZECH_REPUBLIC': { 784 'country_code': 'CZ' 785 }, 786 'DENMARK': { 787 'country_code': 'DK' 788 }, 789 'DJIBOUTI': { 790 'country_code': 'DJ' 791 }, 792 'DOMINICA': { 793 'country_code': 'DM' 794 }, 795 'DOMINICAN_REPUBLIC': { 796 'country_code': 'DO' 797 }, 798 'ECUADOR': { 799 'country_code': 'EC' 800 }, 801 'EGYPT': { 802 'country_code': 'EG' 803 }, 804 'EL_SALVADOR': { 805 'country_code': 'SV' 806 }, 807 'EQUATORIAL_GUINEA': { 808 'country_code': 'GQ' 809 }, 810 'ERITREA': { 811 'country_code': 'ER' 812 }, 813 'ESTONIA': { 814 'country_code': 'EE' 815 }, 816 'ETHIOPIA': { 817 'country_code': 'ET' 818 }, 819 'FALKLAND_ISLANDS_(MALVINAS)': { 820 'country_code': 'FK' 821 }, 822 'FAROE_ISLANDS': { 823 'country_code': 'FO' 824 }, 825 'FIJI': { 826 'country_code': 'FJ' 827 }, 828 'FINLAND': { 829 'country_code': 'FI' 830 }, 831 'FRANCE': { 832 'country_code': 'FR' 833 }, 834 'FRENCH_GUIANA': { 835 'country_code': 'GF' 836 }, 837 'FRENCH_POLYNESIA': { 838 'country_code': 'PF' 839 }, 840 'FRENCH_SOUTHERN_TERRITORIES': { 841 'country_code': 'TF' 842 }, 843 'GABON': { 844 'country_code': 'GA' 845 }, 846 'GAMBIA': { 847 'country_code': 'GM' 848 }, 849 'GEORGIA': { 850 'country_code': 'GE' 851 }, 852 'GERMANY': { 853 'country_code': 'DE' 854 }, 855 'GHANA': { 856 'country_code': 'GH' 857 }, 858 'GIBRALTAR': { 859 'country_code': 'GI' 860 }, 861 'GREECE': { 862 'country_code': 'GR' 863 }, 864 'GREENLAND': { 865 'country_code': 'GL' 866 }, 867 'GRENADA': { 868 'country_code': 'GD' 869 }, 870 'GUADELOUPE': { 871 'country_code': 'GP' 872 }, 873 'GUAM': { 874 'country_code': 'GU' 875 }, 876 'GUATEMALA': { 877 'country_code': 'GT' 878 }, 879 'GUERNSEY': { 880 'country_code': 'GG' 881 }, 882 'GUINEA': { 883 'country_code': 'GN' 884 }, 885 'GUINEA-BISSAU': { 886 'country_code': 'GW' 887 }, 888 'GUYANA': { 889 'country_code': 'GY' 890 }, 891 'HAITI': { 892 'country_code': 'HT' 893 }, 894 'HEARD_ISLAND_AND_MCDONALD_ISLANDS': { 895 'country_code': 'HM' 896 }, 897 'VATICAN_CITY_STATE': { 898 'country_code': 'VA' 899 }, 900 'HONDURAS': { 901 'country_code': 'HN' 902 }, 903 'HONG_KONG': { 904 'country_code': 'HK' 905 }, 906 'HUNGARY': { 907 'country_code': 'HU' 908 }, 909 'ICELAND': { 910 'country_code': 'IS' 911 }, 912 'INDIA': { 913 'country_code': 'IN' 914 }, 915 'INDONESIA': { 916 'country_code': 'ID' 917 }, 918 'IRAN': { 919 'country_code': 'IR' 920 }, 921 'IRAQ': { 922 'country_code': 'IQ' 923 }, 924 'IRELAND': { 925 'country_code': 'IE' 926 }, 927 'ISLE_OF_MAN': { 928 'country_code': 'IM' 929 }, 930 'ISRAEL': { 931 'country_code': 'IL' 932 }, 933 'ITALY': { 934 'country_code': 'IT' 935 }, 936 'JAMAICA': { 937 'country_code': 'JM' 938 }, 939 'JAPAN': { 940 'country_code': 'JP' 941 }, 942 'JERSEY': { 943 'country_code': 'JE' 944 }, 945 'JORDAN': { 946 'country_code': 'JO' 947 }, 948 'KAZAKHSTAN': { 949 'country_code': 'KZ' 950 }, 951 'KENYA': { 952 'country_code': 'KE' 953 }, 954 'KIRIBATI': { 955 'country_code': 'KI' 956 }, 957 'DEMOCRATIC_PEOPLE_S_REPUBLIC_OF_KOREA': { 958 'country_code': 'KP' 959 }, 960 'REPUBLIC_OF_KOREA': { 961 'country_code': 'KR' 962 }, 963 'KUWAIT': { 964 'country_code': 'KW' 965 }, 966 'KYRGYZSTAN': { 967 'country_code': 'KG' 968 }, 969 'LAO': { 970 'country_code': 'LA' 971 }, 972 'LATVIA': { 973 'country_code': 'LV' 974 }, 975 'LEBANON': { 976 'country_code': 'LB' 977 }, 978 'LESOTHO': { 979 'country_code': 'LS' 980 }, 981 'LIBERIA': { 982 'country_code': 'LR' 983 }, 984 'LIBYA': { 985 'country_code': 'LY' 986 }, 987 'LIECHTENSTEIN': { 988 'country_code': 'LI' 989 }, 990 'LITHUANIA': { 991 'country_code': 'LT' 992 }, 993 'LUXEMBOURG': { 994 'country_code': 'LU' 995 }, 996 'MACAO': { 997 'country_code': 'MO' 998 }, 999 'MACEDONIA': { 1000 'country_code': 'MK' 1001 }, 1002 'MADAGASCAR': { 1003 'country_code': 'MG' 1004 }, 1005 'MALAWI': { 1006 'country_code': 'MW' 1007 }, 1008 'MALAYSIA': { 1009 'country_code': 'MY' 1010 }, 1011 'MALDIVES': { 1012 'country_code': 'MV' 1013 }, 1014 'MALI': { 1015 'country_code': 'ML' 1016 }, 1017 'MALTA': { 1018 'country_code': 'MT' 1019 }, 1020 'MARSHALL_ISLANDS': { 1021 'country_code': 'MH' 1022 }, 1023 'MARTINIQUE': { 1024 'country_code': 'MQ' 1025 }, 1026 'MAURITANIA': { 1027 'country_code': 'MR' 1028 }, 1029 'MAURITIUS': { 1030 'country_code': 'MU' 1031 }, 1032 'MAYOTTE': { 1033 'country_code': 'YT' 1034 }, 1035 'MEXICO': { 1036 'country_code': 'MX' 1037 }, 1038 'MICRONESIA': { 1039 'country_code': 'FM' 1040 }, 1041 'MOLDOVA': { 1042 'country_code': 'MD' 1043 }, 1044 'MONACO': { 1045 'country_code': 'MC' 1046 }, 1047 'MONGOLIA': { 1048 'country_code': 'MN' 1049 }, 1050 'MONTENEGRO': { 1051 'country_code': 'ME' 1052 }, 1053 'MONTSERRAT': { 1054 'country_code': 'MS' 1055 }, 1056 'MOROCCO': { 1057 'country_code': 'MA' 1058 }, 1059 'MOZAMBIQUE': { 1060 'country_code': 'MZ' 1061 }, 1062 'MYANMAR': { 1063 'country_code': 'MM' 1064 }, 1065 'NAMIBIA': { 1066 'country_code': 'NA' 1067 }, 1068 'NAURU': { 1069 'country_code': 'NR' 1070 }, 1071 'NEPAL': { 1072 'country_code': 'NP' 1073 }, 1074 'NETHERLANDS': { 1075 'country_code': 'NL' 1076 }, 1077 'NEW_CALEDONIA': { 1078 'country_code': 'NC' 1079 }, 1080 'NEW_ZEALAND': { 1081 'country_code': 'NZ' 1082 }, 1083 'NICARAGUA': { 1084 'country_code': 'NI' 1085 }, 1086 'NIGER': { 1087 'country_code': 'NE' 1088 }, 1089 'NIGERIA': { 1090 'country_code': 'NG' 1091 }, 1092 'NIUE': { 1093 'country_code': 'NU' 1094 }, 1095 'NORFOLK_ISLAND': { 1096 'country_code': 'NF' 1097 }, 1098 'NORTHERN_MARIANA_ISLANDS': { 1099 'country_code': 'MP' 1100 }, 1101 'NORWAY': { 1102 'country_code': 'NO' 1103 }, 1104 'OMAN': { 1105 'country_code': 'OM' 1106 }, 1107 'PAKISTAN': { 1108 'country_code': 'PK' 1109 }, 1110 'PALAU': { 1111 'country_code': 'PW' 1112 }, 1113 'PALESTINE': { 1114 'country_code': 'PS' 1115 }, 1116 'PANAMA': { 1117 'country_code': 'PA' 1118 }, 1119 'PAPUA_NEW_GUINEA': { 1120 'country_code': 'PG' 1121 }, 1122 'PARAGUAY': { 1123 'country_code': 'PY' 1124 }, 1125 'PERU': { 1126 'country_code': 'PE' 1127 }, 1128 'PHILIPPINES': { 1129 'country_code': 'PH' 1130 }, 1131 'PITCAIRN': { 1132 'country_code': 'PN' 1133 }, 1134 'POLAND': { 1135 'country_code': 'PL' 1136 }, 1137 'PORTUGAL': { 1138 'country_code': 'PT' 1139 }, 1140 'PUERTO_RICO': { 1141 'country_code': 'PR' 1142 }, 1143 'QATAR': { 1144 'country_code': 'QA' 1145 }, 1146 'RÉUNION': { 1147 'country_code': 'RE' 1148 }, 1149 'ROMANIA': { 1150 'country_code': 'RO' 1151 }, 1152 'RUSSIAN_FEDERATION': { 1153 'country_code': 'RU' 1154 }, 1155 'RWANDA': { 1156 'country_code': 'RW' 1157 }, 1158 'SAINT_BARTHELEMY': { 1159 'country_code': 'BL' 1160 }, 1161 'SAINT_KITTS_AND_NEVIS': { 1162 'country_code': 'KN' 1163 }, 1164 'SAINT_LUCIA': { 1165 'country_code': 'LC' 1166 }, 1167 'SAINT_MARTIN': { 1168 'country_code': 'MF' 1169 }, 1170 'SAINT_PIERRE_AND_MIQUELON': { 1171 'country_code': 'PM' 1172 }, 1173 'SAINT_VINCENT_AND_THE_GRENADINES': { 1174 'country_code': 'VC' 1175 }, 1176 'SAMOA': { 1177 'country_code': 'WS' 1178 }, 1179 'SAN_MARINO': { 1180 'country_code': 'SM' 1181 }, 1182 'SAO_TOME_AND_PRINCIPE': { 1183 'country_code': 'ST' 1184 }, 1185 'SAUDI_ARABIA': { 1186 'country_code': 'SA' 1187 }, 1188 'SENEGAL': { 1189 'country_code': 'SN' 1190 }, 1191 'SERBIA': { 1192 'country_code': 'RS' 1193 }, 1194 'SEYCHELLES': { 1195 'country_code': 'SC' 1196 }, 1197 'SIERRA_LEONE': { 1198 'country_code': 'SL' 1199 }, 1200 'SINGAPORE': { 1201 'country_code': 'SG' 1202 }, 1203 'SINT_MAARTEN': { 1204 'country_code': 'SX' 1205 }, 1206 'SLOVAKIA': { 1207 'country_code': 'SK' 1208 }, 1209 'SLOVENIA': { 1210 'country_code': 'SI' 1211 }, 1212 'SOLOMON_ISLANDS': { 1213 'country_code': 'SB' 1214 }, 1215 'SOMALIA': { 1216 'country_code': 'SO' 1217 }, 1218 'SOUTH_AFRICA': { 1219 'country_code': 'ZA' 1220 }, 1221 'SOUTH_GEORGIA': { 1222 'country_code': 'GS' 1223 }, 1224 'SOUTH_SUDAN': { 1225 'country_code': 'SS' 1226 }, 1227 'SPAIN': { 1228 'country_code': 'ES' 1229 }, 1230 'SRI_LANKA': { 1231 'country_code': 'LK' 1232 }, 1233 'SUDAN': { 1234 'country_code': 'SD' 1235 }, 1236 'SURINAME': { 1237 'country_code': 'SR' 1238 }, 1239 'SVALBARD_AND_JAN_MAYEN': { 1240 'country_code': 'SJ' 1241 }, 1242 'SWAZILAND': { 1243 'country_code': 'SZ' 1244 }, 1245 'SWEDEN': { 1246 'country_code': 'SE' 1247 }, 1248 'SWITZERLAND': { 1249 'country_code': 'CH' 1250 }, 1251 'SYRIAN_ARAB_REPUBLIC': { 1252 'country_code': 'SY' 1253 }, 1254 'TAIWAN': { 1255 'country_code': 'TW' 1256 }, 1257 'TAJIKISTAN': { 1258 'country_code': 'TJ' 1259 }, 1260 'TANZANIA': { 1261 'country_code': 'TZ' 1262 }, 1263 'THAILAND': { 1264 'country_code': 'TH' 1265 }, 1266 'TIMOR-LESTE': { 1267 'country_code': 'TL' 1268 }, 1269 'TOGO': { 1270 'country_code': 'TG' 1271 }, 1272 'TOKELAU': { 1273 'country_code': 'TK' 1274 }, 1275 'TONGA': { 1276 'country_code': 'TO' 1277 }, 1278 'TRINIDAD_AND_TOBAGO': { 1279 'country_code': 'TT' 1280 }, 1281 'TUNISIA': { 1282 'country_code': 'TN' 1283 }, 1284 'TURKEY': { 1285 'country_code': 'TR' 1286 }, 1287 'TURKMENISTAN': { 1288 'country_code': 'TM' 1289 }, 1290 'TURKS_AND_CAICOS_ISLANDS': { 1291 'country_code': 'TC' 1292 }, 1293 'TUVALU': { 1294 'country_code': 'TV' 1295 }, 1296 'UGANDA': { 1297 'country_code': 'UG' 1298 }, 1299 'UKRAINE': { 1300 'country_code': 'UA' 1301 }, 1302 'UNITED_ARAB_EMIRATES': { 1303 'country_code': 'AE' 1304 }, 1305 'UNITED_KINGDOM': { 1306 'country_code': 'GB' 1307 }, 1308 'UNITED_STATES': { 1309 'country_code': 'US' 1310 }, 1311 'UNITED_STATES_MINOR_OUTLYING_ISLANDS': { 1312 'country_code': 'UM' 1313 }, 1314 'URUGUAY': { 1315 'country_code': 'UY' 1316 }, 1317 'UZBEKISTAN': { 1318 'country_code': 'UZ' 1319 }, 1320 'VANUATU': { 1321 'country_code': 'VU' 1322 }, 1323 'VENEZUELA': { 1324 'country_code': 'VE' 1325 }, 1326 'VIETNAM': { 1327 'country_code': 'VN' 1328 }, 1329 'VIRGIN_ISLANDS_BRITISH': { 1330 'country_code': 'VG' 1331 }, 1332 'VIRGIN_ISLANDS_US': { 1333 'country_code': 'VI' 1334 }, 1335 'WALLIS_AND_FUTUNA': { 1336 'country_code': 'WF' 1337 }, 1338 'WESTERN_SAHARA': { 1339 'country_code': 'EH' 1340 }, 1341 'YEMEN': { 1342 'country_code': 'YE' 1343 }, 1344 'ZAMBIA': { 1345 'country_code': 'ZM' 1346 }, 1347 'ZIMBABWE': { 1348 'country_code': 'ZW' 1349 }, 1350 'NON_COUNTRY': { 1351 'country_code': 'XX' 1352 } 1353} 1354 1355ALL_CHANNELS_2G = { 1356 1: {20, 40}, 1357 2: {20, 40}, 1358 3: {20, 40}, 1359 4: {20, 40}, 1360 5: {20, 40}, 1361 6: {20, 40}, 1362 7: {20, 40}, 1363 8: {20, 40}, 1364 9: {20, 40}, 1365 10: {20, 40}, 1366 11: {20, 40}, 1367 12: {20, 40}, 1368 13: {20, 40}, 1369 14: {20} 1370} 1371 1372ALL_CHANNELS_5G = { 1373 36: {20, 40, 80}, 1374 40: {20, 40, 80}, 1375 44: {20, 40, 80}, 1376 48: {20, 40, 80}, 1377 52: {20, 40, 80}, 1378 56: {20, 40, 80}, 1379 60: {20, 40, 80}, 1380 64: {20, 40, 80}, 1381 100: {20, 40, 80}, 1382 104: {20, 40, 80}, 1383 108: {20, 40, 80}, 1384 112: {20, 40, 80}, 1385 116: {20, 40, 80}, 1386 120: {20, 40, 80}, 1387 124: {20, 40, 80}, 1388 128: {20, 40, 80}, 1389 132: {20, 40, 80}, 1390 136: {20, 40, 80}, 1391 140: {20, 40, 80}, 1392 144: {20, 40, 80}, 1393 149: {20, 40, 80}, 1394 153: {20, 40, 80}, 1395 157: {20, 40, 80}, 1396 161: {20, 40, 80}, 1397 165: {20} 1398} 1399 1400ALL_CHANNELS = {**ALL_CHANNELS_2G, **ALL_CHANNELS_5G} 1401 1402 1403@unique 1404class WnmFeature(Enum): 1405 """Wireless Network Management (AKA 802.11v) features hostapd supports.""" 1406 TIME_ADVERTISEMENT = auto() 1407 WNM_SLEEP_MODE = auto() 1408 BSS_TRANSITION_MANAGEMENT = auto() 1409 PROXY_ARP = auto() 1410 IPV6_NEIGHBOR_ADVERTISEMENT_MULTICAST_TO_UNICAST = auto() 1411