eapol/eapol_framework/eapol_common/am/include/eap_file_config.h
changeset 52 c23bdf5a328a
parent 39 fe6b6762fccd
equal deleted inserted replaced
51:e863583e6720 52:c23bdf5a328a
    23 #define _FILECONFIG_H
    23 #define _FILECONFIG_H
    24 
    24 
    25 #include "eap_core_map.h"
    25 #include "eap_core_map.h"
    26 #include "eap_configuration_field.h"
    26 #include "eap_configuration_field.h"
    27 #include "abs_eap_am_file_input.h"
    27 #include "abs_eap_am_file_input.h"
       
    28 #include "eap_am_export.h"
       
    29 // Start: added by script change_export_macros.sh.
       
    30 #if defined(EAP_NO_EXPORT_EAP_FILE_CONFIG_H)
       
    31 	#define EAP_CLASS_VISIBILITY_EAP_FILE_CONFIG_H EAP_NONSHARABLE 
       
    32 	#define EAP_FUNC_VISIBILITY_EAP_FILE_CONFIG_H 
       
    33 	#define EAP_C_FUNC_VISIBILITY_EAP_FILE_CONFIG_H 
       
    34 	#define EAP_FUNC_EXPORT_EAP_FILE_CONFIG_H 
       
    35 	#define EAP_C_FUNC_EXPORT_EAP_FILE_CONFIG_H 
       
    36 #elif defined(EAP_EXPORT_EAP_FILE_CONFIG_H)
       
    37 	#define EAP_CLASS_VISIBILITY_EAP_FILE_CONFIG_H EAP_EXPORT 
       
    38 	#define EAP_FUNC_VISIBILITY_EAP_FILE_CONFIG_H EAP_FUNC_EXPORT 
       
    39 	#define EAP_C_FUNC_VISIBILITY_EAP_FILE_CONFIG_H EAP_C_FUNC_EXPORT 
       
    40 	#define EAP_FUNC_EXPORT_EAP_FILE_CONFIG_H EAP_FUNC_EXPORT 
       
    41 	#define EAP_C_FUNC_EXPORT_EAP_FILE_CONFIG_H EAP_C_FUNC_EXPORT 
       
    42 #else
       
    43 	#define EAP_CLASS_VISIBILITY_EAP_FILE_CONFIG_H EAP_IMPORT 
       
    44 	#define EAP_FUNC_VISIBILITY_EAP_FILE_CONFIG_H EAP_FUNC_IMPORT 
       
    45 	#define EAP_C_FUNC_VISIBILITY_EAP_FILE_CONFIG_H EAP_C_FUNC_IMPORT 
       
    46 	#define EAP_FUNC_EXPORT_EAP_FILE_CONFIG_H 
       
    47 	#define EAP_C_FUNC_EXPORT_EAP_FILE_CONFIG_H 
       
    48 #endif
       
    49 // End: added by script change_export_macros.sh.
       
    50 
    28 
    51 
    29 class eap_tlv_header_c;
    52 class eap_tlv_header_c;
    30 
    53 
    31 
    54 
    32 template <class Type>
    55 template <class Type>
    34 {
    57 {
    35 	return a < b ? a : b;
    58 	return a < b ? a : b;
    36 }
    59 }
    37 
    60 
    38 
    61 
    39 class EAP_EXPORT eap_config_value_c
    62 class EAP_CLASS_VISIBILITY_EAP_FILE_CONFIG_H eap_config_value_c
    40 {
    63 {
    41 private:
    64 private:
    42 
    65 
    43 	abs_eap_am_tools_c* const m_am_tools;
    66 	abs_eap_am_tools_c* const m_am_tools;
    44 
    67 
    50 
    73 
    51 	bool m_is_valid;
    74 	bool m_is_valid;
    52 
    75 
    53 public:
    76 public:
    54 
    77 
    55 	EAP_FUNC_IMPORT virtual ~eap_config_value_c();
    78 	EAP_FUNC_VISIBILITY_EAP_FILE_CONFIG_H virtual ~eap_config_value_c();
    56 
    79 
    57 	EAP_FUNC_IMPORT eap_config_value_c(
    80 	EAP_FUNC_VISIBILITY_EAP_FILE_CONFIG_H eap_config_value_c(
    58 		abs_eap_am_tools_c* const tools);
    81 		abs_eap_am_tools_c* const tools);
    59 
    82 
    60 	EAP_FUNC_IMPORT void set_subsection(
    83 	EAP_FUNC_VISIBILITY_EAP_FILE_CONFIG_H void set_subsection(
    61 		eap_core_map_c<eap_config_value_c, abs_eap_core_map_c, eap_variable_data_c> * const subsection_map);
    84 		eap_core_map_c<eap_config_value_c, abs_eap_core_map_c, eap_variable_data_c> * const subsection_map);
    62 
    85 
    63 	EAP_FUNC_IMPORT eap_core_map_c<eap_config_value_c, abs_eap_core_map_c, eap_variable_data_c> * get_subsection();
    86 	EAP_FUNC_VISIBILITY_EAP_FILE_CONFIG_H eap_core_map_c<eap_config_value_c, abs_eap_core_map_c, eap_variable_data_c> * get_subsection();
    64 
    87 
    65 	EAP_FUNC_IMPORT eap_variable_data_c * get_data();
    88 	EAP_FUNC_VISIBILITY_EAP_FILE_CONFIG_H eap_variable_data_c * get_data();
    66 
    89 
    67 	EAP_FUNC_IMPORT const eap_variable_data_c * get_const_data() const;
    90 	EAP_FUNC_VISIBILITY_EAP_FILE_CONFIG_H const eap_variable_data_c * get_const_data() const;
    68 
    91 
    69 	EAP_FUNC_IMPORT void set_type(const eap_configure_type_e type);
    92 	EAP_FUNC_VISIBILITY_EAP_FILE_CONFIG_H void set_type(const eap_configure_type_e type);
    70 
    93 
    71 	EAP_FUNC_IMPORT eap_configure_type_e get_type();
    94 	EAP_FUNC_VISIBILITY_EAP_FILE_CONFIG_H eap_configure_type_e get_type();
    72 
    95 
    73 	EAP_FUNC_IMPORT eap_configure_type_e get_const_type() const;
    96 	EAP_FUNC_VISIBILITY_EAP_FILE_CONFIG_H eap_configure_type_e get_const_type() const;
    74 
    97 
    75 	EAP_FUNC_IMPORT void object_increase_reference_count();
    98 	EAP_FUNC_VISIBILITY_EAP_FILE_CONFIG_H void object_increase_reference_count();
    76 
    99 
    77 	EAP_FUNC_IMPORT bool get_is_valid() const;
   100 	EAP_FUNC_VISIBILITY_EAP_FILE_CONFIG_H bool get_is_valid() const;
    78 
   101 
    79 };
   102 };
    80 
   103 
    81 const u32_t MAX_LINE_LENGTH = 1024;
   104 const u32_t MAX_LINE_LENGTH = 1024;
    82 const u32_t MAX_CONFIG_TYPE_LENGTH = 32;
   105 const u32_t MAX_CONFIG_TYPE_LENGTH = 32;
   138 		eap_configure_type_u32array
   161 		eap_configure_type_u32array
   139 	},
   162 	},
   140 };
   163 };
   141 
   164 
   142 
   165 
   143 class EAP_EXPORT eap_file_config_c
   166 class EAP_CLASS_VISIBILITY_EAP_FILE_CONFIG_H eap_file_config_c
   144 : public abs_eap_core_map_c
   167 : public abs_eap_core_map_c
   145 {
   168 {
   146   
   169   
   147  private:
   170  private:
   148 
   171 
   243 	eap_status_e add_option(
   266 	eap_status_e add_option(
   244 		const eap_tlv_header_c * const option_header);
   267 		const eap_tlv_header_c * const option_header);
   245 
   268 
   246  public:
   269  public:
   247 
   270 
   248 	EAP_FUNC_IMPORT eap_file_config_c(
   271 	EAP_FUNC_VISIBILITY_EAP_FILE_CONFIG_H eap_file_config_c(
   249 		abs_eap_am_tools_c* const tools);
   272 		abs_eap_am_tools_c* const tools);
   250 
   273 
   251 	EAP_FUNC_IMPORT virtual ~eap_file_config_c();
   274 	EAP_FUNC_VISIBILITY_EAP_FILE_CONFIG_H virtual ~eap_file_config_c();
   252 
   275 
   253 	EAP_FUNC_IMPORT eap_status_e configure(
   276 	EAP_FUNC_VISIBILITY_EAP_FILE_CONFIG_H eap_status_e configure(
   254 		abs_eap_am_file_input_c * const file);
   277 		abs_eap_am_file_input_c * const file);
   255 
   278 
   256 	EAP_FUNC_IMPORT eap_status_e read_configuration_message(
   279 	EAP_FUNC_VISIBILITY_EAP_FILE_CONFIG_H eap_status_e read_configuration_message(
   257 		const eap_variable_data_c * const configuration_message);
   280 		const eap_variable_data_c * const configuration_message);
   258 
   281 
   259 	EAP_FUNC_IMPORT eap_status_e read_configure(
   282 	EAP_FUNC_VISIBILITY_EAP_FILE_CONFIG_H eap_status_e read_configure(
   260 		const eap_configuration_field_c * const field,
   283 		const eap_configuration_field_c * const field,
   261 		eap_variable_data_c* const data);
   284 		eap_variable_data_c* const data);
   262 
   285 
   263 	bool get_is_valid() const
   286 	bool get_is_valid() const
   264 	{
   287 	{