eap_am_tools_c Class Reference

class eap_am_tools_c : public abs_eap_am_tools_c

This class defines the common functions of tools. These are the platform independent functions used in tools.

Inherits from

Public Member Functions
eap_am_tools_c ()
~eap_am_tools_c ()
EAP_FUNC_IMPORT u8_t ascii_to_octet ( i32_t )
EAP_FUNC_IMPORT void check_activate_trace_on_error ()
EAP_FUNC_IMPORT i32_t compare_u64 (const u64_t , const u64_t )
EAP_FUNC_IMPORT eap_status_e convert_ascii_to_uppercase ( u8_t *const , const u32_t )
EAP_FUNC_IMPORT eap_status_e convert_bytes_to_ascii_armor (const u8_t *const , const u32_t , u8_t *const , u32_t *)
EAP_FUNC_IMPORT eap_status_e convert_bytes_to_hex_ascii (const u8_t *const , const u32_t , u8_t *const , u32_t *)
EAP_FUNC_IMPORT eap_status_e convert_bytes_to_hex_ascii (const void *const , const u32_t , eap_variable_data_c *const )
EAP_FUNC_IMPORT eap_status_e convert_hex_ascii_to_bytes (const u8_t *const , const u32_t , u8_t *const , u32_t *)
EAP_FUNC_IMPORT eap_status_e convert_hex_ascii_to_bytes (const void *const , const u32_t , eap_variable_data_c *const )
EAP_FUNC_IMPORT eap_status_e create_uuid_v5 (const void *const , const u32_t , const void *const , const u32_t , eap_variable_data_c *const )
EAP_FUNC_IMPORT eap_status_e create_uuid_v5_from_mac_address (const u8_t *const , const u32_t , eap_variable_data_c *const )
EAP_FUNC_IMPORT eap_status_e eap_status_return (const bool, const eap_status_e , const eap_char *const , const i32_t )
EAP_FUNC_IMPORT eap_status_e eap_status_return_file_number (const bool, const eap_status_e , const u32_t , const u32_t , const i32_t )
EAP_FUNC_IMPORT eap_status_e generic_convert_unicode_to_utf8 ( eap_variable_data_c &, const eap_variable_data_c &)
EAP_FUNC_IMPORT eap_status_e generic_convert_utf8_to_unicode ( eap_variable_data_c &, const eap_variable_data_c &)
EAP_FUNC_IMPORT bool get_thread_stopped ()
EAP_FUNC_IMPORT u32_t get_trace_mask ()
EAP_FUNC_IMPORT bool get_use_seconds_timestamp_in_traces ()
EAP_FUNC_IMPORT bool get_use_timer_queue ()
EAP_FUNC_IMPORT eap_status_e memory_store_add_data (const eap_variable_data_c *const , eap_tlv_message_data_c *const , const u32_t )
EAP_FUNC_IMPORT eap_status_e memory_store_get_data (const eap_variable_data_c *const , eap_tlv_message_data_c *const )
EAP_FUNC_IMPORT eap_status_e memory_store_remove_data (const eap_variable_data_c *const )
EAP_FUNC_IMPORT u64_t multiply_u64 (const u64_t , const u64_t )
EAP_FUNC_IMPORT eap_status_e number_string_to_u32 (const u8_t *const , const u32_t , u32_t *const )
EAP_FUNC_IMPORT u8_t octet_to_ascii ( i32_t )
EAP_FUNC_IMPORT eap_status_e parse_nai (const eap_variable_data_c *const , eap_variable_data_c *const , eap_variable_data_c *const )
EAP_FUNC_IMPORT eap_status_e restore_bytes_from_ascii_armor (const u8_t *const , const u32_t , u8_t *const , u32_t *)
EAP_FUNC_IMPORT void set_activate_trace_on_error ()
EAP_FUNC_IMPORT void set_trace_mask (const u32_t )
EAP_FUNC_IMPORT void set_use_timer_queue ()
EAP_FUNC_IMPORT eap_status_e shutdown ()
EAP_FUNC_IMPORT eap_status_e shutdown_am_tools ()
EAP_FUNC_IMPORT eap_status_e timer_thread_function ()
EAP_FUNC_IMPORT void trace_configuration (const eap_status_e , const eap_configuration_field_c *const , const eap_variable_data_c *const )
EAP_FUNC_IMPORT void trace_data ( eap_const_string , const void *const , const u32_t )
EAP_FUNC_IMPORT u64_t xor_u64 (const u64_t , const u64_t )
Private Member Functions
EAP_FUNC_IMPORT void convert_selected_bytes_to_ascii_armor (const u8_t , u32_t *const , u8_t *const , u8_t *const , u32_t *const , const bool)
EAP_FUNC_IMPORT u8_t octet_from_ascii_armor (const u8_t )
EAP_FUNC_IMPORT u8_t octet_to_ascii_armor (const u8_t )
EAP_FUNC_IMPORT void restore_selected_bytes_from_ascii_armor (const u8_t , u32_t *const , u8_t *const , u32_t *const , const bool)
Inherited Functions
abs_eap_am_tools_c::abs_eap_am_tools_c()
abs_eap_am_tools_c::am_cancel_all_timers()
abs_eap_am_tools_c::am_cancel_timer(abs_eap_base_timer_c *const ,const u32_t)
abs_eap_am_tools_c::am_set_timer(abs_eap_base_timer_c *const ,const u32_t,void *const ,const u32_t)
abs_eap_am_tools_c::config_strlen(eap_config_string)
abs_eap_am_tools_c::configure()
abs_eap_am_tools_c::convert_am_error_to_eapol_error(const i32_t)
abs_eap_am_tools_c::convert_eapol_error_to_am_error(eap_status_e)
abs_eap_am_tools_c::convert_unicode_to_utf8(eap_variable_data_c &,const eap_variable_data_c &)
abs_eap_am_tools_c::convert_utf8_to_unicode(eap_variable_data_c &,const eap_variable_data_c &)
abs_eap_am_tools_c::delete_abs_eap_am_tools_c(abs_eap_am_tools_c *const )
abs_eap_am_tools_c::enter_global_mutex()
abs_eap_am_tools_c::formatted_print(eap_format_string,...)
abs_eap_am_tools_c::get_clock_ticks()
abs_eap_am_tools_c::get_clock_ticks_of_second()
abs_eap_am_tools_c::get_crypto()
abs_eap_am_tools_c::get_global_mutex()
abs_eap_am_tools_c::get_gmt_unix_time()
abs_eap_am_tools_c::get_hardware_ticks()
abs_eap_am_tools_c::get_hardware_ticks_of_second()
abs_eap_am_tools_c::get_is_timer_thread_active()
abs_eap_am_tools_c::get_is_valid()const
abs_eap_am_tools_c::get_timer_queue_is_empty()
abs_eap_am_tools_c::get_timer_resolution_ms()
abs_eap_am_tools_c::get_use_eap_milli_second_timer()
abs_eap_am_tools_c::getenv(const eap_variable_data_c *const ,eap_variable_data_c *const )
abs_eap_am_tools_c::isspace(const u8_t)
abs_eap_am_tools_c::leave_global_mutex()
abs_eap_am_tools_c::memchr(const void *,u8_t,u32_t)
abs_eap_am_tools_c::memcmp(const void *const ,const void *const ,const u32_t)
abs_eap_am_tools_c::memmove(void *,const void *,const u32_t)
abs_eap_am_tools_c::memrchr(const void *,u8_t,u32_t)
abs_eap_am_tools_c::memset(void *const ,const i32_t,const u32_t)
abs_eap_am_tools_c::new_abs_eap_am_tools_c()
abs_eap_am_tools_c::pulse_timer(const u32_t)
abs_eap_am_tools_c::re_activate_timer_queue()
abs_eap_am_tools_c::set_max_trace_file_size(const u32_t)
abs_eap_am_tools_c::set_timer_resolution_ms(const u32_t)
abs_eap_am_tools_c::set_trace_file_name(const eap_variable_data_c *const )
abs_eap_am_tools_c::set_use_eap_milli_second_timer(const bool)
abs_eap_am_tools_c::sleep(u32_t)
abs_eap_am_tools_c::snprintf(u8_t *const ,u32_t,eap_format_string,...)
abs_eap_am_tools_c::start_timer_thread()
abs_eap_am_tools_c::stop_timer_thread()
abs_eap_am_tools_c::strlen(eap_const_string)
abs_eap_am_tools_c::timer_sleep(u32_t)
abs_eap_am_tools_c::u64_struct_to_u64_t(const u64_struct)
abs_eap_am_tools_c::u64_t_to_u64_struct(const u64_t)
abs_eap_am_tools_c::~abs_eap_am_tools_c()
Public Member Enumerations
enum anonymous {
eap_trace_mask_none  = (0u), eap_trace_mask_always  = (1u << 0u), eap_trace_mask_error  = (1u << 1u), eap_trace_mask_debug  = (1u << 2u), eap_trace_mask_functions  = (1u << 3u), eap_trace_mask_crypto  = (1u << 4u), eap_trace_mask_timer  = (1u << 5u), eap_trace_mask_eap_messages  = (1u << 6u), eap_trace_mask_test_vectors  = (1u << 7u), eap_trace_mask_crypto_sha1  = (1u << 8u), eap_trace_mask_crypto_md4  = (1u << 9u), eap_trace_mask_crypto_rc4  = (1u << 10u), eap_trace_mask_crypto_test_random  = (1u << 11u), eap_trace_mask_message_data  = (1u << 12u), eap_trace_mask_hash_map  = (1u << 13u), eap_trace_mask_timer_queue  = (1u << 14u), eap_trace_mask_ok_returns  = (1u << 15u)
}
Private Attributes
bool m_activate_trace_on_error
eap_am_memory_store_c * m_memory_store
bool m_shutdown_was_called
bool m_thread_stopped
u8_t m_tmp_ascii_buffer
u8_t m_tmp_buffer
u32_t m_trace_mask
bool m_use_seconds_timestamp_in_traces
bool m_use_timer_queue

