rcvbuf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2017 Simon Brummer
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 
22 #ifndef GNRC_TCP_INTERNAL_RCVBUF_H
23 #define GNRC_TCP_INTERNAL_RCVBUF_H
24 
25 #include <stdint.h>
26 #include "mutex.h"
27 #include "net/gnrc/tcp/config.h"
28 #include "net/gnrc/tcp/tcb.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
37 typedef struct rcvbuf_entry {
38  uint8_t used;
41 
45 typedef struct rcvbuf {
48 } rcvbuf_t;
49 
53 void _rcvbuf_init(void);
54 
64 
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif /* GNRC_TCP_INTERNAL_RCVBUF_H */
77 
#define GNRC_TCP_RCV_BUF_SIZE
Default receive buffer size.
Definition: config.h:81
GNRC TCP transmission control block (TCB)
int _rcvbuf_get_buffer(gnrc_tcp_tcb_t *tcb)
Allocate receive buffer and assign it to TCB.
void _rcvbuf_release_buffer(gnrc_tcp_tcb_t *tcb)
Release allocated receive buffer.
GNRC TCP configuration.
Receive buffer entry.
Definition: rcvbuf.h:37
Transmission control block of GNRC TCP.
Definition: tcb.h:50
void _rcvbuf_init(void)
Initializes global receive buffer.
struct rcvbuf rcvbuf_t
Stuct holding receive buffers.
mutex_t lock
Lock for allocation synchronization.
Definition: rcvbuf.h:46
struct rcvbuf_entry rcvbuf_entry_t
Receive buffer entry.
RIOT synchronization API.
rcvbuf_entry_t entries[GNRC_TCP_RCV_BUFFERS]
Maintained receive buffers.
Definition: rcvbuf.h:47
uint8_t buffer[GNRC_TCP_RCV_BUF_SIZE]
Receive buffer storage.
Definition: rcvbuf.h:39
uint8_t used
Flag: Is buffer in use?
Definition: rcvbuf.h:38
Mutex structure.
Definition: mutex.h:36
Stuct holding receive buffers.
Definition: rcvbuf.h:45
#define GNRC_TCP_RCV_BUFFERS
Number of preallocated receive buffers.
Definition: config.h:74