eapol/eapol_framework/eapol_common/type/simple_config/simple_config/src/simple_config_payloads.cpp
changeset 33 938269283a16
parent 2 1c7bc153c08e
child 34 ad1f037f1ac2
equal deleted inserted replaced
22:093cf0757204 33:938269283a16
     1 /*
     1 /*
     2 * Copyright (c) 2001-2007 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2001-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  EAP and WLAN authentication protocols.
    14 * Description:  Defines payloads of protected setup message.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 /*
    18 /*
    19 * %version: 35 %
    19 * %version: 33.1.2 %
    20 */
    20 */
    21 
    21 
    22 // This is enumeration of EAPOL source code.
    22 // This is enumeration of EAPOL source code.
    23 #if defined(USE_EAP_MINIMUM_RELEASE_TRACES)
    23 #if defined(USE_EAP_MINIMUM_RELEASE_TRACES)
    24 	#undef EAP_FILE_NUMBER_ENUM
    24 	#undef EAP_FILE_NUMBER_ENUM
   472 
   472 
   473 			i32_t index = find_simple<simple_config_Attribute_Type_e>(
   473 			i32_t index = find_simple<simple_config_Attribute_Type_e>(
   474 				used_payloads,
   474 				used_payloads,
   475 				&attribute_type,
   475 				&attribute_type,
   476 				m_am_tools);
   476 				m_am_tools);
   477 			if (index < 0ul)
   477 			if (index < 0)
   478 			{
   478 			{
   479 				// ERROR: not used mandatory TLV.
   479 				// ERROR: not used mandatory TLV.
   480 				EAP_TRACE_ERROR(
   480 				EAP_TRACE_ERROR(
   481 					m_am_tools, 
   481 					m_am_tools, 
   482 					TRACE_FLAGS_ERROR, 
   482 					TRACE_FLAGS_ERROR, 
   513 		return EAP_STATUS_RETURN(m_am_tools, eap_status_missing_payload);
   513 		return EAP_STATUS_RETURN(m_am_tools, eap_status_missing_payload);
   514 	}
   514 	}
   515 
   515 
   516 	eap_status_e status = add_attribute(
   516 	eap_status_e status = add_attribute(
   517 		payload->copy());
   517 		payload->copy());
   518 	if (status != eap_status_ok)
       
   519 	{
       
   520 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
   521 		return EAP_STATUS_RETURN(m_am_tools, status);
       
   522 	}
       
   523 
   518 
   524 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
   519 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
   525 	return EAP_STATUS_RETURN(m_am_tools, status);
   520 	return EAP_STATUS_RETURN(m_am_tools, status);
   526 }
   521 }
   527 
   522 
  1297 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
  1292 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
  1298 		return EAP_STATUS_RETURN(m_am_tools, status);
  1293 		return EAP_STATUS_RETURN(m_am_tools, status);
  1299 	}
  1294 	}
  1300 
  1295 
  1301 	status = m_read_payloads.reset();
  1296 	status = m_read_payloads.reset();
  1302 	if (status != eap_status_ok)
  1297 
  1303 	{
  1298 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
  1304 		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
  1299 	return EAP_STATUS_RETURN(m_am_tools, status);
  1305 		return EAP_STATUS_RETURN(m_am_tools, status);
       
  1306 	}
       
  1307 
       
  1308 	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
       
  1309 	return EAP_STATUS_RETURN(m_am_tools, eap_status_ok);
       
  1310 }
  1300 }
  1311 
  1301 
  1312 //--------------------------------------------------
  1302 //--------------------------------------------------
  1313 
  1303 
  1314 simple_config_payloads_c * simple_config_payloads_c::copy() const
  1304 simple_config_payloads_c * simple_config_payloads_c::copy() const