|
1 /* |
|
2 * Copyright (c) 2008 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 "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: Handler of an IKE protocol plugin |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_IKEPLUGINHANDLER_H |
|
20 #define C_IKEPLUGINHANDLER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include "ikepluginsessionhandler.h" |
|
24 #include "ikesocketdefs.h" |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CIkePluginSessionHandler; |
|
28 class MIkeDebug; |
|
29 class MIkePluginIf; |
|
30 class MKmdEventLoggerIf; |
|
31 |
|
32 /** |
|
33 * IKE plugin handler. |
|
34 * IKE plugin specific handler for creating and deleting IKE plugin sessions. |
|
35 * |
|
36 * @lib internal (kmdserver.exe) |
|
37 */ |
|
38 class CIkePluginHandler : public CBase |
|
39 { |
|
40 public: |
|
41 /** |
|
42 * Two-phased constructor. |
|
43 * @param aIkeVersion IKE version |
|
44 * @param aEventLogger Event logger |
|
45 * @param aDebug Debug trace interface |
|
46 */ |
|
47 static CIkePluginHandler* NewL( TInt aIkeVersion, |
|
48 MKmdEventLoggerIf& aEventLogger, |
|
49 MIkeDebug& aDebug ); |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 ~CIkePluginHandler(); |
|
55 |
|
56 /** |
|
57 * Creates IKE plugin session. |
|
58 * @param aVpnIapId VPN IAP id |
|
59 * @param aVpnNetId VPN NET id |
|
60 * @param aVpnInterfaceIndex VPN interface index |
|
61 * @param aIpVersion IP version |
|
62 * @param aDnsServer DNS server from IKE policy |
|
63 * @param aConnection IKE connection interface |
|
64 * @param aCallback Callback interface |
|
65 * @return Handler of IKE plugin session |
|
66 */ |
|
67 CIkePluginSessionHandler& CreateIkePluginSessionL( TUint32 aVpnIapId, |
|
68 TUint32 aVpnNetId, |
|
69 TUint32 aVpnInterfaceIndex, |
|
70 IkeSocket::TIpVersion aIpVersion, |
|
71 const TInetAddr& aDnsServer, |
|
72 CIkeConnectionInterface& aConnection, |
|
73 MIkePluginSessionHandlerCallback& aCallback ); |
|
74 |
|
75 /** |
|
76 * Deletes IKE plugin session which matches VPN IAP id. Does nothing if |
|
77 * session is not found. |
|
78 * @param aVpnIapId VPN IAP Id |
|
79 */ |
|
80 void DeleteIkePluginSession( TUint32 aVpnIapId ); |
|
81 |
|
82 private: |
|
83 CIkePluginHandler( TInt aIkeVersion, |
|
84 MKmdEventLoggerIf& aEventLogger, |
|
85 MIkeDebug& aDebug ); |
|
86 |
|
87 /** |
|
88 * Creates IKE plugin session. |
|
89 * @param aVpnIapId VPN IAP id |
|
90 * @param aVpnNetId VPN NET id |
|
91 * @param aVpnInterfaceIndex VPN interface index |
|
92 * @param aIpVersion IP version |
|
93 * @param aDnsServerAddr DNS server address from IKE policy |
|
94 * @param aConnection IKE connection interface |
|
95 * @param aCallback Callback interface |
|
96 */ |
|
97 CIkePluginSessionHandler& DoCreateIkePluginSessionL( TUint32 aVpnIapId, |
|
98 TUint32 aVpnNetId, |
|
99 TUint32 aVpnInterfaceIndex, |
|
100 IkeSocket::TIpVersion aIpVersion, |
|
101 const TInetAddr& aDnsServerAddr, |
|
102 CIkeConnectionInterface& aConnection, |
|
103 MIkePluginSessionHandlerCallback& aCallback ); |
|
104 |
|
105 /** |
|
106 * Loads IKE plugin. |
|
107 */ |
|
108 void LoadIkePluginL(); |
|
109 |
|
110 /** |
|
111 * Unloads IKE plugin. |
|
112 */ |
|
113 void UnloadIkePlugin(); |
|
114 |
|
115 private: // data |
|
116 |
|
117 /** |
|
118 * IKE version. |
|
119 * Own. |
|
120 */ |
|
121 TInt iIkeVersion; |
|
122 |
|
123 /** |
|
124 * Handle for IKE plugin library. |
|
125 * Own. |
|
126 */ |
|
127 RLibrary iLibrary; |
|
128 |
|
129 /** |
|
130 * IKE plugin. |
|
131 * Own. |
|
132 */ |
|
133 MIkePluginIf* iIkePlugin; |
|
134 |
|
135 /** |
|
136 * IKE plugin session handlers. |
|
137 * Own. |
|
138 */ |
|
139 RPointerArray<CIkePluginSessionHandler> iIkePluginSessions; |
|
140 |
|
141 /** |
|
142 * Event logger. |
|
143 * Not own. |
|
144 */ |
|
145 MKmdEventLoggerIf& iEventLogger; |
|
146 |
|
147 /** |
|
148 * Debug trace interface. |
|
149 * Not own. |
|
150 */ |
|
151 MIkeDebug& iDebug; |
|
152 }; |
|
153 |
|
154 |
|
155 #endif // C_IKEPLUGINHANDLER_H |