|
1 /* |
|
2 * Copyright (c) 2001-2007 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: Interface to EAPOL authentication protocols. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CORE_WLAN_EAPOL_INTERFACE_H |
|
22 #define CORE_WLAN_EAPOL_INTERFACE_H |
|
23 |
|
24 // INCLUDES |
|
25 #include "am_platform_libraries.h" |
|
26 #include "core_wlan_eapol_if_message.h" |
|
27 #include "abs_core_server_callback.h" |
|
28 #include "core_frame_ethernet.h" |
|
29 |
|
30 // CLASS DECLARATION |
|
31 class core_wlan_eapol_interface_c |
|
32 { |
|
33 public: |
|
34 |
|
35 core_wlan_eapol_interface_c( |
|
36 abs_core_server_callback_c& wlm_callback ); |
|
37 |
|
38 ~core_wlan_eapol_interface_c(); |
|
39 |
|
40 static core_error_e convert_if_status_to_core_error( const u32_t if_status ); |
|
41 |
|
42 core_error_e load_eapol( |
|
43 core_eapol_operating_mode_e mode, |
|
44 abs_wlan_eapol_callback_c* const eapol_handler ); |
|
45 |
|
46 core_error_e shutdown(); |
|
47 |
|
48 core_error_e configure(); |
|
49 |
|
50 |
|
51 core_error_e check_pmksa_cache( |
|
52 core_type_list_c<network_id_c> & network_id_list, |
|
53 const wlan_eapol_if_eapol_key_authentication_type_e selected_eapol_key_authentication_type, |
|
54 const wlan_eapol_if_rsna_cipher_e pairwise_key_cipher_suite, |
|
55 const wlan_eapol_if_rsna_cipher_e group_key_cipher_suite ); |
|
56 |
|
57 core_error_e start_authentication( |
|
58 u8_t * ssid, const u32_t ssid_length, |
|
59 const wlan_eapol_if_eapol_key_authentication_type_e selected_eapol_key_authentication_type, |
|
60 u8_t * wpa_psk, const u32_t wpa_psk_length, |
|
61 const bool_t wpa_override_enabled, |
|
62 const network_id_c * network_id ); |
|
63 |
|
64 core_error_e complete_association( |
|
65 const wlan_eapol_if_eapol_wlan_authentication_state_e association_result, |
|
66 const network_id_c * network_id, |
|
67 u8_t * received_wpa_ie, const u32_t received_wpa_ie_length, |
|
68 u8_t * sent_wpa_ie, const u32_t sent_wpa_ie_length, |
|
69 const wlan_eapol_if_rsna_cipher_e pairwise_key_cipher_suite, |
|
70 const wlan_eapol_if_rsna_cipher_e group_key_cipher_suite ); |
|
71 |
|
72 core_error_e disassociation( |
|
73 const network_id_c * network_id ); |
|
74 |
|
75 core_error_e start_preauthentication( |
|
76 const network_id_c * network_id ); |
|
77 |
|
78 core_error_e start_reassociation( |
|
79 const network_id_c * old_network_id, |
|
80 const network_id_c * new_network_id, |
|
81 const wlan_eapol_if_eapol_key_authentication_type_e selected_eapol_key_authentication_type ); |
|
82 |
|
83 core_error_e complete_reassociation( |
|
84 const wlan_eapol_if_eapol_wlan_authentication_state_e association_result, |
|
85 const network_id_c * network_id, |
|
86 u8_t * received_wpa_ie, const u32_t received_wpa_ie_length, |
|
87 u8_t * sent_wpa_ie, const u32_t sent_wpa_ie_length, |
|
88 const wlan_eapol_if_rsna_cipher_e pairwise_key_cipher_suite, |
|
89 const wlan_eapol_if_rsna_cipher_e group_key_cipher_suite ); |
|
90 |
|
91 core_error_e start_wpx_fast_roam_reassociation( |
|
92 const network_id_c * old_network_id, |
|
93 const network_id_c * new_network_id, |
|
94 u8_t * reassociation_request_ie, |
|
95 const u32_t reassociation_request_ie_length, |
|
96 const u8_t* received_wpa_ie, |
|
97 u32_t received_wpa_ie_length, |
|
98 const u8_t* sent_wpa_ie, |
|
99 u32_t sent_wpa_ie_length ); |
|
100 |
|
101 core_error_e complete_wpx_fast_roam_reassociation( |
|
102 const wlan_eapol_if_eapol_wlan_authentication_state_e reassociation_result, |
|
103 const network_id_c * network_id, |
|
104 u8_t * received_reassociation_ie, const u32_t received_reassociation_ie_length ); |
|
105 |
|
106 /** |
|
107 * Send the given frame to EAPOL for processing. |
|
108 * |
|
109 * @param frame Frame to be sent for processing |
|
110 * @return core_error_ok if success, an error code otherwise. |
|
111 */ |
|
112 core_error_e process_frame( |
|
113 const core_frame_ethernet_c& frame ); |
|
114 |
|
115 core_error_e tkip_mic_failure( |
|
116 const network_id_c * network_id, |
|
117 const bool_t is_fatal_failure, |
|
118 const wlan_eapol_if_eapol_tkip_mic_failure_type_e tkip_mic_failure_type ); |
|
119 |
|
120 core_error_e eap_acknowledge( |
|
121 const network_id_c * network_id ); |
|
122 |
|
123 core_error_e update_header_offset( |
|
124 const u32_t header_offset, |
|
125 const u32_t MTU, |
|
126 const u32_t trailer_length ); |
|
127 |
|
128 core_error_e update_wlan_database_reference_values( |
|
129 u8_t * database_reference_value, const u32_t database_reference_value_length ); |
|
130 |
|
131 core_error_e update_completed_check_pmksa_cache_list( |
|
132 core_type_list_c<network_id_c> & network_id_list ); |
|
133 |
|
134 core_type_list_c<core_mac_address_s> & get_completed_check_pmksa_cache_list(); |
|
135 |
|
136 /** |
|
137 * Store a frame for later use. |
|
138 * |
|
139 * @param frame Ethernet frame to be stored. |
|
140 * @note This method will take a copy of the frame. |
|
141 */ |
|
142 core_error_e store_frame( |
|
143 const core_frame_ethernet_c& frame ); |
|
144 |
|
145 /** |
|
146 * Delete the stored frame. |
|
147 */ |
|
148 void clear_stored_frame(); |
|
149 |
|
150 /** |
|
151 * Process the stored frame. |
|
152 * |
|
153 * If a frame has been stored using store_frame(), this method |
|
154 * will send the frame to EAPOL for processing. |
|
155 * @return core_error_ok if success, an error code otherwise. |
|
156 */ |
|
157 core_error_e process_stored_frame(); |
|
158 |
|
159 /** |
|
160 * Return current EAPOL operating mode. |
|
161 * |
|
162 * @return Current EAPOL operating mode. |
|
163 */ |
|
164 core_eapol_operating_mode_e operating_mode() const; |
|
165 |
|
166 /** |
|
167 * Return current EAPOL ethernet type. |
|
168 * |
|
169 * @return Current EAPOL ethernet type. |
|
170 */ |
|
171 wlan_eapol_ethernet_type_e ethernet_type() const; |
|
172 |
|
173 /** |
|
174 * Return current EAPOL authentication type. |
|
175 * |
|
176 * @return Current EAPOL authentication type. |
|
177 */ |
|
178 wlan_eapol_if_eapol_key_authentication_type_e authentication_type() const; |
|
179 |
|
180 private: // Data |
|
181 |
|
182 abs_core_server_callback_c& wlm_callback_m; |
|
183 core_wlan_eapol_if_function_c function; |
|
184 |
|
185 core_type_list_c< core_mac_address_s > completed_check_pmksa_cache_list; |
|
186 |
|
187 /** Frame stored for later use. */ |
|
188 core_frame_ethernet_c* stored_frame_m; |
|
189 |
|
190 /** Current EAPOL operating mode. */ |
|
191 core_eapol_operating_mode_e eapol_mode_m; |
|
192 |
|
193 /** Currently used EAPOL authentication type. */ |
|
194 wlan_eapol_if_eapol_key_authentication_type_e authentication_type_m; |
|
195 |
|
196 //-------------------------------------------------- |
|
197 }; // class core_wlan_eapol_interface_c |
|
198 |
|
199 #endif //#ifndef CORE_WLAN_EAPOL_INTERFACE_H |
|
200 |
|
201 //-------------------------------------------------- |
|
202 |
|
203 // End of file |