|
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: Class implements the generic EAP type interface. |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 32 % |
|
20 */ |
|
21 |
|
22 #ifndef _EAP_GENERIC_H_ |
|
23 #define _EAP_GENERIC_H_ |
|
24 |
|
25 // INCLUDES |
|
26 #include <EapType.h> |
|
27 #include "eap_header.h" |
|
28 #include "eap_array.h" |
|
29 #include "abs_eap_plugin_message.h" |
|
30 #include "EapClientIf.h" |
|
31 |
|
32 // FORWARD DECLARATIONS |
|
33 class eap_am_network_id_c; |
|
34 class eap_method_settings_c; |
|
35 class abs_eap_am_tools_c; |
|
36 class eap_certificate_entry_c; |
|
37 class eap_plugin_message_base_c; |
|
38 |
|
39 |
|
40 enum eap_generic_wait_state_e |
|
41 { |
|
42 eap_generic_wait_state_none, |
|
43 eap_generic_wait_state_complete_get_configuration, |
|
44 eap_generic_wait_state_complete_set_configuration, |
|
45 eap_generic_wait_state_complete_delete_configuration, |
|
46 eap_generic_wait_state_complete_copy_configuration, |
|
47 eap_generic_wait_state_complete_get_type_info, |
|
48 eap_generic_wait_state_complete_invoke_ui, |
|
49 eap_generic_wait_state_complete_set_index, |
|
50 }; |
|
51 |
|
52 const TUint KMaxStringLength = 64; |
|
53 |
|
54 // CLASS DECLARATION |
|
55 /** |
|
56 * Class implements the generic EAP type interface. |
|
57 */ |
|
58 class CEapGeneric |
|
59 : public CEapType |
|
60 , public abs_eap_plugin_message_c |
|
61 , public EapClientIf |
|
62 { |
|
63 public: |
|
64 |
|
65 /** |
|
66 * Construction function. Called by ECom after the EAP generic plugin has been loaded. |
|
67 * @param aIapInfo Pointer to the class that contains information about bearer type and unique index. |
|
68 * @return Pointer to the instance. |
|
69 */ |
|
70 static CEapGeneric* NewL(SIapInfo* aIapInfo); |
|
71 |
|
72 /** |
|
73 * Destructor does nothing. |
|
74 */ |
|
75 virtual ~CEapGeneric(); |
|
76 |
|
77 /** |
|
78 * Creates EAP protocol interface implementation. Instances an object that |
|
79 * has been derived from eap_base_type_c that handles the communication |
|
80 * with EAP stack. |
|
81 * @param aTools Pointer to tools class. |
|
82 * @param aPartner Used for callbacks to the stack. |
|
83 * @param is_client_when_true Specifies whether the EAP type acts as a client or server. |
|
84 * @param receive_network_id Network addresses |
|
85 * @param eap_config_if Pointer used for call back to creater of stack (eapol_am_wlan_authentication_symbian_c class). |
|
86 * @return Pointer to the implementation. |
|
87 */ |
|
88 virtual eap_base_type_c* GetStackInterfaceL(abs_eap_am_tools_c* const aTools, |
|
89 abs_eap_base_type_c* const aPartner, |
|
90 const bool is_client_when_true, |
|
91 const eap_am_network_id_c * const receive_network_id, |
|
92 abs_eap_configuration_if_c * const configuration_if); |
|
93 |
|
94 |
|
95 |
|
96 /** |
|
97 * Gets information about EAP type. |
|
98 * @return Pointer to a class that contains the EAP type information. Also pushed to cleanup stack. |
|
99 */ |
|
100 CEapTypeInfo* GetInfoL(); |
|
101 |
|
102 /** |
|
103 * Deletes EAP type configuration |
|
104 */ |
|
105 void DeleteConfigurationL(); |
|
106 |
|
107 /** |
|
108 * Returns the version of the interface that the EAP type implements. |
|
109 * The client-side of the interface must always check the version with this function |
|
110 * and not call the functions that are not implemented. New functions must be |
|
111 * added to the end of the interface so that the order of the old functions |
|
112 * does not change. |
|
113 * @return Integer indicating the version. |
|
114 */ |
|
115 TUint GetInterfaceVersion(); |
|
116 |
|
117 /** |
|
118 * Sets the tunneling type. This is used to indicate that this type is run inside another |
|
119 * EAP type. |
|
120 * @param aTunnelingType Type number for the tunneling type |
|
121 */ |
|
122 void SetTunnelingType(const TEapExpandedType aTunnelingType); |
|
123 |
|
124 /** |
|
125 * Changes the index of the saved parameters. |
|
126 * @param aIndexType Indicates the bearer used for this connection. |
|
127 * @param aIndex Index for the connection. aIndexType and aIndex uniquely specify the connection. |
|
128 * @return Pointer to the implementation. |
|
129 */ |
|
130 void SetIndexL( |
|
131 const TIndexType aIndexType, |
|
132 const TInt aIndex ); |
|
133 |
|
134 /** |
|
135 * Sets the EAP types configuration |
|
136 * @param aSettings Structure containing the settings |
|
137 */ |
|
138 void SetConfigurationL(const EAPSettings& aSettings); |
|
139 |
|
140 /** |
|
141 * Gets the EAP types configuration |
|
142 * @param aSettings Structure containing the settings |
|
143 */ |
|
144 void GetConfigurationL(EAPSettings& aSettings); |
|
145 |
|
146 /** |
|
147 * Copies the EAP types configuration |
|
148 * @param aDestinationIndex ID to where copy the settings. |
|
149 */ |
|
150 void CopySettingsL(const TIndexType aDestinationIndexType, const TInt aDestinationIndex); |
|
151 |
|
152 eap_status_e complete_get_configuration( |
|
153 const eap_method_settings_c * const internal_settings); |
|
154 |
|
155 eap_status_e complete_set_configuration( |
|
156 const eap_status_e completion_status); |
|
157 |
|
158 eap_status_e complete_delete_configuration( |
|
159 const eap_status_e completion_status); |
|
160 |
|
161 eap_status_e complete_copy_configuration( |
|
162 const eap_status_e completion_status); |
|
163 |
|
164 eap_status_e complete_set_index( |
|
165 const eap_status_e completion_status); |
|
166 |
|
167 eap_status_e complete_get_type_info( |
|
168 const eap_method_settings_c * const internal_settings); |
|
169 |
|
170 eap_status_e complete_invoke_ui( |
|
171 const eap_method_settings_c * const internal_settings); |
|
172 |
|
173 protected: |
|
174 |
|
175 /** |
|
176 * Constructor initialises member variables. |
|
177 */ |
|
178 CEapGeneric( |
|
179 const TIndexType aIndexType, |
|
180 const TInt aIndex, |
|
181 const TEapExpandedType aEapType); |
|
182 |
|
183 void ConstructL(); |
|
184 |
|
185 private: |
|
186 |
|
187 void Activate(); |
|
188 |
|
189 void Complete(); |
|
190 |
|
191 void WaitCompletion(); |
|
192 |
|
193 void SetCompletionStatusIfStillOk(const eap_status_e status); |
|
194 |
|
195 /// This is pointer to the tools class. |
|
196 abs_eap_am_tools_c * const m_am_tools; |
|
197 |
|
198 eap_plugin_message_base_c * const m_server; |
|
199 |
|
200 CActiveSchedulerWait iWait; |
|
201 |
|
202 // Bearer type |
|
203 TIndexType iIndexType; |
|
204 |
|
205 // Unique index |
|
206 TInt iIndex; |
|
207 |
|
208 TEapExpandedType iEapType; |
|
209 |
|
210 // Tunneling type |
|
211 eap_type_value_e iTunnelingType; |
|
212 bool iTunnelingTypePresent; |
|
213 |
|
214 eap_generic_wait_state_e iWaitState; |
|
215 |
|
216 eap_status_e iCompletionStatus; |
|
217 |
|
218 TRequestStatus iAsyncronousStatus; |
|
219 |
|
220 |
|
221 |
|
222 TBuf<KMaxStringLength> iReleaseDate; |
|
223 TBuf<KMaxStringLength> iEapTypeVersion; |
|
224 TBuf<KMaxStringLength> iManufacturer; |
|
225 |
|
226 EAPSettings * ipEAPSettings; |
|
227 }; |
|
228 |
|
229 #endif // _EAP_GENERIC_H_ |
|
230 |
|
231 // End of file |