71 #ifndef _WLAN_COMPAT_H 72 #include <wlan/wlan_compat.h> 80 #define WLAN_ADDR_LEN 6 81 #define WLAN_CRC_LEN 4 82 #define WLAN_BSSID_LEN 6 83 #define WLAN_BSS_TS_LEN 8 84 #define WLAN_HDR_A3_LEN 24 85 #define WLAN_HDR_A4_LEN 30 86 #define WLAN_SSID_MAXLEN 32 87 #define WLAN_DATA_MAXLEN 2312 88 #define WLAN_A3FR_MAXLEN (WLAN_HDR_A3_LEN + WLAN_DATA_MAXLEN + WLAN_CRC_LEN) 89 #define WLAN_A4FR_MAXLEN (WLAN_HDR_A4_LEN + WLAN_DATA_MAXLEN + WLAN_CRC_LEN) 90 #define WLAN_BEACON_FR_MAXLEN (WLAN_HDR_A3_LEN + 334) 91 #define WLAN_ATIM_FR_MAXLEN (WLAN_HDR_A3_LEN + 0) 92 #define WLAN_DISASSOC_FR_MAXLEN (WLAN_HDR_A3_LEN + 2) 93 #define WLAN_ASSOCREQ_FR_MAXLEN (WLAN_HDR_A3_LEN + 48) 94 #define WLAN_ASSOCRESP_FR_MAXLEN (WLAN_HDR_A3_LEN + 16) 95 #define WLAN_REASSOCREQ_FR_MAXLEN (WLAN_HDR_A3_LEN + 54) 96 #define WLAN_REASSOCRESP_FR_MAXLEN (WLAN_HDR_A3_LEN + 16) 97 #define WLAN_PROBEREQ_FR_MAXLEN (WLAN_HDR_A3_LEN + 44) 98 #define WLAN_PROBERESP_FR_MAXLEN (WLAN_HDR_A3_LEN + 78) 99 #define WLAN_AUTHEN_FR_MAXLEN (WLAN_HDR_A3_LEN + 261) 100 #define WLAN_DEAUTHEN_FR_MAXLEN (WLAN_HDR_A3_LEN + 2) 101 #define WLAN_WEP_NKEYS 4 102 #define WLAN_WEP_MAXKEYLEN 13 103 #define WLAN_CHALLENGE_IE_LEN 130 104 #define WLAN_CHALLENGE_LEN 128 105 #define WLAN_WEP_IV_LEN 4 106 #define WLAN_WEP_ICV_LEN 4 110 #define WLAN_FTYPE_MGMT 0x00 111 #define WLAN_FTYPE_CTL 0x01 112 #define WLAN_FTYPE_DATA 0x02 116 #define WLAN_FSTYPE_ASSOCREQ 0x00 117 #define WLAN_FSTYPE_ASSOCRESP 0x01 118 #define WLAN_FSTYPE_REASSOCREQ 0x02 119 #define WLAN_FSTYPE_REASSOCRESP 0x03 120 #define WLAN_FSTYPE_PROBEREQ 0x04 121 #define WLAN_FSTYPE_PROBERESP 0x05 122 #define WLAN_FSTYPE_BEACON 0x08 123 #define WLAN_FSTYPE_ATIM 0x09 124 #define WLAN_FSTYPE_DISASSOC 0x0a 125 #define WLAN_FSTYPE_AUTHEN 0x0b 126 #define WLAN_FSTYPE_DEAUTHEN 0x0c 129 #define WLAN_FSTYPE_BLOCKACKREQ 0x8 130 #define WLAN_FSTYPE_BLOCKACK 0x9 131 #define WLAN_FSTYPE_PSPOLL 0x0a 132 #define WLAN_FSTYPE_RTS 0x0b 133 #define WLAN_FSTYPE_CTS 0x0c 134 #define WLAN_FSTYPE_ACK 0x0d 135 #define WLAN_FSTYPE_CFEND 0x0e 136 #define WLAN_FSTYPE_CFENDCFACK 0x0f 139 #define WLAN_FSTYPE_DATAONLY 0x00 140 #define WLAN_FSTYPE_DATA_CFACK 0x01 141 #define WLAN_FSTYPE_DATA_CFPOLL 0x02 142 #define WLAN_FSTYPE_DATA_CFACK_CFPOLL 0x03 143 #define WLAN_FSTYPE_NULL 0x04 144 #define WLAN_FSTYPE_CFACK 0x05 145 #define WLAN_FSTYPE_CFPOLL 0x06 146 #define WLAN_FSTYPE_CFACK_CFPOLL 0x07 171 #define WLAN_GET_FC_PVER(n) (((uint16_t)(n)) & (BIT0 | BIT1)) 172 #define WLAN_GET_FC_FTYPE(n) ((((uint16_t)(n)) & (BIT2 | BIT3)) >> 2) 173 #define WLAN_GET_FC_FSTYPE(n) ((((uint16_t)(n)) & (BIT4|BIT5|BIT6|BIT7)) >> 4) 174 #define WLAN_GET_FC_TODS(n) ((((uint16_t)(n)) & (BIT8)) >> 8) 175 #define WLAN_GET_FC_FROMDS(n) ((((uint16_t)(n)) & (BIT9)) >> 9) 176 #define WLAN_GET_FC_MOREFRAG(n) ((((uint16_t)(n)) & (BIT10)) >> 10) 177 #define WLAN_GET_FC_RETRY(n) ((((uint16_t)(n)) & (BIT11)) >> 11) 178 #define WLAN_GET_FC_PWRMGT(n) ((((uint16_t)(n)) & (BIT12)) >> 12) 179 #define WLAN_GET_FC_MOREDATA(n) ((((uint16_t)(n)) & (BIT13)) >> 13) 180 #define WLAN_GET_FC_ISWEP(n) ((((uint16_t)(n)) & (BIT14)) >> 14) 181 #define WLAN_GET_FC_ORDER(n) ((((uint16_t)(n)) & (BIT15)) >> 15) 183 #define WLAN_SET_FC_PVER(n) ((uint16_t)(n)) 184 #define WLAN_SET_FC_FTYPE(n) (((uint16_t)(n)) << 2) 185 #define WLAN_SET_FC_FSTYPE(n) (((uint16_t)(n)) << 4) 186 #define WLAN_SET_FC_TODS(n) (((uint16_t)(n)) << 8) 187 #define WLAN_SET_FC_FROMDS(n) (((uint16_t)(n)) << 9) 188 #define WLAN_SET_FC_MOREFRAG(n) (((uint16_t)(n)) << 10) 189 #define WLAN_SET_FC_RETRY(n) (((uint16_t)(n)) << 11) 190 #define WLAN_SET_FC_PWRMGT(n) (((uint16_t)(n)) << 12) 191 #define WLAN_SET_FC_MOREDATA(n) (((uint16_t)(n)) << 13) 192 #define WLAN_SET_FC_ISWEP(n) (((uint16_t)(n)) << 14) 193 #define WLAN_SET_FC_ORDER(n) (((uint16_t)(n)) << 15) 206 #define WLAN_GET_SEQ_FRGNUM(n) (((uint16_t)(n)) & (BIT0|BIT1|BIT2|BIT3)) 207 #define WLAN_GET_SEQ_SEQNUM(n) ((((uint16_t)(n)) & (~(BIT0|BIT1|BIT2|BIT3))) >> 4) 213 #define WLAN_HDR_A3_DATAP(p) (((uint8_t*)(p)) + WLAN_HDR_A3_LEN) 214 #define WLAN_HDR_A4_DATAP(p) (((uint8_t*)(p)) + WLAN_HDR_A4_LEN) 216 #define DOT11_RATE5_ISBASIC_GET(r) (((uint8_t)(r)) & BIT7) 263 #define WLAN_CTL_FRAMELEN(fstype) (\ 264 (fstype) == WLAN_FSTYPE_BLOCKACKREQ ? 24 : \ 265 (fstype) == WLAN_FSTYPE_BLOCKACK ? 152 : \ 266 (fstype) == WLAN_FSTYPE_PSPOLL ? 20 : \ 267 (fstype) == WLAN_FSTYPE_RTS ? 20 : \ 268 (fstype) == WLAN_FSTYPE_CTS ? 14 : \ 269 (fstype) == WLAN_FSTYPE_ACK ? 14 : \ 270 (fstype) == WLAN_FSTYPE_CFEND ? 20 : \ 271 (fstype) == WLAN_FSTYPE_CFENDCFACK ? 20 : 4) 273 #define WLAN_FCS_LEN 4 uint8_t a2[WLAN_ADDR_LEN]
uint8_t a4[WLAN_ADDR_LEN]
struct p80211_hdr_a3 p80211_hdr_a3_t
uint8_t a3[WLAN_ADDR_LEN]
uint8_t a2[WLAN_ADDR_LEN]
uint8_t a1[WLAN_ADDR_LEN]
uint8_t a3[WLAN_ADDR_LEN]
union p80211_hdr p80211_hdr_t
#define WLAN_GET_FC_TODS(n)
#define WLAN_GET_FC_FROMDS(n)
uint8_t a1[WLAN_ADDR_LEN]
uint8_t wlan_bss_ts_t[WLAN_BSS_TS_LEN]
#define __WLAN_ATTRIB_PACK__
#define WLAN_CTL_FRAMELEN(fstype)
#define WLAN_GET_FC_FTYPE(n)
#define WLAN_GET_FC_FSTYPE(n)
struct p80211_hdr_a4 p80211_hdr_a4_t
static uint16_t p80211_headerlen(uint16_t fctl)