Constructor & Destructor Documentation

eap_am_tools_c()

EAP_FUNC_IMPORT eap_am_tools_c ( )

~eap_am_tools_c()

EAP_FUNC_IMPORT ~eap_am_tools_c ( ) [virtual]

Member Functions Documentation

ascii_to_octet(i32_t)

EAP_FUNC_IMPORT u8_t ascii_to_octet ( i32_t character ) [virtual]

Function converts one ascii character to octet.

Parameters

i32_t character is the converted ascii character.

check_activate_trace_on_error()

EAP_FUNC_IMPORT void check_activate_trace_on_error ( ) [virtual]

compare_u64(const u64_t, const u64_t)

EAP_FUNC_IMPORT i32_t compare_u64 ( const u64_t a,
const u64_t b
) [virtual]

This function compares two 64-bit integers. If a is bigger function returns positive integer. If b is bigger function returns negative integer. If a == b function returns zero integer.

Parameters

const u64_t a
const u64_t b

convert_ascii_to_uppercase(u8_t *const, const u32_t)

EAP_FUNC_IMPORT eap_status_e convert_ascii_to_uppercase ( u8_t *const source_bytes,
const u32_t source_bytes_length
) [virtual]

Function converts lovercase ascii characters to uppercase.

Parameters

u8_t *const source_bytes is pointer to the source bytes.
const u32_t source_bytes_length is length of source bytes.

