eapol/eapol_framework/eapol_symbian/eap_server/src/EapSession.cpp
branchRCL_3
changeset 46 c74b3d9f6b9e
parent 45 bad0cc58d154
child 55 9c2aa05919d9
equal deleted inserted replaced
45:bad0cc58d154 46:c74b3d9f6b9e
     1 /*
       
     2 * Copyright (c) 2009-2010 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-session inside EAP-server.
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 32 %
       
    20 */
       
    21 
       
    22 
       
    23 #define __REFERENCE_CAPABILITY_NAMES__
       
    24 #define __INCLUDE_CAPABILITY_NAMES__
       
    25 
       
    26 #include "EapSession.h"
       
    27 #include "EapServerStrings.h"
       
    28 #include "EapServer.h"
       
    29 #include "EapServerProcessHandler.h"
       
    30 #include "EapServerClientDef.h"
       
    31 #include "abs_eap_am_tools.h"
       
    32 #include "EapTraceSymbian.h"
       
    33 
       
    34 #include "eap_automatic_variable.h"
       
    35 
       
    36 /*
       
    37     CEapSession
       
    38 */
       
    39 
       
    40 const TInt KMaxMessageLength = 1000000;
       
    41 
       
    42 // -----------------------------------------------------------------------------------------
       
    43 
       
    44 // construct/destruct
       
    45 
       
    46 CEapSession::CEapSession()
       
    47 : iReceiveActive(EFalse)
       
    48 , iEapProcessHandler(0)
       
    49 , iTools(0)
       
    50     {
       
    51     EAP_TRACE_DEBUG_SYMBIAN((_L("CEapSession::CEapSession(): this=0x%08x"),
       
    52 		this));
       
    53 
       
    54 	EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: CEapSession::CEapSession()"));
       
    55 
       
    56     }
       
    57 
       
    58 // -----------------------------------------------------------------------------------------
       
    59 
       
    60 void CEapSession::ConstructL(CEapServer& /* aServer */, abs_eap_am_tools_c * const tools)
       
    61     {
       
    62 	EAP_TRACE_DEBUG(
       
    63 		tools,
       
    64 		TRACE_FLAGS_DEFAULT,
       
    65 		(EAPL("CEapSession::ConstructL(): this=0x%08x\n"),
       
    66 		this));
       
    67 	EAP_TRACE_RETURN_STRING(tools, "returns: CEapSession::ConstructL()");
       
    68 
       
    69     iTools = tools;
       
    70 
       
    71     iEapProcessHandler = CEapServerProcessHandler::NewL();
       
    72     iEapProcessHandler->ConstructL(this, iTools);
       
    73 	CActiveScheduler::Add(iEapProcessHandler);
       
    74     }
       
    75 
       
    76 // -----------------------------------------------------------------------------------------
       
    77 
       
    78 CEapSession::~CEapSession()
       
    79     {
       
    80 	EAP_TRACE_DEBUG(
       
    81 		iTools,
       
    82 		TRACE_FLAGS_DEFAULT,
       
    83 		(EAPL("CEapSession::~CEapSession(): this=0x%08x\n"),
       
    84 		this));
       
    85 	EAP_TRACE_RETURN_STRING(iTools, "returns: CEapSession::~CEapSession()");
       
    86 
       
    87     // cancel any receive
       
    88     CancelReceive();
       
    89     if (iEapProcessHandler != 0)
       
    90         {
       
    91         delete iEapProcessHandler;
       
    92         iEapProcessHandler = 0;
       
    93         }
       
    94     // decrement session count, so server may terminate if no longer needed
       
    95     Server()->DecrementSessions();
       
    96     }
       
    97 
       
    98 // -----------------------------------------------------------------------------------------
       
    99 
       
   100 CEapServer* CEapSession::Server() const
       
   101     /**
       
   102        Return the EAP-server.
       
   103 
       
   104        This deliberately hides the ugly casts around the code.
       
   105     */
       
   106     {
       
   107 	EAP_TRACE_DEBUG(
       
   108 		iTools,
       
   109 		TRACE_FLAGS_DEFAULT,
       
   110 		(EAPL("CEapSession::Server(): this=0x%08x\n"),
       
   111 		this));
       
   112 	EAP_TRACE_RETURN_STRING(iTools, "returns: CEapSession::Server()");
       
   113 
       
   114     return const_cast<CEapServer*>(static_cast<const CEapServer*>(CSession2::Server()));
       
   115     }
       
   116 
       
   117 // -----------------------------------------------------------------------------------------
       
   118 
       
   119 void CEapSession::CheckCapabilityL(
       
   120 	const RMessage2& aMessage,
       
   121 	const TBool aMustHaveCapabilityWhenTrue,
       
   122 	const TCapability aCapability,
       
   123 	const char *aDiagnostic)
       
   124 {
       
   125 	EAP_TRACE_DEBUG(
       
   126 		iTools,
       
   127 		TRACE_FLAGS_DEFAULT,
       
   128 		(EAPL("CEapSession::CheckCapabilityL(): this=0x%08x: aMessage.Function()=%d=%s\n"),
       
   129 		this,
       
   130 		aMessage.Function(),
       
   131 		EapServerStrings::GetEapRequestsString(aMessage.Function())));
       
   132 
       
   133 	EAP_TRACE_RETURN_STRING(iTools, "returns: CEapSession::CheckCapabilityL()");
       
   134 
       
   135 	if (aMustHaveCapabilityWhenTrue != aMessage.HasCapability(aCapability, aDiagnostic))
       
   136 	{
       
   137 		// Capability check failed.
       
   138 		EAP_TRACE_DEBUG(
       
   139 			iTools,
       
   140 			TRACE_FLAGS_DEFAULT,
       
   141 			(EAPL("ERROR: CEapSession::CheckCapability(): aMessage.Function()=%d=%s, failed capability check: %d=%s, %s\n"),
       
   142 			aMessage.Function(),
       
   143 			EapServerStrings::GetEapRequestsString(aMessage.Function()),
       
   144 			aCapability,
       
   145 			CapabilityNames[aCapability],
       
   146 			aDiagnostic));
       
   147 		Server()->PanicClient(EBadRequest);
       
   148 		User::Leave(EBadRequest);
       
   149 	}
       
   150 	else
       
   151 	{
       
   152 		EAP_TRACE_DEBUG(
       
   153 			iTools,
       
   154 			TRACE_FLAGS_DEFAULT,
       
   155 			(EAPL("CEapSession::CheckCapability(): aMessage.Function()=%d=%s, OK capability check: %d=%s\n"),
       
   156 			aMessage.Function(),
       
   157 			EapServerStrings::GetEapRequestsString(aMessage.Function()),
       
   158 			aCapability,
       
   159 			CapabilityNames[aCapability]));
       
   160 	}
       
   161 }
       
   162 
       
   163 // -----------------------------------------------------------------------------------------
       
   164 
       
   165 // service dispatcher - from CSharableSession
       
   166 
       
   167 void CEapSession::ServiceL(const RMessage2& aMessage)
       
   168     {
       
   169 
       
   170 	EAP_TRACE_DEBUG(
       
   171 		iTools,
       
   172 		TRACE_FLAGS_DEFAULT,
       
   173 		(EAPL("-start--------------------------------------------------------------------\n")));
       
   174 
       
   175 	EAP_TRACE_DEBUG(
       
   176 		iTools,
       
   177 		TRACE_FLAGS_DEFAULT,
       
   178 		(EAPL("CEapSession::ServiceL(): this=0x%08x: starts, aMessage.Function()=%d=%s\n"),
       
   179 		this,
       
   180 		aMessage.Function(),
       
   181 		EapServerStrings::GetEapRequestsString(aMessage.Function())));
       
   182 
       
   183 	EAP_TRACE_RETURN_STRING(iTools, "returns: CEapSession::ServiceL()");
       
   184 
       
   185 
       
   186 	{
       
   187 #if 0
       
   188 		// Add this later.
       
   189 		CheckCapabilityL(
       
   190 			aMessage,
       
   191 			ETrue,
       
   192 			ECapabilityNetworkControl,
       
   193 			"EAP-SERVER: Missing ECapabilityNetworkControl");
       
   194 #endif
       
   195 
       
   196 		CheckCapabilityL(
       
   197 			aMessage,
       
   198 			ETrue,
       
   199 			ECapabilityReadDeviceData,
       
   200 			"EAP-SERVER: Missing ECapabilityReadDeviceData");
       
   201 
       
   202 		CheckCapabilityL(
       
   203 			aMessage,
       
   204 			ETrue,
       
   205 			ECapabilityWriteDeviceData,
       
   206 			"EAP-SERVER: Missing ECapabilityWriteDeviceData");
       
   207 	}
       
   208 
       
   209 
       
   210 	if (aMessage.Function() == EEapIfCancelReceive)
       
   211 	{
       
   212 		EAP_TRACE_DEBUG(
       
   213 			iTools,
       
   214 			TRACE_FLAGS_DEFAULT,
       
   215 			(EAPL("CEapSession::ServiceL(): aMessage.Function()=%d=%s, calls CancelReceive()\n"),
       
   216 			aMessage.Function(),
       
   217 			EapServerStrings::GetEapRequestsString(aMessage.Function())));
       
   218         CancelReceive();
       
   219 		return;
       
   220 	}
       
   221 
       
   222 	// length of passed descriptor (1st parameter passed from client)
       
   223 	TInt deslen = aMessage.GetDesLength(0);
       
   224 
       
   225 	if (deslen > KMaxMessageLength)
       
   226 	{
       
   227 		Server()->PanicClient(EBadRequest);
       
   228 		return;
       
   229 	}
       
   230 
       
   231 	// Passed data will be saved in this descriptor.
       
   232 	RBuf8 buffer;
       
   233 
       
   234 	// Max length set to the value of "deslen", but current length is zero
       
   235 	buffer.CreateL(deslen);
       
   236 
       
   237 	// Do the right cleanup if anything subsequently goes wrong
       
   238 	buffer.CleanupClosePushL();
       
   239 
       
   240 	// Copy the client's descriptor data into our buffer.
       
   241 	aMessage.ReadL(0,buffer,0);
       
   242 
       
   243 	EAP_TRACE_DEBUG(
       
   244 		iTools,
       
   245 		TRACE_FLAGS_DEFAULT,
       
   246 		(EAPL("CEapSession::ServiceL(): calls buffer.Length()\n")));
       
   247 
       
   248 	TUint aLength = buffer.Length();
       
   249 
       
   250 	EAP_TRACE_DEBUG(
       
   251 		iTools,
       
   252 		TRACE_FLAGS_DEFAULT,
       
   253 		(EAPL("CEapSession::ServiceL(): calls buffer.Ptr(): aLength=%d\n"),
       
   254 		aLength));
       
   255 
       
   256 	const void * aData = buffer.Ptr();
       
   257 
       
   258 	EAP_TRACE_DEBUG(
       
   259 		iTools,
       
   260 		TRACE_FLAGS_DEFAULT,
       
   261 		(EAPL("CEapSession::ServiceL(): aData=0x%08x, aLength=%d\n"),
       
   262 		aData,
       
   263 		aLength));
       
   264 
       
   265 	EAP_TRACE_DATA_DEBUG(
       
   266 		iTools,
       
   267 		EAP_TRACE_FLAGS_NEVER,
       
   268 		(EAPL("CEapSession::ServiceL()"),
       
   269 		aData,
       
   270 		aLength));
       
   271 
       
   272 	EAP_TRACE_DEBUG(
       
   273 		iTools,
       
   274 		TRACE_FLAGS_DEFAULT,
       
   275 		(EAPL("CEapSession::ServiceL(): switch aMessage.Function()=%d=%s, iEapProcessHandler=0x%08x\n"),
       
   276 		aMessage.Function(),
       
   277 		EapServerStrings::GetEapRequestsString(aMessage.Function()),
       
   278 		iEapProcessHandler));
       
   279 
       
   280 
       
   281     switch (aMessage.Function())
       
   282         {
       
   283     case EEapCoreIfNew:
       
   284 		EAP_TRACE_DEBUG(
       
   285 			iTools,
       
   286 			TRACE_FLAGS_DEFAULT,
       
   287 			(EAPL("CEapSession::ServiceL(): EEapCoreIfNew\n")));
       
   288         ReceiveAll();
       
   289         iEapProcessHandler->SaveMessage(EEapCoreIfNew, aData, aLength);
       
   290         aMessage.Complete(KErrNone);
       
   291         break;
       
   292     case EEapPluginNew:
       
   293 		EAP_TRACE_DEBUG(
       
   294 			iTools,
       
   295 			TRACE_FLAGS_DEFAULT,
       
   296 			(EAPL("CEapSession::ServiceL(): EEapPluginNew\n")));
       
   297         iEapProcessHandler->SaveMessage(EEapPluginNew, aData, aLength);
       
   298         aMessage.Complete(KErrNone);
       
   299         break;
       
   300     case EEapSettingsNew:
       
   301 		EAP_TRACE_DEBUG(
       
   302 			iTools,
       
   303 			TRACE_FLAGS_DEFAULT,
       
   304 			(EAPL("CEapSession::ServiceL(): EEapSettingsNew\n")));
       
   305         iEapProcessHandler->SaveMessage(EEapSettingsNew, aData, aLength);
       
   306         aMessage.Complete(KErrNone);
       
   307         break;
       
   308     case EEapPacStoreNew:
       
   309         EAP_TRACE_DEBUG(
       
   310             iTools,
       
   311             TRACE_FLAGS_DEFAULT,
       
   312             (EAPL("CEapSession::ServiceL(): EEapPacStoreNew\n")));
       
   313         iEapProcessHandler->SaveMessage(EEapPacStoreNew, aData, aLength);
       
   314         aMessage.Complete(KErrNone);
       
   315         break;
       
   316     case EWapiCoreIfNew:
       
   317         EAP_TRACE_DEBUG(
       
   318             iTools,
       
   319             TRACE_FLAGS_DEFAULT,
       
   320             (EAPL("CEapSession::ServiceL(): EWapiCoreIfNew\n")));
       
   321         ReceiveAll();
       
   322         iEapProcessHandler->SaveMessage(EWapiCoreIfNew, aData, aLength);
       
   323         aMessage.Complete(KErrNone);
       
   324         break;
       
   325     case EWapiSettingsNew:
       
   326         EAP_TRACE_DEBUG(
       
   327             iTools,
       
   328             TRACE_FLAGS_DEFAULT,
       
   329             (EAPL("CEapSession::ServiceL(): EWapiSettingsNew\n")));
       
   330         ReceiveAll();
       
   331         iEapProcessHandler->SaveMessage(EWapiSettingsNew, aData, aLength);
       
   332         aMessage.Complete(KErrNone);
       
   333         break;
       
   334     case EEapCoreProcessData:
       
   335 		EAP_TRACE_DEBUG(
       
   336 			iTools,
       
   337 			TRACE_FLAGS_DEFAULT,
       
   338 			(EAPL("CEapSession::ServiceL(): EEapCoreProcessData\n")));
       
   339         // Read message
       
   340         iEapProcessHandler->SaveMessage(EEapCoreProcessData, aData, aLength);
       
   341         aMessage.Complete(KErrNone);
       
   342         break;
       
   343     case EEapPluginProcessData:
       
   344 		EAP_TRACE_DEBUG(
       
   345 			iTools,
       
   346 			TRACE_FLAGS_DEFAULT,
       
   347 			(EAPL("CEapSession::ServiceL(): EEapPluginProcessData\n")));
       
   348         iEapProcessHandler->SaveMessage(EEapPluginProcessData, aData, aLength);
       
   349         aMessage.Complete(KErrNone);
       
   350         break;
       
   351     case EEapSettingsProcessData:
       
   352 		EAP_TRACE_DEBUG(
       
   353 			iTools,
       
   354 			TRACE_FLAGS_DEFAULT,
       
   355 			(EAPL("CEapSession::ServiceL(): EEapSettingsProcessData\n")));
       
   356         iEapProcessHandler->SaveMessage(EEapSettingsProcessData, aData, aLength);
       
   357         aMessage.Complete(KErrNone);
       
   358         break;
       
   359     case EEapPacStoreProcessData:
       
   360 		EAP_TRACE_DEBUG(
       
   361 			iTools,
       
   362 			TRACE_FLAGS_DEFAULT,
       
   363 			(EAPL("CEapSession::ServiceL(): EEapPacStoreProcessData\n")));
       
   364         iEapProcessHandler->SaveMessage(EEapPacStoreProcessData, aData, aLength);
       
   365         aMessage.Complete(KErrNone);
       
   366         break;
       
   367     case EWapiCoreProcessData:
       
   368         EAP_TRACE_DEBUG(
       
   369             iTools,
       
   370             TRACE_FLAGS_DEFAULT,
       
   371             (EAPL("CEapSession::ServiceL(): EWapiCoreProcessData\n")));
       
   372         iEapProcessHandler->SaveMessage(EWapiCoreProcessData, aData, aLength);
       
   373         aMessage.Complete(KErrNone);
       
   374         break;
       
   375     case EWapiSettingsProcessData:
       
   376         EAP_TRACE_DEBUG(
       
   377             iTools,
       
   378             TRACE_FLAGS_DEFAULT,
       
   379             (EAPL("CEapSession::ServiceL(): EWapiSettingsProcessData\n")));
       
   380         iEapProcessHandler->SaveMessage(EWapiSettingsProcessData, aData, aLength);
       
   381         aMessage.Complete(KErrNone);
       
   382         break;
       
   383     case EEapIfReqReceive: // TAny& aBuffer - async
       
   384 		EAP_TRACE_DEBUG(
       
   385 			iTools,
       
   386 			TRACE_FLAGS_DEFAULT,
       
   387 			(EAPL("CEapSession::ServiceL(): EEapIfReqReceive\n")));
       
   388         __ASSERT_DEBUG(!iReceiveActive, Server()->PanicClient(EReceiveReceiveAlreadyActive));
       
   389         // remember receive request
       
   390         iReceiveMessage = aMessage;
       
   391         iReceiveActive=ETrue;
       
   392 		iEapProcessHandler->Activate();
       
   393         break;
       
   394     case EEapIfCancelReceive:
       
   395 		EAP_TRACE_DEBUG(
       
   396 			iTools,
       
   397 			TRACE_FLAGS_DEFAULT,
       
   398 			(EAPL("CEapSession::ServiceL(): EEapIfCancelReceive\n")));
       
   399         CancelReceive();
       
   400         break;
       
   401     default:
       
   402 		EAP_TRACE_DEBUG(
       
   403 			iTools,
       
   404 			TRACE_FLAGS_DEFAULT,
       
   405 			(EAPL("ERROR: CEapSession::ServiceL(): unknown aMessage.Function()=%d=%s, calls Server()->PanicClient()\n"),
       
   406 			aMessage.Function(),
       
   407 			EapServerStrings::GetEapRequestsString(aMessage.Function())));
       
   408 
       
   409 		Server()->PanicClient(EBadRequest);
       
   410         };
       
   411 
       
   412 	CleanupStack::PopAndDestroy(&buffer);
       
   413 
       
   414 	EAP_TRACE_DEBUG(
       
   415 		iTools,
       
   416 		TRACE_FLAGS_DEFAULT,
       
   417 		(EAPL("CEapSession::ServiceL(): ends aMessage.Function()=%d=%s\n"),
       
   418 		aMessage.Function(),
       
   419 		EapServerStrings::GetEapRequestsString(aMessage.Function())));
       
   420 
       
   421 	EAP_TRACE_DEBUG(
       
   422 		iTools,
       
   423 		TRACE_FLAGS_DEFAULT,
       
   424 		(EAPL("-end----------------------------------------------------------------------\n")));
       
   425     }
       
   426 
       
   427 // -----------------------------------------------------------------------------------------
       
   428 
       
   429 void CEapSession::ReceiveAll()
       
   430     {
       
   431 	EAP_TRACE_DEBUG(
       
   432 		iTools,
       
   433 		TRACE_FLAGS_DEFAULT,
       
   434 		(EAPL("CEapSession::ReceiveAll(): this=0x%08x\n"),
       
   435 		this));
       
   436 	EAP_TRACE_RETURN_STRING(iTools, "returns: CEapSession::ReceiveAll()");
       
   437 
       
   438     }
       
   439 
       
   440 // -----------------------------------------------------------------------------------------
       
   441 
       
   442 void CEapSession::Receive(RMessage2& aBuffer)
       
   443     {
       
   444 	EAP_TRACE_DEBUG(
       
   445 		iTools,
       
   446 		TRACE_FLAGS_DEFAULT,
       
   447 		(EAPL("CEapSession::Receive(): this=0x%08x\n"),
       
   448 		this));
       
   449 	EAP_TRACE_RETURN_STRING(iTools, "returns: CEapSession::Receive()");
       
   450 
       
   451     __ASSERT_DEBUG(!iReceiveActive,Server()->PanicClient(EReceiveReceiveAlreadyActive));
       
   452 
       
   453     // remember receive request
       
   454     iReceiveMessage = aBuffer;
       
   455     iReceiveActive=ETrue;
       
   456     }
       
   457 
       
   458 // -----------------------------------------------------------------------------------------
       
   459 
       
   460 void CEapSession::CancelReceive()
       
   461     {
       
   462 	EAP_TRACE_DEBUG(
       
   463 		iTools,
       
   464 		TRACE_FLAGS_DEFAULT,
       
   465 		(EAPL("CEapSession::CancelReceive(): this=0x%08x\n"),
       
   466 		this));
       
   467 	EAP_TRACE_RETURN_STRING(iTools, "returns: CEapSession::CancelReceive()");
       
   468 
       
   469     if (!iReceiveActive)
       
   470 	{
       
   471 		EAP_TRACE_DEBUG(
       
   472 			iTools,
       
   473 			TRACE_FLAGS_DEFAULT,
       
   474 			(EAPL("CEapSession::CancelReceive(): No receive active\n")));
       
   475         return;
       
   476 	}
       
   477 
       
   478     iReceiveMessage.Complete(KErrCancel);
       
   479     iReceiveActive=EFalse;
       
   480     }
       
   481 
       
   482 // -----------------------------------------------------------------------------------------
       
   483 
       
   484 TBool CEapSession::GetReceiveActive()
       
   485 {
       
   486 	EAP_TRACE_DEBUG(
       
   487 		iTools,
       
   488 		TRACE_FLAGS_DEFAULT,
       
   489 		(EAPL("CEapSession::GetReceiveActive(): this=0x%08x: iReceiveActive=%d\n"),
       
   490 		this,
       
   491 		iReceiveActive));
       
   492 	EAP_TRACE_RETURN_STRING(iTools, "returns: CEapSession::GetReceiveActive()");
       
   493 
       
   494 	return iReceiveActive;
       
   495 }
       
   496 
       
   497 // -----------------------------------------------------------------------------------------
       
   498 
       
   499 eap_status_e CEapSession::SendData(EapMessageBuffer * const message)
       
   500     {
       
   501 	EAP_TRACE_DEBUG(
       
   502 		iTools,
       
   503 		TRACE_FLAGS_DEFAULT,
       
   504 		(EAPL("CEapSession::SendData(): this=0x%08x: message->GetRequestType()=%d=%s, message->GetData()->Length()=%d\n"),
       
   505 		this,
       
   506 		message->GetRequestType(),
       
   507 		EapServerStrings::GetEapRequestsString(message->GetRequestType()),
       
   508 		message->GetData()->Length()));
       
   509 	EAP_TRACE_RETURN_STRING(iTools, "returns: CEapSession::SendData()");
       
   510 
       
   511     if (!iReceiveActive)
       
   512 	{
       
   513 		EAP_TRACE_DEBUG(
       
   514 			iTools,
       
   515 			TRACE_FLAGS_DEFAULT,
       
   516 			(EAPL("CEapSession::SendData(): No receive active\n")));
       
   517         return EAP_STATUS_RETURN(iTools, iTools->convert_am_error_to_eapol_error(KErrCancel));
       
   518 	}
       
   519 
       
   520     TInt error(KErrNone);
       
   521 
       
   522 	EAP_TRACE_DEBUG(
       
   523 		iTools,
       
   524 		TRACE_FLAGS_DEFAULT,
       
   525 		(EAPL("CEapSession::SendData(): calls iReceiveMessage.Write()\n")));
       
   526 
       
   527 	error = iReceiveMessage.Write(0, message->GetData()->Des());
       
   528 
       
   529 	EAP_TRACE_DEBUG(
       
   530 		iTools,
       
   531 		TRACE_FLAGS_DEFAULT,
       
   532 		(EAPL("CEapSession::SendData(): calls iReceiveMessage.Complete(): Write() error=%d\n"),
       
   533 		error));
       
   534 
       
   535     iReceiveMessage.Complete(KErrNone);
       
   536     iReceiveActive=EFalse;
       
   537 
       
   538     return EAP_STATUS_RETURN(iTools, iTools->convert_am_error_to_eapol_error(error));
       
   539     }
       
   540 
       
   541 // -----------------------------------------------------------------------------------------
       
   542 // end