|
1 /* |
|
2 * Copyright (c) 2001-2006 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 and WLAN authentication protocols. |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 57 % |
|
20 */ |
|
21 |
|
22 // This is enumeration of EAPOL source code. |
|
23 #if defined(USE_EAP_MINIMUM_RELEASE_TRACES) |
|
24 #undef EAP_FILE_NUMBER_ENUM |
|
25 #define EAP_FILE_NUMBER_ENUM 739 |
|
26 #undef EAP_FILE_NUMBER_DATE |
|
27 #define EAP_FILE_NUMBER_DATE 1127594498 |
|
28 #endif //#if defined(USE_EAP_MINIMUM_RELEASE_TRACES) |
|
29 |
|
30 |
|
31 // INCLUDE FILES |
|
32 |
|
33 #include "EapGeneric.h" |
|
34 #include "EapConversion.h" |
|
35 #include "eap_base_type.h" |
|
36 #include "eap_method_settings.h" |
|
37 #include "eap_am_assert.h" |
|
38 #include <EapTypeInfo.h> |
|
39 #include "abs_eap_am_tools.h" |
|
40 #include "eap_automatic_variable.h" |
|
41 #include <utf.h> // for CnvUtfConverter |
|
42 #include "abs_eap_plugin_message.h" |
|
43 #include "eap_plugin_message_base.h" |
|
44 #include "abs_eap_am_message_if.h" |
|
45 #include "eap_am_message_if.h" |
|
46 #include "eap_automatic_variable.h" |
|
47 #include "eap_plugin_client_message_if.h" |
|
48 #include "eap_am_message_if_symbian.h" |
|
49 #include "EapTraceSymbian.h" |
|
50 |
|
51 // LOCAL CONSTANTS |
|
52 |
|
53 // The version number of this interface. |
|
54 const TUint KInterfaceVersion = 1; |
|
55 |
|
56 |
|
57 // ================= MEMBER FUNCTIONS ======================= |
|
58 |
|
59 |
|
60 CEapGeneric::CEapGeneric( |
|
61 const TIndexType aIndexType, |
|
62 const TInt aIndex, |
|
63 const TEapExpandedType aEapType) |
|
64 : m_am_tools(abs_eap_am_tools_c::new_abs_eap_am_tools_c()) |
|
65 , m_server(eap_plugin_message_base_c::new_eap_plugin_client_message_if_c( |
|
66 m_am_tools, |
|
67 this)) |
|
68 , iIndexType(aIndexType) |
|
69 , iIndex(aIndex) |
|
70 , iEapType(aEapType) |
|
71 , iTunnelingType(eap_type_none) |
|
72 , iTunnelingTypePresent(false) |
|
73 , iWaitState(eap_generic_wait_state_none) |
|
74 , iCompletionStatus(eap_status_process_general_error) |
|
75 |
|
76 , ipEAPSettings(0) |
|
77 { |
|
78 EAP_TRACE_DEBUG( |
|
79 m_am_tools, |
|
80 TRACE_FLAGS_DEFAULT, |
|
81 (EAPL("CEapGeneric::CEapGeneric(): this=0x%08x, aIndexType=%d, aIndex=%d.\n"), |
|
82 this, |
|
83 aIndexType, |
|
84 aIndex)); |
|
85 |
|
86 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::CEapGeneric()"); |
|
87 } |
|
88 |
|
89 // ---------------------------------------------------------- |
|
90 |
|
91 void CEapGeneric::ConstructL() |
|
92 { |
|
93 EAP_TRACE_DEBUG( |
|
94 m_am_tools, |
|
95 TRACE_FLAGS_DEFAULT, |
|
96 (EAPL("CEapGeneric::ConstructL(): this=0x%08x.\n"), |
|
97 this)); |
|
98 |
|
99 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::ConstructL()"); |
|
100 |
|
101 if (m_am_tools == 0 |
|
102 || m_am_tools->get_is_valid() == false |
|
103 || m_server == 0 |
|
104 || m_server->get_is_valid() == false) |
|
105 { |
|
106 abs_eap_am_tools_c::delete_abs_eap_am_tools_c(m_am_tools); |
|
107 delete m_server; |
|
108 |
|
109 User::Leave(KErrNoMemory); |
|
110 } |
|
111 |
|
112 eap_status_e status = m_server->configure(); |
|
113 if (status != eap_status_ok) |
|
114 { |
|
115 abs_eap_am_tools_c::delete_abs_eap_am_tools_c(m_am_tools); |
|
116 delete m_server; |
|
117 |
|
118 User::Leave(KErrNoMemory); |
|
119 } |
|
120 } |
|
121 |
|
122 // ---------------------------------------------------------- |
|
123 |
|
124 CEapGeneric* CEapGeneric::NewL(SIapInfo *aIapInfo) |
|
125 { |
|
126 CEapGeneric* self = new(ELeave) CEapGeneric(aIapInfo->indexType, aIapInfo->index, aIapInfo->aEapType); |
|
127 |
|
128 CleanupStack::PushL(self); |
|
129 |
|
130 self->ConstructL(); |
|
131 |
|
132 CleanupStack::Pop(); |
|
133 |
|
134 return self; |
|
135 } |
|
136 |
|
137 // ---------------------------------------------------------- |
|
138 |
|
139 CEapGeneric::~CEapGeneric() |
|
140 { |
|
141 EAP_TRACE_DEBUG( |
|
142 m_am_tools, |
|
143 TRACE_FLAGS_DEFAULT, |
|
144 (EAPL("CEapGeneric::~CEapGeneric(): this=0x%08x.\n"), |
|
145 this)); |
|
146 |
|
147 // Do not use m_am_tools, because it will be destroyed before return. |
|
148 EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: CEapGeneric::~CEapGeneric()")); |
|
149 |
|
150 if (m_server != 0) |
|
151 { |
|
152 m_server->shutdown(); |
|
153 } |
|
154 delete m_server; |
|
155 |
|
156 abs_eap_am_tools_c::delete_abs_eap_am_tools_c(m_am_tools); |
|
157 } |
|
158 |
|
159 // ---------------------------------------------------------- |
|
160 |
|
161 #ifdef USE_EAP_SIMPLE_CONFIG |
|
162 |
|
163 eap_base_type_c* CEapGeneric::GetStackInterfaceL(abs_eap_am_tools_c* const aTools, |
|
164 abs_eap_base_type_c* const /* aPartner */, |
|
165 const bool /* is_client_when_true */, |
|
166 const eap_am_network_id_c * const /* receive_network_id */, |
|
167 abs_eap_configuration_if_c * const /*configuration_if*/) |
|
168 |
|
169 #else |
|
170 |
|
171 eap_base_type_c* CEapGeneric::GetStackInterfaceL(abs_eap_am_tools_c* const aTools, |
|
172 abs_eap_base_type_c* const /* aPartner */, |
|
173 const bool /* is_client_when_true */, |
|
174 const eap_am_network_id_c * const /* receive_network_id */) |
|
175 |
|
176 #endif // #ifdef USE_EAP_SIMPLE_CONFIG |
|
177 { |
|
178 EAP_UNREFERENCED_PARAMETER(aTools); |
|
179 // This class does not have stack interface. |
|
180 EAP_TRACE_DEBUG( |
|
181 m_am_tools, |
|
182 TRACE_FLAGS_DEFAULT, |
|
183 (EAPL("ERROR: CEapGeneric::GetStackInterfaceL(): this=0x%08x\n"), |
|
184 this)); |
|
185 |
|
186 EAP_ASSERT_ANYWAY_TOOLS(aTools); |
|
187 |
|
188 return 0; |
|
189 } |
|
190 |
|
191 //---------------------------------------------------------------- |
|
192 |
|
193 void CEapGeneric::Activate() |
|
194 { |
|
195 EAP_TRACE_DEBUG( |
|
196 m_am_tools, |
|
197 TRACE_FLAGS_DEFAULT, |
|
198 (EAPL("CEapGeneric::Activate(): iAsyncronousStatus=%u\n"), |
|
199 iAsyncronousStatus.Int())); |
|
200 |
|
201 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::Activate()"); |
|
202 |
|
203 iAsyncronousStatus = KRequestPending; |
|
204 } |
|
205 |
|
206 //---------------------------------------------------------------- |
|
207 |
|
208 void CEapGeneric::Complete() |
|
209 { |
|
210 EAP_TRACE_DEBUG( |
|
211 m_am_tools, |
|
212 TRACE_FLAGS_DEFAULT, |
|
213 (EAPL("CEapGeneric::Complete(): iAsyncronousStatus=%u\n"), |
|
214 iAsyncronousStatus.Int())); |
|
215 |
|
216 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::Complete()"); |
|
217 |
|
218 iAsyncronousStatus = KErrNone; |
|
219 |
|
220 // This is needed to continue the execution after Wait.Start(); |
|
221 iWait.AsyncStop(); |
|
222 } |
|
223 |
|
224 //---------------------------------------------------------------- |
|
225 |
|
226 void CEapGeneric::WaitCompletion() |
|
227 { |
|
228 EAP_TRACE_DEBUG( |
|
229 m_am_tools, |
|
230 TRACE_FLAGS_DEFAULT, |
|
231 (EAPL("CEapGeneric::WaitCompletion(): iAsyncronousStatus=%u\n"), |
|
232 iAsyncronousStatus.Int())); |
|
233 |
|
234 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::WaitCompletion()"); |
|
235 |
|
236 while (iAsyncronousStatus == KRequestPending) |
|
237 { |
|
238 EAP_TRACE_DEBUG( |
|
239 m_am_tools, |
|
240 TRACE_FLAGS_DEFAULT, |
|
241 (EAPL("CEapGeneric::WaitCompletion(): calls iWait.Start()\n"))); |
|
242 |
|
243 iWait.Start(); |
|
244 |
|
245 EAP_TRACE_DEBUG( |
|
246 m_am_tools, |
|
247 TRACE_FLAGS_DEFAULT, |
|
248 (EAPL("CEapGeneric::WaitCompletion(): iWait.Start() continue, iAsyncronousStatus=%u\n"), |
|
249 iAsyncronousStatus.Int())); |
|
250 } |
|
251 } |
|
252 |
|
253 // ---------------------------------------------------------- |
|
254 |
|
255 void CEapGeneric::SetCompletionStatusIfStillOk(const eap_status_e status) |
|
256 { |
|
257 EAP_TRACE_DEBUG( |
|
258 m_am_tools, |
|
259 TRACE_FLAGS_DEFAULT, |
|
260 (EAPL("CEapGeneric::SetCompletionStatusIfStillOk(): iCompletionStatus=%u=%s, status=%d=%s\n"), |
|
261 iCompletionStatus, |
|
262 eap_status_string_c::get_status_string(iCompletionStatus), |
|
263 status, |
|
264 eap_status_string_c::get_status_string(status))); |
|
265 |
|
266 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::SetCompletionStatusIfStillOk()"); |
|
267 |
|
268 if (iCompletionStatus == eap_status_ok) |
|
269 { |
|
270 iCompletionStatus = status; |
|
271 } |
|
272 } |
|
273 |
|
274 // ---------------------------------------------------------- |
|
275 |
|
276 |
|
277 |
|
278 // ---------------------------------------------------------- |
|
279 |
|
280 CEapTypeInfo* CEapGeneric::GetInfoL() |
|
281 { |
|
282 EAP_TRACE_DEBUG( |
|
283 m_am_tools, |
|
284 TRACE_FLAGS_DEFAULT, |
|
285 (EAPL("CEapGeneric::GetInfoL(): this=0x%08x\n"), |
|
286 this)); |
|
287 |
|
288 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::GetInfoL()"); |
|
289 |
|
290 eap_method_settings_c * const internal_settings = new eap_method_settings_c(m_am_tools); |
|
291 if (internal_settings == 0) |
|
292 { |
|
293 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
294 EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error))); |
|
295 } |
|
296 |
|
297 iCompletionStatus = eap_status_process_general_error; |
|
298 |
|
299 eap_status_e status = m_server->get_type_info(internal_settings); |
|
300 |
|
301 delete internal_settings; |
|
302 |
|
303 if (status != eap_status_ok) |
|
304 { |
|
305 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
306 EAP_STATUS_RETURN(m_am_tools, status))); |
|
307 } |
|
308 |
|
309 iWaitState = eap_generic_wait_state_complete_get_type_info; |
|
310 Activate(); |
|
311 WaitCompletion(); |
|
312 |
|
313 if (iCompletionStatus != eap_status_ok) |
|
314 { |
|
315 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
316 EAP_STATUS_RETURN(m_am_tools, iCompletionStatus))); |
|
317 } |
|
318 |
|
319 CEapTypeInfo* info = new(ELeave) CEapTypeInfo( |
|
320 iReleaseDate, |
|
321 iEapTypeVersion, |
|
322 iManufacturer); |
|
323 |
|
324 return info; |
|
325 } |
|
326 |
|
327 // ---------------------------------------------------------- |
|
328 |
|
329 void CEapGeneric::DeleteConfigurationL() |
|
330 { |
|
331 EAP_TRACE_DEBUG( |
|
332 m_am_tools, |
|
333 TRACE_FLAGS_DEFAULT, |
|
334 (EAPL("CEapGeneric::DeleteConfigurationL(): this=0x%08x\n"), |
|
335 this)); |
|
336 |
|
337 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::DeleteConfigurationL()"); |
|
338 |
|
339 eap_method_settings_c * const internal_settings = new eap_method_settings_c(m_am_tools); |
|
340 if (internal_settings == 0) |
|
341 { |
|
342 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
343 EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error))); |
|
344 } |
|
345 |
|
346 internal_settings->m_IndexType = iIndexType; |
|
347 internal_settings->m_Index = iIndex; |
|
348 |
|
349 TInt error = CEapConversion::ConvertExpandedEAPTypeToInternalType( |
|
350 &iEapType, |
|
351 &(internal_settings->m_EAPType)); |
|
352 if (error != KErrNone) |
|
353 { |
|
354 delete internal_settings; |
|
355 |
|
356 (void)EAP_STATUS_RETURN(m_am_tools, m_am_tools->convert_am_error_to_eapol_error(error)); |
|
357 User::Leave(error); |
|
358 } |
|
359 iCompletionStatus = eap_status_process_general_error; |
|
360 |
|
361 eap_status_e status = m_server->delete_configuration(internal_settings); |
|
362 |
|
363 delete internal_settings; |
|
364 |
|
365 if (status != eap_status_ok) |
|
366 { |
|
367 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
368 EAP_STATUS_RETURN(m_am_tools, status))); |
|
369 } |
|
370 |
|
371 iWaitState = eap_generic_wait_state_complete_delete_configuration; |
|
372 Activate(); |
|
373 WaitCompletion(); |
|
374 |
|
375 if (iCompletionStatus != eap_status_ok) |
|
376 { |
|
377 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
378 EAP_STATUS_RETURN(m_am_tools, iCompletionStatus))); |
|
379 } |
|
380 } |
|
381 |
|
382 // ---------------------------------------------------------- |
|
383 |
|
384 TUint CEapGeneric::GetInterfaceVersion() |
|
385 { |
|
386 EAP_TRACE_DEBUG( |
|
387 m_am_tools, |
|
388 TRACE_FLAGS_DEFAULT, |
|
389 (EAPL("CEapGeneric::GetInterfaceVersion(): this=0x%08x\n"), |
|
390 this)); |
|
391 |
|
392 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::GetInterfaceVersion()"); |
|
393 |
|
394 return KInterfaceVersion; |
|
395 } |
|
396 |
|
397 // ---------------------------------------------------------- |
|
398 |
|
399 void CEapGeneric::SetTunnelingType(const TEapExpandedType aTunnelingType) |
|
400 { |
|
401 EAP_TRACE_DEBUG( |
|
402 m_am_tools, |
|
403 TRACE_FLAGS_DEFAULT, |
|
404 (EAPL("CEapGeneric::SetTunnelingType(): this=0x%08x\n"), |
|
405 this)); |
|
406 |
|
407 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::SetTunnelingType()"); |
|
408 |
|
409 EAP_TRACE_DATA_DEBUG_SYMBIAN( |
|
410 (EAPL("CEapGeneric::SetTunnelingType - tunneling type"), |
|
411 aTunnelingType.GetValue().Ptr(), aTunnelingType.GetValue().Length())); |
|
412 |
|
413 iTunnelingTypePresent = true; |
|
414 |
|
415 eap_type_value_e aInternalType; |
|
416 |
|
417 TInt error = CEapConversion::ConvertExpandedEAPTypeToInternalType( |
|
418 &aTunnelingType, |
|
419 &aInternalType); |
|
420 if (error != KErrNone) |
|
421 { |
|
422 (void)EAP_STATUS_RETURN(m_am_tools, m_am_tools->convert_am_error_to_eapol_error(error)); |
|
423 } |
|
424 |
|
425 iTunnelingType = aInternalType; |
|
426 |
|
427 } |
|
428 |
|
429 |
|
430 // ---------------------------------------------------------- |
|
431 |
|
432 void CEapGeneric::SetIndexL( |
|
433 const TIndexType aIndexType, |
|
434 const TInt aIndex ) |
|
435 { |
|
436 EAP_TRACE_DEBUG( |
|
437 m_am_tools, |
|
438 TRACE_FLAGS_DEFAULT, |
|
439 (EAPL("CEapGeneric::SetIndexL(): this=0x%08x\n"), |
|
440 this)); |
|
441 |
|
442 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::SetIndexL()"); |
|
443 |
|
444 eap_method_settings_c * const internal_settings = new eap_method_settings_c(m_am_tools); |
|
445 if (internal_settings == 0) |
|
446 { |
|
447 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
448 EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error))); |
|
449 } |
|
450 |
|
451 internal_settings->m_IndexType = aIndexType; |
|
452 internal_settings->m_Index = aIndex; |
|
453 |
|
454 TInt error = CEapConversion::ConvertExpandedEAPTypeToInternalType( |
|
455 &iEapType, |
|
456 &(internal_settings->m_EAPType)); |
|
457 if (error != KErrNone) |
|
458 { |
|
459 delete internal_settings; |
|
460 |
|
461 (void)EAP_STATUS_RETURN(m_am_tools, m_am_tools->convert_am_error_to_eapol_error(error)); |
|
462 User::Leave(error); |
|
463 } |
|
464 |
|
465 iCompletionStatus = eap_status_process_general_error; |
|
466 |
|
467 eap_status_e status = m_server->delete_configuration(internal_settings); |
|
468 |
|
469 if (status != eap_status_ok) |
|
470 { |
|
471 delete internal_settings; |
|
472 |
|
473 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
474 EAP_STATUS_RETURN(m_am_tools, status))); |
|
475 } |
|
476 |
|
477 iWaitState = eap_generic_wait_state_complete_delete_configuration; |
|
478 Activate(); |
|
479 WaitCompletion(); |
|
480 |
|
481 if (iCompletionStatus != eap_status_ok) |
|
482 { |
|
483 delete internal_settings; |
|
484 |
|
485 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
486 EAP_STATUS_RETURN(m_am_tools, iCompletionStatus))); |
|
487 } |
|
488 |
|
489 internal_settings->m_IndexType = iIndexType; |
|
490 internal_settings->m_Index = iIndex; |
|
491 |
|
492 error = CEapConversion::ConvertExpandedEAPTypeToInternalType( |
|
493 &iEapType, |
|
494 &(internal_settings->m_EAPType)); |
|
495 if (error != KErrNone) |
|
496 { |
|
497 delete internal_settings; |
|
498 |
|
499 (void)EAP_STATUS_RETURN(m_am_tools, m_am_tools->convert_am_error_to_eapol_error(error)); |
|
500 User::Leave(error); |
|
501 } |
|
502 |
|
503 internal_settings->m_TunnelingTypePresent = iTunnelingTypePresent; |
|
504 internal_settings->m_TunnelingType = iTunnelingType; |
|
505 |
|
506 internal_settings->m_DestinationIndexAndTypePresent = true; |
|
507 internal_settings->m_DestinationIndexType = aIndexType; |
|
508 internal_settings->m_DestinationIndex = aIndex; |
|
509 |
|
510 iCompletionStatus = eap_status_process_general_error; |
|
511 |
|
512 status = m_server->set_index(internal_settings); |
|
513 |
|
514 delete internal_settings; |
|
515 |
|
516 if (status != eap_status_ok) |
|
517 { |
|
518 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
519 EAP_STATUS_RETURN(m_am_tools, status))); |
|
520 } |
|
521 |
|
522 iWaitState = eap_generic_wait_state_complete_set_index; |
|
523 Activate(); |
|
524 WaitCompletion(); |
|
525 |
|
526 if (iCompletionStatus != eap_status_ok) |
|
527 { |
|
528 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
529 EAP_STATUS_RETURN(m_am_tools, iCompletionStatus))); |
|
530 } |
|
531 |
|
532 } |
|
533 |
|
534 // ---------------------------------------------------------- |
|
535 |
|
536 void CEapGeneric::SetConfigurationL(const EAPSettings& aSettings) |
|
537 { |
|
538 EAP_TRACE_DEBUG( |
|
539 m_am_tools, |
|
540 TRACE_FLAGS_DEFAULT, |
|
541 (EAPL("CEapGeneric::SetConfigurationL(): this=0x%08x\n"), |
|
542 this)); |
|
543 |
|
544 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::SetConfigurationL()"); |
|
545 |
|
546 eap_method_settings_c * const internal_settings = new eap_method_settings_c(m_am_tools); |
|
547 if (internal_settings == 0) |
|
548 { |
|
549 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
550 EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error))); |
|
551 } |
|
552 |
|
553 eap_status_e status(eap_status_process_general_error); |
|
554 |
|
555 TInt error(KErrNone); |
|
556 |
|
557 internal_settings->m_IndexType = iIndexType; |
|
558 internal_settings->m_Index = iIndex; |
|
559 |
|
560 internal_settings->m_TunnelingTypePresent = iTunnelingTypePresent; |
|
561 internal_settings->m_TunnelingType = iTunnelingType; |
|
562 |
|
563 error = CEapConversion::ConvertEAPSettingsToInternalType( |
|
564 m_am_tools, |
|
565 &aSettings, |
|
566 internal_settings); |
|
567 if(error == KErrNone) |
|
568 { |
|
569 TInt error = CEapConversion::ConvertExpandedEAPTypeToInternalType( |
|
570 &iEapType, |
|
571 &(internal_settings->m_EAPType)); |
|
572 if (error != KErrNone) |
|
573 { |
|
574 delete internal_settings; |
|
575 |
|
576 (void)EAP_STATUS_RETURN(m_am_tools, m_am_tools->convert_am_error_to_eapol_error(error)); |
|
577 User::Leave(error); |
|
578 } |
|
579 |
|
580 iCompletionStatus = eap_status_process_general_error; |
|
581 |
|
582 status = m_server->set_configuration(internal_settings); |
|
583 } |
|
584 else |
|
585 { |
|
586 status = m_am_tools->convert_am_error_to_eapol_error(error); |
|
587 } |
|
588 |
|
589 delete internal_settings; |
|
590 |
|
591 if (status != eap_status_ok) |
|
592 { |
|
593 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
594 EAP_STATUS_RETURN(m_am_tools, status))); |
|
595 } |
|
596 |
|
597 iWaitState = eap_generic_wait_state_complete_set_configuration; |
|
598 Activate(); |
|
599 WaitCompletion(); |
|
600 |
|
601 if (iCompletionStatus != eap_status_ok) |
|
602 { |
|
603 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
604 EAP_STATUS_RETURN(m_am_tools, iCompletionStatus))); |
|
605 } |
|
606 } |
|
607 |
|
608 // ---------------------------------------------------------- |
|
609 |
|
610 void CEapGeneric::GetConfigurationL(EAPSettings& aSettings) |
|
611 { |
|
612 EAP_TRACE_DEBUG( |
|
613 m_am_tools, |
|
614 TRACE_FLAGS_DEFAULT, |
|
615 (EAPL("CEapGeneric::GetConfigurationL(): this=0x%08x\n"), |
|
616 this)); |
|
617 |
|
618 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::GetConfigurationL()"); |
|
619 |
|
620 eap_method_settings_c * const internal_settings = new eap_method_settings_c(m_am_tools); |
|
621 if (internal_settings == 0) |
|
622 { |
|
623 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
624 EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error))); |
|
625 } |
|
626 |
|
627 internal_settings->m_IndexType = iIndexType; |
|
628 internal_settings->m_Index = iIndex; |
|
629 |
|
630 TInt error = CEapConversion::ConvertExpandedEAPTypeToInternalType( |
|
631 &iEapType, |
|
632 &(internal_settings->m_EAPType)); |
|
633 if (error != KErrNone) |
|
634 { |
|
635 delete internal_settings; |
|
636 |
|
637 (void)EAP_STATUS_RETURN(m_am_tools, m_am_tools->convert_am_error_to_eapol_error(error)); |
|
638 User::Leave(error); |
|
639 } |
|
640 |
|
641 internal_settings->m_TunnelingTypePresent = iTunnelingTypePresent; |
|
642 internal_settings->m_TunnelingType = iTunnelingType; |
|
643 |
|
644 ipEAPSettings = &aSettings; |
|
645 |
|
646 iCompletionStatus = eap_status_process_general_error; |
|
647 |
|
648 eap_status_e status = m_server->get_configuration(internal_settings); |
|
649 |
|
650 delete internal_settings; |
|
651 |
|
652 if (status != eap_status_ok) |
|
653 { |
|
654 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
655 EAP_STATUS_RETURN(m_am_tools, status))); |
|
656 } |
|
657 |
|
658 iWaitState = eap_generic_wait_state_complete_get_configuration; |
|
659 Activate(); |
|
660 WaitCompletion(); |
|
661 |
|
662 if (iCompletionStatus != eap_status_ok) |
|
663 { |
|
664 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
665 EAP_STATUS_RETURN(m_am_tools, iCompletionStatus))); |
|
666 } |
|
667 } |
|
668 |
|
669 // ---------------------------------------------------------- |
|
670 |
|
671 void CEapGeneric::CopySettingsL( |
|
672 const TIndexType aDestinationIndexType, |
|
673 const TInt aDestinationIndex) |
|
674 { |
|
675 EAP_TRACE_DEBUG( |
|
676 m_am_tools, |
|
677 TRACE_FLAGS_DEFAULT, |
|
678 (EAPL("CEapGeneric::CopySettingsL(): this=0x%08x\n"), |
|
679 this)); |
|
680 |
|
681 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::CopySettingsL()"); |
|
682 |
|
683 eap_method_settings_c * const internal_settings = new eap_method_settings_c(m_am_tools); |
|
684 if (internal_settings == 0) |
|
685 { |
|
686 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
687 EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error))); |
|
688 } |
|
689 |
|
690 internal_settings->m_IndexType = aDestinationIndexType; |
|
691 internal_settings->m_Index = aDestinationIndex; |
|
692 |
|
693 iCompletionStatus = eap_status_process_general_error; |
|
694 |
|
695 eap_status_e status = m_server->delete_configuration(internal_settings); |
|
696 |
|
697 if (status != eap_status_ok) |
|
698 { |
|
699 delete internal_settings; |
|
700 |
|
701 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
702 EAP_STATUS_RETURN(m_am_tools, status))); |
|
703 } |
|
704 |
|
705 iWaitState = eap_generic_wait_state_complete_delete_configuration; |
|
706 Activate(); |
|
707 WaitCompletion(); |
|
708 |
|
709 if (iCompletionStatus != eap_status_ok) |
|
710 { |
|
711 delete internal_settings; |
|
712 |
|
713 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
714 EAP_STATUS_RETURN(m_am_tools, iCompletionStatus))); |
|
715 } |
|
716 |
|
717 internal_settings->m_IndexType = iIndexType; |
|
718 internal_settings->m_Index = iIndex; |
|
719 |
|
720 TInt error = CEapConversion::ConvertExpandedEAPTypeToInternalType( |
|
721 &iEapType, |
|
722 &(internal_settings->m_EAPType)); |
|
723 if (error != KErrNone) |
|
724 { |
|
725 delete internal_settings; |
|
726 |
|
727 (void)EAP_STATUS_RETURN(m_am_tools, m_am_tools->convert_am_error_to_eapol_error(error)); |
|
728 User::Leave(error); |
|
729 } |
|
730 |
|
731 internal_settings->m_TunnelingTypePresent = iTunnelingTypePresent; |
|
732 internal_settings->m_TunnelingType = iTunnelingType; |
|
733 |
|
734 internal_settings->m_DestinationIndexAndTypePresent = true; |
|
735 internal_settings->m_DestinationIndexType = aDestinationIndexType; |
|
736 internal_settings->m_DestinationIndex = aDestinationIndex; |
|
737 |
|
738 iCompletionStatus = eap_status_process_general_error; |
|
739 |
|
740 status = m_server->copy_configuration(internal_settings); |
|
741 |
|
742 delete internal_settings; |
|
743 |
|
744 if (status != eap_status_ok) |
|
745 { |
|
746 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
747 EAP_STATUS_RETURN(m_am_tools, status))); |
|
748 } |
|
749 |
|
750 iWaitState = eap_generic_wait_state_complete_copy_configuration; |
|
751 Activate(); |
|
752 WaitCompletion(); |
|
753 |
|
754 if (iCompletionStatus != eap_status_ok) |
|
755 { |
|
756 User::Leave(m_am_tools->convert_eapol_error_to_am_error( |
|
757 EAP_STATUS_RETURN(m_am_tools, iCompletionStatus))); |
|
758 } |
|
759 } |
|
760 |
|
761 // ---------------------------------------------------------- |
|
762 |
|
763 eap_status_e CEapGeneric::complete_get_configuration( |
|
764 const eap_method_settings_c * const internal_settings) |
|
765 { |
|
766 EAP_TRACE_DEBUG( |
|
767 m_am_tools, |
|
768 TRACE_FLAGS_DEFAULT, |
|
769 (EAPL("CEapGeneric::complete_get_configuration(): this=0x%08x, iWaitState=%d, status=%d=%s\n"), |
|
770 this, |
|
771 iWaitState, |
|
772 internal_settings->m_completion_status, |
|
773 eap_status_string_c::get_status_string(internal_settings->m_completion_status))); |
|
774 |
|
775 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::complete_get_configuration()"); |
|
776 |
|
777 if (internal_settings == 0) |
|
778 { |
|
779 iCompletionStatus = eap_status_illegal_parameter; |
|
780 |
|
781 Complete(); |
|
782 |
|
783 return EAP_STATUS_RETURN(m_am_tools, iCompletionStatus); |
|
784 } |
|
785 |
|
786 iCompletionStatus = internal_settings->m_completion_status; |
|
787 |
|
788 if (iWaitState == eap_generic_wait_state_complete_get_configuration |
|
789 && iCompletionStatus == eap_status_ok) |
|
790 { |
|
791 if (ipEAPSettings != 0 |
|
792 && internal_settings != 0) |
|
793 { |
|
794 TInt error(KErrNone); |
|
795 |
|
796 error = CEapConversion::ConvertInternalTypeToEAPSettings( |
|
797 m_am_tools, |
|
798 internal_settings, |
|
799 ipEAPSettings); |
|
800 if(error != KErrNone) |
|
801 { |
|
802 SetCompletionStatusIfStillOk(EAP_STATUS_RETURN(m_am_tools, m_am_tools->convert_am_error_to_eapol_error(error))); |
|
803 } |
|
804 } |
|
805 else |
|
806 { |
|
807 SetCompletionStatusIfStillOk(EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter)); |
|
808 } |
|
809 } |
|
810 else if (iCompletionStatus == eap_status_ok) |
|
811 { |
|
812 // ERROR wrong state. |
|
813 SetCompletionStatusIfStillOk(EAP_STATUS_RETURN(m_am_tools, eap_status_wrong_eap_type_state)); |
|
814 } |
|
815 |
|
816 Complete(); |
|
817 |
|
818 return EAP_STATUS_RETURN(m_am_tools, iCompletionStatus); |
|
819 } |
|
820 |
|
821 // ---------------------------------------------------------- |
|
822 |
|
823 eap_status_e CEapGeneric::complete_set_configuration( |
|
824 const eap_status_e completion_status) |
|
825 { |
|
826 EAP_TRACE_DEBUG( |
|
827 m_am_tools, |
|
828 TRACE_FLAGS_DEFAULT, |
|
829 (EAPL("CEapGeneric::complete_set_configuration(): this=0x%08x, iWaitState=%d, status=%d=%s\n"), |
|
830 this, |
|
831 iWaitState, |
|
832 completion_status, |
|
833 eap_status_string_c::get_status_string(completion_status))); |
|
834 |
|
835 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::complete_set_configuration()"); |
|
836 |
|
837 iCompletionStatus = completion_status; |
|
838 |
|
839 if (iWaitState != eap_generic_wait_state_complete_set_configuration |
|
840 && iCompletionStatus == eap_status_ok) |
|
841 { |
|
842 // ERROR wrong state. |
|
843 SetCompletionStatusIfStillOk(EAP_STATUS_RETURN(m_am_tools, eap_status_wrong_eap_type_state)); |
|
844 } |
|
845 |
|
846 Complete(); |
|
847 |
|
848 return EAP_STATUS_RETURN(m_am_tools, completion_status); |
|
849 } |
|
850 |
|
851 // ---------------------------------------------------------- |
|
852 |
|
853 eap_status_e CEapGeneric::complete_delete_configuration( |
|
854 const eap_status_e completion_status) |
|
855 { |
|
856 EAP_TRACE_DEBUG( |
|
857 m_am_tools, |
|
858 TRACE_FLAGS_DEFAULT, |
|
859 (EAPL("CEapGeneric::complete_delete_configuration(): this=0x%08x, iWaitState=%d, status=%d=%s\n"), |
|
860 this, |
|
861 iWaitState, |
|
862 completion_status, |
|
863 eap_status_string_c::get_status_string(completion_status))); |
|
864 |
|
865 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::complete_delete_configuration()"); |
|
866 |
|
867 iCompletionStatus = completion_status; |
|
868 |
|
869 if (iWaitState != eap_generic_wait_state_complete_delete_configuration |
|
870 && iCompletionStatus == eap_status_ok) |
|
871 { |
|
872 // ERROR wrong state. |
|
873 SetCompletionStatusIfStillOk(EAP_STATUS_RETURN(m_am_tools, eap_status_wrong_eap_type_state)); |
|
874 } |
|
875 |
|
876 Complete(); |
|
877 |
|
878 return EAP_STATUS_RETURN(m_am_tools, completion_status); |
|
879 } |
|
880 |
|
881 // ---------------------------------------------------------- |
|
882 |
|
883 eap_status_e CEapGeneric::complete_copy_configuration( |
|
884 const eap_status_e completion_status) |
|
885 { |
|
886 EAP_TRACE_DEBUG( |
|
887 m_am_tools, |
|
888 TRACE_FLAGS_DEFAULT, |
|
889 (EAPL("CEapGeneric::complete_copy_configuration(): this=0x%08x, iWaitState=%d, status=%d=%s\n"), |
|
890 this, |
|
891 iWaitState, |
|
892 completion_status, |
|
893 eap_status_string_c::get_status_string(completion_status))); |
|
894 |
|
895 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::complete_copy_configuration()"); |
|
896 |
|
897 iCompletionStatus = completion_status; |
|
898 |
|
899 if (iWaitState != eap_generic_wait_state_complete_copy_configuration |
|
900 && iCompletionStatus == eap_status_ok) |
|
901 { |
|
902 // ERROR wrong state. |
|
903 SetCompletionStatusIfStillOk(EAP_STATUS_RETURN(m_am_tools, eap_status_wrong_eap_type_state)); |
|
904 } |
|
905 |
|
906 Complete(); |
|
907 |
|
908 return EAP_STATUS_RETURN(m_am_tools, completion_status); |
|
909 } |
|
910 |
|
911 // ---------------------------------------------------------- |
|
912 |
|
913 eap_status_e CEapGeneric::complete_set_index( |
|
914 const eap_status_e completion_status) |
|
915 { |
|
916 EAP_TRACE_DEBUG( |
|
917 m_am_tools, |
|
918 TRACE_FLAGS_DEFAULT, |
|
919 (EAPL("CEapGeneric::complete_set_index(): this=0x%08x, iWaitState=%d, status=%d=%s\n"), |
|
920 this, |
|
921 iWaitState, |
|
922 completion_status, |
|
923 eap_status_string_c::get_status_string(completion_status))); |
|
924 |
|
925 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::complete_set_index()"); |
|
926 |
|
927 iCompletionStatus = completion_status; |
|
928 |
|
929 if (iWaitState != eap_generic_wait_state_complete_set_index |
|
930 && iCompletionStatus == eap_status_ok) |
|
931 { |
|
932 // ERROR wrong state. |
|
933 SetCompletionStatusIfStillOk(EAP_STATUS_RETURN(m_am_tools, eap_status_wrong_eap_type_state)); |
|
934 } |
|
935 |
|
936 Complete(); |
|
937 |
|
938 return EAP_STATUS_RETURN(m_am_tools, completion_status); |
|
939 } |
|
940 |
|
941 // ---------------------------------------------------------- |
|
942 |
|
943 eap_status_e CEapGeneric::complete_get_type_info( |
|
944 const eap_method_settings_c * const internal_settings) |
|
945 { |
|
946 EAP_TRACE_DEBUG( |
|
947 m_am_tools, |
|
948 TRACE_FLAGS_DEFAULT, |
|
949 (EAPL("CEapGeneric::complete_get_type_info(): this=0x%08x, iWaitState=%d, status=%d=%s\n"), |
|
950 this, |
|
951 iWaitState, |
|
952 internal_settings->m_completion_status, |
|
953 eap_status_string_c::get_status_string(internal_settings->m_completion_status))); |
|
954 |
|
955 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::complete_get_type_info()"); |
|
956 |
|
957 if (internal_settings == 0) |
|
958 { |
|
959 iCompletionStatus = eap_status_illegal_parameter; |
|
960 |
|
961 Complete(); |
|
962 |
|
963 return EAP_STATUS_RETURN(m_am_tools, iCompletionStatus); |
|
964 } |
|
965 |
|
966 iCompletionStatus = internal_settings->m_completion_status; |
|
967 |
|
968 if (iWaitState == eap_generic_wait_state_complete_get_type_info |
|
969 && iCompletionStatus == eap_status_ok) |
|
970 { |
|
971 if (internal_settings != 0 |
|
972 && internal_settings->m_MethodInfoPresent == true) |
|
973 { |
|
974 TInt error(KErrNone); |
|
975 |
|
976 error = CEapConversion::ConvertFromInternalToBuf16( |
|
977 m_am_tools, |
|
978 &(internal_settings->m_KReleaseDate), |
|
979 &iReleaseDate); |
|
980 |
|
981 if(error == KErrNone) |
|
982 { |
|
983 error = CEapConversion::ConvertFromInternalToBuf16( |
|
984 m_am_tools, |
|
985 &(internal_settings->m_KEapTypeVersion), |
|
986 &iEapTypeVersion); |
|
987 } |
|
988 |
|
989 if(error == KErrNone) |
|
990 { |
|
991 error = CEapConversion::ConvertFromInternalToBuf16( |
|
992 m_am_tools, |
|
993 &(internal_settings->m_KManufacturer), |
|
994 &iManufacturer); |
|
995 } |
|
996 |
|
997 if(error != KErrNone) |
|
998 { |
|
999 SetCompletionStatusIfStillOk(EAP_STATUS_RETURN(m_am_tools, m_am_tools->convert_am_error_to_eapol_error(error))); |
|
1000 } |
|
1001 } |
|
1002 else |
|
1003 { |
|
1004 SetCompletionStatusIfStillOk(EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter)); |
|
1005 } |
|
1006 } |
|
1007 else if (iCompletionStatus == eap_status_ok) |
|
1008 { |
|
1009 // ERROR wrong state. |
|
1010 SetCompletionStatusIfStillOk(EAP_STATUS_RETURN(m_am_tools, eap_status_wrong_eap_type_state)); |
|
1011 } |
|
1012 |
|
1013 Complete(); |
|
1014 |
|
1015 return EAP_STATUS_RETURN(m_am_tools, iCompletionStatus); |
|
1016 } |
|
1017 |
|
1018 // ---------------------------------------------------------- |
|
1019 |
|
1020 eap_status_e CEapGeneric::complete_invoke_ui( |
|
1021 const eap_method_settings_c * const internal_settings) |
|
1022 { |
|
1023 EAP_TRACE_DEBUG( |
|
1024 m_am_tools, |
|
1025 TRACE_FLAGS_DEFAULT, |
|
1026 (EAPL("CEapGeneric::complete_invoke_ui(): this=0x%08x, iWaitState=%d, status=%d=%s\n"), |
|
1027 this, |
|
1028 iWaitState, |
|
1029 internal_settings->m_completion_status, |
|
1030 eap_status_string_c::get_status_string(internal_settings->m_completion_status))); |
|
1031 |
|
1032 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapGeneric::complete_invoke_ui()"); |
|
1033 |
|
1034 if (internal_settings == 0) |
|
1035 { |
|
1036 iCompletionStatus = eap_status_illegal_parameter; |
|
1037 |
|
1038 Complete(); |
|
1039 |
|
1040 return EAP_STATUS_RETURN(m_am_tools, iCompletionStatus); |
|
1041 } |
|
1042 |
|
1043 iCompletionStatus = internal_settings->m_completion_status; |
|
1044 |
|
1045 if (iWaitState == eap_generic_wait_state_complete_invoke_ui |
|
1046 && iCompletionStatus == eap_status_ok) |
|
1047 { |
|
1048 if (internal_settings != 0 |
|
1049 && internal_settings->m_ButtonIdPresent == true) |
|
1050 { |
|
1051 |
|
1052 } |
|
1053 else |
|
1054 { |
|
1055 SetCompletionStatusIfStillOk(EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter)); |
|
1056 } |
|
1057 } |
|
1058 else if (iCompletionStatus == eap_status_ok) |
|
1059 { |
|
1060 // ERROR wrong state. |
|
1061 SetCompletionStatusIfStillOk(EAP_STATUS_RETURN(m_am_tools, eap_status_wrong_eap_type_state)); |
|
1062 } |
|
1063 |
|
1064 Complete(); |
|
1065 |
|
1066 return EAP_STATUS_RETURN(m_am_tools, iCompletionStatus); |
|
1067 } |
|
1068 |
|
1069 |
|
1070 //-------------------------------------------------- |
|
1071 //-------------------------------------------------- |
|
1072 //-------------------------------------------------- |
|
1073 |
|
1074 eap_am_message_if_c * eap_am_message_if_c::new_eap_am_message_if_c( |
|
1075 abs_eap_am_tools_c * const tools) |
|
1076 { |
|
1077 EAP_TRACE_DEBUG( |
|
1078 tools, |
|
1079 TRACE_FLAGS_DEFAULT, |
|
1080 (EAPL("eap_am_message_if_c::new_eap_am_server_general_settings_c()\n"))); |
|
1081 |
|
1082 EAP_TRACE_RETURN_STRING(tools, "returns: eap_am_message_if_c::new_eap_am_message_if_c()"); |
|
1083 |
|
1084 eap_am_message_if_c *client_if = new eap_am_message_if_symbian_c(tools, EEapPluginNew); |
|
1085 |
|
1086 eap_automatic_variable_c<eap_am_message_if_c> automatic_client_if( |
|
1087 tools, |
|
1088 client_if); |
|
1089 |
|
1090 if (client_if == 0 |
|
1091 || client_if->get_is_valid() == false) |
|
1092 { |
|
1093 // ERROR. |
|
1094 if (client_if != 0) |
|
1095 { |
|
1096 EAP_TRACE_DEBUG( |
|
1097 tools, |
|
1098 TRACE_FLAGS_ALWAYS|TRACE_FLAGS_DEFAULT, |
|
1099 (EAPL("ERROR: calls: eap_am_message_if_c::new_eap_am_server_general_settings_c(): client_if->shutdown()\n"))); |
|
1100 |
|
1101 client_if->shutdown(); |
|
1102 } |
|
1103 return 0; |
|
1104 } |
|
1105 |
|
1106 automatic_client_if.do_not_free_variable(); |
|
1107 |
|
1108 return client_if; |
|
1109 |
|
1110 } |
|
1111 |
|
1112 //-------------------------------------------------- |
|
1113 |
|
1114 EAP_FUNC_EXPORT eap_plugin_message_base_c * eap_plugin_message_base_c::new_eap_plugin_client_message_if_c( |
|
1115 abs_eap_am_tools_c * const tools, |
|
1116 abs_eap_plugin_message_c * const partner) |
|
1117 { |
|
1118 EAP_TRACE_DEBUG( |
|
1119 tools, |
|
1120 TRACE_FLAGS_DEFAULT, |
|
1121 (EAPL("eap_plugin_message_base_c::new_eap_plugin_client_message_if_c()\n"))); |
|
1122 |
|
1123 EAP_TRACE_RETURN_STRING(tools, "returns: eap_plugin_message_base_c::new_eap_plugin_client_message_if_c()"); |
|
1124 |
|
1125 eap_am_message_if_c *client_if = eap_am_message_if_c::new_eap_am_message_if_c( |
|
1126 tools); |
|
1127 |
|
1128 eap_automatic_variable_c<eap_am_message_if_c> automatic_client_if( |
|
1129 tools, |
|
1130 client_if); |
|
1131 |
|
1132 if (client_if == 0 |
|
1133 || client_if->get_is_valid() == false) |
|
1134 { |
|
1135 // ERROR. |
|
1136 if (client_if != 0) |
|
1137 { |
|
1138 EAP_TRACE_DEBUG( |
|
1139 tools, |
|
1140 TRACE_FLAGS_ALWAYS|TRACE_FLAGS_DEFAULT, |
|
1141 (EAPL("ERROR: calls: eap_plugin_message_base_c::new_eap_plugin_client_message_if_c(): client_if->shutdown()\n"))); |
|
1142 |
|
1143 (void) client_if->shutdown(); |
|
1144 } |
|
1145 return 0; |
|
1146 } |
|
1147 |
|
1148 eap_plugin_client_message_if_c * new_session_core = new eap_plugin_client_message_if_c(tools, client_if, partner); |
|
1149 |
|
1150 eap_automatic_variable_c<eap_plugin_client_message_if_c> automatic_new_session_core( |
|
1151 tools, |
|
1152 new_session_core); |
|
1153 |
|
1154 if (new_session_core == 0 |
|
1155 || new_session_core->get_is_valid() == false) |
|
1156 { |
|
1157 // ERROR. |
|
1158 if (new_session_core != 0) |
|
1159 { |
|
1160 EAP_TRACE_DEBUG( |
|
1161 tools, |
|
1162 TRACE_FLAGS_ALWAYS|TRACE_FLAGS_DEFAULT, |
|
1163 (EAPL("ERROR: calls: eap_plugin_message_base_c::new_eap_plugin_client_message_if_c(): new_session_core->shutdown()\n"))); |
|
1164 |
|
1165 new_session_core->shutdown(); |
|
1166 } |
|
1167 return 0; |
|
1168 } |
|
1169 |
|
1170 client_if->set_partner(new_session_core); |
|
1171 |
|
1172 automatic_client_if.do_not_free_variable(); |
|
1173 automatic_new_session_core.do_not_free_variable(); |
|
1174 |
|
1175 return new_session_core; |
|
1176 } |
|
1177 |
|
1178 // ---------------------------------------------------------- |
|
1179 // End of file |