eapol/eapol_framework/eapol_common/type/radius/core/eap_radius_state_notification.cpp
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 // This is enumeration of EAPOL source code.
       
    20 #if defined(USE_EAP_MINIMUM_RELEASE_TRACES)
       
    21 	#undef EAP_FILE_NUMBER_ENUM
       
    22 	#define EAP_FILE_NUMBER_ENUM 113 
       
    23 	#undef EAP_FILE_NUMBER_DATE 
       
    24 	#define EAP_FILE_NUMBER_DATE 1127594498 
       
    25 #endif //#if defined(USE_EAP_MINIMUM_RELEASE_TRACES)
       
    26 
       
    27 
       
    28 
       
    29 #include "eap_radius_state_notification.h"
       
    30 #include "eap_radius_types.h"
       
    31 #include "eap_tools.h"
       
    32 #include "eap_radius.h"
       
    33 
       
    34 
       
    35 EAP_FUNC_EXPORT eap_radius_state_notification_c::~eap_radius_state_notification_c()
       
    36 {
       
    37 }
       
    38 
       
    39 EAP_FUNC_EXPORT eap_radius_state_notification_c::eap_radius_state_notification_c(
       
    40 	abs_eap_am_tools_c * const tools,
       
    41 	const eap_am_network_id_c * const send_network_id,
       
    42 	bool is_client,
       
    43 	eap_state_notification_generic_e,
       
    44 	eap_protocol_layer_e layer,
       
    45 	u32_t protocol,
       
    46 	u32_t previous_state,
       
    47 	u32_t current_state,
       
    48 	u8_t eap_identifier,
       
    49 	bool allow_send_eap_success)
       
    50 	: m_am_tools(tools)
       
    51 	, m_layer(layer)
       
    52 	, m_notification_string(tools)
       
    53 	, m_needs_confirmation_from_user(false)
       
    54 	, m_protocol(protocol)
       
    55 	, m_eap_type(eap_type_none)
       
    56 	, m_previous_state(previous_state)
       
    57 	, m_current_state(current_state)
       
    58 	, m_send_network_id(send_network_id)
       
    59 	, m_is_client(is_client)
       
    60 	, m_eap_identifier(eap_identifier)
       
    61 	, m_allow_send_eap_success(allow_send_eap_success)
       
    62 {
       
    63 }
       
    64 
       
    65 
       
    66 #if defined(USE_EAP_EXPANDED_TYPES)
       
    67 
       
    68 EAP_FUNC_EXPORT eap_radius_state_notification_c::eap_radius_state_notification_c(
       
    69 	abs_eap_am_tools_c * const tools,
       
    70 	const eap_am_network_id_c * const send_network_id,
       
    71 	bool is_client,
       
    72 	eap_state_notification_eap_e,
       
    73 	eap_protocol_layer_e layer,
       
    74 	eap_type_value_e eap_type,
       
    75 	u32_t previous_state,
       
    76 	u32_t current_state,
       
    77 	u8_t eap_identifier,
       
    78 	bool allow_send_eap_success)
       
    79 	: m_am_tools(tools)
       
    80 	, m_layer(layer)
       
    81 	, m_notification_string(tools)
       
    82 	, m_needs_confirmation_from_user(false)
       
    83 	, m_protocol(0ul)
       
    84 	, m_eap_type(eap_type)
       
    85 	, m_previous_state(previous_state)
       
    86 	, m_current_state(current_state)
       
    87 	, m_send_network_id(send_network_id)
       
    88 	, m_is_client(is_client)
       
    89 	, m_eap_identifier(eap_identifier)
       
    90 	, m_allow_send_eap_success(allow_send_eap_success)
       
    91 {
       
    92 }
       
    93 
       
    94 #endif //#if defined(USE_EAP_EXPANDED_TYPES)
       
    95 
       
    96 
       
    97 EAP_FUNC_EXPORT eap_radius_state_notification_c::eap_radius_state_notification_c(
       
    98 	abs_eap_am_tools_c * const tools,
       
    99 	const eap_am_network_id_c * const send_network_id,
       
   100 	bool is_client,
       
   101 	eap_state_notification_eap_e,
       
   102 	eap_protocol_layer_e layer,
       
   103 	eap_type_ietf_values_e eap_type,
       
   104 	u32_t previous_state,
       
   105 	u32_t current_state,
       
   106 	u8_t eap_identifier,
       
   107 	bool allow_send_eap_success)
       
   108 	: m_am_tools(tools)
       
   109 	, m_layer(layer)
       
   110 	, m_notification_string(tools)
       
   111 	, m_needs_confirmation_from_user(false)
       
   112 	, m_protocol(0ul)
       
   113 	, m_eap_type(eap_type)
       
   114 	, m_previous_state(previous_state)
       
   115 	, m_current_state(current_state)
       
   116 	, m_send_network_id(send_network_id)
       
   117 	, m_is_client(is_client)
       
   118 	, m_eap_identifier(eap_identifier)
       
   119 	, m_allow_send_eap_success(allow_send_eap_success)
       
   120 {
       
   121 }
       
   122 
       
   123 EAP_FUNC_EXPORT const eap_am_network_id_c * eap_radius_state_notification_c::get_send_network_id() const
       
   124 {
       
   125 	return m_send_network_id;
       
   126 }
       
   127 
       
   128 EAP_FUNC_EXPORT eap_protocol_layer_e eap_radius_state_notification_c::get_protocol_layer() const
       
   129 {
       
   130 	return m_layer;
       
   131 }
       
   132 
       
   133 EAP_FUNC_EXPORT u32_t eap_radius_state_notification_c::get_protocol() const
       
   134 {
       
   135 	return m_protocol;
       
   136 }
       
   137 
       
   138 EAP_FUNC_EXPORT eap_type_value_e eap_radius_state_notification_c::get_eap_type() const
       
   139 {
       
   140 	return m_eap_type;
       
   141 }
       
   142 
       
   143 EAP_FUNC_EXPORT u32_t eap_radius_state_notification_c::get_previous_state() const
       
   144 {
       
   145 	return m_previous_state;
       
   146 }
       
   147 
       
   148 EAP_FUNC_EXPORT u32_t eap_radius_state_notification_c::get_current_state() const
       
   149 {
       
   150 	return m_current_state;
       
   151 }
       
   152 
       
   153 EAP_FUNC_EXPORT eap_const_string eap_radius_state_notification_c::get_current_state_string() const
       
   154 {
       
   155 	// NOTE this is static function.
       
   156 	return eap_radius_c::get_state_string(static_cast<eap_radius_state_variable_e>(m_current_state));
       
   157 }
       
   158 
       
   159 EAP_FUNC_EXPORT eap_const_string eap_radius_state_notification_c::get_previous_state_string() const
       
   160 {
       
   161 	// NOTE this is static function.
       
   162 	return eap_radius_c::get_state_string(static_cast<eap_radius_state_variable_e>(m_previous_state));
       
   163 }
       
   164 
       
   165 EAP_FUNC_EXPORT bool eap_radius_state_notification_c::get_is_client() const
       
   166 {
       
   167 	return m_is_client;
       
   168 }
       
   169 
       
   170 EAP_FUNC_EXPORT u8_t eap_radius_state_notification_c::get_eap_identifier() const
       
   171 {
       
   172 	return m_eap_identifier;
       
   173 }
       
   174 
       
   175 EAP_FUNC_EXPORT bool eap_radius_state_notification_c::get_allow_send_eap_success() const
       
   176 {
       
   177 	return m_allow_send_eap_success;
       
   178 }
       
   179 
       
   180 EAP_FUNC_EXPORT eap_status_e eap_radius_state_notification_c::set_notification_string(
       
   181 	const eap_variable_data_c * const notification_string,
       
   182 	const bool needs_confirmation_from_user)
       
   183 {
       
   184 	eap_status_e status = m_notification_string.set_copy_of_buffer(notification_string);
       
   185 	if (status != eap_status_ok)
       
   186 	{
       
   187 		return EAP_STATUS_RETURN(m_am_tools, status);
       
   188 	}
       
   189 
       
   190 	m_needs_confirmation_from_user = needs_confirmation_from_user;
       
   191 
       
   192 	return EAP_STATUS_RETURN(m_am_tools, status);
       
   193 }
       
   194 
       
   195 EAP_FUNC_EXPORT const eap_variable_data_c * eap_radius_state_notification_c::get_notification_string() const
       
   196 {
       
   197 	return &m_notification_string;
       
   198 }
       
   199 
       
   200 EAP_FUNC_EXPORT bool eap_radius_state_notification_c::get_needs_confirmation_from_user() const
       
   201 {
       
   202 	return m_needs_confirmation_from_user;
       
   203 }
       
   204 
       
   205 //--------------------------------------------------
       
   206 
       
   207 
       
   208 
       
   209 // End.