Contexts for 6LoWPAN address compression

Context buffer for stateful 6LoWPAN address compression. More...

Detailed Description

Context buffer for stateful 6LoWPAN address compression.

See also
RFC 6282, section 3.1.2
RFC 6775, section 4.2

Files

file  ctx.h
 Context buffer definitions.
 

Data Structures

struct  gnrc_sixlowpan_ctx_t
 Entry in the 6LoWPAN context buffer. More...
 

Macros

#define GNRC_SIXLOWPAN_CTX_SIZE   (16)
 maximum number of entries in context buffer
 

Functions

gnrc_sixlowpan_ctx_tgnrc_sixlowpan_ctx_lookup_addr (const ipv6_addr_t *addr)
 Gets a context matching the given IPv6 address best with its prefix. More...
 
gnrc_sixlowpan_ctx_tgnrc_sixlowpan_ctx_lookup_id (uint8_t id)
 Gets context by ID. More...
 
gnrc_sixlowpan_ctx_tgnrc_sixlowpan_ctx_update (uint8_t id, const ipv6_addr_t *prefix, uint8_t prefix_len, uint16_t ltime, bool comp)
 Updates (or adds if currently not registered) a context. More...
 
void gnrc_sixlowpan_ctx_reset (void)
 Resets the whole context buffer.
 

Context flags.

Flags to set in gnrc_sixlowpan_ctx_t::flags_id.

#define GNRC_SIXLOWPAN_CTX_FLAGS_CID_MASK   (0x0f)
 mask for the Context ID.
 
#define GNRC_SIXLOWPAN_CTX_FLAGS_COMP   (0x10)
 Use context for compression.
 

Function Documentation

◆ gnrc_sixlowpan_ctx_lookup_addr()

gnrc_sixlowpan_ctx_t* gnrc_sixlowpan_ctx_lookup_addr ( const ipv6_addr_t addr)

Gets a context matching the given IPv6 address best with its prefix.

Parameters
[in]addrAn IPv6 address.
Returns
The context associated with the best prefix for addr.
NULL if there is no such context.

◆ gnrc_sixlowpan_ctx_lookup_id()

gnrc_sixlowpan_ctx_t* gnrc_sixlowpan_ctx_lookup_id ( uint8_t  id)

Gets context by ID.

Parameters
[in]idA context ID.
Returns
The context associated with id.
NULL if there is no such context.

◆ gnrc_sixlowpan_ctx_update()

gnrc_sixlowpan_ctx_t* gnrc_sixlowpan_ctx_update ( uint8_t  id,
const ipv6_addr_t prefix,
uint8_t  prefix_len,
uint16_t  ltime,
bool  comp 
)

Updates (or adds if currently not registered) a context.

Parameters
[in]idThe ID for the context. Must be < GNRC_SIXLOWPAN_CTX_SIZE.
[in]prefixThe prefix for the context.
[in]prefix_lenLength of prefix in bits. Must be > 0.
[in]ltimeNew lifetime of the context. comp will be implicitly set to false if ltime == 0.
[in]compUse for compression if true, do not use for compression, but still for decompression if false.
Returns
The new context on success.
NULL, on error or on removal.