📄 wt_stmgt.h
字号:
#ifndef _WT_MGTMT_H#define _WT_MGTMT_H#define ISTATUS_0_STARTED 0#define ISTATUS_1_SCANNING 1#define ISTATUS_2_WAIT_AUTH 2#define ISTATUS_3_AUTHENTICATED 3#define ISTATUS_4_ASSOCIATED 4#define ISTATUS_5_UNKNOWN 5typedef struct associd { UINT16 vala;} associd_t;#ifdef NDIS_MINIPORT_DRIVER#pragma pack(1)#endif#define MAX_COUNTRY_TYPE 7/*-- Country ie ------------------------------*/ typedef struct wlan_country { UINT8 eid ; UINT8 len ; wlan_country_info_t supportcountry[MAX_COUNTRY_TYPE] ;} wlan_country_t;/*---erp info----------------------------------*/ typedef struct wlan_erp { UINT8 eid ; UINT8 len ; UINT8 erpinfo ;} wlan_erp_t;#define MAX_EXTEND_RATES 255/*-- Extend Supported Rates -----------------------------*/ typedef struct wlan_extend_rates { UINT8 eid ; UINT8 len ; UINT8 extrates[MAX_EXTEND_RATES] ; } wlan_extend_rates_t;/*-- Hopping Pattern Parameters Information Element----------*/ typedef struct wlan_fhparms { UINT8 eid ; UINT8 len ; UINT8 PrimeRadix ; UINT8 NumChannel ; } wlan_fhparms_t;/*-- FH Pattern Table----------*/#define MAX_FH_PATTERNTABLE 255 /*check */ typedef struct wlan_fhpatterntable { UINT8 eid ; UINT8 len ; UINT8 FHPatternTable[MAX_FH_PATTERNTABLE] ; } wlan_fhpatterntable_t;/*-- request info----------*/#define MAX_PROB_REQUEST 255 /*check */ typedef struct wlan_requestinfo { UINT8 eid ; UINT8 len ; UINT8 requestinfo[MAX_PROB_REQUEST] ; } wlan_requestinfo_t;/*-- power constraint---------*/#define MAX_POWER_CONSTRAINT 255 /*check */ typedef struct wlan_powerconstraint { UINT8 eid ; UINT8 len ; UINT8 powerconstraint[MAX_POWER_CONSTRAINT] ; } wlan_powerconstraint_t;/*-- channel switch announcement---------*/#define MAX_SWCHANNELA 255 typedef struct wlan_channelswa { UINT8 eid ; UINT8 len ; UINT8 channelswa[MAX_SWCHANNELA] ; } wlan_channelswa_t;/*-- Quiet----------------------------*/#define MAX_QUIET 255 typedef struct wlan_quiet { UINT8 eid ; UINT8 len ; UINT8 quiet[MAX_QUIET] ; } wlan_quiet_t;/*-- IBSS DFS----------------------------*/#define MAX_DFS 255 typedef struct wlan_ibssdfs { UINT8 eid ; UINT8 len ; UINT8 ibssdfs[MAX_DFS] ; } wlan_ibssdfs_t;/*-- TPC Report----------------------------*/#define MAX_TPCREPORT 255 typedef struct wlan_tpcreport { UINT8 eid ; UINT8 len ; UINT8 tpcreport[MAX_TPCREPORT] ; } wlan_tpcreport_t;/*-- RSN----------------------------*/#define MAX_RSN 24 typedef struct wlan_rsn { UINT8 eid ; UINT8 len ; UINT8 rsn[MAX_RSN] ; } wlan_rsn_t;/*-- IBSS Parameter Set ---------------------------*/ typedef struct ibss_parms { UINT8 eid ; UINT8 len ; UINT16 atim_win ;} ibss_parms_t;/*typedef struct tim { UINT16 size; char buf[0x100];} tim_t;*//*-- TIM ------------------------------------------*/ typedef struct tim { UINT8 eid ; UINT8 len ; UINT8 dtim_cnt ; UINT8 dtim_period ; UINT8 bitmap_ctl ; UINT8 virt_bm[256] ;} tim_t;#define MAX_NUMBER_OF_SITE 31typedef struct _ssid { UINT8 element_ID; UINT8 length; UINT8 inf[32];} ssid_t;#define ELE_LEN_SUPPORT_RATES 8typedef struct _rates { UINT8 element_ID; UINT8 length; UINT8 sup_rates[ELE_LEN_SUPPORT_RATES];} rates_t;typedef struct fhps { UINT8 element_ID; UINT8 length; UINT16 dwell_time; UINT8 hop_set; UINT8 hop_pattern; UINT8 hop_index;} fhps_t;typedef struct dsps { UINT8 element_ID; UINT8 length; UINT8 curr_channel;} dsps_t;typedef struct cfps { UINT8 element_ID; UINT8 length; UINT8 cfp_count; UINT8 cfp_period; UINT16 cfp_max_dur; UINT16 cfp_dur_rem;} cfps_t;typedef struct challenge_text { UINT8 element_ID; UINT8 length; UINT8 text[253];} challenge_text_t;#ifdef NDIS_MINIPORT_DRIVER#pragma pack()#endiftypedef struct powermgmt { UINT8 wakeup_cfg; UINT8 listen_interval; /* for EACH_ITVL: wake up every "beacon units" interval */ UINT8 options; UINT8 hangover_period; /* remaining wake time after Tx MPDU w/ PS bit, in values of 1/1024 seconds */ UINT16 enhanced_ps_transition_time; /* rem. wake time for Enh. PS */} powermgmt_t;typedef struct defaultkey { UINT8 num;} defaultkey_t;typedef struct sub3info { UINT8 size; UINT8 buf[0x4];} sub3info_t;typedef struct subsubinfo { UINT8 size; struct sub3info buf;} subsubinfo_t;typedef struct subinfo { UINT16 size; char buf[0x8]; struct subsubinfo buf2; char buf3[0x8];} subinfo_t;typedef struct beaconinfo { UINT16 size; UINT16 status; UINT8 addr1[0x6]; UINT8 addr2[0x6]; UINT8 addr3[0x6]; struct subinfo inf; UINT8 buf[0x1c];} beaconinfo_t;typedef struct beacon_s { UINT16 size; struct beaconinfo inf;// UINT16 vala;} beacon_t;typedef struct scan_s { UINT16 count; /* number of scans to do */ UINT16 start_chan; UINT16 flags; UINT8 max_rate; /* max. probe rate */ UINT8 options; UINT16 chan_duration; UINT16 max_probe_delay;} scan_t; /* length 0xc */typedef struct proberesp { UINT16 size; char buf[0x54];} proberesp_t;typedef struct probereq { UINT16 size; char buf[0x44];} probereq_t;#define ESSID_MAX_SIZE 30typedef struct joinbss { UINT8 bssid[WLAN_ADDR_LEN]; UINT16 beacon_interval; UINT8 dtim_interval; UINT8 rates_basic; UINT8 rates_supported; UINT8 rate_tx; UINT8 preamble_type; UINT8 macmode; UINT8 channel; UINT8 essid_len; char essid[ESSID_MAX_SIZE]; } joinbss_t; /* * I am temporarily redefining this because the above struct is somewhat wrong. * * NOTE: this is a generic struct for all sorts of different packet types. * As such I guess that someone got confused about structure layout. * In other words: it always has an "official" packet header (A4?) * and then a custom packet body. * The current form is probably a bit sub-optimal. However let's keep it * for now and then redefine it later. Or maybe change it now to have a * better struct layout for all sorts of management packets? */typedef struct acxp80211_hdr { p80211_hdr_a3_t a4; UINT8 val0x18[8]; /* this contains the Logical Link Control data the first three bytes are the dsap, ssap and control respectively. the following 3 bytes are either ieee_oui or an RFC. See p80211conv.c/h for more. */ UINT16 beacon_interval; UINT16 caps; UINT8 info[0x30]; /* 0x24 */ /* * info[1] is essid_len * &info[2] is essid (max. 32 chars) * FIXME: huh, then sizeof(info) == 0x18 cannot be correct! Adjusting * to 0x30, which extends to end of this struct */// p80211_hdr_a4_t b4;} acxp80211_hdr_t; /* size: 0x54 *//* struct used for Beacon and for Probe Response frames */typedef struct acxp80211_beacon_prb_resp { p80211_hdr_a3_t hdr; /* 24 Bytes */ UINT8 timestamp[8]; /* 8 Bytes */ UINT16 beacon_interval; /* 2 Bytes */ UINT16 caps; /* 2 Bytes */ UINT8 info[48]; /* 48 Bytes */#if INFO_CONSISTS_OF UINT8 ssid[1+1+IW_ESSID_MAX_SIZE]; /* 34 Bytes */ UINT8 supp_rates[1+1+8]; /* 10 Bytes */ UINT8 ds_parms[1+1+1]; /* 3 Bytes */ UINT8 filler; /* 1 Byte alignment filler */#endif} acxp80211_beacon_prb_resp_t;typedef struct acxp80211_packet { UINT16 size; /* packet len indicator for firmware */ struct acxp80211_hdr hdr; /* actual packet */} acxp80211_packet_t; /* size: 0x56 */typedef struct acxp80211_beacon_prb_resp_template { UINT16 size; /* packet len indicator for firmware */ struct acxp80211_beacon_prb_resp pkt;} acxp80211_beacon_prb_resp_template_t;typedef struct acxp80211_nullframe { UINT16 size; struct p80211_hdr_a3 hdr;} acxp80211_nullframe_t;typedef struct { UINT32 offset; UINT32 len;} radioinit_t;typedef struct p80211mgmt_fr_t { union { wlan_fr_mgmt_t mgmt; wlan_fr_assocreq_t assocreq; wlan_fr_reassocreq_t reassocreq; wlan_fr_assocresp_t assocresp; wlan_fr_reassocresp_t reassocresp; wlan_fr_beacon_t beacon; wlan_fr_disassoc_t disassoc; wlan_fr_authen_t authen; wlan_fr_deauthen_t deauthen; wlan_fr_proberesp_t proberesp; } a;} p80211mgmt_fr_t;typedef struct client { UINT16 aid; /* association ID */ char address[WLAN_ADDR_LEN]; /* 0x2 */ UINT8 val0x8; UINT8 used; /* 0x9 */ UINT16 val0xa; UINT16 auth_alg; UINT16 val0xe; UINT8 *val0x10; // points to some data, don't know what yet UINT32 unkn0x14; UINT8 val0x18[0x80]; /* 0x18, used by wt40_process_authen() */ UINT16 val0x98; UINT16 val0x9a; UINT8 pad5[8]; /* 0x9c */ struct client *next; /* 0xa4 */} client_t;typedef struct rxhostdescriptor rxhostdescriptor_t;typedef struct rxbuffer rxbuffer_t;typedef struct auth_frame_body { UINT16 auth_alg; UINT16 auth_seq; UINT16 status; challenge_text_t challenge;} auth_frame_body_t;typedef struct assocresp_frame_body { UINT16 cap_info; UINT16 status; UINT16 aid; rates_t rates;} assocresp_frame_body_t;typedef struct reassocreq_frame_body { UINT16 cap_info; UINT16 listen_int; UINT8 current_ap[6]; ssid_t ssid; rates_t rates;} reassocreq_frame_body_t;typedef struct reassocresp_frame_body { UINT16 cap_info; UINT16 status; UINT16 aid; rates_t rates;} reassocresp_frame_body_t;typedef struct deauthen_frame_body { UINT16 reason;} deauthen_frame_body_t;typedef struct disassoc_frame_body { UINT16 reason;} disassoc_frame_body_t;typedef struct probereq_frame_body { ssid_t ssid; rates_t rates;} probereq_frame_body_t;typedef struct proberesp_frame_body { UINT8 timestamp[8]; UINT16 beacon_int; UINT16 cap_info; ssid_t ssid; rates_t rates; fhps_t fhps; dsps_t dsps; cfps_t cfps;} proberesp_frame_body_t;typedef struct TxData { UINT16 frame_control; /* 0x0 */ UINT16 duration_id; /* 0x2 */ UINT8 da[WLAN_ADDR_LEN]; /* 0x4 */ UINT8 sa[WLAN_ADDR_LEN]; /* 0xa */ UINT8 bssid[WLAN_BSSID_LEN]; /* 0x10 */ UINT16 sequence_control; /* 0x16 */ union { auth_frame_body_t auth; deauthen_frame_body_t deauthen; /* assocreq_frame_body_t does not exist, since it * contains variable-length members, thus it's no static * struct */ assocresp_frame_body_t assocresp; reassocresp_frame_body_t reassocreq; reassocresp_frame_body_t reassocresp; disassoc_frame_body_t disassoc; probereq_frame_body_t probereq; proberesp_frame_body_t proberesp; char * raw[2400-24]; } body;} TxData; /* size: 2400 *///---------------------------------------------------------------/// move to wt.h laterint WtWlan_is_mac_address_zero(mac_t * mac);void WtWlan_clear_mac_address(mac_t * m);int WtWlan_is_mac_address_equal(UINT8 * one, UINT8 * two);void WtWlan_copy_mac_address(UINT8 *to, const UINT8 * const from);UINT8 WtWlan_is_mac_address_group(mac_t * mac);UINT8 WtWlan_is_mac_address_directed(mac_t * mac);void WtWlan_set_mac_address_broadcast(UINT8 *address);int WtWlan_is_mac_address_broadcast(const UINT8 * const address);int WtWlan_is_mac_address_multicast(mac_t * mac);void WtWlan_log_mac_address(unsigned int level, UINT8 * mac);#endif /* _WT_MGTMT_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -