|
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 #ifndef _EAPSIMINTERFACE_H_ |
|
20 #define _EAPSIMINTERFACE_H_ |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include "eap_tools.h" |
|
25 #include "eap_am_type_gsmsim_symbian.h" |
|
26 |
|
27 #include <etelmm.h> |
|
28 #include <rmmcustomapi.h> |
|
29 |
|
30 // CLASS DECLARATION |
|
31 /** |
|
32 * Class (active object) that handles the communications with the SIM. |
|
33 */ |
|
34 class CEapSimIsaInterface |
|
35 : public CActive |
|
36 { |
|
37 public: |
|
38 |
|
39 // For differentiating the query type. |
|
40 enum TQueryType |
|
41 { |
|
42 EQueryNone, |
|
43 EQueryIMSI, |
|
44 EQuerySRESandKC |
|
45 }; |
|
46 /** |
|
47 * Initialisation function. |
|
48 * @param aTools Tools class pointer. |
|
49 * @param aParent Pointer to the parent class. |
|
50 */ |
|
51 static CEapSimIsaInterface* NewL( |
|
52 abs_eap_am_tools_c* const aTools, |
|
53 eap_am_type_gsmsim_symbian_c* const aParent); |
|
54 |
|
55 /** |
|
56 * Destructor |
|
57 */ |
|
58 virtual ~CEapSimIsaInterface(); |
|
59 |
|
60 /** |
|
61 * This function queries the IMSI from SIM. After the request has been completed |
|
62 * complete_SIM_imsi is called in the parent. |
|
63 */ |
|
64 void QueryIMSIL(); |
|
65 |
|
66 /** |
|
67 * This function queries Kc and SRES from SIM. After the request has been completed |
|
68 * complete_SIM_kc_and_sres is called in the parent. |
|
69 * @param aRand Random value |
|
70 */ |
|
71 void QueryKcAndSRESL(const TDesC8& aRand); |
|
72 |
|
73 protected: |
|
74 |
|
75 CEapSimIsaInterface(abs_eap_am_tools_c* const aTools, eap_am_type_gsmsim_symbian_c* const aParent); |
|
76 |
|
77 void ConstructL(); |
|
78 |
|
79 void RunL(); |
|
80 |
|
81 void DoCancel(); |
|
82 |
|
83 private: |
|
84 |
|
85 // Creates the MMETel connection and loads the phone module. |
|
86 TInt CreateMMETelConnectionL(); |
|
87 |
|
88 private: |
|
89 |
|
90 eap_am_type_gsmsim_symbian_c * const iParent; |
|
91 |
|
92 abs_eap_am_tools_c * const m_am_tools; |
|
93 |
|
94 // ETel connection. |
|
95 RTelServer iServer; |
|
96 RMobilePhone iPhone; |
|
97 |
|
98 //For custom API. |
|
99 RMmCustomAPI iCustomAPI; |
|
100 |
|
101 // Stores the last queried Subscriber Id ( IMSI ). |
|
102 RMobilePhone::TMobilePhoneSubscriberId iSubscriberId; |
|
103 |
|
104 // Stores the SIM authentication details. |
|
105 RMmCustomAPI::TSimAuthenticationEapSim iEAPSim; |
|
106 |
|
107 // For the packaged authentication data. |
|
108 RMmCustomAPI::TSimDataPckg *iAuthenticationData; |
|
109 |
|
110 // Stores the query identifier. Used to check if IMSI query or KC & SRES query. |
|
111 TQueryType iQueryId; |
|
112 |
|
113 // Tells if MMETEL is connected already or not. |
|
114 TBool iMMETELConnectionStatus; |
|
115 |
|
116 }; |
|
117 |
|
118 #endif // _EAPSIMINTERFACE_H_ |
|
119 |
|
120 // End of file |