convert_bytes_to_ascii_armor(const u8_t *const, const u32_t, u8_t *const, u32_t *)

EAP_FUNC_IMPORT eap_status_e convert_bytes_to_ascii_armor ( const u8_t *const source_bytes,
const u32_t source_bytes_length,
u8_t *const target,
u32_t * target_length
) [virtual]

Function converts bytes to ascii armored bytes.

Parameters

const u8_t *const source_bytes is pointer to the source bytes.
const u32_t source_bytes_length is length of source bytes.
u8_t *const target is pointer to the target bytes.
u32_t * target_length is length of target bytes. Binary 6-bit blocks are converted to 8-bit ascii values. Ascii values can easily represent 2^6=64 values. If length of target array is not module 3, padding zero bits are ignored. |0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | : : : : : : : | : : : : : : : | : : : : : : : | : : : : : : : | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0 1 2 3 4 5|0 1 2 3 4 5|0 1 2 3 4 5|0 1 2 3 4 5|0 1 2 3 4 5|0 1 2 3 4 5| | | | | | | + | | | | | | \ | | | | | + \ | | | | | \ \ | | | | + \ \ | | | | \ \ \ | | | + \ \ \ | | | \ \ \ \ | | + \ \ \ \ | | \ \ \ \ \ | + \ \ \ \ \ | \ \ \ \ \ \ | \ \ \ \ \ \ | + + + + + + | | | | | | | |0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | : : : : : : : | : : : : : : : | : : : : : : : | : : : : : : : | : : : : : : : | : : : : : : : | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

