|
1 /* |
|
2 * Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Interface to WPX adaptation. |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 10 % |
|
20 */ |
|
21 |
|
22 #ifndef ABS_CORE_WPX_ADAPTATION_H |
|
23 #define ABS_CORE_WPX_ADAPTATION_H |
|
24 |
|
25 #include "core_types.h" |
|
26 #include "core_type_list.h" |
|
27 |
|
28 class core_iap_data_c; |
|
29 class core_ap_data_c; |
|
30 class core_server_c; |
|
31 class abs_core_driverif_c; |
|
32 class abs_core_server_callback_c; |
|
33 class core_frame_dot11_ie_c; |
|
34 class core_frame_beacon_c; |
|
35 class core_frame_assoc_resp_c; |
|
36 class core_frame_dot11_c; |
|
37 class core_operation_base_c; |
|
38 |
|
39 /** |
|
40 * This class hides WPX specific functionality. |
|
41 * |
|
42 * @since S60 v3.1 |
|
43 */ |
|
44 NONSHARABLE_CLASS( abs_core_wpx_adaptation_c ) |
|
45 { |
|
46 |
|
47 public: |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~abs_core_wpx_adaptation_c() {}; |
|
53 |
|
54 /** |
|
55 * Returns the WPX key management suite from the given OUI. |
|
56 * |
|
57 * @since S60 v3.1 |
|
58 * @param oui OUI to check for key management suite. |
|
59 * @return core_key_management_none if no supported WPX key management suite found, |
|
60 * otherwise the defined suite |
|
61 */ |
|
62 virtual core_key_management_e wpx_key_management_suite( |
|
63 const u8_t* oui ) = 0; |
|
64 |
|
65 /** |
|
66 * Convert the given key management suite to WPX specific OUI. |
|
67 * |
|
68 * @since S60 v3.1 |
|
69 * @param key_management Key management suite to convert. |
|
70 * @param data_length Length of the OUI element. |
|
71 * @param data Pointer to the buffer for storing the OUI element. |
|
72 * @return code_error_ok on success, an error code otherwise. |
|
73 * @note On successful execution data_length parameter is changed |
|
74 * to the size of data stored. |
|
75 */ |
|
76 virtual core_error_e get_wpx_key_management_oui( |
|
77 core_key_management_e key_management, |
|
78 u8_t& data_length, |
|
79 u8_t* data ) = 0; |
|
80 |
|
81 /** |
|
82 * Check whether the given AP has compatible WPX settings with the connection settings. |
|
83 * |
|
84 * @since S60 v3.1 |
|
85 * @param reason The reason AP failed the check. |
|
86 * @param ap_data AP data to compare. |
|
87 * @param iap_data IAP data to compare. |
|
88 * @return Whether further checking is allowed. |
|
89 */ |
|
90 virtual bool_t is_ap_wpx_compatible_with_iap( |
|
91 core_connect_status_e& reason, |
|
92 const core_ap_data_c& ap_data, |
|
93 const core_iap_data_c& iap_data ) = 0; |
|
94 |
|
95 /** |
|
96 * Process the given WPX frame. |
|
97 * |
|
98 * @since S60 v3.1 |
|
99 * @param frame_type Type of the frame. |
|
100 * @param frame_length Length of frame data. |
|
101 * @param frame_data Pointer to the frame data. |
|
102 * @return Whether the frame was handled. |
|
103 */ |
|
104 virtual bool_t handle_wpx_frame( |
|
105 core_frame_type_e frame_type, |
|
106 u16_t frame_length, |
|
107 const u8_t* frame_data ) = 0; |
|
108 |
|
109 /** |
|
110 * Handle a successful roam to WPX AP. |
|
111 * |
|
112 * @since S60 v3.1 |
|
113 * @param ap_data AP information. |
|
114 */ |
|
115 virtual void handle_wpx_roam_success( |
|
116 const core_ap_data_c& ap_data ) = 0; |
|
117 |
|
118 /** |
|
119 * Handle a connection stop. |
|
120 * |
|
121 * @since S60 v3.2 |
|
122 */ |
|
123 virtual void handle_wpx_connection_stop() = 0; |
|
124 |
|
125 /** |
|
126 * Handle the starting of WPX fast-roam reassociation. |
|
127 * |
|
128 * @since S60 v3.1 |
|
129 * @param ap_data AP information. |
|
130 * @param assoc_ie_list IEs added to be added to reassociation request. |
|
131 * @return code_error_ok on success, an error code otherwise. |
|
132 */ |
|
133 virtual core_error_e handle_fast_roam_start_reassociation( |
|
134 core_ap_data_c& ap_data, |
|
135 core_type_list_c<core_frame_dot11_ie_c>& assoc_ie_list ) = 0; |
|
136 |
|
137 /** |
|
138 * Process the WPX fast-roam reassociation response frame. |
|
139 * |
|
140 * @since S60 v3.1 |
|
141 * @param server Pointer to the core_server instance. |
|
142 * @param frame Received reassociation response. |
|
143 */ |
|
144 virtual void handle_fast_roam_reassoc_resp( |
|
145 core_frame_assoc_resp_c* frame ) = 0; |
|
146 |
|
147 /** |
|
148 * Return the WPX specific IEs for the association request. |
|
149 * |
|
150 * @since S60 v3.1 |
|
151 * @param ap_data AP being connected to. |
|
152 * @param assoc_ie_list WPX IEs are added to this list. |
|
153 */ |
|
154 virtual void get_association_request_wpx_ie( |
|
155 core_ap_data_c& ap_data, |
|
156 core_type_list_c<core_frame_dot11_ie_c>& assoc_ie_list ) = 0; |
|
157 |
|
158 /** |
|
159 * Return the WPX version number. |
|
160 * |
|
161 * @since S60 v3.1 |
|
162 * @param frame Frame to search for WPX version number. |
|
163 * @return The WPX version number. Zero if none. |
|
164 */ |
|
165 virtual u8_t wpx_version( |
|
166 core_frame_beacon_c* frame ) = 0; |
|
167 |
|
168 /** |
|
169 * Return the maximum tx power level. |
|
170 * |
|
171 * @since S60 v3.1 |
|
172 * @param frame Frame to search for maximum tx power level. |
|
173 * @return Maximum tx power level, MAX_TX_POWER_LEVEL_NOT_DEFINED if none. |
|
174 */ |
|
175 virtual u8_t max_tx_power_level( |
|
176 core_frame_beacon_c* frame ) = 0; |
|
177 |
|
178 /** |
|
179 * Handle the WPX-specific features in traffic stream creation. |
|
180 * |
|
181 * @since S60 v3.2 |
|
182 * @param ap_data AP being connected to. |
|
183 * @param frame Frame containing the TSPEC parameters. |
|
184 * @param tid TID of the traffic stream. |
|
185 * @param tspec TSPEC parameters of the traffic stream. |
|
186 */ |
|
187 virtual void handle_ts_create_request( |
|
188 const core_ap_data_c& ap_data, |
|
189 core_frame_dot11_c* frame, |
|
190 u8_t tid, |
|
191 const core_traffic_stream_params_s& tspec ) = 0; |
|
192 |
|
193 /** |
|
194 * Get the WPX-specific traffic stream parameters. |
|
195 * |
|
196 * @since S60 v3.2 |
|
197 * @param frame Frame to be parsed. |
|
198 * @param tid TID of the traffic stream. |
|
199 * @param tspec Parameters are stored here. |
|
200 */ |
|
201 virtual void get_wpx_traffic_stream_params( |
|
202 core_frame_dot11_c* frame, |
|
203 u8_t tid, |
|
204 core_traffic_stream_params_s& tspec ) = 0; |
|
205 |
|
206 /** |
|
207 * Get the WPX-specific traffic stream status. |
|
208 * |
|
209 * @since S60 v3.2 |
|
210 * @param status Status Code field from the ADDTS Response. |
|
211 * @return The WPX-specific traffic stream status. |
|
212 */ |
|
213 virtual core_traffic_stream_status_e get_wpx_traffic_stream_status( |
|
214 u8_t status ) = 0; |
|
215 |
|
216 /** |
|
217 * Handle the WPX-specific features in association response. |
|
218 * |
|
219 * @since S60 v3.2 |
|
220 * @param ap_data AP being connected to. |
|
221 * @param frame Received reassociation response. |
|
222 */ |
|
223 virtual void handle_association_response( |
|
224 core_ap_data_c& ap_data, |
|
225 core_frame_assoc_resp_c* frame ) = 0; |
|
226 |
|
227 /** |
|
228 * Handle the WPX-specific operations after successful traffic stream creation. |
|
229 * |
|
230 * @since S60 v3.2 |
|
231 * @param frame Frame containing the TSPEC parameters. |
|
232 * @param tid TID of the traffic stream. |
|
233 * @param user_priority User Priority of the traffic stream. |
|
234 */ |
|
235 virtual void handle_ts_create_success( |
|
236 core_frame_dot11_c* frame, |
|
237 u8_t tid, |
|
238 u8_t user_priority ) = 0; |
|
239 |
|
240 /** |
|
241 * Handle the WPX-specific operations after traffic stream deletion. |
|
242 * |
|
243 * @since S60 v3.2 |
|
244 * @param tid TID of the traffic stream. |
|
245 * @param user_priority User Priority of the traffic stream. |
|
246 */ |
|
247 virtual void handle_ts_delete( |
|
248 u8_t tid, |
|
249 u8_t user_priority ) = 0; |
|
250 |
|
251 /** |
|
252 * Check whether the given management status code is WPX-specific. |
|
253 * |
|
254 * @since S60 v3.2 |
|
255 * @param management_status Management status code to check. |
|
256 * @return Whether the given status code is WPX-specific. |
|
257 */ |
|
258 virtual bool_t is_wpx_management_status( |
|
259 u32_t management_status ) = 0; |
|
260 |
|
261 /** |
|
262 * Check whether the given WPX-specific management status code is considered fatal. |
|
263 * |
|
264 * @since S60 v3.2 |
|
265 * @param management_status Management status code to check. |
|
266 * @return Whether the given status code is considered fatal. |
|
267 */ |
|
268 virtual bool_t is_fatal_wpx_management_status( |
|
269 u32_t management_status ) = 0; |
|
270 |
|
271 /** |
|
272 * Get the encryption mode used for connection. |
|
273 * |
|
274 * @since S60 v3.2 |
|
275 * @param ap_data AP being connected to. |
|
276 * @param mode Suggested encryption mode. |
|
277 * @return The encryption mode used for connection. |
|
278 */ |
|
279 virtual core_encryption_mode_e encryption_mode( |
|
280 core_ap_data_c& ap_data, |
|
281 core_encryption_mode_e mode ) = 0; |
|
282 |
|
283 /** |
|
284 * Get the authentication algorithm number used for connection. |
|
285 * |
|
286 * @since S60 v3.2 |
|
287 * @param eapol_auth_type The type of authentication. |
|
288 * @param eapol_auth_mode The authentication mode requested by EAPOL. |
|
289 * @return The authentication algorithm number used for connection. |
|
290 */ |
|
291 virtual u16_t authentication_algorithm( |
|
292 wlan_eapol_if_eapol_key_authentication_type_e eapol_auth_type, |
|
293 wlan_eapol_if_eapol_key_authentication_mode_e eapol_auth_mode ) = 0; |
|
294 |
|
295 /** |
|
296 * Return a WPX specific operation to be run during loading of drivers. |
|
297 * |
|
298 * @since S60 v3.2 |
|
299 * @return Pointer to the operation instance, NULL if none. |
|
300 */ |
|
301 virtual core_operation_base_c* get_wpx_load_drivers_operation() = 0; |
|
302 |
|
303 }; |
|
304 |
|
305 #endif // ABS_CORE_WPX_ADAPTATION_H |