eap_buf_chain_base_c Class Reference
class eap_buf_chain_base_c
|
Nested Classes and Structures
Public Member Functions
|
|
eap_buf_chain_base_c
(const ,
abs_eap_am_tools_c
*const ,
u8_t
*const , const
u32_t
, const bool, const bool, const
u32_t
)
|
|
eap_buf_chain_base_c
(const ,
abs_eap_am_tools_c
*const , const
u8_t
*const , const
u32_t
, const bool)
|
|
eap_buf_chain_base_c
(const ,
abs_eap_am_tools_c
*const , const
u32_t
)
|
|
~eap_buf_chain_base_c
()
|
EAP_FUNC_IMPORT
eap_status_e
|
add_data
(const void *const , const
u32_t
)
|
EAP_FUNC_IMPORT
eap_status_e
|
add_data
(const
eap_variable_data_c
*const )
|
EAP_FUNC_IMPORT
eap_status_e
|
add_data_to_offset
(const
u32_t
, const void *const , const
u32_t
)
|
EAP_FUNC_IMPORT
eap_status_e
|
add_data_to_offset
(const
u32_t
, const
eap_variable_data_c
*const )
|
EAP_FUNC_IMPORT bool
|
check_guards
()
|
EAP_FUNC_IMPORT
u32_t
|
get_buffer_length
()
|
EAP_FUNC_IMPORT
u8_t
*
|
get_data
(const
u32_t
)
|
EAP_FUNC_IMPORT
u32_t
|
get_data_length
()
|
EAP_FUNC_IMPORT
u8_t
*
|
get_data_offset
(const
u32_t
, const
u32_t
)
|
EAP_FUNC_IMPORT bool
|
get_do_length_checks
()
|
EAP_FUNC_IMPORT bool
|
get_do_packet_retransmission
()
|
EAP_FUNC_IMPORT bool
|
get_encrypt
()
|
EAP_FUNC_IMPORT bool
|
get_is_client
()
|
EAP_FUNC_IMPORT bool
|
get_is_manipulated
()
|
EAP_FUNC_IMPORT bool
|
get_is_valid
()
|
EAP_FUNC_IMPORT bool
|
get_is_valid_data
()
|
EAP_FUNC_IMPORT
u32_t
|
get_mem_guard_length
()
|
EAP_FUNC_IMPORT
eap_random_error_type
|
get_random_error_type
()
|
EAP_FUNC_IMPORT
u32_t
|
get_send_packet_index
()
|
EAP_FUNC_IMPORT const void *
|
get_stack_address
()
|
EAP_FUNC_IMPORT
eap_status_e
|
set_buffer_length
(const
u32_t
)
|
EAP_FUNC_IMPORT
eap_status_e
|
set_data_length
(const
u32_t
)
|
EAP_FUNC_IMPORT void
|
set_do_length_checks
(const bool)
|
EAP_FUNC_IMPORT void
|
set_do_packet_retransmission
(const bool)
|
EAP_FUNC_IMPORT void
|
set_encrypt
(const bool)
|
EAP_FUNC_IMPORT void
|
set_is_client
(const bool)
|
EAP_FUNC_IMPORT void
|
set_is_manipulated
()
|
EAP_FUNC_IMPORT void
|
set_random_error_type
(
eap_random_error_type
)
|
EAP_FUNC_IMPORT void
|
set_send_packet_index
(const
u32_t
)
|
EAP_FUNC_IMPORT void
|
set_stack_address
(const void *const )
|
Constructor & Destructor Documentation
eap_buf_chain_base_c(const, abs_eap_am_tools_c *const, u8_t *const, const u32_t, const bool, const bool, const u32_t)
EAP_FUNC_IMPORT
|
eap_buf_chain_base_c
|
(
|
const
|
eap_write_buffer_e,
|
|
abs_eap_am_tools_c
*const
|
tools,
|
|
u8_t
*const
|
data,
|
|
const
u32_t
|
data_length,
|
|
const bool
|
reset_data,
|
|
const bool
|
free_buffer,
|
|
const
u32_t
|
mem_guard_length
|
|
)
|
|
The constructor of the eap_buf_chain_wr class initializes attributes using the parameters passes to it. NOTE the buffer allocated from the stack or from the heap must allocate additional bytes for memory guards. The EAP_MEM_GUARDS(size) macro increases the size with count of memory guard bytes. The example use of eap_buf_chain_wr is as follows. NOTE all sanity checks are ignored in the example.
u8_t packet_buffer[EAP_MEM_GUARDS(EAP_MAX_LOCAL_PACKET_BUFFER_LENGTH)];
eap_buf_chain_wr_c response_packet(
eap_write_buffer, m_am_tools, packet_buffer,
sizeof(packet_buffer), true, false, EAP_MEM_GUARD_LENGTH);
const u32_t eap_header_offset = get_type_partner()->get_header_offset(
&MTU, &trailer_length);
eap_header_wr_c * const eap_response = (eap_header_wr_c * const)
response_packet.get_data_offset(eap_header_offset,
(EAP_MAX_LOCAL_PACKET_BUFFER_LENGTH
-(eap_header_offset+ trailer_length)));
Parameters
const eap_write_buffer_e
|
separates the write and read-only constructors.
|
abs_eap_am_tools_c
*const tools
|
parameter is pointer to the tools class.
|
u8_t
*const data
|
is pointer to the buffer containing the message.
|
const
u32_t
data_length
|
parameter is count of bytes in the buffer.
|
const bool reset_data
|
parameter indicates whether the data bytes must be set zero.
|
const bool free_buffer
|
parameter indicates whether the destructor must free the data buffer.
|
const
u32_t
mem_guard_length
|
indicates the length of guard bytes both pre-fix and post-fix.
|
eap_buf_chain_base_c(const, abs_eap_am_tools_c *const, const u8_t *const, const u32_t, const bool)
EAP_FUNC_IMPORT
|
eap_buf_chain_base_c
|
(
|
const
|
eap_read_buffer_e,
|
|
abs_eap_am_tools_c
*const
|
tools,
|
|
const
u8_t
*const
|
data,
|
|
const
u32_t
|
data_length,
|
|
const bool
|
free_buffer
|
|
)
|
|
The constructor of the eap_buf_chain_wr class initializes attributes using the parameters passes to it. The example use of eap_buf_chain_wr is as follows. NOTE all sanity checks are ignored in the example.
u8_t packet_buffer[EAP_MEM_GUARDS(EAP_MAX_LOCAL_PACKET_BUFFER_LENGTH)];
eap_buf_chain_rd_c response_packet(
eap_read_buffer, m_am_tools, packet_buffer,
sizeof(packet_buffer), false);
const u32_t eap_header_offset = get_type_partner()->get_header_offset(
&MTU, &trailer_length);
eap_header_rd_c * const eap_response = (eap_header_rd_c * const)
response_packet.get_data_offset(eap_header_offset,
(EAP_MAX_LOCAL_PACKET_BUFFER_LENGTH
-(eap_header_offset+ trailer_length)));
Parameters
const eap_read_buffer_e
|
separates the write and read-only constructors.
|
abs_eap_am_tools_c
*const tools
|
parameter is pointer to the tools class.
|
const
u8_t
*const data
|
is pointer to the buffer containing the message.
|
const
u32_t
data_length
|
parameter is count of bytes in the buffer.
|
const bool free_buffer
|
parameter indicates whether the destructor must free the data buffer.
|
eap_buf_chain_base_c(const, abs_eap_am_tools_c *const, const u32_t)
EAP_FUNC_IMPORT
|
eap_buf_chain_base_c
|
(
|
const
|
eap_write_buffer_e,
|
|
abs_eap_am_tools_c
*const
|
tools,
|
|
const
u32_t
|
data_length
|
|
)
|
|
The constructor of the eap_buf_chain_wr class initializes attributes using the parameters passes to it. New buffer is allocated from heap. The example use of eap_buf_chain_wr is as follows. NOTE all sanity checks are ignored in the example.
eap_buf_chain_rd_c response_packet(
eap_write_buffer_e, m_am_tools,
PACKET_BUFFER_LENGTH);
const u32_t eap_header_offset = get_type_partner()->get_header_offset(
&MTU, &trailer_length);
eap_header_rd_c * const eap_response = (eap_header_rd_c * const)
response_packet.get_data_offset(eap_header_offset,
(PACKET_BUFFER_LENGTH
-(eap_header_offset+ trailer_length)));
Parameters
const eap_write_buffer_e
|
separates the write and read-only constructors.
|
abs_eap_am_tools_c
*const tools
|
parameter is pointer to the tools class.
|
const
u32_t
data_length
|
parameter is count of bytes in the buffer.
|
~eap_buf_chain_base_c()
EAP_FUNC_IMPORT
|
~eap_buf_chain_base_c
|
(
|
)
|
[virtual]
|
The destructor of the
eap_buf_chain_base_c
class checks memory guards and frees the allocated buffer.
Member Functions Documentation
add_data(const void *const, const u32_t)
EAP_FUNC_IMPORT
eap_status_e
|
add_data
|
(
|
const void *const
|
buffer,
|
|
const
u32_t
|
buffer_length
|
|
)
|
|
The
add_data()
function adds data to the end of the buffer. If the buffer is empty the data is added to begin of the buffer.
Parameters
const void *const buffer
|
points the data to be added.
|
const
u32_t
buffer_length
|
is length of the buffer in bytes.
|
add_data(const eap_variable_data_c *const)
The
add_data()
function adds data to the end of the buffer. If the buffer is empty the data is added to begin of the buffer.
add_data_to_offset(const u32_t, const void *const, const u32_t)
EAP_FUNC_IMPORT
eap_status_e
|
add_data_to_offset
|
(
|
const
u32_t
|
offset,
|
|
const void *const
|
buffer,
|
|
const
u32_t
|
buffer_length
|
|
)
|
|
Parameters
const
u32_t
offset
|
tells the place where data will begin.
|
const void *const buffer
|
points the data to be added.
|
const
u32_t
buffer_length
|
is length of the buffer in bytes.
|
add_data_to_offset(const u32_t, const eap_variable_data_c *const)
The
add_data()
function adds data to the offset of the buffer.
Parameters
const
u32_t
offset
|
tells the place where data will begin.
|
const
eap_variable_data_c
*const buffer
|
points the data to be added.
|
check_guard_bytes(const u8_t *const)
EAP_FUNC_IMPORT bool
|
check_guard_bytes
|
(
|
const
u8_t
*const
|
guard
|
)
|
const [private]
|
Function checks the memory guard bytes.
check_guards()
EAP_FUNC_IMPORT bool
|
check_guards
|
(
|
)
|
const
|
Function checks the all memory guard bytes.
force_inheritance()
EAP_FUNC_IMPORT void
|
force_inheritance
|
(
|
)
|
[private, pure virtual]
|
get_buffer_length()
EAP_FUNC_IMPORT
u32_t
|
get_buffer_length
|
(
|
)
|
const
|
get_data(const u32_t)
EAP_FUNC_IMPORT
u8_t
*
|
get_data
|
(
|
const
u32_t
|
p_continuous_bytes
|
)
|
const
|
The
get_data()
function function returns pointer to the data. 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.
Parameters
const
u32_t
p_continuous_bytes
|
indicates how many bytes in continuous memory is needed.
|
get_data_length()
EAP_FUNC_IMPORT
u32_t
|
get_data_length
|
(
|
)
|
const
|
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
|
The
get_data_offset()
function returns pointer to the data in offset (p_offset). 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.
Parameters
const
u32_t
p_offset
|
indicates the required offset.
|
const
u32_t
p_continuous_bytes
|
indicates how many bytes in continuous memory is needed.
|
get_do_length_checks()
EAP_FUNC_IMPORT bool
|
get_do_length_checks
|
(
|
)
|
const
|
get_do_packet_retransmission()
EAP_FUNC_IMPORT bool
|
get_do_packet_retransmission
|
(
|
)
|
|
get_encrypt()
EAP_FUNC_IMPORT bool
|
get_encrypt
|
(
|
)
|
const
|
This gets whether this packet must be encrypted (true) or not (false). Encryption means the WLAN data encryption on the air (WEP, TKIP or CCMP). Using this flag to tell the encryption allows the configuration of the temporal key beforehand the key is used. This is optimization to fasten the key configuration.
get_is_client()
EAP_FUNC_IMPORT bool
|
get_is_client
|
(
|
)
|
const
|
This gets whether the sender is client or server. This is used in testing.
get_is_manipulated()
EAP_FUNC_IMPORT bool
|
get_is_manipulated
|
(
|
)
|
|
The
get_is_manipulated()
function returns flag to indicate this packet is manipulated. This is used for testing purposes.
get_is_valid()
EAP_FUNC_IMPORT bool
|
get_is_valid
|
(
|
)
|
const
|
get_is_valid_data()
EAP_FUNC_IMPORT bool
|
get_is_valid_data
|
(
|
)
|
const
|
The
get_is_valid()
function returns the status of the data included in object.
get_mem_guard_length()
EAP_FUNC_IMPORT
u32_t
|
get_mem_guard_length
|
(
|
)
|
|
get_random_error_type()
EAP_FUNC_IMPORT
eap_random_error_type
|
get_random_error_type
|
(
|
)
|
|
The
get_random_error_type()
function returns the type of manipulation of the packet. This is used for testing purposes.
get_send_packet_index()
EAP_FUNC_IMPORT
u32_t
|
get_send_packet_index
|
(
|
)
|
|
This function returns the index of sent packet. This is used for testing purposes.
get_stack_address()
EAP_FUNC_IMPORT const void *
|
get_stack_address
|
(
|
)
|
const
|
This gets the pointer of sender stack. This is used in testing.
initialize(const u32_t)
Parameters
const
u32_t
mem_guard_length
|
|
reset_data_buffer()
EAP_FUNC_IMPORT void
|
reset_data_buffer
|
(
|
)
|
[private]
|
Function zeroes the data buffer.
set_buffer_length(const u32_t)
set_data_length(const u32_t)
set_do_length_checks(const bool)
EAP_FUNC_IMPORT void
|
set_do_length_checks
|
(
|
const bool
|
do_length_checks
|
)
|
|
Parameters
const bool do_length_checks
|
|
set_do_packet_retransmission(const bool)
EAP_FUNC_IMPORT void
|
set_do_packet_retransmission
|
(
|
const bool
|
do_packet_retransmission_when_true
|
)
|
|
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.
Parameters
const bool do_packet_retransmission_when_true
|
|
set_encrypt(const bool)
EAP_FUNC_IMPORT void
|
set_encrypt
|
(
|
const bool
|
encrypt_when_true
|
)
|
|
This sets whether this packet must be encrypted (true) or not (false). Encryption means the WLAN data encryption on the air (WEP, TKIP or CCMP). Using this flag to tell the encryption allows the configuration of the temporal key beforehand the key is used. This is optimization to fasten the key configuration.
Parameters
const bool encrypt_when_true
|
|
set_is_client(const bool)
EAP_FUNC_IMPORT void
|
set_is_client
|
(
|
const bool
|
is_client_when_true
|
)
|
|
This sets whether the sender is client or server. This is used in testing.
Parameters
const bool is_client_when_true
|
|
set_is_manipulated()
EAP_FUNC_IMPORT void
|
set_is_manipulated
|
(
|
)
|
|
The
set_is_manipulated()
function sets flag to indicate this packet is manipulated. This is used for testing purposes.
set_mem_guard_bytes()
EAP_FUNC_IMPORT void
|
set_mem_guard_bytes
|
(
|
)
|
[private]
|
Function sets the memory guard bytes.
set_random_error_type(eap_random_error_type)
EAP_FUNC_IMPORT void
|
set_random_error_type
|
(
|
eap_random_error_type
|
error_type
|
)
|
|
The
set_random_error_type()
function sets the type of manipulation of the packet. This is used for testing purposes.
Parameters
eap_random_error_type
error_type
|
|
set_send_packet_index(const u32_t)
EAP_FUNC_IMPORT void
|
set_send_packet_index
|
(
|
const
u32_t
|
send_packet_index
|
)
|
|
This function sets the index of sent packet. This is used for testing purposes.
Parameters
const
u32_t
send_packet_index
|
|
set_stack_address(const void *const)
EAP_FUNC_IMPORT void
|
set_stack_address
|
(
|
const void *const
|
stack_address
|
)
|
|
This sets the pointer of sender stack. This is used in testing.
Parameters
const void *const stack_address
|
|
Member Data Documentation
abs_eap_am_tools_c *const m_am_tools
eap_buf_chain_base_impl_str * m_data
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.