Loading...
Searching...
No Matches
frag.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
20#ifndef NET_GNRC_IPV6_EXT_FRAG_H
21#define NET_GNRC_IPV6_EXT_FRAG_H
22
23#include <stdbool.h>
24#include <stdint.h>
25
26#include "clist.h"
27#include "net/gnrc/pkt.h"
28#include "net/gnrc/pktbuf.h"
29#include "net/ipv6/hdr.h"
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
38#define GNRC_IPV6_EXT_FRAG_RBUF_GC (0xfe00U)
39
46#define GNRC_IPV6_EXT_FRAG_CONTINUE (0xfe01U)
47
53#define GNRC_IPV6_EXT_FRAG_SEND (0xfe02U)
54
65
77
95
99typedef struct {
100 unsigned rbuf_full;
102 unsigned frag_full;
104 unsigned datagrams;
105 unsigned fragments;
107
113
123void gnrc_ipv6_ext_frag_send_pkt(gnrc_pktsnip_t *pkt, unsigned path_mtu);
124
133
145
166 uint32_t id);
167
175
186{
188 rbuf->pkt = NULL;
190}
191
209
210#ifdef __cplusplus
211}
212#endif
213
214#endif /* NET_GNRC_IPV6_EXT_FRAG_H */
Circular linked list.
void gnrc_ipv6_ext_frag_send(gnrc_ipv6_ext_frag_send_t *snd_buf)
(Continue to) fragment packet already in fragmentation send buffer
void gnrc_ipv6_ext_frag_init(void)
Initializes IPv6 fragmentation and reassembly.
gnrc_ipv6_ext_frag_stats_t * gnrc_ipv6_ext_frag_stats(void)
Get the current statistics on reassembly and fragmentation.
void gnrc_ipv6_ext_frag_send_pkt(gnrc_pktsnip_t *pkt, unsigned path_mtu)
Send an IPv6 packet fragmented.
void gnrc_ipv6_ext_frag_rbuf_free(gnrc_ipv6_ext_frag_rbuf_t *rbuf)
Frees a reassembly buffer entry (but does not release its gnrc_ipv6_ext_frag_rbuf_t::pkt)
static void gnrc_ipv6_ext_frag_rbuf_del(gnrc_ipv6_ext_frag_rbuf_t *rbuf)
Delete a reassembly buffer entry (and release its gnrc_ipv6_ext_frag_rbuf_t::pkt)
Definition frag.h:185
gnrc_pktsnip_t * gnrc_ipv6_ext_frag_reass(gnrc_pktsnip_t *pkt)
Reassemble fragmented IPv6 packet.
gnrc_ipv6_ext_frag_rbuf_t * gnrc_ipv6_ext_frag_rbuf_get(ipv6_hdr_t *ipv6, uint32_t id)
Get a reassembly buffer by the identifying parameters.
struct gnrc_ipv6_ext_frag_limits gnrc_ipv6_ext_frag_limits_t
Data type to describe limits of a single fragment in the reassembly buffer.
void gnrc_ipv6_ext_frag_rbuf_gc(void)
Garbage-collect reassembly buffer.
static void gnrc_pktbuf_release(gnrc_pktsnip_t *pkt)
Decreases gnrc_pktsnip_t::users of pkt atomically and removes it if it reaches 0 and reports GNRC_NET...
Definition pktbuf.h:196
General definitions for network packets and their helper functions.
IPv6 header type and helper function definitions.
Interface definition for the global network buffer.
Data type to describe limits of a single fragment in the reassembly buffer.
Definition frag.h:59
uint16_t end
the exclusive end (= offset + length) of the fragment
Definition frag.h:62
struct gnrc_ipv6_ext_frag_limits * next
limits of next fragment
Definition frag.h:60
uint16_t start
the start (= offset) of the fragment
Definition frag.h:61
A reassembly buffer entry.
Definition frag.h:81
gnrc_pktsnip_t * pkt
the (partly) reassembled packet
Definition frag.h:82
uint32_t id
the identification from the fragment headers
Definition frag.h:90
ipv6_hdr_t * ipv6
the IPv6 header of gnrc_ipv6_ext_frag_rbuf_t::pkt
Definition frag.h:83
clist_node_t limits
The limits of the fragments in the reassembled packet.
Definition frag.h:89
uint32_t arrival
arrival time of last received fragment
Definition frag.h:91
uint16_t pkt_len
length of gnrc_ipv6_ext_frag_rbuf_t::pkt
Definition frag.h:92
uint8_t last
received last fragment
Definition frag.h:93
Fragmentation send buffer type.
Definition frag.h:69
gnrc_pktsnip_t * pkt
the IPv6 packet to fragment
Definition frag.h:70
gnrc_pktsnip_t * per_frag
per fragment headers
Definition frag.h:71
uint16_t path_mtu
path MTU to destination of gnrc_ipv6_ext_frag_send_t::pkt
Definition frag.h:73
uint32_t id
the identification for the fragment header
Definition frag.h:72
uint16_t offset
current fragmentation offset
Definition frag.h:75
Statistics on reassembly and reassembly.
Definition frag.h:99
unsigned rbuf_full
counts the number of events where the reassembly buffer is full
Definition frag.h:100
unsigned fragments
total fragments of reassembled fragments
Definition frag.h:105
unsigned datagrams
reassembled datagrams
Definition frag.h:104
unsigned frag_full
counts the number of events that there where no gnrc_sixlowpan_frag_fb_t available
Definition frag.h:102
Type to represent parts (either headers or payload) of a packet, called snips.
Definition pkt.h:108
Data type to represent an IPv6 packet header.
Definition hdr.h:66
List node structure.
Definition list.h:40