eapol/eapol_framework/eapol_symbian/eap_server/include/EapServer.h
branchRCL_3
changeset 46 c74b3d9f6b9e
parent 45 bad0cc58d154
child 55 9c2aa05919d9
equal deleted inserted replaced
45:bad0cc58d154 46:c74b3d9f6b9e
     1 /*
       
     2 * Copyright (c) 2001-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-server class.
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 12 %
       
    20 */
       
    21 
       
    22 
       
    23 #ifndef EAPAUTHSERVER_H_
       
    24 #define EAPAUTHSERVER_H_
       
    25 
       
    26 #include <e32base.h>
       
    27 #include <e32svr.h>
       
    28 #include <ecom/implementationinformation.h>
       
    29 #include <ecom/ecom.h>
       
    30 #include "EapServerClientDef.h"
       
    31 #include "EapScheduler.h"
       
    32 #include "EapSession.h"
       
    33 #include "abs_eap_am_tools.h"
       
    34 #include "EapClientIf.h"
       
    35 #include "EapServerBackup.h"
       
    36 
       
    37 class CEapDelayedShutdown;
       
    38 
       
    39 class CEapServer
       
    40 : public CServer2
       
    41 , public EapClientIf
       
    42 , public AbsEapserverBackup
       
    43     {
       
    44 
       
    45 public:
       
    46 
       
    47     // construct
       
    48     CEapServer();
       
    49     void ConstructL();
       
    50     static CEapServer* NewL();
       
    51     virtual ~CEapServer();
       
    52     // from CServer2
       
    53     CSession2* NewSessionL(const TVersion& aVersion, const RMessage2 &aMessage ) const;
       
    54     // session counting
       
    55     void IncrementSessions();
       
    56     void DecrementSessions();
       
    57     // utility
       
    58     void PanicClient(TInt aPanic) const;
       
    59 
       
    60 	void StopL();
       
    61 
       
    62 	void BackupOrRestoreCompleteL();
       
    63 
       
    64 	void BackupOrRestoreStartingL();
       
    65 
       
    66 private:
       
    67 
       
    68     TInt RunError(TInt aErr);
       
    69     CEapDelayedShutdown* iShutdown;
       
    70 	CEapserverBackup * iBackupRestore;
       
    71 
       
    72     TInt iSessionCount;
       
    73     abs_eap_am_tools_c * iTools;
       
    74     TBool iIsValid;
       
    75     };
       
    76 
       
    77 
       
    78 // Handles timer that stops EAP-server after some idle time.
       
    79 class CEapDelayedShutdown : public CActive
       
    80     {
       
    81 public:
       
    82     CEapDelayedShutdown(abs_eap_am_tools_c * const tools, CEapServer * const aServer);
       
    83     void ConstructL();
       
    84     virtual ~CEapDelayedShutdown();
       
    85     void Start();
       
    86 private:
       
    87     void DoCancel();
       
    88     void RunL();
       
    89 	TInt RunError(TInt aError);
       
    90 
       
    91 private:
       
    92 	abs_eap_am_tools_c * const iTools;
       
    93     RTimer iTimer;
       
    94 	CEapServer * const iServer;
       
    95     };
       
    96 
       
    97 
       
    98 #endif /* EAPAUTHSERVER_H_ */