abs_eap_am_tools_c Class Reference

class abs_eap_am_tools_c

Current services are timer handling, crypto library, trace functions, memory manipulation and hardware tick counter. Use of eap_am_tools is through abstract virtual class abs_eap_am_tools. A pointer to the abs_eap_am_tools class is given to all other classes as a parameter to each constructor. Adaptation module creates the eap_am_tools_Y class before it initializes the stack. This prevents the need of global objects.

Public Member Functions
abs_eap_am_tools_c ()
~abs_eap_am_tools_c ()
eap_status_e am_cancel_all_timers ()
eap_status_e am_cancel_timer ( abs_eap_base_timer_c *const , const u32_t )
eap_status_e am_set_timer ( abs_eap_base_timer_c *const , const u32_t , void *const , const u32_t )
u8_t ascii_to_octet ( i32_t )
void check_activate_trace_on_error ()
i32_t compare_u64 (const u64_t , const u64_t )
u32_t config_strlen ( eap_config_string )
eap_status_e configure ()
eap_status_e convert_am_error_to_eapol_error (const i32_t )
eap_status_e convert_ascii_to_uppercase ( u8_t *const , const u32_t )
eap_status_e convert_bytes_to_ascii_armor (const u8_t *const , const u32_t , u8_t *const , u32_t *)
eap_status_e convert_bytes_to_hex_ascii (const u8_t *const , const u32_t , u8_t *const , u32_t *)
eap_status_e convert_bytes_to_hex_ascii (const void *const , const u32_t , eap_variable_data_c *const )
i32_t convert_eapol_error_to_am_error ( eap_status_e )
eap_status_e convert_hex_ascii_to_bytes (const u8_t *const , const u32_t , u8_t *const , u32_t *)
eap_status_e convert_hex_ascii_to_bytes (const void *const , const u32_t , eap_variable_data_c *const )
eap_status_e convert_unicode_to_utf8 ( eap_variable_data_c &, const eap_variable_data_c &)
eap_status_e convert_utf8_to_unicode ( eap_variable_data_c &, const eap_variable_data_c &)
eap_status_e create_uuid_v5 (const void *const , const u32_t , const void *const , const u32_t , eap_variable_data_c *const )
eap_status_e create_uuid_v5_from_mac_address (const u8_t *const , const u32_t , eap_variable_data_c *const )
EAP_FUNC_IMPORT_INTERFACE void delete_abs_eap_am_tools_c ( abs_eap_am_tools_c *const )
eap_status_e eap_status_return (const bool, const eap_status_e , const eap_char *const , const i32_t )
eap_status_e eap_status_return_file_number (const bool, const eap_status_e , const u32_t , const u32_t , const i32_t )
void enter_global_mutex ()
void formatted_print ( eap_format_string , ...)
u64_t get_clock_ticks ()
u64_t get_clock_ticks_of_second ()
abs_eap_am_crypto_c * get_crypto ()
abs_eap_am_mutex_c * get_global_mutex ()
u32_t get_gmt_unix_time ()
u64_t get_hardware_ticks ()
u64_t get_hardware_ticks_of_second ()
bool get_is_timer_thread_active ()
bool get_is_valid ()
bool get_thread_stopped ()
bool get_timer_queue_is_empty ()
u32_t get_timer_resolution_ms ()
u32_t get_trace_mask ()
bool get_use_eap_milli_second_timer ()
bool get_use_timer_queue ()
eap_status_e getenv (const eap_variable_data_c *const , eap_variable_data_c *const )
bool isspace (const u8_t )
void leave_global_mutex ()
void * memchr (const void *, u8_t , u32_t )
i32_t memcmp (const void *const , const void *const , const u32_t )
void memmove (void *, const void *, const u32_t )
eap_status_e memory_store_add_data (const eap_variable_data_c *const , eap_tlv_message_data_c *const , const u32_t )
eap_status_e memory_store_get_data (const eap_variable_data_c *const , eap_tlv_message_data_c *const )
eap_status_e memory_store_remove_data (const eap_variable_data_c *const )
void * memrchr (const void *, u8_t , u32_t )
void memset (void *const , const i32_t , const u32_t )
u64_t multiply_u64 (const u64_t , const u64_t )
EAP_FUNC_IMPORT_INTERFACE abs_eap_am_tools_c * new_abs_eap_am_tools_c ()
eap_status_e number_string_to_u32 (const u8_t *const , const u32_t , u32_t *const )
u8_t octet_to_ascii ( i32_t )
eap_status_e parse_nai (const eap_variable_data_c *const , eap_variable_data_c *const , eap_variable_data_c *const )
u32_t pulse_timer (const u32_t )
eap_status_e re_activate_timer_queue ()
eap_status_e restore_bytes_from_ascii_armor (const u8_t *const , const u32_t , u8_t *const , u32_t *)
void set_activate_trace_on_error ()
void set_max_trace_file_size (const u32_t )
void set_timer_resolution_ms (const u32_t )
eap_status_e set_trace_file_name (const eap_variable_data_c *const )
void set_trace_mask (const u32_t )
void set_use_eap_milli_second_timer (const bool)
eap_status_e shutdown ()
void sleep ( u32_t )
u32_t snprintf ( u8_t *const , u32_t , eap_format_string , ...)
eap_status_e start_timer_thread ()
eap_status_e stop_timer_thread ()
u32_t strlen ( eap_const_string )
void timer_sleep ( u32_t )
eap_status_e timer_thread_function ()
void trace_configuration (const eap_status_e , const eap_configuration_field_c *const , const eap_variable_data_c *const )
void trace_data ( eap_const_string , const void *const , const u32_t )
u64_t u64_struct_to_u64_t (const u64_struct )
u64_struct u64_t_to_u64_struct (const u64_t )
u64_t xor_u64 (const u64_t , const u64_t )

