eapol/eapol_framework/eapol_common/core/eap_session_core_base.cpp
branchRCL_3
changeset 46 c74b3d9f6b9e
parent 45 bad0cc58d154
child 55 9c2aa05919d9
equal deleted inserted replaced
45:bad0cc58d154 46:c74b3d9f6b9e
     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 * %version: 12 %
       
    20 */
       
    21 
       
    22 // This is enumeration of EAPOL source code.
       
    23 #if defined(USE_EAP_MINIMUM_RELEASE_TRACES)
       
    24 	#undef EAP_FILE_NUMBER_ENUM
       
    25 	#define EAP_FILE_NUMBER_ENUM 727 
       
    26 	#undef EAP_FILE_NUMBER_DATE 
       
    27 	#define EAP_FILE_NUMBER_DATE 1127594498 
       
    28 #endif //#if defined(USE_EAP_MINIMUM_RELEASE_TRACES)
       
    29 
       
    30 
       
    31 #include "eap_session_core_base.h"
       
    32 #include "eap_session_core.h"
       
    33 #include "eap_core_client_message_if.h"
       
    34 #include "eap_automatic_variable.h"
       
    35 
       
    36 
       
    37 EAP_FUNC_EXPORT eap_session_core_base_c::~eap_session_core_base_c()
       
    38 {
       
    39 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
    40 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
    41 }
       
    42 
       
    43 EAP_FUNC_EXPORT eap_session_core_base_c::eap_session_core_base_c()
       
    44 {
       
    45 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
    46 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
    47 }
       
    48 
       
    49 //--------------------------------------------------
       
    50 //--------------------------------------------------
       
    51 //--------------------------------------------------
       
    52 
       
    53 //
       
    54 EAP_FUNC_EXPORT eap_session_core_base_c * eap_session_core_base_c::new_eap_session_core_c(
       
    55 	abs_eap_am_tools_c * const tools,
       
    56 	abs_eap_session_core_c * const partner,
       
    57 	const bool is_client_when_true,
       
    58 	const u32_t /* MTU */)
       
    59 {
       
    60 	eap_session_core_c * new_session_core = new eap_session_core_c(tools, partner, is_client_when_true);
       
    61 
       
    62 	eap_automatic_variable_c<eap_session_core_c> automatic_new_session_core(
       
    63 		tools,
       
    64 		new_session_core);
       
    65 
       
    66 	if (new_session_core == 0
       
    67 		|| new_session_core->get_is_valid() == false)
       
    68 	{
       
    69 		// ERROR.
       
    70 		if (new_session_core != 0)
       
    71 		{
       
    72 			EAP_TRACE_DEBUG(
       
    73 				tools,
       
    74 				TRACE_FLAGS_ALWAYS|TRACE_FLAGS_DEFAULT, 
       
    75 				(EAPL("calls: new_eap_session_core_c(): new_session_core->shutdown(): %s.\n"),
       
    76 				(is_client_when_true == true) ? "client": "server"));
       
    77 
       
    78 			new_session_core->shutdown();
       
    79 		}
       
    80 		return 0;
       
    81 	}
       
    82 
       
    83 	automatic_new_session_core.do_not_free_variable();
       
    84 
       
    85 	return new_session_core;
       
    86 }
       
    87 
       
    88 //--------------------------------------------------
       
    89 // End.