|
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 all connection related data |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 37 % |
|
20 */ |
|
21 |
|
22 #include "core_connection_data.h" |
|
23 #include "core_tools.h" |
|
24 #include "am_debug.h" |
|
25 |
|
26 const u8_t CORE_FAILURE_NONE = 0; |
|
27 |
|
28 // ======== MEMBER FUNCTIONS ======== |
|
29 |
|
30 // --------------------------------------------------------------------------- |
|
31 // --------------------------------------------------------------------------- |
|
32 // |
|
33 core_connection_data_c::core_connection_data_c( |
|
34 const core_iap_data_s& iap_data, |
|
35 const core_device_settings_s& device_settings ) : |
|
36 iap_data_m( iap_data ), |
|
37 device_settings_m( device_settings ), |
|
38 connect_status_m( core_connect_undefined ), |
|
39 previous_ap_m( NULL ), |
|
40 current_ap_m( NULL ), |
|
41 ssid_m( BROADCAST_SSID ), |
|
42 temp_blacklist_m( ), |
|
43 last_rcp_class_m( core_rcp_normal ), |
|
44 last_tx_level_m( MAX_TX_POWER_LEVEL_NOT_DEFINED ), |
|
45 last_bssid_m( ZERO_MAC_ADDR ), |
|
46 last_connection_state_m( core_connection_state_notconnected ), |
|
47 association_failure_count_m( ), |
|
48 deauthentication_count_m( ), |
|
49 last_eap_type_m( EAP_TYPE_NONE ), |
|
50 last_eap_error_code_m( EAP_ERROR_NONE ), |
|
51 adjacent_ap_channels_m( ), |
|
52 is_eapol_authentication_started_m( false_t ), |
|
53 is_eapol_authenticating_m( false_t ), |
|
54 eapol_auth_bssid_m( ZERO_MAC_ADDR ), |
|
55 traffic_stream_list_m( ), |
|
56 virtual_traffic_stream_list_m( ), |
|
57 is_eapol_connecting_m( false_t ), |
|
58 is_disconnecting_m( false_t ), |
|
59 last_roam_reason_m( core_roam_reason_none ), |
|
60 last_roam_failed_reason_m( core_roam_failed_reason_none ), |
|
61 is_eapol_require_immediate_reconnect_m( false_t ), |
|
62 is_voice_call_on_m( false_t ), |
|
63 previous_rrm_measurement_request_time_m( 0 ) |
|
64 { |
|
65 DEBUG( "core_connection_data_c::core_connection_data_c()" ); |
|
66 |
|
67 for( u8_t idx( 0 ); idx < MAX_QOS_ACCESS_CLASS; ++idx ) |
|
68 { |
|
69 ac_traffic_status_m[idx] = core_access_class_traffic_status_admitted; |
|
70 ac_traffic_mode_m[idx] = core_access_class_traffic_mode_automatic; |
|
71 } |
|
72 } |
|
73 |
|
74 // --------------------------------------------------------------------------- |
|
75 // --------------------------------------------------------------------------- |
|
76 // |
|
77 core_connection_data_c::~core_connection_data_c() |
|
78 { |
|
79 DEBUG( "core_connection_data_c::~core_connection_data_c()" ); |
|
80 delete current_ap_m; |
|
81 delete previous_ap_m; |
|
82 temp_blacklist_m.clear(); |
|
83 association_failure_count_m.clear(); |
|
84 deauthentication_count_m.clear(); |
|
85 power_save_test_verdict_m.clear(); |
|
86 } |
|
87 |
|
88 // --------------------------------------------------------------------------- |
|
89 // --------------------------------------------------------------------------- |
|
90 // |
|
91 core_iap_data_c& core_connection_data_c::iap_data() |
|
92 { |
|
93 return iap_data_m; |
|
94 } |
|
95 |
|
96 // --------------------------------------------------------------------------- |
|
97 // --------------------------------------------------------------------------- |
|
98 // |
|
99 core_connect_status_e core_connection_data_c::connect_status() const |
|
100 { |
|
101 return connect_status_m; |
|
102 } |
|
103 |
|
104 // --------------------------------------------------------------------------- |
|
105 // --------------------------------------------------------------------------- |
|
106 // |
|
107 void core_connection_data_c::set_connect_status( |
|
108 core_connect_status_e connect_status ) |
|
109 { |
|
110 connect_status_m = connect_status; |
|
111 } |
|
112 |
|
113 // --------------------------------------------------------------------------- |
|
114 // --------------------------------------------------------------------------- |
|
115 // |
|
116 void core_connection_data_c::set_current_ap_data( |
|
117 const core_ap_data_c& ap_data ) |
|
118 { |
|
119 DEBUG( "core_connection_data_c::set_current_ap_data()" ); |
|
120 |
|
121 delete current_ap_m; |
|
122 current_ap_m = NULL; |
|
123 |
|
124 current_ap_m = core_ap_data_c::instance( ap_data ); |
|
125 } |
|
126 |
|
127 // --------------------------------------------------------------------------- |
|
128 // --------------------------------------------------------------------------- |
|
129 // |
|
130 core_ap_data_c* core_connection_data_c::current_ap_data() |
|
131 { |
|
132 return current_ap_m; |
|
133 } |
|
134 |
|
135 |
|
136 // --------------------------------------------------------------------------- |
|
137 // --------------------------------------------------------------------------- |
|
138 // |
|
139 void core_connection_data_c::set_previous_ap_data( |
|
140 const core_ap_data_c& ap_data ) |
|
141 { |
|
142 delete previous_ap_m; |
|
143 previous_ap_m = NULL; |
|
144 |
|
145 previous_ap_m = core_ap_data_c::instance( ap_data ); |
|
146 } |
|
147 |
|
148 // --------------------------------------------------------------------------- |
|
149 // --------------------------------------------------------------------------- |
|
150 // |
|
151 core_ap_data_c* core_connection_data_c::previous_ap_data() |
|
152 { |
|
153 return previous_ap_m; |
|
154 } |
|
155 |
|
156 // --------------------------------------------------------------------------- |
|
157 // --------------------------------------------------------------------------- |
|
158 // |
|
159 const core_ssid_s& core_connection_data_c::ssid() const |
|
160 { |
|
161 return ssid_m; |
|
162 } |
|
163 |
|
164 // --------------------------------------------------------------------------- |
|
165 // --------------------------------------------------------------------------- |
|
166 // |
|
167 void core_connection_data_c::set_ssid( |
|
168 const core_ssid_s& ssid ) |
|
169 { |
|
170 ssid_m = ssid; |
|
171 } |
|
172 |
|
173 // --------------------------------------------------------------------------- |
|
174 // --------------------------------------------------------------------------- |
|
175 // |
|
176 bool_t core_connection_data_c::is_mac_in_temporary_blacklist( |
|
177 const core_mac_address_s& mac ) |
|
178 { |
|
179 core_ap_blacklist_entry_s* addr = temp_blacklist_m.first(); |
|
180 while ( addr ) |
|
181 { |
|
182 if ( addr->bssid == mac ) |
|
183 { |
|
184 return true_t; |
|
185 } |
|
186 |
|
187 addr = temp_blacklist_m.next(); |
|
188 } |
|
189 |
|
190 return false_t; |
|
191 } |
|
192 |
|
193 // --------------------------------------------------------------------------- |
|
194 // --------------------------------------------------------------------------- |
|
195 // |
|
196 void core_connection_data_c::add_mac_to_temporary_blacklist( |
|
197 const core_mac_address_s& mac, |
|
198 core_ap_blacklist_reason_e reason ) |
|
199 { |
|
200 if ( !is_mac_in_temporary_blacklist( mac ) ) |
|
201 { |
|
202 core_ap_blacklist_entry_s* entry = new core_ap_blacklist_entry_s; |
|
203 if ( entry ) |
|
204 { |
|
205 entry->bssid = mac; |
|
206 entry->reason = reason; |
|
207 temp_blacklist_m.append( entry ); |
|
208 } |
|
209 } |
|
210 } |
|
211 |
|
212 // --------------------------------------------------------------------------- |
|
213 // --------------------------------------------------------------------------- |
|
214 // |
|
215 void core_connection_data_c::remove_mac_from_temporary_blacklist( |
|
216 const core_mac_address_s& mac ) |
|
217 { |
|
218 core_ap_blacklist_entry_s* addr = temp_blacklist_m.first(); |
|
219 while ( addr ) |
|
220 { |
|
221 if ( addr->bssid == mac ) |
|
222 { |
|
223 temp_blacklist_m.remove( addr ); |
|
224 delete addr; |
|
225 addr = NULL; |
|
226 |
|
227 return; |
|
228 } |
|
229 |
|
230 addr = temp_blacklist_m.next(); |
|
231 } |
|
232 } |
|
233 |
|
234 // --------------------------------------------------------------------------- |
|
235 // --------------------------------------------------------------------------- |
|
236 // |
|
237 core_type_list_c<core_ap_blacklist_entry_s>& core_connection_data_c::temporary_blacklist() |
|
238 { |
|
239 return temp_blacklist_m; |
|
240 } |
|
241 |
|
242 // --------------------------------------------------------------------------- |
|
243 // --------------------------------------------------------------------------- |
|
244 // |
|
245 void core_connection_data_c::remove_temporary_blacklist_entries( |
|
246 u32_t reasons ) |
|
247 { |
|
248 core_ap_blacklist_entry_s* addr = temp_blacklist_m.first(); |
|
249 while( addr ) |
|
250 { |
|
251 if( reasons & addr->reason ) |
|
252 { |
|
253 DEBUG6( "core_connection_data_c::remove_temporary_blacklist_entries() - removing entry with BSSID %02X:%02X:%02X:%02X:%02X:%02X", |
|
254 addr->bssid.addr[0], addr->bssid.addr[1], addr->bssid.addr[2], |
|
255 addr->bssid.addr[3], addr->bssid.addr[4], addr->bssid.addr[5] ); |
|
256 |
|
257 temp_blacklist_m.remove( addr ); |
|
258 delete addr; |
|
259 addr = NULL; |
|
260 |
|
261 return; |
|
262 } |
|
263 |
|
264 addr = temp_blacklist_m.next(); |
|
265 } |
|
266 } |
|
267 |
|
268 // --------------------------------------------------------------------------- |
|
269 // --------------------------------------------------------------------------- |
|
270 // |
|
271 core_rcp_class_e core_connection_data_c::last_rcp_class() const |
|
272 { |
|
273 return last_rcp_class_m; |
|
274 } |
|
275 |
|
276 // --------------------------------------------------------------------------- |
|
277 // --------------------------------------------------------------------------- |
|
278 // |
|
279 void core_connection_data_c::set_last_rcp_class( |
|
280 core_rcp_class_e type ) |
|
281 { |
|
282 last_rcp_class_m = type; |
|
283 }; |
|
284 |
|
285 // --------------------------------------------------------------------------- |
|
286 // --------------------------------------------------------------------------- |
|
287 // |
|
288 u32_t core_connection_data_c::last_tx_level() const |
|
289 { |
|
290 return last_tx_level_m; |
|
291 } |
|
292 |
|
293 // --------------------------------------------------------------------------- |
|
294 // --------------------------------------------------------------------------- |
|
295 // |
|
296 void core_connection_data_c::set_last_tx_level( |
|
297 u32_t tx_level ) |
|
298 { |
|
299 last_tx_level_m = tx_level; |
|
300 } |
|
301 |
|
302 // --------------------------------------------------------------------------- |
|
303 // --------------------------------------------------------------------------- |
|
304 // |
|
305 const core_mac_address_s& core_connection_data_c::last_bssid() const |
|
306 { |
|
307 return last_bssid_m; |
|
308 } |
|
309 |
|
310 // --------------------------------------------------------------------------- |
|
311 // --------------------------------------------------------------------------- |
|
312 // |
|
313 void core_connection_data_c::set_last_bssid( |
|
314 const core_mac_address_s& bssid ) |
|
315 { |
|
316 last_bssid_m = bssid; |
|
317 } |
|
318 |
|
319 // --------------------------------------------------------------------------- |
|
320 // --------------------------------------------------------------------------- |
|
321 // |
|
322 core_connection_state_e core_connection_data_c::connection_state() const |
|
323 { |
|
324 core_operating_mode_e mode = |
|
325 iap_data_m.operating_mode(); |
|
326 |
|
327 if( mode == core_operating_mode_ibss ) |
|
328 { |
|
329 if( iap_data_m.security_mode() == core_security_mode_allow_unsecure ) |
|
330 { |
|
331 return core_connection_state_ibss; |
|
332 } |
|
333 else |
|
334 { |
|
335 return core_connection_state_secureibss; |
|
336 } |
|
337 } |
|
338 else |
|
339 { |
|
340 if( iap_data_m.security_mode() == core_security_mode_allow_unsecure ) |
|
341 { |
|
342 return core_connection_state_infrastructure; |
|
343 } |
|
344 else |
|
345 { |
|
346 return core_connection_state_secureinfra; |
|
347 } |
|
348 } |
|
349 } |
|
350 |
|
351 // --------------------------------------------------------------------------- |
|
352 // --------------------------------------------------------------------------- |
|
353 // |
|
354 core_connection_state_e core_connection_data_c::last_connection_state() const |
|
355 { |
|
356 return last_connection_state_m; |
|
357 } |
|
358 |
|
359 // --------------------------------------------------------------------------- |
|
360 // --------------------------------------------------------------------------- |
|
361 // |
|
362 void core_connection_data_c::set_last_connection_state( |
|
363 core_connection_state_e state ) |
|
364 { |
|
365 last_connection_state_m = state; |
|
366 } |
|
367 |
|
368 // --------------------------------------------------------------------------- |
|
369 // --------------------------------------------------------------------------- |
|
370 // |
|
371 u8_t core_connection_data_c::ap_association_failure_count( |
|
372 const core_mac_address_s& bssid ) |
|
373 { |
|
374 core_ap_failure_count_s* iter = association_failure_count_m.first(); |
|
375 while ( iter ) |
|
376 { |
|
377 if ( iter->bssid == bssid ) |
|
378 { |
|
379 return iter->count; |
|
380 } |
|
381 |
|
382 iter = association_failure_count_m.next(); |
|
383 } |
|
384 |
|
385 return CORE_FAILURE_NONE; |
|
386 } |
|
387 |
|
388 // --------------------------------------------------------------------------- |
|
389 // --------------------------------------------------------------------------- |
|
390 // |
|
391 void core_connection_data_c::increase_ap_association_failure_count( |
|
392 const core_mac_address_s& bssid ) |
|
393 { |
|
394 core_ap_failure_count_s* iter = association_failure_count_m.first(); |
|
395 while ( iter ) |
|
396 { |
|
397 if ( iter->bssid == bssid ) |
|
398 { |
|
399 iter->count++; |
|
400 return; |
|
401 } |
|
402 |
|
403 iter = association_failure_count_m.next(); |
|
404 } |
|
405 |
|
406 iter = new core_ap_failure_count_s; |
|
407 if ( iter ) |
|
408 { |
|
409 iter->bssid = bssid; |
|
410 iter->count = CORE_FAILURE_NONE + 1; |
|
411 association_failure_count_m.append( iter ); |
|
412 } |
|
413 } |
|
414 |
|
415 // --------------------------------------------------------------------------- |
|
416 // --------------------------------------------------------------------------- |
|
417 // |
|
418 void core_connection_data_c::clear_ap_association_failure_count( |
|
419 const core_mac_address_s& bssid ) |
|
420 { |
|
421 core_ap_failure_count_s* iter = association_failure_count_m.first(); |
|
422 while ( iter ) |
|
423 { |
|
424 if ( iter->bssid == bssid ) |
|
425 { |
|
426 DEBUG1( "core_connection_data_c::clear_ap_failure_count() - this AP had %u previous failures", |
|
427 iter->count ); |
|
428 |
|
429 association_failure_count_m.remove( iter ); |
|
430 |
|
431 delete iter; |
|
432 iter = NULL; |
|
433 |
|
434 return; |
|
435 } |
|
436 |
|
437 iter = association_failure_count_m.next(); |
|
438 } |
|
439 |
|
440 DEBUG( "core_connection_data_c::clear_ap_failure_count() - this AP had no previous failures" ); |
|
441 } |
|
442 |
|
443 // --------------------------------------------------------------------------- |
|
444 // --------------------------------------------------------------------------- |
|
445 // |
|
446 u8_t core_connection_data_c::ap_authentication_failure_count( |
|
447 const core_mac_address_s& bssid ) |
|
448 { |
|
449 core_ap_auth_failure_count_s* iter = authentication_failure_count_m.first(); |
|
450 while ( iter ) |
|
451 { |
|
452 if ( iter->bssid == bssid ) |
|
453 { |
|
454 return iter->count; |
|
455 } |
|
456 |
|
457 iter = authentication_failure_count_m.next(); |
|
458 } |
|
459 |
|
460 return CORE_FAILURE_NONE; |
|
461 } |
|
462 |
|
463 // --------------------------------------------------------------------------- |
|
464 // --------------------------------------------------------------------------- |
|
465 // |
|
466 void core_connection_data_c::increase_ap_authentication_failure_count( |
|
467 const core_mac_address_s& bssid ) |
|
468 { |
|
469 core_ap_auth_failure_count_s* iter = authentication_failure_count_m.first(); |
|
470 while ( iter ) |
|
471 { |
|
472 if ( iter->bssid == bssid ) |
|
473 { |
|
474 iter->count++; |
|
475 return; |
|
476 } |
|
477 |
|
478 iter = authentication_failure_count_m.next(); |
|
479 } |
|
480 |
|
481 iter = new core_ap_auth_failure_count_s; |
|
482 if ( iter ) |
|
483 { |
|
484 iter->bssid = bssid; |
|
485 iter->count = CORE_FAILURE_NONE + 1; |
|
486 authentication_failure_count_m.append( iter ); |
|
487 } |
|
488 } |
|
489 |
|
490 // --------------------------------------------------------------------------- |
|
491 // --------------------------------------------------------------------------- |
|
492 // |
|
493 void core_connection_data_c::clear_all_authentication_failure_counts() |
|
494 { |
|
495 DEBUG( "core_connection_data_c::clear_all_authentication_failure_counts()" ); |
|
496 |
|
497 core_ap_auth_failure_count_s* iter = authentication_failure_count_m.first(); |
|
498 while ( iter ) |
|
499 { |
|
500 DEBUG1( "core_connection_data_c::clear_all_authentication_failure_counts() - this AP had %u previous failures", |
|
501 iter->count ); |
|
502 |
|
503 authentication_failure_count_m.remove( iter ); |
|
504 |
|
505 delete iter; |
|
506 iter = NULL; |
|
507 |
|
508 iter = authentication_failure_count_m.next(); |
|
509 } |
|
510 |
|
511 } |
|
512 |
|
513 |
|
514 // --------------------------------------------------------------------------- |
|
515 // --------------------------------------------------------------------------- |
|
516 // |
|
517 u8_t core_connection_data_c::ap_deauthentication_count( |
|
518 const core_mac_address_s& bssid ) |
|
519 { |
|
520 core_ap_failure_count_s* iter = deauthentication_count_m.first(); |
|
521 while ( iter ) |
|
522 { |
|
523 if ( iter->bssid == bssid ) |
|
524 { |
|
525 return iter->count; |
|
526 } |
|
527 |
|
528 iter = deauthentication_count_m.next(); |
|
529 } |
|
530 |
|
531 return CORE_FAILURE_NONE; |
|
532 } |
|
533 |
|
534 // --------------------------------------------------------------------------- |
|
535 // --------------------------------------------------------------------------- |
|
536 // |
|
537 void core_connection_data_c::increase_ap_deauthentication_count( |
|
538 const core_mac_address_s& bssid ) |
|
539 { |
|
540 core_ap_failure_count_s* iter = deauthentication_count_m.first(); |
|
541 while ( iter ) |
|
542 { |
|
543 if ( iter->bssid == bssid ) |
|
544 { |
|
545 iter->count++; |
|
546 return; |
|
547 } |
|
548 |
|
549 iter = deauthentication_count_m.next(); |
|
550 } |
|
551 |
|
552 iter = new core_ap_failure_count_s; |
|
553 if ( iter ) |
|
554 { |
|
555 iter->bssid = bssid; |
|
556 iter->count = CORE_FAILURE_NONE + 1; |
|
557 deauthentication_count_m.append( iter ); |
|
558 } |
|
559 } |
|
560 |
|
561 // --------------------------------------------------------------------------- |
|
562 // --------------------------------------------------------------------------- |
|
563 // |
|
564 u32_t core_connection_data_c::last_failed_eap_type() const |
|
565 { |
|
566 return last_eap_type_m; |
|
567 } |
|
568 |
|
569 // --------------------------------------------------------------------------- |
|
570 // --------------------------------------------------------------------------- |
|
571 // |
|
572 void core_connection_data_c::set_last_failed_eap_type( |
|
573 u32_t type ) |
|
574 { |
|
575 last_eap_type_m = type; |
|
576 } |
|
577 |
|
578 // --------------------------------------------------------------------------- |
|
579 // --------------------------------------------------------------------------- |
|
580 // |
|
581 u32_t core_connection_data_c::last_eap_error() const |
|
582 { |
|
583 return last_eap_error_code_m; |
|
584 } |
|
585 |
|
586 // --------------------------------------------------------------------------- |
|
587 // --------------------------------------------------------------------------- |
|
588 // |
|
589 void core_connection_data_c::set_last_eap_error( |
|
590 u32_t error ) |
|
591 { |
|
592 last_eap_error_code_m = error; |
|
593 } |
|
594 |
|
595 // --------------------------------------------------------------------------- |
|
596 // --------------------------------------------------------------------------- |
|
597 // |
|
598 const core_scan_channels_c& core_connection_data_c::adjacent_ap_channels() const |
|
599 { |
|
600 return adjacent_ap_channels_m; |
|
601 } |
|
602 |
|
603 // --------------------------------------------------------------------------- |
|
604 // --------------------------------------------------------------------------- |
|
605 // |
|
606 void core_connection_data_c::set_adjacent_ap_channels( |
|
607 const core_scan_channels_c& channels ) |
|
608 { |
|
609 adjacent_ap_channels_m.set( channels ); |
|
610 } |
|
611 |
|
612 // --------------------------------------------------------------------------- |
|
613 // --------------------------------------------------------------------------- |
|
614 // |
|
615 void core_connection_data_c::merge_adjacent_ap_channels( |
|
616 const core_scan_channels_c& channels ) |
|
617 { |
|
618 adjacent_ap_channels_m.merge( channels ); |
|
619 } |
|
620 |
|
621 // --------------------------------------------------------------------------- |
|
622 // --------------------------------------------------------------------------- |
|
623 // |
|
624 bool_t core_connection_data_c::is_eapol_authentication_started() const |
|
625 { |
|
626 return is_eapol_authentication_started_m; |
|
627 } |
|
628 |
|
629 // --------------------------------------------------------------------------- |
|
630 // --------------------------------------------------------------------------- |
|
631 // |
|
632 void core_connection_data_c::set_eapol_authentication_started( |
|
633 bool_t is_authentication_started ) |
|
634 { |
|
635 is_eapol_authentication_started_m = is_authentication_started; |
|
636 } |
|
637 |
|
638 // --------------------------------------------------------------------------- |
|
639 // --------------------------------------------------------------------------- |
|
640 // |
|
641 bool_t core_connection_data_c::is_eapol_authenticating() const |
|
642 { |
|
643 return is_eapol_authenticating_m; |
|
644 } |
|
645 |
|
646 // --------------------------------------------------------------------------- |
|
647 // --------------------------------------------------------------------------- |
|
648 // |
|
649 void core_connection_data_c::set_eapol_authenticating( |
|
650 bool_t is_authenticating ) |
|
651 { |
|
652 is_eapol_authenticating_m = is_authenticating; |
|
653 } |
|
654 |
|
655 // --------------------------------------------------------------------------- |
|
656 // --------------------------------------------------------------------------- |
|
657 // |
|
658 const core_mac_address_s& core_connection_data_c::eapol_auth_bssid() const |
|
659 { |
|
660 return eapol_auth_bssid_m; |
|
661 } |
|
662 |
|
663 // --------------------------------------------------------------------------- |
|
664 // --------------------------------------------------------------------------- |
|
665 // |
|
666 void core_connection_data_c::set_eapol_auth_bssid( |
|
667 const core_mac_address_s& bssid ) |
|
668 { |
|
669 eapol_auth_bssid_m = bssid; |
|
670 } |
|
671 |
|
672 // --------------------------------------------------------------------------- |
|
673 // --------------------------------------------------------------------------- |
|
674 // |
|
675 core_traffic_stream_list_c& core_connection_data_c::traffic_stream_list() |
|
676 { |
|
677 return traffic_stream_list_m; |
|
678 } |
|
679 |
|
680 // --------------------------------------------------------------------------- |
|
681 // --------------------------------------------------------------------------- |
|
682 // |
|
683 core_virtual_traffic_stream_list_c& core_connection_data_c::virtual_traffic_stream_list() |
|
684 { |
|
685 return virtual_traffic_stream_list_m; |
|
686 } |
|
687 |
|
688 // --------------------------------------------------------------------------- |
|
689 // --------------------------------------------------------------------------- |
|
690 // |
|
691 bool_t core_connection_data_c::is_eapol_connecting() const |
|
692 { |
|
693 return is_eapol_connecting_m; |
|
694 } |
|
695 |
|
696 // --------------------------------------------------------------------------- |
|
697 // --------------------------------------------------------------------------- |
|
698 // |
|
699 void core_connection_data_c::set_eapol_connecting( |
|
700 bool_t is_eapol_connecting ) |
|
701 { |
|
702 is_eapol_connecting_m = is_eapol_connecting; |
|
703 } |
|
704 |
|
705 // --------------------------------------------------------------------------- |
|
706 // --------------------------------------------------------------------------- |
|
707 // |
|
708 bool_t core_connection_data_c::is_disconnecting() const |
|
709 { |
|
710 return is_disconnecting_m; |
|
711 } |
|
712 |
|
713 // --------------------------------------------------------------------------- |
|
714 // --------------------------------------------------------------------------- |
|
715 // |
|
716 void core_connection_data_c::set_disconnecting( |
|
717 bool_t is_disconnecting ) |
|
718 { |
|
719 is_disconnecting_m = is_disconnecting; |
|
720 } |
|
721 |
|
722 // --------------------------------------------------------------------------- |
|
723 // --------------------------------------------------------------------------- |
|
724 // |
|
725 const core_rcpi_roam_interval_s& core_connection_data_c::rcpi_roam_interval() const |
|
726 { |
|
727 return rcpi_roam_interval_m; |
|
728 } |
|
729 |
|
730 // --------------------------------------------------------------------------- |
|
731 // --------------------------------------------------------------------------- |
|
732 // |
|
733 void core_connection_data_c::reset_rcpi_roam_interval() |
|
734 { |
|
735 rcpi_roam_interval_m.count = 0; |
|
736 rcpi_roam_interval_m.interval = device_settings_m.rcpi_roam_min_interval; |
|
737 } |
|
738 |
|
739 // --------------------------------------------------------------------------- |
|
740 // --------------------------------------------------------------------------- |
|
741 // |
|
742 void core_connection_data_c::set_core_rcpi_roam_interval( |
|
743 const core_rcpi_roam_interval_s& interval ) |
|
744 { |
|
745 rcpi_roam_interval_m = interval; |
|
746 } |
|
747 |
|
748 // --------------------------------------------------------------------------- |
|
749 // --------------------------------------------------------------------------- |
|
750 // |
|
751 core_roam_reason_e core_connection_data_c::last_roam_reason() const |
|
752 { |
|
753 return last_roam_reason_m; |
|
754 } |
|
755 |
|
756 // --------------------------------------------------------------------------- |
|
757 // --------------------------------------------------------------------------- |
|
758 // |
|
759 void core_connection_data_c::set_last_roam_reason( |
|
760 core_roam_reason_e reason ) |
|
761 { |
|
762 last_roam_reason_m = reason; |
|
763 } |
|
764 |
|
765 // --------------------------------------------------------------------------- |
|
766 // --------------------------------------------------------------------------- |
|
767 // |
|
768 core_roam_failed_reason_e core_connection_data_c::last_roam_failed_reason() const |
|
769 { |
|
770 return last_roam_failed_reason_m; |
|
771 } |
|
772 |
|
773 // --------------------------------------------------------------------------- |
|
774 // --------------------------------------------------------------------------- |
|
775 // |
|
776 void core_connection_data_c::set_last_roam_failed_reason( |
|
777 core_roam_failed_reason_e reason ) |
|
778 { |
|
779 last_roam_failed_reason_m = reason; |
|
780 } |
|
781 |
|
782 // --------------------------------------------------------------------------- |
|
783 // --------------------------------------------------------------------------- |
|
784 // |
|
785 bool_t core_connection_data_c::is_ap_power_save_test_run( |
|
786 const core_mac_address_s& bssid, |
|
787 bool_t& is_success ) |
|
788 { |
|
789 core_ap_power_save_test_verdict_s* iter = power_save_test_verdict_m.first(); |
|
790 while ( iter ) |
|
791 { |
|
792 if ( iter->bssid == bssid ) |
|
793 { |
|
794 is_success = iter->is_success; |
|
795 |
|
796 return true_t; |
|
797 } |
|
798 |
|
799 iter = power_save_test_verdict_m.next(); |
|
800 } |
|
801 |
|
802 return false_t; |
|
803 } |
|
804 |
|
805 // --------------------------------------------------------------------------- |
|
806 // --------------------------------------------------------------------------- |
|
807 // |
|
808 void core_connection_data_c::add_ap_power_save_test_verdict( |
|
809 const core_mac_address_s& bssid, |
|
810 bool_t is_success ) |
|
811 { |
|
812 core_ap_power_save_test_verdict_s* iter = new core_ap_power_save_test_verdict_s; |
|
813 if ( iter ) |
|
814 { |
|
815 iter->bssid = bssid; |
|
816 iter->is_success = is_success; |
|
817 |
|
818 power_save_test_verdict_m.append( iter ); |
|
819 } |
|
820 } |
|
821 |
|
822 // --------------------------------------------------------------------------- |
|
823 // --------------------------------------------------------------------------- |
|
824 // |
|
825 bool_t core_connection_data_c::is_eapol_require_immediate_reconnect() const |
|
826 { |
|
827 return is_eapol_require_immediate_reconnect_m; |
|
828 } |
|
829 |
|
830 // --------------------------------------------------------------------------- |
|
831 // --------------------------------------------------------------------------- |
|
832 // |
|
833 void core_connection_data_c::set_eapol_require_immediate_reconnect( |
|
834 bool_t is_immediate_reconnect_required ) |
|
835 { |
|
836 is_eapol_require_immediate_reconnect_m = is_immediate_reconnect_required; |
|
837 } |
|
838 |
|
839 // --------------------------------------------------------------------------- |
|
840 // --------------------------------------------------------------------------- |
|
841 // |
|
842 bool_t core_connection_data_c::voice_call_state() const |
|
843 { |
|
844 DEBUG1( "core_connection_data_c::voice_call_state() - returning %u", is_voice_call_on_m ); |
|
845 return is_voice_call_on_m; |
|
846 } |
|
847 |
|
848 // --------------------------------------------------------------------------- |
|
849 // --------------------------------------------------------------------------- |
|
850 // |
|
851 void core_connection_data_c::set_voice_call_state( const bool_t& is_voice_call_on ) |
|
852 { |
|
853 DEBUG1( "core_connection_data_c::set_voice_call_state( %u )", is_voice_call_on ); |
|
854 is_voice_call_on_m = is_voice_call_on; |
|
855 } |
|
856 |
|
857 // --------------------------------------------------------------------------- |
|
858 // --------------------------------------------------------------------------- |
|
859 // |
|
860 const u64_t& core_connection_data_c::get_previous_rrm_measurement_request_time() const |
|
861 { |
|
862 return previous_rrm_measurement_request_time_m; |
|
863 } |
|
864 |
|
865 // --------------------------------------------------------------------------- |
|
866 // --------------------------------------------------------------------------- |
|
867 // |
|
868 void core_connection_data_c::set_previous_rrm_measurement_request_time( const u64_t& timestamp) |
|
869 { |
|
870 previous_rrm_measurement_request_time_m = timestamp; |
|
871 } |
|
872 |
|
873 // --------------------------------------------------------------------------- |
|
874 // --------------------------------------------------------------------------- |
|
875 // |
|
876 core_access_class_traffic_status_e core_connection_data_c::ac_traffic_status( |
|
877 core_access_class_e access_class ) const |
|
878 { |
|
879 return ac_traffic_status_m[access_class]; |
|
880 } |
|
881 |
|
882 // --------------------------------------------------------------------------- |
|
883 // --------------------------------------------------------------------------- |
|
884 // |
|
885 void core_connection_data_c::set_ac_traffic_status( |
|
886 core_access_class_e access_class, |
|
887 core_access_class_traffic_status_e status ) |
|
888 { |
|
889 ac_traffic_status_m[access_class] = status; |
|
890 } |
|
891 |
|
892 // --------------------------------------------------------------------------- |
|
893 // --------------------------------------------------------------------------- |
|
894 // |
|
895 core_access_class_traffic_mode_e core_connection_data_c::ac_traffic_mode( |
|
896 core_access_class_e access_class ) const |
|
897 { |
|
898 return ac_traffic_mode_m[access_class]; |
|
899 } |
|
900 |
|
901 // --------------------------------------------------------------------------- |
|
902 // --------------------------------------------------------------------------- |
|
903 // |
|
904 void core_connection_data_c::set_ac_traffic_mode( |
|
905 core_access_class_e access_class, |
|
906 core_access_class_traffic_mode_e mode ) |
|
907 { |
|
908 ac_traffic_mode_m[access_class] = mode; |
|
909 } |