#include <inttypes.h>
#include <stdbool.h>
#include "net/gnrc/netif/hdr.h"
#include "net/gnrc/pkt.h"
#include "net/gnrc/sixlowpan/config.h"
#include "net/gnrc/sixlowpan/frag.h"
+ Include dependency graph for rbuf.h:

Go to the source code of this file.

Functions

void rbuf_add (gnrc_netif_hdr_t *netif_hdr, gnrc_pktsnip_t *frag, size_t offset, unsigned page)
 Adds a new fragment to the reassembly buffer. More...
 
void rbuf_gc (void)
 Checks timeouts and removes entries if necessary.
 
void rbuf_rm (gnrc_sixlowpan_rbuf_t *rbuf)
 Unsets a reassembly buffer entry (but does not free rbuf_t::super::pkt) More...
 
static bool rbuf_entry_empty (const gnrc_sixlowpan_rbuf_t *rbuf)
 Checks if a reassembly buffer entry is unset. More...
 
void rbuf_reset (void)
 Resets the packet buffer to a clean state. More...
 
const gnrc_sixlowpan_rbuf_trbuf_array (void)
 Returns a pointer to the array representing the reassembly buffer. More...
 

Legacy defines

#define RBUF_SIZE   (GNRC_SIXLOWPAN_FRAG_RBUF_SIZE)
 
#define RBUF_TIMEOUT   (GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_US)
 

Function Documentation

◆ rbuf_add()

void rbuf_add ( gnrc_netif_hdr_t netif_hdr,
gnrc_pktsnip_t frag,
size_t  offset,
unsigned  page 
)

Adds a new fragment to the reassembly buffer.

If the packet is complete, dispatch the packet with the transmit information of the last fragment.

Parameters
[in]netif_hdrThe interface header of the fragment, with gnrc_netif_hdr_t::if_pid and its source and destination address set.
[in]fragThe fragment to add.
[in]offsetThe fragment's offset.
[in]pageCurrent 6Lo dispatch parsing page.

◆ rbuf_array()

const gnrc_sixlowpan_rbuf_t* rbuf_array ( void  )

Returns a pointer to the array representing the reassembly buffer.

Note
Only available when TEST_SUITES is defined
Returns
The first element of the reassembly buffer. const, so that write access is immediately spotted at compile time of tests. The const qualifier may however be discarded if required by the tests.

◆ rbuf_entry_empty()

static bool rbuf_entry_empty ( const gnrc_sixlowpan_rbuf_t rbuf)
inlinestatic

Checks if a reassembly buffer entry is unset.

Parameters
[in]rbufA reassembly buffer entry
Returns
true, if rbuf is empty (i.e. rbuf->super.pkt is NULL).
false, if rbuf is in use.

Definition at line 87 of file rbuf.h.

◆ rbuf_reset()

void rbuf_reset ( void  )

Resets the packet buffer to a clean state.

Note
Only available when TEST_SUITES is defined

◆ rbuf_rm()

void rbuf_rm ( gnrc_sixlowpan_rbuf_t rbuf)

Unsets a reassembly buffer entry (but does not free rbuf_t::super::pkt)

This functions sets rbuf_t::super::pkt to NULL and removes all rbuf::ints.

Parameters
[in]rbufA reassembly buffer entry