abs_eap_base_type_c Class Reference

class abs_eap_base_type_c

The class is the interface to partner class of the eap_base_type class. This declares the pure virtual member functions EAP-type class could call.

Public Member Functions
abs_eap_base_type_c()
~abs_eap_base_type_c()
eap_status_e add_rogue_ap(eap_array_c< eap_rogue_ap_entry_c > &)
eap_status_e cancel_all_timers()
eap_status_e cancel_timer(abs_eap_base_timer_c *const , const u32_t)
eap_status_e check_is_valid_eap_type(const eap_type_value_e)
eap_status_e complete_eap_identity_query(const eap_am_network_id_c *const , const eap_variable_data_c *const , const u8_t)
eap_status_e get_eap_type_list(eap_array_c< eap_type_value_e > *const )
u32_t get_header_offset(u32_t *const , u32_t *const )
boolget_is_tunneled_eap()
eap_status_e get_saved_eap_identity(eap_variable_data_c *const )
eap_status_e load_module(const eap_type_value_e, const , abs_eap_base_type_c *const , eap_base_type_c **const , const bool, const eap_am_network_id_c *const )
eap_status_e packet_data_crypto_keys(const eap_am_network_id_c *const , const eap_master_session_key_c *const )
eap_status_e packet_send(const eap_am_network_id_c *const , eap_buf_chain_wr_c *const , const u32_t, const u32_t, const u32_t)
eap_status_e read_configure(const eap_configuration_field_c *const , eap_variable_data_c *const )
eap_status_e restart_authentication(const eap_am_network_id_c *const , const bool)
eap_status_e set_authentication_role(const bool)
eap_status_e set_session_timeout(const u32_t)
eap_status_e set_timer(abs_eap_base_timer_c *const , const u32_t, void *const , const u32_t)
voidstate_notification(const abs_eap_state_notification_c *const )
eap_status_e unload_module(const eap_type_value_e)
eap_status_e write_configure(const eap_configuration_field_c *const , eap_variable_data_c *const )

Constructor & Destructor Documentation

abs_eap_base_type_c()

abs_eap_base_type_c()[inline]

The constructor of the abs_eap_base_type_c class does nothing special.

~abs_eap_base_type_c()

~abs_eap_base_type_c()[inline, virtual]

The destructor of the abs_eap_base_type_c class does nothing special.

Member Functions Documentation

add_rogue_ap(eap_array_c< eap_rogue_ap_entry_c > &)

eap_status_e add_rogue_ap(eap_array_c< eap_rogue_ap_entry_c > &rogue_ap_list)[pure virtual]

Parameters

eap_array_c< eap_rogue_ap_entry_c > & rogue_ap_list

cancel_all_timers()

eap_status_e 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. Preferred mode is to cancel each timer directly using cancel_timer() function.

Adaptation module internally implements the timer.

cancel_timer(abs_eap_base_timer_c *const, const u32_t)

eap_status_e cancel_timer(abs_eap_base_timer_c *const initializer,
const u32_tid
)[pure virtual]

The cancel_timer() function cancels the timer id initiated by initializer. Adaptation module internally implements the timer.

Parameters

abs_eap_base_timer_c *const initializeris pointer to object which set the cancelled timer.
const u32_t idis identifier which will be returned in timer_expired() function. The user selects and interprets the id for this timer.

check_is_valid_eap_type(const eap_type_value_e)

eap_status_e check_is_valid_eap_type(const eap_type_value_eeap_type)[pure virtual]

This is needed by PEAP type. This function queries the validity of EAP-type. Lower layer should return eap_status_ok if this EAP-type is supported.

Parameters

const eap_type_value_e eap_typeis the requested EAP-type.

complete_eap_identity_query(const eap_am_network_id_c *const, const eap_variable_data_c *const, const u8_t)

eap_status_e complete_eap_identity_query(const eap_am_network_id_c *const send_network_id,
const eap_variable_data_c *const identity,
const u8_teap_identifier
)[pure virtual]

Client object of EAP-type calls this function. This function completes asyncronously query_eap_identity() function call.

Parameters

const eap_am_network_id_c *const send_network_idis network identity of target.
const eap_variable_data_c *const identityis pointer to object that includes the identity.
const u8_t eap_identifieris EAP-Identifier for EAP-Response/Identity packet.

get_eap_type_list(eap_array_c< eap_type_value_e > *const)

eap_status_e get_eap_type_list(eap_array_c< eap_type_value_e > *const eap_type_list)[pure virtual]

This function queries the list of supported EAP-types. Lower layer should return eap_status_ok if this call succeeds.

Parameters

