|
1 /* |
|
2 * ============================================================================ |
|
3 * Name : ./accesssec/eapol/eapol_framework/wapi_common/include/wapi_am_wlan_authentication.h |
|
4 * Part of : WAPI / WAPI *** Info from the SWAD |
|
5 * Description : WAPI authentication |
|
6 * Version : %version: 4.1.1 % << Don't touch! Updated by Synergy at check-out. |
|
7 * |
|
8 * Copyright © 2001-2009 Nokia. All rights reserved. |
|
9 * This material, including documentation and any related computer |
|
10 * programs, is protected by copyright controlled by Nokia. All |
|
11 * rights are reserved. Copying, including reproducing, storing, |
|
12 * adapting or translating, any or all of this material requires the |
|
13 * prior written consent of Nokia. This material also contains |
|
14 * confidential information which may not be disclosed to others |
|
15 * without the prior written consent of Nokia. |
|
16 * ============================================================================ |
|
17 * Template version: 4.2 |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #if !defined(_WAPI_AM_WLAN_AUTHENTICATION_H_) |
|
23 #define _WAPI_AM_WLAN_AUTHENTICATION_H_ |
|
24 |
|
25 #include "eap_am_export.h" |
|
26 #include "eap_status.h" |
|
27 #include "eap_header.h" |
|
28 #include "eap_array.h" |
|
29 #include "eapol_key_types.h" |
|
30 |
|
31 class abs_wapi_am_wlan_authentication_c; |
|
32 class abs_eap_am_tools_c; |
|
33 class eap_am_network_id_c; |
|
34 class abs_eapol_wlan_database_reference_if_c; |
|
35 class abs_eap_state_notification_c; |
|
36 |
|
37 |
|
38 /// This is interface to adaptation module of class wapi_wlan_authentication_c. |
|
39 class EAP_EXPORT wapi_am_wlan_authentication_c |
|
40 { |
|
41 private: |
|
42 //-------------------------------------------------- |
|
43 |
|
44 //-------------------------------------------------- |
|
45 protected: |
|
46 //-------------------------------------------------- |
|
47 |
|
48 //-------------------------------------------------- |
|
49 public: |
|
50 //-------------------------------------------------- |
|
51 |
|
52 // |
|
53 virtual ~wapi_am_wlan_authentication_c(); |
|
54 |
|
55 /// @param tools: Constructor takes parameter tools that is pointer to adaptation of the platform. |
|
56 /// @param is_client_when_true: Second parameter is true when object is client and false when object is server. |
|
57 /// @param wlan_database_reference: third parameter is pointer to interface to read the current database reference. |
|
58 EAP_FUNC_IMPORT static wapi_am_wlan_authentication_c * new_wapi_am_wlan_authentication( |
|
59 abs_eap_am_tools_c * const tools, |
|
60 const bool is_client_when_true, |
|
61 const abs_eapol_wlan_database_reference_if_c * const wlan_database_reference |
|
62 ); |
|
63 |
|
64 /// This is documented in abs_eap_stack_interface_c::get_is_valid(). |
|
65 virtual bool get_is_valid() = 0; |
|
66 |
|
67 /// This is documented in abs_eap_stack_interface_c::configure(). |
|
68 virtual eap_status_e configure() = 0; |
|
69 |
|
70 /// This is documented in abs_eap_stack_interface_c::shutdown(). |
|
71 virtual eap_status_e shutdown() = 0; |
|
72 |
|
73 /// Function sets the parther object of this object. |
|
74 virtual eap_status_e set_am_partner( |
|
75 abs_wapi_am_wlan_authentication_c * am_partner |
|
76 ) = 0; |
|
77 |
|
78 /// Function resets current WAPI-configuration. |
|
79 virtual eap_status_e reset_wapi_configuration() = 0; |
|
80 |
|
81 /// Function sets the new WLAN parameters. |
|
82 virtual eap_status_e set_wlan_parameters( |
|
83 const eap_variable_data_c * const SSID, |
|
84 const bool WAPI_override_enabled, |
|
85 const eap_variable_data_c * const preshared_key, |
|
86 const eapol_key_authentication_type_e selected_eapol_key_authentication_type) = 0; |
|
87 |
|
88 /// New association is completed. |
|
89 virtual eap_status_e association( |
|
90 const eap_am_network_id_c * const receive_network_id ///< source includes remote address, destination includes local address. |
|
91 ) = 0; |
|
92 |
|
93 /// Previous connection was disassociated. |
|
94 virtual eap_status_e disassociation( |
|
95 const eap_am_network_id_c * const receive_network_id ///< source includes remote address, destination includes local address. |
|
96 ) = 0; |
|
97 |
|
98 // **** |
|
99 // TODO: Is this needed in WAPI? |
|
100 /// Function gets the current WLAN configuration |
|
101 virtual eap_status_e get_wlan_configuration( |
|
102 eap_variable_data_c * const preshared_key) = 0; |
|
103 |
|
104 /** |
|
105 * This function indicates finish of the authentication to adatation module. |
|
106 * @param when_true_successfull indicates whether authentication was successfull (true) or not (false). |
|
107 * @param authentication_type indicates the used WAPI authentication type (PSK or certificate). |
|
108 */ |
|
109 virtual eap_status_e authentication_finished( |
|
110 const bool when_true_successfull, |
|
111 const eapol_key_authentication_type_e authentication_type) = 0; |
|
112 |
|
113 /** |
|
114 * The read_configure() function reads the configuration data identified |
|
115 * by the field string of field_length bytes length. Adaptation module must direct |
|
116 * the query to some persistent store. |
|
117 * @see abs_eap_base_type_c::read_configure(). |
|
118 */ |
|
119 virtual eap_status_e read_configure( |
|
120 const eap_configuration_field_c * const field, |
|
121 eap_variable_data_c * const data) = 0; |
|
122 |
|
123 /** |
|
124 * The write_configure() function writes the configuration data identified |
|
125 * by the field string of field_length bytes length. Adaptation module must direct |
|
126 * the action to some persistent store. |
|
127 * @see abs_eap_base_type_c::write_configure(). |
|
128 */ |
|
129 virtual eap_status_e write_configure( |
|
130 const eap_configuration_field_c * const field, |
|
131 eap_variable_data_c * const data) = 0; |
|
132 |
|
133 /** |
|
134 * The set_timer() function initializes timer to be elapsed after p_time_ms milliseconds. |
|
135 * @param initializer is pointer to object which timer_expired() function will |
|
136 * be called after timer elapses. |
|
137 * @param id is identifier which will be returned in timer_expired() function. |
|
138 * The user selects and interprets the id for this timer. |
|
139 * @param data is pointer to any user selected data which will be returned in timer_expired() function. |
|
140 * @param p_time_ms is time of timer to elapse in milli seconds. |
|
141 * |
|
142 * Adaptation module internally implements the timer. |
|
143 */ |
|
144 virtual eap_status_e set_timer( |
|
145 abs_eap_base_timer_c * const initializer, |
|
146 const u32_t id, |
|
147 void * const data, |
|
148 const u32_t p_time_ms) = 0; |
|
149 |
|
150 /** |
|
151 * The cancel_timer() function cancels the timer id initiated by initializer. |
|
152 * @param initializer is the object that initialised the timer. |
|
153 * @param id is the identity of the timer. |
|
154 * |
|
155 * Adaptation module internally implements the timer. |
|
156 */ |
|
157 virtual eap_status_e cancel_timer( |
|
158 abs_eap_base_timer_c * const initializer, |
|
159 const u32_t id) = 0; |
|
160 |
|
161 /** |
|
162 * The cancel_all_timers() function cancels all timers. |
|
163 * User should use this in termination of the stack before |
|
164 * the adaptation module of tools is deleted. |
|
165 * Preferred mode is to cancel each timer directly |
|
166 * using cancel_timer() function. |
|
167 * |
|
168 * Adaptation module internally implements the timer. |
|
169 */ |
|
170 virtual eap_status_e cancel_all_timers() = 0; |
|
171 |
|
172 /** |
|
173 * This is notification of internal state transition. |
|
174 * This is used for notifications, debugging and protocol testing. |
|
175 * The primal notifications are eap_state_variable_e::eap_state_authentication_finished_successfully |
|
176 * and eap_state_variable_e::eap_state_authentication_terminated_unsuccessfully. |
|
177 * These two notifications are sent from WAPI-protocol layer (eap_protocol_layer_e::eap_protocol_layer_wapi). |
|
178 */ |
|
179 virtual void state_notification( |
|
180 const abs_eap_state_notification_c * const state) = 0; |
|
181 |
|
182 //-------------------------------------------------- |
|
183 }; // class wapi_am_wlan_authentication_c |
|
184 |
|
185 #endif //#if !defined(_WAPI_AM_WLAN_AUTHENTICATION_H_) |
|
186 |
|
187 //-------------------------------------------------- |
|
188 |
|
189 |
|
190 |
|
191 // End. |