|
1 /* |
|
2 * Copyright (c) 2005-2009 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: Class holding access point specific information |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 23 % |
|
20 */ |
|
21 |
|
22 #ifndef CORE_AP_DATA_H |
|
23 #define CORE_AP_DATA_H |
|
24 |
|
25 #include "core_types.h" |
|
26 #include "core_scan_channels.h" |
|
27 #include "core_frame_mgmt_ie.h" |
|
28 #include "abs_core_wpx_adaptation.h" |
|
29 |
|
30 const u32_t CORE_EAPOL_WPAIE_DATA_OFFSET = 2; |
|
31 |
|
32 class core_frame_dot11_c; |
|
33 class core_frame_dot11_ie_c; |
|
34 class core_frame_rsn_ie_c; |
|
35 class core_frame_wpa_ie_c; |
|
36 class core_frame_wsc_ie_c; |
|
37 class core_frame_beacon_c; |
|
38 class core_frame_wmm_ie_parameter_c; |
|
39 class core_frame_qbss_load_ie_c; |
|
40 class core_frame_wapi_ie_c; |
|
41 |
|
42 /** |
|
43 * Class encapsulating a single AP parsed from the scan results. |
|
44 * |
|
45 * @since S60 v3.1 |
|
46 */ |
|
47 NONSHARABLE_CLASS( core_ap_data_c ) |
|
48 { |
|
49 |
|
50 public: |
|
51 |
|
52 typedef enum _core_am_ap_data_capability |
|
53 { |
|
54 core_am_ap_data_capability_rsn_ie_present = 1, |
|
55 core_am_ap_data_capability_wpa_ie_present = 2, |
|
56 core_am_ap_data_capability_wmm_ie_present = 4, |
|
57 core_am_ap_data_capability_uapsd_supported = 8, |
|
58 core_am_ap_data_capability_wapi_ie_present = 16 |
|
59 } core_am_ap_data_capability; |
|
60 |
|
61 /** |
|
62 * Factory method used for creating an instance of core_ap_data_c |
|
63 * encapsulating the copy of the given core_ap_data_c instance. |
|
64 * |
|
65 * @since S60 v3.1 |
|
66 * @param copy Instance to be copied. |
|
67 * @return Instance of the class, NULL if parsing failed. |
|
68 */ |
|
69 static core_ap_data_c* instance( |
|
70 const core_ap_data_c& copy ); |
|
71 |
|
72 /** |
|
73 * Factory method used for creating an instance of core_ap_data_c |
|
74 * encapsulating the given beacon/probe response frame. |
|
75 * |
|
76 * @since S60 v3.1 |
|
77 * @param wpx_adaptation WPX adaptation. |
|
78 * @param frame Beacon/probe response frame to be encapsulated. |
|
79 * @param rcpi RCPI value of the frame. |
|
80 * @param is_copied Whether the object should take a copy of the frame data. |
|
81 * @return Instance of the class, NULL if parsing failed. |
|
82 */ |
|
83 static core_ap_data_c* instance( |
|
84 abs_core_wpx_adaptation_c& wpx_adaptation, |
|
85 const core_frame_dot11_c* frame, |
|
86 u8_t rcpi, |
|
87 bool_t is_copied ); |
|
88 |
|
89 /** |
|
90 * Destructor. |
|
91 */ |
|
92 virtual ~core_ap_data_c(); |
|
93 |
|
94 /** |
|
95 * Get BSSID of the AP. |
|
96 * |
|
97 * @since S60 v3.1 |
|
98 * @return BSSID of the AP. |
|
99 */ |
|
100 core_mac_address_s bssid() const; |
|
101 |
|
102 /** |
|
103 * Get the SSID of the AP. |
|
104 */ |
|
105 core_ssid_s ssid(); |
|
106 |
|
107 /** |
|
108 * Get the capabilities field of the AP. |
|
109 * |
|
110 * @since S60 v3.1 |
|
111 * @return Capabilities field of the AP. |
|
112 */ |
|
113 u16_t capabilities() const; |
|
114 |
|
115 /** |
|
116 * Get the maximum allowed tx power level. |
|
117 * |
|
118 * @since S60 v3.1 |
|
119 * @return Maximum allowed tx power level, |
|
120 * MAX_TX_POWER_LEVEL_NOT_DEFINED if not defined. |
|
121 */ |
|
122 u8_t max_tx_power_level() const; |
|
123 |
|
124 /** |
|
125 * Get the country information. |
|
126 * |
|
127 * @since S60 v5.0 |
|
128 * @return Country information, country information is zero if not defined. |
|
129 */ |
|
130 core_country_string_s country_info() const; |
|
131 |
|
132 /** |
|
133 * Get the privacy field of the AP. |
|
134 * |
|
135 * @since S60 v3.1 |
|
136 * @return Privacy field of the AP. |
|
137 */ |
|
138 bool_t is_privacy_enabled() const; |
|
139 |
|
140 /** |
|
141 * whether short preamble is allowed or not. If not, long must be used. |
|
142 * |
|
143 * @since S60 v3.1 |
|
144 * @return true if short is allowed |
|
145 */ |
|
146 bool_t is_short_preamble_allowed() const; |
|
147 |
|
148 /** |
|
149 * whether short slot time is allowed or not. If not, long must be used. |
|
150 * |
|
151 * @since S60 v3.1 |
|
152 * @return true if short is allowed |
|
153 */ |
|
154 bool_t is_short_slot_time_used() const; |
|
155 |
|
156 /** |
|
157 * whether accesspoint (i.e. infra) or ad hoc network |
|
158 * |
|
159 * @since S60 v3.1 |
|
160 * @return true if infrastrcture network |
|
161 */ |
|
162 bool_t is_infra() const; |
|
163 |
|
164 /** |
|
165 * Whether radio measurement is supported. |
|
166 * |
|
167 * @since S60 v5.2 |
|
168 * @return Whether radio measurement is supported |
|
169 */ |
|
170 bool_t is_radio_measurement_supported() const; |
|
171 |
|
172 /** |
|
173 * is WPA IE present or not |
|
174 * |
|
175 * @since S60 v3.1 |
|
176 * @return true if present |
|
177 */ |
|
178 bool_t is_wpa_ie_present() const; |
|
179 |
|
180 /** |
|
181 * is RSN IE present or not |
|
182 * |
|
183 * @since S60 v3.1 |
|
184 * @return true if present |
|
185 */ |
|
186 bool_t is_rsn_ie_present() const; |
|
187 |
|
188 /** |
|
189 * is WMM IE present or not |
|
190 * |
|
191 * @since S60 v3.2 |
|
192 * @return true if present |
|
193 */ |
|
194 bool_t is_wmm_ie_present() const; |
|
195 |
|
196 /** |
|
197 * Whether U-APSD is supported. |
|
198 * |
|
199 * @since S60 v3.2 |
|
200 * @return Whether U-APSD is supported. |
|
201 */ |
|
202 bool_t is_uapsd_supported() const; |
|
203 |
|
204 /** |
|
205 * Return whether Admission Control is mandatory for the given access class. |
|
206 * @return Whether Admission Control is mandatory for the given access class. |
|
207 */ |
|
208 bool_t is_admission_control_required( |
|
209 core_access_class_e access_class ) const; |
|
210 |
|
211 /** |
|
212 * is WAPI IE present or not |
|
213 * |
|
214 * @since S60 v3.2 |
|
215 * @return true if present |
|
216 */ |
|
217 bool_t is_wapi_ie_present() const; |
|
218 |
|
219 /** |
|
220 * pairwise_ciphers |
|
221 * |
|
222 * @since S60 v3.1 |
|
223 * @return pairwise key |
|
224 */ |
|
225 u8_t pairwise_ciphers() const; |
|
226 |
|
227 /** |
|
228 * group_cipher |
|
229 * |
|
230 * @since S60 v3.1 |
|
231 * @return group key |
|
232 */ |
|
233 u8_t group_cipher() const; |
|
234 |
|
235 /** |
|
236 * key_management_suites of the AP |
|
237 * |
|
238 * @since S60 v3.1 |
|
239 * @return |
|
240 */ |
|
241 u8_t key_management_suites() const; |
|
242 |
|
243 /** |
|
244 * best_pairwise_cipher |
|
245 * |
|
246 * @since S60 v3.1 |
|
247 * @return |
|
248 */ |
|
249 core_cipher_suite_e best_pairwise_cipher() const; |
|
250 |
|
251 /** |
|
252 * best_group_cipher |
|
253 * |
|
254 * @since S60 v3.1 |
|
255 * @return |
|
256 */ |
|
257 core_cipher_suite_e best_group_cipher() const; |
|
258 |
|
259 /** |
|
260 * is wpx supported or not by the AP |
|
261 * |
|
262 * @since S60 v3.1 |
|
263 * @return |
|
264 */ |
|
265 bool_t is_wpx() const; |
|
266 |
|
267 /** |
|
268 * Return the WPX version. |
|
269 * |
|
270 * @since S60 v3.2 |
|
271 * @return The WPX version. |
|
272 */ |
|
273 u8_t wpx_version() const; |
|
274 |
|
275 /** |
|
276 * channel where AP operates |
|
277 * |
|
278 * @since S60 v3.1 |
|
279 * @return |
|
280 */ |
|
281 u8_t channel() const; |
|
282 |
|
283 /** |
|
284 * is_wpx_fast_roam_available |
|
285 * |
|
286 * @since S60 v3.1 |
|
287 * @return |
|
288 */ |
|
289 bool_t is_wpx_fast_roam_available() const; |
|
290 |
|
291 /** |
|
292 * timestamp |
|
293 * |
|
294 * @since S60 v3.1 |
|
295 * @return |
|
296 */ |
|
297 core_tsf_value_s timestamp() const; |
|
298 |
|
299 /** |
|
300 * band |
|
301 * |
|
302 * @since S60 v3.1 |
|
303 * @return |
|
304 */ |
|
305 u8_t band() const; |
|
306 |
|
307 /** |
|
308 * Get RCPI value of the frame. |
|
309 * |
|
310 * @since S60 v3.1 |
|
311 * @return RCPI value of the frame. |
|
312 */ |
|
313 u8_t rcpi() const; |
|
314 |
|
315 /** |
|
316 * Return the beacon interval of the frame. |
|
317 * |
|
318 * @since S60 v3.1 |
|
319 * @return The beacon interval of the frame. |
|
320 */ |
|
321 u16_t beacon_interval() const; |
|
322 |
|
323 /** |
|
324 * Return the DTIM period of the AP. |
|
325 * |
|
326 * @since S60 v3.2 |
|
327 * @return The DTIM period of the AP. |
|
328 */ |
|
329 u8_t dtim_period() const; |
|
330 |
|
331 /** |
|
332 * Set the DTIM period of the AP. |
|
333 * |
|
334 * @since S60 v3.2 |
|
335 * @param dtim_period The DTIM period of the AP. |
|
336 */ |
|
337 void set_dtim_period( |
|
338 u8_t dtim_period ); |
|
339 |
|
340 /** |
|
341 * Get the actual beacon/probe response frame of the AP. |
|
342 * |
|
343 * @since S60 v3.1 |
|
344 * @return The actual beacon/probe response frame of the AP. |
|
345 */ |
|
346 core_frame_beacon_c* frame() const; |
|
347 |
|
348 /** |
|
349 * Return an WPA IE parser instance. |
|
350 * @return NULL if no WPA IE present, pointer to instance otherwise. |
|
351 */ |
|
352 const core_frame_wpa_ie_c* wpa_ie(); |
|
353 |
|
354 /** |
|
355 * Return an RSN IE parser instance. |
|
356 * @return NULL if no RSN IE present, pointer to instance otherwise. |
|
357 */ |
|
358 const core_frame_rsn_ie_c* rsn_ie(); |
|
359 |
|
360 /** |
|
361 * Return an WSC IE parser instance. |
|
362 * @return NULL if no WSC IE present, pointer to instance otherwise. |
|
363 */ |
|
364 const core_frame_wsc_ie_c* wsc_ie(); |
|
365 |
|
366 /** |
|
367 * Return a WMM Parameter Element IE parser instance. |
|
368 * @return NULL if no WMM Parameter Element IE present, pointer to instance otherwise. |
|
369 */ |
|
370 const core_frame_wmm_ie_parameter_c* wmm_parameter_ie(); |
|
371 |
|
372 /** |
|
373 * Return an 802.11e QBSS Load IE parser instance. |
|
374 * @return NULL if no 802.11e QBSS Load IE present, pointer to instance otherwise. |
|
375 */ |
|
376 const core_frame_qbss_load_ie_c* qbss_load_ie(); |
|
377 |
|
378 /** |
|
379 * Process AP channel report information elements. |
|
380 * |
|
381 * @since S60 v5.1 |
|
382 * @return |
|
383 */ |
|
384 core_scan_channels_c ap_channel_report(); |
|
385 |
|
386 /** |
|
387 * Return a WAPI IE parser instance. |
|
388 * @return NULL if no WAPI IE present, pointer to instance otherwise. |
|
389 */ |
|
390 const core_frame_wapi_ie_c* wapi_ie(); |
|
391 |
|
392 /** |
|
393 * Get an 802.11k Admission Capacities. |
|
394 * @param admission_capacities Admission Capacities. |
|
395 */ |
|
396 void admission_capacity( |
|
397 medium_time_s& admission_capacities ); |
|
398 |
|
399 /** |
|
400 * Return power capability. |
|
401 * @return power capability. |
|
402 */ |
|
403 u8_t power_capability(); |
|
404 |
|
405 /** |
|
406 * Return RRM capabilities. |
|
407 * @return RRM capabilities. |
|
408 */ |
|
409 u64_t rrm_capabilities(); |
|
410 |
|
411 /** |
|
412 * Get reported frame body. |
|
413 * @param reported_frame_body_length Reported frame body length. |
|
414 * @param reported_frame_body Reported frame body. |
|
415 */ |
|
416 void get_reported_frame_body( |
|
417 u16_t* reported_frame_body_length, |
|
418 u8_t* reported_frame_body ); |
|
419 |
|
420 /** |
|
421 * Get Request IE. |
|
422 * @param reported_frame_body_length Reported frame body length. |
|
423 * @param reported_frame_body Reported frame body. |
|
424 * @param ie_id_list IE ID list. |
|
425 * @param ie_id_list_length IE ID list length. |
|
426 */ |
|
427 void request_ie( |
|
428 u16_t* reported_frame_body_length, |
|
429 u8_t* reported_frame_body, |
|
430 u8_t* ie_id_list, |
|
431 u8_t ie_id_list_length ); |
|
432 |
|
433 /** |
|
434 * Assignment operator. |
|
435 */ |
|
436 core_ap_data_c& operator=( |
|
437 const core_ap_data_c& src ); |
|
438 |
|
439 private: |
|
440 |
|
441 /** |
|
442 * Constructor. |
|
443 * |
|
444 * @param wpx_adaptation WPX adaptation. |
|
445 */ |
|
446 core_ap_data_c( |
|
447 abs_core_wpx_adaptation_c& wpx_adaptation ); |
|
448 |
|
449 /** |
|
450 * Return the most secure cipher from the given list. |
|
451 * @param ciphers List of ciphers to choose from. |
|
452 * @return The most secure cipher from the given list. |
|
453 */ |
|
454 core_cipher_suite_e best_cipher( |
|
455 u32_t ciphers ) const; |
|
456 |
|
457 private: // data |
|
458 |
|
459 /** WPX adaptation instance. */ |
|
460 abs_core_wpx_adaptation_c& wpx_adaptation_m; |
|
461 |
|
462 /** Beacon/Probe response frame. */ |
|
463 core_frame_beacon_c* frame_m; |
|
464 |
|
465 /** RCPI value of the frame. */ |
|
466 u8_t rcpi_m; |
|
467 |
|
468 /** Supported pairwise ciphers. */ |
|
469 u8_t pairwise_cipher_m; |
|
470 |
|
471 /** Supported group ciphers. */ |
|
472 u8_t group_cipher_m; |
|
473 |
|
474 /** Supported key management suites. */ |
|
475 u8_t key_management_m; |
|
476 |
|
477 /** The WPX version supported by the AP. */ |
|
478 u8_t wpx_version_m; |
|
479 |
|
480 /** Bitmap of different boolean capabilities. */ |
|
481 u8_t capabilities_bitmap_m; |
|
482 |
|
483 /** Bitmap of AC classes that require admission control. */ |
|
484 u8_t is_ac_required_bitmap_m; |
|
485 |
|
486 /** DTIM period. */ |
|
487 u8_t dtim_period_m; |
|
488 |
|
489 }; |
|
490 |
|
491 #endif // CORE_AP_DATA_H |