eapol/eapol_framework/eapol_common/type/tls_peap/tls/include/tls_alert_message.h
changeset 49 43351a4f2da3
parent 26 9abfd4f00d37
equal deleted inserted replaced
47:712b4ffd76bb 49:43351a4f2da3
    23 #define _TLS_ALERT_MESSAGE_H_
    23 #define _TLS_ALERT_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 "tls_peap_types.h"
    27 #include "tls_peap_types.h"
       
    28 #include "eap_am_export.h"
       
    29 // Start: added by script change_export_macros.sh.
       
    30 #if defined(EAP_NO_EXPORT_TLS_ALERT_MESSAGE_H)
       
    31 	#define EAP_CLASS_VISIBILITY_TLS_ALERT_MESSAGE_H EAP_NONSHARABLE 
       
    32 	#define EAP_FUNC_VISIBILITY_TLS_ALERT_MESSAGE_H 
       
    33 	#define EAP_C_FUNC_VISIBILITY_TLS_ALERT_MESSAGE_H 
       
    34 	#define EAP_FUNC_EXPORT_TLS_ALERT_MESSAGE_H 
       
    35 	#define EAP_C_FUNC_EXPORT_TLS_ALERT_MESSAGE_H 
       
    36 #elif defined(EAP_EXPORT_TLS_ALERT_MESSAGE_H)
       
    37 	#define EAP_CLASS_VISIBILITY_TLS_ALERT_MESSAGE_H EAP_EXPORT 
       
    38 	#define EAP_FUNC_VISIBILITY_TLS_ALERT_MESSAGE_H EAP_FUNC_EXPORT 
       
    39 	#define EAP_C_FUNC_VISIBILITY_TLS_ALERT_MESSAGE_H EAP_C_FUNC_EXPORT 
       
    40 	#define EAP_FUNC_EXPORT_TLS_ALERT_MESSAGE_H EAP_FUNC_EXPORT 
       
    41 	#define EAP_C_FUNC_EXPORT_TLS_ALERT_MESSAGE_H EAP_C_FUNC_EXPORT 
       
    42 #else
       
    43 	#define EAP_CLASS_VISIBILITY_TLS_ALERT_MESSAGE_H EAP_IMPORT 
       
    44 	#define EAP_FUNC_VISIBILITY_TLS_ALERT_MESSAGE_H EAP_FUNC_IMPORT 
       
    45 	#define EAP_C_FUNC_VISIBILITY_TLS_ALERT_MESSAGE_H EAP_C_FUNC_IMPORT 
       
    46 	#define EAP_FUNC_EXPORT_TLS_ALERT_MESSAGE_H 
       
    47 	#define EAP_C_FUNC_EXPORT_TLS_ALERT_MESSAGE_H 
       
    48 #endif
       
    49 // End: added by script change_export_macros.sh.
       
    50 
    28 
    51 
    29 
    52 
    30 /** @file */
    53 /** @file */
    31 
    54 
    32 
    55 
    33 /// This class defines one TLS alert message.
    56 /// This class defines one TLS alert message.
    34 /**
    57 /**
    35  * This class defines TLS-Alert message.
    58  * This class defines TLS-Alert message.
    36  */
    59  */
    37 class EAP_EXPORT tls_alert_message_c
    60 class EAP_CLASS_VISIBILITY_TLS_ALERT_MESSAGE_H tls_alert_message_c
    38 {
    61 {
    39 private:
    62 private:
    40 	//--------------------------------------------------
    63 	//--------------------------------------------------
    41 
    64 
    42 	/// This is pointer to the tools class. @see abs_eap_am_tools_c.
    65 	/// This is pointer to the tools class. @see abs_eap_am_tools_c.
    61 
    84 
    62 	/**
    85 	/**
    63 	 * The set_is_valid() function sets the state of the object valid.
    86 	 * The set_is_valid() function sets the state of the object valid.
    64 	 * The creator of this object calls this function after it is initialized. 
    87 	 * The creator of this object calls this function after it is initialized. 
    65 	 */
    88 	 */
    66 	EAP_FUNC_IMPORT void set_is_valid();
    89 	EAP_FUNC_VISIBILITY_TLS_ALERT_MESSAGE_H void set_is_valid();
    67 
    90 
    68 	//--------------------------------------------------
    91 	//--------------------------------------------------
    69 protected:
    92 protected:
    70 	//--------------------------------------------------
    93 	//--------------------------------------------------
    71 
    94 
    72 	//--------------------------------------------------
    95 	//--------------------------------------------------
    73 public:
    96 public:
    74 	//--------------------------------------------------
    97 	//--------------------------------------------------
    75 
    98 
    76 	/// Destructor does nothing.
    99 	/// Destructor does nothing.
    77 	EAP_FUNC_IMPORT virtual ~tls_alert_message_c();
   100 	EAP_FUNC_VISIBILITY_TLS_ALERT_MESSAGE_H virtual ~tls_alert_message_c();
    78 
   101 
    79 	/// Constructor initializes the object.
   102 	/// Constructor initializes the object.
    80 	EAP_FUNC_IMPORT tls_alert_message_c(
   103 	EAP_FUNC_VISIBILITY_TLS_ALERT_MESSAGE_H tls_alert_message_c(
    81 		abs_eap_am_tools_c * const tools,
   104 		abs_eap_am_tools_c * const tools,
    82 		const bool is_client);
   105 		const bool is_client);
    83 
   106 
    84 
   107 
    85 	/**
   108 	/**
    86 	 * Object must indicate it's validity.
   109 	 * Object must indicate it's validity.
    87 	 * If object initialization fails this function must return false.
   110 	 * If object initialization fails this function must return false.
    88 	 * @return This function returns the validity of this object.
   111 	 * @return This function returns the validity of this object.
    89 	 */
   112 	 */
    90 	EAP_FUNC_IMPORT bool get_is_valid();
   113 	EAP_FUNC_VISIBILITY_TLS_ALERT_MESSAGE_H bool get_is_valid();
    91 
   114 
    92 
   115 
    93 	/**
   116 	/**
    94 	 * This function creates data of the Handshake message to internal buffer.
   117 	 * This function creates data of the Handshake message to internal buffer.
    95 	 * Later this data is added to final TLS-record buffer.
   118 	 * Later this data is added to final TLS-record buffer.
    96 	 */
   119 	 */
    97 	EAP_FUNC_IMPORT eap_status_e create_message_data();
   120 	EAP_FUNC_VISIBILITY_TLS_ALERT_MESSAGE_H eap_status_e create_message_data();
    98 
   121 
    99 
   122 
   100 
   123 
   101 	/**
   124 	/**
   102 	 * This function sets alert level.
   125 	 * This function sets alert level.
   103 	 */
   126 	 */
   104 	EAP_FUNC_IMPORT eap_status_e set_alert_level(const tls_alert_level_e alert_level);
   127 	EAP_FUNC_VISIBILITY_TLS_ALERT_MESSAGE_H eap_status_e set_alert_level(const tls_alert_level_e alert_level);
   105 
   128 
   106 	/**
   129 	/**
   107 	 * This function gets alert level.
   130 	 * This function gets alert level.
   108 	 */
   131 	 */
   109 	EAP_FUNC_IMPORT tls_alert_level_e get_alert_level() const;
   132 	EAP_FUNC_VISIBILITY_TLS_ALERT_MESSAGE_H tls_alert_level_e get_alert_level() const;
   110 
   133 
   111 
   134 
   112 	/**
   135 	/**
   113 	 * This function sets alert description.
   136 	 * This function sets alert description.
   114 	 */
   137 	 */
   115 	EAP_FUNC_IMPORT eap_status_e set_alert_description(const tls_alert_description_e alert_description);
   138 	EAP_FUNC_VISIBILITY_TLS_ALERT_MESSAGE_H eap_status_e set_alert_description(const tls_alert_description_e alert_description);
   116 
   139 
   117 	/**
   140 	/**
   118 	 * This function gets alert description.
   141 	 * This function gets alert description.
   119 	 */
   142 	 */
   120 	EAP_FUNC_IMPORT tls_alert_description_e get_alert_description() const;
   143 	EAP_FUNC_VISIBILITY_TLS_ALERT_MESSAGE_H tls_alert_description_e get_alert_description() const;
   121 
   144 
   122 
   145 
   123 	/**
   146 	/**
   124 	 * This function adds data of the TLS-Alert message to tls_message_buffer.
   147 	 * This function adds data of the TLS-Alert message to tls_message_buffer.
   125 	 */
   148 	 */
   126 	EAP_FUNC_IMPORT eap_status_e add_message_data(
   149 	EAP_FUNC_VISIBILITY_TLS_ALERT_MESSAGE_H eap_status_e add_message_data(
   127 		eap_variable_data_c * const tls_message_buffer);
   150 		eap_variable_data_c * const tls_message_buffer);
   128 
   151 
   129 	// 
   152 	// 
   130 	//--------------------------------------------------
   153 	//--------------------------------------------------
   131 }; // class tls_alert_message_c
   154 }; // class tls_alert_message_c