eapol/eapol_framework/eapol_common/include/eap_general_header_base.h
changeset 52 c23bdf5a328a
parent 33 938269283a16
equal deleted inserted replaced
51:e863583e6720 52:c23bdf5a328a
    24 
    24 
    25 
    25 
    26 #include "eap_am_assert.h"
    26 #include "eap_am_assert.h"
    27 #include "eap_am_tools.h"
    27 #include "eap_am_tools.h"
    28 #include "eap_tools.h"
    28 #include "eap_tools.h"
       
    29 #include "eap_am_export.h"
       
    30 // Start: added by script change_export_macros.sh.
       
    31 #if defined(EAP_NO_EXPORT_EAP_GENERAL_HEADER_BASE_H)
       
    32 	#define EAP_CLASS_VISIBILITY_EAP_GENERAL_HEADER_BASE_H EAP_NONSHARABLE 
       
    33 	#define EAP_FUNC_VISIBILITY_EAP_GENERAL_HEADER_BASE_H 
       
    34 	#define EAP_C_FUNC_VISIBILITY_EAP_GENERAL_HEADER_BASE_H 
       
    35 	#define EAP_FUNC_EXPORT_EAP_GENERAL_HEADER_BASE_H 
       
    36 	#define EAP_C_FUNC_EXPORT_EAP_GENERAL_HEADER_BASE_H 
       
    37 #elif defined(EAP_EXPORT_EAP_GENERAL_HEADER_BASE_H)
       
    38 	#define EAP_CLASS_VISIBILITY_EAP_GENERAL_HEADER_BASE_H EAP_EXPORT 
       
    39 	#define EAP_FUNC_VISIBILITY_EAP_GENERAL_HEADER_BASE_H EAP_FUNC_EXPORT 
       
    40 	#define EAP_C_FUNC_VISIBILITY_EAP_GENERAL_HEADER_BASE_H EAP_C_FUNC_EXPORT 
       
    41 	#define EAP_FUNC_EXPORT_EAP_GENERAL_HEADER_BASE_H EAP_FUNC_EXPORT 
       
    42 	#define EAP_C_FUNC_EXPORT_EAP_GENERAL_HEADER_BASE_H EAP_C_FUNC_EXPORT 
       
    43 #else
       
    44 	#define EAP_CLASS_VISIBILITY_EAP_GENERAL_HEADER_BASE_H EAP_IMPORT 
       
    45 	#define EAP_FUNC_VISIBILITY_EAP_GENERAL_HEADER_BASE_H EAP_FUNC_IMPORT 
       
    46 	#define EAP_C_FUNC_VISIBILITY_EAP_GENERAL_HEADER_BASE_H EAP_C_FUNC_IMPORT 
       
    47 	#define EAP_FUNC_EXPORT_EAP_GENERAL_HEADER_BASE_H 
       
    48 	#define EAP_C_FUNC_EXPORT_EAP_GENERAL_HEADER_BASE_H 
       
    49 #endif
       
    50 // End: added by script change_export_macros.sh.
       
    51 
    29 
    52 
    30 /** @file */
    53 /** @file */
    31 
    54 
    32 /** This is general base class defining the view to packet header.
    55 /** This is general base class defining the view to packet header.
    33  */
    56  */
    34 class EAP_EXPORT eap_general_header_base_c
    57 class EAP_CLASS_VISIBILITY_EAP_GENERAL_HEADER_BASE_H eap_general_header_base_c
    35 {
    58 {
    36 private:
    59 private:
    37 	//--------------------------------------------------
    60 	//--------------------------------------------------
    38 
    61 
    39 	/// This is pointer to the tools class.
    62 	/// This is pointer to the tools class.
    62 public:
    85 public:
    63 	//--------------------------------------------------
    86 	//--------------------------------------------------
    64 
    87 
    65 	/// Destructor does nothing special.
    88 	/// Destructor does nothing special.
    66 	/// NOTE the header buffer is not deleted here.
    89 	/// NOTE the header buffer is not deleted here.
    67 	EAP_FUNC_IMPORT virtual ~eap_general_header_base_c();
    90 	EAP_FUNC_VISIBILITY_EAP_GENERAL_HEADER_BASE_H virtual ~eap_general_header_base_c();
    68 
    91 
    69 	/// Constructor does nothing special.
    92 	/// Constructor does nothing special.
    70 	/// The tools parameter is pointer to tools object.
    93 	/// The tools parameter is pointer to tools object.
    71 	/// The header_buffer parameter is pointer to buffer of the packet including header and data.
    94 	/// The header_buffer parameter is pointer to buffer of the packet including header and data.
    72 	/// The header_buffer_length parameter is length of the header_buffer.
    95 	/// The header_buffer_length parameter is length of the header_buffer.
    73 	EAP_FUNC_IMPORT eap_general_header_base_c(
    96 	EAP_FUNC_VISIBILITY_EAP_GENERAL_HEADER_BASE_H eap_general_header_base_c(
    74 		abs_eap_am_tools_c * const tools,
    97 		abs_eap_am_tools_c * const tools,
    75 		void * const header_buffer,
    98 		void * const header_buffer,
    76 		const u32_t header_buffer_length);
    99 		const u32_t header_buffer_length);
    77 
   100 
    78 	/// This function returns the pointer to the offset of the data of the packet.
   101 	/// This function returns the pointer to the offset of the data of the packet.
    79 	EAP_FUNC_IMPORT u8_t * get_header_offset(const u32_t offset, const u32_t data_length) const;
   102 	EAP_FUNC_VISIBILITY_EAP_GENERAL_HEADER_BASE_H u8_t * get_header_offset(const u32_t offset, const u32_t data_length) const;
    80 
   103 
    81 	/// This function returns the pointer to the data of the packet.
   104 	/// This function returns the pointer to the data of the packet.
    82 	EAP_FUNC_IMPORT u8_t * get_header_buffer(const u32_t data_length) const;
   105 	EAP_FUNC_VISIBILITY_EAP_GENERAL_HEADER_BASE_H u8_t * get_header_buffer(const u32_t data_length) const;
    83 
   106 
    84 	/// This function sets the buffer of the packet.
   107 	/// This function sets the buffer of the packet.
    85 	/// The header_buffer parameter is pointer to buffer of the packet including header and data.
   108 	/// The header_buffer parameter is pointer to buffer of the packet including header and data.
    86 	/// The header_buffer_length parameter is length of the header_buffer.
   109 	/// The header_buffer_length parameter is length of the header_buffer.
    87 	EAP_FUNC_IMPORT void set_header_buffer(u8_t * const header_buffer, const u32_t header_buffer_length);
   110 	EAP_FUNC_VISIBILITY_EAP_GENERAL_HEADER_BASE_H void set_header_buffer(u8_t * const header_buffer, const u32_t header_buffer_length);
    88 
   111 
    89 	/// This function returns the length of the header buffer.
   112 	/// This function returns the length of the header buffer.
    90 	EAP_FUNC_IMPORT u32_t get_header_buffer_length() const;
   113 	EAP_FUNC_VISIBILITY_EAP_GENERAL_HEADER_BASE_H u32_t get_header_buffer_length() const;
    91 
   114 
    92 	/// This function returns validity of the object.
   115 	/// This function returns validity of the object.
    93 	EAP_FUNC_IMPORT bool get_is_valid() const;
   116 	EAP_FUNC_VISIBILITY_EAP_GENERAL_HEADER_BASE_H bool get_is_valid() const;
    94 
   117 
    95 	/// This function returns pointer to the tools object.
   118 	/// This function returns pointer to the tools object.
    96 	EAP_FUNC_IMPORT abs_eap_am_tools_c * get_am_tools() const;
   119 	EAP_FUNC_VISIBILITY_EAP_GENERAL_HEADER_BASE_H abs_eap_am_tools_c * get_am_tools() const;
    97 
   120 
    98 	/// This function checks the validity of derived header.
   121 	/// This function checks the validity of derived header.
    99 	virtual eap_status_e check_header() const = 0;
   122 	virtual eap_status_e check_header() const = 0;
   100 
   123 
   101 
   124 
   102 #if defined(USE_EAP_ERROR_TESTS)
   125 #if defined(USE_EAP_ERROR_TESTS)
   103 
   126 
   104 	EAP_FUNC_IMPORT void set_error_detected(const bool error_detected);
   127 	EAP_FUNC_VISIBILITY_EAP_GENERAL_HEADER_BASE_H void set_error_detected(const bool error_detected);
   105 
   128 
   106 	EAP_FUNC_IMPORT bool get_error_detected();
   129 	EAP_FUNC_VISIBILITY_EAP_GENERAL_HEADER_BASE_H bool get_error_detected();
   107 
   130 
   108 #endif //#if defined(USE_EAP_ERROR_TESTS)
   131 #endif //#if defined(USE_EAP_ERROR_TESTS)
   109 
   132 
   110 	// 
   133 	// 
   111 	//--------------------------------------------------
   134 	//--------------------------------------------------