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_echeck_header()
EAP_FUNC_IMPORT eap_code_value_eget_code()
EAP_FUNC_IMPORT eap_const_stringget_code_string()
EAP_FUNC_IMPORT u8_t *get_data(const u32_t)
EAP_FUNC_IMPORT u16_tget_data_length()
EAP_FUNC_IMPORT u8_t *get_data_offset(const u32_t, const u32_t)
EAP_FUNC_IMPORT u32_tget_expanded_ietf_type_offset()
EAP_FUNC_IMPORT u32_tget_expanded_type_field_length()
EAP_FUNC_IMPORT u32_tget_expanded_vendor_id_offset()
EAP_FUNC_IMPORT u32_tget_expanded_vendor_type_offset()
EAP_FUNC_IMPORT u32_tget_header_length()
EAP_FUNC_IMPORT u8_tget_identifier()
EAP_FUNC_IMPORT eap_type_ietf_values_eget_ietf_type()
EAP_FUNC_IMPORT u32_tget_ietf_type_field_length()
EAP_FUNC_IMPORT u16_tget_length()
EAP_FUNC_IMPORT eap_type_value_eget_type()
EAP_FUNC_IMPORT u8_t *get_type_data(const u32_t)
EAP_FUNC_IMPORT u16_tget_type_data_length()
EAP_FUNC_IMPORT u8_t *get_type_data_offset(const u32_t, const u32_t)
EAP_FUNC_IMPORT u32_tget_type_data_start_offset(const bool)
EAP_FUNC_IMPORT u32_tget_type_field_length()
EAP_FUNC_IMPORT eap_const_stringget_type_string()
EAP_FUNC_IMPORT voidset_code(const eap_code_value_e)
EAP_FUNC_IMPORT voidset_identifier(const u8_t)
EAP_FUNC_IMPORT voidset_length(const u16_t, const bool)
EAP_FUNC_IMPORT eap_status_eset_type(const eap_type_value_e, const bool)
EAP_FUNC_IMPORT voidset_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
enumoffsets {
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 *constm_am_tools

Constructor & Destructor Documentation

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

EAP_FUNC_IMPORTeap_header_base_c(abs_eap_am_tools_c *const tools,
void *const header_buffer,
const u32_theader_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_echeck_header()const [virtual]

get_code()

EAP_FUNC_IMPORT eap_code_value_eget_code()const

get_code_string()

EAP_FUNC_IMPORT eap_const_stringget_code_string()const

get_data(const u32_t)

EAP_FUNC_IMPORT u8_t *get_data(const u32_tp_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_tget_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_tp_offset,
const u32_tp_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_tget_expanded_ietf_type_offset()[static]

get_expanded_type_field_length()

EAP_FUNC_IMPORT u32_tget_expanded_type_field_length()[static]

get_expanded_vendor_id_offset()

EAP_FUNC_IMPORT u32_tget_expanded_vendor_id_offset()[static]

get_expanded_vendor_type_offset()

EAP_FUNC_IMPORT u32_tget_expanded_vendor_type_offset()[static]

get_header_length()

EAP_FUNC_IMPORT u32_tget_header_length()[static]

get_identifier()

EAP_FUNC_IMPORT u8_tget_identifier()const

get_ietf_type()

EAP_FUNC_IMPORT eap_type_ietf_values_eget_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_tget_ietf_type_field_length()[static]

get_length()

EAP_FUNC_IMPORT u16_tget_length()const

get_type()

EAP_FUNC_IMPORT eap_type_value_eget_type()const

get_type_data(const u32_t)

EAP_FUNC_IMPORT u8_t *get_type_data(const u32_tp_continuous_bytes)const

Parameters

const u32_t p_continuous_bytes

get_type_data_length()

EAP_FUNC_IMPORT u16_tget_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_tp_offset,
const u32_tp_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_tget_type_data_start_offset(const boolexpanded_type_when_true)[static]

Parameters

const bool expanded_type_when_true

get_type_field_length()

EAP_FUNC_IMPORT u32_tget_type_field_length()const

get_type_string()

EAP_FUNC_IMPORT eap_const_stringget_type_string()const

set_code(const eap_code_value_e)

EAP_FUNC_IMPORT voidset_code(const eap_code_value_ep_code)

Parameters

const eap_code_value_e p_code

set_identifier(const u8_t)

EAP_FUNC_IMPORT voidset_identifier(const u8_tp_identifier)

Parameters

const u8_t p_identifier

set_length(const u16_t, const bool)

EAP_FUNC_IMPORT voidset_length(const u16_tp_length,
const boolexpanded_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_eset_type(const eap_type_value_ep_type,
const boolexpanded_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 voidset_type_data_length(const u16_tp_length,
const boolexpanded_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 *constm_am_tools[private]