Constructor & Destructor Documentation

abs_eap_am_tools_c()

abs_eap_am_tools_c ( ) [inline]

The constructor of the abs_eap_am_tools_c does nothing special.

~abs_eap_am_tools_c()

~abs_eap_am_tools_c ( ) [inline, virtual]

The destructor of the abs_eap_am_tools_c class does nothing special.

Member Functions Documentation

am_cancel_all_timers()

eap_status_e am_cancel_all_timers ( ) [pure virtual]

The cancel_all_timers() function cancels all timers. User should use this in termination of the stack before the adaptation module of tools is deleted.

Adaptation module of tools includes internal attribute eap_timer_queue_c to which this call is directed.

This function de-activated timer queue. You could re-activate timer queue with re_activate_timer_queue function.

am_cancel_timer(abs_eap_base_timer_c *const, const u32_t)

eap_status_e am_cancel_timer ( abs_eap_base_timer_c *const initializer,
const u32_t id
) [pure virtual]

The cancel_timer() function cancels the timer id initiated by initializer.

Adaptation module of tools includes internal attribute eap_timer_queue_c to which this call is directed.

Parameters

abs_eap_base_timer_c *const initializer
const u32_t id

am_set_timer(abs_eap_base_timer_c *const, const u32_t, void *const, const u32_t)

eap_status_e am_set_timer ( abs_eap_base_timer_c *const initializer,
const u32_t id,
void *const data,
const u32_t p_time_ms
) [pure virtual]

The set_timer() function initializes timer to be elapsed after p_time_ms milliseconds. Adaptation module of tools includes internal attribute eap_timer_queue_c to which this call is directed.

Parameters

abs_eap_base_timer_c *const initializer is pointer to object which timer_expired() function will be called after timer elapses.
const u32_t id is identifier which will be returned in timer_expired() function. The user selects and interprets the id for this timer.
void *const data is pointer to any user selected data which will be returned in timer_expired() function.
const u32_t p_time_ms

ascii_to_octet(i32_t)

u8_t ascii_to_octet ( i32_t character ) [pure virtual]

Function converts one ascii character to octet.

Parameters

i32_t character is the converted ascii character.

check_activate_trace_on_error()

void check_activate_trace_on_error ( ) [pure virtual]

compare_u64(const u64_t, const u64_t)

