100 DEBUG( "core_sub_operation_wpa_connect_c::next_state() - marking is_eapol_authentication_started as true" ); |
100 DEBUG( "core_sub_operation_wpa_connect_c::next_state() - marking is_eapol_authentication_started as true" ); |
101 server_m->get_connection_data()->set_eapol_authentication_started( |
101 server_m->get_connection_data()->set_eapol_authentication_started( |
102 true_t ); |
102 true_t ); |
103 server_m->get_connection_data()->set_eapol_auth_bssid( |
103 server_m->get_connection_data()->set_eapol_auth_bssid( |
104 ZERO_MAC_ADDR ); |
104 ZERO_MAC_ADDR ); |
|
105 server_m->get_connection_data()->set_eapol_auth_failure( |
|
106 core_error_ok ); |
105 |
107 |
106 eapol_auth_type_m = core_tools_c::eap_authentication_type( |
108 eapol_auth_type_m = core_tools_c::eap_authentication_type( |
107 server_m->get_connection_data()->iap_data(), |
109 server_m->get_connection_data()->iap_data(), |
108 ap_data_m ); |
110 ap_data_m ); |
109 current_bssid_m = ap_data_m.bssid(); |
111 current_bssid_m = ap_data_m.bssid(); |
632 server_m->get_eapol_instance().ethernet_type() ); |
634 server_m->get_eapol_instance().ethernet_type() ); |
633 |
635 |
634 DEBUG6( "core_sub_operation_wpa_connect_c::next_state() - EAPOL disassociation from BSSID %02X:%02X:%02X:%02X:%02X:%02X", |
636 DEBUG6( "core_sub_operation_wpa_connect_c::next_state() - EAPOL disassociation from BSSID %02X:%02X:%02X:%02X:%02X:%02X", |
635 current_bssid_m.addr[0], current_bssid_m.addr[1], current_bssid_m.addr[2], |
637 current_bssid_m.addr[0], current_bssid_m.addr[1], current_bssid_m.addr[2], |
636 current_bssid_m.addr[3], current_bssid_m.addr[4], current_bssid_m.addr[5] ); |
638 current_bssid_m.addr[3], current_bssid_m.addr[4], current_bssid_m.addr[5] ); |
|
639 DEBUG( "core_sub_operation_wpa_connect_c::next_state() - marking is_eapol_disconnecting as true" ); |
|
640 server_m->get_connection_data()->set_eapol_disconnecting( |
|
641 true ); |
637 |
642 |
638 server_m->get_eapol_instance().disassociation( &network ); |
643 server_m->get_eapol_instance().disassociation( &network ); |
639 |
644 operation_state_m = core_state_user_cancel_disassociated; |
|
645 |
|
646 break; |
|
647 } |
|
648 case core_state_user_cancel_disassociated: |
|
649 { |
640 /** The connection attempt failed, we are no longer connected. */ |
650 /** The connection attempt failed, we are no longer connected. */ |
641 is_connected_m = false_t; |
651 is_connected_m = false_t; |
642 |
652 |
643 return core_error_cancel; |
653 return core_error_cancel; |
644 } |
654 } |
768 |
778 |
769 // --------------------------------------------------------------------------- |
779 // --------------------------------------------------------------------------- |
770 // --------------------------------------------------------------------------- |
780 // --------------------------------------------------------------------------- |
771 // |
781 // |
772 core_error_e core_sub_operation_wpa_connect_c::disassociate( |
782 core_error_e core_sub_operation_wpa_connect_c::disassociate( |
773 network_id_c * /*receive_network_id*/, |
783 network_id_c * receive_network_id, |
774 const bool_t /* self_disassociation */ ) |
784 const bool_t /* self_disassociation */ ) |
775 { |
785 { |
776 DEBUG( "core_sub_operation_wpa_connect_c::disassociate()" ); |
786 DEBUG( "core_sub_operation_wpa_connect_c::disassociate()" ); |
|
787 |
|
788 const core_mac_address_s bssid( |
|
789 receive_network_id->source() ); |
|
790 DEBUG6( "core_sub_operation_wpa_connect_c::disassociate() - function BSSID is %02X:%02X:%02X:%02X:%02X:%02X", |
|
791 bssid.addr[0], bssid.addr[1], bssid.addr[2], |
|
792 bssid.addr[3], bssid.addr[4], bssid.addr[5] ); |
|
793 DEBUG6( "core_sub_operation_wpa_connect_c::disassociate() - EAPOL disassociation from BSSID %02X:%02X:%02X:%02X:%02X:%02X", |
|
794 current_bssid_m.addr[0], current_bssid_m.addr[1], current_bssid_m.addr[2], |
|
795 current_bssid_m.addr[3], current_bssid_m.addr[4], current_bssid_m.addr[5] ); |
|
796 if( operation_state_m == core_state_req_state_notification && |
|
797 bssid == current_bssid_m ) |
|
798 { |
|
799 DEBUG( "core_sub_operation_wpa_connect_c::disassociate() - marking is_eapol_disconnecting as true" ); |
|
800 server_m->get_connection_data()->set_eapol_disconnecting( |
|
801 true ); |
|
802 |
|
803 server_m->get_eapol_instance().disassociation( receive_network_id ); |
|
804 } |
777 |
805 |
778 return core_error_ok; |
806 return core_error_ok; |
779 } |
807 } |
780 |
808 |
781 // --------------------------------------------------------------------------- |
809 // --------------------------------------------------------------------------- |
930 ASSERT( false_t ); |
958 ASSERT( false_t ); |
931 |
959 |
932 return core_error_ok; |
960 return core_error_ok; |
933 } |
961 } |
934 |
962 |
|
963 // --------------------------------------------------------------------------- |
|
964 // --------------------------------------------------------------------------- |
|
965 // |
|
966 core_error_e core_sub_operation_wpa_connect_c::complete_disassociation( |
|
967 network_id_c * /* receive_network_id */ ) |
|
968 { |
|
969 DEBUG( "core_sub_operation_wpa_connect_c::complete_disassociation()" ); |
|
970 |
|
971 ASSERT( false_t ); |
|
972 |
|
973 return core_error_ok; |
|
974 } |
935 |
975 |
936 // --------------------------------------------------------------------------- |
976 // --------------------------------------------------------------------------- |
937 // --------------------------------------------------------------------------- |
977 // --------------------------------------------------------------------------- |
938 // |
978 // |
939 void core_sub_operation_wpa_connect_c::handle_error( |
979 void core_sub_operation_wpa_connect_c::handle_error( |
958 { |
998 { |
959 is_cached_sa_used_m = false_t; |
999 is_cached_sa_used_m = false_t; |
960 |
1000 |
961 asynch_goto( core_state_init, CORE_TIMER_IMMEDIATELY ); |
1001 asynch_goto( core_state_init, CORE_TIMER_IMMEDIATELY ); |
962 } |
1002 } |
963 else if ( function == wlan_eapol_if_message_type_function_complete_association |
1003 else if ( ( function == wlan_eapol_if_message_type_function_complete_association |
964 || function == wlan_eapol_if_message_type_function_complete_reassociation |
1004 || function == wlan_eapol_if_message_type_function_complete_reassociation |
965 || function == wlan_eapol_if_message_type_function_complete_wpx_fast_roam_reassociation ) |
1005 || function == wlan_eapol_if_message_type_function_complete_wpx_fast_roam_reassociation ) && |
|
1006 eapol_auth_type_m == wlan_eapol_if_eapol_key_authentication_type_wpx_fast_roam ) |
966 { |
1007 { |
967 DEBUG( "core_sub_operation_wpa_connect_c::handle_error() - (WPX fast-roam) (re-)association failed" ); |
1008 DEBUG( "core_sub_operation_wpa_connect_c::handle_error() - (WPX fast-roam) (re-)association failed" ); |
968 asynch_goto( core_state_req_association_failed, CORE_TIMER_IMMEDIATELY ); |
1009 asynch_goto( core_state_req_association_failed, CORE_TIMER_IMMEDIATELY ); |
969 } |
1010 } |
970 /*else if ( function == wlan_eapol_if_message_type_function_start_authentication ) |
1011 /*else if ( function == wlan_eapol_if_message_type_function_start_authentication ) |
1009 server_m->get_eapol_instance().ethernet_type() ); |
1050 server_m->get_eapol_instance().ethernet_type() ); |
1010 |
1051 |
1011 DEBUG6( "core_sub_operation_wpa_connect_c::notify() - EAPOL disassociation from BSSID %02X:%02X:%02X:%02X:%02X:%02X", |
1052 DEBUG6( "core_sub_operation_wpa_connect_c::notify() - EAPOL disassociation from BSSID %02X:%02X:%02X:%02X:%02X:%02X", |
1012 current_bssid_m.addr[0], current_bssid_m.addr[1], current_bssid_m.addr[2], |
1053 current_bssid_m.addr[0], current_bssid_m.addr[1], current_bssid_m.addr[2], |
1013 current_bssid_m.addr[3], current_bssid_m.addr[4], current_bssid_m.addr[5] ); |
1054 current_bssid_m.addr[3], current_bssid_m.addr[4], current_bssid_m.addr[5] ); |
|
1055 DEBUG( "core_sub_operation_wpa_connect_c::next_state() - marking is_eapol_disconnecting as true" ); |
|
1056 server_m->get_connection_data()->set_eapol_disconnecting( |
|
1057 true ); |
|
1058 server_m->get_connection_data()->set_eapol_auth_failure( |
|
1059 core_error_eapol_failure ); |
1014 |
1060 |
1015 server_m->get_eapol_instance().disassociation( &network ); |
1061 server_m->get_eapol_instance().disassociation( &network ); |
1016 |
|
1017 if ( indication != core_am_indication_wlan_media_disconnect ) |
|
1018 { |
|
1019 DEBUG( "core_sub_operation_wpa_connect_c::notify() - marking is_eapol_authenticating as false" ); |
|
1020 server_m->get_connection_data()->set_eapol_authenticating( |
|
1021 false_t ); |
|
1022 DEBUG( "core_sub_operation_wpa_connect_c::notify() - marking is_eapol_authentication_started as false" ); |
|
1023 server_m->get_connection_data()->set_eapol_authentication_started( |
|
1024 false_t ); |
|
1025 |
|
1026 asynch_goto( core_state_bss_lost ); |
|
1027 |
|
1028 return true_t; |
|
1029 } |
|
1030 |
1062 |
1031 /** |
1063 /** |
1032 * EAPOL indication will move the state machine forward. |
1064 * EAPOL indication will move the state machine forward. |
1033 */ |
1065 */ |
1034 |
1066 |