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