IPv6 fragmentation extension

Definitions for IPv6 fragmentation extension. More...

Detailed Description

Definitions for IPv6 fragmentation extension.

See also
RFC 8200, section 4.5

Files

file  frag.h
 Fragmentation extension definitions.
 

Data Structures

struct  ipv6_ext_frag_t
 Fragment header definition. More...
 

Macros

#define IPV6_EXT_FRAG_OFFSET_MASK   (0xFFF8)
 Mask for the offset.
 
#define IPV6_EXT_FRAG_M   (0x0001)
 M flag.
 

Functions

static unsigned ipv6_ext_frag_get_offset (const ipv6_ext_frag_t *frag)
 Get offset of fragment in bytes. More...
 
static bool ipv6_ext_frag_more (const ipv6_ext_frag_t *frag)
 Checks if more fragments are coming after the given fragment. More...
 
static void ipv6_ext_frag_set_offset (ipv6_ext_frag_t *frag, unsigned offset)
 Sets the offset field of a fragment header. More...
 
static void ipv6_ext_frag_set_more (ipv6_ext_frag_t *frag)
 Sets the M flag of a fragment header. More...
 

Function Documentation

◆ ipv6_ext_frag_get_offset()

static unsigned ipv6_ext_frag_get_offset ( const ipv6_ext_frag_t frag)
inlinestatic

Get offset of fragment in bytes.

Parameters
[in]fragA fragment header
Returns
Offset of fragment in bytes.

Definition at line 62 of file frag.h.

◆ ipv6_ext_frag_more()

static bool ipv6_ext_frag_more ( const ipv6_ext_frag_t frag)
inlinestatic

Checks if more fragments are coming after the given fragment.

Parameters
[in]fragA fragment header
Returns
true, when more fragments are coming after the given fragment.
false, when the given fragment is the last.

Definition at line 78 of file frag.h.

◆ ipv6_ext_frag_set_more()

static void ipv6_ext_frag_set_more ( ipv6_ext_frag_t frag)
inlinestatic

Sets the M flag of a fragment header.

Note
Must be called after ipv6_ext_frag_set_offset()
Parameters
[in,out]fragA fragment header

Definition at line 109 of file frag.h.

◆ ipv6_ext_frag_set_offset()

static void ipv6_ext_frag_set_offset ( ipv6_ext_frag_t frag,
unsigned  offset 
)
inlinestatic

Sets the offset field of a fragment header.

Note
Must be called before ipv6_ext_frag_set_more()
Parameters
[in,out]fragA fragment header
[in]offsetThe offset of the fragment in bytes. Is assumed to be a multiple of 8. Is assumed to be lesser or equal to 65528.

Definition at line 93 of file frag.h.