6LoWPAN Fragmentation headers and functionality More...

Detailed Description

6LoWPAN Fragmentation headers and functionality

See also
RFC 4944, section 5.3

Modules

 Fragment size hint
 Provides a hint for smaller fragment sizes than the link-layer PDU for the next fragment to sent.
 

Files

file  frag.h
 6LoWPAN Fragmentation definitions
 
file  rbuf.h
 

Data Structures

struct  gnrc_sixlowpan_rbuf_int
 Fragment intervals to identify limits of fragments and duplicates. More...
 
struct  gnrc_sixlowpan_rbuf_base_t
 Base class for both reassembly buffer and virtual reassembly buffer. More...
 
struct  gnrc_sixlowpan_rbuf_t
 An entry in the 6LoWPAN reassembly buffer. More...
 
struct  gnrc_sixlowpan_msg_frag_t
 Definition of 6LoWPAN fragmentation type. More...
 

Typedefs

typedef struct gnrc_sixlowpan_rbuf_int gnrc_sixlowpan_rbuf_int_t
 Fragment intervals to identify limits of fragments and duplicates. More...
 

Functions

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...
 
void gnrc_sixlowpan_frag_rbuf_base_rm (gnrc_sixlowpan_rbuf_base_t *entry)
 Remove base entry. More...
 
void gnrc_sixlowpan_frag_rbuf_gc (void)
 Garbage collect reassembly buffer.
 
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...
 
void gnrc_sixlowpan_frag_rbuf_remove (gnrc_sixlowpan_rbuf_t *rbuf)
 Removes an entry from the reassembly buffer. More...
 
void gnrc_sixlowpan_frag_rbuf_dispatch_when_complete (gnrc_sixlowpan_rbuf_t *rbuf, gnrc_netif_hdr_t *netif)
 Checks if a reassembly buffer entry is complete and dispatches it to the next layer if that is the case. 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.
 

Typedef Documentation

◆ gnrc_sixlowpan_rbuf_int_t

Fragment intervals to identify limits of fragments and duplicates.

Note
Fragments MUST NOT overlap and overlapping fragments are to be discarded
See also
RFC 4944, section 5.3

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_rbuf_base_rm()

void gnrc_sixlowpan_frag_rbuf_base_rm ( gnrc_sixlowpan_rbuf_base_t entry)

Remove base entry.

Parameters
[in,out]entryEntry to remove

◆ gnrc_sixlowpan_frag_rbuf_dispatch_when_complete()

void gnrc_sixlowpan_frag_rbuf_dispatch_when_complete ( gnrc_sixlowpan_rbuf_t rbuf,
gnrc_netif_hdr_t netif 
)

Checks if a reassembly buffer entry is complete and dispatches it to the next layer if that is the case.

Precondition
rbuf != NULL
netif != NULL
Parameters
[in]rbufA reassembly buffer entry. Must not be NULL.
[in]netifOriginal gnrc_netif_hdr_t of the last received frame. Used to construct the gnrc_netif_hdr_t of the completed datagram. Must not be NULL.

◆ gnrc_sixlowpan_frag_rbuf_remove()

void gnrc_sixlowpan_frag_rbuf_remove ( gnrc_sixlowpan_rbuf_t rbuf)

Removes an entry from the reassembly buffer.

Precondition
rbuf != NULL
Parameters
[in]rbufA reassembly buffer entry. Must not be NULL.

◆ 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 204 of file frag.h.

◆ 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