convert_bytes_to_hex_ascii(const u8_t *const, const u32_t, u8_t *const, u32_t *)

EAP_FUNC_IMPORT eap_status_e convert_bytes_to_hex_ascii ( const u8_t *const source_bytes,
const u32_t source_bytes_length,
u8_t *const target,
u32_t * target_length
) [virtual]

Function converts bytes to hex ascii.

Parameters

const u8_t *const source_bytes is pointer to the source bytes.
const u32_t source_bytes_length is length of source bytes.
u8_t *const target is pointer to the target bytes.
u32_t * target_length is length of target bytes.

convert_bytes_to_hex_ascii(const void *const, const u32_t, eap_variable_data_c *const)

EAP_FUNC_IMPORT eap_status_e convert_bytes_to_hex_ascii ( const void *const source_bytes,
const u32_t source_bytes_length,
eap_variable_data_c *const target
) [virtual]

Function converts bytes to hex ascii.

Parameters

const void *const source_bytes is pointer to the source bytes.
const u32_t source_bytes_length is length of source bytes.
eap_variable_data_c *const target is pointer to the target buffer.

convert_hex_ascii_to_bytes(const u8_t *const, const u32_t, u8_t *const, u32_t *)

EAP_FUNC_IMPORT eap_status_e convert_hex_ascii_to_bytes ( const u8_t *const source_bytes,
const u32_t source_bytes_length,
u8_t *const target,
u32_t * target_length
) [virtual]

Function converts hex ascii to bytes.

Parameters

const u8_t *const source_bytes is pointer to the source bytes.
const u32_t source_bytes_length is length of source bytes.
u8_t *const target is pointer to the target bytes.
u32_t * target_length is length of target bytes.

convert_hex_ascii_to_bytes(const void *const, const u32_t, eap_variable_data_c *const)

EAP_FUNC_IMPORT eap_status_e convert_hex_ascii_to_bytes ( const void *const source_bytes,
const u32_t source_bytes_length,
eap_variable_data_c *const target
) [virtual]

Function converts hex ascii to bytes.

Parameters

const void *const source_bytes is pointer to the source bytes.
const u32_t source_bytes_length is length of source bytes.
eap_variable_data_c *const target is pointer to the target bytes.

convert_selected_bytes_to_ascii_armor(const u8_t, u32_t *const, u8_t *const, u8_t *const, u32_t *const, const bool)

EAP_FUNC_IMPORT void convert_selected_bytes_to_ascii_armor ( const u8_t source_byte,
u32_t *const saved_bit_count,
u8_t *const saved_bits,
u8_t *const target,
u32_t *const output_ind,
const bool last_input_byte
) [private]

Parameters

const u8_t source_byte
u32_t *const saved_bit_count
u8_t *const saved_bits
u8_t *const target
u32_t *const output_ind
const bool last_input_byte

create_uuid_v5(const void *const, const u32_t, const void *const, const u32_t, eap_variable_data_c *const)

EAP_FUNC_IMPORT eap_status_e create_uuid_v5 ( const void *const ns_uuid,
const u32_t ns_uuid_length,
const void *const name,
const u32_t name_length,
eap_variable_data_c *const uuid
) [virtual]

The create_uuid_v5() method creates an UUID version 5 (SHA-1) from the name space UUID and name (RFC 4122). The name space UUID should be in hex format (e.g. 3d813cbb47fb52ba91df831e1593ac29). The name space UUID and name must be in network byte order (little endiann).

Parameters

const void *const ns_uuid pointer to the UUID of the name space in hex format.
const u32_t ns_uuid_length lenght of the name space UUID in bytes (should be 16 bytes).
const void *const name pointer to the name (e.g. MAC address) in the name space in hex format.
const u32_t name_length length of the name in bytes.
eap_variable_data_c *const uuid pointer to an eap_variable_data_c instance to which the UUID will be created.

create_uuid_v5_from_mac_address(const u8_t *const, const u32_t, eap_variable_data_c *const)

EAP_FUNC_IMPORT eap_status_e create_uuid_v5_from_mac_address ( const u8_t *const mac_address,
const u32_t mac_address_length,
eap_variable_data_c *const uuid
) [virtual]

The create_uuid_v5_from_mac_address() method creates an UUID version 5 from a MAC address. Uses an internally defined, fixed name space UUID allocated for EAP MAC addresses. The MAC address should be in hex format (little endiann).

