eap_tlv_message_data_c Class Reference

class eap_tlv_message_data_c
Here is a figure of message data composed of Attribute-Value Pairs (See eap_tlv_header_c). Value data follows eap_tlv_message_data_c.
  EAP-TLV-message data:
  0                   1                   2                   3   
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                              Type                             |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                             Length = 8                        |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                              Value 1                          |
 +-+-                                                         -+-+
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                              Type                             |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                             Length = 4                        |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                              Value 2                          |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                              Type                             |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                             Length = 4                        |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                              Value 3                          |
 +-+-                                                         -+-+
 |                                                               |
 +-+-                                                         -+-+
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

 NOTE, the length of value could be anythin between 0 ... (2^32)-1.
 Only the free memory limits the length of the value.
 There are no padding between Attribute-Value Pairs.
 The next Attribute-Value Pair starts exactly after the previous
 Value of previous Attribute-Value Pair.
Public Member Functions
eap_tlv_message_data_c(abs_eap_am_tools_c *const )
~eap_tlv_message_data_c()
EAP_FUNC_IMPORT eap_status_eadd_message_data(const eap_tlv_type_t, const u32_t, const void *const )
EAP_FUNC_IMPORT eap_status_eadd_message_data_array(const eap_tlv_type_t, const u32_t, eap_array_c< eap_variable_data_c > *const )
EAP_FUNC_IMPORT eap_status_eadd_message_header(const eap_tlv_type_t, const u32_t)
EAP_FUNC_IMPORT eap_status_eallocate_message_buffer(const eap_tlv_type_t, const u32_t, void **const )
EAP_FUNC_IMPORT eap_status_eallocate_message_data_buffer(const u32_t)
EAP_FUNC_IMPORT eap_status_ecopy_message_data(const u32_t, const void *const )
EAP_FUNC_IMPORT boolget_is_valid()
EAP_FUNC_IMPORT void *get_message_data()
EAP_FUNC_IMPORT u32_tget_message_data_length()
EAP_FUNC_IMPORT u32_tobject_decrease_reference_count()
EAP_FUNC_IMPORT voidobject_increase_reference_count()
EAP_FUNC_IMPORT eap_status_eparse_message_data(eap_array_c< eap_tlv_header_c > *const )
EAP_FUNC_IMPORT eap_status_eset_message_data(const u32_t, const void *const )
Private Attributes
abs_eap_am_tools_c *constm_am_tools
eap_variable_data_c m_message_data

Constructor & Destructor Documentation

eap_tlv_message_data_c(abs_eap_am_tools_c *const)

EAP_FUNC_IMPORTeap_tlv_message_data_c(abs_eap_am_tools_c *const tools)

The constructor of the eap_tlv_message_data_c class simply initializes the attributes.

Parameters

abs_eap_am_tools_c *const tools

~eap_tlv_message_data_c()

EAP_FUNC_IMPORT~eap_tlv_message_data_c()[virtual]

The destructor of the eap_tlv_message_data_c class does nothing.

Member Functions Documentation

add_message_data(const eap_tlv_type_t, const u32_t, const void *const)

EAP_FUNC_IMPORT eap_status_eadd_message_data(const eap_tlv_type_ttype,
const u32_tlength,
const void *const data
)

This function adds data to message.

Parameters

const eap_tlv_type_t type
const u32_t length
const void *const data

add_message_data_array(const eap_tlv_type_t, const u32_t, eap_array_c< eap_variable_data_c > *const)

EAP_FUNC_IMPORT eap_status_eadd_message_data_array(const eap_tlv_type_ttype,
const u32_tlength_of_each_data_block,
eap_array_c< eap_variable_data_c > *const data_array
)

This function adds array of data to message.

Parameters

const eap_tlv_type_t type
const u32_t length_of_each_data_block
eap_array_c< eap_variable_data_c > *const data_array

add_message_header(const eap_tlv_type_t, const u32_t)

EAP_FUNC_IMPORT eap_status_eadd_message_header(const eap_tlv_type_ttype,
const u32_tlength
)

This function adds header of structured data to message.

Parameters

const eap_tlv_type_t type
const u32_t length

allocate_message_buffer(const eap_tlv_type_t, const u32_t, void **const)

EAP_FUNC_IMPORT eap_status_eallocate_message_buffer(const eap_tlv_type_ttype,
const u32_tlength,
void **const buffer
)

This function allocates buffer to message of specified type. Function returns pointer to the value field of specified length.

Parameters

const eap_tlv_type_t type
const u32_t length
void **const buffer

allocate_message_data_buffer(const u32_t)

EAP_FUNC_IMPORT eap_status_eallocate_message_data_buffer(const u32_tapproximate_buffer_requirement)

Parameters

const u32_t approximate_buffer_requirement

copy_message_data(const u32_t, const void *const)

EAP_FUNC_IMPORT eap_status_ecopy_message_data(const u32_tlength,
const void *const value
)

This function copies message data. Data must be formatted as EAP-TLV-message data.

Parameters

const u32_t length
const void *const value

get_is_valid()

EAP_FUNC_IMPORT boolget_is_valid()

Object must indicate it's validity. If object initialization fails this function must return false.

get_message_data()

EAP_FUNC_IMPORT void *get_message_data()const

This function returns the pointer to the data. Empty message return NULL pointer.

get_message_data_length()

EAP_FUNC_IMPORT u32_tget_message_data_length()const

This function returns the length of the data. Empty message return zero.

object_decrease_reference_count()

EAP_FUNC_IMPORT u32_tobject_decrease_reference_count()

This function should first decrease reference count and second return the remaining reference count. Reference count must not be decreased when it is zero.

object_increase_reference_count()

EAP_FUNC_IMPORT voidobject_increase_reference_count()

This function should increase reference count.

parse_message_data(eap_array_c< eap_tlv_header_c > *const)

EAP_FUNC_IMPORT eap_status_eparse_message_data(eap_array_c< eap_tlv_header_c > *const tlv_blocks)

This function parses eap_tlv_header_c blocks from message to tlv_blocks.

Parameters

eap_array_c< eap_tlv_header_c > *const tlv_blocks

set_message_data(const u32_t, const void *const)

EAP_FUNC_IMPORT eap_status_eset_message_data(const u32_tlength,
const void *const value
)

This function sets message data. Note the data is referenced not copied. Data must be formatted as EAP-TLV-message data.

Parameters

const u32_t length
const void *const value

Member Data Documentation

abs_eap_am_tools_c *const m_am_tools

abs_eap_am_tools_c *constm_am_tools[private]

eap_variable_data_c m_message_data

eap_variable_data_c m_message_data[private]