eapol/eapol_framework/eapol_common/include/eapol_session_key.h
changeset 49 43351a4f2da3
parent 26 9abfd4f00d37
equal deleted inserted replaced
47:712b4ffd76bb 49:43351a4f2da3
    23 #define _EAPOL_SESSION_KEY_H_
    23 #define _EAPOL_SESSION_KEY_H_
    24 
    24 
    25 #include "eap_variable_data.h"
    25 #include "eap_variable_data.h"
    26 #include "eapol_key_types.h"
    26 #include "eapol_key_types.h"
    27 #include "eap_am_export.h"
    27 #include "eap_am_export.h"
       
    28 // Start: added by script change_export_macros.sh.
       
    29 #if defined(EAP_NO_EXPORT_EAPOL_SESSION_KEY_H)
       
    30 	#define EAP_CLASS_VISIBILITY_EAPOL_SESSION_KEY_H EAP_NONSHARABLE 
       
    31 	#define EAP_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H 
       
    32 	#define EAP_C_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H 
       
    33 	#define EAP_FUNC_EXPORT_EAPOL_SESSION_KEY_H 
       
    34 	#define EAP_C_FUNC_EXPORT_EAPOL_SESSION_KEY_H 
       
    35 #elif defined(EAP_EXPORT_EAPOL_SESSION_KEY_H)
       
    36 	#define EAP_CLASS_VISIBILITY_EAPOL_SESSION_KEY_H EAP_EXPORT 
       
    37 	#define EAP_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H EAP_FUNC_EXPORT 
       
    38 	#define EAP_C_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H EAP_C_FUNC_EXPORT 
       
    39 	#define EAP_FUNC_EXPORT_EAPOL_SESSION_KEY_H EAP_FUNC_EXPORT 
       
    40 	#define EAP_C_FUNC_EXPORT_EAPOL_SESSION_KEY_H EAP_C_FUNC_EXPORT 
       
    41 #else
       
    42 	#define EAP_CLASS_VISIBILITY_EAPOL_SESSION_KEY_H EAP_IMPORT 
       
    43 	#define EAP_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H EAP_FUNC_IMPORT 
       
    44 	#define EAP_C_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H EAP_C_FUNC_IMPORT 
       
    45 	#define EAP_FUNC_EXPORT_EAPOL_SESSION_KEY_H 
       
    46 	#define EAP_C_FUNC_EXPORT_EAPOL_SESSION_KEY_H 
       
    47 #endif
       
    48 // End: added by script change_export_macros.sh.
    28 
    49 
    29 
    50 
    30 /// A eapol_session_key_c class.
    51 /// A eapol_session_key_c class.
    31 /// This is used for session key encapsulation.
    52 /// This is used for session key encapsulation.
    32 class EAP_EXPORT eapol_session_key_c
    53 class EAP_CLASS_VISIBILITY_EAPOL_SESSION_KEY_H eapol_session_key_c
    33 {
    54 {
    34 private:
    55 private:
    35 	//--------------------------------------------------
    56 	//--------------------------------------------------
    36 
    57 
    37 	abs_eap_am_tools_c * const m_am_tools; ///< This is pointer to the tools class. @see abs_eap_am_tools_c.
    58 	abs_eap_am_tools_c * const m_am_tools; ///< This is pointer to the tools class. @see abs_eap_am_tools_c.
    57 	//--------------------------------------------------
    78 	//--------------------------------------------------
    58 
    79 
    59 	/**
    80 	/**
    60 	 * The destructor of the eapol_session_key_c class does nothing special.
    81 	 * The destructor of the eapol_session_key_c class does nothing special.
    61 	 */
    82 	 */
    62 	EAP_FUNC_IMPORT virtual ~eapol_session_key_c();
    83 	EAP_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H virtual ~eapol_session_key_c();
    63 
    84 
    64 	/**
    85 	/**
    65 	 * The constructor of the eapol_session_key_c class does nothing special.
    86 	 * The constructor of the eapol_session_key_c class does nothing special.
    66 	 */
    87 	 */
    67 	EAP_FUNC_IMPORT eapol_session_key_c(
    88 	EAP_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H eapol_session_key_c(
    68 		abs_eap_am_tools_c * const tools,
    89 		abs_eap_am_tools_c * const tools,
    69 		eap_variable_data_c * const key, ///< Here is the key.
    90 		eap_variable_data_c * const key, ///< Here is the key.
    70 		const eapol_key_type_e key_type, ///< This the type of the key.
    91 		const eapol_key_type_e key_type, ///< This the type of the key.
    71 		const u32_t key_index, ///< This is the index of the key.
    92 		const u32_t key_index, ///< This is the index of the key.
    72 		const bool key_tx_bit, ///< This is the TX bit of the key.
    93 		const bool key_tx_bit, ///< This is the TX bit of the key.
    75 		);
    96 		);
    76 
    97 
    77 	/**
    98 	/**
    78 	 * The constructor of the eapol_session_key_c class does nothing special.
    99 	 * The constructor of the eapol_session_key_c class does nothing special.
    79 	 */
   100 	 */
    80 	EAP_FUNC_IMPORT eapol_session_key_c(
   101 	EAP_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H eapol_session_key_c(
    81 		abs_eap_am_tools_c * const tools
   102 		abs_eap_am_tools_c * const tools
    82 		);
   103 		);
    83 
   104 
    84 	EAP_FUNC_IMPORT const eap_variable_data_c * get_key() const;
   105 	EAP_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H const eap_variable_data_c * get_key() const;
    85 
   106 
    86 	EAP_FUNC_IMPORT const eap_variable_data_c * get_sequence_number() const;
   107 	EAP_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H const eap_variable_data_c * get_sequence_number() const;
    87 
   108 
    88 	EAP_FUNC_IMPORT eapol_key_type_e get_key_type() const;
   109 	EAP_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H eapol_key_type_e get_key_type() const;
    89 
   110 
    90 	EAP_FUNC_IMPORT u32_t get_key_index() const;
   111 	EAP_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H u32_t get_key_index() const;
    91 
   112 
    92 	EAP_FUNC_IMPORT bool get_key_tx_bit() const;
   113 	EAP_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H bool get_key_tx_bit() const;
    93 
   114 
    94 	EAP_FUNC_IMPORT bool get_is_valid() const;
   115 	EAP_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H bool get_is_valid() const;
    95 
   116 
    96 
   117 
    97 	EAP_FUNC_IMPORT eap_status_e set_key(const eap_variable_data_c * const key);
   118 	EAP_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H eap_status_e set_key(const eap_variable_data_c * const key);
    98 
   119 
    99 	EAP_FUNC_IMPORT eap_status_e set_sequence_number(eap_variable_data_c * const sequence_number);
   120 	EAP_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H eap_status_e set_sequence_number(eap_variable_data_c * const sequence_number);
   100 
   121 
   101 	EAP_FUNC_IMPORT void set_key_type(const eapol_key_type_e key_type);
   122 	EAP_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H void set_key_type(const eapol_key_type_e key_type);
   102 
   123 
   103 	EAP_FUNC_IMPORT void set_key_index(const u32_t key_index);
   124 	EAP_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H void set_key_index(const u32_t key_index);
   104 
   125 
   105 	EAP_FUNC_IMPORT void set_key_tx_bit(const bool key_tx_bit);
   126 	EAP_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H void set_key_tx_bit(const bool key_tx_bit);
   106 
   127 
   107 	EAP_FUNC_IMPORT static eap_const_string get_eapol_key_type_string(
   128 	EAP_FUNC_VISIBILITY_EAPOL_SESSION_KEY_H static eap_const_string get_eapol_key_type_string(
   108 		const eapol_key_type_e key_type);
   129 		const eapol_key_type_e key_type);
   109 
   130 
   110 	//--------------------------------------------------
   131 	//--------------------------------------------------
   111 }; // class eapol_session_key_c
   132 }; // class eapol_session_key_c
   112 
   133