eap_header_base_c Class Reference

class eap_header_base_c : public eap_general_header_base_c
This is base class defining the EAP-packet header.
        Original EAP-header.
  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
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |     Code      |  Identifier   |            Length             |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |  Type         |    Type data ...
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  0                   1                   2                   3
  
  EAP-header with expanded type field.
  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
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |     Code      |  Identifier   |            Length             |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |  Type         |                Vendor-Id                      |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                        Vendor-Type                            |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |  Type data ...
  +-+-+-+-+-+-+-+-+
       

Inherits from

Public Member Functions
eap_header_base_c ( abs_eap_am_tools_c *const , void *const , const u32_t )
~eap_header_base_c ()
EAP_FUNC_IMPORT eap_status_e check_header ()
EAP_FUNC_IMPORT eap_code_value_e get_code ()
EAP_FUNC_IMPORT eap_const_string get_code_string ()
EAP_FUNC_IMPORT u8_t * get_data (const u32_t )
EAP_FUNC_IMPORT u16_t get_data_length ()
EAP_FUNC_IMPORT u8_t * get_data_offset (const u32_t , const u32_t )
EAP_FUNC_IMPORT u32_t get_expanded_ietf_type_offset ()
EAP_FUNC_IMPORT u32_t get_expanded_type_field_length ()
EAP_FUNC_IMPORT u32_t get_expanded_vendor_id_offset ()
EAP_FUNC_IMPORT u32_t get_expanded_vendor_type_offset ()
EAP_FUNC_IMPORT u32_t get_header_length ()
EAP_FUNC_IMPORT u8_t get_identifier ()
EAP_FUNC_IMPORT eap_type_ietf_values_e get_ietf_type ()
EAP_FUNC_IMPORT u32_t get_ietf_type_field_length ()
EAP_FUNC_IMPORT u16_t get_length ()
EAP_FUNC_IMPORT eap_type_value_e get_type ()
EAP_FUNC_IMPORT u8_t * get_type_data (const u32_t )
EAP_FUNC_IMPORT u16_t get_type_data_length ()
EAP_FUNC_IMPORT u8_t * get_type_data_offset (const u32_t , const u32_t )
EAP_FUNC_IMPORT u32_t get_type_data_start_offset (const bool)
EAP_FUNC_IMPORT u32_t get_type_field_length ()
EAP_FUNC_IMPORT eap_const_string get_type_string ()
EAP_FUNC_IMPORT void set_code (const eap_code_value_e )
EAP_FUNC_IMPORT void set_identifier (const u8_t )
EAP_FUNC_IMPORT void set_length (const u16_t , const bool)
EAP_FUNC_IMPORT eap_status_e set_type (const eap_type_value_e , const bool)
EAP_FUNC_IMPORT void set_type_data_length (const u16_t , const bool)
Inherited Functions
eap_general_header_base_c::eap_general_header_base_c(abs_eap_am_tools_c *const ,void *const ,const u32_t)
eap_general_header_base_c::get_am_tools()const
eap_general_header_base_c::get_header_buffer(const u32_t)const
eap_general_header_base_c::get_header_buffer_length()const
eap_general_header_base_c::get_header_offset(const u32_t,const u32_t)const
eap_general_header_base_c::get_is_valid()const
eap_general_header_base_c::set_header_buffer(u8_t *const ,const u32_t)
eap_general_header_base_c::~eap_general_header_base_c()
Private Member Enumerations
enum offsets {
m_code_offset  = 0ul, m_identifier_offset  = m_code_offset+sizeof(u8_t), m_length_offset  = m_identifier_offset+sizeof(u8_t), m_type_offset  = m_length_offset+sizeof(u16_t), m_data_offset  = m_type_offset+sizeof(u8_t), m_exp_ietf_type_offset  = 0ul, m_exp_vendor_id_offset  = m_exp_ietf_type_offset+eap_expanded_type_c::m_ietf_type_size, m_exp_vendor_type_offset  = m_exp_vendor_id_offset+eap_expanded_type_c::m_vendor_id_size
}
Private Attributes
abs_eap_am_tools_c *const m_am_tools

Constructor & Destructor Documentation

eap_header_base_c(abs_eap_am_tools_c *const, void *const, const u32_t)

EAP_FUNC_IMPORT eap_header_base_c ( abs_eap_am_tools_c *const tools,
void *const header_buffer,
const u32_t header_buffer_length
)

Constructor does nothing special. The tools parameter is pointer to tools object. The header_buffer parameter is pointer to buffer of EAP-packet including header and data. The header_buffer_length parameter is length of the header_buffer.

Parameters

abs_eap_am_tools_c *const tools
void *const header_buffer
const u32_t header_buffer_length

~eap_header_base_c()

EAP_FUNC_IMPORT ~eap_header_base_c ( ) [virtual]

Member Functions Documentation

check_header()

EAP_FUNC_IMPORT eap_status_e check_header ( ) const [virtual]

get_code()

EAP_FUNC_IMPORT eap_code_value_e get_code ( ) const