Parameters

const u8_t *const mac_address pointer to the MAC address in hex format.
const u32_t mac_address_length length of the MAC address (should be 6 bytes).
eap_variable_data_c *const uuid pointer to an eap_variable_data_c instance to which the UUID will be created.

eap_status_return(const bool, const eap_status_e, const eap_char *const, const i32_t)

EAP_FUNC_IMPORT eap_status_e eap_status_return ( const bool print_error_when_true,
const eap_status_e status,
const eap_char *const file_name,
const i32_t line_number
) [virtual]

Parameters

const bool print_error_when_true
const eap_status_e status
const eap_char *const file_name
const i32_t line_number

eap_status_return_file_number(const bool, const eap_status_e, const u32_t, const u32_t, const i32_t)

EAP_FUNC_IMPORT eap_status_e eap_status_return_file_number ( const bool print_error_when_true,
const eap_status_e status,
const u32_t file_date,
const u32_t file_number,
const i32_t line_number
) [virtual]

This function is global proxy for return values with file name and line number. This is used in traces.

Parameters

const bool print_error_when_true
const eap_status_e status
const u32_t file_date
const u32_t file_number
const i32_t line_number

generic_convert_unicode_to_utf8(eap_variable_data_c &, const eap_variable_data_c &)

EAP_FUNC_IMPORT eap_status_e generic_convert_unicode_to_utf8 ( eap_variable_data_c & dest,
const eap_variable_data_c & src
)

Function converts unicode characters into UTF8 characters.

Parameters

eap_variable_data_c & dest is reference to destination utf8 variable data.
const eap_variable_data_c & src is refrence to unicode variable data.

generic_convert_utf8_to_unicode(eap_variable_data_c &, const eap_variable_data_c &)

EAP_FUNC_IMPORT eap_status_e generic_convert_utf8_to_unicode ( eap_variable_data_c & dest,
const eap_variable_data_c & src
)

Function converts UTF8 characters into unicode characters.

Parameters

eap_variable_data_c & dest is reference to destination unicode variable data.
const eap_variable_data_c & src is refrence to UTF8 variable data.

get_thread_stopped()

EAP_FUNC_IMPORT bool get_thread_stopped ( ) [virtual]

Returns true when timer thread is stopped. Returns false when timer thread is running.

get_trace_mask()

EAP_FUNC_IMPORT u32_t get_trace_mask ( ) const [virtual]

Gets the current trace mask.

get_use_seconds_timestamp_in_traces()

EAP_FUNC_IMPORT bool get_use_seconds_timestamp_in_traces ( )

get_use_timer_queue()

EAP_FUNC_IMPORT bool get_use_timer_queue ( ) [virtual]

Returns true when timer queue is used. Returns false when timer queue is not used.

memory_store_add_data(const eap_variable_data_c *const, eap_tlv_message_data_c *const, const u32_t)

EAP_FUNC_IMPORT eap_status_e memory_store_add_data ( const eap_variable_data_c *const key,
eap_tlv_message_data_c *const data,
const u32_t timeout
) [virtual]

Memory store is visible only during the eap_am_tools_c object is alive. This function add flat data to memory store. You must format your data to eap_tlv_message_data_c object. Data is identified by key parameter. You can set timeout to data. Data will be automatically removed after timeout. Timeout value zero means no timeout is set. Serious WARNING: do use really good key values. Memory store is globally used by all EAP Core objects. Key must be good that other users do not use others data. Add the real data type as a string to the key and other identifiers that separate data between the other users that store same data type to the memory store.

Parameters

const eap_variable_data_c *const key
eap_tlv_message_data_c *const data
const u32_t timeout

memory_store_get_data(const eap_variable_data_c *const, eap_tlv_message_data_c *const)

EAP_FUNC_IMPORT eap_status_e memory_store_get_data ( const eap_variable_data_c *const key,
eap_tlv_message_data_c *const data
) [virtual]

Memory store is visible only during the eap_am_tools_c object is alive. This function gets data from memory store. Data is returned in eap_tlv_message_data_c object. Data is identified by key parameter. Serious WARNING: do use really good key values. Memory store is globally used by all EAP Core objects. Key must be good that other users do not use others data. Add the real data type as a string to the key and other identifiers that separate data between the other users that store same data type to the memory store.

Parameters

const eap_variable_data_c *const key
eap_tlv_message_data_c *const data

