eapol/eapol_framework/eapol_common/type/gsmsim/core/eap_type_gsmsim_state.cpp
changeset 0 c8830336c852
child 2 1c7bc153c08e
equal deleted inserted replaced
-1:000000000000 0:c8830336c852
       
     1 /*
       
     2 * Copyright (c) 2001-2006 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:  EAP and WLAN authentication protocols.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // This is enumeration of EAPOL source code.
       
    20 #if defined(USE_EAP_MINIMUM_RELEASE_TRACES)
       
    21 	#undef EAP_FILE_NUMBER_ENUM
       
    22 	#define EAP_FILE_NUMBER_ENUM 83 
       
    23 	#undef EAP_FILE_NUMBER_DATE 
       
    24 	#define EAP_FILE_NUMBER_DATE 1127594498 
       
    25 #endif //#if defined(USE_EAP_MINIMUM_RELEASE_TRACES)
       
    26 
       
    27 
       
    28 
       
    29 #include "eap_am_memory.h"
       
    30 #include "eap_tools.h"
       
    31 #include "eap_am_export.h"
       
    32 #include "eap_base_type.h"
       
    33 #include "eap_variable_data.h"
       
    34 #include "eap_type_gsmsim_header.h"
       
    35 #include "eap_type_gsmsim_types.h"
       
    36 #include "eap_type_gsmsim_payloads.h"
       
    37 #include "abs_eap_type_gsmsim_state.h"
       
    38 #include "abs_eap_base_timer.h"
       
    39 #include "eap_type_gsmsim_state.h"
       
    40 #include "eap_crypto_api.h"
       
    41 #include "eap_state_notification.h"
       
    42 
       
    43 //--------------------------------------------------
       
    44 
       
    45 
       
    46 EAP_FUNC_EXPORT eap_type_gsmsim_state_variable_parameters_c::~eap_type_gsmsim_state_variable_parameters_c()
       
    47 {
       
    48 }
       
    49 
       
    50 EAP_FUNC_EXPORT eap_type_gsmsim_state_variable_parameters_c::eap_type_gsmsim_state_variable_parameters_c()
       
    51 	: m_must_be_initiator(false)
       
    52 	, m_must_be_responder(false)
       
    53 {
       
    54 	u32_t ind = 0;
       
    55 	for (ind = 0; ind < GSMSIM_STATE_MAX_TYPES; ind++)
       
    56 	{
       
    57 		m_valid_types[ind] = gsmsim_subtype_NONE;
       
    58 	}
       
    59 }
       
    60 
       
    61 
       
    62 EAP_FUNC_EXPORT bool eap_type_gsmsim_state_variable_parameters_c::check_valid_types(gsmsim_subtype_e type) const
       
    63 {
       
    64 	for (u32_t ind = 0u; ind < GSMSIM_STATE_MAX_TYPES; ind++)
       
    65 	{
       
    66 		if (type == m_valid_types[ind])
       
    67 		{
       
    68 			return true;
       
    69 		}
       
    70 	}
       
    71 	return false;
       
    72 }
       
    73 
       
    74 EAP_FUNC_EXPORT bool eap_type_gsmsim_state_variable_parameters_c::check_initiator(const bool is_initiator) const
       
    75 {
       
    76 	if (m_must_be_initiator == true && is_initiator == false
       
    77 		|| m_must_be_responder == true && is_initiator == true)
       
    78 	{
       
    79 		return false;
       
    80 	}
       
    81 	return true;
       
    82 }
       
    83 
       
    84 EAP_FUNC_EXPORT void eap_type_gsmsim_state_variable_parameters_c::init_state(
       
    85 	const bool must_be_initiator,
       
    86 	const bool must_be_responder,
       
    87 	const gsmsim_subtype_e type0,
       
    88 	const gsmsim_subtype_e type1,
       
    89 	const gsmsim_subtype_e type2,
       
    90 	const gsmsim_subtype_e type3)
       
    91 {
       
    92 	m_must_be_initiator = (must_be_initiator);
       
    93 	m_must_be_responder = (must_be_responder);
       
    94 	m_valid_types[0] = (type0);
       
    95 	m_valid_types[1] = (type1);
       
    96 	m_valid_types[2] = (type2);
       
    97 	m_valid_types[3] = (type3);
       
    98 }
       
    99 
       
   100 
       
   101 //--------------------------------------------------
       
   102 
       
   103 
       
   104 
       
   105 // End.