Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
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  */
19 #ifndef RBUF_H
20 #define RBUF_H
22 #include <inttypes.h>
24 #include "net/gnrc/netif/hdr.h"
25 #include "net/gnrc/pkt.h"
28 #ifdef __cplusplus
30 extern "C" {
31 #endif
33 #define RBUF_L2ADDR_MAX_LEN (8U)
34 #define RBUF_SIZE (4U)
35 #define RBUF_TIMEOUT (3U * US_PER_SEC)
49 typedef struct rbuf_int {
50  struct rbuf_int *next;
51  uint16_t start;
52  uint16_t end;
53 } rbuf_int_t;
73 typedef struct {
76  uint32_t arrival;
78  uint8_t src[RBUF_L2ADDR_MAX_LEN];
79  uint8_t dst[RBUF_L2ADDR_MAX_LEN];
80  uint8_t src_len;
81  uint8_t dst_len;
82  uint16_t tag;
83  uint16_t cur_size;
84 } rbuf_t;
100 void rbuf_add(gnrc_netif_hdr_t *netif_hdr, gnrc_pktsnip_t *frag,
101  size_t frag_size, size_t offset);
103 #ifdef __cplusplus
104 }
105 #endif
107 #endif /* RBUF_H */
General definitions for network packets and their helper functions.
uint16_t cur_size
the datagram&#39;s current size
Definition: rbuf.h:83
An entry in the 6LoWPAN reassembly buffer.
Definition: rbuf.h:73
gnrc_pktsnip_t * pkt
the reassembled packet in packet buffer
Definition: rbuf.h:75
Generic network interface header.
maximum length for link-layer addresses
Definition: rbuf.h:33
Fragment intervals to identify limits of fragments.
Definition: rbuf.h:49
rbuf_int_t * ints
intervals of the fragment
Definition: rbuf.h:74
uint16_t start
start byte of interval
Definition: rbuf.h:51
Adds include for missing inttype definitions.
uint16_t tag
the datagram&#39;s tag
Definition: rbuf.h:82
uint8_t dst_len
length of destination address
Definition: rbuf.h:81
6LoWPAN Fragmentation definitions
uint8_t src_len
length of source address
Definition: rbuf.h:80
Type to represent parts (either headers or payload) of a packet, called snips.
void rbuf_add(gnrc_netif_hdr_t *netif_hdr, gnrc_pktsnip_t *frag, size_t frag_size, size_t offset)
Adds a new fragment to the reassembly buffer.
struct rbuf_int rbuf_int_t
Fragment intervals to identify limits of fragments.
struct rbuf_int * next
next element in interval list
Definition: rbuf.h:50
uint32_t arrival
time in microseconds of arrival of last received fragment
Definition: rbuf.h:76
Generic network interface header.
uint16_t end
end byte of interval
Definition: rbuf.h:52