6LoWPAN selective fragment recovery

Provides dispatches for 6LoWPAN selective fragment recovery and helper functions. More...

Detailed Description

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...
 

Macro Definition Documentation

◆ SIXLOWPAN_SFR_GEN_DISP_MASK

#define SIXLOWPAN_SFR_GEN_DISP_MASK   (0xfc)

Mask for generic dispatch of both selective fragment recovery headers.

See also
SIXLOWPAN_SFR_GEN_DISP
SIXLOWPAN_SFR_DISP_MASK
SIXLOWPAN_SFR_RFRAG_DISP
SIXLOWPAN_SFR_ACK_DISP

Definition at line 46 of file sfr.h.

Function Documentation

◆ sixlowpan_sfr_ack_is()

static bool sixlowpan_sfr_ack_is ( const sixlowpan_sfr_t hdr)
inlinestatic

Check if given header is a 6LoWPAN RFRAG acknowledgment header.

See also
SIXLOWPAN_SFR_ACK_DISP
Parameters
[in]hdrThe 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

Definition at line 371 of file sfr.h.

◆ sixlowpan_sfr_ack_set_disp()

static void sixlowpan_sfr_ack_set_disp ( sixlowpan_sfr_t hdr)
inlinestatic

Initialize 6LoWPAN RFRAG acknowledgment dispatch.

See also
SIXLOWPAN_SFR_ACK_DISP
Parameters
[in,out]hdrA 6LoWPAN selective fragment recovery header

Definition at line 355 of file sfr.h.

◆ sixlowpan_sfr_clear_ecn()

static void sixlowpan_sfr_clear_ecn ( sixlowpan_sfr_t hdr)
inlinestatic

Clear the ECN flag in a 6LoWPAN recoverable fragment header.

Parameters
[in,out]hdrA 6LoWPAN selective fragment recovery header

Definition at line 182 of file sfr.h.

◆ sixlowpan_sfr_ecn()

static bool sixlowpan_sfr_ecn ( const sixlowpan_sfr_t hdr)
inlinestatic

Check if the ECN flag in a 6LoWPAN recoverable fragment header is set.

Parameters
[in]hdrA 6LoWPAN selective fragment recovery header

return true, if ECN flag in hdr is set return false, if ECN flag in hdr is cleared

Definition at line 196 of file sfr.h.

◆ sixlowpan_sfr_is()

static bool sixlowpan_sfr_is ( sixlowpan_sfr_t hdr)
inlinestatic

Check if given header is a 6LoWPAN selective fragment recovery header (either RFRAG or RFRAG ACK)

See also
SIXLOWPAN_SFR_RFRAG_DISP
Parameters
[in]hdrThe 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

Definition at line 162 of file sfr.h.

◆ sixlowpan_sfr_rfrag_ack_req()

static bool sixlowpan_sfr_rfrag_ack_req ( sixlowpan_sfr_rfrag_t hdr)
inlinestatic

Check if the Acknowledgment request flag in a 6LoWPAN recoverable fragment header is set.

Parameters
[in]hdrA 6LoWPAN recoverable fragment header

return true, if Acknowledgment request flag in hdr is set return false, if Acknowledgment request flag in hdr is cleared

Definition at line 260 of file sfr.h.

◆ sixlowpan_sfr_rfrag_clear_ack_req()

static void sixlowpan_sfr_rfrag_clear_ack_req ( sixlowpan_sfr_rfrag_t hdr)
inlinestatic

Clear the Acknowledgment request flag in a 6LoWPAN recoverable fragment header.

Parameters
[in,out]hdrA 6LoWPAN recoverable fragment header

Definition at line 246 of file sfr.h.

◆ sixlowpan_sfr_rfrag_get_frag_size()

static uint16_t sixlowpan_sfr_rfrag_get_frag_size ( const sixlowpan_sfr_rfrag_t hdr)
inlinestatic

Get fragment size from a 6LoWPAN recoverable fragment header.

Parameters
[in]hdrA 6LoWPAN recoverable fragment header
Returns
The fragment size of the 6LoWPAN recoverable fragment

Definition at line 319 of file sfr.h.

◆ sixlowpan_sfr_rfrag_get_offset()

