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_reset
void gnrc_sixlowpan_frag_vrb_reset(void)
Resets the VRB to a clean state.
gnrc_sixlowpan_frag_vrb_t::super
gnrc_sixlowpan_frag_rb_base_t super
base type
Definition: vrb.h:48
gnrc_sixlowpan_frag_vrb_gc
void gnrc_sixlowpan_frag_vrb_gc(void)
Checks timeouts and removes entries if necessary.
gnrc_sixlowpan_frag_vrb_t::out_tag
uint16_t out_tag
Outgoing tag to gnrc_sixlowpan_frag_rb_base_t::dst.
Definition: vrb.h:56
gnrc_sixlowpan_frag_vrb_rm
static void gnrc_sixlowpan_frag_vrb_rm(gnrc_sixlowpan_frag_vrb_t *vrb)
Removes an entry from the VRB.
Definition: vrb.h:125
kernel_defines.h
Common macros and compiler attributes/pragmas configuration.
rb.h
Reassembly buffer definitions.
frag.h
6LoWPAN Fragmentation definitions
gnrc_sixlowpan_frag_vrb_t
Representation of the virtual reassembly buffer entry.
Definition: vrb.h:47
config.h
Configuration macros for 6LoWPAN.
gnrc_sixlowpan_frag_rb_base_t::src_len
uint8_t src_len
length of gnrc_sixlowpan_frag_rb_t::src
Definition: rb.h:75
timex.h
Utility library for comparing and computing timestamps.
gnrc_sixlowpan_frag_vrb_get
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_rb_base_rm
void gnrc_sixlowpan_frag_rb_base_rm(gnrc_sixlowpan_frag_rb_base_t *entry)
Remove base entry.
gnrc_netif_t
Representation of a network interface.
Definition: netif.h:115
gnrc_sixlowpan_frag_vrb_entry_empty
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
gnrc_sixlowpan_frag_rb_base_t
Base class for both reassembly buffer and virtual reassembly buffer.
Definition: rb.h:71
gnrc_sixlowpan_frag_vrb_add
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.
IS_USED
#define IS_USED(module)
Checks whether a module is being used or not. Can be used in C conditionals.
Definition: kernel_defines.h:188
gnrc_sixlowpan_frag_vrb_from_route
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.
netif.h
Definition for GNRC's network interfaces.
gnrc_sixlowpan_frag_vrb_t::out_netif
gnrc_netif_t * out_netif
Outgoing interface to gnrc_sixlowpan_frag_rb_base_t::dst.
Definition: vrb.h:52
gnrc_pktsnip
Type to represent parts (either headers or payload) of a packet, called snips.
Definition: pkt.h:108