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 
21 #include <stddef.h>
22 #include <stdbool.h>
23 #include <stdint.h>
24 
25 #include "modules.h"
26 #include "net/gnrc/netif.h"
28 #ifdef MODULE_GNRC_SIXLOWPAN_FRAG
30 #endif /* MODULE_GNRC_SIXLOWPAN_FRAG */
32 #include "timex.h"
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
44 typedef struct {
53  uint16_t out_tag;
54 #if IS_USED(MODULE_GNRC_SIXLOWPAN_FRAG_SFR)
55  int16_t offset_diff;
59  gnrc_netif_t *in_netif;
60 #endif /* IS_USED(MODULE_GNRC_SIXLOWPAN_FRAG_SFR) */
62 
81  gnrc_netif_t *out_netif, const uint8_t *out_dst, size_t out_dst_len);
82 
102  const gnrc_sixlowpan_frag_rb_base_t *base,
103  gnrc_netif_t *netif, const gnrc_pktsnip_t *hdr);
104 
109 
122  const uint8_t *src, size_t src_len, unsigned src_tag);
123 
138  const gnrc_netif_t *netif, const uint8_t *src, size_t src_len,
139  unsigned tag);
140 
147 {
148  if (IS_USED(MODULE_GNRC_SIXLOWPAN_FRAG_RB)) {
150  }
151  vrb->super.src_len = 0;
152 }
153 
163 {
164  return (vrb->super.src_len == 0);
165 }
166 
167 #if defined(TEST_SUITES) || defined(DOXYGEN)
174 #endif
175 
176 #ifdef __cplusplus
177 }
178 #endif
179 
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.
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_reverse(const gnrc_netif_t *netif, const uint8_t *src, size_t src_len, unsigned tag)
Reverse VRB lookup.
static void gnrc_sixlowpan_frag_vrb_rm(gnrc_sixlowpan_frag_vrb_t *vrb)
Removes an entry from the VRB.
Definition: vrb.h:146
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.
void gnrc_sixlowpan_frag_vrb_gc(void)
Checks timeouts and removes entries if necessary.
static bool gnrc_sixlowpan_frag_vrb_entry_empty(gnrc_sixlowpan_frag_vrb_t *vrb)
Determines if a VRB entry is empty.
Definition: vrb.h:162
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.
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:129
Type to represent parts (either headers or payload) of a packet, called snips.
Definition: pkt.h:105
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:44
gnrc_netif_t * out_netif
Outgoing interface to gnrc_sixlowpan_frag_rb_base_t::dst.
Definition: vrb.h:49
uint16_t out_tag
Outgoing tag to gnrc_sixlowpan_frag_rb_base_t::dst.
Definition: vrb.h:53
gnrc_sixlowpan_frag_rb_base_t super
base type
Definition: vrb.h:45
Configuration macros for 6LoWPAN.
Utility library for comparing and computing timestamps.