6LoWPAN Fragmentation headers and functionality More...

Detailed Description

6LoWPAN Fragmentation headers and functionality

See also
RFC 4944, section 5.3

Files

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

Data Structures

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

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...
 
void gnrc_sixlowpan_frag_rbuf_gc (void)
 Garbage collect reassembly buffer.
 
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.
 

Function Documentation

◆ 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_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