eapol/eapol_framework/eapol_common/type/tls_peap/tls/include/tls_application_data_message.h
changeset 52 c23bdf5a328a
parent 33 938269283a16
equal deleted inserted replaced
51:e863583e6720 52:c23bdf5a328a
    22 #if !defined(_TLS_APPLICATION_DATA_MESSAGE_H_)
    22 #if !defined(_TLS_APPLICATION_DATA_MESSAGE_H_)
    23 #define _TLS_APPLICATION_DATA_MESSAGE_H_
    23 #define _TLS_APPLICATION_DATA_MESSAGE_H_
    24 
    24 
    25 #include "eap_tools.h"
    25 #include "eap_tools.h"
    26 #include "eap_array.h"
    26 #include "eap_array.h"
       
    27 #include "eap_am_export.h"
       
    28 // Start: added by script change_export_macros.sh.
       
    29 #if defined(EAP_NO_EXPORT_TLS_APPLICATION_DATA_MESSAGE_H)
       
    30 	#define EAP_CLASS_VISIBILITY_TLS_APPLICATION_DATA_MESSAGE_H EAP_NONSHARABLE 
       
    31 	#define EAP_FUNC_VISIBILITY_TLS_APPLICATION_DATA_MESSAGE_H 
       
    32 	#define EAP_C_FUNC_VISIBILITY_TLS_APPLICATION_DATA_MESSAGE_H 
       
    33 	#define EAP_FUNC_EXPORT_TLS_APPLICATION_DATA_MESSAGE_H 
       
    34 	#define EAP_C_FUNC_EXPORT_TLS_APPLICATION_DATA_MESSAGE_H 
       
    35 #elif defined(EAP_EXPORT_TLS_APPLICATION_DATA_MESSAGE_H)
       
    36 	#define EAP_CLASS_VISIBILITY_TLS_APPLICATION_DATA_MESSAGE_H EAP_EXPORT 
       
    37 	#define EAP_FUNC_VISIBILITY_TLS_APPLICATION_DATA_MESSAGE_H EAP_FUNC_EXPORT 
       
    38 	#define EAP_C_FUNC_VISIBILITY_TLS_APPLICATION_DATA_MESSAGE_H EAP_C_FUNC_EXPORT 
       
    39 	#define EAP_FUNC_EXPORT_TLS_APPLICATION_DATA_MESSAGE_H EAP_FUNC_EXPORT 
       
    40 	#define EAP_C_FUNC_EXPORT_TLS_APPLICATION_DATA_MESSAGE_H EAP_C_FUNC_EXPORT 
       
    41 #else
       
    42 	#define EAP_CLASS_VISIBILITY_TLS_APPLICATION_DATA_MESSAGE_H EAP_IMPORT 
       
    43 	#define EAP_FUNC_VISIBILITY_TLS_APPLICATION_DATA_MESSAGE_H EAP_FUNC_IMPORT 
       
    44 	#define EAP_C_FUNC_VISIBILITY_TLS_APPLICATION_DATA_MESSAGE_H EAP_C_FUNC_IMPORT 
       
    45 	#define EAP_FUNC_EXPORT_TLS_APPLICATION_DATA_MESSAGE_H 
       
    46 	#define EAP_C_FUNC_EXPORT_TLS_APPLICATION_DATA_MESSAGE_H 
       
    47 #endif
       
    48 // End: added by script change_export_macros.sh.
       
    49 
    27 
    50 
    28 class eap_buf_chain_wr_c;
    51 class eap_buf_chain_wr_c;
    29 
    52 
    30 
    53 
    31 /** @file */
    54 /** @file */
    34 
    57 
    35 /// This class defines one TLS application data message.
    58 /// This class defines one TLS application data message.
    36 /**
    59 /**
    37  * This class includes one application data message.
    60  * This class includes one application data message.
    38  */
    61  */
    39 class EAP_EXPORT tls_application_data_message_c
    62 class EAP_CLASS_VISIBILITY_TLS_APPLICATION_DATA_MESSAGE_H tls_application_data_message_c
    40 {
    63 {
    41 private:
    64 private:
    42 	//--------------------------------------------------
    65 	//--------------------------------------------------
    43 
    66 
    44 	abs_eap_am_tools_c * const m_am_tools;
    67 	abs_eap_am_tools_c * const m_am_tools;
    59 
    82 
    60 	/**
    83 	/**
    61 	 * The set_is_valid() function sets the state of the object valid.
    84 	 * The set_is_valid() function sets the state of the object valid.
    62 	 * The creator of this object calls this function after it is initialized. 
    85 	 * The creator of this object calls this function after it is initialized. 
    63 	 */
    86 	 */
    64 	EAP_FUNC_IMPORT void set_is_valid();
    87 	EAP_FUNC_VISIBILITY_TLS_APPLICATION_DATA_MESSAGE_H void set_is_valid();
    65 
    88 
    66 	//--------------------------------------------------
    89 	//--------------------------------------------------
    67 protected:
    90 protected:
    68 	//--------------------------------------------------
    91 	//--------------------------------------------------
    69 
    92 
    72 	//--------------------------------------------------
    95 	//--------------------------------------------------
    73 
    96 
    74 	/**
    97 	/**
    75 	 * Destructor does nothing.
    98 	 * Destructor does nothing.
    76 	 */
    99 	 */
    77 	EAP_FUNC_IMPORT virtual ~tls_application_data_message_c();
   100 	EAP_FUNC_VISIBILITY_TLS_APPLICATION_DATA_MESSAGE_H virtual ~tls_application_data_message_c();
    78 
   101 
    79 	/**
   102 	/**
    80 	 * Constructor initializes the object.
   103 	 * Constructor initializes the object.
    81 	 */
   104 	 */
    82 	EAP_FUNC_IMPORT tls_application_data_message_c(
   105 	EAP_FUNC_VISIBILITY_TLS_APPLICATION_DATA_MESSAGE_H tls_application_data_message_c(
    83 		abs_eap_am_tools_c * const tools,
   106 		abs_eap_am_tools_c * const tools,
    84 		const bool is_client);
   107 		const bool is_client);
    85 
   108 
    86 	/**
   109 	/**
    87 	 * Object must indicate it's validity.
   110 	 * Object must indicate it's validity.
    88 	 * If object initialization fails this function must return false.
   111 	 * If object initialization fails this function must return false.
    89 	 * @return This function returns the validity of this object.
   112 	 * @return This function returns the validity of this object.
    90 	 */
   113 	 */
    91 	EAP_FUNC_IMPORT bool get_is_valid();
   114 	EAP_FUNC_VISIBILITY_TLS_APPLICATION_DATA_MESSAGE_H bool get_is_valid();
    92 
   115 
    93 	/**
   116 	/**
    94 	 * This function sets this message is analysed.
   117 	 * This function sets this message is analysed.
    95 	 */
   118 	 */
    96 	EAP_FUNC_IMPORT void set_is_analysed();
   119 	EAP_FUNC_VISIBILITY_TLS_APPLICATION_DATA_MESSAGE_H void set_is_analysed();
    97 
   120 
    98 	/**
   121 	/**
    99 	 * This function returns whether message is analysed (true) or not (false).
   122 	 * This function returns whether message is analysed (true) or not (false).
   100 	 */
   123 	 */
   101 	EAP_FUNC_IMPORT bool get_is_analysed();
   124 	EAP_FUNC_VISIBILITY_TLS_APPLICATION_DATA_MESSAGE_H bool get_is_analysed();
   102 
   125 
   103 
   126 
   104 	/**
   127 	/**
   105 	 * This function stores the application data to m_application_data.
   128 	 * This function stores the application data to m_application_data.
   106 	 */
   129 	 */
   107 	EAP_FUNC_IMPORT eap_status_e set_application_data(
   130 	EAP_FUNC_VISIBILITY_TLS_APPLICATION_DATA_MESSAGE_H eap_status_e set_application_data(
   108 		const u8_t * const packet,
   131 		const u8_t * const packet,
   109 		const u32_t packet_length);
   132 		const u32_t packet_length);
   110 
   133 
   111 	/**
   134 	/**
   112 	 * This function returns pointer to m_application_data.
   135 	 * This function returns pointer to m_application_data.
   113 	 */
   136 	 */
   114 	EAP_FUNC_IMPORT eap_variable_data_c * get_application_data();
   137 	EAP_FUNC_VISIBILITY_TLS_APPLICATION_DATA_MESSAGE_H eap_variable_data_c * get_application_data();
   115 
   138 
   116 	/**
   139 	/**
   117 	 * This function adds data of the TLS-Application data message from m_application_data to tls_message_buffer.
   140 	 * This function adds data of the TLS-Application data message from m_application_data to tls_message_buffer.
   118 	 */
   141 	 */
   119 	EAP_FUNC_IMPORT eap_status_e add_message_data(
   142 	EAP_FUNC_VISIBILITY_TLS_APPLICATION_DATA_MESSAGE_H eap_status_e add_message_data(
   120 		eap_variable_data_c * const tls_message_buffer);
   143 		eap_variable_data_c * const tls_message_buffer);
   121 
   144 
   122 	// 
   145 	// 
   123 	//--------------------------------------------------
   146 	//--------------------------------------------------
   124 }; // class tls_application_data_message_c
   147 }; // class tls_application_data_message_c