121 eap_trace_mask_timer_queue = (1u << 14u), ///< This value traces the timer queue. |
142 eap_trace_mask_timer_queue = (1u << 14u), ///< This value traces the timer queue. |
122 eap_trace_mask_ok_returns = (1u << 15u), ///< This value traces the OK return values, alot of them. |
143 eap_trace_mask_ok_returns = (1u << 15u), ///< This value traces the OK return values, alot of them. |
123 eap_trace_mask_trace_never = (1u << 16u), ///< This value never traces. This can disable trace always. |
144 eap_trace_mask_trace_never = (1u << 16u), ///< This value never traces. This can disable trace always. |
124 }; |
145 }; |
125 |
146 |
126 EAP_FUNC_IMPORT u8_t octet_to_ascii(i32_t octet); |
147 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H u8_t octet_to_ascii(i32_t octet); |
127 |
148 |
128 EAP_FUNC_IMPORT u8_t ascii_to_octet(i32_t character); |
149 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H u8_t ascii_to_octet(i32_t character); |
129 |
150 |
130 EAP_FUNC_IMPORT virtual ~eap_am_tools_c(); |
151 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H virtual ~eap_am_tools_c(); |
131 |
152 |
132 EAP_FUNC_IMPORT eap_am_tools_c(); |
153 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_am_tools_c(); |
133 |
154 |
134 EAP_FUNC_IMPORT bool get_use_seconds_timestamp_in_traces(); |
155 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H bool get_use_seconds_timestamp_in_traces(); |
135 |
156 |
136 EAP_FUNC_IMPORT bool get_thread_stopped(); |
157 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H bool get_thread_stopped(); |
137 |
158 |
138 EAP_FUNC_IMPORT void set_use_timer_queue(); |
159 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H void set_use_timer_queue(); |
139 |
160 |
140 EAP_FUNC_IMPORT bool get_use_timer_queue(); |
161 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H bool get_use_timer_queue(); |
141 |
162 |
142 EAP_FUNC_IMPORT u32_t get_trace_mask() const; |
163 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H u32_t get_trace_mask() const; |
143 |
164 |
144 EAP_FUNC_IMPORT void set_trace_mask(const u32_t mask); |
165 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H void set_trace_mask(const u32_t mask); |
145 |
166 |
146 EAP_FUNC_IMPORT void set_activate_trace_on_error(); |
167 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H void set_activate_trace_on_error(); |
147 |
168 |
148 EAP_FUNC_IMPORT void check_activate_trace_on_error(); |
169 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H void check_activate_trace_on_error(); |
149 |
170 |
150 EAP_FUNC_IMPORT void trace_data(eap_const_string prefix, const void * const data, const u32_t data_length); |
171 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H void trace_data(eap_const_string prefix, const void * const data, const u32_t data_length); |
151 |
172 |
152 EAP_FUNC_IMPORT eap_status_e timer_thread_function(); |
173 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e timer_thread_function(); |
153 |
174 |
154 EAP_FUNC_IMPORT eap_status_e convert_ascii_to_uppercase( |
175 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e convert_ascii_to_uppercase( |
155 u8_t * const source_bytes, |
176 u8_t * const source_bytes, |
156 const u32_t source_bytes_length); |
177 const u32_t source_bytes_length); |
157 |
178 |
158 EAP_FUNC_IMPORT eap_status_e convert_bytes_to_hex_ascii( |
179 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e convert_bytes_to_hex_ascii( |
159 const u8_t * const source_bytes, |
180 const u8_t * const source_bytes, |
160 const u32_t source_bytes_length, |
181 const u32_t source_bytes_length, |
161 u8_t * const target, |
182 u8_t * const target, |
162 u32_t *target_length); |
183 u32_t *target_length); |
163 |
184 |
164 EAP_FUNC_IMPORT eap_status_e convert_bytes_to_hex_ascii( |
185 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e convert_bytes_to_hex_ascii( |
165 const void * const source_bytes, |
186 const void * const source_bytes, |
166 const u32_t source_bytes_length, |
187 const u32_t source_bytes_length, |
167 eap_variable_data_c * const target); |
188 eap_variable_data_c * const target); |
168 |
189 |
169 EAP_FUNC_IMPORT eap_status_e convert_hex_ascii_to_bytes( |
190 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e convert_hex_ascii_to_bytes( |
170 const u8_t * const source_bytes, |
191 const u8_t * const source_bytes, |
171 const u32_t source_bytes_length, |
192 const u32_t source_bytes_length, |
172 u8_t * const target, |
193 u8_t * const target, |
173 u32_t *target_length); |
194 u32_t *target_length); |
174 |
195 |
175 EAP_FUNC_IMPORT eap_status_e convert_hex_ascii_to_bytes( |
196 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e convert_hex_ascii_to_bytes( |
176 const void * const source_bytes, |
197 const void * const source_bytes, |
177 const u32_t source_bytes_length, |
198 const u32_t source_bytes_length, |
178 eap_variable_data_c * const target); |
199 eap_variable_data_c * const target); |
179 |
200 |
180 |
201 |
181 EAP_FUNC_IMPORT eap_status_e convert_bytes_to_ascii_armor( |
202 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e convert_bytes_to_ascii_armor( |
182 const u8_t * const source_bytes, |
203 const u8_t * const source_bytes, |
183 const u32_t source_bytes_length, |
204 const u32_t source_bytes_length, |
184 u8_t * const target, |
205 u8_t * const target, |
185 u32_t *target_length); |
206 u32_t *target_length); |
186 |
207 |
187 EAP_FUNC_IMPORT eap_status_e restore_bytes_from_ascii_armor( |
208 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e restore_bytes_from_ascii_armor( |
188 const u8_t * const source_bytes, |
209 const u8_t * const source_bytes, |
189 const u32_t source_bytes_length, |
210 const u32_t source_bytes_length, |
190 u8_t * const target, |
211 u8_t * const target, |
191 u32_t *target_length); |
212 u32_t *target_length); |
192 |
213 |
193 EAP_FUNC_IMPORT eap_status_e eap_status_return( |
214 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e eap_status_return( |
194 const bool print_error_when_true, |
215 const bool print_error_when_true, |
195 const eap_status_e status, |
216 const eap_status_e status, |
196 const eap_char * const file_name, |
217 const eap_char * const file_name, |
197 const i32_t line_number); |
218 const i32_t line_number); |
198 |
219 |
199 EAP_FUNC_IMPORT eap_status_e eap_status_return_file_number( |
220 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e eap_status_return_file_number( |
200 const bool print_error_when_true, |
221 const bool print_error_when_true, |
201 const eap_status_e status, |
222 const eap_status_e status, |
202 const u32_t file_date, |
223 const u32_t file_date, |
203 const u32_t file_number, |
224 const u32_t file_number, |
204 const i32_t line_number); |
225 const i32_t line_number); |
205 |
226 |
206 |
227 |
207 // This is documented in abs_eap_am_tools_c::memory_store_add_data(). |
228 // This is documented in abs_eap_am_tools_c::memory_store_add_data(). |
208 EAP_FUNC_IMPORT eap_status_e memory_store_add_data( |
229 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e memory_store_add_data( |
209 const eap_variable_data_c * const key, |
230 const eap_variable_data_c * const key, |
210 eap_tlv_message_data_c * const data, |
231 eap_tlv_message_data_c * const data, |
211 const u32_t timeout); |
232 const u32_t timeout); |
212 |
233 |
213 // This is documented in abs_eap_am_tools_c::memory_store_get_data(). |
234 // This is documented in abs_eap_am_tools_c::memory_store_get_data(). |
214 EAP_FUNC_IMPORT eap_status_e memory_store_get_data( |
235 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e memory_store_get_data( |
215 const eap_variable_data_c * const key, |
236 const eap_variable_data_c * const key, |
216 eap_tlv_message_data_c * const data); |
237 eap_tlv_message_data_c * const data); |
217 |
238 |
218 // This is documented in abs_eap_am_tools_c::memory_store_remove_data(). |
239 // This is documented in abs_eap_am_tools_c::memory_store_remove_data(). |
219 EAP_FUNC_IMPORT eap_status_e memory_store_remove_data( |
240 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e memory_store_remove_data( |
220 const eap_variable_data_c * const key); |
241 const eap_variable_data_c * const key); |
221 |
242 |
222 |
243 |
223 /// This function shuts down eap_am_tools_c object. |
244 /// This function shuts down eap_am_tools_c object. |
224 EAP_FUNC_IMPORT eap_status_e shutdown_am_tools(); |
245 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e shutdown_am_tools(); |
225 |
246 |
226 /// The implementing function must call eap_am_tools_c::shutdown_am_tools(). |
247 /// The implementing function must call eap_am_tools_c::shutdown_am_tools(). |
227 EAP_FUNC_IMPORT virtual eap_status_e shutdown() = 0; |
248 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H virtual eap_status_e shutdown() = 0; |
228 |
249 |
229 /** |
250 /** |
230 * Function converts unicode characters into UTF8 characters. |
251 * Function converts unicode characters into UTF8 characters. |
231 * @param dest is reference to destination utf8 variable data. |
252 * @param dest is reference to destination utf8 variable data. |
232 * @param src is refrence to unicode variable data. |
253 * @param src is refrence to unicode variable data. |
233 * @return eap status code. |
254 * @return eap status code. |
234 */ |
255 */ |
235 EAP_FUNC_IMPORT eap_status_e generic_convert_unicode_to_utf8( |
256 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e generic_convert_unicode_to_utf8( |
236 eap_variable_data_c & dest, |
257 eap_variable_data_c & dest, |
237 const eap_variable_data_c & src); |
258 const eap_variable_data_c & src); |
238 |
259 |
239 /** |
260 /** |
240 * Function converts UTF8 characters into unicode characters. |
261 * Function converts UTF8 characters into unicode characters. |
241 * @param dest is reference to destination unicode variable data. |
262 * @param dest is reference to destination unicode variable data. |
242 * @param src is refrence to UTF8 variable data. |
263 * @param src is refrence to UTF8 variable data. |
243 * @return eap status code. |
264 * @return eap status code. |
244 */ |
265 */ |
245 EAP_FUNC_IMPORT eap_status_e generic_convert_utf8_to_unicode( |
266 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e generic_convert_utf8_to_unicode( |
246 eap_variable_data_c & dest, |
267 eap_variable_data_c & dest, |
247 const eap_variable_data_c & src); |
268 const eap_variable_data_c & src); |
248 |
269 |
249 /** |
270 /** |
250 * Function parses NAI to usename and realm. |
271 * Function parses NAI to usename and realm. |
251 * If either is missing the corresponding value will be invalid. |
272 * If either is missing the corresponding value will be invalid. |
252 */ |
273 */ |
253 EAP_FUNC_IMPORT eap_status_e parse_nai( |
274 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e parse_nai( |
254 const eap_variable_data_c * const nai, |
275 const eap_variable_data_c * const nai, |
255 eap_variable_data_c * const username, |
276 eap_variable_data_c * const username, |
256 eap_variable_data_c * const realm); |
277 eap_variable_data_c * const realm); |
257 |
278 |
258 |
279 |
259 #if defined(USE_EAP_ERROR_TESTS) |
280 #if defined(USE_EAP_ERROR_TESTS) |
260 EAP_FUNC_IMPORT eap_status_e generate_random_error( |
281 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e generate_random_error( |
261 eap_buf_chain_wr_c * const sent_packet, |
282 eap_buf_chain_wr_c * const sent_packet, |
262 const bool forse_error, |
283 const bool forse_error, |
263 const u32_t packet_index, |
284 const u32_t packet_index, |
264 const u32_t minimum_index, |
285 const u32_t minimum_index, |
265 const u32_t error_probability, |
286 const u32_t error_probability, |
266 const u32_t minimum_packet_length); |
287 const u32_t minimum_packet_length); |
267 |
288 |
268 EAP_FUNC_IMPORT u32_t get_packet_index(); |
289 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H u32_t get_packet_index(); |
269 |
290 |
270 EAP_FUNC_IMPORT void increase_packet_index(); |
291 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H void increase_packet_index(); |
271 #endif //#if defined(USE_EAP_ERROR_TESTS) |
292 #endif //#if defined(USE_EAP_ERROR_TESTS) |
272 |
293 |
273 |
294 |
274 EAP_FUNC_IMPORT eap_status_e number_string_to_u32( |
295 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e number_string_to_u32( |
275 const u8_t * const number_string, |
296 const u8_t * const number_string, |
276 const u32_t number_string_length, |
297 const u32_t number_string_length, |
277 u32_t * const integer); |
298 u32_t * const integer); |
278 |
299 |
279 EAP_FUNC_IMPORT void trace_configuration( |
300 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H void trace_configuration( |
280 const eap_status_e configuration_read_status, |
301 const eap_status_e configuration_read_status, |
281 const eap_configuration_field_c * const field, |
302 const eap_configuration_field_c * const field, |
282 const eap_variable_data_c * const data); |
303 const eap_variable_data_c * const data); |
283 |
304 |
284 EAP_FUNC_IMPORT u64_t xor_u64(const u64_t a, const u64_t b); |
305 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H u64_t xor_u64(const u64_t a, const u64_t b); |
285 |
306 |
286 EAP_FUNC_IMPORT u64_t multiply_u64(const u64_t a, const u64_t b); |
307 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H u64_t multiply_u64(const u64_t a, const u64_t b); |
287 |
308 |
288 EAP_FUNC_IMPORT i32_t compare_u64(const u64_t a, const u64_t b); |
309 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H i32_t compare_u64(const u64_t a, const u64_t b); |
289 |
310 |
290 EAP_FUNC_IMPORT eap_status_e create_uuid_v5( |
311 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e create_uuid_v5( |
291 const void* const ns_uuid, |
312 const void* const ns_uuid, |
292 const u32_t ns_uuid_length, |
313 const u32_t ns_uuid_length, |
293 const void* const name, |
314 const void* const name, |
294 const u32_t name_length, |
315 const u32_t name_length, |
295 eap_variable_data_c* const uuid ); |
316 eap_variable_data_c* const uuid ); |
296 |
317 |
297 EAP_FUNC_IMPORT eap_status_e create_uuid_v5_from_mac_address( |
318 EAP_FUNC_VISIBILITY_EAP_AM_TOOLS_H eap_status_e create_uuid_v5_from_mac_address( |
298 const u8_t* const mac_address, |
319 const u8_t* const mac_address, |
299 const u32_t mac_address_length, |
320 const u32_t mac_address_length, |
300 eap_variable_data_c* const uuid ); |
321 eap_variable_data_c* const uuid ); |
301 |
322 |
302 }; |
323 }; |