1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | ** All rights reserved.
|
---|
5 | ** Contact: Nokia Corporation ([email protected])
|
---|
6 | **
|
---|
7 | ** This file is part of the plugins of the Qt Toolkit.
|
---|
8 | **
|
---|
9 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
10 | ** Commercial Usage
|
---|
11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
12 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
13 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
14 | ** a written agreement between you and Nokia.
|
---|
15 | **
|
---|
16 | ** GNU Lesser General Public License Usage
|
---|
17 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
18 | ** General Public License version 2.1 as published by the Free Software
|
---|
19 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
20 | ** packaging of this file. Please review the following information to
|
---|
21 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
22 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
23 | **
|
---|
24 | ** In addition, as a special exception, Nokia gives you certain additional
|
---|
25 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
---|
26 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
---|
27 | **
|
---|
28 | ** GNU General Public License Usage
|
---|
29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
30 | ** General Public License version 3.0 as published by the Free Software
|
---|
31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
32 | ** packaging of this file. Please review the following information to
|
---|
33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
35 | **
|
---|
36 | ** If you have questions regarding the use of this file, please contact
|
---|
37 | ** Nokia at [email protected].
|
---|
38 | ** $QT_END_LICENSE$
|
---|
39 | **
|
---|
40 | ****************************************************************************/
|
---|
41 |
|
---|
42 | #ifndef PLATFORMDEFS_H
|
---|
43 | #define PLATFORMDEFS_H
|
---|
44 |
|
---|
45 | #include <wtypes.h>
|
---|
46 | #undef interface
|
---|
47 |
|
---|
48 | #define WLAN_MAX_NAME_LENGTH 256
|
---|
49 | #define WLAN_MAX_PHY_TYPE_NUMBER 8
|
---|
50 | #define WLAN_NOTIFICATION_SOURCE_ALL 0x0000ffff
|
---|
51 | #define WLAN_AVAILABLE_NETWORK_CONNECTED 1
|
---|
52 | #define WLAN_AVAILABLE_NETWORK_HAS_PROFILE 2
|
---|
53 | #define DOT11_SSID_MAX_LENGTH 32
|
---|
54 |
|
---|
55 | QT_BEGIN_NAMESPACE
|
---|
56 |
|
---|
57 | struct WLAN_NOTIFICATION_DATA {
|
---|
58 | DWORD NotificationSource;
|
---|
59 | DWORD NotificationCode;
|
---|
60 | GUID InterfaceGuid;
|
---|
61 | DWORD dwDataSize;
|
---|
62 | PVOID pData;
|
---|
63 | };
|
---|
64 |
|
---|
65 | enum WLAN_INTERFACE_STATE {
|
---|
66 | wlan_interface_state_not_ready = 0,
|
---|
67 | wlan_interface_state_connected,
|
---|
68 | wlan_interface_state_ad_hoc_network_formed,
|
---|
69 | wlan_interface_state_disconnecting,
|
---|
70 | wlan_interface_state_disconnected,
|
---|
71 | wlan_interface_state_associating,
|
---|
72 | wlan_interface_state_discovering,
|
---|
73 | wlan_interface_state_authenticating
|
---|
74 | };
|
---|
75 |
|
---|
76 | struct WLAN_INTERFACE_INFO {
|
---|
77 | GUID InterfaceGuid;
|
---|
78 | WCHAR strInterfaceDescription[WLAN_MAX_NAME_LENGTH];
|
---|
79 | WLAN_INTERFACE_STATE isState;
|
---|
80 | };
|
---|
81 |
|
---|
82 | struct WLAN_INTERFACE_INFO_LIST {
|
---|
83 | DWORD dwNumberOfItems;
|
---|
84 | DWORD dwIndex;
|
---|
85 | WLAN_INTERFACE_INFO InterfaceInfo[1];
|
---|
86 | };
|
---|
87 |
|
---|
88 | struct DOT11_SSID {
|
---|
89 | ULONG uSSIDLength;
|
---|
90 | UCHAR ucSSID[DOT11_SSID_MAX_LENGTH];
|
---|
91 | };
|
---|
92 |
|
---|
93 | struct NDIS_OBJECT_HEADER {
|
---|
94 | UCHAR Type;
|
---|
95 | UCHAR Revision;
|
---|
96 | USHORT Size;
|
---|
97 | };
|
---|
98 |
|
---|
99 | typedef UCHAR DOT11_MAC_ADDRESS[6];
|
---|
100 | struct DOT11_BSSID_LIST {
|
---|
101 | NDIS_OBJECT_HEADER Header;
|
---|
102 | ULONG uNumberOfEntries;
|
---|
103 | ULONG uTotalNumOfEntries;
|
---|
104 | DOT11_MAC_ADDRESS BSSIDs[1];
|
---|
105 | };
|
---|
106 |
|
---|
107 | enum DOT11_BSS_TYPE {
|
---|
108 | dot11_BSS_type_infrastructure = 1,
|
---|
109 | dot11_BSS_type_independent = 2,
|
---|
110 | dot11_BSS_type_any = 3
|
---|
111 | };
|
---|
112 |
|
---|
113 | enum DOT11_PHY_TYPE {
|
---|
114 | dot11_phy_type_unknown = 0,
|
---|
115 | dot11_phy_type_any = dot11_phy_type_unknown,
|
---|
116 | dot11_phy_type_fhss = 1,
|
---|
117 | dot11_phy_type_dsss = 2,
|
---|
118 | dot11_phy_type_irbaseband = 3,
|
---|
119 | dot11_phy_type_ofdm = 4,
|
---|
120 | dot11_phy_type_hrdsss = 5,
|
---|
121 | dot11_phy_type_erp = 6,
|
---|
122 | dot11_phy_type_ht = 7,
|
---|
123 | dot11_phy_type_IHV_start = 0x80000000,
|
---|
124 | dot11_phy_type_IHV_end = 0xffffffff
|
---|
125 | };
|
---|
126 |
|
---|
127 | enum DOT11_AUTH_ALGORITHM {
|
---|
128 | DOT11_AUTH_ALGO_80211_OPEN = 1,
|
---|
129 | DOT11_AUTH_ALGO_80211_SHARED_KEY = 2,
|
---|
130 | DOT11_AUTH_ALGO_WPA = 3,
|
---|
131 | DOT11_AUTH_ALGO_WPA_PSK = 4,
|
---|
132 | DOT11_AUTH_ALGO_WPA_NONE = 5,
|
---|
133 | DOT11_AUTH_ALGO_RSNA = 6,
|
---|
134 | DOT11_AUTH_ALGO_RSNA_PSK = 7,
|
---|
135 | DOT11_AUTH_ALGO_IHV_START = 0x80000000,
|
---|
136 | DOT11_AUTH_ALGO_IHV_END = 0xffffffff
|
---|
137 | };
|
---|
138 |
|
---|
139 | enum DOT11_CIPHER_ALGORITHM {
|
---|
140 | DOT11_CIPHER_ALGO_NONE = 0x00,
|
---|
141 | DOT11_CIPHER_ALGO_WEP40 = 0x01,
|
---|
142 | DOT11_CIPHER_ALGO_TKIP = 0x02,
|
---|
143 | DOT11_CIPHER_ALGO_CCMP = 0x04,
|
---|
144 | DOT11_CIPHER_ALGO_WEP104 = 0x05,
|
---|
145 | DOT11_CIPHER_ALGO_WPA_USE_GROUP = 0x100,
|
---|
146 | DOT11_CIPHER_ALGO_RSN_USE_GROUP = 0x100,
|
---|
147 | DOT11_CIPHER_ALGO_WEP = 0x101,
|
---|
148 | DOT11_CIPHER_ALGO_IHV_START = 0x80000000,
|
---|
149 | DOT11_CIPHER_ALGO_IHV_END = 0xffffffff
|
---|
150 | };
|
---|
151 |
|
---|
152 | struct WLAN_AVAILABLE_NETWORK {
|
---|
153 | WCHAR strProfileName[WLAN_MAX_NAME_LENGTH];
|
---|
154 | DOT11_SSID dot11Ssid;
|
---|
155 | DOT11_BSS_TYPE dot11BssType;
|
---|
156 | ULONG uNumberOfBssids;
|
---|
157 | BOOL bNetworkConnectable;
|
---|
158 | DWORD wlanNotConnectableReason;
|
---|
159 | ULONG uNumberOfPhyTypes;
|
---|
160 | DOT11_PHY_TYPE dot11PhyTypes[WLAN_MAX_PHY_TYPE_NUMBER];
|
---|
161 | BOOL bMorePhyTypes;
|
---|
162 | ULONG wlanSignalQuality;
|
---|
163 | BOOL bSecurityEnabled;
|
---|
164 | DOT11_AUTH_ALGORITHM dot11DefaultAuthAlgorithm;
|
---|
165 | DOT11_CIPHER_ALGORITHM dot11DefaultCipherAlgorithm;
|
---|
166 | DWORD dwFlags;
|
---|
167 | DWORD dwReserved;
|
---|
168 | };
|
---|
169 |
|
---|
170 | struct WLAN_AVAILABLE_NETWORK_LIST {
|
---|
171 | DWORD dwNumberOfItems;
|
---|
172 | DWORD dwIndex;
|
---|
173 | WLAN_AVAILABLE_NETWORK Network[1];
|
---|
174 | };
|
---|
175 |
|
---|
176 | enum WLAN_INTF_OPCODE {
|
---|
177 | wlan_intf_opcode_autoconf_start = 0x000000000,
|
---|
178 | wlan_intf_opcode_autoconf_enabled,
|
---|
179 | wlan_intf_opcode_background_scan_enabled,
|
---|
180 | wlan_intf_opcode_media_streaming_mode,
|
---|
181 | wlan_intf_opcode_radio_state,
|
---|
182 | wlan_intf_opcode_bss_type,
|
---|
183 | wlan_intf_opcode_interface_state,
|
---|
184 | wlan_intf_opcode_current_connection,
|
---|
185 | wlan_intf_opcode_channel_number,
|
---|
186 | wlan_intf_opcode_supported_infrastructure_auth_cipher_pairs,
|
---|
187 | wlan_intf_opcode_supported_adhoc_auth_cipher_pairs,
|
---|
188 | wlan_intf_opcode_supported_country_or_region_string_list,
|
---|
189 | wlan_intf_opcode_current_operation_mode,
|
---|
190 | wlan_intf_opcode_supported_safe_mode,
|
---|
191 | wlan_intf_opcode_certified_safe_mode,
|
---|
192 | wlan_intf_opcode_autoconf_end = 0x0fffffff,
|
---|
193 | wlan_intf_opcode_msm_start = 0x10000100,
|
---|
194 | wlan_intf_opcode_statistics,
|
---|
195 | wlan_intf_opcode_rssi,
|
---|
196 | wlan_intf_opcode_msm_end = 0x1fffffff,
|
---|
197 | wlan_intf_opcode_security_start = 0x20010000,
|
---|
198 | wlan_intf_opcode_security_end = 0x2fffffff,
|
---|
199 | wlan_intf_opcode_ihv_start = 0x30000000,
|
---|
200 | wlan_intf_opcode_ihv_end = 0x3fffffff
|
---|
201 | };
|
---|
202 |
|
---|
203 | enum WLAN_OPCODE_VALUE_TYPE {
|
---|
204 | wlan_opcode_value_type_query_only = 0,
|
---|
205 | wlan_opcode_value_type_set_by_group_policy,
|
---|
206 | wlan_opcode_value_type_set_by_user,
|
---|
207 | wlan_opcode_value_type_invalid
|
---|
208 | };
|
---|
209 |
|
---|
210 | enum WLAN_CONNECTION_MODE {
|
---|
211 | wlan_connection_mode_profile = 0,
|
---|
212 | wlan_connection_mode_temporary_profile,
|
---|
213 | wlan_connection_mode_discovery_secure,
|
---|
214 | wlan_connection_mode_discovery_unsecure,
|
---|
215 | wlan_connection_mode_auto,
|
---|
216 | wlan_connection_mode_invalid
|
---|
217 | };
|
---|
218 |
|
---|
219 | struct WLAN_CONNECTION_PARAMETERS {
|
---|
220 | WLAN_CONNECTION_MODE wlanConnectionMode;
|
---|
221 | LPCWSTR strProfile;
|
---|
222 | DOT11_SSID *pDot11Ssid;
|
---|
223 | DOT11_BSSID_LIST *pDesiredBssidList;
|
---|
224 | DOT11_BSS_TYPE dot11BssType;
|
---|
225 | DWORD dwFlags;
|
---|
226 | };
|
---|
227 |
|
---|
228 | struct WLAN_RAW_DATA {
|
---|
229 | DWORD dwDataSize;
|
---|
230 | BYTE DataBlob[1];
|
---|
231 | };
|
---|
232 |
|
---|
233 | enum WLAN_NOTIFICATION_ACM {
|
---|
234 | wlan_notification_acm_start = 0,
|
---|
235 | wlan_notification_acm_autoconf_enabled,
|
---|
236 | wlan_notification_acm_autoconf_disabled,
|
---|
237 | wlan_notification_acm_background_scan_enabled,
|
---|
238 | wlan_notification_acm_background_scan_disabled,
|
---|
239 | wlan_notification_acm_bss_type_change,
|
---|
240 | wlan_notification_acm_power_setting_change,
|
---|
241 | wlan_notification_acm_scan_complete,
|
---|
242 | wlan_notification_acm_scan_fail,
|
---|
243 | wlan_notification_acm_connection_start,
|
---|
244 | wlan_notification_acm_connection_complete,
|
---|
245 | wlan_notification_acm_connection_attempt_fail,
|
---|
246 | wlan_notification_acm_filter_list_change,
|
---|
247 | wlan_notification_acm_interface_arrival,
|
---|
248 | wlan_notification_acm_interface_removal,
|
---|
249 | wlan_notification_acm_profile_change,
|
---|
250 | wlan_notification_acm_profile_name_change,
|
---|
251 | wlan_notification_acm_profiles_exhausted,
|
---|
252 | wlan_notification_acm_network_not_available,
|
---|
253 | wlan_notification_acm_network_available,
|
---|
254 | wlan_notification_acm_disconnecting,
|
---|
255 | wlan_notification_acm_disconnected,
|
---|
256 | wlan_notification_acm_adhoc_network_state_change,
|
---|
257 | wlan_notification_acm_end
|
---|
258 | };
|
---|
259 |
|
---|
260 | struct WLAN_ASSOCIATION_ATTRIBUTES {
|
---|
261 | DOT11_SSID dot11Ssid;
|
---|
262 | DOT11_BSS_TYPE dot11BssType;
|
---|
263 | DOT11_MAC_ADDRESS dot11Bssid;
|
---|
264 | DOT11_PHY_TYPE dot11PhyType;
|
---|
265 | ULONG uDot11PhyIndex;
|
---|
266 | ULONG wlanSignalQuality;
|
---|
267 | ULONG ulRxRate;
|
---|
268 | ULONG ulTxRate;
|
---|
269 | };
|
---|
270 |
|
---|
271 | struct WLAN_SECURITY_ATTRIBUTES {
|
---|
272 | BOOL bSecurityEnabled;
|
---|
273 | BOOL bOneXEnabled;
|
---|
274 | DOT11_AUTH_ALGORITHM dot11AuthAlgorithm;
|
---|
275 | DOT11_CIPHER_ALGORITHM dot11CipherAlgorithm;
|
---|
276 | };
|
---|
277 |
|
---|
278 | struct WLAN_CONNECTION_ATTRIBUTES {
|
---|
279 | WLAN_INTERFACE_STATE isState;
|
---|
280 | WLAN_CONNECTION_MODE wlanConnectionMode;
|
---|
281 | WCHAR strProfileName[WLAN_MAX_NAME_LENGTH];
|
---|
282 | WLAN_ASSOCIATION_ATTRIBUTES wlanAssociationAttributes;
|
---|
283 | WLAN_SECURITY_ATTRIBUTES wlanSecurityAttributes;
|
---|
284 | };
|
---|
285 |
|
---|
286 | typedef void (WINAPI *WLAN_NOTIFICATION_CALLBACK)(WLAN_NOTIFICATION_DATA *, PVOID);
|
---|
287 |
|
---|
288 | typedef DWORD (WINAPI *WlanOpenHandleProto)
|
---|
289 | (DWORD dwClientVersion, PVOID pReserved, PDWORD pdwNegotiatedVersion, PHANDLE phClientHandle);
|
---|
290 | typedef DWORD (WINAPI *WlanRegisterNotificationProto)
|
---|
291 | (HANDLE hClientHandle, DWORD dwNotifSource, BOOL bIgnoreDuplicate,
|
---|
292 | WLAN_NOTIFICATION_CALLBACK funcCallback, PVOID pCallbackContext,
|
---|
293 | PVOID pReserved, PDWORD pdwPrevNotifSource);
|
---|
294 | typedef DWORD (WINAPI *WlanEnumInterfacesProto)
|
---|
295 | (HANDLE hClientHandle, PVOID pReserved, WLAN_INTERFACE_INFO_LIST **ppInterfaceList);
|
---|
296 | typedef DWORD (WINAPI *WlanGetAvailableNetworkListProto)
|
---|
297 | (HANDLE hClientHandle, const GUID* pInterfaceGuid, DWORD dwFlags, PVOID pReserved,
|
---|
298 | WLAN_AVAILABLE_NETWORK_LIST **ppAvailableNetworkList);
|
---|
299 | typedef DWORD (WINAPI *WlanQueryInterfaceProto)
|
---|
300 | (HANDLE hClientHandle, const GUID *pInterfaceGuid, WLAN_INTF_OPCODE OpCode, PVOID pReserved,
|
---|
301 | PDWORD pdwDataSize, PVOID *ppData, WLAN_OPCODE_VALUE_TYPE *pWlanOpcodeValueType);
|
---|
302 | typedef DWORD (WINAPI *WlanConnectProto)
|
---|
303 | (HANDLE hClientHandle, const GUID *pInterfaceGuid,
|
---|
304 | const WLAN_CONNECTION_PARAMETERS *pConnectionParameters, PVOID pReserved);
|
---|
305 | typedef DWORD (WINAPI *WlanDisconnectProto)
|
---|
306 | (HANDLE hClientHandle, const GUID *pInterfaceGuid, PVOID pReserved);
|
---|
307 | typedef DWORD (WINAPI *WlanScanProto)
|
---|
308 | (HANDLE hClientHandle, const GUID *pInterfaceGuid, const DOT11_SSID *pDot11Ssid,
|
---|
309 | const WLAN_RAW_DATA *pIeData, PVOID pReserved);
|
---|
310 | typedef VOID (WINAPI *WlanFreeMemoryProto)(PVOID pMemory);
|
---|
311 | typedef DWORD (WINAPI *WlanCloseHandleProto)(HANDLE hClientHandle, PVOID pReserved);
|
---|
312 |
|
---|
313 | extern WlanOpenHandleProto local_WlanOpenHandle;
|
---|
314 | extern WlanRegisterNotificationProto local_WlanRegisterNotification;
|
---|
315 | extern WlanEnumInterfacesProto local_WlanEnumInterfaces;
|
---|
316 | extern WlanGetAvailableNetworkListProto local_WlanGetAvailableNetworkList;
|
---|
317 | extern WlanQueryInterfaceProto local_WlanQueryInterface;
|
---|
318 | extern WlanConnectProto local_WlanConnect;
|
---|
319 | extern WlanDisconnectProto local_WlanDisconnect;
|
---|
320 | extern WlanScanProto local_WlanScan;
|
---|
321 | extern WlanFreeMemoryProto local_WlanFreeMemory;
|
---|
322 | extern WlanCloseHandleProto local_WlanCloseHandle;
|
---|
323 |
|
---|
324 | QT_END_NAMESPACE
|
---|
325 |
|
---|
326 | #endif // PLATFORMDEFS_H
|
---|