35 #include "eap_type_securid.h" |
35 #include "eap_type_securid.h" |
36 #include "EapSecurIDGlobal.h" |
36 #include "EapSecurIDGlobal.h" |
37 #include <EapTypeInfo.h> |
37 #include <EapTypeInfo.h> |
38 #include "EapGtcDbUtils.h" |
38 #include "EapGtcDbUtils.h" |
39 |
39 |
40 |
|
41 #include "eap_am_tools_symbian.h" |
40 #include "eap_am_tools_symbian.h" |
|
41 #include "EapConversion.h" |
|
42 #include "EapTraceSymbian.h" |
42 |
43 |
43 // LOCAL CONSTANTS |
44 // LOCAL CONSTANTS |
44 |
45 |
45 // The version number of this interface. |
46 // The version number of this interface. |
46 const TUint KInterfaceVersion = 1; |
47 const TUint KInterfaceVersion = 1; |
148 return KInterfaceVersion; |
149 return KInterfaceVersion; |
149 } |
150 } |
150 |
151 |
151 // ---------------------------------------------------------- |
152 // ---------------------------------------------------------- |
152 |
153 |
153 TInt CEapSecurID::InvokeUiL() |
154 CEapTypeInfo* CEapSecurID::GetInfoL() |
154 { |
|
155 TInt buttonId(0); |
|
156 return buttonId; |
|
157 } |
|
158 |
|
159 // ---------------------------------------------------------- |
|
160 |
|
161 CEapTypeInfo* CEapSecurID::GetInfoLC() |
|
162 { |
155 { |
163 CEapTypeInfo* info = new(ELeave) CEapTypeInfo( |
156 CEapTypeInfo* info = new(ELeave) CEapTypeInfo( |
164 (TDesC&) KReleaseDate, |
157 (TDesC&) KReleaseDate, |
165 (TDesC&) KEapTypeVersion, |
158 (TDesC&) KEapTypeVersion, |
166 (TDesC&) KManufacturer); |
159 (TDesC&) KManufacturer); |
167 CleanupStack::PushL(info); |
160 |
168 return info; |
161 return info; |
169 } |
162 } |
170 |
163 |
171 // ---------------------------------------------------------- |
164 // ---------------------------------------------------------- |
172 |
165 |
175 EapGtcDbUtils::DeleteConfigurationL(iIndexType, iIndex, iTunnelingType); |
168 EapGtcDbUtils::DeleteConfigurationL(iIndexType, iIndex, iTunnelingType); |
176 } |
169 } |
177 |
170 |
178 // ---------------------------------------------------------- |
171 // ---------------------------------------------------------- |
179 |
172 |
180 void CEapSecurID::SetTunnelingType(const TInt aTunnelingType) |
173 void CEapSecurID::SetTunnelingType(const TEapExpandedType aTunnelingType) |
181 { |
174 { |
182 #ifdef USE_EAP_EXPANDED_TYPES |
175 EAP_TRACE_DATA_DEBUG_SYMBIAN( |
183 |
176 (EAPL("CEapSecurID::SetTunnelingType - tunneling type"), |
184 // Vendor id is eap_type_vendor_id_ietf always in this plugin. |
177 aTunnelingType.GetValue().Ptr(), aTunnelingType.GetValue().Length())); |
185 iTunnelingType.set_eap_type_values(eap_type_vendor_id_ietf, aTunnelingType); |
178 |
186 |
179 eap_type_value_e aInternalType; |
187 #else |
180 |
188 |
181 TInt err = CEapConversion::ConvertExpandedEAPTypeToInternalType( |
189 iTunnelingType = static_cast<eap_type_value_e>(aTunnelingType); |
182 &aTunnelingType, |
190 |
183 &aInternalType); |
191 #endif //#ifdef USE_EAP_EXPANDED_TYPES |
184 |
192 } |
185 iTunnelingType = aInternalType; |
|
186 } |
193 |
187 |
194 // ---------------------------------------------------------- |
188 // ---------------------------------------------------------- |
195 void CEapSecurID::SetIndexL( |
189 void CEapSecurID::SetIndexL( |
196 const TIndexType aIndexType, |
190 const TIndexType aIndexType, |
197 const TInt aIndex) |
191 const TInt aIndex) |
211 iIndexType = tmpIndexType; |
205 iIndexType = tmpIndexType; |
212 iIndex = tmpIndex; |
206 iIndex = tmpIndex; |
213 |
207 |
214 RDbNamedDatabase db; |
208 RDbNamedDatabase db; |
215 |
209 |
216 RDbs session; |
210 RFs session; |
217 |
211 |
218 EapGtcDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); |
212 EapGtcDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); |
219 |
213 |
220 CleanupClosePushL(session); |
214 CleanupClosePushL(session); |
221 CleanupClosePushL(db); |
215 CleanupClosePushL(db); |
230 iTunnelingType); |
224 iTunnelingType); |
231 |
225 |
232 iIndexType = aIndexType; |
226 iIndexType = aIndexType; |
233 iIndex = aIndex; |
227 iIndex = aIndex; |
234 |
228 |
235 CleanupStack::PopAndDestroy(2); // db |
229 CleanupStack::PopAndDestroy(&db); |
236 |
230 CleanupStack::PopAndDestroy(&session); |
237 |
|
238 } |
231 } |
239 |
232 |
240 void CEapSecurID::SetConfigurationL(const EAPSettings& aSettings) |
233 void CEapSecurID::SetConfigurationL(const EAPSettings& aSettings) |
241 { |
234 { |
242 RDbNamedDatabase db; |
235 RDbNamedDatabase db; |
243 |
236 |
244 RDbs session; |
237 RFs session; |
245 |
238 |
246 // This also creates the IAP entry if it doesn't exist |
239 // This also creates the IAP entry if it doesn't exist |
247 EapGtcDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); |
240 EapGtcDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); |
248 |
241 |
249 CleanupClosePushL(session); |
242 CleanupClosePushL(session); |
253 db, |
246 db, |
254 aSettings, |
247 aSettings, |
255 iIndexType, |
248 iIndexType, |
256 iIndex, |
249 iIndex, |
257 iTunnelingType); |
250 iTunnelingType); |
258 |
251 |
259 CleanupStack::PopAndDestroy(2); // db, session |
252 CleanupStack::PopAndDestroy(&db); |
|
253 CleanupStack::PopAndDestroy(&session); |
260 } |
254 } |
261 |
255 |
262 void CEapSecurID::GetConfigurationL(EAPSettings& aSettings) |
256 void CEapSecurID::GetConfigurationL(EAPSettings& aSettings) |
263 { |
257 { |
264 RDbNamedDatabase db; |
258 RDbNamedDatabase db; |
265 |
259 |
266 RDbs session; |
260 RFs session; |
267 |
261 |
268 // This also creates the IAP entry if it doesn't exist |
262 // This also creates the IAP entry if it doesn't exist |
269 EapGtcDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); |
263 EapGtcDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); |
270 |
264 |
271 CleanupClosePushL(session); |
265 CleanupClosePushL(session); |
275 db, |
269 db, |
276 aSettings, |
270 aSettings, |
277 iIndexType, |
271 iIndexType, |
278 iIndex, |
272 iIndex, |
279 iTunnelingType); |
273 iTunnelingType); |
280 |
274 |
281 CleanupStack::PopAndDestroy(2); // db, session |
275 CleanupStack::PopAndDestroy(&db); |
|
276 CleanupStack::PopAndDestroy(&session); |
282 } |
277 } |
283 |
278 |
284 void CEapSecurID::CopySettingsL( |
279 void CEapSecurID::CopySettingsL( |
285 const TIndexType aDestinationIndexType, |
280 const TIndexType aDestinationIndexType, |
286 const TInt aDestinationIndex) |
281 const TInt aDestinationIndex) |
300 iIndexType = tmpIndexType; |
295 iIndexType = tmpIndexType; |
301 iIndex = tmpIndex; |
296 iIndex = tmpIndex; |
302 |
297 |
303 RDbNamedDatabase db; |
298 RDbNamedDatabase db; |
304 |
299 |
305 RDbs session; |
300 RFs session; |
306 |
301 |
307 EapGtcDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); |
302 EapGtcDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); |
308 |
303 |
309 CleanupClosePushL(session); |
304 CleanupClosePushL(session); |
310 CleanupClosePushL(db); |
305 CleanupClosePushL(db); |