eapol/eapol_framework/eapol_symbian/am/core/symbian/Eapol.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 153 
       
    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 // INCLUDE FILES
       
    29 #include <e32base.h>
       
    30 #include "eap_am_memory.h"
       
    31 #include <Eapol.h>
       
    32 #include "eapol_am_core_symbian.h"
       
    33 
       
    34 //--------------------------------------------------
       
    35 
       
    36 //
       
    37 
       
    38 CEapol::~CEapol()
       
    39 {
       
    40 	delete iEapolCore;
       
    41 }
       
    42 
       
    43 //--------------------------------------------------
       
    44 
       
    45 //
       
    46 
       
    47 CEapol::CEapol()
       
    48 : iEapolCore(0)
       
    49 {
       
    50 }
       
    51 
       
    52 //--------------------------------------------------
       
    53 
       
    54 //
       
    55 
       
    56 EXPORT_C CEapol* CEapol::NewL(MEapolToWlmIf* const aPartner, const TBool aIsClient, const TUint aServerIndex)
       
    57 {
       
    58 	CEapol* self = new(ELeave) CEapol;
       
    59 	CleanupStack::PushL(self);
       
    60 	self->ConstructL(aPartner, aIsClient, aServerIndex);
       
    61 	CleanupStack::Pop();
       
    62 	return self;
       
    63 }
       
    64 
       
    65 //--------------------------------------------------
       
    66 
       
    67 //
       
    68 
       
    69 void CEapol::ConstructL(MEapolToWlmIf* const aPartner, 
       
    70 						const TBool aIsClient,
       
    71 						const TUint aServerIndex)
       
    72 {
       
    73 	if (aIsClient)
       
    74 	{
       
    75 		iEapolCore = eapol_am_core_symbian_c::NewL(aPartner, true, aServerIndex);
       
    76 	}
       
    77 	else
       
    78 	{
       
    79 		iEapolCore = eapol_am_core_symbian_c::NewL(aPartner, false, aServerIndex);
       
    80 	}
       
    81 }
       
    82 
       
    83 //--------------------------------------------------
       
    84 
       
    85 //
       
    86 
       
    87 EXPORT_C TInt CEapol::Start(const TIndexType aIndexType,
       
    88 							const TUint aIndex,
       
    89 							const TSSID& aSSID,
       
    90 							const TBool aWPAOverrideEnabled,
       
    91 							const TUint8* aWPAPSK,
       
    92 							const TUint aWPAPSKLength)
       
    93 {
       
    94 	return iEapolCore->Start(aIndexType, aIndex, aSSID, aWPAOverrideEnabled, aWPAPSK, aWPAPSKLength);
       
    95 }
       
    96 
       
    97 //--------------------------------------------------
       
    98 
       
    99 //
       
   100 
       
   101 EXPORT_C TInt CEapol::CompleteAssociation(
       
   102 	const TInt aResult,
       
   103 	const TMacAddress& aLocalAddress, 
       
   104 	const TMacAddress& aRemoteAddress,
       
   105 	const TUint8* const aReceivedWPAIE, 
       
   106 	const TUint aReceivedWPAIELength,
       
   107 	const TUint8* const aSentWPAIE,
       
   108 	const TUint aSentWPAIELength,
       
   109 	const TWPACipherSuite aGroupKeyCipherSuite,
       
   110 	const TWPACipherSuite aPairwiseKeyCipherSuite
       
   111 	)
       
   112 {
       
   113 	return iEapolCore->CompleteAssociation(
       
   114 		aResult,
       
   115 		aLocalAddress,
       
   116 		aRemoteAddress,
       
   117 		aReceivedWPAIE,
       
   118 		aReceivedWPAIELength,
       
   119 		aSentWPAIE,
       
   120 		aSentWPAIELength,
       
   121 		aGroupKeyCipherSuite,
       
   122 		aPairwiseKeyCipherSuite
       
   123 	);
       
   124 }
       
   125 
       
   126 //--------------------------------------------------
       
   127 
       
   128 //
       
   129 
       
   130 EXPORT_C TInt CEapol::Disassociated()
       
   131 {
       
   132 	return iEapolCore->Disassociated();		
       
   133 }
       
   134 
       
   135 //--------------------------------------------------
       
   136 
       
   137 //
       
   138 
       
   139 EXPORT_C TInt CEapol::ReceivePacket(const TUint aLength, const TUint8* const aData)
       
   140 {
       
   141 	return iEapolCore->ReceivePacket(aLength, aData);	
       
   142 }
       
   143 
       
   144 //--------------------------------------------------
       
   145 
       
   146 //
       
   147 
       
   148 EXPORT_C TInt CEapol::SendWPAMICFailureReport(
       
   149 		TBool aFatalMICFailure,
       
   150 		const TMICFailureType aMICFailureType)
       
   151 {
       
   152 	return iEapolCore->SendWPAMICFailureReport(aFatalMICFailure, aMICFailureType);		
       
   153 }
       
   154 
       
   155 // End of file