eapol/eapol_framework/eapol_common/include/eap_buffer.h
changeset 49 43351a4f2da3
parent 26 9abfd4f00d37
--- a/eapol/eapol_framework/eapol_common/include/eap_buffer.h	Fri Sep 03 09:22:44 2010 +0300
+++ b/eapol/eapol_framework/eapol_common/include/eap_buffer.h	Thu Sep 16 13:07:04 2010 +0300
@@ -24,6 +24,29 @@
 
 #include "eap_am_assert.h"
 #include "eap_variable_data.h"
+#include "eap_am_export.h"
+// Start: added by script change_export_macros.sh.
+#if defined(EAP_NO_EXPORT_EAP_BUFFER_H)
+	#define EAP_CLASS_VISIBILITY_EAP_BUFFER_H EAP_NONSHARABLE 
+	#define EAP_FUNC_VISIBILITY_EAP_BUFFER_H 
+	#define EAP_C_FUNC_VISIBILITY_EAP_BUFFER_H 
+	#define EAP_FUNC_EXPORT_EAP_BUFFER_H 
+	#define EAP_C_FUNC_EXPORT_EAP_BUFFER_H 
+#elif defined(EAP_EXPORT_EAP_BUFFER_H)
+	#define EAP_CLASS_VISIBILITY_EAP_BUFFER_H EAP_EXPORT 
+	#define EAP_FUNC_VISIBILITY_EAP_BUFFER_H EAP_FUNC_EXPORT 
+	#define EAP_C_FUNC_VISIBILITY_EAP_BUFFER_H EAP_C_FUNC_EXPORT 
+	#define EAP_FUNC_EXPORT_EAP_BUFFER_H EAP_FUNC_EXPORT 
+	#define EAP_C_FUNC_EXPORT_EAP_BUFFER_H EAP_C_FUNC_EXPORT 
+#else
+	#define EAP_CLASS_VISIBILITY_EAP_BUFFER_H EAP_IMPORT 
+	#define EAP_FUNC_VISIBILITY_EAP_BUFFER_H EAP_FUNC_IMPORT 
+	#define EAP_C_FUNC_VISIBILITY_EAP_BUFFER_H EAP_C_FUNC_IMPORT 
+	#define EAP_FUNC_EXPORT_EAP_BUFFER_H 
+	#define EAP_C_FUNC_EXPORT_EAP_BUFFER_H 
+#endif
+// End: added by script change_export_macros.sh.
+
 
 //--------------------------------------------------
 
@@ -75,7 +98,7 @@
 
 
 /// Network packets are handled through eap_buf_chain_base_c class.
