eapol/eapol_framework/eapol_common/include/eap_plugin_client_message_if.h
branchRCL_3
changeset 19 c74b3d9f6b9e
parent 18 bad0cc58d154
equal deleted inserted replaced
18:bad0cc58d154 19:c74b3d9f6b9e
     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-plugin interface message class.
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 6 %
       
    20 */
       
    21 
       
    22 #if !defined(_EAP_PLUGIN_CLIENT_MESSAGE_IF_H_)
       
    23 #define _EAP_PLUGIN_CLIENT_MESSAGE_IF_H_
       
    24 
       
    25 #include "eap_tools.h"
       
    26 #include "eap_am_export.h"
       
    27 #include "eap_plugin_message_base.h"
       
    28 #include "abs_eap_am_message_if.h"
       
    29 #include "eap_array.h"
       
    30 #include "eap_process_tlv_message_data.h"
       
    31 
       
    32 class eap_method_settings_c;
       
    33 class eap_am_message_if_c;
       
    34 class abs_eap_plugin_message_c;
       
    35 class eap_tlv_header_c;
       
    36 
       
    37 /// A eap_plugin_client_message_if_c class implements mapping of EAP authentication sessions.
       
    38 /// Network identity separates parallel EAP authentication sessions.
       
    39 class EAP_EXPORT eap_plugin_client_message_if_c
       
    40 : public eap_plugin_message_base_c
       
    41 , public abs_eap_am_message_if_c
       
    42 {
       
    43 private:
       
    44 	//--------------------------------------------------
       
    45 
       
    46 	/// This is pointer to the tools class.
       
    47 	abs_eap_am_tools_c * const m_am_tools;
       
    48 
       
    49 	/// eap_plugin_client_message_if_c deletes m_client_if in destructor.
       
    50 	eap_am_message_if_c * m_client_if;
       
    51 
       
    52 	/// This is back pointer to object which created this object.
       
    53 	/// Packets are sent to the partner.
       
    54 	abs_eap_plugin_message_c * const m_partner;
       
    55 
       
    56 	/// This indicates whether this object was generated successfully.
       
    57 	bool m_is_valid;
       
    58 
       
    59 	eap_status_e m_error_code;
       
    60 
       
    61 	eap_tlv_message_type_function_e m_error_function;
       
    62 
       
    63 
       
    64 	eap_status_e complete_get_configuration(
       
    65 		EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters);
       
    66 
       
    67 	eap_status_e complete_set_configuration(
       
    68 		EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters);
       
    69 
       
    70 	eap_status_e complete_delete_configuration(
       
    71 		EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters);
       
    72 
       
    73 	eap_status_e complete_copy_configuration(
       
    74 		EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters);
       
    75 
       
    76 	eap_status_e complete_set_index(
       
    77 		EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters);
       
    78 
       
    79 	eap_status_e complete_get_type_info(
       
    80 		EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters);
       
    81 
       
    82 	eap_status_e complete_invoke_ui(
       
    83 		EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters);
       
    84 
       
    85 
       
    86 	eap_status_e process_message_type_error(
       
    87 		EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters);
       
    88 
       
    89 	//--------------------------------------------------
       
    90 protected:
       
    91 	//--------------------------------------------------
       
    92 
       
    93 	//--------------------------------------------------
       
    94 public:
       
    95 	//--------------------------------------------------
       
    96 
       
    97 	/**
       
    98 	 * The destructor of the eap_core class does nothing special.
       
    99 	 */
       
   100 	EAP_FUNC_IMPORT virtual ~eap_plugin_client_message_if_c();
       
   101 
       
   102 	/**
       
   103 	 * The constructor initializes member attributes using parameters passed to it.
       
   104 	 * @param tools is pointer to the tools class. @see abs_eap_am_tools_c.
       
   105 	 * @param partner is back pointer to object which created this object.
       
   106 	 * @param is_client_when_true indicates whether the network entity should act
       
   107 	 * as a client (true) or server (false), in terms of EAP-protocol
       
   108 	 * whether this network entity is EAP-supplicant (true) or EAP-authenticator (false).
       
   109 	 */
       
   110 	EAP_FUNC_IMPORT eap_plugin_client_message_if_c(
       
   111 		abs_eap_am_tools_c * const tools,
       
   112 		eap_am_message_if_c * const client_if,
       
   113 		abs_eap_plugin_message_c * const partner);
       
   114 
       
   115 	/**
       
   116 	 * This function must reset the state of object to same as 
       
   117 	 * state was after the configure() function call.
       
   118 	 * If object reset succeeds this function must return eap_status_ok.
       
   119 	 * If object reset fails this function must return corresponding error status.
       
   120 	 * @return This function returns the status of reset operation.
       
   121 	 */
       
   122 	EAP_FUNC_IMPORT eap_status_e reset();
       
   123 
       
   124 	// This is documented in abs_eap_stack_interface_c::configure().
       
   125 	EAP_FUNC_IMPORT eap_status_e configure();
       
   126 
       
   127 	// This is documented in abs_eap_stack_interface_c::shutdown().
       
   128 	EAP_FUNC_IMPORT eap_status_e shutdown();
       
   129 
       
   130 	// This is documented in abs_eap_stack_interface_c::get_is_valid().
       
   131 	EAP_FUNC_IMPORT bool get_is_valid();
       
   132 
       
   133 	EAP_FUNC_IMPORT eap_status_e process_message(eap_process_tlv_message_data_c * const message);
       
   134 
       
   135 	EAP_FUNC_IMPORT eap_status_e get_configuration(const eap_method_settings_c * const internal_settings);
       
   136 
       
   137 	EAP_FUNC_IMPORT eap_status_e set_configuration(const eap_method_settings_c * const internal_settings);
       
   138 
       
   139 	EAP_FUNC_IMPORT eap_status_e copy_configuration(const eap_method_settings_c * const internal_settings);
       
   140 
       
   141 	EAP_FUNC_IMPORT eap_status_e delete_configuration(const eap_method_settings_c * const internal_settings);
       
   142 
       
   143 	EAP_FUNC_IMPORT eap_status_e set_index(const eap_method_settings_c * const internal_settings);
       
   144 
       
   145 	EAP_FUNC_IMPORT eap_status_e get_type_info(const eap_method_settings_c * const internal_settings);
       
   146 
       
   147 	EAP_FUNC_IMPORT eap_status_e invoke_ui(const eap_method_settings_c * const internal_settings);
       
   148 
       
   149 	EAP_FUNC_IMPORT eap_status_e send_data(const void * const data, const u32_t length);
       
   150 
       
   151 	//--------------------------------------------------
       
   152 }; // class eap_plugin_client_message_if_c
       
   153 
       
   154 //--------------------------------------------------
       
   155 
       
   156 #endif //#if !defined(_EAP_PLUGIN_CLIENT_MESSAGE_IF_H_)
       
   157 
       
   158 //--------------------------------------------------
       
   159 
       
   160 
       
   161 
       
   162 // End.