vrb.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019 Freie Universit├Ąt Berlin
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
21#ifndef NET_GNRC_SIXLOWPAN_FRAG_VRB_H
22#define NET_GNRC_SIXLOWPAN_FRAG_VRB_H
23
24#include <stddef.h>
25#include <stdbool.h>
26#include <stdint.h>
27
28#include "modules.h"
29#include "net/gnrc/netif.h"
31#ifdef MODULE_GNRC_SIXLOWPAN_FRAG
33#endif /* MODULE_GNRC_SIXLOWPAN_FRAG */
35#include "timex.h"
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
47typedef struct {
56 uint16_t out_tag;
57#if IS_USED(MODULE_GNRC_SIXLOWPAN_FRAG_SFR)
58 int16_t offset_diff;
62 gnrc_netif_t *in_netif;
63#endif /* IS_USED(MODULE_GNRC_SIXLOWPAN_FRAG_SFR) */
65
84 gnrc_netif_t *out_netif, const uint8_t *out_dst, size_t out_dst_len);
85
106 gnrc_netif_t *netif, const gnrc_pktsnip_t *hdr);
107
112
125 const uint8_t *src, size_t src_len, unsigned src_tag);
126
141 const gnrc_netif_t *netif, const uint8_t *src, size_t src_len,
142 unsigned tag);
143
150{
151 if (IS_USED(MODULE_GNRC_SIXLOWPAN_FRAG_RB)) {
153 }
154 vrb->super.src_len = 0;
155}
156
166{
167 return (vrb->super.src_len == 0);
168}
169
170#if defined(TEST_SUITES) || defined(DOXYGEN)
177#endif
178
179#ifdef __cplusplus
180}
181#endif
182
183#endif /* NET_GNRC_SIXLOWPAN_FRAG_VRB_H */
Definition for GNRC's network interfaces.
6LoWPAN Fragmentation definitions
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:149
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:165
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:71
Reassembly buffer definitions.
Representation of a network interface.
Definition: netif.h:135
Type to represent parts (either headers or payload) of a packet, called snips.
Definition: pkt.h:108
Base class for both reassembly buffer and virtual reassembly buffer.
Definition: rb.h:76
uint8_t src_len
length of gnrc_sixlowpan_frag_rb_t::src
Definition: rb.h:80
Representation of the virtual reassembly buffer entry.
Definition: vrb.h:47
gnrc_netif_t * out_netif
Outgoing interface to gnrc_sixlowpan_frag_rb_base_t::dst.
Definition: vrb.h:52
uint16_t out_tag
Outgoing tag to gnrc_sixlowpan_frag_rb_base_t::dst.
Definition: vrb.h:56
gnrc_sixlowpan_frag_rb_base_t super
base type
Definition: vrb.h:48
Configuration macros for 6LoWPAN.
Utility library for comparing and computing timestamps.