📄 802.11.h
字号:
/* Management Frames *//* Management Frame Constants *//* Fixed fields */#define DOT11_MNG_AUTH_ALGO_LEN 2 /* d11 management auth. algo. length */#define DOT11_MNG_AUTH_SEQ_LEN 2 /* d11 management auth. seq. length */#define DOT11_MNG_BEACON_INT_LEN 2 /* d11 management beacon interval length */#define DOT11_MNG_CAP_LEN 2 /* d11 management cap. length */#define DOT11_MNG_AP_ADDR_LEN 6 /* d11 management AP address length */#define DOT11_MNG_LISTEN_INT_LEN 2 /* d11 management listen interval length */#define DOT11_MNG_REASON_LEN 2 /* d11 management reason length */#define DOT11_MNG_AID_LEN 2 /* d11 management AID length */#define DOT11_MNG_STATUS_LEN 2 /* d11 management status length */#define DOT11_MNG_TIMESTAMP_LEN 8 /* d11 management timestamp length *//* DUR/ID field in assoc resp is 0xc000 | AID */#define DOT11_AID_MASK 0x3fff /* d11 AID mask *//* Reason Codes */#define DOT11_RC_RESERVED 0 /* d11 RC reserved */#define DOT11_RC_UNSPECIFIED 1 /* Unspecified reason */#define DOT11_RC_AUTH_INVAL 2 /* Previous authentication no longer * valid */#define DOT11_RC_DEAUTH_LEAVING 3 /* Deauthenticated because sending station * is leaving (or has left) IBSS or ESS */#define DOT11_RC_INACTIVITY 4 /* Disassociated due to inactivity */#define DOT11_RC_BUSY 5 /* Disassociated because AP is unable * to handle all currently associated * stations */#define DOT11_RC_INVAL_CLASS_2 6 /* Class 2 frame received from * nonauthenticated station */#define DOT11_RC_INVAL_CLASS_3 7 /* Class 3 frame received from * nonassociated station */#define DOT11_RC_DISASSOC_LEAVING 8 /* Disassociated because sending station is * leaving (or has left) BSS */#define DOT11_RC_NOT_AUTH 9 /* Station requesting (re)association is * not authenticated with responding * station */#define DOT11_RC_MAX 23 /* Reason codes > 23 are reserved *//* Status Codes */#define DOT11_STATUS_SUCCESS 0 /* Successful */#define DOT11_STATUS_FAILURE 1 /* Unspecified failure */#define DOT11_STATUS_CAP_MISMATCH 10 /* Cannot support all requested * capabilities in the Capability * Information field */#define DOT11_STATUS_REASSOC_FAIL 11 /* Reassociation denied due to inability * to confirm that association exists */#define DOT11_STATUS_ASSOC_FAIL 12 /* Association denied due to reason * outside the scope of this standard */#define DOT11_STATUS_AUTH_MISMATCH 13 /* Responding station does not support * the specified authentication * algorithm */#define DOT11_STATUS_AUTH_SEQ 14 /* Received an Authentication frame * with authentication transaction * sequence number out of expected * sequence */#define DOT11_STATUS_AUTH_CHALLENGE_FAIL 15 /* Authentication rejected because of * challenge failure */#define DOT11_STATUS_AUTH_TIMEOUT 16 /* Authentication rejected due to timeout * waiting for next frame in sequence */#define DOT11_STATUS_ASSOC_BUSY_FAIL 17 /* Association denied because AP is * unable to handle additional * associated stations */#define DOT11_STATUS_ASSOC_RATE_MISMATCH 18 /* Association denied due to requesting * station not supporting all of the * data rates in the BSSBasicRateSet * parameter */#define DOT11_STATUS_ASSOC_SHORT_REQUIRED 19 /* Association denied due to requesting * station not supporting the Short * Preamble option */#define DOT11_STATUS_ASSOC_PBCC_REQUIRED 20 /* Association denied due to requesting * station not supporting the PBCC * Modulation option */#define DOT11_STATUS_ASSOC_AGILITY_REQUIRED 21 /* Association denied due to requesting * station not supporting the Channel * Agility option */#define DOT11_STATUS_ASSOC_SPECTRUM_REQUIRED 22 /* Association denied because Spectrum * Management capability is required. */#define DOT11_STATUS_ASSOC_BAD_POWER_CAP 23 /* Association denied because the info * in the Power Cap element is * unacceptable. */#define DOT11_STATUS_ASSOC_BAD_SUP_CHANNELS 24 /* Association denied because the info * in the Supported Channel element is * unacceptable */#define DOT11_STATUS_ASSOC_SHORTSLOT_REQUIRED 25 /* Association denied due to requesting * station not supporting the Short Slot * Time option */#define DOT11_STATUS_ASSOC_ERPBCC_REQUIRED 26 /* Association denied due to requesting * station not supporting the ER-PBCC * Modulation option */#define DOT11_STATUS_ASSOC_DSSOFDM_REQUIRED 27 /* Association denied due to requesting * station not supporting the DSS-OFDM * option *//* Info Elts, length of INFORMATION portion of Info Elts */#define DOT11_MNG_DS_PARAM_LEN 1 /* d11 management DS parameter length */#define DOT11_MNG_IBSS_PARAM_LEN 2 /* d11 management IBSS parameter length *//* TIM Info element has 3 bytes fixed info in INFORMATION field, * followed by 1 to 251 bytes of Partial Virtual Bitmap */#define DOT11_MNG_TIM_FIXED_LEN 3 /* d11 management TIM fixed length */#define DOT11_MNG_TIM_DTIM_COUNT 0 /* d11 management DTIM count */#define DOT11_MNG_TIM_DTIM_PERIOD 1 /* d11 management DTIM period */#define DOT11_MNG_TIM_BITMAP_CTL 2 /* d11 management TIM BITMAP control */#define DOT11_MNG_TIM_PVB 3 /* d11 management TIM PVB *//* TLV defines */#define TLV_TAG_OFF 0 /* tag offset */#define TLV_LEN_OFF 1 /* length offset */#define TLV_HDR_LEN 2 /* header length */#define TLV_BODY_OFF 2 /* body offset *//* Management Frame Information Element IDs */#define DOT11_MNG_SSID_ID 0 /* d11 management SSID id */#define DOT11_MNG_RATES_ID 1 /* d11 management rates id */#define DOT11_MNG_FH_PARMS_ID 2 /* d11 management FH parameter id */#define DOT11_MNG_DS_PARMS_ID 3 /* d11 management DS parameter id */#define DOT11_MNG_CF_PARMS_ID 4 /* d11 management CF parameter id */#define DOT11_MNG_TIM_ID 5 /* d11 management TIM id */#define DOT11_MNG_IBSS_PARMS_ID 6 /* d11 management IBSS parameter id */#define DOT11_MNG_COUNTRY_ID 7 /* d11 management country id */#define DOT11_MNG_HOPPING_PARMS_ID 8 /* d11 management hopping parameter id */#define DOT11_MNG_HOPPING_TABLE_ID 9 /* d11 management hopping table id */#define DOT11_MNG_REQUEST_ID 10 /* d11 management request id */#define DOT11_MNG_QBSS_LOAD_ID 11 /* d11 management QBSS Load id */#define DOT11_MNG_CHALLENGE_ID 16 /* d11 management chanllenge id */#define DOT11_MNG_PWR_CONSTRAINT_ID 32 /* 11H PowerConstraint */#define DOT11_MNG_PWR_CAP_ID 33 /* 11H PowerCapability */#define DOT11_MNG_TPC_REQUEST_ID 34 /* 11H TPC Request */#define DOT11_MNG_TPC_REPORT_ID 35 /* 11H TPC Report */#define DOT11_MNG_SUPP_CHANNELS_ID 36 /* 11H Supported Channels */#define DOT11_MNG_CHANNEL_SWITCH_ID 37 /* 11H ChannelSwitch Announcement */#define DOT11_MNG_MEASURE_REQUEST_ID 38 /* 11H MeasurementRequest */#define DOT11_MNG_MEASURE_REPORT_ID 39 /* 11H MeasurementReport */#define DOT11_MNG_QUIET_ID 40 /* 11H Quiet */#define DOT11_MNG_IBSS_DFS_ID 41 /* 11H IBSS_DFS */#define DOT11_MNG_ERP_ID 42 /* d11 management ERP id */#define DOT11_MNG_TS_DELAY_ID 43 /* d11 management TS Delay id */#define DOT11_MNG_NONERP_ID 47 /* d11 management NON-ERP id */#define DOT11_MNG_RSN_ID 48 /* d11 management RSN id */#define DOT11_MNG_EXT_RATES_ID 50 /* d11 management ext. rates id */#define DOT11_MNG_WPA_ID 221 /* d11 management WPA id */#define DOT11_MNG_PROPR_ID 221 /* d11 management proprietary id *//* Rate element Basic flag and rate mask */#define DOT11_RATE_BASIC 0x80 /* flag for a Basic Rate */#define DOT11_RATE_MASK 0x7F /* mask for numeric part of rate *//* ERP info element bit values */#define DOT11_MNG_ERP_LEN 1 /* ERP is currently 1 byte long */#define DOT11_MNG_NONERP_PRESENT 0x01 /* NonERP (802.11b) STAs are present *in the BSS */#define DOT11_MNG_USE_PROTECTION 0x02 /* Use protection mechanisms for *ERP-OFDM frames */#define DOT11_MNG_BARKER_PREAMBLE 0x04 /* Short Preambles: 0 == allowed, * 1 == not allowed *//* TS Delay element offset & size */#define DOT11_MGN_TS_DELAY_LEN 4 /* length of TS DELAY IE */#define TS_DELAY_FIELD_SIZE 4 /* TS DELAY field size *//* Capability Information Field */#define DOT11_CAP_ESS 0x0001 /* d11 cap. ESS */#define DOT11_CAP_IBSS 0x0002 /* d11 cap. IBSS */#define DOT11_CAP_POLLABLE 0x0004 /* d11 cap. pollable */#define DOT11_CAP_POLL_RQ 0x0008 /* d11 cap. poll request */#define DOT11_CAP_PRIVACY 0x0010 /* d11 cap. privacy */#define DOT11_CAP_SHORT 0x0020 /* d11 cap. short */#define DOT11_CAP_PBCC 0x0040 /* d11 cap. PBCC */#define DOT11_CAP_AGILITY 0x0080 /* d11 cap. agility */#define DOT11_CAP_SPECTRUM 0x0100 /* d11 cap. spectrum */#define DOT11_CAP_SHORTSLOT 0x0400 /* d11 cap. shortslot */#define DOT11_CAP_CCK_OFDM 0x2000 /* d11 cap. CCK/OFDM *//* Action Frame Constants */#define DOT11_ACTION_CAT_ERR_MASK 0x80 /* d11 action category error mask */#define DOT11_ACTION_CAT_SPECT_MNG 0x00 /* d11 action category spectrum management */#define DOT11_ACTION_CAT_BLOCKACK 0x03 /* d11 action category block ack */#define DOT11_ACTION_NOTIFICATION 0x11 /* 17 */#define DOT11_ACTION_ID_M_REQ 0 /* d11 action measurement request */#define DOT11_ACTION_ID_M_REP 1 /* d11 action measurement response */#define DOT11_ACTION_ID_TPC_REQ 2 /* d11 action TPC request */#define DOT11_ACTION_ID_TPC_REP 3 /* d11 action TPC response */#define DOT11_ACTION_ID_CHANNEL_SWITCH 4 /* d11 action channel switch *//* MLME Enumerations */#define DOT11_BSSTYPE_INFRASTRUCTURE 0 /* d11 infrastructure */#define DOT11_BSSTYPE_INDEPENDENT 1 /* d11 independent */#define DOT11_BSSTYPE_ANY 2 /* d11 any BSS type */#define DOT11_SCANTYPE_ACTIVE 0 /* d11 scan active */#define DOT11_SCANTYPE_PASSIVE 1 /* d11 scan passive *//* 802.11 A PHY constants */#define APHY_SLOT_TIME 9 /* APHY slot time */#define APHY_SIFS_TIME 16 /* APHY SIFS time */#define APHY_DIFS_TIME (APHY_SIFS_TIME + (2 * APHY_SLOT_TIME)) /* APHY DIFS time */#define APHY_PREAMBLE_TIME 16 /* APHY preamble time */#define APHY_SIGNAL_TIME 4 /* APHY signal time */#define APHY_SYMBOL_TIME 4 /* APHY symbol time */#define APHY_SERVICE_NBITS 16 /* APHY service nbits */#define APHY_TAIL_NBITS 6 /* APHY tail nbits */#define APHY_CWMIN 15 /* APHY cwmin *//* 802.11 B PHY constants */#define BPHY_SLOT_TIME 20 /* BPHY slot time */#define BPHY_SIFS_TIME 10 /* BPHY SIFS time */#define BPHY_DIFS_TIME 50 /* BPHY DIFS time */#define BPHY_PLCP_TIME 192 /* BPHY PLCP time */#define BPHY_PLCP_SHORT_TIME 96 /* BPHY PLCP short time */#define BPHY_CWMIN 31 /* BPHY cwmin *//* 802.11 G constants */#define DOT11_OFDM_SIGNAL_EXTENSION 6 /* d11 OFDM signal extension */#define PHY_CWMAX 1023 /* PHY cwmax */#define DOT11_MAXNUMFRAGS 16 /* max # fragments per MSDU *//* dot11Counters Table - 802.11 spec., Annex D */typedef struct d11cnt { uint32 txfrag; /* dot11TransmittedFragmentCount */ uint32 txmulti; /* dot11MulticastTransmittedFrameCount */ uint32 txfail; /* dot11FailedCount */ uint32 txretry; /* dot11RetryCount */ uint32 txretrie; /* dot11MultipleRetryCount */ uint32 rxdup; /* dot11FrameduplicateCount */ uint32 txrts; /* dot11RTSSuccessCount */ uint32 txnocts; /* dot11RTSFailureCount */ uint32 txnoack; /* dot11ACKFailureCount */ uint32 rxfrag; /* dot11ReceivedFragmentCount */ uint32 rxmulti; /* dot11MulticastReceivedFrameCount */ uint32 rxcrc; /* dot11FCSErrorCount */ uint32 txfrmsnt; /* dot11TransmittedFrameCount */ uint32 rxundec; /* dot11WEPUndecryptableCount */} d11cnt_t;/* BRCM OUI */#define BRCM_OUI "\x00\x10\x18" /* Broadcom OUI *//* OUI for BRCM proprietary IE */#define BRCM_PROP_OUI "\x00\x90\x4C" /* Broadcom proprietary OUI *//* BRCM info element */struct brcm_ie { uint8 id; /* IE ID, 221, DOT11_MNG_PROPR_ID */ uint8 len; /* IE length */ uint8 oui[3]; /* Proprietary OUI, BRCM_OUI */ uint8 ver; /* type/ver of this IE */ uint8 assoc; /* # of assoc STAs */ uint8 flags; /* misc flags */ uint8 flags1; /* misc flags */ uint16 amsdu_mtu_pref; /* preferred A-MSDU MTU */} PACKED;typedef struct brcm_ie brcm_ie_t;#define BRCM_IE_LEN 11 /* BRCM IE length */#define BRCM_IE_VER 2 /* BRCM IE version */#define BRCM_IE_LEGACY_AES_VER 1 /* BRCM IE legacy AES version *//* Vendor IE structure */struct vndr_ie { uchar id; uchar len; uchar oui [3]; uchar data [1]; /* Variable size data */}PACKED;typedef struct vndr_ie vndr_ie_t;#define VNDR_IE_HDR_LEN 2 /* id + len field */#define VNDR_IE_MIN_LEN 3 /* size of the oui field */#define VNDR_IE_MAX_LEN 256 /* verdor IE max length *//* WPA definitions */#define WPA_VERSION 1 /* WPA version */#define WPA_OUI "\x00\x50\xF2" /* WPA OUI */#define WPA2_VERSION 1 /* WPA2 version */#define WPA2_VERSION_LEN 2 /* WAP2 version length */#define WPA2_OUI "\x00\x0F\xAC" /* WPA2 OUI */#define WPA_OUI_LEN 3 /* WPA OUI length *//* RSN authenticated key managment suite */#define RSN_AKM_NONE 0 /* None (IBSS) */#define RSN_AKM_UNSPECIFIED 1 /* Over 802.1x */#define RSN_AKM_PSK 2 /* Pre-shared Key *//* Key related defines */#define DOT11_MAX_DEFAULT_KEYS 4 /* number of default keys */#define DOT11_MAX_KEY_SIZE 32 /* max size of any key */#define DOT11_MAX_IV_SIZE 16 /* max size of any IV */#define DOT11_EXT_IV_FLAG (1<<5) /* flag to indicate IV is > 4 bytes */#define WEP1_KEY_SIZE 5 /* max size of any WEP key */#define WEP1_KEY_HEX_SIZE 10 /* size of WEP key in hex. */#define WEP128_KEY_SIZE 13 /* max size of any WEP key */#define WEP128_KEY_HEX_SIZE 26 /* size of WEP key in hex. */#define TKIP_MIC_SIZE 8 /* size of TKIP MIC */#define TKIP_EOM_SIZE 7 /* max size of TKIP EOM */#define TKIP_EOM_FLAG 0x5a /* TKIP EOM flag byte */#define TKIP_KEY_SIZE 32 /* size of any TKIP key */#define TKIP_MIC_AUTH_TX 16 /* offset to Authenticator MIC TX key */#define TKIP_MIC_AUTH_RX 24 /* offset to Authenticator MIC RX key */#define TKIP_MIC_SUP_RX 16 /* offset to Supplicant MIC RX key */#define TKIP_MIC_SUP_TX 24 /* offset to Supplicant MIC TX key */#define AES_KEY_SIZE 16 /* size of AES key */#undef PACKED#if !defined(__GNUC__)#pragma pack()#endif#endif /* _802_11_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -