The friendly Operating System for the Internet of Things
rbuf.h
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  */
8 
19 #ifndef GNRC_SIXLOWPAN_FRAG_RBUF_H
20 #define GNRC_SIXLOWPAN_FRAG_RBUF_H
21 
22 #include <inttypes.h>
23 
24 #include "net/gnrc/netif/hdr.h"
25 #include "net/gnrc/pkt.h"
26 
28 #ifdef __cplusplus
29 
30 extern "C" {
31 #endif
32 
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;
54 
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;
85 
100 void rbuf_add(gnrc_netif_hdr_t *netif_hdr, gnrc_pktsnip_t *frag,
101  size_t frag_size, size_t offset);
102 
103 #ifdef __cplusplus
104 }
105 #endif
106 
107 #endif /* GNRC_SIXLOWPAN_FRAG_RBUF_H */
108 
General definitions for network packets and their helper functions.
uint16_t cur_size
the datagram'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.
#define RBUF_L2ADDR_MAX_LEN
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'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