memory_store_remove_data(const eap_variable_data_c *const)

EAP_FUNC_IMPORT eap_status_e memory_store_remove_data ( const eap_variable_data_c *const key ) [virtual]

Memory store is visible only during the eap_am_tools_c object is alive. This function removes data from memory store. Data is identified by key parameter. Serious WARNING: do use really good key values. Memory store is globally used by all EAP Core objects. Key must be good that other users do not use others data. Add the real data type as a string to the key and other identifiers that separate data between the other users that store same data type to the memory store.

Parameters

const eap_variable_data_c *const key

multiply_u64(const u64_t, const u64_t)

EAP_FUNC_IMPORT u64_t multiply_u64 ( const u64_t a,
const u64_t b
) [virtual]

This function multiplys two 64-bit integers. Returned value is remainder of 2^64, so overflow is not detected.

Parameters

const u64_t a
const u64_t b

number_string_to_u32(const u8_t *const, const u32_t, u32_t *const)

EAP_FUNC_IMPORT eap_status_e number_string_to_u32 ( const u8_t *const number_string,
const u32_t number_string_length,
u32_t *const integer
) [virtual]

This function converts string to u32_t value.

Parameters

const u8_t *const number_string
const u32_t number_string_length
u32_t *const integer

octet_from_ascii_armor(const u8_t)

EAP_FUNC_IMPORT u8_t octet_from_ascii_armor ( const u8_t source_byte ) [private]

Parameters

const u8_t source_byte

octet_to_ascii(i32_t)

EAP_FUNC_IMPORT u8_t octet_to_ascii ( i32_t octet ) [virtual]

Function converts one octet to ascii character.

Parameters

i32_t octet is the converted octet.

octet_to_ascii_armor(const u8_t)

EAP_FUNC_IMPORT u8_t octet_to_ascii_armor ( const u8_t source_byte ) [private]

Parameters

const u8_t source_byte

parse_nai(const eap_variable_data_c *const, eap_variable_data_c *const, eap_variable_data_c *const)

EAP_FUNC_IMPORT eap_status_e parse_nai ( const eap_variable_data_c *const nai,
eap_variable_data_c *const username,
eap_variable_data_c *const realm
) [virtual]

Function parses NAI to usename and realm. If either is missing the corresponding value will be invalid.

Parameters

const eap_variable_data_c *const nai
eap_variable_data_c *const username
eap_variable_data_c *const realm

restore_bytes_from_ascii_armor(const u8_t *const, const u32_t, u8_t *const, u32_t *)

EAP_FUNC_IMPORT eap_status_e restore_bytes_from_ascii_armor ( const u8_t *const source_bytes,
const u32_t source_bytes_length,
u8_t *const target,
u32_t * target_length
) [virtual]

Function converts ascii armored bytes to bytes.

Parameters

const u8_t *const source_bytes is pointer to the source bytes.
const u32_t source_bytes_length is length of source bytes.
u8_t *const target is pointer to the target bytes.
u32_t * target_length is length of target bytes. 8-bit ascii values are converted to binary 6-bit blocks. Ascii values can easily represent 2^6=64 values. If length of source array is not module 3, missing bits are padded with zero bits. |0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | : : : : : : : | : : : : : : : | : : : : : : : | : : : : : : : |0:0:0:0| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0 1 2 3 4 5|0 1 2 3 4 5|0 1 2 3 4 5|0 1 2 3 4 5|0 1 2 3 4 5|0 1 2 3 4 5| | | | | | | + | | | | | | \ | | | | | + \ | | | | | \ \ | | | | + \ \ | | | | \ \ \ | | | + \ \ \ | | | \ \ \ \ | | + \ \ \ \ | | \ \ \ \ \ | + \ \ \ \ \ | \ \ \ \ \ \ | \ \ \ \ \ \ | + + + + + + | | | | | | | |0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | : : : : : : : | : : : : : : : | : : : : : : : | : : : : : : : | : : : : : : : | : : : : : : : | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

restore_selected_bytes_from_ascii_armor(const u8_t, u32_t *const, u8_t *const, u32_t *const, const bool)

EAP_FUNC_IMPORT void restore_selected_bytes_from_ascii_armor ( const u8_t source_byte,
u32_t *const missing_bit_count,
u8_t *const target,
u32_t *const output_ind,
const bool last_input_byte
) [private]

Parameters

