eapol/eapol_framework/eapol_common/am/include/eap_am_type_simple_config.h
changeset 0 c8830336c852
child 2 1c7bc153c08e
equal deleted inserted replaced
-1:000000000000 0:c8830336c852
       
     1 /*
       
     2 * Copyright (c) 2001-2006 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:  EAP and WLAN authentication protocols.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #if !defined(_EAP_AM_TYPE_SIMPLE_CONFIG_H_)
       
    22 #define _EAP_AM_TYPE_SIMPLE_CONFIG_H_
       
    23 
       
    24 #include "eap_tools.h"
       
    25 #include "eap_variable_data.h"
       
    26 #include "eap_header.h"
       
    27 #include "eap_am_export.h"
       
    28 #include "abs_eap_am_type_simple_config.h"
       
    29 #include "eap_am_network_id.h"
       
    30 #include "simple_config_am_services.h"
       
    31 
       
    32 class abs_eap_base_type_c;
       
    33 class eap_base_type_c;
       
    34 class abs_eap_am_type_simple_config_c;
       
    35 class abs_eap_configuration_if_c;
       
    36 
       
    37 /// This class is interface to adaptation module of EAP/SIMPLE_CONFIG.
       
    38 class EAP_EXPORT eap_am_type_simple_config_c
       
    39 : public simple_config_am_services_c
       
    40 {	
       
    41 private:
       
    42 	//--------------------------------------------------
       
    43 
       
    44 	/** Function returns partner object of adaptation module of EAP-SIMPLE_CONFIG.
       
    45 	 *  Partner object is the EAP-SIMPLE_CONFIG object.
       
    46 	 */
       
    47 	virtual abs_eap_am_type_simple_config_c * get_am_partner() = 0;
       
    48 
       
    49 	//--------------------------------------------------
       
    50 protected:
       
    51 	//--------------------------------------------------
       
    52 
       
    53 	//--------------------------------------------------
       
    54 public:
       
    55 	//--------------------------------------------------
       
    56 
       
    57 	virtual ~eap_am_type_simple_config_c()
       
    58 	{
       
    59 	}
       
    60 
       
    61 	/** Function sets partner object of adaptation module of EAP-SIMPLE_CONFIG.
       
    62 	 *  Partner object is the EAP-SIMPLE_CONFIG object.
       
    63 	 */
       
    64 	virtual void set_am_partner(abs_eap_am_type_simple_config_c * const partner) = 0;
       
    65 
       
    66 	virtual eap_status_e configure() = 0;
       
    67 
       
    68 	/**
       
    69 	 * The shutdown() function is called before the destructor of the 
       
    70 	 * object is executed. During the function call the object 
       
    71 	 * could shutdown the operations, for example cancel timers.
       
    72 	 * Each derived class must define this function.
       
    73 	 */
       
    74 	virtual eap_status_e shutdown() = 0;
       
    75 
       
    76 	virtual bool get_is_valid() = 0;
       
    77 
       
    78 	/** Client calls this function.
       
    79 	 *  EAP-SIMPLE_CONFIG AM could do finishing operations to databases etc. based on authentication status and type.
       
    80 	 */
       
    81 	virtual eap_status_e reset() = 0;
       
    82 
       
    83 	/** Client calls this function.
       
    84 	 *  EAP-SIMPLE_CONFIG AM could make some fast operations here, heavy operations should be done in the reset() function.
       
    85 	 */
       
    86 	virtual eap_status_e authentication_finished(
       
    87 		const bool true_when_successfull,
       
    88 		const bool true_when_session_resumed) = 0;
       
    89 
       
    90 	/** Client calls this function.
       
    91 	 *  AM must copy identity to output parameters if call is syncronous.
       
    92 	 *  This function could be completed asyncronously with abs_eap_am_type_simple_config_c::complete_query_eap_identity_query() function call.
       
    93 	 */
       
    94 	virtual eap_status_e query_eap_identity(
       
    95 		const eap_am_network_id_c * const receive_network_id,
       
    96 		const u8_t eap_identifier,
       
    97 		bool * const use_manual_username,
       
    98 		eap_variable_data_c * const manual_username,
       
    99 		bool *const use_manual_realm,
       
   100 		eap_variable_data_c * const manual_realm
       
   101 		) = 0;
       
   102 
       
   103 	/** Client calls this function.
       
   104 	 *  This call cancels asyncronous query_SIM_IMSI_or_pseudonym_or_reauthentication_id() function call.
       
   105 	 *  AM must not complete query_SIM_IMSI_or_pseudonym_or_reauthentication_id()
       
   106 	 *  with abs_eap_am_type_gsmsim_c::complete_SIM_IMSI_or_pseudonym_or_reauthentication_id_query() after
       
   107 	 *  cancel_SIM_IMSI_or_pseudonym_or_reauthentication_id_query() call.
       
   108 	 */
       
   109 	virtual eap_status_e cancel_identity_query() = 0;
       
   110 
       
   111 	/**
       
   112 	 * The type_configure_read() function reads the configuration data identified
       
   113 	 * by the field string of field_length bytes length. Adaptation module must direct
       
   114 	 * the query to some persistent store.
       
   115 	 * @param field is generic configure string idenfying the required configure data.
       
   116 	 * @param field_length is length of the field string.
       
   117 	 * @param data is pointer to existing eap_variable_data object.
       
   118 	 */
       
   119 	virtual eap_status_e type_configure_read(
       
   120 		const eap_configuration_field_c * const field,
       
   121 		eap_variable_data_c * const data) = 0;
       
   122 
       
   123 	/**
       
   124 	 * The type_configure_write() function writes the configuration data identified
       
   125 	 * by the field string of field_length bytes length. Adaptation module must direct
       
   126 	 * the action to some persistent store.
       
   127 	 * @param field is generic configure string idenfying the required configure data.
       
   128 	 * @param field_length is length of the field string.
       
   129 	 * @param data is pointer to existing eap_variable_data object.
       
   130 	 */
       
   131 	virtual eap_status_e type_configure_write(
       
   132 		const eap_configuration_field_c * const field,
       
   133 		eap_variable_data_c * const data) = 0;
       
   134 
       
   135 	/**
       
   136 	 * This is needed by PEAP type.
       
   137 	 * The load_module() function function indicates the lower level to
       
   138 	 * load new module of EAP-type.
       
   139 	 * @param type is the requested EAP-type.
       
   140 	 * @param partner is pointer to the caller object.
       
   141 	 * The partner of the new created EAP-type object is the caller object.
       
   142 	 * @param eap_type is a pointer to a pointer of EAP-type object.
       
   143 	 * Adaptation module sets eap_type pointer to created EAP-type object.
       
   144 	 * @param is_client_when_true parameter indicates whether the network entity should
       
   145 	 * act as a client (true) or server (false), in terms of EAP-protocol whether
       
   146 	 * this network entity is EAP-supplicant (true) or EAP-authenticator (false).
       
   147 	 */
       
   148 	virtual eap_status_e load_module(
       
   149 		const eap_type_value_e type,
       
   150 		const eap_type_value_e /* tunneling_type */,
       
   151 		abs_eap_base_type_c * const partner,
       
   152 		eap_base_type_c ** const eap_type,
       
   153 		const bool is_client_when_true,
       
   154 		const eap_am_network_id_c * const receive_network_id) = 0;
       
   155 
       
   156 	/**
       
   157 	 * This is needed by PEAP type.
       
   158 	 * This function queries the validity of EAP-type.
       
   159 	 * Lower layer should return eap_status_ok if this EAP-type is supported.
       
   160 	 */
       
   161 	virtual eap_status_e check_is_valid_eap_type(const eap_type_value_e eap_type) = 0;
       
   162 
       
   163 	/**
       
   164 	 * This function queries the list of supported EAP-types.
       
   165 	 * Lower layer should return eap_status_ok if this call succeeds.
       
   166 	 * @param eap_type_list will include the list of supported EAP-types. Each value in list
       
   167 	 * is type of u32_t and represent one supported EAP-type. List consists of subsequent u32_t type values.
       
   168 	 */
       
   169 	virtual eap_status_e get_eap_type_list(
       
   170 		eap_array_c<eap_type_value_e> * const eap_type_list) = 0;
       
   171 
       
   172 	/**
       
   173 	 * This is needed by PEAP type.
       
   174 	 * The unload_module() function unloads the module of a EAP-type. 
       
   175 	 * @param type is the requested EAP-type.
       
   176 	 */
       
   177 	virtual eap_status_e unload_module(const eap_type_value_e type) = 0;
       
   178 
       
   179 
       
   180 	//--------------------------------------------------
       
   181 }; // class eap_am_type_simple_config_c
       
   182 
       
   183 
       
   184 /** @file */ 
       
   185 
       
   186 /**
       
   187  * This function creates a new instance of adaptation module of EAP-SIMPLE_CONFIG-type.
       
   188  * @param tools is pointer to the abs_eap_am_tools class created by the adaptation module.
       
   189  * EAP-SIMPLE_CONFIG-type will callback caller using the partner pointer.
       
   190  */
       
   191 EAP_C_FUNC_IMPORT  eap_am_type_simple_config_c *new_eap_am_type_simple_config(
       
   192 	abs_eap_am_tools_c * const tools,
       
   193 	abs_eap_base_type_c * const partner,
       
   194 	const eap_type_value_e eap_type,
       
   195 	const bool is_client_when_true,
       
   196 	const eap_am_network_id_c * const receive_network_id,
       
   197 	abs_eap_configuration_if_c * const configuration_if);
       
   198 
       
   199 
       
   200 #endif //#if !defined(_EAP_AM_TYPE_SIMPLE_CONFIG_H_)
       
   201 
       
   202 //--------------------------------------------------
       
   203 
       
   204 
       
   205 
       
   206 // End.