26
|
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 |
/*
|
49
|
19 |
* %version: 14 %
|
26
|
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"
|
49
|
36 |
#include "EapServerProcessHandler.h"
|
26
|
37 |
|
|
38 |
class CEapDelayedShutdown;
|
|
39 |
|
|
40 |
class CEapServer
|
|
41 |
: public CServer2
|
|
42 |
, public EapClientIf
|
|
43 |
, public AbsEapserverBackup
|
|
44 |
{
|
|
45 |
|
|
46 |
public:
|
|
47 |
|
|
48 |
// construct
|
|
49 |
CEapServer();
|
|
50 |
void ConstructL();
|
|
51 |
static CEapServer* NewL();
|
|
52 |
virtual ~CEapServer();
|
|
53 |
// from CServer2
|
|
54 |
CSession2* NewSessionL(const TVersion& aVersion, const RMessage2 &aMessage ) const;
|
|
55 |
// session counting
|
|
56 |
void IncrementSessions();
|
|
57 |
void DecrementSessions();
|
|
58 |
// utility
|
|
59 |
void PanicClient(TInt aPanic) const;
|
|
60 |
|
|
61 |
void StopL();
|
|
62 |
|
|
63 |
void BackupOrRestoreCompleteL();
|
|
64 |
|
|
65 |
void BackupOrRestoreStartingL();
|
|
66 |
|
49
|
67 |
TInt AddReadyHandler(CEapServerProcessHandler * const handler);
|
|
68 |
|
|
69 |
TInt CompleteReadyHandler(CEapServerProcessHandler * const handler);
|
|
70 |
|
|
71 |
TInt CancelReadyHandler(CEapServerProcessHandler * const handler);
|
|
72 |
|
26
|
73 |
private:
|
|
74 |
|
|
75 |
TInt RunError(TInt aErr);
|
|
76 |
CEapDelayedShutdown* iShutdown;
|
|
77 |
CEapserverBackup * iBackupRestore;
|
|
78 |
|
49
|
79 |
RArray<CEapServerProcessHandler *> iReadyHandlers;
|
|
80 |
|
26
|
81 |
TInt iSessionCount;
|
|
82 |
abs_eap_am_tools_c * iTools;
|
|
83 |
TBool iIsValid;
|
|
84 |
};
|
|
85 |
|
|
86 |
|
|
87 |
// Handles timer that stops EAP-server after some idle time.
|
|
88 |
class CEapDelayedShutdown : public CActive
|
|
89 |
{
|
|
90 |
public:
|
|
91 |
CEapDelayedShutdown(abs_eap_am_tools_c * const tools, CEapServer * const aServer);
|
|
92 |
void ConstructL();
|
|
93 |
virtual ~CEapDelayedShutdown();
|
|
94 |
void Start();
|
|
95 |
private:
|
|
96 |
void DoCancel();
|
|
97 |
void RunL();
|
|
98 |
TInt RunError(TInt aError);
|
|
99 |
|
|
100 |
private:
|
|
101 |
abs_eap_am_tools_c * const iTools;
|
|
102 |
RTimer iTimer;
|
|
103 |
CEapServer * const iServer;
|
|
104 |
};
|
|
105 |
|
|
106 |
|
|
107 |
#endif /* EAPAUTHSERVER_H_ */
|