Loading...
Searching...
No Matches
vrb.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2019 Freie Universität Berlin
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
20
21#include <stddef.h>
22#include <stdbool.h>
23#include <stdint.h>
24
25#include "compiler_hints.h"
26#include "modules.h"
27#include "net/gnrc/netif.h"
30
31#ifdef MODULE_GNRC_SIXLOWPAN_FRAG
33#endif /* MODULE_GNRC_SIXLOWPAN_FRAG */
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
45typedef struct {
54 uint16_t out_tag;
55#if IS_USED(MODULE_GNRC_SIXLOWPAN_FRAG_SFR)
56 int16_t offset_diff;
60 gnrc_netif_t *in_netif;
61#endif /* IS_USED(MODULE_GNRC_SIXLOWPAN_FRAG_SFR) */
63
80ACCESS(read_only, 3, 4)
83 gnrc_netif_t *out_netif, const uint8_t *out_dst, size_t out_dst_len);
84
105 gnrc_netif_t *netif, const gnrc_pktsnip_t *hdr);
106
111
123ACCESS(read_only, 1, 2)
125 const uint8_t *src, size_t src_len, unsigned src_tag);
126
140ACCESS(read_only, 2, 3)
142 const gnrc_netif_t *netif, const uint8_t *src, size_t src_len,
143 unsigned tag);
144
151{
152 if (IS_USED(MODULE_GNRC_SIXLOWPAN_FRAG_RB)) {
154 }
155 vrb->super.src_len = 0;
156}
157
167{
168 return (vrb->super.src_len == 0);
169}
170
171#if defined(TEST_SUITES) || defined(DOXYGEN)
178#endif
179
180#ifdef __cplusplus
181}
182#endif
183
Common macros and compiler attributes/pragmas configuration.
#define ACCESS(mode, ptr_idx, size_idx)
Emit an attribute (if supported by the compiler) that declares how a function will access its paramet...
Definition for GNRC's network interfaces.
6LoWPAN Fragmentation definitions
struct gnrc_pktsnip gnrc_pktsnip_t
Type to represent parts (either headers or payload) of a packet, called snips.
void gnrc_sixlowpan_frag_rb_base_rm(gnrc_sixlowpan_frag_rb_base_t *entry)
Remove base entry.
void gnrc_sixlowpan_frag_vrb_reset(void)
Resets the VRB to a clean state.
static void gnrc_sixlowpan_frag_vrb_rm(gnrc_sixlowpan_frag_vrb_t *vrb)
Removes an entry from the VRB.
Definition vrb.h:150
void gnrc_sixlowpan_frag_vrb_gc(void)
Checks timeouts and removes entries if necessary.
gnrc_sixlowpan_frag_vrb_t * gnrc_sixlowpan_frag_vrb_reverse(const gnrc_netif_t *netif, const uint8_t *src, size_t src_len, unsigned tag)
Reverse VRB lookup.
gnrc_sixlowpan_frag_vrb_t * gnrc_sixlowpan_frag_vrb_add(const gnrc_sixlowpan_frag_rb_base_t *base, gnrc_netif_t *out_netif, const uint8_t *out_dst, size_t out_dst_len)
Adds a new reassembly buffer entry.
gnrc_sixlowpan_frag_vrb_t * gnrc_sixlowpan_frag_vrb_get(const uint8_t *src, size_t src_len, unsigned src_tag)
Gets a VRB entry.
static bool gnrc_sixlowpan_frag_vrb_entry_empty(gnrc_sixlowpan_frag_vrb_t *vrb)
Determines if a VRB entry is empty.
Definition vrb.h:166
gnrc_sixlowpan_frag_vrb_t * gnrc_sixlowpan_frag_vrb_from_route(const gnrc_sixlowpan_frag_rb_base_t *base, gnrc_netif_t *netif, const gnrc_pktsnip_t *hdr)
Generate reassembly buffer from a header's forwarding information.
Common macros and compiler attributes/pragmas configuration.
#define IS_USED(module)
Checks whether a module is being used or not.
Definition modules.h:67
Reassembly buffer definitions.
Representation of a network interface.
Definition netif.h:137
Base class for both reassembly buffer and virtual reassembly buffer.
Definition rb.h:73
uint8_t src_len
length of gnrc_sixlowpan_frag_rb_t::src
Definition rb.h:77
Representation of the virtual reassembly buffer entry.
Definition vrb.h:45
gnrc_netif_t * out_netif
Outgoing interface to gnrc_sixlowpan_frag_rb_base_t::dst.
Definition vrb.h:50
uint16_t out_tag
Outgoing tag to gnrc_sixlowpan_frag_rb_base_t::dst.
Definition vrb.h:54
gnrc_sixlowpan_frag_rb_base_t super
base type
Definition vrb.h:46
Configuration macros for 6LoWPAN.