i32_t compare_u64 ( const u64_t a,
const u64_t b
) [pure 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

config_strlen(eap_config_string)

u32_t config_strlen ( eap_config_string string ) [pure virtual]

Get the length of a string.

Parameters

eap_config_string string

configure()

eap_status_e configure ( ) [pure virtual]

The configure() function is called after the constructor of the object is successfully executed. During the function call the object could query the configuration. Each derived class must define this function. Needed configuration depends on the implementation.

convert_am_error_to_eapol_error(const i32_t)

eap_status_e convert_am_error_to_eapol_error ( const i32_t am_error_value ) [pure virtual]

Function converts AM error value to eap_status_e.

Parameters

const i32_t am_error_value is the AM error value.

convert_ascii_to_uppercase(u8_t *const, const u32_t)

eap_status_e convert_ascii_to_uppercase ( u8_t *const source_bytes,
const u32_t source_bytes_length
) [pure 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_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
) [pure 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_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
) [pure 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_status_e convert_bytes_to_hex_ascii ( const void *const source_bytes,
const u32_t source_bytes_length,
eap_variable_data_c *const target
) [pure 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_eapol_error_to_am_error(eap_status_e)

i32_t convert_eapol_error_to_am_error ( eap_status_e eap_error ) [pure virtual]

Function converts eap_status_e to AM error value.

Parameters

eap_status_e eap_error is the eap_status_e error value.

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

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
) [pure 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_status_e convert_hex_ascii_to_bytes ( const void *const source_bytes,
const u32_t source_bytes_length,
eap_variable_data_c *const target
) [pure 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_unicode_to_utf8(eap_variable_data_c &, const eap_variable_data_c &)

eap_status_e convert_unicode_to_utf8 ( eap_variable_data_c & dest,
const eap_variable_data_c & src
) [pure virtual]

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.

convert_utf8_to_unicode(eap_variable_data_c &, const eap_variable_data_c &)

eap_status_e convert_utf8_to_unicode ( eap_variable_data_c & dest,
const eap_variable_data_c & src
) [pure virtual]

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.

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

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
) [pure 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_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
) [pure 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.

delete_abs_eap_am_tools_c(abs_eap_am_tools_c *const)

EAP_FUNC_IMPORT_INTERFACE void delete_abs_eap_am_tools_c ( abs_eap_am_tools_c *const am_tools ) [static]

This function deletes platform specific tools object. Note this function calls also shutdown() of the allocated tools object. The platform specific module must implement this function.

Parameters

abs_eap_am_tools_c *const am_tools

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

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
) [pure 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_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
) [pure 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

enter_global_mutex()

void enter_global_mutex ( ) [pure virtual]

This function enters the global mutex. Mutex is needed to synchronize the timer thread and stack call operations. Timer pulse is run parallel to the stack operation. This causes the use of global mutex.

formatted_print(eap_format_string, ...)

void formatted_print ( eap_format_string format,
...
) [pure virtual]

The formatted_print() function traces format string and formatted parameters to file. File is set as a parameter to constructor. This is used in macros EAP_TRACE_DEBUG(object_name, _parameter_list_) and EAP_TRACE_ERROR(object_name, _parameter_list_).

Parameters

eap_format_string format
...

get_clock_ticks()

u64_t get_clock_ticks ( ) [pure virtual]

Function returns current value of clock ticks counter.

get_clock_ticks_of_second()

u64_t get_clock_ticks_of_second ( ) [pure virtual]

Function returns count of clock ticks in one second.

get_crypto()

abs_eap_am_crypto_c * get_crypto ( ) [pure virtual]

The get_crypto() function returns a pointer to object of type eap_am_crypto.

get_global_mutex()

abs_eap_am_mutex_c * get_global_mutex ( ) [pure virtual]

Returns the global mutex. This is used in some assertion tests.

get_gmt_unix_time()

u32_t get_gmt_unix_time ( ) [pure virtual]

This function returns the current time and date in standard UNIX 32-bit format (seconds since the midnight starting Jan 1, 1970, GMT) according to the sender's internal clock.

get_hardware_ticks()

u64_t get_hardware_ticks ( ) [pure virtual]

The get_hardware_ticks() function returns current value of hardware ticks counter.

get_hardware_ticks_of_second()

u64_t get_hardware_ticks_of_second ( ) [pure virtual]

Function returns count of hardware ticks in one second.

get_is_timer_thread_active()

bool get_is_timer_thread_active ( ) [pure virtual]

Returns the value of timer thread activity. Timer thread stops when this functions returns false.

get_is_valid()

bool get_is_valid ( ) const [pure virtual]

The get_is_valid() function returns the status of the object. True indicates the object is initialized succesfully.

get_thread_stopped()

bool get_thread_stopped ( ) [pure virtual]

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

get_timer_queue_is_empty()

bool get_timer_queue_is_empty ( ) [pure virtual]

This function checks whether the internal timer queue is empty.

get_timer_resolution_ms()

u32_t get_timer_resolution_ms ( ) [pure virtual]

This function returns the resolution of the timer. Each pulse increases time by this value.

Adaptation module of tools includes internal attribute eap_timer_queue_c to which this call is directed.

get_trace_mask()

u32_t get_trace_mask ( ) const [pure virtual]

Gets the current trace mask.

get_use_eap_milli_second_timer()

bool get_use_eap_milli_second_timer ( ) [pure virtual]

This function returns true when milli second timer is used.

get_use_timer_queue()

bool get_use_timer_queue ( ) [pure virtual]

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

getenv(const eap_variable_data_c *const, eap_variable_data_c *const)

eap_status_e getenv ( const eap_variable_data_c *const environment_variable_name,
eap_variable_data_c *const environment_variable_value
) [pure virtual]

This function reads value of environment variable. Note the all environments does not support this, for example Symbian.

Parameters

const eap_variable_data_c *const environment_variable_name
eap_variable_data_c *const environment_variable_value

isspace(const u8_t)

bool isspace ( const u8_t character ) [pure virtual]

This function checks whether the character is space.

Parameters

const u8_t character

leave_global_mutex()

void leave_global_mutex ( ) [pure virtual]

This function leaves the global mutex. Timer pulse is run parallel to the stack operation. This causes the use of global mutex.

memchr(const void *, u8_t, u32_t)

void * memchr ( const void * buf,
u8_t character,
u32_t count
) [pure virtual]

The memchr function searches the first occurence of character starting from buf. Maximum count bytes are searched.

Parameters

const void * buf
u8_t character
u32_t count

memcmp(const void *const, const void *const, const u32_t)

i32_t memcmp ( const void *const buf1,
const void *const buf2,
const u32_t count
) [pure virtual]

The memcmp() function compares count bytes from buf1 and buf2.

Parameters

const void *const buf1
const void *const buf2
const u32_t count

memmove(void *, const void *, const u32_t)

void memmove ( void * dest,
const void * src,
const u32_t count
) [pure virtual]

The memmove() function copies count bytes from src to dest. The implementation must handle overlapping memory areas correctly. Check always the destination is correct memory. This function is low level and cannot check the used memory.

Parameters

void * dest is pointer to the destination.
const void * src is pointer to the source.
const u32_t count indicates the count of copied bytes.

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

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
) [pure 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_status_e memory_store_get_data ( const eap_variable_data_c *const key,
eap_tlv_message_data_c *const data
) [pure 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_status_e memory_store_remove_data ( const eap_variable_data_c *const key ) [pure 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

memrchr(const void *, u8_t, u32_t)

void * memrchr ( const void * buf,
u8_t character,
u32_t count
) [pure virtual]

The memchr function searches the last occurence of character starting from the enf of the buf. Maximum count bytes are searched.

Parameters

const void * buf
u8_t character
u32_t count

memset(void *const, const i32_t, const u32_t)

void memset ( void *const dest,
const i32_t fill_byte,
const u32_t count
) [pure virtual]

The memset function sets the first count bytes of dest to the character fill_byte. Check always the destination is correct memory. This function is low level and cannot check the used memory.

Parameters

void *const dest is pointer to the destination.
const i32_t fill_byte is the fill value.
const u32_t count indicates the count of set bytes.

multiply_u64(const u64_t, const u64_t)

u64_t multiply_u64 ( const u64_t a,
const u64_t b
) [pure 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

new_abs_eap_am_tools_c()

EAP_FUNC_IMPORT_INTERFACE abs_eap_am_tools_c * new_abs_eap_am_tools_c ( ) [static]

This function allocates platform specific tools object. Note this function calls also configure() of the allocated tools object. The platform specific module must implement this function.

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

eap_status_e number_string_to_u32 ( const u8_t *const number_string,
const u32_t number_string_length,
u32_t *const integer
) [pure 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_to_ascii(i32_t)

u8_t octet_to_ascii ( i32_t octet ) [pure virtual]

Function converts one octet to ascii character.

Parameters

i32_t octet is the converted octet.

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

eap_status_e parse_nai ( const eap_variable_data_c *const nai,
eap_variable_data_c *const username,
eap_variable_data_c *const realm
) [pure 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

pulse_timer(const u32_t)

u32_t pulse_timer ( const u32_t elapsed_time_in_ms ) [pure virtual]

Pulses timer. Time is increased by get_timer_resolution_ms() milli seconds. Timer pulse is run parallel to the stack operation. This causes the use of global mutex.

Adaptation module of tools includes internal attribute eap_timer_queue_c to which this call is directed. Function returns the next sleep time in milli seconds.

Parameters

const u32_t elapsed_time_in_ms

re_activate_timer_queue()

eap_status_e re_activate_timer_queue ( ) [pure virtual]

This function re-activates timer queue. Symbian AM call this function when AM-tools object is re-used. This can be called after am_cancel_all_timers() function. am_cancel_all_timers() function de-activated timer queue.

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

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
) [pure 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| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | : : : : : : : | : : : : : : : | : : : : : : : | : : : : : : : | : : : : : : : | : : : : : : : | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

set_activate_trace_on_error()

void set_activate_trace_on_error ( ) [pure 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_max_trace_file_size(const u32_t)

void set_max_trace_file_size ( const u32_t max_trace_file_size ) [pure virtual]

This function sets the maximum size of trace output file in bytes. Note this is not absolute value. New file is generated when size of trace log file exceeds this limitation.

Parameters

const u32_t max_trace_file_size

set_timer_resolution_ms(const u32_t)

void set_timer_resolution_ms ( const u32_t timer_resolution_ms ) [pure virtual]

This function sets the resolution of the timer. The default value is EAP_TIMER_RESOLUTION. Each pulse increases time by this value.

Adaptation module of tools includes internal attribute eap_timer_queue_c to which this call is directed.

Parameters

const u32_t timer_resolution_ms

set_trace_file_name(const eap_variable_data_c *const)

eap_status_e set_trace_file_name ( const eap_variable_data_c *const trace_output_file ) [pure virtual]

This function sets the trace output file name.

Parameters

const eap_variable_data_c *const trace_output_file

set_trace_mask(const u32_t)

void set_trace_mask ( const u32_t mask ) [pure virtual]

This function sets the current trace mask.

Parameters

const u32_t mask

set_use_eap_milli_second_timer(const bool)

void set_use_eap_milli_second_timer ( const bool use_eap_millisecond_timer ) [pure virtual]

This function sets the flag whether to use milli second timer (true) or not (false).

Parameters

const bool use_eap_millisecond_timer

shutdown()

eap_status_e shutdown ( ) [pure virtual]

The shutdown() function is called before the destructor of the object is executed. During the function call the object could shutdown the operations, for example cancel timers. Each derived class must define this function.

sleep(u32_t)

void sleep ( u32_t milli_seconds ) [pure virtual]

The sleep function suspends the execution of the current thread for the specified interval.

Parameters

u32_t milli_seconds is the suspension time in milli seconds.

snprintf(u8_t *const, u32_t, eap_format_string, ...)

u32_t snprintf ( u8_t *const buffer,
u32_t buffer_size,
eap_format_string format,
...
) [pure virtual]

This function formats string to buffer. Function returns number of written bytes.

Parameters

u8_t *const buffer
u32_t buffer_size
eap_format_string format
...

start_timer_thread()

eap_status_e start_timer_thread ( ) [pure virtual]

Starts the thread to pulse timer. User of tools should call this after the stack is created.

stop_timer_thread()

eap_status_e stop_timer_thread ( ) [pure virtual]

Stops the timer thread. User of tools should call this before the stack is deleted.

strlen(eap_const_string)

u32_t strlen ( eap_const_string string ) [pure virtual]

Get the length of a string.

Parameters

eap_const_string string

timer_sleep(u32_t)

void timer_sleep ( u32_t milli_seconds ) [pure virtual]

The timer_sleep function suspends the execution of the current timer thread for the specified interval. Timer could be set any value. When timer is set to shorter timeout than the smallest current timeout is the timer_sleep() will cancel sleep and the new sleep time could be calculated.

Parameters

u32_t milli_seconds is the suspension time in milli seconds.

timer_thread_function()

eap_status_e timer_thread_function ( ) [pure 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)

void trace_configuration ( const eap_status_e configuration_read_status,
const eap_configuration_field_c *const field,
const eap_variable_data_c *const data
) [pure 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)

void trace_data ( eap_const_string prefix,
const void *const p_data,
const u32_t data_length
) [pure 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

u64_struct_to_u64_t(const u64_struct)

u64_t u64_struct_to_u64_t ( const u64_struct value ) [pure virtual]

This function converts u64_struct to u64_t type. This is used in some 64-bit calculations.

Parameters

const u64_struct value

u64_t_to_u64_struct(const u64_t)

u64_struct u64_t_to_u64_struct ( const u64_t value ) [pure virtual]

This function converts u64_t to u64_struct type. This is used in some 64-bit calculations.

Parameters

const u64_t value

xor_u64(const u64_t, const u64_t)

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

This function xors two 64-bit integers.

Parameters

const u64_t a
const u64_t b