Provides dispatches for 6LoWPAN selective fragment recovery and helper functions. More...
Provides dispatches for 6LoWPAN selective fragment recovery and helper functions.
Files | |
file | sfr.h |
6LoWPAN selective fragment recovery dispatch type and helper function definitions. | |
Data Structures | |
struct | sixlowpan_sfr_t |
Generic type for selective fragment recovery headers. More... | |
struct | sixlowpan_sfr_rfrag_t |
Recoverable fragment header. More... | |
struct | sixlowpan_sfr_ack_t |
Recoverable fragment (RFRAG) acknowledgment header. More... | |
Macros | |
#define | SIXLOWPAN_SFR_GEN_DISP_MASK (0xfc) |
Mask for generic dispatch of both selective fragment recovery headers. More... | |
#define | SIXLOWPAN_SFR_GEN_DISP (0xe8) |
generic dispatch for both SFR headers | |
#define | SIXLOWPAN_SFR_ECN (0x01U) |
explicit congestion notification flag | |
#define | SIXLOWPAN_SFR_ACK_REQ (0x80U) |
Acknowledgment request flag (for 8 MSB) | |
#define | SIXLOWPAN_SFR_SEQ_MASK (0x7cU) |
Sequence number mask (for 8 MSB) | |
#define | SIXLOWPAN_SFR_SEQ_POS (2U) |
Sequence number position (for 8 MSB) | |
#define | SIXLOWPAN_SFR_SEQ_MAX (0x1fU) |
Maximum value for sequence number. | |
#define | SIXLOWPAN_SFR_FRAG_SIZE_MASK (0x03ffU) |
Fragment size mask. | |
#define | SIXLOWPAN_SFR_FRAG_SIZE_MAX (0x03ffU) |
Maximum value for fragment size. | |
#define | SIXLOWPAN_SFR_ACK_BITMAP_SIZE (32U) |
Acknowledgment bitmap size in bits. | |
Functions | |
static bool | sixlowpan_sfr_is (sixlowpan_sfr_t *hdr) |
Check if given header is a 6LoWPAN selective fragment recovery header (either RFRAG or RFRAG ACK) More... | |
static void | sixlowpan_sfr_set_ecn (sixlowpan_sfr_t *hdr) |
Set the ECN flag in a 6LoWPAN selective fragment recovery header. More... | |
static void | sixlowpan_sfr_clear_ecn (sixlowpan_sfr_t *hdr) |
Clear the ECN flag in a 6LoWPAN recoverable fragment header. More... | |
static bool | sixlowpan_sfr_ecn (const sixlowpan_sfr_t *hdr) |
Check if the ECN flag in a 6LoWPAN recoverable fragment header is set. More... | |
static void | sixlowpan_sfr_rfrag_set_disp (sixlowpan_sfr_t *hdr) |
Initialize 6LoWPAN recoverable fragment dispatch. More... | |
static bool | sixlowpan_sfr_rfrag_is (const sixlowpan_sfr_t *hdr) |
Check if given header is a 6LoWPAN recoverable fragment header. More... | |
static void | sixlowpan_sfr_rfrag_set_ack_req (sixlowpan_sfr_rfrag_t *hdr) |
Set the Acknowledgment request flag in a 6LoWPAN recoverable fragment header. More... | |
static void | sixlowpan_sfr_rfrag_clear_ack_req (sixlowpan_sfr_rfrag_t *hdr) |
Clear the Acknowledgment request flag in a 6LoWPAN recoverable fragment header. More... | |
static bool | sixlowpan_sfr_rfrag_ack_req (sixlowpan_sfr_rfrag_t *hdr) |
Check if the Acknowledgment request flag in a 6LoWPAN recoverable fragment header is set. More... | |
static void | sixlowpan_sfr_rfrag_set_seq (sixlowpan_sfr_rfrag_t *hdr, uint8_t seq) |
Set sequence number in a 6LoWPAN recoverable fragment header. More... | |
static uint8_t | sixlowpan_sfr_rfrag_get_seq (const sixlowpan_sfr_rfrag_t *hdr) |
Get sequence number from a 6LoWPAN recoverable fragment header. More... | |
static void | sixlowpan_sfr_rfrag_set_frag_size (sixlowpan_sfr_rfrag_t *hdr, uint16_t frag_size) |
Set fragment size in a 6LoWPAN recoverable fragment header. More... | |
static uint16_t | sixlowpan_sfr_rfrag_get_frag_size (const sixlowpan_sfr_rfrag_t *hdr) |
Get fragment size from a 6LoWPAN recoverable fragment header. More... | |
static void | sixlowpan_sfr_rfrag_set_offset (sixlowpan_sfr_rfrag_t *hdr, uint16_t offset) |
Set fragment offset in a 6LoWPAN recoverable fragment header. More... | |
static uint16_t | sixlowpan_sfr_rfrag_get_offset (const sixlowpan_sfr_rfrag_t *hdr) |
Get fragment offset from a 6LoWPAN recoverable fragment header. More... | |
static void | sixlowpan_sfr_ack_set_disp (sixlowpan_sfr_t *hdr) |
Initialize 6LoWPAN RFRAG acknowledgment dispatch. More... | |
static bool | sixlowpan_sfr_ack_is (const sixlowpan_sfr_t *hdr) |
Check if given header is a 6LoWPAN RFRAG acknowledgment header. More... | |
#define SIXLOWPAN_SFR_GEN_DISP_MASK (0xfc) |
Mask for generic dispatch of both selective fragment recovery headers.
|
inlinestatic |
Check if given header is a 6LoWPAN RFRAG acknowledgment header.
[in] | hdr | The 6LoWPAN selective fragment recovery header to check |
return true, if hdr
is a 6LoWPAN RFRAG acknowledgment header return false, if hdr
is not a 6LoWPAN RFRAG acknowledgment header
|
inlinestatic |
Initialize 6LoWPAN RFRAG acknowledgment dispatch.
[in,out] | hdr | A 6LoWPAN selective fragment recovery header |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Check if given header is a 6LoWPAN selective fragment recovery header (either RFRAG or RFRAG ACK)
[in] | hdr | The 6LoWPAN selective fragment recovery header to check |
return true, if hdr
is a 6LoWPAN selective fragment recovery header return false, if hdr
is not a 6LoWPAN selective fragment recovery header
|
inlinestatic |
Check if the Acknowledgment request flag in a 6LoWPAN recoverable fragment header is set.
[in] | hdr | A 6LoWPAN recoverable fragment header |
return true, if Acknowledgment request flag in hdr
is set return false, if Acknowledgment request flag in hdr
is cleared
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Check if given header is a 6LoWPAN recoverable fragment header.
[in] | hdr | The 6LoWPAN selective fragment recovery header to check |
return true, if hdr
is a 6LoWPAN recoverable fragment header return false, if hdr
is not a 6LoWPAN recoverable fragment header
|
inlinestatic |
|
inlinestatic |
Initialize 6LoWPAN recoverable fragment dispatch.
[in,out] | hdr | A 6LoWPAN selective fragment recovery header |
|
inlinestatic |
Set fragment size in a 6LoWPAN recoverable fragment header.
frag_size <= SIXLOWPAN_SFR_FRAG_SIZE_MAX
[in,out] | hdr | A 6LoWPAN recoverable fragment header |
[in] | frag_size | The fragment size to set. Must be lesser or equal to SIXLOWPAN_SFR_FRAG_SIZE_MAX. |
|
inlinestatic |
|
inlinestatic |
Set sequence number in a 6LoWPAN recoverable fragment header.
seq <= SIXLOWPAN_SFR_SEQ_MAX
[in,out] | hdr | A 6LoWPAN recoverable fragment header |
[in] | seq | The sequence number to set. Must be lesser or equal to SIXLOWPAN_SFR_SEQ_MAX. |
|
inlinestatic |