|
| 1 | +#define FRAME_TYPE_MANAGEMENT 0 |
| 2 | +#define FRAME_TYPE_CONTROL 1 |
| 3 | +#define FRAME_TYPE_DATA 2 |
| 4 | +#define FRAME_SUBTYPE_ASSOC_REQUEST 0x00 |
| 5 | +#define FRAME_SUBTYPE_ASSOC_RESPONSE 0x01 |
| 6 | +#define FRAME_SUBTYPE_REASSOC_REQUEST 0x02 |
| 7 | +#define FRAME_SUBTYPE_REASSOC_RESPONSE 0x03 |
| 8 | +#define FRAME_SUBTYPE_PROBE_REQUEST 0x04 |
| 9 | +#define FRAME_SUBTYPE_PROBE_RESPONSE 0x05 |
| 10 | +#define FRAME_SUBTYPE_BEACON 0x08 |
| 11 | +#define FRAME_SUBTYPE_ATIM 0x09 |
| 12 | +#define FRAME_SUBTYPE_DISASSOCIATION 0x0a |
| 13 | +#define FRAME_SUBTYPE_AUTHENTICATION 0x0b |
| 14 | +#define FRAME_SUBTYPE_DEAUTHENTICATION 0x0c |
| 15 | +#define FRAME_SUBTYPE_DATA 0x14 |
| 16 | +typedef struct framectrl_80211 |
| 17 | +{ |
| 18 | + //buf[0] |
| 19 | + u8 Protocol:2; |
| 20 | + u8 Type:2; |
| 21 | + u8 Subtype:4; |
| 22 | + //buf[1] |
| 23 | + u8 ToDS:1; |
| 24 | + u8 FromDS:1; |
| 25 | + u8 MoreFlag:1; |
| 26 | + u8 Retry:1; |
| 27 | + u8 PwrMgmt:1; |
| 28 | + u8 MoreData:1; |
| 29 | + u8 Protectedframe:1; |
| 30 | + u8 Order:1; |
| 31 | +} framectrl_80211,*lpframectrl_80211; |
| 32 | + |
| 33 | +typedef struct management_80211 |
| 34 | +{ |
| 35 | + struct framectrl_80211 framectrl; |
| 36 | + uint16 duration; |
| 37 | + uint8 rdaddr[6]; |
| 38 | + uint8 tsaddr[6]; |
| 39 | + uint8 bssid[6]; |
| 40 | + uint16 number; |
| 41 | +} management_request_t; |
| 42 | + |
| 43 | +typedef struct |
| 44 | +{ |
| 45 | + management_request_t hdr; |
| 46 | + uint8 timestamp[8]; |
| 47 | + uint16 beacon_interval; |
| 48 | + uint16 capability_info; |
| 49 | +} wifi_beacon_t; |
| 50 | + |
| 51 | +typedef struct tagged_parameter |
| 52 | +{ |
| 53 | + /* SSID parameter */ |
| 54 | + uint8 tag_number; |
| 55 | + uint8 tag_length; |
| 56 | +} tagged_parameter, *ptagged_parameter; |
| 57 | + |
| 58 | +struct RxControl { |
| 59 | + signed rssi:8;//表示该包的信号强度 |
| 60 | + unsigned rate:4; |
| 61 | + unsigned is_group:1; |
| 62 | + unsigned:1; |
| 63 | + unsigned sig_mode:2;//表示该包是否是11n的包,0表示非11n,非0表示11n |
| 64 | + unsigned legacy_length:12;//如果不是11n的包,它表示包的长度 |
| 65 | + unsigned damatch0:1; |
| 66 | + unsigned damatch1:1; |
| 67 | + unsigned bssidmatch0:1; |
| 68 | + unsigned bssidmatch1:1; |
| 69 | + unsigned MCS:7;//如果是11n的包,它表示包的调制编码序列,有效值:0-76 |
| 70 | + unsigned CWB:1;//如果是11n的包,它表示是否为HT40的包 |
| 71 | + unsigned HT_length:16;//如果是11n的包,它表示包的长度 |
| 72 | + unsigned Smoothing:1; |
| 73 | + unsigned Not_Sounding:1; |
| 74 | + unsigned:1; |
| 75 | + unsigned Aggregation:1; |
| 76 | + unsigned STBC:2; |
| 77 | + unsigned FEC_CODING:1;//如果是11n的包,它表示是否为LDPC的包 |
| 78 | + unsigned SGI:1; |
| 79 | + unsigned rxend_state:8; |
| 80 | + unsigned ampdu_cnt:8; |
| 81 | + unsigned channel:4;//表示该包所在的信道 |
| 82 | + unsigned:12; |
| 83 | +}; |
| 84 | + |
| 85 | +struct sniffer_buf2{ |
| 86 | + struct RxControl rx_ctrl; |
| 87 | + u8 buf[112];//包含ieee80211包头 |
| 88 | + u16 cnt;//包的个数 |
| 89 | + u16 len[1];//包的长度 |
| 90 | +}; |
| 91 | + |
| 92 | +struct sniffer_buf{ |
| 93 | + struct RxControl rx_ctrl; |
| 94 | + u8 buf[48];//包含ieee80211包头 |
| 95 | + u16 cnt;//包的个数 |
| 96 | + u16 len[1];//包的长度 |
| 97 | +}; |
| 98 | + |
0 commit comments