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 "kernel_defines.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
38 extern "C" {
39 #endif
40 
47 typedef struct {
56  uint16_t out_tag;
58 
77  gnrc_netif_t *out_netif, const uint8_t *out_dst, size_t out_dst_len);
78 
99  gnrc_netif_t *netif, const gnrc_pktsnip_t *hdr);
100 
104 void gnrc_sixlowpan_frag_vrb_gc(void);
105 
118  const uint8_t *src, size_t src_len, unsigned src_tag);
119 
126 {
127  if (IS_USED(MODULE_GNRC_SIXLOWPAN_FRAG_RB)) {
129  }
130  vrb->super.src_len = 0;
131 }
132 
142 {
143  return (vrb->super.src_len == 0);
144 }
145 
146 #if defined(TEST_SUITES) || defined(DOXYGEN)
147 
153 #endif
154 
155 #ifdef __cplusplus
156 }
157 #endif
158 
159 #endif /* NET_GNRC_SIXLOWPAN_FRAG_VRB_H */
160 
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.
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&#39;s forwarding information.
static bool gnrc_sixlowpan_frag_vrb_entry_empty(gnrc_sixlowpan_frag_vrb_t *vrb)
Determines if a VRB entry is empty.
Definition: vrb.h:141
uint8_t src_len
length of gnrc_sixlowpan_frag_rb_t::src
Definition: rb.h:75
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.
#define IS_USED(module)
Checks whether a module is being used or not.
Utility library for comparing and computing timestamps.
Representation of the virtual reassembly buffer entry.
Definition: vrb.h:47
gnrc_sixlowpan_frag_rb_base_t super
base type
Definition: vrb.h:48
Representation of a network interface.
Definition: netif.h:107
Base class for both reassembly buffer and virtual reassembly buffer.
Definition: rb.h:71
void gnrc_sixlowpan_frag_vrb_reset(void)
Resets the VRB to a clean state.
uint16_t out_tag
Outgoing tag to gnrc_sixlowpan_frag_rb_base_t::dst.
Definition: vrb.h:56
Definition for GNRC&#39;s network interfaces.
Reassembly buffer definitions.
Common macros and compiler attributes/pragmas configuration.
static void gnrc_sixlowpan_frag_vrb_rm(gnrc_sixlowpan_frag_vrb_t *vrb)
Removes an entry from the VRB.
Definition: vrb.h:125
gnrc_netif_t * out_netif
Outgoing interface to gnrc_sixlowpan_frag_rb_base_t::dst.
Definition: vrb.h:52
Type to represent parts (either headers or payload) of a packet, called snips.
Definition: pkt.h:107
void gnrc_sixlowpan_frag_vrb_gc(void)
Checks timeouts and removes entries if necessary.
6LoWPAN Fragmentation definitions
void gnrc_sixlowpan_frag_rb_base_rm(gnrc_sixlowpan_frag_rb_base_t *entry)
Remove base entry.
Configuration macros for 6LoWPAN.