80211mgr.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849
  1. /*
  2. * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
  3. * All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along
  16. * with this program; if not, write to the Free Software Foundation, Inc.,
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18. *
  19. *
  20. * File: 80211mgr.h
  21. *
  22. * Purpose: 802.11 management frames pre-defines.
  23. *
  24. *
  25. * Author: Lyndon Chen
  26. *
  27. * Date: May 8, 2002
  28. *
  29. */
  30. #ifndef __80211MGR_H__
  31. #define __80211MGR_H__
  32. #include "ttype.h"
  33. #include "80211hdr.h"
  34. /*--------------------- Export Definitions -------------------------*/
  35. #define WLAN_MIN_ARRAY 1
  36. // Information Element ID value
  37. #define WLAN_EID_SSID 0
  38. #define WLAN_EID_SUPP_RATES 1
  39. #define WLAN_EID_FH_PARMS 2
  40. #define WLAN_EID_DS_PARMS 3
  41. #define WLAN_EID_CF_PARMS 4
  42. #define WLAN_EID_TIM 5
  43. #define WLAN_EID_IBSS_PARMS 6
  44. #define WLAN_EID_COUNTRY 7
  45. #define WLAN_EID_CHALLENGE 16
  46. #define WLAN_EID_PWR_CONSTRAINT 32
  47. #define WLAN_EID_PWR_CAPABILITY 33
  48. #define WLAN_EID_TPC_REQ 34
  49. #define WLAN_EID_TPC_REP 35
  50. #define WLAN_EID_SUPP_CH 36
  51. #define WLAN_EID_CH_SWITCH 37
  52. #define WLAN_EID_MEASURE_REQ 38
  53. #define WLAN_EID_MEASURE_REP 39
  54. #define WLAN_EID_QUIET 40
  55. #define WLAN_EID_IBSS_DFS 41
  56. #define WLAN_EID_ERP 42
  57. // reference 802.11i 7.3.2 table 20
  58. #define WLAN_EID_RSN 48
  59. #define WLAN_EID_EXTSUPP_RATES 50
  60. // reference WiFi WPA spec.
  61. #define WLAN_EID_RSN_WPA 221
  62. #ifdef Cisco_ccx
  63. #define WLAN_EID_CCX 133
  64. #define WLAN_EID_CCX_IP 149
  65. #define WLAN_EID_CCX_Ver 221
  66. #endif
  67. #define WLAN_EID_ERP_NONERP_PRESENT 0x01
  68. #define WLAN_EID_ERP_USE_PROTECTION 0x02
  69. #define WLAN_EID_ERP_BARKER_MODE 0x04
  70. // Reason Codes
  71. #define WLAN_MGMT_REASON_RSVD 0
  72. #define WLAN_MGMT_REASON_UNSPEC 1
  73. #define WLAN_MGMT_REASON_PRIOR_AUTH_INVALID 2
  74. #define WLAN_MGMT_REASON_DEAUTH_LEAVING 3
  75. #define WLAN_MGMT_REASON_DISASSOC_INACTIVE 4
  76. #define WLAN_MGMT_REASON_DISASSOC_AP_BUSY 5
  77. #define WLAN_MGMT_REASON_CLASS2_NONAUTH 6
  78. #define WLAN_MGMT_REASON_CLASS3_NONASSOC 7
  79. #define WLAN_MGMT_REASON_DISASSOC_STA_HASLEFT 8
  80. #define WLAN_MGMT_REASON_CANT_ASSOC_NONAUTH 9
  81. #define WLAN_MGMT_REASON_DISASSOC_PWR_CAP_UNACCEPT 10
  82. #define WLAN_MGMT_REASON_DISASSOC_SUPP_CH_UNACCEPT 11
  83. #define WLAN_MGMT_REASON_INVALID_IE 13
  84. #define WLAN_MGMT_REASON_MIC_FAILURE 14
  85. #define WLAN_MGMT_REASON_4WAY_HANDSHAKE_TIMEOUT 15
  86. #define WLAN_MGMT_REASON_GRPKEY_UPDATE_TIMEOUT 16
  87. #define WLAN_MGMT_REASON_4WAY_INFO_DIFFERENT 17
  88. #define WLAN_MGMT_REASON_MULTCAST_CIPHER_INVALID 18
  89. #define WLAN_MGMT_REASON_UNCAST_CIPHER_INVALID 19
  90. #define WLAN_MGMT_REASON_AKMP_INVALID 20
  91. #define WLAN_MGMT_REASON_RSNE_UNSUPPORTED 21
  92. #define WLAN_MGMT_REASON_RSNE_CAP_INVALID 22
  93. #define WLAN_MGMT_REASON_80211X_AUTH_FAILED 23
  94. // Status Codes
  95. #define WLAN_MGMT_STATUS_SUCCESS 0
  96. #define WLAN_MGMT_STATUS_UNSPEC_FAILURE 1
  97. #define WLAN_MGMT_STATUS_CAPS_UNSUPPORTED 10
  98. #define WLAN_MGMT_STATUS_REASSOC_NO_ASSOC 11
  99. #define WLAN_MGMT_STATUS_ASSOC_DENIED_UNSPEC 12
  100. #define WLAN_MGMT_STATUS_UNSUPPORTED_AUTHALG 13
  101. #define WLAN_MGMT_STATUS_RX_AUTH_NOSEQ 14
  102. #define WLAN_MGMT_STATUS_CHALLENGE_FAIL 15
  103. #define WLAN_MGMT_STATUS_AUTH_TIMEOUT 16
  104. #define WLAN_MGMT_STATUS_ASSOC_DENIED_BUSY 17
  105. #define WLAN_MGMT_STATUS_ASSOC_DENIED_RATES 18
  106. #define WLAN_MGMT_STATUS_ASSOC_DENIED_SHORTPREAMBLE 19
  107. #define WLAN_MGMT_STATUS_ASSOC_DENIED_PBCC 20
  108. #define WLAN_MGMT_STATUS_ASSOC_DENIED_AGILITY 21
  109. // reference 802.11h 7.3.1.9
  110. //
  111. #define WLAN_MGMT_STATUS_ASSOC_REJECT_BCS_SPECTRUM_MNG 22
  112. #define WLAN_MGMT_STATUS_ASSOC_REJECT_BCS_PWR_CAP 23
  113. #define WLAN_MGMT_STATUS_ASSOC_REJECT_BCS_SUPP_CH 24
  114. //
  115. // reference 802.11g 7.3.1.9
  116. //
  117. #define WLAN_MGMT_STATUS_SHORTSLOTTIME_UNSUPPORTED 25
  118. #define WLAN_MGMT_STATUS_DSSSOFDM_UNSUPPORTED 26
  119. //
  120. // reference 802.11i 7.3.1.9 table 19
  121. //
  122. #define WLAN_MGMT_STATUS_INVALID_IE 40
  123. #define WLAN_MGMT_STATUS_GROUP_CIPHER_INVALID 41
  124. #define WLAN_MGMT_STATUS_PAIRWISE_CIPHER_INVALID 42
  125. #define WLAN_MGMT_STATUS_AKMP_INVALID 43
  126. #define WLAN_MGMT_STATUS_UNSUPPORT_RSN_IE_VER 44
  127. #define WLAN_MGMT_STATUS_INVALID_RSN_IE_CAP 45
  128. #define WLAN_MGMT_STATUS_CIPHER_REJECT 46
  129. // Auth Algorithm
  130. #define WLAN_AUTH_ALG_OPENSYSTEM 0
  131. #define WLAN_AUTH_ALG_SHAREDKEY 1
  132. // Management Frame Field Offsets
  133. // Note: Not all fields are listed because of variable lengths.
  134. // Note: These offsets are from the start of the frame data
  135. #define WLAN_BEACON_OFF_TS 0
  136. #define WLAN_BEACON_OFF_BCN_INT 8
  137. #define WLAN_BEACON_OFF_CAPINFO 10
  138. #define WLAN_BEACON_OFF_SSID 12
  139. #define WLAN_DISASSOC_OFF_REASON 0
  140. #define WLAN_ASSOCREQ_OFF_CAP_INFO 0
  141. #define WLAN_ASSOCREQ_OFF_LISTEN_INT 2
  142. #define WLAN_ASSOCREQ_OFF_SSID 4
  143. #define WLAN_ASSOCRESP_OFF_CAP_INFO 0
  144. #define WLAN_ASSOCRESP_OFF_STATUS 2
  145. #define WLAN_ASSOCRESP_OFF_AID 4
  146. #define WLAN_ASSOCRESP_OFF_SUPP_RATES 6
  147. #define WLAN_REASSOCREQ_OFF_CAP_INFO 0
  148. #define WLAN_REASSOCREQ_OFF_LISTEN_INT 2
  149. #define WLAN_REASSOCREQ_OFF_CURR_AP 4
  150. #define WLAN_REASSOCREQ_OFF_SSID 10
  151. #define WLAN_REASSOCRESP_OFF_CAP_INFO 0
  152. #define WLAN_REASSOCRESP_OFF_STATUS 2
  153. #define WLAN_REASSOCRESP_OFF_AID 4
  154. #define WLAN_REASSOCRESP_OFF_SUPP_RATES 6
  155. #define WLAN_PROBEREQ_OFF_SSID 0
  156. #define WLAN_PROBERESP_OFF_TS 0
  157. #define WLAN_PROBERESP_OFF_BCN_INT 8
  158. #define WLAN_PROBERESP_OFF_CAP_INFO 10
  159. #define WLAN_PROBERESP_OFF_SSID 12
  160. #define WLAN_AUTHEN_OFF_AUTH_ALG 0
  161. #define WLAN_AUTHEN_OFF_AUTH_SEQ 2
  162. #define WLAN_AUTHEN_OFF_STATUS 4
  163. #define WLAN_AUTHEN_OFF_CHALLENGE 6
  164. #define WLAN_DEAUTHEN_OFF_REASON 0
  165. //
  166. // Cipher Suite Selectors defiened in 802.11i
  167. //
  168. #define WLAN_11i_CSS_USE_GROUP 0
  169. #define WLAN_11i_CSS_WEP40 1
  170. #define WLAN_11i_CSS_TKIP 2
  171. #define WLAN_11i_CSS_CCMP 4
  172. #define WLAN_11i_CSS_WEP104 5
  173. #define WLAN_11i_CSS_UNKNOWN 255
  174. //
  175. // Authentication and Key Management Suite Selectors defined in 802.11i
  176. //
  177. #define WLAN_11i_AKMSS_802_1X 1
  178. #define WLAN_11i_AKMSS_PSK 2
  179. #define WLAN_11i_AKMSS_UNKNOWN 255
  180. // Measurement type definitions reference ieee 802.11h Table 20b
  181. #define MEASURE_TYPE_BASIC 0
  182. #define MEASURE_TYPE_CCA 1
  183. #define MEASURE_TYPE_RPI 2
  184. // Measurement request mode definitions reference ieee 802.11h Figure 46h
  185. #define MEASURE_MODE_ENABLE 0x02
  186. #define MEASURE_MODE_REQ 0x04
  187. #define MEASURE_MODE_REP 0x08
  188. // Measurement report mode definitions reference ieee 802.11h Figure 46m
  189. #define MEASURE_MODE_LATE 0x01
  190. #define MEASURE_MODE_INCAPABLE 0x02
  191. #define MEASURE_MODE_REFUSED 0x04
  192. /*--------------------- Export Classes ----------------------------*/
  193. /*--------------------- Export Variables --------------------------*/
  194. /*--------------------- Export Types ------------------------------*/
  195. // Information Element Types
  196. #pragma pack(1)
  197. typedef struct tagWLAN_IE {
  198. BYTE byElementID;
  199. BYTE len;
  200. } __attribute__ ((__packed__))
  201. WLAN_IE, *PWLAN_IE;
  202. // Service Set Identity (SSID)
  203. #pragma pack(1)
  204. typedef struct tagWLAN_IE_SSID {
  205. BYTE byElementID;
  206. BYTE len;
  207. BYTE abySSID[1];
  208. } __attribute__ ((__packed__))
  209. WLAN_IE_SSID, *PWLAN_IE_SSID;
  210. // Supported Rates
  211. #pragma pack(1)
  212. typedef struct tagWLAN_IE_SUPP_RATES {
  213. BYTE byElementID;
  214. BYTE len;
  215. BYTE abyRates[1];
  216. } __attribute__ ((__packed__))
  217. WLAN_IE_SUPP_RATES, *PWLAN_IE_SUPP_RATES;
  218. // FH Parameter Set
  219. #pragma pack(1)
  220. typedef struct _WLAN_IE_FH_PARMS {
  221. BYTE byElementID;
  222. BYTE len;
  223. WORD wDwellTime;
  224. BYTE byHopSet;
  225. BYTE byHopPattern;
  226. BYTE byHopIndex;
  227. } WLAN_IE_FH_PARMS, *PWLAN_IE_FH_PARMS;
  228. // DS Parameter Set
  229. #pragma pack(1)
  230. typedef struct tagWLAN_IE_DS_PARMS {
  231. BYTE byElementID;
  232. BYTE len;
  233. BYTE byCurrChannel;
  234. } __attribute__ ((__packed__))
  235. WLAN_IE_DS_PARMS, *PWLAN_IE_DS_PARMS;
  236. // CF Parameter Set
  237. #pragma pack(1)
  238. typedef struct tagWLAN_IE_CF_PARMS {
  239. BYTE byElementID;
  240. BYTE len;
  241. BYTE byCFPCount;
  242. BYTE byCFPPeriod;
  243. WORD wCFPMaxDuration;
  244. WORD wCFPDurRemaining;
  245. } __attribute__ ((__packed__))
  246. WLAN_IE_CF_PARMS, *PWLAN_IE_CF_PARMS;
  247. // TIM
  248. #pragma pack(1)
  249. typedef struct tagWLAN_IE_TIM {
  250. BYTE byElementID;
  251. BYTE len;
  252. BYTE byDTIMCount;
  253. BYTE byDTIMPeriod;
  254. BYTE byBitMapCtl;
  255. BYTE byVirtBitMap[1];
  256. } __attribute__ ((__packed__))
  257. WLAN_IE_TIM, *PWLAN_IE_TIM;
  258. // IBSS Parameter Set
  259. #pragma pack(1)
  260. typedef struct tagWLAN_IE_IBSS_PARMS {
  261. BYTE byElementID;
  262. BYTE len;
  263. WORD wATIMWindow;
  264. } __attribute__ ((__packed__))
  265. WLAN_IE_IBSS_PARMS, *PWLAN_IE_IBSS_PARMS;
  266. // Challenge Text
  267. #pragma pack(1)
  268. typedef struct tagWLAN_IE_CHALLENGE {
  269. BYTE byElementID;
  270. BYTE len;
  271. BYTE abyChallenge[1];
  272. } __attribute__ ((__packed__))
  273. WLAN_IE_CHALLENGE, *PWLAN_IE_CHALLENGE;
  274. #pragma pack(1)
  275. typedef struct tagWLAN_IE_RSN_EXT {
  276. BYTE byElementID;
  277. BYTE len;
  278. BYTE abyOUI[4];
  279. WORD wVersion;
  280. BYTE abyMulticast[4];
  281. WORD wPKCount;
  282. struct {
  283. BYTE abyOUI[4];
  284. } PKSList[1]; // the rest is variable so need to
  285. // overlay ieauth structure
  286. } WLAN_IE_RSN_EXT, *PWLAN_IE_RSN_EXT;
  287. #pragma pack(1)
  288. typedef struct tagWLAN_IE_RSN_AUTH {
  289. WORD wAuthCount;
  290. struct {
  291. BYTE abyOUI[4];
  292. } AuthKSList[1];
  293. } WLAN_IE_RSN_AUTH, *PWLAN_IE_RSN_AUTH;
  294. // RSN Identity
  295. #pragma pack(1)
  296. typedef struct tagWLAN_IE_RSN {
  297. BYTE byElementID;
  298. BYTE len;
  299. WORD wVersion;
  300. BYTE abyRSN[WLAN_MIN_ARRAY];
  301. } WLAN_IE_RSN, *PWLAN_IE_RSN;
  302. // CCX Identity DavidWang
  303. #pragma pack(1)
  304. typedef struct tagWLAN_IE_CCX {
  305. BYTE byElementID;
  306. BYTE len;
  307. BYTE abyCCX[30];
  308. } WLAN_IE_CCX, *PWLAN_IE_CCX;
  309. #pragma pack(1)
  310. typedef struct tagWLAN_IE_CCX_IP {
  311. BYTE byElementID;
  312. BYTE len;
  313. BYTE abyCCXOUI[4];
  314. BYTE abyCCXIP[4];
  315. BYTE abyCCXREV[2];
  316. } WLAN_IE_CCX_IP, *PWLAN_IE_CCX_IP;
  317. #pragma pack(1)
  318. typedef struct tagWLAN_IE_CCX_Ver {
  319. BYTE byElementID;
  320. BYTE len;
  321. BYTE abyCCXVer[5];
  322. } WLAN_IE_CCX_Ver, *PWLAN_IE_CCX_Ver;
  323. // ERP
  324. #pragma pack(1)
  325. typedef struct tagWLAN_IE_ERP {
  326. BYTE byElementID;
  327. BYTE len;
  328. BYTE byContext;
  329. } __attribute__ ((__packed__))
  330. WLAN_IE_ERP, *PWLAN_IE_ERP;
  331. #pragma pack(1)
  332. typedef struct _MEASEURE_REQ {
  333. BYTE byChannel;
  334. BYTE abyStartTime[8];
  335. BYTE abyDuration[2];
  336. } MEASEURE_REQ, *PMEASEURE_REQ,
  337. MEASEURE_REQ_BASIC, *PMEASEURE_REQ_BASIC,
  338. MEASEURE_REQ_CCA, *PMEASEURE_REQ_CCA,
  339. MEASEURE_REQ_RPI, *PMEASEURE_REQ_RPI;
  340. typedef struct _MEASEURE_REP_BASIC {
  341. BYTE byChannel;
  342. BYTE abyStartTime[8];
  343. BYTE abyDuration[2];
  344. BYTE byMap;
  345. } MEASEURE_REP_BASIC, *PMEASEURE_REP_BASIC;
  346. typedef struct _MEASEURE_REP_CCA {
  347. BYTE byChannel;
  348. BYTE abyStartTime[8];
  349. BYTE abyDuration[2];
  350. BYTE byCCABusyFraction;
  351. } MEASEURE_REP_CCA, *PMEASEURE_REP_CCA;
  352. typedef struct _MEASEURE_REP_RPI {
  353. BYTE byChannel;
  354. BYTE abyStartTime[8];
  355. BYTE abyDuration[2];
  356. BYTE abyRPIdensity[8];
  357. } MEASEURE_REP_RPI, *PMEASEURE_REP_RPI;
  358. typedef union _MEASEURE_REP {
  359. MEASEURE_REP_BASIC sBasic;
  360. MEASEURE_REP_CCA sCCA;
  361. MEASEURE_REP_RPI sRPI;
  362. } MEASEURE_REP, *PMEASEURE_REP;
  363. typedef struct _WLAN_IE_MEASURE_REQ {
  364. BYTE byElementID;
  365. BYTE len;
  366. BYTE byToken;
  367. BYTE byMode;
  368. BYTE byType;
  369. MEASEURE_REQ sReq;
  370. } WLAN_IE_MEASURE_REQ, *PWLAN_IE_MEASURE_REQ;
  371. typedef struct _WLAN_IE_MEASURE_REP {
  372. BYTE byElementID;
  373. BYTE len;
  374. BYTE byToken;
  375. BYTE byMode;
  376. BYTE byType;
  377. MEASEURE_REP sRep;
  378. } WLAN_IE_MEASURE_REP, *PWLAN_IE_MEASURE_REP;
  379. typedef struct _WLAN_IE_CH_SW {
  380. BYTE byElementID;
  381. BYTE len;
  382. BYTE byMode;
  383. BYTE byChannel;
  384. BYTE byCount;
  385. } WLAN_IE_CH_SW, *PWLAN_IE_CH_SW;
  386. typedef struct _WLAN_IE_QUIET {
  387. BYTE byElementID;
  388. BYTE len;
  389. BYTE byQuietCount;
  390. BYTE byQuietPeriod;
  391. BYTE abyQuietDuration[2];
  392. BYTE abyQuietOffset[2];
  393. } WLAN_IE_QUIET, *PWLAN_IE_QUIET;
  394. typedef struct _WLAN_IE_COUNTRY {
  395. BYTE byElementID;
  396. BYTE len;
  397. BYTE abyCountryString[3];
  398. BYTE abyCountryInfo[3];
  399. } WLAN_IE_COUNTRY, *PWLAN_IE_COUNTRY;
  400. typedef struct _WLAN_IE_PW_CONST {
  401. BYTE byElementID;
  402. BYTE len;
  403. BYTE byPower;
  404. } WLAN_IE_PW_CONST, *PWLAN_IE_PW_CONST;
  405. typedef struct _WLAN_IE_PW_CAP {
  406. BYTE byElementID;
  407. BYTE len;
  408. BYTE byMinPower;
  409. BYTE byMaxPower;
  410. } WLAN_IE_PW_CAP, *PWLAN_IE_PW_CAP;
  411. typedef struct _WLAN_IE_SUPP_CH {
  412. BYTE byElementID;
  413. BYTE len;
  414. BYTE abyChannelTuple[2];
  415. } WLAN_IE_SUPP_CH, *PWLAN_IE_SUPP_CH;
  416. typedef struct _WLAN_IE_TPC_REQ {
  417. BYTE byElementID;
  418. BYTE len;
  419. } WLAN_IE_TPC_REQ, *PWLAN_IE_TPC_REQ;
  420. typedef struct _WLAN_IE_TPC_REP {
  421. BYTE byElementID;
  422. BYTE len;
  423. BYTE byTxPower;
  424. BYTE byLinkMargin;
  425. } WLAN_IE_TPC_REP, *PWLAN_IE_TPC_REP;
  426. typedef struct _WLAN_IE_IBSS_DFS {
  427. BYTE byElementID;
  428. BYTE len;
  429. BYTE abyDFSOwner[6];
  430. BYTE byDFSRecovery;
  431. BYTE abyChannelMap[2];
  432. } WLAN_IE_IBSS_DFS, *PWLAN_IE_IBSS_DFS;
  433. #pragma pack()
  434. // Frame Types
  435. // prototype structure, all mgmt frame types will start with these members
  436. typedef struct tagWLAN_FR_MGMT {
  437. unsigned int uType;
  438. unsigned int len;
  439. PBYTE pBuf;
  440. PUWLAN_80211HDR pHdr;
  441. } WLAN_FR_MGMT, *PWLAN_FR_MGMT;
  442. // Beacon frame
  443. typedef struct tagWLAN_FR_BEACON {
  444. unsigned int uType;
  445. unsigned int len;
  446. PBYTE pBuf;
  447. PUWLAN_80211HDR pHdr;
  448. // fixed fields
  449. PQWORD pqwTimestamp;
  450. PWORD pwBeaconInterval;
  451. PWORD pwCapInfo;
  452. /*-- info elements ----------*/
  453. PWLAN_IE_SSID pSSID;
  454. PWLAN_IE_SUPP_RATES pSuppRates;
  455. // PWLAN_IE_FH_PARMS pFHParms;
  456. PWLAN_IE_DS_PARMS pDSParms;
  457. PWLAN_IE_CF_PARMS pCFParms;
  458. PWLAN_IE_TIM pTIM;
  459. PWLAN_IE_IBSS_PARMS pIBSSParms;
  460. PWLAN_IE_RSN pRSN;
  461. PWLAN_IE_RSN_EXT pRSNWPA;
  462. PWLAN_IE_ERP pERP;
  463. PWLAN_IE_SUPP_RATES pExtSuppRates;
  464. PWLAN_IE_COUNTRY pIE_Country;
  465. PWLAN_IE_PW_CONST pIE_PowerConstraint;
  466. PWLAN_IE_CH_SW pIE_CHSW;
  467. PWLAN_IE_IBSS_DFS pIE_IBSSDFS;
  468. PWLAN_IE_QUIET pIE_Quiet;
  469. } WLAN_FR_BEACON, *PWLAN_FR_BEACON;
  470. // IBSS ATIM frame
  471. typedef struct tagWLAN_FR_IBSSATIM {
  472. unsigned int uType;
  473. unsigned int len;
  474. PBYTE pBuf;
  475. PUWLAN_80211HDR pHdr;
  476. // fixed fields
  477. // info elements
  478. // this frame type has a null body
  479. } WLAN_FR_IBSSATIM, *PWLAN_FR_IBSSATIM;
  480. // Disassociation
  481. typedef struct tagWLAN_FR_DISASSOC {
  482. unsigned int uType;
  483. unsigned int len;
  484. PBYTE pBuf;
  485. PUWLAN_80211HDR pHdr;
  486. /*-- fixed fields -----------*/
  487. PWORD pwReason;
  488. /*-- info elements ----------*/
  489. } WLAN_FR_DISASSOC, *PWLAN_FR_DISASSOC;
  490. // Association Request
  491. typedef struct tagWLAN_FR_ASSOCREQ {
  492. unsigned int uType;
  493. unsigned int len;
  494. PBYTE pBuf;
  495. PUWLAN_80211HDR pHdr;
  496. /*-- fixed fields -----------*/
  497. PWORD pwCapInfo;
  498. PWORD pwListenInterval;
  499. /*-- info elements ----------*/
  500. PWLAN_IE_SSID pSSID;
  501. PWLAN_IE_SUPP_RATES pSuppRates;
  502. PWLAN_IE_RSN pRSN;
  503. PWLAN_IE_CCX pCCX;
  504. PWLAN_IE_CCX_IP pCCXIP;
  505. PWLAN_IE_CCX_Ver pCCXVER;
  506. PWLAN_IE_RSN_EXT pRSNWPA;
  507. PWLAN_IE_SUPP_RATES pExtSuppRates;
  508. PWLAN_IE_PW_CAP pCurrPowerCap;
  509. PWLAN_IE_SUPP_CH pCurrSuppCh;
  510. } WLAN_FR_ASSOCREQ, *PWLAN_FR_ASSOCREQ;
  511. // Association Response
  512. typedef struct tagWLAN_FR_ASSOCRESP {
  513. unsigned int uType;
  514. unsigned int len;
  515. PBYTE pBuf;
  516. PUWLAN_80211HDR pHdr;
  517. /*-- fixed fields -----------*/
  518. PWORD pwCapInfo;
  519. PWORD pwStatus;
  520. PWORD pwAid;
  521. /*-- info elements ----------*/
  522. PWLAN_IE_SUPP_RATES pSuppRates;
  523. PWLAN_IE_SUPP_RATES pExtSuppRates;
  524. } WLAN_FR_ASSOCRESP, *PWLAN_FR_ASSOCRESP;
  525. // Reassociation Request
  526. typedef struct tagWLAN_FR_REASSOCREQ {
  527. unsigned int uType;
  528. unsigned int len;
  529. PBYTE pBuf;
  530. PUWLAN_80211HDR pHdr;
  531. /*-- fixed fields -----------*/
  532. PWORD pwCapInfo;
  533. PWORD pwListenInterval;
  534. PIEEE_ADDR pAddrCurrAP;
  535. /*-- info elements ----------*/
  536. PWLAN_IE_SSID pSSID;
  537. PWLAN_IE_SUPP_RATES pSuppRates;
  538. PWLAN_IE_RSN pRSN;
  539. PWLAN_IE_CCX pCCX;
  540. PWLAN_IE_CCX_IP pCCXIP;
  541. PWLAN_IE_CCX_Ver pCCXVER;
  542. PWLAN_IE_RSN_EXT pRSNWPA;
  543. PWLAN_IE_SUPP_RATES pExtSuppRates;
  544. } WLAN_FR_REASSOCREQ, *PWLAN_FR_REASSOCREQ;
  545. // Reassociation Response
  546. typedef struct tagWLAN_FR_REASSOCRESP {
  547. unsigned int uType;
  548. unsigned int len;
  549. PBYTE pBuf;
  550. PUWLAN_80211HDR pHdr;
  551. /*-- fixed fields -----------*/
  552. PWORD pwCapInfo;
  553. PWORD pwStatus;
  554. PWORD pwAid;
  555. /*-- info elements ----------*/
  556. PWLAN_IE_SUPP_RATES pSuppRates;
  557. PWLAN_IE_SUPP_RATES pExtSuppRates;
  558. } WLAN_FR_REASSOCRESP, *PWLAN_FR_REASSOCRESP;
  559. // Probe Request
  560. typedef struct tagWLAN_FR_PROBEREQ {
  561. unsigned int uType;
  562. unsigned int len;
  563. PBYTE pBuf;
  564. PUWLAN_80211HDR pHdr;
  565. /*-- fixed fields -----------*/
  566. /*-- info elements ----------*/
  567. PWLAN_IE_SSID pSSID;
  568. PWLAN_IE_SUPP_RATES pSuppRates;
  569. PWLAN_IE_SUPP_RATES pExtSuppRates;
  570. } WLAN_FR_PROBEREQ, *PWLAN_FR_PROBEREQ;
  571. // Probe Response
  572. typedef struct tagWLAN_FR_PROBERESP {
  573. unsigned int uType;
  574. unsigned int len;
  575. PBYTE pBuf;
  576. PUWLAN_80211HDR pHdr;
  577. /*-- fixed fields -----------*/
  578. PQWORD pqwTimestamp;
  579. PWORD pwBeaconInterval;
  580. PWORD pwCapInfo;
  581. /*-- info elements ----------*/
  582. PWLAN_IE_SSID pSSID;
  583. PWLAN_IE_SUPP_RATES pSuppRates;
  584. PWLAN_IE_DS_PARMS pDSParms;
  585. PWLAN_IE_CF_PARMS pCFParms;
  586. PWLAN_IE_IBSS_PARMS pIBSSParms;
  587. PWLAN_IE_RSN pRSN;
  588. PWLAN_IE_RSN_EXT pRSNWPA;
  589. PWLAN_IE_ERP pERP;
  590. PWLAN_IE_SUPP_RATES pExtSuppRates;
  591. PWLAN_IE_COUNTRY pIE_Country;
  592. PWLAN_IE_PW_CONST pIE_PowerConstraint;
  593. PWLAN_IE_CH_SW pIE_CHSW;
  594. PWLAN_IE_IBSS_DFS pIE_IBSSDFS;
  595. PWLAN_IE_QUIET pIE_Quiet;
  596. } WLAN_FR_PROBERESP, *PWLAN_FR_PROBERESP;
  597. // Authentication
  598. typedef struct tagWLAN_FR_AUTHEN {
  599. unsigned int uType;
  600. unsigned int len;
  601. PBYTE pBuf;
  602. PUWLAN_80211HDR pHdr;
  603. /*-- fixed fields -----------*/
  604. PWORD pwAuthAlgorithm;
  605. PWORD pwAuthSequence;
  606. PWORD pwStatus;
  607. /*-- info elements ----------*/
  608. PWLAN_IE_CHALLENGE pChallenge;
  609. } WLAN_FR_AUTHEN, *PWLAN_FR_AUTHEN;
  610. // Deauthenication
  611. typedef struct tagWLAN_FR_DEAUTHEN {
  612. unsigned int uType;
  613. unsigned int len;
  614. PBYTE pBuf;
  615. PUWLAN_80211HDR pHdr;
  616. /*-- fixed fields -----------*/
  617. PWORD pwReason;
  618. /*-- info elements ----------*/
  619. } WLAN_FR_DEAUTHEN, *PWLAN_FR_DEAUTHEN;
  620. /*--------------------- Export Functions --------------------------*/
  621. void
  622. vMgrEncodeBeacon(
  623. PWLAN_FR_BEACON pFrame
  624. );
  625. void
  626. vMgrDecodeBeacon(
  627. PWLAN_FR_BEACON pFrame
  628. );
  629. void
  630. vMgrEncodeIBSSATIM(
  631. PWLAN_FR_IBSSATIM pFrame
  632. );
  633. void
  634. vMgrDecodeIBSSATIM(
  635. PWLAN_FR_IBSSATIM pFrame
  636. );
  637. void
  638. vMgrEncodeDisassociation(
  639. PWLAN_FR_DISASSOC pFrame
  640. );
  641. void
  642. vMgrDecodeDisassociation(
  643. PWLAN_FR_DISASSOC pFrame
  644. );
  645. void
  646. vMgrEncodeAssocRequest(
  647. PWLAN_FR_ASSOCREQ pFrame
  648. );
  649. void
  650. vMgrDecodeAssocRequest(
  651. PWLAN_FR_ASSOCREQ pFrame
  652. );
  653. void
  654. vMgrEncodeAssocResponse(
  655. PWLAN_FR_ASSOCRESP pFrame
  656. );
  657. void
  658. vMgrDecodeAssocResponse(
  659. PWLAN_FR_ASSOCRESP pFrame
  660. );
  661. void
  662. vMgrEncodeReassocRequest(
  663. PWLAN_FR_REASSOCREQ pFrame
  664. );
  665. void
  666. vMgrDecodeReassocRequest(
  667. PWLAN_FR_REASSOCREQ pFrame
  668. );
  669. void
  670. vMgrEncodeProbeRequest(
  671. PWLAN_FR_PROBEREQ pFrame
  672. );
  673. void
  674. vMgrDecodeProbeRequest(
  675. PWLAN_FR_PROBEREQ pFrame
  676. );
  677. void
  678. vMgrEncodeProbeResponse(
  679. PWLAN_FR_PROBERESP pFrame
  680. );
  681. void
  682. vMgrDecodeProbeResponse(
  683. PWLAN_FR_PROBERESP pFrame
  684. );
  685. void
  686. vMgrEncodeAuthen(
  687. PWLAN_FR_AUTHEN pFrame
  688. );
  689. void
  690. vMgrDecodeAuthen(
  691. PWLAN_FR_AUTHEN pFrame
  692. );
  693. void
  694. vMgrEncodeDeauthen(
  695. PWLAN_FR_DEAUTHEN pFrame
  696. );
  697. void
  698. vMgrDecodeDeauthen(
  699. PWLAN_FR_DEAUTHEN pFrame
  700. );
  701. void
  702. vMgrEncodeReassocResponse(
  703. PWLAN_FR_REASSOCRESP pFrame
  704. );
  705. void
  706. vMgrDecodeReassocResponse(
  707. PWLAN_FR_REASSOCRESP pFrame
  708. );
  709. #endif// __80211MGR_H__