nodemcu-firmware/app/include/sys/network_80211.h

99 lines
2.4 KiB
C
Raw Permalink Normal View History

#define FRAME_TYPE_MANAGEMENT 0
#define FRAME_TYPE_CONTROL 1
#define FRAME_TYPE_DATA 2
#define FRAME_SUBTYPE_ASSOC_REQUEST 0x00
#define FRAME_SUBTYPE_ASSOC_RESPONSE 0x01
#define FRAME_SUBTYPE_REASSOC_REQUEST 0x02
#define FRAME_SUBTYPE_REASSOC_RESPONSE 0x03
#define FRAME_SUBTYPE_PROBE_REQUEST 0x04
#define FRAME_SUBTYPE_PROBE_RESPONSE 0x05
#define FRAME_SUBTYPE_BEACON 0x08
#define FRAME_SUBTYPE_ATIM 0x09
#define FRAME_SUBTYPE_DISASSOCIATION 0x0a
#define FRAME_SUBTYPE_AUTHENTICATION 0x0b
#define FRAME_SUBTYPE_DEAUTHENTICATION 0x0c
#define FRAME_SUBTYPE_DATA 0x14
typedef struct framectrl_80211
{
//buf[0]
u8 Protocol:2;
u8 Type:2;
u8 Subtype:4;
//buf[1]
u8 ToDS:1;
u8 FromDS:1;
u8 MoreFlag:1;
u8 Retry:1;
u8 PwrMgmt:1;
u8 MoreData:1;
u8 Protectedframe:1;
u8 Order:1;
} framectrl_80211,*lpframectrl_80211;
typedef struct management_80211
{
struct framectrl_80211 framectrl;
uint16 duration;
uint8 rdaddr[6];
uint8 tsaddr[6];
uint8 bssid[6];
uint16 number;
} management_request_t;
typedef struct
{
management_request_t hdr;
uint8 timestamp[8];
uint16 beacon_interval;
uint16 capability_info;
} wifi_beacon_t;
typedef struct tagged_parameter
{
/* SSID parameter */
uint8 tag_number;
uint8 tag_length;
} tagged_parameter, *ptagged_parameter;
struct RxControl {
signed rssi:8;//<2F><>ʾ<EFBFBD>ð<EFBFBD><C3B0><EFBFBD><EFBFBD>ź<EFBFBD>ǿ<EFBFBD><C7BF>
unsigned rate:4;
unsigned is_group:1;
unsigned:1;
unsigned sig_mode:2;//<2F><>ʾ<EFBFBD>ð<EFBFBD><C3B0>Ƿ<EFBFBD><C7B7><EFBFBD>11n<31>İ<EFBFBD><C4B0><EFBFBD>0<EFBFBD><30>ʾ<EFBFBD><CABE>11n<31><6E><EFBFBD><EFBFBD>0<EFBFBD><30>ʾ11n
unsigned legacy_length:12;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>11n<31>İ<EFBFBD><C4B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>ij<EFBFBD><C4B3><EFBFBD>
unsigned damatch0:1;
unsigned damatch1:1;
unsigned bssidmatch0:1;
unsigned bssidmatch1:1;
unsigned MCS:7;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>11n<31>İ<EFBFBD><C4B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>ĵ<EFBFBD><C4B5>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD>Чֵ<D0A7><D6B5>0-76
unsigned CWB:1;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>11n<31>İ<EFBFBD><C4B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>Ƿ<EFBFBD>ΪHT40<34>İ<EFBFBD>
unsigned HT_length:16;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>11n<31>İ<EFBFBD><C4B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>ij<EFBFBD><C4B3><EFBFBD>
unsigned Smoothing:1;
unsigned Not_Sounding:1;
unsigned:1;
unsigned Aggregation:1;
unsigned STBC:2;
unsigned FEC_CODING:1;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>11n<31>İ<EFBFBD><C4B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>Ƿ<EFBFBD>ΪLDPC<50>İ<EFBFBD>
unsigned SGI:1;
unsigned rxend_state:8;
unsigned ampdu_cnt:8;
unsigned channel:4;//<2F><>ʾ<EFBFBD>ð<EFBFBD><C3B0><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5>ŵ<EFBFBD>
unsigned:12;
};
struct sniffer_buf2{
struct RxControl rx_ctrl;
u8 buf[112];//<2F><><EFBFBD><EFBFBD>ieee80211<31><31>ͷ
u16 cnt;//<2F><><EFBFBD>ĸ<EFBFBD><C4B8><EFBFBD>
u16 len[1];//<2F><><EFBFBD>ij<EFBFBD><C4B3><EFBFBD>
};
struct sniffer_buf{
struct RxControl rx_ctrl;
u8 buf[48];//<2F><><EFBFBD><EFBFBD>ieee80211<31><31>ͷ
u16 cnt;//<2F><><EFBFBD>ĸ<EFBFBD><C4B8><EFBFBD>
u16 len[1];//<2F><><EFBFBD>ij<EFBFBD><C4B3><EFBFBD>
};