get_code_string()

EAP_FUNC_IMPORT eap_const_string get_code_string ( ) const

get_data(const u32_t)

EAP_FUNC_IMPORT u8_t * get_data ( const u32_t p_continuous_bytes ) const

This function returns the pointer to the data field of EAP-packet. Data field includes type field.

Parameters

const u32_t p_continuous_bytes

get_data_length()

EAP_FUNC_IMPORT u16_t get_data_length ( ) const

This function returns the data length of EAP-packet. The data length includes type field.

get_data_offset(const u32_t, const u32_t)

EAP_FUNC_IMPORT u8_t * get_data_offset ( const u32_t p_offset,
const u32_t p_continuous_bytes
) const

This function returns the pointer to the offset of the data field of EAP-packet. Data field includes type field.

Parameters

const u32_t p_offset
const u32_t p_continuous_bytes

get_expanded_ietf_type_offset()

EAP_FUNC_IMPORT u32_t get_expanded_ietf_type_offset ( ) [static]

get_expanded_type_field_length()

EAP_FUNC_IMPORT u32_t get_expanded_type_field_length ( ) [static]

get_expanded_vendor_id_offset()

EAP_FUNC_IMPORT u32_t get_expanded_vendor_id_offset ( ) [static]

get_expanded_vendor_type_offset()

EAP_FUNC_IMPORT u32_t get_expanded_vendor_type_offset ( ) [static]

get_header_length()

EAP_FUNC_IMPORT u32_t get_header_length ( ) [static]

get_identifier()

EAP_FUNC_IMPORT u8_t get_identifier ( ) const

get_ietf_type()

EAP_FUNC_IMPORT eap_type_ietf_values_e get_ietf_type ( ) const

This function returns the IETF type field of EAP-header. This means the first 8-bits of type field, whether it is short or expanded type.

get_ietf_type_field_length()

EAP_FUNC_IMPORT u32_t get_ietf_type_field_length ( ) [static]

get_length()

EAP_FUNC_IMPORT u16_t get_length ( ) const

get_type()

EAP_FUNC_IMPORT eap_type_value_e get_type ( ) const

get_type_data(const u32_t)

EAP_FUNC_IMPORT u8_t * get_type_data ( const u32_t p_continuous_bytes ) const

Parameters

const u32_t p_continuous_bytes

get_type_data_length()

EAP_FUNC_IMPORT u16_t get_type_data_length ( ) const

get_type_data_offset(const u32_t, const u32_t)

EAP_FUNC_IMPORT u8_t * get_type_data_offset ( const u32_t p_offset,
const u32_t p_continuous_bytes
) const

Parameters

const u32_t p_offset
const u32_t p_continuous_bytes

get_type_data_start_offset(const bool)

EAP_FUNC_IMPORT u32_t get_type_data_start_offset ( const bool expanded_type_when_true ) [static]

Parameters

const bool expanded_type_when_true

get_type_field_length()

EAP_FUNC_IMPORT u32_t get_type_field_length ( ) const

get_type_string()

EAP_FUNC_IMPORT eap_const_string get_type_string ( ) const

set_code(const eap_code_value_e)

EAP_FUNC_IMPORT void set_code ( const eap_code_value_e p_code )

Parameters

const eap_code_value_e p_code

set_identifier(const u8_t)

EAP_FUNC_IMPORT void set_identifier ( const u8_t p_identifier )

Parameters

const u8_t p_identifier

set_length(const u16_t, const bool)

EAP_FUNC_IMPORT void set_length ( const u16_t p_length,
const bool expanded_type_when_true
)

Parameters

const u16_t p_length
const bool expanded_type_when_true

set_type(const eap_type_value_e, const bool)

EAP_FUNC_IMPORT eap_status_e set_type ( const eap_type_value_e p_type,
const bool expanded_type_when_true
)

Parameters

const eap_type_value_e p_type
const bool expanded_type_when_true

set_type_data_length(const u16_t, const bool)

EAP_FUNC_IMPORT void set_type_data_length ( const u16_t p_length,
const bool expanded_type_when_true
)

Parameters

const u16_t p_length
const bool expanded_type_when_true

Member Enumerations Documentation

Enum offsets

This enumeration defines the offsets of the EAP-header fields.

Enumerators

m_code_offset = 0ul
m_identifier_offset = m_code_offset+sizeof(u8_t)
m_length_offset = m_identifier_offset+sizeof(u8_t)
m_type_offset = m_length_offset+sizeof(u16_t)
m_data_offset = m_type_offset+sizeof(u8_t)
m_exp_ietf_type_offset = 0ul
m_exp_vendor_id_offset = m_exp_ietf_type_offset+eap_expanded_type_c::m_ietf_type_size
m_exp_vendor_type_offset = m_exp_vendor_id_offset+eap_expanded_type_c::m_vendor_id_size

Member Data Documentation

abs_eap_am_tools_c *const m_am_tools

abs_eap_am_tools_c *const m_am_tools [private]