libcoap 4.3.5-develop-19cef11
|
structure for CoAP PDUs More...
#include <coap_pdu_internal.h>
Data Fields | |
coap_pdu_type_t | type |
message type More... | |
coap_pdu_code_t | code |
request method (value 1–31) or response code (value 64-255) More... | |
coap_mid_t | mid |
message id, if any, in regular host byte order More... | |
uint8_t | max_hdr_size |
space reserved for protocol-specific header More... | |
uint8_t | hdr_size |
actual size used for protocol-specific header (0 until header is encoded) More... | |
uint8_t | crit_opt |
Set if unknown critical option for proxy. More... | |
uint16_t | max_opt |
highest option number in PDU More... | |
uint32_t | e_token_length |
length of Token space (includes leading extended bytes More... | |
unsigned | ref |
reference count More... | |
coap_bin_const_t | actual_token |
Actual token in pdu. More... | |
size_t | alloc_size |
allocated storage for token, options and payload More... | |
size_t | used_size |
used bytes of storage for token, options and payload More... | |
size_t | max_size |
maximum size for token, options and payload, or zero for variable size pdu More... | |
uint8_t * | token |
first byte of token (or extended length bytes prefix), if any, or options More... | |
uint8_t * | data |
first byte of payload, if any More... | |
const uint8_t * | body_data |
Holds ptr to re-assembled data or NULL. More... | |
size_t | body_length |
Holds body data length. More... | |
size_t | body_offset |
Holds body data offset. More... | |
size_t | body_total |
Holds body data total size. More... | |
coap_lg_xmit_t * | lg_xmit |
Holds ptr to lg_xmit if sending a set of blocks. More... | |
coap_session_t * | session |
Session responsible for PDU or NULL. More... | |
coap_binary_t * | data_free |
Data to be freed off by coap_delete_pdu() More... | |
structure for CoAP PDUs
Separate COAP_PDU_BUF is allocated with offsets held in coap_pdu_t.
token, if any, follows the fixed size header, then optional options until payload marker (0xff) (if paylooad), then the optional payload.
Memory layout is: <—header—>|<—token—><—options—>0xff<—payload—>
header is addressed with a negative offset to token, its maximum size is max_hdr_size.
allocated buffer always starts max_hdr_size before token.
options starts at token + e_token_length. payload starts at data, its length is used_size - (data - token).
alloc_size, used_size and max_size are the offsets from token.
Definition at line 135 of file coap_pdu_internal.h.
coap_bin_const_t coap_pdu_t::actual_token |
Actual token in pdu.
Definition at line 149 of file coap_pdu_internal.h.
size_t coap_pdu_t::alloc_size |
allocated storage for token, options and payload
Definition at line 150 of file coap_pdu_internal.h.
const uint8_t* coap_pdu_t::body_data |
Holds ptr to re-assembled data or NULL.
This does not get released by coap_delete_pdu()
Definition at line 169 of file coap_pdu_internal.h.
size_t coap_pdu_t::body_length |
Holds body data length.
Definition at line 171 of file coap_pdu_internal.h.
size_t coap_pdu_t::body_offset |
Holds body data offset.
Definition at line 172 of file coap_pdu_internal.h.
size_t coap_pdu_t::body_total |
Holds body data total size.
Definition at line 173 of file coap_pdu_internal.h.
coap_pdu_code_t coap_pdu_t::code |
request method (value 1–31) or response code (value 64-255)
Definition at line 137 of file coap_pdu_internal.h.
uint8_t coap_pdu_t::crit_opt |
Set if unknown critical option for proxy.
Definition at line 144 of file coap_pdu_internal.h.
uint8_t* coap_pdu_t::data |
first byte of payload, if any
Definition at line 158 of file coap_pdu_internal.h.
coap_binary_t* coap_pdu_t::data_free |
Data to be freed off by coap_delete_pdu()
Definition at line 177 of file coap_pdu_internal.h.
uint32_t coap_pdu_t::e_token_length |
length of Token space (includes leading extended bytes
Definition at line 146 of file coap_pdu_internal.h.
uint8_t coap_pdu_t::hdr_size |
actual size used for protocol-specific header (0 until header is encoded)
Definition at line 142 of file coap_pdu_internal.h.
coap_lg_xmit_t* coap_pdu_t::lg_xmit |
Holds ptr to lg_xmit if sending a set of blocks.
Definition at line 174 of file coap_pdu_internal.h.
uint8_t coap_pdu_t::max_hdr_size |
space reserved for protocol-specific header
Definition at line 141 of file coap_pdu_internal.h.
uint16_t coap_pdu_t::max_opt |
highest option number in PDU
Definition at line 145 of file coap_pdu_internal.h.
size_t coap_pdu_t::max_size |
maximum size for token, options and payload, or zero for variable size pdu
Definition at line 154 of file coap_pdu_internal.h.
coap_mid_t coap_pdu_t::mid |
message id, if any, in regular host byte order
Definition at line 139 of file coap_pdu_internal.h.
unsigned coap_pdu_t::ref |
reference count
Definition at line 148 of file coap_pdu_internal.h.
coap_session_t* coap_pdu_t::session |
Session responsible for PDU or NULL.
Definition at line 176 of file coap_pdu_internal.h.
uint8_t* coap_pdu_t::token |
first byte of token (or extended length bytes prefix), if any, or options
Definition at line 156 of file coap_pdu_internal.h.
coap_pdu_type_t coap_pdu_t::type |
message type
Definition at line 136 of file coap_pdu_internal.h.
size_t coap_pdu_t::used_size |
used bytes of storage for token, options and payload
Definition at line 152 of file coap_pdu_internal.h.