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(); |
640 server_m->get_eapol_instance().ethernet_type() ); |
642 server_m->get_eapol_instance().ethernet_type() ); |
641 |
643 |
642 DEBUG6( "core_sub_operation_wpa_connect_c::next_state() - EAPOL disassociation from BSSID %02X:%02X:%02X:%02X:%02X:%02X", |
644 DEBUG6( "core_sub_operation_wpa_connect_c::next_state() - EAPOL disassociation from BSSID %02X:%02X:%02X:%02X:%02X:%02X", |
643 current_bssid_m.addr[0], current_bssid_m.addr[1], current_bssid_m.addr[2], |
645 current_bssid_m.addr[0], current_bssid_m.addr[1], current_bssid_m.addr[2], |
644 current_bssid_m.addr[3], current_bssid_m.addr[4], current_bssid_m.addr[5] ); |
646 current_bssid_m.addr[3], current_bssid_m.addr[4], current_bssid_m.addr[5] ); |
|
647 DEBUG( "core_sub_operation_wpa_connect_c::next_state() - marking is_eapol_disconnecting as true" ); |
|
648 server_m->get_connection_data()->set_eapol_disconnecting( |
|
649 true ); |
645 |
650 |
646 server_m->get_eapol_instance().disassociation( &network ); |
651 server_m->get_eapol_instance().disassociation( &network ); |
647 |
652 operation_state_m = core_state_user_cancel_disassociated; |
|
653 |
|
654 break; |
|
655 } |
|
656 case core_state_user_cancel_disassociated: |
|
657 { |
648 /** The connection attempt failed, we are no longer connected. */ |
658 /** The connection attempt failed, we are no longer connected. */ |
649 is_connected_m = false_t; |
659 is_connected_m = false_t; |
650 |
660 |
651 return core_error_cancel; |
661 return core_error_cancel; |
652 } |
662 } |
776 |
786 |
777 // --------------------------------------------------------------------------- |
787 // --------------------------------------------------------------------------- |
778 // --------------------------------------------------------------------------- |
788 // --------------------------------------------------------------------------- |
779 // |
789 // |
780 core_error_e core_sub_operation_wpa_connect_c::disassociate( |
790 core_error_e core_sub_operation_wpa_connect_c::disassociate( |
781 network_id_c * /*receive_network_id*/, |
791 network_id_c * receive_network_id, |
782 const bool_t /* self_disassociation */ ) |
792 const bool_t /* self_disassociation */ ) |
783 { |
793 { |
784 DEBUG( "core_sub_operation_wpa_connect_c::disassociate()" ); |
794 DEBUG( "core_sub_operation_wpa_connect_c::disassociate()" ); |
|
795 |
|
796 const core_mac_address_s bssid( |
|
797 receive_network_id->source() ); |
|
798 DEBUG6( "core_sub_operation_wpa_connect_c::disassociate() - function BSSID is %02X:%02X:%02X:%02X:%02X:%02X", |
|
799 bssid.addr[0], bssid.addr[1], bssid.addr[2], |
|
800 bssid.addr[3], bssid.addr[4], bssid.addr[5] ); |
|
801 DEBUG6( "core_sub_operation_wpa_connect_c::disassociate() - EAPOL disassociation from BSSID %02X:%02X:%02X:%02X:%02X:%02X", |
|
802 current_bssid_m.addr[0], current_bssid_m.addr[1], current_bssid_m.addr[2], |
|
803 current_bssid_m.addr[3], current_bssid_m.addr[4], current_bssid_m.addr[5] ); |
|
804 if( operation_state_m == core_state_req_state_notification && |
|
805 bssid == current_bssid_m ) |
|
806 { |
|
807 DEBUG( "core_sub_operation_wpa_connect_c::disassociate() - marking is_eapol_disconnecting as true" ); |
|
808 server_m->get_connection_data()->set_eapol_disconnecting( |
|
809 true ); |
|
810 |
|
811 server_m->get_eapol_instance().disassociation( receive_network_id ); |
|
812 } |
785 |
813 |
786 return core_error_ok; |
814 return core_error_ok; |
787 } |
815 } |
788 |
816 |
789 // --------------------------------------------------------------------------- |
817 // --------------------------------------------------------------------------- |
938 ASSERT( false_t ); |
966 ASSERT( false_t ); |
939 |
967 |
940 return core_error_ok; |
968 return core_error_ok; |
941 } |
969 } |
942 |
970 |
|
971 // --------------------------------------------------------------------------- |
|
972 // --------------------------------------------------------------------------- |
|
973 // |
|
974 core_error_e core_sub_operation_wpa_connect_c::complete_disassociation( |
|
975 network_id_c * /* receive_network_id */ ) |
|
976 { |
|
977 DEBUG( "core_sub_operation_wpa_connect_c::complete_disassociation()" ); |
|
978 |
|
979 ASSERT( false_t ); |
|
980 |
|
981 return core_error_ok; |
|
982 } |
943 |
983 |
944 // --------------------------------------------------------------------------- |
984 // --------------------------------------------------------------------------- |
945 // --------------------------------------------------------------------------- |
985 // --------------------------------------------------------------------------- |
946 // |
986 // |
947 void core_sub_operation_wpa_connect_c::handle_error( |
987 void core_sub_operation_wpa_connect_c::handle_error( |
966 { |
1006 { |
967 is_cached_sa_used_m = false_t; |
1007 is_cached_sa_used_m = false_t; |
968 |
1008 |
969 asynch_goto( core_state_init, CORE_TIMER_IMMEDIATELY ); |
1009 asynch_goto( core_state_init, CORE_TIMER_IMMEDIATELY ); |
970 } |
1010 } |
971 else if ( function == wlan_eapol_if_message_type_function_complete_association |
1011 else if ( ( function == wlan_eapol_if_message_type_function_complete_association |
972 || function == wlan_eapol_if_message_type_function_complete_reassociation |
1012 || function == wlan_eapol_if_message_type_function_complete_reassociation |
973 || function == wlan_eapol_if_message_type_function_complete_wpx_fast_roam_reassociation ) |
1013 || function == wlan_eapol_if_message_type_function_complete_wpx_fast_roam_reassociation ) && |
|
1014 eapol_auth_type_m == wlan_eapol_if_eapol_key_authentication_type_wpx_fast_roam ) |
974 { |
1015 { |
975 DEBUG( "core_sub_operation_wpa_connect_c::handle_error() - (WPX fast-roam) (re-)association failed" ); |
1016 DEBUG( "core_sub_operation_wpa_connect_c::handle_error() - (WPX fast-roam) (re-)association failed" ); |
976 asynch_goto( core_state_req_association_failed, CORE_TIMER_IMMEDIATELY ); |
1017 asynch_goto( core_state_req_association_failed, CORE_TIMER_IMMEDIATELY ); |
977 } |
1018 } |
978 /*else if ( function == wlan_eapol_if_message_type_function_start_authentication ) |
1019 /*else if ( function == wlan_eapol_if_message_type_function_start_authentication ) |
1017 server_m->get_eapol_instance().ethernet_type() ); |
1058 server_m->get_eapol_instance().ethernet_type() ); |
1018 |
1059 |
1019 DEBUG6( "core_sub_operation_wpa_connect_c::notify() - EAPOL disassociation from BSSID %02X:%02X:%02X:%02X:%02X:%02X", |
1060 DEBUG6( "core_sub_operation_wpa_connect_c::notify() - EAPOL disassociation from BSSID %02X:%02X:%02X:%02X:%02X:%02X", |
1020 current_bssid_m.addr[0], current_bssid_m.addr[1], current_bssid_m.addr[2], |
1061 current_bssid_m.addr[0], current_bssid_m.addr[1], current_bssid_m.addr[2], |
1021 current_bssid_m.addr[3], current_bssid_m.addr[4], current_bssid_m.addr[5] ); |
1062 current_bssid_m.addr[3], current_bssid_m.addr[4], current_bssid_m.addr[5] ); |
|
1063 DEBUG( "core_sub_operation_wpa_connect_c::next_state() - marking is_eapol_disconnecting as true" ); |
|
1064 server_m->get_connection_data()->set_eapol_disconnecting( |
|
1065 true ); |
|
1066 server_m->get_connection_data()->set_eapol_auth_failure( |
|
1067 core_error_eapol_failure ); |
1022 |
1068 |
1023 server_m->get_eapol_instance().disassociation( &network ); |
1069 server_m->get_eapol_instance().disassociation( &network ); |
1024 |
|
1025 if ( indication != core_am_indication_wlan_media_disconnect ) |
|
1026 { |
|
1027 DEBUG( "core_sub_operation_wpa_connect_c::notify() - marking is_eapol_authenticating as false" ); |
|
1028 server_m->get_connection_data()->set_eapol_authenticating( |
|
1029 false_t ); |
|
1030 DEBUG( "core_sub_operation_wpa_connect_c::notify() - marking is_eapol_authentication_started as false" ); |
|
1031 server_m->get_connection_data()->set_eapol_authentication_started( |
|
1032 false_t ); |
|
1033 |
|
1034 asynch_goto( core_state_bss_lost ); |
|
1035 |
|
1036 return true_t; |
|
1037 } |
|
1038 |
1070 |
1039 /** |
1071 /** |
1040 * EAPOL indication will move the state machine forward. |
1072 * EAPOL indication will move the state machine forward. |
1041 */ |
1073 */ |
1042 |
1074 |