-class EAP_EXPORT eap_buf_chain_base_c
+class EAP_CLASS_VISIBILITY_EAP_BUFFER_H eap_buf_chain_base_c
 {
 private:
 	//--------------------------------------------------
@@ -139,28 +162,28 @@
 	/**
 	 * This function initializes the eap_buf_chain_base_c object.
 	 */
-	EAP_FUNC_IMPORT eap_status_e initialize(
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H eap_status_e initialize(
 		const u32_t mem_guard_length);
 
 	/**
 	 * Forses the inheritance.
 	 */
-	EAP_FUNC_IMPORT virtual void force_inheritance() = 0;
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H virtual void force_inheritance() = 0;
 
 	/**
 	 * Function checks the memory guard bytes.
 	 */
-	EAP_FUNC_IMPORT bool check_guard_bytes(const u8_t * const guard) const;
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H bool check_guard_bytes(const u8_t * const guard) const;
 
 	/**
 	 * Function sets the memory guard bytes.
 	 */
-	EAP_FUNC_IMPORT void set_mem_guard_bytes();
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H void set_mem_guard_bytes();
 
 	/**
 	 * Function zeroes the data buffer.
 	 */
-	EAP_FUNC_IMPORT void reset_data_buffer();
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H void reset_data_buffer();
 
 	//--------------------------------------------------
 protected:
@@ -169,7 +192,7 @@
 	/**
 	 * @return Returns pointer to the tools object.
 	 */
-	EAP_FUNC_IMPORT abs_eap_am_tools_c * get_am_tools();
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H abs_eap_am_tools_c * get_am_tools();
 
 	//--------------------------------------------------
 public:
@@ -178,13 +201,13 @@
 	/**
 	 * Function checks the all memory guard bytes.
 	 */
-	EAP_FUNC_IMPORT bool check_guards() const;
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H bool check_guards() const;
 
 	/**
 	 * The destructor of the eap_buf_chain_base_c class checks memory guards
 	 * and frees the allocated buffer.
 	 */
-	EAP_FUNC_IMPORT virtual ~eap_buf_chain_base_c();
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H virtual ~eap_buf_chain_base_c();
 
 	/**
 	 * The constructor of the eap_buf_chain_wr class initializes attributes using
@@ -215,7 +238,7 @@
 	 *         -(eap_header_offset+ trailer_length)));
 	 * @endcode
 	 */
-	EAP_FUNC_IMPORT eap_buf_chain_base_c(
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H eap_buf_chain_base_c(
 		const eap_write_buffer_e, 
 		abs_eap_am_tools_c * const tools,
 		u8_t * const data, 
@@ -249,7 +272,7 @@
 	 *         -(eap_header_offset+ trailer_length)));
 	 * @endcode
 	 */
-	EAP_FUNC_IMPORT eap_buf_chain_base_c(
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H eap_buf_chain_base_c(
 		const eap_read_buffer_e,
 		abs_eap_am_tools_c * const tools,
 		const u8_t * const data, 
@@ -279,7 +302,7 @@
 	 *         -(eap_header_offset+ trailer_length)));
 	 * @endcode
 	 */
-	EAP_FUNC_IMPORT eap_buf_chain_base_c(
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H eap_buf_chain_base_c(
 		const eap_write_buffer_e,
 		abs_eap_am_tools_c * const tools,
 		const u32_t data_length);
@@ -307,7 +330,7 @@
 	 *         -(eap_header_offset+ trailer_length)));
 	 * @endcode
 	 */
-	EAP_FUNC_IMPORT eap_buf_chain_base_c(
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H eap_buf_chain_base_c(
 		const eap_read_buffer_e,
 		abs_eap_am_tools_c * const tools,
 		const u32_t data_length);
@@ -315,17 +338,17 @@
 	/**
 	 * @return Returns count of memory guard bytes.
 	 */
-	EAP_FUNC_IMPORT u32_t get_mem_guard_length();
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H u32_t get_mem_guard_length();
 
 	/**
 	 * The get_buffer_length() function returns the length of buffer in bytes.
 	 */
-	EAP_FUNC_IMPORT u32_t get_buffer_length() const;
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H u32_t get_buffer_length() const;
 
 	/**
 	 * The get_data_length() function returns count of data bytes in the buffer.
 	 */
-	EAP_FUNC_IMPORT u32_t get_data_length() const;
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H u32_t get_data_length() const;
 
 	/**
 	 * The get_data_offset() function returns pointer to the data in offset (p_offset).
@@ -335,7 +358,7 @@
 	 * NOTE user of the eap_buf_chain_wr class must obtain the pointer to the data using
 	 * this or the get_data() function. These functions can handle the memory guard.
 	 */
-	EAP_FUNC_IMPORT u8_t * get_data_offset(const u32_t p_offset, const u32_t p_continuous_bytes) const;
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H u8_t * get_data_offset(const u32_t p_offset, const u32_t p_continuous_bytes) const;
 
 	/**
 	 * The get_data() function function returns pointer to the data.
@@ -344,100 +367,100 @@
 	 * NOTE user of the eap_buf_chain_wr class must obtain the pointer to the data using
 	 * this or the get_data_offset() function. These functions can handle the memory guard.
 	 */
-	EAP_FUNC_IMPORT u8_t * get_data(const u32_t p_continuous_bytes) const;
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H u8_t * get_data(const u32_t p_continuous_bytes) const;
 
 	/**
 	 * The set_buffer_length() function allocates the buffer of length bytes.
 	 */
-	EAP_FUNC_IMPORT eap_status_e set_buffer_length(const u32_t length);
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H eap_status_e set_buffer_length(const u32_t length);
 
 	/**
 	 * The set_data_length() function set the data length in the buffer.
 	 */
-	EAP_FUNC_IMPORT eap_status_e set_data_length(const u32_t length);
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H eap_status_e set_data_length(const u32_t length);
 
 	/**
 	 * The get_is_valid() function returns the status of the object.
 	 * @return True indicates the object is initialized.
 	 */
-	EAP_FUNC_IMPORT bool get_is_valid() const;
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H bool get_is_valid() const;
 
 	/**
 	 * The get_is_valid() function returns the status of the
 	 * data included in object.
 	 * @return True indicates the object includes valid data.
 	 */
-	EAP_FUNC_IMPORT bool get_is_valid_data() const;
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H bool get_is_valid_data() const;
 
 	/**
 	 * The set_is_manipulated() function sets flag to indicate this packet is manipulated.
 	 * This is used for testing purposes.
 	 */
-	EAP_FUNC_IMPORT void set_is_manipulated();
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H void set_is_manipulated();
 
 	/**
 	 * The get_is_manipulated() function returns flag to indicate this packet is manipulated.
 	 * This is used for testing purposes.
 	 */
-	EAP_FUNC_IMPORT bool get_is_manipulated();
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H bool get_is_manipulated();
 
 	/**
 	 * This function sets the index of sent packet.
 	 * This is used for testing purposes.
 	 */
-	EAP_FUNC_IMPORT void set_send_packet_index(const u32_t send_packet_index);
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H void set_send_packet_index(const u32_t send_packet_index);
 
 	/**
 	 * This function returns the index of sent packet.
 	 * This is used for testing purposes.
 	 */
-	EAP_FUNC_IMPORT u32_t get_send_packet_index();
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H u32_t get_send_packet_index();
 
 	/**
 	 * The set_random_error_type() function sets the type of manipulation of the packet.
 	 * This is used for testing purposes.
 	 */
-	EAP_FUNC_IMPORT void set_random_error_type(eap_random_error_type error_type);
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H void set_random_error_type(eap_random_error_type error_type);
 
 	/**
 	 * The get_random_error_type() function returns the type of manipulation of the packet.
 	 * This is used for testing purposes.
 	 */
-	EAP_FUNC_IMPORT eap_random_error_type get_random_error_type();
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H eap_random_error_type get_random_error_type();
 
 	/**
 	 * The set_do_packet_retransmission() function sets the re-transmission flag of this packet.
 	 * Packet will be re-transmitted by lower layer when do_packet_retransmission_when_true is true.
 	 * Packet will not re-transmitted by lower layer when do_packet_retransmission_when_true is false.
 	 */
-	EAP_FUNC_IMPORT void set_do_packet_retransmission(const bool do_packet_retransmission_when_true);
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H void set_do_packet_retransmission(const bool do_packet_retransmission_when_true);
 
 	/**
 	 * The set_do_packet_retransmission() function gets the re-transmission flag of this packet.
 	 */
-	EAP_FUNC_IMPORT bool get_do_packet_retransmission();
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H bool get_do_packet_retransmission();
 
 	/**
 	 * This sets whether the sender is client or server.
 	 * This is used in testing.
 	 */
-	EAP_FUNC_IMPORT void set_is_client(const bool is_client_when_true);
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H void set_is_client(const bool is_client_when_true);
 
 	/**
 	 * This gets whether the sender is client or server.
 	 * This is used in testing.
 	 */
-	EAP_FUNC_IMPORT bool get_is_client() const;
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H bool get_is_client() const;
 
 	/**
 	 * This is used in testing.
 	 */
-	EAP_FUNC_IMPORT void set_do_length_checks(const bool do_length_checks);
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H void set_do_length_checks(const bool do_length_checks);
 
 	/**
 	 * This is used in testing.
 	 */
-	EAP_FUNC_IMPORT bool get_do_length_checks() const;
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H bool get_do_length_checks() const;
 
 
 	/**
@@ -447,7 +470,7 @@
 	 * temporal key beforehand the key is used.
 	 * This is optimization to fasten the key configuration.
 	 */
-	EAP_FUNC_IMPORT void set_encrypt(const bool encrypt_when_true);
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H void set_encrypt(const bool encrypt_when_true);
 
 	/**
 	 * This gets whether this packet must be encrypted (true) or not (false).
@@ -456,20 +479,20 @@
 	 * temporal key beforehand the key is used.
 	 * This is optimization to fasten the key configuration.
 	 */
-	EAP_FUNC_IMPORT bool get_encrypt() const;
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H bool get_encrypt() const;
 
 
 	/**
 	 * This sets the pointer of sender stack.
 	 * This is used in testing.
 	 */
-	EAP_FUNC_IMPORT void set_stack_address(const void * const stack_address);
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H void set_stack_address(const void * const stack_address);
 
 	/**
 	 * This gets the pointer of sender stack.
 	 * This is used in testing.
 	 */
-	EAP_FUNC_IMPORT const void * get_stack_address() const;
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H const void * get_stack_address() const;
 
 	/**
 	 * The add_data() function adds data to the end of the buffer.
@@ -477,7 +500,7 @@
 	 * @param buffer points the data to be added.
 	 * @param buffer_length is length of the buffer in bytes.
 	 */
-	EAP_FUNC_IMPORT eap_status_e add_data(
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H eap_status_e add_data(
 		const void * const buffer,
 		const u32_t buffer_length);
 
@@ -486,7 +509,7 @@
 	 * If the buffer is empty the data is added to begin of the buffer.
 	 * @param buffer points the data to be added.
 	 */
-	EAP_FUNC_IMPORT eap_status_e add_data(
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H eap_status_e add_data(
 		const eap_variable_data_c * const buffer);
 
 	/**
@@ -495,7 +518,7 @@
 	 * @param buffer points the data to be added.
 	 * @param buffer_length is length of the buffer in bytes.
 	 */
-	EAP_FUNC_IMPORT eap_status_e add_data_to_offset(
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H eap_status_e add_data_to_offset(
 		const u32_t offset,
 		const void * const buffer,
 		const u32_t buffer_length);
@@ -505,7 +528,7 @@
 	 * @param offset tells the place where data will begin.
 	 * @param buffer points the data to be added.
 	 */
-	EAP_FUNC_IMPORT eap_status_e add_data_to_offset(
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H eap_status_e add_data_to_offset(
 		const u32_t offset,
 		const eap_variable_data_c * const buffer);
 
@@ -518,7 +541,7 @@
 /// Write only network packets are handled through eap_buf_chain_base_c class.
 /// Post-suffix _wr_c indicates the buffer has write attribute on.
 /// The eap_buf_chain_wr_c class is derived from eap_buf_chain_base class.
-class EAP_EXPORT eap_buf_chain_wr_c
+class EAP_CLASS_VISIBILITY_EAP_BUFFER_H eap_buf_chain_wr_c
 : public eap_buf_chain_base_c
 {
 private:
@@ -526,7 +549,7 @@
 	/**
 	 * Forses the inheritance.
 	 */
-	EAP_FUNC_IMPORT void force_inheritance();
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H void force_inheritance();
 
 	//--------------------------------------------------
 protected:
@@ -539,13 +562,13 @@
 	/**
 	 * The destructor does nothing special.
 	 */
-	EAP_FUNC_IMPORT virtual ~eap_buf_chain_wr_c();
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H virtual ~eap_buf_chain_wr_c();
 
 	/**
 	 * The costructor does nothing special. It just initializes all member attributes.
 	 * This version uses preallocated buffer.
 	 */
-	EAP_FUNC_IMPORT eap_buf_chain_wr_c(
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H eap_buf_chain_wr_c(
 		const eap_write_buffer_e,
 		abs_eap_am_tools_c * const tools,
 		u8_t * const data,
@@ -558,7 +581,7 @@
 	 * The costructor does nothing special. It just initializes all member attributes.
 	 * This version allocates buffer from heap.
 	 */
-	EAP_FUNC_IMPORT eap_buf_chain_wr_c(
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H eap_buf_chain_wr_c(
 		const eap_write_buffer_e,
 		abs_eap_am_tools_c * const tools,
 		const u32_t data_length);
@@ -568,20 +591,20 @@
 	 * This version does not allocate buffer.
 	 * You must call set_buffer_length() member function to allocate buffer.
 	 */
-	EAP_FUNC_IMPORT eap_buf_chain_wr_c(
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H eap_buf_chain_wr_c(
 		const eap_write_buffer_e,
 		abs_eap_am_tools_c * const tools);
 
 	/**
 	 * @return Returns the pointer to the ethernet header.
 	 */
-	EAP_FUNC_IMPORT u8_t * get_ethernet_header();
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H u8_t * get_ethernet_header();
 
 	/**
 	 * The copy() function copies the eap_buf_chain_wr object.
 	 * Data is copied to new allocated buffer.
 	 */
-	EAP_FUNC_IMPORT eap_buf_chain_wr_c * copy();
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H eap_buf_chain_wr_c * copy();
 
 	// 
 	//--------------------------------------------------
@@ -591,7 +614,7 @@
 /// Read only network packets are handled through eap_buf_chain_rd_c class.
 /// Post-suffix _rd_c indicates the buffer has read only attribute on.
 /// The eap_buf_chain_rd_c class is derived from eap_buf_chain_base class.
-class EAP_EXPORT eap_buf_chain_rd_c
+class EAP_CLASS_VISIBILITY_EAP_BUFFER_H eap_buf_chain_rd_c
 : public eap_buf_chain_base_c
 {
 private:
@@ -599,7 +622,7 @@
 	/**
 	 * Forses the inheritance.
 	 */
-	EAP_FUNC_IMPORT void force_inheritance();
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H void force_inheritance();
 
 	//--------------------------------------------------
 protected:
@@ -612,7 +635,7 @@
 	/**
 	 * The destructor of the eap_buf_chain_rd_c class checks memory guards.
 	 */
-	EAP_FUNC_IMPORT virtual ~eap_buf_chain_rd_c();
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H virtual ~eap_buf_chain_rd_c();
 
 	/**
 	 * The constructor of the eap_buf_chain_wr class initializes attributes using
@@ -639,7 +662,7 @@
 	 *         -(eap_header_offset+ trailer_length)));
 	 * @endcode
 	 */
-	EAP_FUNC_IMPORT eap_buf_chain_rd_c(
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H eap_buf_chain_rd_c(
 		const eap_read_buffer_e, 
 		abs_eap_am_tools_c * const tools,
 		const u8_t * const data, 
@@ -650,7 +673,7 @@
 	 * The costructor does nothing special. It just initializes all member attributes.
 	 * This version allocates buffer from heap.
 	 */
-	EAP_FUNC_IMPORT eap_buf_chain_rd_c(
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H eap_buf_chain_rd_c(
 		const eap_read_buffer_e,
 		abs_eap_am_tools_c * const tools,
 		const u32_t data_length);
@@ -662,7 +685,7 @@
 	 * NOTE user of the eap_buf_chain_wr class must obtain the pointer to the data using
 	 * this or the get_data_offset() function. These functions can handle the memory guard.
 	 */
-	EAP_FUNC_IMPORT const u8_t * get_data(const u32_t p_continuous_bytes) const;
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H const u8_t * get_data(const u32_t p_continuous_bytes) const;
 
 	/**
 	 * The get_data_offset() function returns pointer to the data in offset (p_offset).
@@ -672,12 +695,12 @@
 	 * NOTE user of the eap_buf_chain_wr class must obtain the pointer to the data using
 	 * this or the get_data() function. These functions can handle the memory guard.
 	 */
-	EAP_FUNC_IMPORT const u8_t * get_data_offset(const u32_t p_offset, const u32_t p_continuous_bytes) const;
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H const u8_t * get_data_offset(const u32_t p_offset, const u32_t p_continuous_bytes) const;
 
 	/**
 	 * @return Returns the pointer to the ethernet header.
 	 */
-	EAP_FUNC_IMPORT const u8_t * get_ethernet_header() const;
+	EAP_FUNC_VISIBILITY_EAP_BUFFER_H const u8_t * get_ethernet_header() const;
 
 	// 
 	//--------------------------------------------------