|
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 |
|
20 #ifndef _EAPMSCHAPV2_H_ |
|
21 #define _EAPMSCHAPV2_H_ |
|
22 |
|
23 // INCLUDES |
|
24 #include <EapType.h> |
|
25 #include "eap_header.h" |
|
26 |
|
27 // LOCAL CONSTANTS |
|
28 |
|
29 // CLASS DECLARATION |
|
30 /** |
|
31 * Class that implements the generic EAP type interface. Implements EAP MSCHAPv2 and |
|
32 * plain MSCHAPv2 protocol. |
|
33 */ |
|
34 class CEapMsChapV2 : public CEapType |
|
35 { |
|
36 public: |
|
37 /** |
|
38 * Construction function. Called by ECom after the EAP MSCHAPv2 plugin has been loaded. |
|
39 * @param aIapInfo Pointer to the class that contains information about bearer type and unique index. |
|
40 * @return Pointer to the instance. |
|
41 */ |
|
42 static CEapMsChapV2* NewL(SIapInfo *aIapInfo); |
|
43 |
|
44 /** |
|
45 * Construction function. Called by ECom after the plain MSCHAPv2 plugin has been loaded. |
|
46 * @param aIapInfo Pointer to the class that contains information about bearer type and unique index. |
|
47 * @return Pointer to the instance. |
|
48 */ |
|
49 static CEapMsChapV2* NewPlainMSCHAPv2L(SIapInfo *aIapInfo); |
|
50 |
|
51 /** |
|
52 * Destructor does nothing. |
|
53 */ |
|
54 virtual ~CEapMsChapV2(); |
|
55 |
|
56 #ifdef USE_EAP_SIMPLE_CONFIG |
|
57 |
|
58 /** |
|
59 * Creates EAP protocol interface implementation. Instances an object that |
|
60 * has been derived from eap_base_type_c that handles the communication |
|
61 * with EAP stack. |
|
62 * @param aTools Pointer to tools class. |
|
63 * @param aPartner Used for callbacks to the stack. |
|
64 * @param is_client_when_true Specifies whether the EAP type acts as a client or server. |
|
65 * @param receive_network_id Network addresses |
|
66 * @param eap_config_if Pointer used for call back to creater of stack (eapol_am_wlan_authentication_symbian_c class). |
|
67 * @return Pointer to the implementation. |
|
68 */ |
|
69 virtual eap_base_type_c* GetStackInterfaceL(abs_eap_am_tools_c* const aTools, |
|
70 abs_eap_base_type_c* const aPartner, |
|
71 const bool is_client_when_true, |
|
72 const eap_am_network_id_c * const receive_network_id, |
|
73 abs_eap_configuration_if_c * const configuration_if); |
|
74 |
|
75 #else |
|
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 * @return Pointer to the implementation. |
|
86 */ |
|
87 eap_base_type_c* GetStackInterfaceL(abs_eap_am_tools_c* const aTools, |
|
88 abs_eap_base_type_c* const aPartner, |
|
89 const bool is_client_when_true, |
|
90 const eap_am_network_id_c * const receive_network_id); |
|
91 |
|
92 #endif // #ifdef USE_EAP_SIMPLE_CONFIG |
|
93 |
|
94 /** |
|
95 * Invokes the configuration UI. |
|
96 **/ |
|
97 TInt InvokeUiL(); |
|
98 |
|
99 /** |
|
100 * Gets information about EAP type. |
|
101 * @return Pointer to a class that contains the EAP type information. Also pushed to cleanup stack. |
|
102 */ |
|
103 CEapTypeInfo* GetInfoLC(); |
|
104 |
|
105 /** |
|
106 * Deletes EAP type configuration |
|
107 */ |
|
108 void DeleteConfigurationL(); |
|
109 |
|
110 /** |
|
111 * Returns the version of the interface that the EAP type implements. |
|
112 * The client-side of the interface must always check the version with this function |
|
113 * and not call the functions that are not implemented. New functions must be |
|
114 * added to the end of the interface so that the order of the old functions |
|
115 * does not change. |
|
116 * @return Integer indicating the version. |
|
117 */ |
|
118 TUint GetInterfaceVersion(); |
|
119 |
|
120 /** |
|
121 * Sets the tunneling type. This is used to indicate that this type is run inside another |
|
122 * EAP type. |
|
123 * @param aTunnelingType Type number for the tunneling type |
|
124 */ |
|
125 void SetTunnelingType(const TInt aTunnelingType); |
|
126 |
|
127 /** |
|
128 * Changes the index of the saved parameters. |
|
129 * @param aIndexType Indicates the bearer used for this connection. |
|
130 * @param aIndex Index for the connection. aIndexType and aIndex uniquely specify the connection. |
|
131 */ |
|
132 void SetIndexL( |
|
133 const TIndexType aIndexType, |
|
134 const TInt aIndex); |
|
135 |
|
136 /** |
|
137 * Sets the EAP types configuration |
|
138 * @param aSettings Structure containing the settings |
|
139 */ |
|
140 void SetConfigurationL(const EAPSettings& aSettings); |
|
141 |
|
142 /** |
|
143 * Gets the EAP types configuration |
|
144 * @param aSettings Structure containing the settings |
|
145 */ |
|
146 void GetConfigurationL(EAPSettings& aSettings); |
|
147 |
|
148 /** |
|
149 * Copies the EAP types configuration |
|
150 * @param aDestinationIndex ID to where copy the settings. |
|
151 */ |
|
152 void CopySettingsL(const TIndexType aDestinationIndexType, const TInt aDestinationIndex); |
|
153 |
|
154 protected: |
|
155 |
|
156 /** |
|
157 * Constructor initialises member variables. |
|
158 */ |
|
159 CEapMsChapV2(const TIndexType aIndexType, const TInt aIndex, |
|
160 const eap_type_value_e aEapType = eap_type_mschapv2 ); |
|
161 |
|
162 private: |
|
163 |
|
164 // Bearer type |
|
165 TIndexType iIndexType; |
|
166 |
|
167 // Unique index |
|
168 TInt iIndex; |
|
169 |
|
170 // Tunneling type |
|
171 eap_type_value_e iTunnelingType; |
|
172 |
|
173 // Eap type (EAP-MSCHAPv2 or plain MSCHAPv2) |
|
174 eap_type_value_e iEapType; |
|
175 |
|
176 }; |
|
177 |
|
178 #endif // _EAPMSCHAPV2_H_ |
|
179 |
|
180 // End of file |