tcb.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2015-2017 Simon Brummer
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
19 #include <stdint.h>
20 #include "ringbuffer.h"
21 #include "mutex.h"
22 #include "evtimer_msg.h"
23 #include "evtimer_mbox.h"
24 #include "msg.h"
25 #include "mbox.h"
26 #include "net/gnrc/pkt.h"
27 #include "config.h"
28 
29 #ifdef MODULE_GNRC_IPV6
30 #include "net/gnrc/ipv6.h"
31 #endif
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
40 typedef struct sock_tcp {
41  uint8_t address_family;
42 #ifdef MODULE_GNRC_IPV6
43  uint8_t local_addr[sizeof(ipv6_addr_t)];
44  uint8_t peer_addr[sizeof(ipv6_addr_t)];
45  int8_t ll_iface;
46 #endif
47  uint16_t local_port;
48  uint16_t peer_port;
49  uint8_t state;
50  uint8_t status;
51  uint32_t snd_una;
52  uint32_t snd_nxt;
53  uint16_t snd_wnd;
54  uint32_t snd_wl1;
55  uint32_t snd_wl2;
56  uint32_t rcv_nxt;
57  uint16_t rcv_wnd;
58  uint32_t iss;
59  uint32_t irs;
60  uint16_t mss;
61  uint32_t rtt_start;
62  int32_t rtt_var;
63  int32_t srtt;
64  int32_t rto;
65  uint8_t retries;
71  uint8_t *rcv_buf_raw;
75  struct sock_tcp *next;
77 
81 typedef struct sock_tcp_queue {
84  size_t tcbs_len;
86 
90 #define GNRC_TCP_TCB_QUEUE_INIT { MUTEX_INIT, NULL, 0 }
91 
92 #ifdef __cplusplus
93 }
94 #endif
Message box based evtimer event.
IPC-based evtimer definitions.
Definitions for GNRC's IPv6 implementation.
Mailbox API.
Mutex for thread synchronization.
General definitions for network packets and their helper functions.
A utility for storing and retrieving byte data using a ring buffer.
Message box event definition.
Definition: evtimer_mbox.h:30
IPC-message event.
Definition: evtimer_msg.h:37
Type to represent parts (either headers or payload) of a packet, called snips.
Definition: pkt.h:105
Mailbox struct definition.
Definition: mbox.h:37
Mutex structure.
Definition: mutex.h:36
Ringbuffer.
Definition: ringbuffer.h:32
TCP queue type.
Definition: sock_types.h:114
mutex_t lock
Mutex for access synchronization.
Definition: tcb.h:82
gnrc_tcp_tcb_t * tcbs
Pointer to TCB sequence.
Definition: tcb.h:83
size_t tcbs_len
Number of TCBs behind member tcbs.
Definition: tcb.h:84
TCP sock type.
Definition: sock_types.h:101
mutex_t fsm_lock
Mutex for FSM access synchronization.
Definition: tcb.h:73
uint8_t address_family
Address Family of local_addr / peer_addr.
Definition: tcb.h:41
uint16_t local_port
Local connections port number.
Definition: tcb.h:47
uint16_t snd_wnd
Send window.
Definition: tcb.h:53
uint8_t state
Connections state.
Definition: tcb.h:49
ringbuffer_t rcv_buf
Receive buffer data structure.
Definition: tcb.h:72
uint8_t peer_addr[sizeof(ipv6_addr_t)]
Peer IP address.
Definition: tcb.h:44
evtimer_mbox_event_t event_misc
General purpose event.
Definition: tcb.h:68
evtimer_msg_event_t event_timeout
Timeout event.
Definition: tcb.h:67
int32_t rto
Retransmission timeout duration.
Definition: tcb.h:64
evtimer_msg_event_t event_retransmit
Retransmission event.
Definition: tcb.h:66
uint32_t snd_una
Send unacknowledged.
Definition: tcb.h:51
uint32_t iss
Initial sequence sumber.
Definition: tcb.h:58
uint8_t status
A connections status flags.
Definition: tcb.h:50
uint16_t mss
The peers MSS.
Definition: tcb.h:60
uint16_t rcv_wnd
Receive window.
Definition: tcb.h:57
gnrc_pktsnip_t * pkt_retransmit
Pointer to packet in "retransmit queue".
Definition: tcb.h:69
mbox_t * mbox
TCB mbox for synchronization.
Definition: tcb.h:70
int32_t rtt_var
Round trip time variance.
Definition: tcb.h:62
uint32_t snd_wl2
AckNo.
Definition: tcb.h:55
uint32_t snd_nxt
Send next.
Definition: tcb.h:52
uint32_t rtt_start
Timer value for rtt estimation.
Definition: tcb.h:61
uint32_t snd_wl1
SeqNo.
Definition: tcb.h:54
int8_t ll_iface
Link layer interface id to use.
Definition: tcb.h:45
uint32_t irs
Initial received sequence number.
Definition: tcb.h:59
mutex_t function_lock
Mutex for function call synchronization.
Definition: tcb.h:74
struct sock_tcp * next
Pointer next TCB.
Definition: tcb.h:75
uint8_t local_addr[sizeof(ipv6_addr_t)]
Local IP address.
Definition: tcb.h:43
uint16_t peer_port
Peer connections port number.
Definition: tcb.h:48
int32_t srtt
Smoothed round trip time.
Definition: tcb.h:63
uint32_t rcv_nxt
Receive next.
Definition: tcb.h:56
uint8_t * rcv_buf_raw
Pointer to the receive buffer.
Definition: tcb.h:71
uint8_t retries
Number of retransmissions.
Definition: tcb.h:65
ztimer default configuration
struct sock_tcp_queue gnrc_tcp_tcb_queue_t
Transmission control block queue.
struct sock_tcp gnrc_tcp_tcb_t
Transmission control block of GNRC TCP.
Data type to represent an IPv6 address.
Definition: addr.h:64