|
libcoap 4.3.5-develop-4c3f4af
|
Internal API for Block Transfer (RFC7959). More...
Data Structures | |
| struct | coap_lg_range |
| struct | coap_rblock_t |
| Structure to keep track of received blocks. More... | |
| struct | coap_l_block1_t |
| Structure to keep track of block1 specific information (Requests). More... | |
| struct | coap_l_block2_t |
| Structure to keep track of block2 specific information (Responses). More... | |
| struct | coap_lg_xmit_data_t |
| struct | coap_lg_xmit_t |
| Structure to hold large body (many blocks) transmission information. More... | |
Macros | |
| #define | STATE_MAX_BLK_CNT_BITS 20 |
| #define | STATE_TOKEN_BASE(t) |
| #define | STATE_TOKEN_RETRY(t) |
| #define | STATE_TOKEN_FULL(t, r) |
| #define | COAP_BLOCK_SET_MASK |
| #define | COAP_BLOCK_MAX_SIZE_MASK 0x7000000 /* (svr)Mask to get the max supported block size */ |
| #define | COAP_BLOCK_MAX_SIZE_SHIFT 24 /* (svr)Mask shift to get the max supported block size */ |
| #define | COAP_BLOCK_MAX_SIZE_GET(a) |
| #define | COAP_BLOCK_MAX_SIZE_SET(a) |
| #define | COAP_SINGLE_BLOCK_OR_Q (COAP_BLOCK_SINGLE_BODY) |
| #define | COAP_RBLOCK_CNT 4 |
| #define | coap_check_update_token(a, b) |
Typedefs | |
| typedef struct coap_rblock_t | coap_rblock_t |
| Structure to keep track of received blocks. | |
| typedef struct coap_l_block1_t | coap_l_block1_t |
| Structure to keep track of block1 specific information (Requests). | |
| typedef struct coap_l_block2_t | coap_l_block2_t |
| Structure to keep track of block2 specific information (Responses). | |
| typedef struct coap_lg_xmit_data_t | coap_lg_xmit_data_t |
Enumerations | |
| enum | coap_recurse_t { COAP_RECURSE_OK , COAP_RECURSE_NO } |
Functions | |
| coap_lg_xmit_t * | coap_find_lg_xmit (coap_session_t *session, coap_pdu_t *pdu) |
| Find the current lg_xmit for the session that matches the pdu. | |
| void | coap_block_delete_lg_xmit (coap_session_t *session, coap_lg_xmit_t *lg_xmit) |
| Remove a lg_xmit. | |
| COAP_STATIC_INLINE void | coap_lg_xmit_release_lkd (coap_session_t *session, coap_lg_xmit_t *lg_xmit) |
| Decrement reference counter on a lg_xmit. | |
| COAP_STATIC_INLINE void | coap_lg_xmit_reference_lkd (coap_lg_xmit_t *lg_xmit) |
| Increment reference counter on a lg_xmit. | |
| int | coap_block_check_lg_xmit_timeouts (coap_session_t *session, coap_tick_t now, coap_tick_t *tim_rem) |
| void | coap_check_code_lg_xmit (const coap_session_t *session, const coap_pdu_t *request, coap_pdu_t *response, const coap_resource_t *resource, const coap_string_t *query) |
| The function checks that the code in a newly formed lg_xmit created by coap_add_data_large_response_lkd() is updated. | |
| void | coap_context_set_block_mode_lkd (coap_context_t *context, uint32_t block_mode) |
| Set the context level CoAP block handling bits for handling RFC7959. | |
| int | coap_context_set_max_block_size_lkd (coap_context_t *context, size_t max_block_size) |
| Set the context level maximum block size that the server supports when sending or receiving packets with Block1 or Block2 options. | |
| coap_binary_t * | coap_block_build_body_lkd (coap_binary_t *body_data, size_t length, const uint8_t *data, size_t offset, size_t total) |
| Re-assemble payloads into a body. | |
Internal API for Block Transfer (RFC7959).
| #define COAP_BLOCK_MAX_SIZE_GET | ( | a | ) |
Definition at line 68 of file coap_block_internal.h.
| #define COAP_BLOCK_MAX_SIZE_MASK 0x7000000 /* (svr)Mask to get the max supported block size */ |
Definition at line 66 of file coap_block_internal.h.
| #define COAP_BLOCK_MAX_SIZE_SET | ( | a | ) |
Definition at line 69 of file coap_block_internal.h.
| #define COAP_BLOCK_MAX_SIZE_SHIFT 24 /* (svr)Mask shift to get the max supported block size */ |
Definition at line 67 of file coap_block_internal.h.
| #define COAP_BLOCK_SET_MASK |
Definition at line 57 of file coap_block_internal.h.
| #define coap_check_update_token | ( | a, | |
| b ) |
Definition at line 800 of file coap_block_internal.h.
| #define COAP_RBLOCK_CNT 4 |
Definition at line 113 of file coap_block_internal.h.
| #define COAP_SINGLE_BLOCK_OR_Q (COAP_BLOCK_SINGLE_BODY) |
Definition at line 99 of file coap_block_internal.h.
| #define STATE_MAX_BLK_CNT_BITS 20 |
Definition at line 39 of file coap_block_internal.h.
| #define STATE_TOKEN_BASE | ( | t | ) |
Definition at line 41 of file coap_block_internal.h.
| #define STATE_TOKEN_FULL | ( | t, | |
| r ) |
Definition at line 43 of file coap_block_internal.h.
| #define STATE_TOKEN_RETRY | ( | t | ) |
Definition at line 42 of file coap_block_internal.h.
| typedef struct coap_l_block1_t coap_l_block1_t |
Structure to keep track of block1 specific information (Requests).
| typedef struct coap_l_block2_t coap_l_block2_t |
Structure to keep track of block2 specific information (Responses).
| typedef struct coap_lg_xmit_data_t coap_lg_xmit_data_t |
| typedef struct coap_rblock_t coap_rblock_t |
Structure to keep track of received blocks.
| enum coap_recurse_t |
| Enumerator | |
|---|---|
| COAP_RECURSE_OK | |
| COAP_RECURSE_NO | |
Definition at line 102 of file coap_block_internal.h.
| coap_binary_t * coap_block_build_body_lkd | ( | coap_binary_t * | body_data, |
| size_t | length, | ||
| const uint8_t * | data, | ||
| size_t | offset, | ||
| size_t | total ) |
Re-assemble payloads into a body.
Note: This function must be called in the locked state.
| body_data | The pointer to the data for the body holding the representation so far or NULL if the first time. |
| length | The length of data. |
| data | The payload data to update the body with. |
| offset | The offset of the data into the body. |
| total | The estimated total size of the body. |
NULL if error. If NULL, body_data will have been de-allocated. Definition at line 4247 of file coap_block.c.
| int coap_block_check_lg_xmit_timeouts | ( | coap_session_t * | session, |
| coap_tick_t | now, | ||
| coap_tick_t * | tim_rem ) |
Definition at line 1534 of file coap_block.c.
| void coap_block_delete_lg_xmit | ( | coap_session_t * | session, |
| coap_lg_xmit_t * | lg_xmit ) |
Remove a lg_xmit.
If lg_xmit is being referenced, then the reference counter is decremented but the lg_xmit data still exists until a coap_lg_xmit_release_lkd() is invoked.
Note: This function must be called in the locked state.
| session | The CoAP session. |
| lg_xmit | The lg_xmit being used. |
Definition at line 2754 of file coap_block.c.
| void coap_check_code_lg_xmit | ( | const coap_session_t * | session, |
| const coap_pdu_t * | request, | ||
| coap_pdu_t * | response, | ||
| const coap_resource_t * | resource, | ||
| const coap_string_t * | query ) |
The function checks that the code in a newly formed lg_xmit created by coap_add_data_large_response_lkd() is updated.
| session | The session. |
| request | The request PDU to to check. |
| response | The response PDU to to update with response->code. |
| resource | The requested resource. |
| query | The requested query. |
| void coap_context_set_block_mode_lkd | ( | coap_context_t * | context, |
| uint32_t | block_mode ) |
Set the context level CoAP block handling bits for handling RFC7959.
These bits flow down to a session when a session is created and if the peer does not support something, an appropriate bit may get disabled in the session block_mode. The session block_mode then flows down into coap_crcv_t or coap_srcv_t where again an appropriate bit may get disabled.
Note: This function must be called before the session is set up.
Note: COAP_BLOCK_USE_LIBCOAP must be set if libcoap is to do all the block tracking and requesting, otherwise the application will have to do all of this work (the default if coap_context_set_block_mode() is not called).
| context | The coap_context_t object. |
| block_mode | Zero or more COAP_BLOCK_ or'd options |
Definition at line 429 of file coap_block.c.
| int coap_context_set_max_block_size_lkd | ( | coap_context_t * | context, |
| size_t | max_block_size ) |
Set the context level maximum block size that the server supports when sending or receiving packets with Block1 or Block2 options.
This maximum block size flows down to a session when a session is created.
Note: This function must be called before the session is set up.
Note: COAP_BLOCK_USE_LIBCOAP must be set using coap_context_set_block_mode() if libcoap is to do this work.
| context | The coap_context_t object. |
| max_block_size | The maximum block size a server supports. Can be 0 (reset), or must be 16, 32, 64, 128, 256, 512 or 1024. |
Definition at line 454 of file coap_block.c.
| coap_lg_xmit_t * coap_find_lg_xmit | ( | coap_session_t * | session, |
| coap_pdu_t * | pdu ) |
Find the current lg_xmit for the session that matches the pdu.
If client and base lg_xmit is a mcast send, then create a secondorary lg_xmit.
| session | The current session. |
| pdu | The pdu that contains the appropriate token. |
Definition at line 484 of file coap_block.c.
| COAP_STATIC_INLINE void coap_lg_xmit_reference_lkd | ( | coap_lg_xmit_t * | lg_xmit | ) |
Increment reference counter on a lg_xmit.
Note: This function must be called in the locked state.
| lg_xmit | The lg_xmit being used. |
Definition at line 604 of file coap_block_internal.h.
| COAP_STATIC_INLINE void coap_lg_xmit_release_lkd | ( | coap_session_t * | session, |
| coap_lg_xmit_t * | lg_xmit ) |
Decrement reference counter on a lg_xmit.
Note that the lg_xmit storage may be deleted as a result and should not be used after this call.
Note: This function must be called in the locked state.
| session | The CoAP session. |
| lg_xmit | The lg_xmit being used. |
Definition at line 591 of file coap_block_internal.h.