static uint16_t sixlowpan_sfr_rfrag_get_offset ( const sixlowpan_sfr_rfrag_t hdr)
inlinestatic

Get fragment offset from a 6LoWPAN recoverable fragment header.

Parameters
[in]hdrA 6LoWPAN recoverable fragment header
Returns
The fragment offset of the 6LoWPAN recoverable fragment

Definition at line 343 of file sfr.h.

◆ sixlowpan_sfr_rfrag_get_seq()

static uint8_t sixlowpan_sfr_rfrag_get_seq ( const sixlowpan_sfr_rfrag_t hdr)
inlinestatic

Get sequence number from a 6LoWPAN recoverable fragment header.

Parameters
[in]hdrA 6LoWPAN recoverable fragment header
Returns
The sequence number of the 6LoWPAN recoverable fragment

Definition at line 289 of file sfr.h.

◆ sixlowpan_sfr_rfrag_is()

static bool sixlowpan_sfr_rfrag_is ( const sixlowpan_sfr_t hdr)
inlinestatic

Check if given header is a 6LoWPAN recoverable fragment header.

See also
SIXLOWPAN_SFR_RFRAG_DISP
Parameters
[in]hdrThe 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

Definition at line 224 of file sfr.h.

◆ sixlowpan_sfr_rfrag_set_ack_req()

static void sixlowpan_sfr_rfrag_set_ack_req ( sixlowpan_sfr_rfrag_t hdr)
inlinestatic

Set the Acknowledgment request flag in a 6LoWPAN recoverable fragment header.

Parameters
[in,out]hdrA 6LoWPAN recoverable fragment header

Definition at line 235 of file sfr.h.

◆ sixlowpan_sfr_rfrag_set_disp()

static void sixlowpan_sfr_rfrag_set_disp ( sixlowpan_sfr_t hdr)
inlinestatic

Initialize 6LoWPAN recoverable fragment dispatch.

See also
SIXLOWPAN_SFR_RFRAG_DISP
Parameters
[in,out]hdrA 6LoWPAN selective fragment recovery header

Definition at line 208 of file sfr.h.

◆ sixlowpan_sfr_rfrag_set_frag_size()

static void sixlowpan_sfr_rfrag_set_frag_size ( sixlowpan_sfr_rfrag_t hdr,
uint16_t  frag_size 
)
inlinestatic

Set fragment size in a 6LoWPAN recoverable fragment header.

Precondition
frag_size <= SIXLOWPAN_SFR_FRAG_SIZE_MAX
Parameters
[in,out]hdrA 6LoWPAN recoverable fragment header
[in]frag_sizeThe fragment size to set. Must be lesser or equal to SIXLOWPAN_SFR_FRAG_SIZE_MAX.

Definition at line 304 of file sfr.h.

◆ sixlowpan_sfr_rfrag_set_offset()

static void sixlowpan_sfr_rfrag_set_offset ( sixlowpan_sfr_rfrag_t hdr,
uint16_t  offset 
)
inlinestatic

Set fragment offset in a 6LoWPAN recoverable fragment header.

Parameters
[in,out]hdrA 6LoWPAN recoverable fragment header
[in]offsetThe fragment offset to set.

Definition at line 330 of file sfr.h.

◆ sixlowpan_sfr_rfrag_set_seq()

static void sixlowpan_sfr_rfrag_set_seq ( sixlowpan_sfr_rfrag_t hdr,
uint8_t  seq 
)
inlinestatic

Set sequence number in a 6LoWPAN recoverable fragment header.

Precondition
seq <= SIXLOWPAN_SFR_SEQ_MAX
Parameters
[in,out]hdrA 6LoWPAN recoverable fragment header
[in]seqThe sequence number to set. Must be lesser or equal to SIXLOWPAN_SFR_SEQ_MAX.

Definition at line 274 of file sfr.h.

◆ sixlowpan_sfr_set_ecn()

static void sixlowpan_sfr_set_ecn ( sixlowpan_sfr_t hdr)
inlinestatic

Set the ECN flag in a 6LoWPAN selective fragment recovery header.

Parameters
[in,out]hdrA 6LoWPAN selective fragment recovery header

Definition at line 172 of file sfr.h.