Loading...
Searching...
No Matches
sfr.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
34#ifndef NET_GNRC_SIXLOWPAN_FRAG_SFR_H
35#define NET_GNRC_SIXLOWPAN_FRAG_SFR_H
36
37#include "assert.h"
38#include "bitfield.h"
39#include "net/gnrc/pkt.h"
40#include "net/gnrc/netif.h"
45#include "net/sixlowpan/sfr.h"
46
47#ifdef __cplusplus
48extern "C" {
49#endif
50
54#define GNRC_SIXLOWPAN_FRAG_SFR_ARQ_TIMEOUT_MSG (0x0227)
55
59#define GNRC_SIXLOWPAN_FRAG_SFR_INTER_FRAG_GAP_MSG (0x0228)
60
64typedef struct {
66 struct {
67 uint32_t usual;
68 uint32_t aborts;
69 uint32_t forwarded;
70 } fragments_sent;
71 struct {
72 uint32_t by_nack;
73 uint32_t by_timeout;
74 } fragment_resends;
75 struct {
76 uint32_t full;
77 uint32_t partly;
78 uint32_t aborts;
79 uint32_t forwarded;
80 } acks;
82
87
96{
97 if (IS_USED(MODULE_GNRC_SIXLOWPAN_FRAG_SFR) &&
98 gnrc_netif_is_6lo(netif)) {
99#if IS_USED(MODULE_GNRC_NETIF_6LO)
101 netif->sixlo.max_frag_size =
104 : netif->sixlo.max_frag_size;
106#endif
107 }
108}
109
122{
123#if IS_USED(MODULE_GNRC_NETIF_6LO)
124 return IS_USED(MODULE_GNRC_SIXLOWPAN_FRAG_SFR) &&
125 gnrc_netif_is_6lo(netif) &&
127#else
128 (void)netif;
129 return false;
130#endif
131}
132
147 unsigned page);
148
156void gnrc_sixlowpan_frag_sfr_recv(gnrc_pktsnip_t *pkt, void *ctx, unsigned page);
157
175 unsigned page);
176
184
192
193#if IS_USED(MODULE_GNRC_SIXLOWPAN_FRAG_SFR_STATS)
199void gnrc_sixlowpan_frag_sfr_stats_get(gnrc_sixlowpan_frag_sfr_stats_t *stats);
200#endif /* IS_USED(MODULE_GNRC_SIXLOWPAN_FRAG_SFR_STATS) */
201
202#ifdef __cplusplus
203}
204#endif
205
206#endif /* NET_GNRC_SIXLOWPAN_FRAG_SFR_H */
#define GNRC_NETIF_6LO_LOCAL_FLAGS_SFR
Selective Fragment Recovery enabled.
Definition 6lo.h:46
POSIX.1-2008 compliant version of the assert macro.
#define assert(cond)
abort the program if assertion is false
Definition assert.h:137
bitfields operations on bitfields of arbitrary length
Fragmentation buffer definitions.
Definition for GNRC's network interfaces.
#define CONFIG_GNRC_SIXLOWPAN_SFR_OPT_FRAG_SIZE
Default value for fragment size that the sender should use to start with (OptFragmentSize)
Definition config.h:206
#define CONFIG_GNRC_SIXLOWPAN_SFR_MIN_FRAG_SIZE
Default minimum value for fragment size (MinFragmentSize)
Definition config.h:183
int gnrc_sixlowpan_frag_sfr_forward(gnrc_pktsnip_t *pkt, sixlowpan_sfr_rfrag_t *rfrag, gnrc_sixlowpan_frag_vrb_t *vrbe, unsigned page)
Forward a fragment via selective fragment recovery.
void gnrc_sixlowpan_frag_sfr_arq_timeout(gnrc_sixlowpan_frag_fb_t *fbuf)
Handles an Acknowledgment request timeout.
void gnrc_sixlowpan_frag_sfr_recv(gnrc_pktsnip_t *pkt, void *ctx, unsigned page)
Handles a packet containing a selective fragment recovery header.
void gnrc_sixlowpan_frag_sfr_send(gnrc_pktsnip_t *pkt, void *ctx, unsigned page)
Sends a packet via selective fragment recovery.
void gnrc_sixlowpan_frag_sfr_init(void)
Initialize selective fragment recovery.
static bool gnrc_sixlowpan_frag_sfr_netif(gnrc_netif_t *netif)
Checks if a network interface is configured for selective fragment recovery.
Definition sfr.h:121
void gnrc_sixlowpan_frag_sfr_inter_frame_gap(gnrc_sixlowpan_frag_fb_t *fbuf)
Handles inter frame gap.
static void gnrc_sixlowpan_frag_sfr_init_iface(gnrc_netif_t *netif)
Initialize a network interface for selective fragment recovery.
Definition sfr.h:95
#define IS_USED(module)
Checks whether a module is being used or not.
Definition modules.h:71
General definitions for network packets and their helper functions.
6LoWPAN selective fragment recovery type definitions for GNRC
6LoWPAN selective fragment recovery dispatch type and helper function definitions.
uint16_t max_frag_size
Maximum fragment size for 6Lo fragmentation.
Definition 6lo.h:59
uint8_t local_flags
6LoWPAN capability flags beyond the ones advertised in 6LoWPAN Capability Indication Option (6CIO)
Definition 6lo.h:68
Representation of a network interface.
Definition netif.h:135
gnrc_netif_6lo_t sixlo
6Lo component
Definition netif.h:210
Type to represent parts (either headers or payload) of a packet, called snips.
Definition pkt.h:108
6LoWPAN fragmentation buffer entry.
Definition fb.h:47
Stats on selective fragment recovery.
Definition sfr.h:64
uint32_t usual
non-abort fragments sent
Definition sfr.h:67
uint32_t full
full RFRAGs ACKs sent
Definition sfr.h:76
uint32_t forwarded
forwarded fragments
Definition sfr.h:69
uint32_t by_timeout
fragments resent due to an ARQ timeout
Definition sfr.h:73
uint32_t datagram_resends
datagrams resent
Definition sfr.h:65
uint32_t by_nack
fragments resent due to a 0 in ACK's bitmap
Definition sfr.h:72
uint32_t partly
partly ACKing RFRAGs sent
Definition sfr.h:77
uint32_t aborts
abort pseudo-fragments sent
Definition sfr.h:68
Representation of the virtual reassembly buffer entry.
Definition vrb.h:47
Recoverable fragment header.
Definition sfr.h:96
Configuration macros for 6LoWPAN.
Virtual reassembly buffer definitions.