28 #include "eap_file_config.h" |
28 #include "eap_file_config.h" |
29 //#include <eap_am_file_input_stdio.h> |
29 //#include <eap_am_file_input_stdio.h> |
30 #include "abs_eap_database_reference_if.h" |
30 #include "abs_eap_database_reference_if.h" |
31 #include "abs_eapol_message_wlan_authentication.h" |
31 #include "abs_eapol_message_wlan_authentication.h" |
32 #include "eapol_handle_tlv_message_data.h" |
32 #include "eapol_handle_tlv_message_data.h" |
|
33 #include "eap_am_export.h" |
|
34 // Start: added by script change_export_macros.sh. |
|
35 #if defined(EAP_NO_EXPORT_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H) |
|
36 #define EAP_CLASS_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H EAP_NONSHARABLE |
|
37 #define EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H |
|
38 #define EAP_C_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H |
|
39 #define EAP_FUNC_EXPORT_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H |
|
40 #define EAP_C_FUNC_EXPORT_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H |
|
41 #elif defined(EAP_EXPORT_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H) |
|
42 #define EAP_CLASS_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H EAP_EXPORT |
|
43 #define EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H EAP_FUNC_EXPORT |
|
44 #define EAP_C_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H EAP_C_FUNC_EXPORT |
|
45 #define EAP_FUNC_EXPORT_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H EAP_FUNC_EXPORT |
|
46 #define EAP_C_FUNC_EXPORT_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H EAP_C_FUNC_EXPORT |
|
47 #else |
|
48 #define EAP_CLASS_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H EAP_IMPORT |
|
49 #define EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H EAP_FUNC_IMPORT |
|
50 #define EAP_C_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H EAP_C_FUNC_IMPORT |
|
51 #define EAP_FUNC_EXPORT_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H |
|
52 #define EAP_C_FUNC_EXPORT_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H |
|
53 #endif |
|
54 // End: added by script change_export_macros.sh. |
|
55 |
33 |
56 |
34 /** @file */ |
57 /** @file */ |
35 |
58 |
36 class eap_tlv_header_c; |
59 class eap_tlv_header_c; |
37 |
60 |
67 |
90 |
68 bool m_is_valid; |
91 bool m_is_valid; |
69 |
92 |
70 // ---------------------------------------------------------------------- |
93 // ---------------------------------------------------------------------- |
71 |
94 |
72 EAP_FUNC_IMPORT eap_status_e check_pmksa_cache( |
95 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e check_pmksa_cache( |
73 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const tlv_blocks); |
96 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const tlv_blocks); |
74 |
97 |
75 EAP_FUNC_IMPORT eap_status_e start_authentication( |
98 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e start_authentication( |
76 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
99 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
77 |
100 |
78 EAP_FUNC_IMPORT eap_status_e complete_association( |
101 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e complete_association( |
79 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
102 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
80 |
103 |
81 EAP_FUNC_IMPORT eap_status_e disassociation( |
104 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e disassociation( |
82 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
105 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
83 |
106 |
84 EAP_FUNC_IMPORT eap_status_e start_preauthentication( |
107 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e start_preauthentication( |
85 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
108 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
86 |
109 |
87 EAP_FUNC_IMPORT eap_status_e start_reassociation( |
110 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e start_reassociation( |
88 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
111 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
89 |
112 |
90 EAP_FUNC_IMPORT eap_status_e complete_reassociation( |
113 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e complete_reassociation( |
91 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
114 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
92 |
115 |
93 EAP_FUNC_IMPORT eap_status_e start_WPXM_reassociation( |
116 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e start_WPXM_reassociation( |
94 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
117 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
95 |
118 |
96 EAP_FUNC_IMPORT eap_status_e complete_WPXM_reassociation( |
119 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e complete_WPXM_reassociation( |
97 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
120 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
98 |
121 |
99 EAP_FUNC_IMPORT eap_status_e packet_process( |
122 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e packet_process( |
100 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
123 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
101 |
124 |
102 EAP_FUNC_IMPORT eap_status_e tkip_mic_failure( |
125 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e tkip_mic_failure( |
103 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
126 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
104 |
127 |
105 EAP_FUNC_IMPORT eap_status_e eap_acknowledge( |
128 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e eap_acknowledge( |
106 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
129 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
107 |
130 |
108 EAP_FUNC_IMPORT eap_status_e update_header_offset( |
131 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e update_header_offset( |
109 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
132 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
110 |
133 |
111 EAP_FUNC_IMPORT eap_status_e update_wlan_database_reference_values( |
134 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e update_wlan_database_reference_values( |
112 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
135 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
113 |
136 |
114 EAP_FUNC_IMPORT eap_status_e send_error_message( |
137 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e send_error_message( |
115 const eap_status_e status, |
138 const eap_status_e status, |
116 const eap_tlv_message_type_function_e function); |
139 const eap_tlv_message_type_function_e function); |
117 |
140 |
118 EAP_FUNC_IMPORT eap_status_e process_message_type_error( |
141 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e process_message_type_error( |
119 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
142 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
120 |
143 |
121 EAP_FUNC_IMPORT eap_status_e process_message(eapol_handle_tlv_message_data_c * const message); |
144 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e process_message(eapol_handle_tlv_message_data_c * const message); |
122 |
145 |
123 EAP_FUNC_IMPORT eap_status_e send_message(eapol_handle_tlv_message_data_c * const message); |
146 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e send_message(eapol_handle_tlv_message_data_c * const message); |
124 |
147 |
125 // ---------------------------------------------------------------------- |
148 // ---------------------------------------------------------------------- |
126 |
149 |
127 public: |
150 public: |
128 |
151 |
129 EAP_FUNC_IMPORT virtual ~eapol_message_wlan_authentication_c(); |
152 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H virtual ~eapol_message_wlan_authentication_c(); |
130 |
153 |
131 EAP_FUNC_IMPORT eapol_message_wlan_authentication_c( |
154 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eapol_message_wlan_authentication_c( |
132 abs_eap_am_tools_c * const tools, |
155 abs_eap_am_tools_c * const tools, |
133 abs_eapol_message_wlan_authentication_c * const partner); |
156 abs_eapol_message_wlan_authentication_c * const partner); |
134 |
157 |
135 |
158 |
136 /// This function configures the object and sets the initial values |
159 /// This function configures the object and sets the initial values |
137 /// of header offset, MTU and trailer length. |
160 /// of header offset, MTU and trailer length. |
138 /// Look at the abs_eap_base_type_c::get_header_offset() |
161 /// Look at the abs_eap_base_type_c::get_header_offset() |
139 /// for description of header_offset, MTU and trailer_length. |
162 /// for description of header_offset, MTU and trailer_length. |
140 EAP_FUNC_IMPORT eap_status_e configure( |
163 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e configure( |
141 const u32_t header_offset, |
164 const u32_t header_offset, |
142 const u32_t MTU, |
165 const u32_t MTU, |
143 const u32_t trailer_length); |
166 const u32_t trailer_length); |
144 |
167 |
145 // Look at abs_eap_stack_interface_c::shutdown(). |
168 // Look at abs_eap_stack_interface_c::shutdown(). |
146 EAP_FUNC_IMPORT eap_status_e shutdown(); |
169 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e shutdown(); |
147 |
170 |
148 // Look at abs_eap_stack_interface_c::get_is_valid(). |
171 // Look at abs_eap_stack_interface_c::get_is_valid(). |
149 EAP_FUNC_IMPORT bool get_is_valid(); |
172 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H bool get_is_valid(); |
150 |
173 |
151 |
174 |
152 |
175 |
153 // ------------------------------------------------------ |
176 // ------------------------------------------------------ |
154 // The following functions are from abs_eap_base_timer_c. |
177 // The following functions are from abs_eap_base_timer_c. |
155 |
178 |
156 // Look at abs_eap_base_timer_c::timer_expired(). |
179 // Look at abs_eap_base_timer_c::timer_expired(). |
157 EAP_FUNC_IMPORT eap_status_e timer_expired( |
180 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e timer_expired( |
158 const u32_t id, |
181 const u32_t id, |
159 void *data); |
182 void *data); |
160 |
183 |
161 // Look at abs_eap_base_timer_c::timer_delete_data(). |
184 // Look at abs_eap_base_timer_c::timer_delete_data(). |
162 EAP_FUNC_IMPORT eap_status_e timer_delete_data( |
185 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e timer_delete_data( |
163 const u32_t id, |
186 const u32_t id, |
164 void *data); |
187 void *data); |
165 |
188 |
166 // The previous functions are from abs_eap_base_timer_c. |
189 // The previous functions are from abs_eap_base_timer_c. |
167 // ------------------------------------------------------ |
190 // ------------------------------------------------------ |
169 |
192 |
170 // ---------------------------------------------------------------- |
193 // ---------------------------------------------------------------- |
171 // The following functions are from abs_eapol_wlan_authentication_c. |
194 // The following functions are from abs_eapol_wlan_authentication_c. |
172 |
195 |
173 // Look at abs_eapol_wlan_authentication_c::packet_send(). |
196 // Look at abs_eapol_wlan_authentication_c::packet_send(). |
174 EAP_FUNC_IMPORT eap_status_e packet_send( |
197 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e packet_send( |
175 const eap_am_network_id_c * const send_network_id, |
198 const eap_am_network_id_c * const send_network_id, |
176 eap_buf_chain_wr_c * const sent_packet, |
199 eap_buf_chain_wr_c * const sent_packet, |
177 const u32_t header_offset, |
200 const u32_t header_offset, |
178 const u32_t data_length, |
201 const u32_t data_length, |
179 const u32_t buffer_length); |
202 const u32_t buffer_length); |
180 |
203 |
181 // Look at abs_eapol_wlan_authentication_c::get_header_offset(). |
204 // Look at abs_eapol_wlan_authentication_c::get_header_offset(). |
182 EAP_FUNC_IMPORT u32_t get_header_offset( |
205 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H u32_t get_header_offset( |
183 u32_t * const MTU, |
206 u32_t * const MTU, |
184 u32_t * const trailer_length); |
207 u32_t * const trailer_length); |
185 |
208 |
186 // Look at abs_eapol_wlan_authentication_c::associate(). |
209 // Look at abs_eapol_wlan_authentication_c::associate(). |
187 EAP_FUNC_IMPORT eap_status_e associate( |
210 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e associate( |
188 eapol_key_802_11_authentication_mode_e authentication_mode); |
211 eapol_key_802_11_authentication_mode_e authentication_mode); |
189 |
212 |
190 // Look at abs_eapol_wlan_authentication_c::disassociate(). |
213 // Look at abs_eapol_wlan_authentication_c::disassociate(). |
191 EAP_FUNC_IMPORT eap_status_e disassociate( |
214 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e disassociate( |
192 const eap_am_network_id_c * const receive_network_id, ///< source includes remote address, destination includes local address. |
215 const eap_am_network_id_c * const receive_network_id, ///< source includes remote address, destination includes local address. |
193 const bool self_disassociation); |
216 const bool self_disassociation); |
194 |
217 |
195 // Look at abs_eapol_wlan_authentication_c::packet_data_session_key(). |
218 // Look at abs_eapol_wlan_authentication_c::packet_data_session_key(). |
196 EAP_FUNC_IMPORT eap_status_e packet_data_session_key( |
219 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e packet_data_session_key( |
197 const eap_am_network_id_c * const send_network_id, |
220 const eap_am_network_id_c * const send_network_id, |
198 const eapol_session_key_c * const key); |
221 const eapol_session_key_c * const key); |
199 |
222 |
200 // Look at abs_eapol_wlan_authentication_c::state_notification(). |
223 // Look at abs_eapol_wlan_authentication_c::state_notification(). |
201 EAP_FUNC_IMPORT void state_notification( |
224 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H void state_notification( |
202 const abs_eap_state_notification_c * const state); |
225 const abs_eap_state_notification_c * const state); |
203 |
226 |
204 // Look at abs_eapol_wlan_authentication_c::add_rogue_ap(). |
227 // Look at abs_eapol_wlan_authentication_c::add_rogue_ap(). |
205 EAP_FUNC_IMPORT eap_status_e add_rogue_ap(eap_array_c<eap_rogue_ap_entry_c> & rogue_ap_list); |
228 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e add_rogue_ap(eap_array_c<eap_rogue_ap_entry_c> & rogue_ap_list); |
206 |
229 |
207 // Look at abs_eapol_wlan_authentication_c::reassociate(). |
230 // Look at abs_eapol_wlan_authentication_c::reassociate(). |
208 EAP_FUNC_IMPORT eap_status_e reassociate( |
231 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e reassociate( |
209 const eap_am_network_id_c * const send_network_id, |
232 const eap_am_network_id_c * const send_network_id, |
210 const eapol_key_authentication_type_e authentication_type, |
233 const eapol_key_authentication_type_e authentication_type, |
211 const eap_variable_data_c * const PMKID); |
234 const eap_variable_data_c * const PMKID); |
212 |
235 |
213 // The previous functions are from abs_eapol_wlan_authentication_c. |
236 // The previous functions are from abs_eapol_wlan_authentication_c. |
215 |
238 |
216 |
239 |
217 /// Function receives the data message from lower layer. |
240 /// Function receives the data message from lower layer. |
218 /// Data is formatted to Attribute-Value Pairs. |
241 /// Data is formatted to Attribute-Value Pairs. |
219 /// Look at eap_tlv_header_c and eap_tlv_message_data_c. |
242 /// Look at eap_tlv_header_c and eap_tlv_message_data_c. |
220 EAP_FUNC_IMPORT wlan_eap_if_send_status_e process_data(const void * const data, const u32_t length); |
243 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H wlan_eap_if_send_status_e process_data(const void * const data, const u32_t length); |
221 |
244 |
222 // ---------------------------------------------------------------------- |
245 // ---------------------------------------------------------------------- |
223 |
246 |
224 #if defined(USE_EAP_SIMPLE_CONFIG) |
247 #if defined(USE_EAP_SIMPLE_CONFIG) |
225 |
248 |
226 EAP_FUNC_IMPORT eap_status_e save_simple_config_session( |
249 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e save_simple_config_session( |
227 const simple_config_state_e state, |
250 const simple_config_state_e state, |
228 EAP_TEMPLATE_CONST eap_array_c<simple_config_credential_c> * const credential_array, |
251 EAP_TEMPLATE_CONST eap_array_c<simple_config_credential_c> * const credential_array, |
229 const eap_variable_data_c * const new_password, |
252 const eap_variable_data_c * const new_password, |
230 const simple_config_Device_Password_ID_e Device_Password_ID, |
253 const simple_config_Device_Password_ID_e Device_Password_ID, |
231 const simple_config_payloads_c * const other_configuration); |
254 const simple_config_payloads_c * const other_configuration); |
232 |
255 |
233 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
256 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
234 |
257 |
235 EAP_FUNC_IMPORT eap_status_e complete_check_pmksa_cache( |
258 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e complete_check_pmksa_cache( |
236 EAP_TEMPLATE_CONST eap_array_c<eap_am_network_id_c> * const bssid_sta_receive_network_ids); |
259 EAP_TEMPLATE_CONST eap_array_c<eap_am_network_id_c> * const bssid_sta_receive_network_ids); |
237 |
260 |
238 EAP_FUNC_IMPORT eap_status_e complete_disassociation( |
261 EAP_FUNC_VISIBILITY_EAPOL_MESSAGE_WLAN_AUTHENTICATION_H eap_status_e complete_disassociation( |
239 const eap_am_network_id_c * const receive_network_id); |
262 const eap_am_network_id_c * const receive_network_id); |
240 |
263 |
241 // ---------------------------------------------------------------------- |
264 // ---------------------------------------------------------------------- |
242 }; |
265 }; |
243 |
266 |