const u8_t source_byte
u32_t *const missing_bit_count
u8_t *const target
u32_t *const output_ind
const bool last_input_byte

set_activate_trace_on_error()

EAP_FUNC_IMPORT void set_activate_trace_on_error ( ) [virtual]

This functions allows activation of trace when the error occurs. Look at the set_activate_trace_on_error() and eap_status_return() functions. NOTE the always active traces are only left active. That means set_activate_trace_on_error() function calls set_trace_mask(eap_trace_mask_always).

set_trace_mask(const u32_t)

EAP_FUNC_IMPORT void set_trace_mask ( const u32_t mask ) [virtual]

This function sets the current trace mask.

Parameters

const u32_t mask

set_use_timer_queue()

EAP_FUNC_IMPORT void set_use_timer_queue ( )

shutdown()

EAP_FUNC_IMPORT eap_status_e shutdown ( ) [pure virtual]

shutdown_am_tools()

EAP_FUNC_IMPORT eap_status_e shutdown_am_tools ( )

timer_thread_function()

EAP_FUNC_IMPORT eap_status_e timer_thread_function ( ) [virtual]

Function runs the timer thread loop. This function calls the pulse_timer() function to increase the elapsed time.

trace_configuration(const eap_status_e, const eap_configuration_field_c *const, const eap_variable_data_c *const)

EAP_FUNC_IMPORT void trace_configuration ( const eap_status_e configuration_read_status,
const eap_configuration_field_c *const field,
const eap_variable_data_c *const data
) [virtual]

This function traces read configure field and data.

Parameters

const eap_status_e configuration_read_status
const eap_configuration_field_c *const field
const eap_variable_data_c *const data

trace_data(eap_const_string, const void *const, const u32_t)

EAP_FUNC_IMPORT void trace_data ( eap_const_string prefix,
const void *const p_data,
const u32_t data_length
) [virtual]

The trace_data() function traces null terminated prefix string and data_length bytes from p_data to file. This is used in macros EAP_TRACE_DATA_DEBUG(object_name, _parameter_list_) and EAP_TRACE_DATA_ERROR(object_name, _parameter_list_).

Parameters

eap_const_string prefix
const void *const p_data
const u32_t data_length

xor_u64(const u64_t, const u64_t)

EAP_FUNC_IMPORT u64_t xor_u64 ( const u64_t a,
const u64_t b
) [virtual]

This function xors two 64-bit integers.

Parameters

const u64_t a
const u64_t b

Member Enumerations Documentation

Enum anonymous

Enumerators

eap_trace_mask_none = (0u)
eap_trace_mask_always = (1u << 0u)
eap_trace_mask_error = (1u << 1u)
eap_trace_mask_debug = (1u << 2u)
eap_trace_mask_functions = (1u << 3u)
eap_trace_mask_crypto = (1u << 4u)
eap_trace_mask_timer = (1u << 5u)
eap_trace_mask_eap_messages = (1u << 6u)
eap_trace_mask_test_vectors = (1u << 7u)
eap_trace_mask_crypto_sha1 = (1u << 8u)
eap_trace_mask_crypto_md4 = (1u << 9u)
eap_trace_mask_crypto_rc4 = (1u << 10u)
eap_trace_mask_crypto_test_random = (1u << 11u)
eap_trace_mask_message_data = (1u << 12u)
eap_trace_mask_hash_map = (1u << 13u)
eap_trace_mask_timer_queue = (1u << 14u)
eap_trace_mask_ok_returns = (1u << 15u)

Member Data Documentation

bool m_activate_trace_on_error

bool m_activate_trace_on_error [private]

This flag allows activation of trace when the error occurs. Look at the set_activate_trace_on_error() and eap_status_return() functions.

eap_am_memory_store_c * m_memory_store

eap_am_memory_store_c * m_memory_store [private]

bool m_shutdown_was_called

bool m_shutdown_was_called [private]

bool m_thread_stopped

bool m_thread_stopped [private]

u8_t m_tmp_ascii_buffer

u8_t m_tmp_ascii_buffer [private]

u8_t m_tmp_buffer

u8_t m_tmp_buffer [private]

u32_t m_trace_mask

u32_t m_trace_mask [private]

bool m_use_seconds_timestamp_in_traces

bool m_use_seconds_timestamp_in_traces [private]

bool m_use_timer_queue

bool m_use_timer_queue [private]