eap_array_c< eap_type_value_e > *const eap_type_listwill include the list of supported EAP-types. Each value in list is type of u32_t and represent one supported EAP-type. List consists of subsequent u32_t type values.

get_header_offset(u32_t *const, u32_t *const)

u32_t get_header_offset(u32_t *const MTU_length,
u32_t *const trailer_length
)[pure virtual]

The get_header_offset() function obtains the header offset of EAP-packet. The needed buffer length is ((offset) + (EAP-packet length) + (trailer)) bytes. Each layer adds the length of the header to offset. Each layer removes the length of the header and trailer from MTU.

Now some ascii graphics follows.
 |<-------------------------buffer length----------------------------------------->|
 |                                                                                 |
 |                     +-----+---------------------------------------+             |
 |                     | EAP |  data                                 |             |
 |                     +-----+---------------------------------------+             |
 |<----offset--------->|<----MTU------------------------------------>|<--trailer-->|
 |                     |                                             |             |
 |             +-------+---------------------------------------------+             |
 |             | EAPOL |  data                                       |             |
 |             +-------+---------------------------------------------+             |
 |<--offset--->|<----MTU-------------------------------------------->|<--trailer-->|
 |             |                                                     |             |
 +-------------+-----------------------------------------------------+-------------+
 |  ETHERNET   |  data                                               |  trailer    |
 +-------------+-----------------------------------------------------+-------------+
 |<----MTU------------------------------------------------------------------------>|

Parameters

u32_t *const MTU_lengthis pointer to variable to store the maximum transfer unit (MTU). MTU is the maximum EAP-packet length in bytes
u32_t *const trailer_lengthis pointer to the variable to store length of trailer needed by lower levels.

get_is_tunneled_eap()

boolget_is_tunneled_eap()const [pure virtual]

get_saved_eap_identity(eap_variable_data_c *const)

eap_status_e get_saved_eap_identity(eap_variable_data_c *const identity)[pure virtual]

Client object of EAP-type calls this function. This function gets the EAP-identity queried from previous EAP-type.

First EAP-type A is default. The eap_core_c object queries EAP-identity from EAP-type A. Server process EAP-Response/Identity but there the default EAP-type is B. Server sends EAP-Request/B. Client loads new EAP-type B and forwards EAP-Request/B to it. EAP-Request/B is the first EAP-packet EAP-type B receive. It must continue using the EAP-identity obtained with EAP-type A. Now EAP-type B could get the EAP-identity obtained with EAP-type A with this function.

Parameters

eap_variable_data_c *const identity

load_module(const eap_type_value_e, const, abs_eap_base_type_c *const, eap_base_type_c **const, const bool, const eap_am_network_id_c *const)

eap_status_e load_module(const eap_type_value_etype,
const eap_type_value_e,
abs_eap_base_type_c *const partner,
eap_base_type_c **const eap_type,
const boolis_client_when_true,
const eap_am_network_id_c *const receive_network_id
)[pure virtual]

This is needed by PEAP type. The load_module() function function indicates the lower level to load new module of EAP-type.

Parameters

const eap_type_value_e typeis the requested EAP-type.
const eap_type_value_e
abs_eap_base_type_c *const partneris pointer to the caller object. The partner of the new created EAP-type object is the caller object.
eap_base_type_c **const eap_typeis a pointer to a pointer of EAP-type object. Adaptation module sets eap_type pointer to created EAP-type object.
const bool is_client_when_trueparameter indicates whether the network entity should act as a client (true) or server (false), in terms of EAP-protocol whether this network entity is EAP-supplicant (true) or EAP-authenticator (false).
const eap_am_network_id_c *const receive_network_idincludes the addresses (network identity) and packet type.

packet_data_crypto_keys(const eap_am_network_id_c *const, const eap_master_session_key_c *const)

eap_status_e packet_data_crypto_keys(const eap_am_network_id_c *const send_network_id,
const eap_master_session_key_c *const master_session_key
)[pure virtual]

Note this function is just an example. Parameters will change later. The packet_data_crypto_keys() function gives the generated keys to lower level. After EAP-authentication has generated the keys it calls this function to offer the keys to lower level.

Parameters

const eap_am_network_id_c *const send_network_id
const eap_master_session_key_c *const master_session_keyis pointer to the first byte of the master session key.

packet_send(const eap_am_network_id_c *const, eap_buf_chain_wr_c *const, const u32_t, const u32_t, const u32_t)

