eapol/eapol_framework/eapol_common/core/eap_plugin_server_message_if.cpp
branchRCL_3
changeset 46 c74b3d9f6b9e
parent 45 bad0cc58d154
child 55 9c2aa05919d9
equal deleted inserted replaced
45:bad0cc58d154 46:c74b3d9f6b9e
     1 /*
       
     2 * Copyright (c) 2001-2010 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 message interface in the server.
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 14 %
       
    20 */
       
    21 
       
    22 // This is enumeration of EAPOL source code.
       
    23 #if defined(USE_EAP_MINIMUM_RELEASE_TRACES)
       
    24 	#undef EAP_FILE_NUMBER_ENUM
       
    25 	#define EAP_FILE_NUMBER_ENUM 746 
       
    26 	#undef EAP_FILE_NUMBER_DATE 
       
    27 	#define EAP_FILE_NUMBER_DATE 1127594498 
       
    28 #endif //#if defined(USE_EAP_MINIMUM_RELEASE_TRACES)
       
    29 
       
    30 
       
    31 
       
    32 #include "eap_am_memory.h"
       
    33 #include "eap_tools.h"
       
    34 #include "eap_plugin_server_message_if.h"
       
    35 #include "eap_crypto_api.h"
       
    36 #include "eap_state_notification.h"
       
    37 #include "eap_automatic_variable.h"
       
    38 #include "eap_network_id_selector.h"
       
    39 #include "eap_config.h"
       
    40 
       
    41 //--------------------------------------------------
       
    42 
       
    43 // 
       
    44 EAP_FUNC_EXPORT eap_plugin_server_message_if_c::~eap_plugin_server_message_if_c()
       
    45 {
       
    46 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
    47 
       
    48 	EAP_TRACE_DEBUG(
       
    49 		m_am_tools, 
       
    50 		EAP_TRACE_FLAGS_MESSAGE_DATA, 
       
    51 		(EAPL("eap_plugin_server_message_if_c::~eap_plugin_server_message_if_c(): this = 0x%08x\n"),
       
    52 		this));
       
    53 
       
    54 	EAP_ASSERT(m_shutdown_was_called == true);
       
    55 
       
    56 	delete m_am_plugin;
       
    57 
       
    58 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
    59 }
       
    60 
       
    61 //--------------------------------------------------
       
    62 
       
    63 #if defined(_WIN32) && !defined(__GNUC__)
       
    64 	#pragma warning( disable : 4355 ) // 'this' : used in base member initializer list
       
    65 #endif
       
    66 
       
    67 // 
       
    68 EAP_FUNC_EXPORT eap_plugin_server_message_if_c::eap_plugin_server_message_if_c(
       
    69 	abs_eap_am_tools_c * const tools)
       
    70 	: m_partner(0)
       
    71 	, m_am_plugin(new_eap_am_plugin_c(tools, this))
       
    72 	, m_am_tools(tools)
       
    73 	, m_error_code(eap_status_ok)
       
    74 	, m_error_function(eap_tlv_message_type_function_none)
       
    75 	, m_is_client(false)
       
    76 	, m_is_valid(false)
       
    77 	, m_shutdown_was_called(false)
       
    78 {
       
    79 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
    80 
       
    81 	EAP_TRACE_DEBUG(
       
    82 		m_am_tools, 
       
    83 		EAP_TRACE_FLAGS_MESSAGE_DATA, 
       
    84 		(EAPL("eap_plugin_server_message_if_c::eap_plugin_server_message_if_c(): %s, this = 0x%08x => 0x%08x, compiled %s %s.\n"),
       
    85 		(m_is_client == true) ? "client": "server",
       
    86 		this,
       
    87 		dynamic_cast<abs_eap_base_timer_c *>(this),
       
    88 		__DATE__,
       
    89 		__TIME__));
       
    90 
       
    91 	if (m_am_plugin != 0
       
    92 		&& m_am_plugin->get_is_valid() == true)
       
    93 	{
       
    94 		set_is_valid();
       
    95 	}
       
    96 
       
    97 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
    98 }
       
    99 
       
   100 //--------------------------------------------------
       
   101 
       
   102 //
       
   103 EAP_FUNC_EXPORT eap_status_e eap_plugin_server_message_if_c::configure(
       
   104 	const eap_variable_data_c * const /* client_configuration */)
       
   105 {
       
   106 	EAP_ASSERT(m_am_tools->get_global_mutex()->get_is_reserved() == true);
       
   107 
       
   108 	EAP_TRACE_DEBUG(
       
   109 		m_am_tools,
       
   110 		EAP_TRACE_FLAGS_MESSAGE_DATA,
       
   111 		(EAPL("%s: eap_plugin_server_message_if_c::configure()\n"),
       
   112 		(m_is_client == true) ? "client": "server"));
       
   113 
       
   114 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_plugin_server_message_if_c::configure()");
       
   115 
       
   116 	eap_status_e status(eap_status_process_general_error);
       
   117 
       
   118 	if (m_am_plugin != 0)
       
   119 	{
       
   120 		status = m_am_plugin->configure();
       
   121 		if (status != eap_status_ok)
       
   122 		{
       
   123 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   124 			return EAP_STATUS_RETURN(m_am_tools, status);
       
   125 		}
       
   126 	}
       
   127 
       
   128 	return EAP_STATUS_RETURN(m_am_tools, status);
       
   129 }
       
   130 
       
   131 //--------------------------------------------------
       
   132 
       
   133 //
       
   134 EAP_FUNC_EXPORT eap_status_e eap_plugin_server_message_if_c::shutdown()
       
   135 {
       
   136 	EAP_TRACE_DEBUG(
       
   137 		m_am_tools,
       
   138 		EAP_TRACE_FLAGS_MESSAGE_DATA,
       
   139 		(EAPL("%s: eap_plugin_server_message_if_c::shutdown(), m_shutdown_was_called=%d\n"),
       
   140 		(m_is_client == true) ? "client": "server",
       
   141 		m_shutdown_was_called));
       
   142 
       
   143 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_plugin_server_message_if_c::shutdown()");
       
   144 
       
   145 	EAP_ASSERT(m_am_tools->get_global_mutex()->get_is_reserved() == true);
       
   146 
       
   147 	if (m_shutdown_was_called == true)
       
   148 	{
       
   149 		// Shutdown function was called already.
       
   150 		return EAP_STATUS_RETURN(m_am_tools, eap_status_ok);
       
   151 	}
       
   152 	m_shutdown_was_called = true;
       
   153 
       
   154 	if (m_am_plugin != 0)
       
   155 	{
       
   156 		(void) m_am_plugin->shutdown();
       
   157 	}
       
   158 
       
   159 	return EAP_STATUS_RETURN(m_am_tools, eap_status_ok);
       
   160 }
       
   161 
       
   162 //--------------------------------------------------
       
   163 
       
   164 //
       
   165 EAP_FUNC_EXPORT void eap_plugin_server_message_if_c::set_partner(abs_eap_am_message_if_c * const partner)
       
   166 {
       
   167 	m_partner = partner;
       
   168 }
       
   169 
       
   170 //--------------------------------------------------
       
   171 
       
   172 EAP_FUNC_EXPORT eap_status_e eap_plugin_server_message_if_c::send_error_message(
       
   173 	const eap_status_e error_code,
       
   174 	const eap_tlv_message_type_function_e function)
       
   175 {
       
   176 	eap_status_e status(eap_status_ok);
       
   177 
       
   178 	{
       
   179 		// Creates message data composed of Attribute-Value Pairs.
       
   180 		eap_process_tlv_message_data_c message(m_am_tools);
       
   181 
       
   182 		if (message.get_is_valid() == false)
       
   183 		{
       
   184 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   185 			return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   186 		}
       
   187 
       
   188 		status = message.add_parameter_data(
       
   189 			eap_tlv_message_type_error,
       
   190 			static_cast<u32_t>(error_code));
       
   191 		if (status != eap_status_ok)
       
   192 		{
       
   193 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   194 			return EAP_STATUS_RETURN(m_am_tools, status);
       
   195 		}
       
   196 
       
   197 		status = message.add_parameter_data(function);
       
   198 		if (status != eap_status_ok)
       
   199 		{
       
   200 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   201 			return EAP_STATUS_RETURN(m_am_tools, status);
       
   202 		}
       
   203 
       
   204 		status = send_message(&message);
       
   205 		if (status != eap_status_ok)
       
   206 		{
       
   207 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   208 			return EAP_STATUS_RETURN(m_am_tools, status);
       
   209 		}
       
   210 	}
       
   211 
       
   212 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   213 	return EAP_STATUS_RETURN(m_am_tools, eap_status_ok);
       
   214 }
       
   215 
       
   216 //--------------------------------------------------
       
   217 
       
   218 EAP_FUNC_EXPORT eap_status_e eap_plugin_server_message_if_c::send_message(eap_process_tlv_message_data_c * const message)
       
   219 {
       
   220 	// Sends message data composed of Attribute-Value Pairs.
       
   221 
       
   222 	EAP_TRACE_DEBUG(
       
   223 		m_am_tools, 
       
   224 		EAP_TRACE_FLAGS_MESSAGE_DATA, 
       
   225 		(EAPL("eap_plugin_server_message_if_c::send_message(): this = 0x%08x => 0x%08x.\n"),
       
   226 		this,
       
   227 		dynamic_cast<abs_eap_base_timer_c *>(this)));
       
   228 
       
   229 	EAP_TRACE_DATA_DEBUG(
       
   230 		m_am_tools,
       
   231 		EAP_TRACE_FLAGS_NEVER,
       
   232 		(EAPL("eap_core_client_message_if_c::send_message()"),
       
   233 		message->get_message_data(),
       
   234 		message->get_message_data_length()));
       
   235 
       
   236 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_client_message_if_c::send_message()");
       
   237 
       
   238 	eap_status_e send_status = m_partner->send_data(
       
   239 		message->get_message_data(),
       
   240 		message->get_message_data_length());
       
   241 
       
   242 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   243 	return EAP_STATUS_RETURN(m_am_tools, send_status);
       
   244 }
       
   245 
       
   246 //--------------------------------------------------
       
   247 
       
   248 EAP_FUNC_EXPORT eap_status_e eap_plugin_server_message_if_c::process_message_type_error(
       
   249 	EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters)
       
   250 {
       
   251 	eap_status_e status(eap_status_ok);
       
   252 
       
   253 	eap_process_tlv_message_data_c message_data(m_am_tools);
       
   254 
       
   255 	if (message_data.get_is_valid() == false)
       
   256 	{
       
   257 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   258 		return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   259 	}
       
   260 
       
   261 	// Error payload is the first in this case.
       
   262 	status = message_data.read_parameter_data(parameters, eap_message_payload_index_function, eap_tlv_message_type_error, &m_error_code);
       
   263 	if (status != eap_status_ok)
       
   264 	{
       
   265 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   266 		return EAP_STATUS_RETURN(m_am_tools, status);
       
   267 	}
       
   268 
       
   269 	// Fuction payload is the second in this case.
       
   270 	status = message_data.read_parameter_data(parameters, eap_message_payload_index_first_parameter, &m_error_function);
       
   271 
       
   272 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   273 	return EAP_STATUS_RETURN(m_am_tools, status);
       
   274 }
       
   275 
       
   276 //--------------------------------------------------
       
   277 
       
   278 EAP_FUNC_EXPORT eap_status_e eap_plugin_server_message_if_c::process_message(eap_process_tlv_message_data_c * const message)
       
   279 {
       
   280 	// Parses message data composed of Attribute-Value Pairs.
       
   281 
       
   282 	EAP_TRACE_DATA_DEBUG(
       
   283 		m_am_tools,
       
   284 		EAP_TRACE_FLAGS_NEVER,
       
   285 		(EAPL("eap_plugin_server_message_if_c::process_message()"),
       
   286 		message->get_message_data(),
       
   287 		message->get_message_data_length()));
       
   288 
       
   289 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_plugin_server_message_if_c::process_message()");
       
   290 
       
   291 	eap_array_c<eap_tlv_header_c> parameters(m_am_tools);
       
   292 
       
   293 	eap_status_e status = message->parse_message_data(&parameters);
       
   294 	if (status != eap_status_ok)
       
   295 	{
       
   296 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   297 
       
   298 		(void) send_error_message(
       
   299 			status,
       
   300 			eap_tlv_message_type_function_none);
       
   301 
       
   302 		return EAP_STATUS_RETURN(m_am_tools, status);
       
   303 	}
       
   304 
       
   305 	if (parameters.get_object_count() == 0)
       
   306 	{
       
   307 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   308 
       
   309 		status = eap_status_illegal_parameter;
       
   310 
       
   311 		(void) send_error_message(
       
   312 			status,
       
   313 			eap_tlv_message_type_function_none);
       
   314 
       
   315 		return EAP_STATUS_RETURN(m_am_tools, status);
       
   316 	}
       
   317 
       
   318 	const eap_tlv_header_c * const function_header = parameters.get_object(eap_message_payload_index_function);
       
   319 	if (function_header == 0
       
   320 		|| (function_header->get_type() != eap_tlv_message_type_error
       
   321 			&& function_header->get_type() != eap_tlv_message_type_function))
       
   322 	{
       
   323 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   324 
       
   325 		status = eap_status_illegal_parameter;
       
   326 
       
   327 		(void) send_error_message(
       
   328 			status,
       
   329 			eap_tlv_message_type_function_none);
       
   330 
       
   331 		return EAP_STATUS_RETURN(m_am_tools, status);
       
   332 	}
       
   333 
       
   334 	if (function_header->get_type() == eap_tlv_message_type_error)
       
   335 	{
       
   336 		status = process_message_type_error(&parameters);
       
   337 	}
       
   338 	else // function_header->get_type() == eap_tlv_message_type_function
       
   339 	{
       
   340 		eap_tlv_message_type_function_e function(eap_tlv_message_type_function_none);
       
   341 
       
   342 		status = message->get_parameter_data(function_header, &function);
       
   343 		if (status != eap_status_ok)
       
   344 		{
       
   345 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   346 
       
   347 			(void) send_error_message(
       
   348 				status,
       
   349 				eap_tlv_message_type_function_none);
       
   350 
       
   351 			return EAP_STATUS_RETURN(m_am_tools, status);
       
   352 		}
       
   353 
       
   354 		switch(function)
       
   355 		{
       
   356 		case eap_tlv_message_type_function_plugin_get_configuration:
       
   357 			status = get_configuration(&parameters);
       
   358 			break;
       
   359 		case eap_tlv_message_type_function_plugin_set_configuration:
       
   360 			status = set_configuration(&parameters);
       
   361 			break;
       
   362 		case eap_tlv_message_type_function_plugin_copy_configuration:
       
   363 			status = copy_configuration(&parameters);
       
   364 			break;
       
   365 		case eap_tlv_message_type_function_plugin_delete_configuration:
       
   366 			status = delete_configuration(&parameters);
       
   367 			break;
       
   368 		case eap_tlv_message_type_function_plugin_set_index:
       
   369 			status = set_index(&parameters);
       
   370 			break;
       
   371 		case eap_tlv_message_type_function_plugin_get_type_info:
       
   372 			status = get_type_info(&parameters);
       
   373 			break;
       
   374 		case eap_tlv_message_type_function_plugin_invoke_ui:
       
   375 			status = invoke_ui(&parameters);
       
   376 			break;
       
   377 		default:
       
   378 			EAP_TRACE_ERROR(
       
   379 				m_am_tools,
       
   380 				TRACE_FLAGS_DEFAULT,
       
   381 				(EAPL("ERROR: process_data(): unknown function %d.\n"),
       
   382 				 function));
       
   383 
       
   384 			status = eap_status_illegal_parameter;
       
   385 
       
   386 			EAP_ASSERT_ANYWAY_TOOLS(m_am_tools);
       
   387 		};
       
   388 
       
   389 		if (status != eap_status_ok
       
   390 			&& status != eap_status_success
       
   391 			&& status != eap_status_pending_request
       
   392 			&& status != eap_status_completed_request
       
   393 			&& status != eap_status_drop_packet_quietly)
       
   394 		{
       
   395 			(void) send_error_message(
       
   396 				status,
       
   397 				function);
       
   398 		}
       
   399 	}
       
   400 
       
   401 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   402 	return EAP_STATUS_RETURN(m_am_tools, status);
       
   403 }
       
   404 
       
   405 //--------------------------------------------------
       
   406 
       
   407 /// Function receives the data message from lower layer.
       
   408 /// Data is formatted to Attribute-Value Pairs.
       
   409 /// Look at eap_tlv_header_c and eap_tlv_message_data_c.
       
   410 EAP_FUNC_EXPORT eap_status_e eap_plugin_server_message_if_c::process_data(const void * const data, const u32_t length)
       
   411 {
       
   412 	EAP_TRACE_DATA_DEBUG(
       
   413 		m_am_tools,
       
   414 		EAP_TRACE_FLAGS_NEVER,
       
   415 		(EAPL("eap_plugin_server_message_if_c::process_data()"),
       
   416 		data,
       
   417 		length));
       
   418 
       
   419 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_plugin_server_message_if_c::process_message()");
       
   420 
       
   421 	eap_status_e status(eap_status_process_general_error);
       
   422 
       
   423 	{
       
   424 		eap_process_tlv_message_data_c message(m_am_tools);
       
   425 
       
   426 		if (message.get_is_valid() == false)
       
   427 		{
       
   428 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   429 
       
   430 			status = eap_status_allocation_error;
       
   431 
       
   432 			(void) send_error_message(
       
   433 				status,
       
   434 				eap_tlv_message_type_function_none);
       
   435 
       
   436 			return EAP_STATUS_RETURN(m_am_tools, status);
       
   437 		}
       
   438 
       
   439 		status = message.set_message_data(length, data);
       
   440 		if (status != eap_status_ok)
       
   441 		{
       
   442 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   443 
       
   444 			(void) send_error_message(
       
   445 				status,
       
   446 				eap_tlv_message_type_function_none);
       
   447 
       
   448 			return EAP_STATUS_RETURN(m_am_tools, status);
       
   449 		}
       
   450 
       
   451 		status = process_message(&message);
       
   452 	}
       
   453 
       
   454 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   455 	return EAP_STATUS_RETURN(m_am_tools, status);
       
   456 }
       
   457 
       
   458 //--------------------------------------------------
       
   459 
       
   460 //
       
   461 EAP_FUNC_EXPORT void eap_plugin_server_message_if_c::set_is_valid()
       
   462 {
       
   463 	m_is_valid = true;
       
   464 }
       
   465 
       
   466 //--------------------------------------------------
       
   467 
       
   468 //
       
   469 EAP_FUNC_EXPORT bool eap_plugin_server_message_if_c::get_is_valid()
       
   470 {
       
   471 	return m_is_valid;
       
   472 }
       
   473 
       
   474 //--------------------------------------------------
       
   475 
       
   476 //
       
   477 EAP_FUNC_EXPORT eap_status_e eap_plugin_server_message_if_c::timer_expired(
       
   478 	const u32_t id, void *data)
       
   479 {
       
   480 	EAP_UNREFERENCED_PARAMETER(id);
       
   481 	EAP_UNREFERENCED_PARAMETER(data);
       
   482 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   483 
       
   484 	EAP_TRACE_DEBUG(
       
   485 		m_am_tools,
       
   486 		EAP_TRACE_FLAGS_MESSAGE_DATA,
       
   487 		(EAPL("TIMER: %s: [0x%08x]->eap_plugin_server_message_if_c::timer_expired(id 0x%02x, data 0x%08x).\n"),
       
   488 		 (m_is_client == true) ? "client": "server",
       
   489 		 this,
       
   490 		 id,
       
   491 		 data));
       
   492 
       
   493 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_plugin_server_message_if_c::timer_expired()");
       
   494 
       
   495 
       
   496 	return EAP_STATUS_RETURN(m_am_tools, eap_status_ok);
       
   497 }
       
   498 
       
   499 //--------------------------------------------------
       
   500 
       
   501 //
       
   502 EAP_FUNC_EXPORT eap_status_e eap_plugin_server_message_if_c::timer_delete_data(
       
   503 	const u32_t id, void *data)
       
   504 {
       
   505 	EAP_UNREFERENCED_PARAMETER(id);
       
   506 	EAP_UNREFERENCED_PARAMETER(data);
       
   507 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   508 
       
   509 	EAP_TRACE_DEBUG(
       
   510 		m_am_tools,
       
   511 		EAP_TRACE_FLAGS_MESSAGE_DATA,
       
   512 		(EAPL("TIMER: %s: [0x%08x]->eap_plugin_server_message_if_c::timer_delete_data(id 0x%02x, data 0x%08x).\n"),
       
   513 		(m_is_client == true) ? "client": "server",
       
   514 		this, id, data));
       
   515 
       
   516 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_plugin_server_message_if_c::timer_delete_data()");
       
   517 
       
   518 	return EAP_STATUS_RETURN(m_am_tools, eap_status_ok);
       
   519 }
       
   520 
       
   521 //--------------------------------------------------
       
   522 
       
   523 eap_status_e eap_plugin_server_message_if_c::get_configuration(
       
   524 	EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters)
       
   525 {
       
   526 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   527 
       
   528 	EAP_TRACE_DEBUG(
       
   529 		m_am_tools, 
       
   530 		EAP_TRACE_FLAGS_MESSAGE_DATA, 
       
   531 		(EAPL("%s: eap_plugin_server_message_if_c::get_configuration(): parameters=0x%08x, count=%d\n"),
       
   532 		 (m_is_client == true) ? "client": "server",
       
   533 		 parameters,
       
   534 		 (parameters != 0) ? parameters->get_object_count(): 0));
       
   535 
       
   536 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_plugin_server_message_if_c::get_configuration()");
       
   537 
       
   538 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   539 
       
   540 	eap_status_e status(eap_status_ok);
       
   541 
       
   542 	u32_t parameter_index(eap_message_payload_index_first_parameter);
       
   543 
       
   544 	eap_process_tlv_message_data_c message_data(m_am_tools);
       
   545 
       
   546 	if (message_data.get_is_valid() == false)
       
   547 	{
       
   548 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   549 		return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   550 	}
       
   551 
       
   552 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   553 
       
   554 	eap_method_settings_c * const internal_settings = new eap_method_settings_c(m_am_tools);
       
   555 
       
   556 	eap_automatic_variable_c<eap_method_settings_c> automatic_internal_settings(m_am_tools, internal_settings);
       
   557 
       
   558 	if (internal_settings == 0)
       
   559 	{
       
   560 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   561 		return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   562 	}
       
   563 
       
   564 	status = message_data.read_parameter_data(parameters, parameter_index, internal_settings);
       
   565 	if (status != eap_status_ok)
       
   566 	{
       
   567 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   568 		return EAP_STATUS_RETURN(m_am_tools, status);
       
   569 	}
       
   570 
       
   571 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   572 
       
   573 	status = m_am_plugin->get_configuration(
       
   574 		internal_settings
       
   575 		);
       
   576 
       
   577 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   578 
       
   579 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   580 	return EAP_STATUS_RETURN(m_am_tools, status);
       
   581 }
       
   582 
       
   583 //--------------------------------------------------
       
   584 
       
   585 eap_status_e eap_plugin_server_message_if_c::set_configuration(
       
   586 	EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters)
       
   587 {
       
   588 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   589 
       
   590 	EAP_TRACE_DEBUG(
       
   591 		m_am_tools, 
       
   592 		EAP_TRACE_FLAGS_MESSAGE_DATA, 
       
   593 		(EAPL("%s: eap_plugin_server_message_if_c::set_configuration()\n"),
       
   594 		 (m_is_client == true) ? "client": "server"));
       
   595 
       
   596 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_plugin_server_message_if_c::set_configuration()");
       
   597 
       
   598 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   599 
       
   600 	eap_status_e status(eap_status_ok);
       
   601 
       
   602 	u32_t parameter_index(eap_message_payload_index_first_parameter);
       
   603 
       
   604 	eap_process_tlv_message_data_c message_data(m_am_tools);
       
   605 
       
   606 	if (message_data.get_is_valid() == false)
       
   607 	{
       
   608 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   609 		return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   610 	}
       
   611 
       
   612 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   613 
       
   614 	eap_method_settings_c * const internal_settings = new eap_method_settings_c(m_am_tools);
       
   615 
       
   616 	eap_automatic_variable_c<eap_method_settings_c> automatic_internal_settings(m_am_tools, internal_settings);
       
   617 
       
   618 	if (internal_settings == 0)
       
   619 	{
       
   620 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   621 		return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   622 	}
       
   623 
       
   624 	status = message_data.read_parameter_data(parameters, parameter_index, internal_settings);
       
   625 	if (status != eap_status_ok)
       
   626 	{
       
   627 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   628 		return EAP_STATUS_RETURN(m_am_tools, status);
       
   629 	}
       
   630 
       
   631 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   632 
       
   633 	status = m_am_plugin->set_configuration(
       
   634 		internal_settings
       
   635 		);
       
   636 
       
   637 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   638 
       
   639 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   640 	return EAP_STATUS_RETURN(m_am_tools, status);
       
   641 }
       
   642 
       
   643 //--------------------------------------------------
       
   644 
       
   645 eap_status_e eap_plugin_server_message_if_c::copy_configuration(
       
   646 	EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters)
       
   647 {
       
   648 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   649 
       
   650 	EAP_TRACE_DEBUG(
       
   651 		m_am_tools, 
       
   652 		EAP_TRACE_FLAGS_MESSAGE_DATA, 
       
   653 		(EAPL("%s: eap_plugin_server_message_if_c::copy_configuration()\n"),
       
   654 		 (m_is_client == true) ? "client": "server"));
       
   655 
       
   656 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_plugin_server_message_if_c::copy_configuration()");
       
   657 
       
   658 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   659 
       
   660 	eap_status_e status(eap_status_ok);
       
   661 
       
   662 	u32_t parameter_index(eap_message_payload_index_first_parameter);
       
   663 
       
   664 	eap_process_tlv_message_data_c message_data(m_am_tools);
       
   665 
       
   666 	if (message_data.get_is_valid() == false)
       
   667 	{
       
   668 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   669 		return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   670 	}
       
   671 
       
   672 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   673 
       
   674 	eap_method_settings_c * const internal_settings = new eap_method_settings_c(m_am_tools);
       
   675 
       
   676 	eap_automatic_variable_c<eap_method_settings_c> automatic_internal_settings(m_am_tools, internal_settings);
       
   677 
       
   678 	if (internal_settings == 0)
       
   679 	{
       
   680 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   681 		return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   682 	}
       
   683 
       
   684 	status = message_data.read_parameter_data(parameters, parameter_index, internal_settings);
       
   685 	if (status != eap_status_ok)
       
   686 	{
       
   687 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   688 		return EAP_STATUS_RETURN(m_am_tools, status);
       
   689 	}
       
   690 
       
   691 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   692 
       
   693 	status = m_am_plugin->copy_configuration(
       
   694 		internal_settings
       
   695 		);
       
   696 
       
   697 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   698 
       
   699 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   700 	return EAP_STATUS_RETURN(m_am_tools, status);
       
   701 }
       
   702 
       
   703 //--------------------------------------------------
       
   704 
       
   705 eap_status_e eap_plugin_server_message_if_c::delete_configuration(
       
   706 	EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters)
       
   707 {
       
   708 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   709 
       
   710 	EAP_TRACE_DEBUG(
       
   711 		m_am_tools, 
       
   712 		EAP_TRACE_FLAGS_MESSAGE_DATA, 
       
   713 		(EAPL("%s: eap_plugin_server_message_if_c::delete_configuration()\n"),
       
   714 		 (m_is_client == true) ? "client": "server"));
       
   715 
       
   716 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_plugin_server_message_if_c::delete_configuration()");
       
   717 
       
   718 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   719 
       
   720 	eap_status_e status(eap_status_ok);
       
   721 
       
   722 	u32_t parameter_index(eap_message_payload_index_first_parameter);
       
   723 
       
   724 	eap_process_tlv_message_data_c message_data(m_am_tools);
       
   725 
       
   726 	if (message_data.get_is_valid() == false)
       
   727 	{
       
   728 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   729 		return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   730 	}
       
   731 
       
   732 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   733 
       
   734 	eap_method_settings_c * const internal_settings = new eap_method_settings_c(m_am_tools);
       
   735 
       
   736 	eap_automatic_variable_c<eap_method_settings_c> automatic_internal_settings(m_am_tools, internal_settings);
       
   737 
       
   738 	if (internal_settings == 0)
       
   739 	{
       
   740 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   741 		return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   742 	}
       
   743 
       
   744 	status = message_data.read_parameter_data(parameters, parameter_index, internal_settings);
       
   745 	if (status != eap_status_ok)
       
   746 	{
       
   747 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   748 		return EAP_STATUS_RETURN(m_am_tools, status);
       
   749 	}
       
   750 
       
   751 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   752 
       
   753 	status = m_am_plugin->delete_configuration(
       
   754 		internal_settings
       
   755 		);
       
   756 
       
   757 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   758 
       
   759 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   760 	return EAP_STATUS_RETURN(m_am_tools, status);
       
   761 }
       
   762 
       
   763 //--------------------------------------------------
       
   764 
       
   765 eap_status_e eap_plugin_server_message_if_c::set_index(
       
   766 	EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters)
       
   767 {
       
   768 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   769 
       
   770 	EAP_TRACE_DEBUG(
       
   771 		m_am_tools, 
       
   772 		EAP_TRACE_FLAGS_MESSAGE_DATA, 
       
   773 		(EAPL("%s: eap_plugin_server_message_if_c::set_index()\n"),
       
   774 		 (m_is_client == true) ? "client": "server"));
       
   775 
       
   776 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_plugin_server_message_if_c::set_index()");
       
   777 
       
   778 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   779 
       
   780 	eap_status_e status(eap_status_ok);
       
   781 
       
   782 	u32_t parameter_index(eap_message_payload_index_first_parameter);
       
   783 
       
   784 	eap_process_tlv_message_data_c message_data(m_am_tools);
       
   785 
       
   786 	if (message_data.get_is_valid() == false)
       
   787 	{
       
   788 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   789 		return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   790 	}
       
   791 
       
   792 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   793 
       
   794 	eap_method_settings_c * const internal_settings = new eap_method_settings_c(m_am_tools);
       
   795 
       
   796 	eap_automatic_variable_c<eap_method_settings_c> automatic_internal_settings(m_am_tools, internal_settings);
       
   797 
       
   798 	if (internal_settings == 0)
       
   799 	{
       
   800 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   801 		return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   802 	}
       
   803 
       
   804 	status = message_data.read_parameter_data(parameters, parameter_index, internal_settings);
       
   805 	if (status != eap_status_ok)
       
   806 	{
       
   807 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   808 		return EAP_STATUS_RETURN(m_am_tools, status);
       
   809 	}
       
   810 
       
   811 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   812 
       
   813 	status = m_am_plugin->set_index(
       
   814 		internal_settings
       
   815 		);
       
   816 
       
   817 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   818 
       
   819 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   820 	return EAP_STATUS_RETURN(m_am_tools, status);
       
   821 }
       
   822 
       
   823 //--------------------------------------------------
       
   824 
       
   825 eap_status_e eap_plugin_server_message_if_c::get_type_info(
       
   826 	EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters)
       
   827 {
       
   828 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   829 
       
   830 	EAP_TRACE_DEBUG(
       
   831 		m_am_tools, 
       
   832 		EAP_TRACE_FLAGS_MESSAGE_DATA, 
       
   833 		(EAPL("%s: eap_plugin_server_message_if_c::get_type_info()\n"),
       
   834 		 (m_is_client == true) ? "client": "server"));
       
   835 
       
   836 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_plugin_server_message_if_c::get_type_info()");
       
   837 
       
   838 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   839 
       
   840 	eap_status_e status(eap_status_ok);
       
   841 
       
   842 	u32_t parameter_index(eap_message_payload_index_first_parameter);
       
   843 
       
   844 	eap_process_tlv_message_data_c message_data(m_am_tools);
       
   845 
       
   846 	if (message_data.get_is_valid() == false)
       
   847 	{
       
   848 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   849 		return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   850 	}
       
   851 
       
   852 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   853 
       
   854 	eap_method_settings_c * const internal_settings = new eap_method_settings_c(m_am_tools);
       
   855 
       
   856 	eap_automatic_variable_c<eap_method_settings_c> automatic_internal_settings(m_am_tools, internal_settings);
       
   857 
       
   858 	if (internal_settings == 0)
       
   859 	{
       
   860 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   861 		return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   862 	}
       
   863 
       
   864 	status = message_data.read_parameter_data(parameters, parameter_index, internal_settings);
       
   865 	if (status != eap_status_ok)
       
   866 	{
       
   867 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   868 		return EAP_STATUS_RETURN(m_am_tools, status);
       
   869 	}
       
   870 
       
   871 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   872 
       
   873 	status = m_am_plugin->get_type_info(
       
   874 		internal_settings
       
   875 		);
       
   876 
       
   877 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   878 
       
   879 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   880 	return EAP_STATUS_RETURN(m_am_tools, status);
       
   881 }
       
   882 
       
   883 //--------------------------------------------------
       
   884 
       
   885 eap_status_e eap_plugin_server_message_if_c::invoke_ui(
       
   886 	EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters)
       
   887 {
       
   888 	EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   889 
       
   890 	EAP_TRACE_DEBUG(
       
   891 		m_am_tools, 
       
   892 		EAP_TRACE_FLAGS_MESSAGE_DATA, 
       
   893 		(EAPL("%s: eap_plugin_server_message_if_c::invoke_ui()\n"),
       
   894 		 (m_is_client == true) ? "client": "server"));
       
   895 
       
   896 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_plugin_server_message_if_c::invoke_ui()");
       
   897 
       
   898 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   899 
       
   900 	eap_status_e status(eap_status_ok);
       
   901 
       
   902 	u32_t parameter_index(eap_message_payload_index_first_parameter);
       
   903 
       
   904 	eap_process_tlv_message_data_c message_data(m_am_tools);
       
   905 
       
   906 	if (message_data.get_is_valid() == false)
       
   907 	{
       
   908 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   909 		return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   910 	}
       
   911 
       
   912 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   913 
       
   914 	eap_method_settings_c * const internal_settings = new eap_method_settings_c(m_am_tools);
       
   915 
       
   916 	eap_automatic_variable_c<eap_method_settings_c> automatic_internal_settings(m_am_tools, internal_settings);
       
   917 
       
   918 	if (internal_settings == 0)
       
   919 	{
       
   920 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   921 		return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   922 	}
       
   923 
       
   924 	status = message_data.read_parameter_data(parameters, parameter_index, internal_settings);
       
   925 	if (status != eap_status_ok)
       
   926 	{
       
   927 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   928 		return EAP_STATUS_RETURN(m_am_tools, status);
       
   929 	}
       
   930 
       
   931 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   932 
       
   933 
       
   934 
       
   935 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       
   936 
       
   937 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   938 	return EAP_STATUS_RETURN(m_am_tools, status);
       
   939 }
       
   940 
       
   941 //--------------------------------------------------
       
   942 
       
   943 EAP_FUNC_EXPORT eap_status_e eap_plugin_server_message_if_c::complete_get_configuration(const eap_method_settings_c * const internal_settings)
       
   944 {
       
   945 	eap_status_e status(eap_status_process_general_error);
       
   946 
       
   947 	EAP_TRACE_DEBUG(
       
   948 		m_am_tools, 
       
   949 		EAP_TRACE_FLAGS_MESSAGE_DATA, 
       
   950 		(EAPL("%s: eap_core_server_message_if_c::complete_get_configuration()\n"),
       
   951 		 (m_is_client == true) ? "client": "server"));
       
   952 
       
   953 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_server_message_if_c::complete_get_configuration()");
       
   954 
       
   955 	{
       
   956 		// Creates message data composed of Attribute-Value Pairs.
       
   957 		eap_process_tlv_message_data_c message(m_am_tools);
       
   958 
       
   959 		if (message.get_is_valid() == false)
       
   960 		{
       
   961 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   962 			return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
   963 		}
       
   964 
       
   965 		status = message.add_parameter_data(eap_tlv_message_type_function_plugin_complete_get_configuration);
       
   966 		if (status != eap_status_ok)
       
   967 		{
       
   968 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   969 			return EAP_STATUS_RETURN(m_am_tools, status);
       
   970 		}
       
   971 
       
   972 		status = message.add_parameter_data(internal_settings);
       
   973 		if (status != eap_status_ok)
       
   974 		{
       
   975 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   976 			return EAP_STATUS_RETURN(m_am_tools, status);
       
   977 		}
       
   978 
       
   979 		status = send_message(&message);
       
   980 		if (status != eap_status_ok)
       
   981 		{
       
   982 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   983 			return EAP_STATUS_RETURN(m_am_tools, status);
       
   984 		}
       
   985 	}
       
   986 
       
   987 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   988 	return EAP_STATUS_RETURN(m_am_tools, status);
       
   989 }
       
   990 
       
   991 //--------------------------------------------------
       
   992 
       
   993 EAP_FUNC_EXPORT eap_status_e eap_plugin_server_message_if_c::complete_set_configuration(const eap_method_settings_c * const internal_settings)
       
   994 {
       
   995 	eap_status_e status(eap_status_process_general_error);
       
   996 
       
   997 	EAP_TRACE_DEBUG(
       
   998 		m_am_tools, 
       
   999 		EAP_TRACE_FLAGS_MESSAGE_DATA, 
       
  1000 		(EAPL("%s: eap_core_server_message_if_c::complete_set_configuration()\n"),
       
  1001 		 (m_is_client == true) ? "client": "server"));
       
  1002 
       
  1003 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_server_message_if_c::complete_set_configuration()");
       
  1004 
       
  1005 	{
       
  1006 		// Creates message data composed of Attribute-Value Pairs.
       
  1007 		eap_process_tlv_message_data_c message(m_am_tools);
       
  1008 
       
  1009 		if (message.get_is_valid() == false)
       
  1010 		{
       
  1011 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1012 			return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
  1013 		}
       
  1014 
       
  1015 		status = message.add_parameter_data(eap_tlv_message_type_function_plugin_complete_set_configuration);
       
  1016 		if (status != eap_status_ok)
       
  1017 		{
       
  1018 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1019 			return EAP_STATUS_RETURN(m_am_tools, status);
       
  1020 		}
       
  1021 
       
  1022 		status = message.add_parameter_data(internal_settings);
       
  1023 		if (status != eap_status_ok)
       
  1024 		{
       
  1025 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1026 			return EAP_STATUS_RETURN(m_am_tools, status);
       
  1027 		}
       
  1028 
       
  1029 		status = send_message(&message);
       
  1030 		if (status != eap_status_ok)
       
  1031 		{
       
  1032 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1033 			return EAP_STATUS_RETURN(m_am_tools, status);
       
  1034 		}
       
  1035 	}
       
  1036 
       
  1037 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1038 	return EAP_STATUS_RETURN(m_am_tools, status);
       
  1039 }
       
  1040 
       
  1041 //--------------------------------------------------
       
  1042 
       
  1043 EAP_FUNC_EXPORT eap_status_e eap_plugin_server_message_if_c::complete_delete_configuration(const eap_method_settings_c * const internal_settings)
       
  1044 {
       
  1045 	eap_status_e status(eap_status_process_general_error);
       
  1046 
       
  1047 	EAP_TRACE_DEBUG(
       
  1048 		m_am_tools, 
       
  1049 		EAP_TRACE_FLAGS_MESSAGE_DATA, 
       
  1050 		(EAPL("%s: eap_core_server_message_if_c::complete_delete_configuration()\n"),
       
  1051 		 (m_is_client == true) ? "client": "server"));
       
  1052 
       
  1053 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_server_message_if_c::complete_delete_configuration()");
       
  1054 
       
  1055 	{
       
  1056 		// Creates message data composed of Attribute-Value Pairs.
       
  1057 		eap_process_tlv_message_data_c message(m_am_tools);
       
  1058 
       
  1059 		if (message.get_is_valid() == false)
       
  1060 		{
       
  1061 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1062 			return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
  1063 		}
       
  1064 
       
  1065 		status = message.add_parameter_data(eap_tlv_message_type_function_plugin_complete_delete_configuration);
       
  1066 		if (status != eap_status_ok)
       
  1067 		{
       
  1068 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1069 			return EAP_STATUS_RETURN(m_am_tools, status);
       
  1070 		}
       
  1071 
       
  1072 		status = message.add_parameter_data(internal_settings);
       
  1073 		if (status != eap_status_ok)
       
  1074 		{
       
  1075 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1076 			return EAP_STATUS_RETURN(m_am_tools, status);
       
  1077 		}
       
  1078 
       
  1079 		status = send_message(&message);
       
  1080 		if (status != eap_status_ok)
       
  1081 		{
       
  1082 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1083 			return EAP_STATUS_RETURN(m_am_tools, status);
       
  1084 		}
       
  1085 	}
       
  1086 
       
  1087 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1088 	return EAP_STATUS_RETURN(m_am_tools, status);
       
  1089 }
       
  1090 
       
  1091 //--------------------------------------------------
       
  1092 
       
  1093 EAP_FUNC_EXPORT eap_status_e eap_plugin_server_message_if_c::complete_copy_configuration(const eap_method_settings_c * const internal_settings)
       
  1094 {
       
  1095 	eap_status_e status(eap_status_process_general_error);
       
  1096 
       
  1097 	EAP_TRACE_DEBUG(
       
  1098 		m_am_tools, 
       
  1099 		EAP_TRACE_FLAGS_MESSAGE_DATA, 
       
  1100 		(EAPL("%s: eap_core_server_message_if_c::complete_copy_configuration()\n"),
       
  1101 		 (m_is_client == true) ? "client": "server"));
       
  1102 
       
  1103 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_server_message_if_c::complete_copy_configuration()");
       
  1104 
       
  1105 	{
       
  1106 		// Creates message data composed of Attribute-Value Pairs.
       
  1107 		eap_process_tlv_message_data_c message(m_am_tools);
       
  1108 
       
  1109 		if (message.get_is_valid() == false)
       
  1110 		{
       
  1111 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1112 			return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
  1113 		}
       
  1114 
       
  1115 		status = message.add_parameter_data(eap_tlv_message_type_function_plugin_complete_copy_configuration);
       
  1116 		if (status != eap_status_ok)
       
  1117 		{
       
  1118 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1119 			return EAP_STATUS_RETURN(m_am_tools, status);
       
  1120 		}
       
  1121 
       
  1122 		status = message.add_parameter_data(internal_settings);
       
  1123 		if (status != eap_status_ok)
       
  1124 		{
       
  1125 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1126 			return EAP_STATUS_RETURN(m_am_tools, status);
       
  1127 		}
       
  1128 
       
  1129 		status = send_message(&message);
       
  1130 		if (status != eap_status_ok)
       
  1131 		{
       
  1132 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1133 			return EAP_STATUS_RETURN(m_am_tools, status);
       
  1134 		}
       
  1135 	}
       
  1136 
       
  1137 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1138 	return EAP_STATUS_RETURN(m_am_tools, status);
       
  1139 }
       
  1140 
       
  1141 //--------------------------------------------------
       
  1142 
       
  1143 EAP_FUNC_EXPORT eap_status_e eap_plugin_server_message_if_c::complete_set_index(const eap_method_settings_c * const internal_settings)
       
  1144 {
       
  1145 	eap_status_e status(eap_status_process_general_error);
       
  1146 
       
  1147 	EAP_TRACE_DEBUG(
       
  1148 		m_am_tools, 
       
  1149 		EAP_TRACE_FLAGS_MESSAGE_DATA, 
       
  1150 		(EAPL("%s: eap_core_server_message_if_c::complete_set_index()\n"),
       
  1151 		 (m_is_client == true) ? "client": "server"));
       
  1152 
       
  1153 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_server_message_if_c::complete_set_index()");
       
  1154 
       
  1155 	{
       
  1156 		// Creates message data composed of Attribute-Value Pairs.
       
  1157 		eap_process_tlv_message_data_c message(m_am_tools);
       
  1158 
       
  1159 		if (message.get_is_valid() == false)
       
  1160 		{
       
  1161 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1162 			return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
  1163 		}
       
  1164 
       
  1165 		status = message.add_parameter_data(eap_tlv_message_type_function_plugin_complete_set_index);
       
  1166 		if (status != eap_status_ok)
       
  1167 		{
       
  1168 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1169 			return EAP_STATUS_RETURN(m_am_tools, status);
       
  1170 		}
       
  1171 
       
  1172 		status = message.add_parameter_data(internal_settings);
       
  1173 		if (status != eap_status_ok)
       
  1174 		{
       
  1175 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1176 			return EAP_STATUS_RETURN(m_am_tools, status);
       
  1177 		}
       
  1178 
       
  1179 		status = send_message(&message);
       
  1180 		if (status != eap_status_ok)
       
  1181 		{
       
  1182 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1183 			return EAP_STATUS_RETURN(m_am_tools, status);
       
  1184 		}
       
  1185 	}
       
  1186 
       
  1187 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1188 	return EAP_STATUS_RETURN(m_am_tools, status);
       
  1189 }
       
  1190 
       
  1191 //--------------------------------------------------
       
  1192 
       
  1193 EAP_FUNC_EXPORT eap_status_e eap_plugin_server_message_if_c::complete_get_type_info(const eap_method_settings_c * const internal_settings)
       
  1194 {
       
  1195 	eap_status_e status(eap_status_process_general_error);
       
  1196 
       
  1197 	EAP_TRACE_DEBUG(
       
  1198 		m_am_tools, 
       
  1199 		EAP_TRACE_FLAGS_MESSAGE_DATA, 
       
  1200 		(EAPL("%s: eap_core_server_message_if_c::complete_get_type_info()\n"),
       
  1201 		 (m_is_client == true) ? "client": "server"));
       
  1202 
       
  1203 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_server_message_if_c::complete_get_type_info()");
       
  1204 
       
  1205 	{
       
  1206 		// Creates message data composed of Attribute-Value Pairs.
       
  1207 		eap_process_tlv_message_data_c message(m_am_tools);
       
  1208 
       
  1209 		if (message.get_is_valid() == false)
       
  1210 		{
       
  1211 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1212 			return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
  1213 		}
       
  1214 
       
  1215 		status = message.add_parameter_data(eap_tlv_message_type_function_plugin_complete_get_type_info);
       
  1216 		if (status != eap_status_ok)
       
  1217 		{
       
  1218 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1219 			return EAP_STATUS_RETURN(m_am_tools, status);
       
  1220 		}
       
  1221 
       
  1222 		status = message.add_parameter_data(internal_settings);
       
  1223 		if (status != eap_status_ok)
       
  1224 		{
       
  1225 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1226 			return EAP_STATUS_RETURN(m_am_tools, status);
       
  1227 		}
       
  1228 
       
  1229 		status = send_message(&message);
       
  1230 		if (status != eap_status_ok)
       
  1231 		{
       
  1232 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1233 			return EAP_STATUS_RETURN(m_am_tools, status);
       
  1234 		}
       
  1235 	}
       
  1236 
       
  1237 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1238 	return EAP_STATUS_RETURN(m_am_tools, status);
       
  1239 }
       
  1240 
       
  1241 //--------------------------------------------------
       
  1242 
       
  1243 EAP_FUNC_EXPORT eap_status_e eap_plugin_server_message_if_c::complete_invoke_ui(const eap_method_settings_c * const internal_settings)
       
  1244 {
       
  1245 	eap_status_e status(eap_status_process_general_error);
       
  1246 
       
  1247 	EAP_TRACE_DEBUG(
       
  1248 		m_am_tools, 
       
  1249 		EAP_TRACE_FLAGS_MESSAGE_DATA, 
       
  1250 		(EAPL("%s: eap_core_server_message_if_c::complete_invoke_ui()\n"),
       
  1251 		 (m_is_client == true) ? "client": "server"));
       
  1252 
       
  1253 	EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_server_message_if_c::complete_invoke_ui()");
       
  1254 
       
  1255 	{
       
  1256 		// Creates message data composed of Attribute-Value Pairs.
       
  1257 		eap_process_tlv_message_data_c message(m_am_tools);
       
  1258 
       
  1259 		if (message.get_is_valid() == false)
       
  1260 		{
       
  1261 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1262 			return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
       
  1263 		}
       
  1264 
       
  1265 		status = message.add_parameter_data(eap_tlv_message_type_function_plugin_complete_invoke_ui);
       
  1266 		if (status != eap_status_ok)
       
  1267 		{
       
  1268 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1269 			return EAP_STATUS_RETURN(m_am_tools, status);
       
  1270 		}
       
  1271 
       
  1272 		status = message.add_parameter_data(internal_settings);
       
  1273 		if (status != eap_status_ok)
       
  1274 		{
       
  1275 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1276 			return EAP_STATUS_RETURN(m_am_tools, status);
       
  1277 		}
       
  1278 
       
  1279 		status = send_message(&message);
       
  1280 		if (status != eap_status_ok)
       
  1281 		{
       
  1282 			EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1283 			return EAP_STATUS_RETURN(m_am_tools, status);
       
  1284 		}
       
  1285 	}
       
  1286 
       
  1287 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1288 	return EAP_STATUS_RETURN(m_am_tools, status);
       
  1289 }
       
  1290 
       
  1291 //--------------------------------------------------
       
  1292 // End.