ctx.h¶
Context buffer definitions.
-
GNRC_SIXLOWPAN_CTX_FLAGS_CID_MASK¶ mask for the Context ID.
1
(0x0f)
-
GNRC_SIXLOWPAN_CTX_FLAGS_COMP¶ Use context for compression.
1
(0x10)
-
GNRC_SIXLOWPAN_CTX_SIZE¶ maximum number of entries in context buffer
1
(16)
-
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
addr: An IPv6 address. Return values
- The context associated with the best prefix for
addr. - NULL if there is no such context.
- The context associated with the best prefix for
-
gnrc_sixlowpan_ctx_t *
gnrc_sixlowpan_ctx_lookup_id(uint8_t id)¶ Gets context by ID.
Parameters
id: A context ID. Return values
- The context associated with
id. - NULL if there is no such context.
- The context associated with
-
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
id: The ID for the context. Must be < ctx.h::GNRC_SIXLOWPAN_CTX_SIZE.prefix: The prefix for the context. prefix_len: Length of prefixin bits. Must be > 0.ltime: New lifetime of the context. compwill be implicitly set tofalseifltime== 0.comp: Use for compression if true, do not use for compression, but still for decompression if false. Return values
- The new context on success.
- NULL, on error or on removal.
-
void
gnrc_sixlowpan_ctx_reset(void)¶ Resets the whole context buffer.
-
struct
gnrc_sixlowpan_ctx_t¶ Entry in the 6LoWPAN context buffer.
-
ipv6_addr_t
prefix¶ The prefix associated to this context.
-
uint8_t
prefix_len¶ Length of
ctx.h::gnrc_sixlowpan_ctx_t::prefixin bit.
-
uint8_t
flags_id¶ 4-bit flags, 4-bit Context ID.
The flags are defined as above.Note
This needs to be here to easily translate prefixes to ID.
-
uint16_t
ltime¶ Lifetime in minutes this context is valid.
See also
-
ipv6_addr_t