382 break; |
382 break; |
383 case EEapIfReqReceive: // TAny& aBuffer - async |
383 case EEapIfReqReceive: // TAny& aBuffer - async |
384 EAP_TRACE_DEBUG( |
384 EAP_TRACE_DEBUG( |
385 iTools, |
385 iTools, |
386 TRACE_FLAGS_DEFAULT, |
386 TRACE_FLAGS_DEFAULT, |
387 (EAPL("CEapSession::ServiceL(): EEapIfReqReceive\n"))); |
387 (EAPL("CEapSession::ServiceL(): EEapIfReqReceive, iReceiveMessage=0x%08x\n"), |
|
388 &iReceiveMessage)); |
|
389 |
388 __ASSERT_DEBUG(!iReceiveActive, Server()->PanicClient(EReceiveReceiveAlreadyActive)); |
390 __ASSERT_DEBUG(!iReceiveActive, Server()->PanicClient(EReceiveReceiveAlreadyActive)); |
|
391 |
389 // remember receive request |
392 // remember receive request |
390 iReceiveMessage = aMessage; |
393 iReceiveMessage = aMessage; |
391 iReceiveActive=ETrue; |
394 iReceiveActive=ETrue; |
392 iEapProcessHandler->Activate(); |
395 |
|
396 iEapProcessHandler->Activate(EapServerProcessHandlerState_Send); |
|
397 |
393 break; |
398 break; |
394 case EEapIfCancelReceive: |
399 case EEapIfCancelReceive: |
395 EAP_TRACE_DEBUG( |
400 EAP_TRACE_DEBUG( |
396 iTools, |
401 iTools, |
397 TRACE_FLAGS_DEFAULT, |
402 TRACE_FLAGS_DEFAULT, |
442 void CEapSession::Receive(RMessage2& aBuffer) |
447 void CEapSession::Receive(RMessage2& aBuffer) |
443 { |
448 { |
444 EAP_TRACE_DEBUG( |
449 EAP_TRACE_DEBUG( |
445 iTools, |
450 iTools, |
446 TRACE_FLAGS_DEFAULT, |
451 TRACE_FLAGS_DEFAULT, |
447 (EAPL("CEapSession::Receive(): this=0x%08x\n"), |
452 (EAPL("CEapSession::Receive(): this=0x%08x, iReceiveMessage=0x%08x\n"), |
448 this)); |
453 this, |
|
454 &iReceiveMessage)); |
449 EAP_TRACE_RETURN_STRING(iTools, "returns: CEapSession::Receive()"); |
455 EAP_TRACE_RETURN_STRING(iTools, "returns: CEapSession::Receive()"); |
450 |
456 |
451 __ASSERT_DEBUG(!iReceiveActive,Server()->PanicClient(EReceiveReceiveAlreadyActive)); |
457 __ASSERT_DEBUG(!iReceiveActive,Server()->PanicClient(EReceiveReceiveAlreadyActive)); |
452 |
458 |
453 // remember receive request |
459 // remember receive request |
495 } |
502 } |
496 |
503 |
497 // ----------------------------------------------------------------------------------------- |
504 // ----------------------------------------------------------------------------------------- |
498 |
505 |
499 eap_status_e CEapSession::SendData(EapMessageBuffer * const message) |
506 eap_status_e CEapSession::SendData(EapMessageBuffer * const message) |
500 { |
507 { |
501 EAP_TRACE_DEBUG( |
508 EAP_TRACE_DEBUG( |
502 iTools, |
509 iTools, |
503 TRACE_FLAGS_DEFAULT, |
510 TRACE_FLAGS_DEFAULT, |
504 (EAPL("CEapSession::SendData(): this=0x%08x: message->GetRequestType()=%d=%s, message->GetData()->Length()=%d\n"), |
511 (EAPL("CEapSession::SendData(): this=0x%08x: message->GetRequestType()=%d=%s, message->GetData()->Length()=%d\n"), |
505 this, |
512 this, |
506 message->GetRequestType(), |
513 message->GetRequestType(), |
507 EapServerStrings::GetEapRequestsString(message->GetRequestType()), |
514 EapServerStrings::GetEapRequestsString(message->GetRequestType()), |
508 message->GetData()->Length())); |
515 message->GetData()->Length())); |
509 EAP_TRACE_RETURN_STRING(iTools, "returns: CEapSession::SendData()"); |
516 EAP_TRACE_RETURN_STRING(iTools, "returns: CEapSession::SendData()"); |
510 |
517 |
511 if (!iReceiveActive) |
518 if (!iReceiveActive) |
512 { |
519 { |
513 EAP_TRACE_DEBUG( |
520 EAP_TRACE_DEBUG( |
514 iTools, |
521 iTools, |
515 TRACE_FLAGS_DEFAULT, |
522 TRACE_FLAGS_DEFAULT, |
516 (EAPL("CEapSession::SendData(): No receive active\n"))); |
523 (EAPL("CEapSession::SendData(): No receive active\n"))); |
517 return EAP_STATUS_RETURN(iTools, iTools->convert_am_error_to_eapol_error(KErrCancel)); |
524 return EAP_STATUS_RETURN(iTools, iTools->convert_am_error_to_eapol_error(KErrCancel)); |
518 } |
525 } |
519 |
526 |
520 TInt error(KErrNone); |
527 TInt error(KErrNone); |
521 |
528 |
522 EAP_TRACE_DEBUG( |
529 EAP_TRACE_DEBUG( |
523 iTools, |
530 iTools, |
524 TRACE_FLAGS_DEFAULT, |
531 TRACE_FLAGS_DEFAULT, |
525 (EAPL("CEapSession::SendData(): calls iReceiveMessage.Write()\n"))); |
532 (EAPL("CEapSession::SendData(): calls iReceiveMessage.Write()\n"))); |
527 error = iReceiveMessage.Write(0, message->GetData()->Des()); |
534 error = iReceiveMessage.Write(0, message->GetData()->Des()); |
528 |
535 |
529 EAP_TRACE_DEBUG( |
536 EAP_TRACE_DEBUG( |
530 iTools, |
537 iTools, |
531 TRACE_FLAGS_DEFAULT, |
538 TRACE_FLAGS_DEFAULT, |
532 (EAPL("CEapSession::SendData(): calls iReceiveMessage.Complete(): Write() error=%d\n"), |
539 (EAPL("CEapSession::SendData(): calls iReceiveMessage.Complete(): Write() error=%d, iReceiveMessage=0x%08x\n"), |
533 error)); |
540 error, |
534 |
541 &iReceiveMessage)); |
535 iReceiveMessage.Complete(KErrNone); |
542 |
536 iReceiveActive=EFalse; |
543 iReceiveMessage.Complete(KErrNone); |
537 |
544 iReceiveActive=EFalse; |
538 return EAP_STATUS_RETURN(iTools, iTools->convert_am_error_to_eapol_error(error)); |
545 |
539 } |
546 return EAP_STATUS_RETURN(iTools, iTools->convert_am_error_to_eapol_error(error)); |
|
547 } |
|
548 |
|
549 // ----------------------------------------------------------------------------------------- |
|
550 |
|
551 TInt CEapSession::AddReadyHandler(CEapServerProcessHandler * const handler) |
|
552 { |
|
553 EAP_TRACE_DEBUG( |
|
554 iTools, |
|
555 TRACE_FLAGS_DEFAULT, |
|
556 (EAPL("CEapSession::AddReadyHandler(): this=0x%08x: handler=0x%08x\n"), |
|
557 this, |
|
558 handler)); |
|
559 EAP_TRACE_RETURN_STRING(iTools, "returns: CEapSession::AddReadyHandler()"); |
|
560 |
|
561 return Server()->AddReadyHandler(handler); |
|
562 } |
|
563 |
|
564 // ----------------------------------------------------------------------------------------- |
|
565 |
|
566 TInt CEapSession::CompleteReadyHandler(CEapServerProcessHandler * const handler) |
|
567 { |
|
568 EAP_TRACE_DEBUG( |
|
569 iTools, |
|
570 TRACE_FLAGS_DEFAULT, |
|
571 (EAPL("CEapSession::CompleteReadyHandler(): this=0x%08x: handler=0x%08x\n"), |
|
572 this, |
|
573 handler)); |
|
574 EAP_TRACE_RETURN_STRING(iTools, "returns: CEapSession::CompleteReadyHandler()"); |
|
575 |
|
576 return Server()->CompleteReadyHandler(handler); |
|
577 } |
|
578 |
|
579 // ----------------------------------------------------------------------------------------- |
|
580 |
|
581 TInt CEapSession::CancelReadyHandler(CEapServerProcessHandler * const handler) |
|
582 { |
|
583 EAP_TRACE_DEBUG( |
|
584 iTools, |
|
585 TRACE_FLAGS_DEFAULT, |
|
586 (EAPL("CEapSession::CancelReadyHandler(): this=0x%08x: handler=0x%08x\n"), |
|
587 this, |
|
588 handler)); |
|
589 EAP_TRACE_RETURN_STRING(iTools, "returns: CEapSession::CancelReadyHandler()"); |
|
590 |
|
591 return Server()->CancelReadyHandler(handler); |
|
592 } |
540 |
593 |
541 // ----------------------------------------------------------------------------------------- |
594 // ----------------------------------------------------------------------------------------- |
542 // end |
595 // end |