26#ifndef NET_GNRC_SIXLOWPAN_CTX_H
27#define NET_GNRC_SIXLOWPAN_CTX_H
40#define GNRC_SIXLOWPAN_CTX_SIZE (16)
48#define GNRC_SIXLOWPAN_CTX_FLAGS_CID_MASK (0x0f)
49#define GNRC_SIXLOWPAN_CTX_FLAGS_COMP (0x10)
115 uint8_t prefix_len, uint16_t ltime,
125 if (
IS_USED(MODULE_GNRC_SIXLOWPAN_CTX)) {
142 return (ctx != NULL) &&
161 if (!
IS_USED(MODULE_GNRC_SIXLOWPAN_CTX)) {
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.
gnrc_sixlowpan_ctx_t * gnrc_sixlowpan_ctx_lookup_id(uint8_t id)
Gets context by ID.
static bool gnrc_sixlowpan_ctx_update_6ctx(const ipv6_addr_t *prefix, uint8_t prefix_len, uint32_t valid)
Create or update a compression context.
static bool gnrc_sixlowpan_ctx_match(const gnrc_sixlowpan_ctx_t *ctx, const ipv6_addr_t *prefix, uint8_t prefix_len)
Check if a prefix matches a compression context.
static void gnrc_sixlowpan_ctx_remove(uint8_t id)
Removes context.
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.
void gnrc_sixlowpan_ctx_reset(void)
Resets the whole context buffer.
#define GNRC_SIXLOWPAN_CTX_FLAGS_CID_MASK
mask for the Context ID.
#define GNRC_SIXLOWPAN_CTX_SIZE
maximum number of entries in context buffer
uint8_t ipv6_addr_match_prefix(const ipv6_addr_t *a, const ipv6_addr_t *b)
Checks up to which bit-count two IPv6 addresses match in their prefix.
#define MS_PER_SEC
The number of milliseconds per second.
Adds include for missing inttype definitions.
Definitions for IPv6 addresses.
Common macros and compiler attributes/pragmas configuration.
#define IS_USED(module)
Checks whether a module is being used or not.
Entry in the 6LoWPAN context buffer.
uint8_t prefix_len
Length of gnrc_sixlowpan_ctx_t::prefix in bit.
uint16_t ltime
Lifetime in minutes this context is valid.
ipv6_addr_t prefix
The prefix associated to this context.
uint8_t flags_id
4-bit flags, 4-bit Context ID.
Utility library for comparing and computing timestamps.
Data type to represent an IPv6 address.