eap_status_e packet_send(const eap_am_network_id_c *const network_id,
eap_buf_chain_wr_c *const sent_packet,
const u32_theader_offset,
const u32_tdata_length,
const u32_tbuffer_length
)[pure virtual]
The derived class could send packets to partner class with this function. Now some ascii graphics follows.
 +---------------------+-----+---------------------------------------+-------------+
 |                     | EAP |  data                                 |             |
 +---------------------+-----+---------------------------------------+-------------+
 |                     |                                             |             |
 |<---header_offset--->|<-------------data_length------------------->|<--trailer-->|
 |                                                                                 |
 |<------------------------buffer_length------------------------------------------>|

 trailer is the free space in the end of the packet buffer.

Parameters

const eap_am_network_id_c *const network_idcarries the addresses (network identity) and type of the packet.
eap_buf_chain_wr_c *const sent_packetincludes the buffer for the whole packet and initialized EAP-packet in correct offset.
const u32_t header_offsetis offset of the EAP-header within the sent_packet.
const u32_t data_lengthis length in bytes of the EAP-packet.
const u32_t buffer_lengthis length in bytes of the whole packet buffer.

read_configure(const eap_configuration_field_c *const, eap_variable_data_c *const)

eap_status_e read_configure(const eap_configuration_field_c *const field,
eap_variable_data_c *const data
)[pure virtual]

The read_configure() function reads the configuration data identified by the field string of field_length bytes length. Adaptation module must direct the query to some persistent store. EAP-type should store it's parameters to an own database. The own database should be accessed through adaptation module of EAP-type. See eap_am_type_gsmsim_simulator_c::type_configure_read.

Parameters

const eap_configuration_field_c *const fieldis generic configure string idenfying the required configure data.
eap_variable_data_c *const datais pointer to existing eap_variable_data object.

restart_authentication(const eap_am_network_id_c *const, const bool)

eap_status_e restart_authentication(const eap_am_network_id_c *const send_network_id,
const boolis_client_when_true
)[pure virtual]

This function restarts authentication to send_network_id.

Parameters

const eap_am_network_id_c *const send_network_idis network identity of target.
const bool is_client_when_trueindicates whether this object should act as a client (true) or server (false), in terms of EAP-protocol whether this network entity is EAP-supplicant (true) or EAP-authenticator (false).

set_authentication_role(const bool)

eap_status_e set_authentication_role(const boolwhen_true_set_client)[pure virtual]

Parameters

const bool when_true_set_client

set_session_timeout(const u32_t)

eap_status_e set_session_timeout(const u32_tsession_timeout_ms)[pure virtual]

The set_session_timeout() function changes the session timeout timer to be elapsed after session_timeout_ms milliseconds.

Parameters

const u32_t session_timeout_ms

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

eap_status_e set_timer(abs_eap_base_timer_c *const initializer,
const u32_tid,
void *const data,
const u32_ttime_ms
)[pure virtual]

The set_timer() function initializes timer to be elapsed after time_ms milliseconds. Adaptation module internally implements the timer.

Parameters

abs_eap_base_timer_c *const initializeris pointer to object which timer_expired() function will be called after timer elapses.
const u32_t idis identifier which will be returned in timer_expired() function. The user selects and interprets the id for this timer.
void *const datais pointer to any user selected data which will be returned in timer_expired() function.
const u32_t time_msis the time of timer in milli seconds.

state_notification(const abs_eap_state_notification_c *const)

voidstate_notification(const abs_eap_state_notification_c *const state)[pure virtual]

This is notification of internal state transition. This is used for notifications, debugging and protocol testing. The primal notifications are eap_state_variable_e::eap_state_authentication_finished_successfully and eap_state_variable_e::eap_state_authentication_terminated_unsuccessfully. EAP-type MUST send these two notifications to lower layer. These two notifications are sent using EAP-protocol layer (eap_protocol_layer_e::eap_protocol_layer_eap). See also eap_state_notification_c.

Parameters

const abs_eap_state_notification_c *const state

unload_module(const eap_type_value_e)

eap_status_e unload_module(const eap_type_value_eeap_type)[pure virtual]

This is needed by PEAP type. The unload_module() function unloads the module of a EAP-type.

Parameters

const eap_type_value_e eap_typeis the requested EAP-type.

write_configure(const eap_configuration_field_c *const, eap_variable_data_c *const)

eap_status_e write_configure(const eap_configuration_field_c *const field,
eap_variable_data_c *const data
)[pure virtual]

The write_configure() function writes the configuration data identified by the field string of field_length bytes length. Adaptation module must direct the action to some persistent store. EAP-type should store it's parameters to an own database. The own database should be accessed through adaptation module of EAP-type. See eap_am_type_gsmsim_simulator_c::type_configure_write.

Parameters

const eap_configuration_field_c *const fieldis generic configure string idenfying the required configure data.
eap_variable_data_c *const datais pointer to existing eap_variable_data object.