iowpa.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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. * File: iowpa.h
  20. *
  21. * Purpose: Handles wpa supplicant ioctl interface
  22. *
  23. * Author: Lyndon Chen
  24. *
  25. * Date: May 8, 2002
  26. *
  27. */
  28. #ifndef __IOWPA_H__
  29. #define __IOWPA_H__
  30. /*--------------------- Export Definitions -------------------------*/
  31. #define WPA_IE_LEN 64
  32. //WPA related
  33. /*
  34. typedef enum { WPA_ALG_NONE, WPA_ALG_WEP, WPA_ALG_TKIP, WPA_ALG_CCMP } wpa_alg;
  35. typedef enum { CIPHER_NONE, CIPHER_WEP40, CIPHER_TKIP, CIPHER_CCMP,
  36. CIPHER_WEP104 } wpa_cipher;
  37. typedef enum { KEY_MGMT_802_1X, KEY_MGMT_PSK, KEY_MGMT_NONE,
  38. KEY_MGMT_802_1X_NO_WPA, KEY_MGMT_WPA_NONE } wpa_key_mgmt;
  39. */
  40. enum {
  41. VIAWGET_SET_WPA = 1,
  42. VIAWGET_SET_KEY = 2,
  43. VIAWGET_SET_SCAN = 3,
  44. VIAWGET_GET_SCAN = 4,
  45. VIAWGET_GET_SSID = 5,
  46. VIAWGET_GET_BSSID = 6,
  47. VIAWGET_SET_DROP_UNENCRYPT = 7,
  48. VIAWGET_SET_DEAUTHENTICATE = 8,
  49. VIAWGET_SET_ASSOCIATE = 9,
  50. VIAWGET_SET_DISASSOCIATE= 10
  51. };
  52. enum {
  53. VIAWGET_ASSOC_MSG = 1,
  54. VIAWGET_DISASSOC_MSG = 2,
  55. VIAWGET_PTK_MIC_MSG = 3,
  56. VIAWGET_GTK_MIC_MSG = 4,
  57. VIAWGET_CCKM_ROAM_MSG = 5,
  58. VIAWGET_DEVICECLOSE_MSG = 6
  59. };
  60. #pragma pack(1)
  61. typedef struct viawget_wpa_header {
  62. u8 type;
  63. u16 req_ie_len;
  64. u16 resp_ie_len;
  65. } viawget_wpa_header;
  66. struct viawget_wpa_param {
  67. u32 cmd;
  68. u8 addr[6];
  69. union {
  70. struct {
  71. u8 len;
  72. u8 data[0];
  73. } generic_elem;
  74. struct {
  75. u8 bssid[6];
  76. u8 ssid[32];
  77. u8 ssid_len;
  78. u8 *wpa_ie;
  79. u16 wpa_ie_len;
  80. int pairwise_suite;
  81. int group_suite;
  82. int key_mgmt_suite;
  83. int auth_alg;
  84. int mode;
  85. } wpa_associate;
  86. struct {
  87. int alg_name;
  88. u16 key_index;
  89. u16 set_tx;
  90. u8 *seq;
  91. u16 seq_len;
  92. u8 *key;
  93. u16 key_len;
  94. } wpa_key;
  95. struct {
  96. u8 ssid_len;
  97. u8 ssid[32];
  98. } scan_req;
  99. struct {
  100. u16 scan_count;
  101. u8 *buf;
  102. } scan_results;
  103. } u;
  104. };
  105. #pragma pack(1)
  106. struct viawget_scan_result {
  107. u8 bssid[6];
  108. u8 ssid[32];
  109. u16 ssid_len;
  110. u8 wpa_ie[WPA_IE_LEN];
  111. u16 wpa_ie_len;
  112. u8 rsn_ie[WPA_IE_LEN];
  113. u16 rsn_ie_len;
  114. int freq; // MHz
  115. int caps; // e.g. privacy
  116. int qual; // signal quality
  117. int noise;
  118. int level;
  119. int maxrate;
  120. };
  121. //2006-1116-01,<Add> by NomadZhao
  122. #pragma pack()
  123. /*--------------------- Export Classes ----------------------------*/
  124. /*--------------------- Export Variables --------------------------*/
  125. /*--------------------- Export Types ------------------------------*/
  126. /*--------------------- Export Functions --------------------------*/
  127. #endif //__IOWPA_H__