📄 dot11lib.h
字号:
#define DOT11_RC_MIN_PACKET 4/************************************************************************** DOT11_COUNTRY_DISC - Country discovery structure, used by* dot11SmeEssCcChoose()**************************************************************************/#define DOT11_SCAN_COUNTRY_MAX 8typedef struct { int countryCode; int num; } DOT11_COUNTRY_DISC;/* Different power-save modes */#define DOT11_POWER_ACTIVE 0#define DOT11_POWER_SLEEP 1#define DOT11_POWER_PROB 2/************************************************************************** DOT11_RC_INFO - Info for the rate control task. Part of SME.**************************************************************************/typedef struct dot11_rc_info { /* The number of packets since the last time the RC task was run on this KSL entry. */ UINT32 packetTotal; /* Running sum of the number of retries since the last time the RC task was run on this KSL entry. */ UINT32 retryTotal; /* Running sum of the number of transmit failures (usually due to excessive retries) since the last time the RC task was run */ UINT32 failureTotal; /* Running sum of the SSI since the last time the RC task was run. Div by "packetTotal" to get the average SSI */ UINT32 ackTotal; } DOT11_RC_INFO;/**************************************************************************** DOT11_BSS - A structure representing an individual wireless network. This* was added with the implementation of mSSID to keep details* for the separate virtual networks separate****************************************************************************/typedef struct dot11_bss { int bssNum; /* Is this BSS currently in use? */ BOOL inUse; /* Current link status */ int linkStatus; /* Current connected BSSID. This does uniquely identify the network, since each BSS has to have a unique BSSID.*/ UINT8 bssid[DOT11_ADDR_LEN]; /* The SSID that the SME is currently working with. Since there may be more than AP with a given SSID, this does not uniquely identify the network */ char currentSsid[DOT11_SSID_LEN + 1]; M_BLK_ID pMblkBeacon; /* Cluster allocated for beacons */ /* The VLAN this SSID is associated with, is VLAN support is turned on */ int vlanId; /* These are the parameters that control WPA and 802.11 mode */ /* Security Policy : a bitmap of allowed sec. policies */ UINT32 secPol; /* Authentication Policy: specifies 802.1X or PSK */ UINT32 authPol; /* Cipher Policy: Specifies list of allowed ciphers */ UINT32 ciphPol; char rsnPassphrase[DOT11_PASSPHRASE_LEN+1]; char rsnPassLastSsid[DOT11_SSID_LEN + 1]; /* If authPol == PSK, then this contains the PSK*/ UINT8 preSharedKey[64]; BOOL pskValid; /* The desired broadcast rate is that set by WIOCSBCASTRATE. It is taken into consideration when choosing a new bcast rate. If this rate is not in the BSS basic rate set, the next lowest basic rate will be chosen. */ UINT32 desiredBcastRate; /* These are the rates that the user wishes to use. They may or may not be a subset of the supported rates - the intersection of the two sets will be used */ DOT11_RATES allowedRates; /* This is the rate that is used to transmit management and control frames, as well and multicast and broadcast frames. It is typically one of the station's basic rates, but is not required to be */ UINT32 bcastRate; /* This is the default authentication method for a station, and the allowed authentication method for an AP */ UINT32 authType; /****** AP Specific parameters *******/ UINT32 dtimCount; /* number of bcns until DTIM */ UINT32 cfpCount; /* number of bcns until CFP */ BOOL respondBcastSsid; /* Respond to requests for ANY ssid */ BOOL showSsidInBeacon; /* Respond to requests for ANY ssid */ DOT11_IE_TIM * pTim; /* Pointer to the TIM IE */ UINT8 tivb[DOT11_MAX_PVB]; /* Complete TIVB */ INT32 tivbStart; /* Start of real data in the tivb*/ INT32 tivbStop; /* End of data in the tivb */ SEM_ID tivbSem; /* Sem protecting TIVB */ /* 802.11g compatibility info */ /* Set to TRUE if a non-ERP station is present in 11g network */ BOOL nonErpPresent; /* Set to TRUE if all ERP stations are required to use protection */ BOOL useProtection; /* Set to TRUE if use of short time slot is allowed in this BSS */ BOOL useShortTimeslot; /* Set to TRUE if use of short preamble is not allowed in this BSS */ BOOL useLongPreamble; /* Pointer to the ERP IE in the beacon, for easy updating of 802.11g info as stations join. Can be NULL is not in 11g mode */ DOT11_IE_ERP * pErpIe; /* Pointer to the capabilities field in the beacon */ UINT16 * pCaps; /* Maximum number of stations allowed to associate to this BSS */ UINT32 assocLimit; /* These are the multicast keys for the BSS (multicast as in "all devices, not as in unicast and multicast packets) */ DOT11_ENCRYPT_TYPE multiEncryptType; UINT32 multiEncryptIndex; UINT32 multiKeySlot; /* This setting is only used on an ESS or IBSS, since a STA will always send to an AP directly. */ UINT32 multiDecryptIndex; /* Counters for TKIP/AES multicast packets */ UINT8 tscMultiTx[DOT11_TSC_LEN]; UINT8 tscMultiRx[DOT11_TSC_LEN]; UINT8 gmk[DOT11_GMK_LEN]; UINT8 gtk[DOT11_GTK_LEN]; BOOL gtkValid; UINT8 gNonce[DOT11_NONCE_LEN]; } DOT11_BSS;#define DOT11_DEFAULT_BSS (&pDot11->sme->bss[0])/*************************************************************************** DOT11_KSL_ENTRY - An entry in the Known Station List***************************************************************************/typedef struct kslEntry { struct kslEntry * pNext; /* This is a pointer to the BSS to which this station belongs. In an ESS or IBSS, this will always be a pointer to pDot11->sme->bss[0] */ DOT11_BSS * pBss; UINT8 macAddr[DOT11_ADDR_LEN]; int dot11Mode; /* Is it an AP, STA or IBSS */ UINT32 timestamp; /* When did we last hear from it */ DOT11_RC_INFO rcInfo ; /* Rate control info, stats */ DOT11_RATES suppRates; /* Supported rates for entry */ UINT16 capabilities; /* 802.11 capabilities field */ /* Rates used to communicate with this station. It is the intersection of the supported rates for this station, the supported rates for the remote station and the allowed rates as set by the user. Note that these rates are expected to be in order from slowest to fastest. */ DOT11_RATES actualRates; UINT32 currentTxRate; UINT32 currentTxRateIndex; UINT32 lastRxRate; /* Determines if this is a static KSL entry for WEP key mapping. This entry won't be recycled until the key is manually deleted.*/ BOOL wepKeyMapping; /* This values is used to inform the HDD which key mapping entry is to be used for this destination. This is the unicast key for this station. If not set, then the multicast key from the DPE will be used if present. The decryptIndex is used only with TKIP to allow for separate TX and RX entries (different MICs). */ INT32 uniDecryptIndex; INT32 uniEncryptIndex; UINT32 uniEncryptType; /* The SSID that this entry is connected to. */ char ssid[DOT11_SSID_LEN + 1]; /* This KSL_Entry is access controlled. The type of control is left up to the controlling SME module */ BOOL accessControlled; /* These entries are used by WIOCSDOT1XPORTSTATUS to determine if packets are allowed to be transmitted through the port */ BOOL dot1xControlled; BOOL dot1xAllowed; /* These records are used to keep track of the advertised security policies */ UINT32 secPol; UINT32 authPol; UINT32 ciphPol; UINT32 groupPol; UINT32 rsnCap; /* These records keep track of the chosen security policies */ UINT32 negSecPol; UINT32 negAuthPol; /* This contains the Pairwise Master key, and a flag determining whether this is a valid PMK */ UINT8 pmk[DOT11_PMK_LEN]; BOOL pmkValid; /* The variables control the state of the four-way state machine. The timer is used to wait a limited time for a reply before retransmitting */ UINT32 fourWayState; INT32 fourWayGlobalTimer; INT32 eapolMsgTimer; /* The dervied keys are generated from the combination of the PMK, the local nonce and the remote nonce */ BOOL derivedKeysValid; UINT8 kck[DOT11_KCK_LEN]; UINT8 kek[DOT11_KCK_LEN]; UINT8 tk[DOT11_TK_LEN]; /* The EAPOL replay counter is used for the fourway key exchange, and keeps track of the last key number observed or used */ UINT8 eapolReplay[DOT11_EAPOL_REPLAY_LEN]; /* The nonce information governs whether we have a valid nonce, and whether our information about the remote nonce is valid */ UINT8 localNonce[DOT11_NONCE_LEN]; BOOL localNonceValid; UINT8 remoteNonce[DOT11_NONCE_LEN]; BOOL remoteNonceValid; /* These elements store the last WPA oe RSN IE used by the enitity to which the KSL record points. This is used in the fourway handshake to compare against to ensure the IE has not been tampered with */ UINT8 lastRsnIe[DOT11_IE_MAX_SIZE]; UINT8 lastWpaIe[DOT11_IE_MAX_SIZE]; /* The transmit sequence counters store the packet number of the last packet transmitted to this station, as well as the last packet received from this station */ UINT8 tscUniTx[DOT11_TSC_LEN]; UINT8 tscUniRx[DOT11_TSC_LEN]; /* Reflects the number of times that this entity has failed the fourway handshake */ UINT32 fourWayTimeouts; /* The tickGet() of the last connection attempt. This is used by dot11KslSSIDLookup() so that the same AP will not always be chosen if it is rejecting connection attempts */ UINT32 lastAttempt; /* This is the sequence number of the last packet received; used for duplicate detection as a fix to SPR 110780 */ UINT16 lastSeq; /* The "type" union reflects the type of the KSL entry, NOT the SME */ union { struct /* KSL_ENTRY is an AP */ { int channel; /* Last channel we heard from entry on*/ int mode; /* PHY mode last heard in */ int ssi; /* Last SSI we heard from entry on */ int aid; /* Association ID, if associated */ /* The shared key buffer stores the last challenge text that was sent to the STA */ UINT8 skaBuffer[DOT11_AUTH_CHAL_MAX]; int skaLength; /* Offset of TIM IE in beacon packets in bytes from start of pkt*/ UINT32 timIeOffset; /* Offset of byte in complete virtual bitmap */ UINT32 timByteOffset; /* Mask of byte pointed to by timByteOffset for this STA */ UINT32 timMask; /* Information stripped from last received beacon */ BOOL beaconSync; DOT11_TIMESTAMP lastBeaconTsf; UINT32 beaconPeriod; UINT32 dtimPeriod; UINT32 dtimCount; UINT32 cfpPeriod; UINT32 cfpCount; UINT32 cfpDuration; UINT32 lastProbation; /* 802.11g compatibility information */ BOOL useProtection; BOOL useShortTimeslot; BOOL useLongPreamble; /* 802.11d information */ UINT32 countryCode; } ap; struct /* KSL_ENTRY is a station in ESS mode */ { int rate; /* Last rate we heard from entry on */ int aid; /* Association ID */ BOOL authenticatedSka; /* Has passed stage 1 of SKA */ BOOL authenticated; /* Has passed final stage of auth */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -