6LoWPAN Fragmentation headers and functionality More...

Detailed Description

6LoWPAN Fragmentation headers and functionality

See also
RFC 4944, section 5.3

Modules

 6LoWPAN reassembly buffer
 6LoWPAN reassembly buffer
 
 Fragment size hint
 Provides a hint for smaller fragment sizes than the link-layer PDU for the next fragment to sent.
 
 Virtual reassembly buffer
 Virtual reassembly buffer.
 

Files

file  frag.h
 6LoWPAN Fragmentation definitions
 

Data Structures

struct  gnrc_sixlowpan_msg_frag_t
 Definition of 6LoWPAN fragmentation type. More...
 
struct  gnrc_sixlowpan_frag_stats_t
 Statistics on fragmentation and reassembly. More...
 

Functions

gnrc_sixlowpan_frag_stats_tgnrc_sixlowpan_frag_stats_get (void)
 Get the current statistics on fragmentation and reassembly. More...
 
gnrc_sixlowpan_msg_frag_tgnrc_sixlowpan_msg_frag_get (void)
 Allocates a gnrc_sixlowpan_msg_frag_t object. More...
 
void gnrc_sixlowpan_frag_send (gnrc_pktsnip_t *pkt, void *ctx, unsigned page)
 Sends a packet fragmented. More...
 
void gnrc_sixlowpan_frag_recv (gnrc_pktsnip_t *pkt, void *ctx, unsigned page)
 Handles a packet containing a fragment header. More...
 
uint16_t gnrc_sixlowpan_frag_next_tag (void)
 Generate a new datagram tag for sending. More...
 
static bool gnrc_sixlowpan_frag_send_msg (gnrc_sixlowpan_msg_frag_t *fragment_msg)
 Sends a message to pass a further fragment down the network stack. More...
 

Message types

#define GNRC_SIXLOWPAN_MSG_FRAG_SND   (0x0225)
 Message type for passing one 6LoWPAN fragment down the network stack.
 
#define GNRC_SIXLOWPAN_MSG_FRAG_GC_RBUF   (0x0226)
 Message type for triggering garbage collection reassembly buffer.
 

Function Documentation

◆ gnrc_sixlowpan_frag_next_tag()

uint16_t gnrc_sixlowpan_frag_next_tag ( void  )

Generate a new datagram tag for sending.

Returns
A new datagram tag.

◆ gnrc_sixlowpan_frag_recv()

void gnrc_sixlowpan_frag_recv ( gnrc_pktsnip_t pkt,
void *  ctx,
unsigned  page 
)

Handles a packet containing a fragment header.

Parameters
[in]pktThe packet to handle
[in]ctxContext for the packet. May be NULL.
[in]pageCurrent 6Lo dispatch parsing page.

◆ gnrc_sixlowpan_frag_send()

void gnrc_sixlowpan_frag_send ( gnrc_pktsnip_t pkt,
void *  ctx,
unsigned  page 
)

Sends a packet fragmented.

Precondition
ctx != NULL
gnrc_sixlowpan_msg_frag_t::pkt of ctx is equal to pkt or pkt == NULL.
Parameters
[in]pktA packet. May be NULL.
[in]ctxMessage containing status of the 6LoWPAN fragmentation progress. Expected to be of type gnrc_sixlowpan_msg_frag_t, with gnrc_sixlowpan_msg_frag_t set to pkt. Must not be NULL.
[in]pageCurrent 6Lo dispatch parsing page.

◆ gnrc_sixlowpan_frag_send_msg()

static bool gnrc_sixlowpan_frag_send_msg ( gnrc_sixlowpan_msg_frag_t fragment_msg)
inlinestatic

Sends a message to pass a further fragment down the network stack.

See also
GNRC_SIXLOWPAN_MSG_FRAG_SND
Parameters
[in]fragment_msgA gnrc_sixlowpan_msg_frag_t object
Returns
true, when the message was sent
false when sending the message failed.

Definition at line 155 of file frag.h.

◆ gnrc_sixlowpan_frag_stats_get()

gnrc_sixlowpan_frag_stats_t* gnrc_sixlowpan_frag_stats_get ( void  )

Get the current statistics on fragmentation and reassembly.

Returns
The current statistics on fragmentation and reassembly

◆ gnrc_sixlowpan_msg_frag_get()

gnrc_sixlowpan_msg_frag_t* gnrc_sixlowpan_msg_frag_get ( void  )

Allocates a gnrc_sixlowpan_msg_frag_t object.

Returns
A gnrc_sixlowpan_msg_frag_t if available
NULL, otherwise