20#ifndef GNRC_TCP_COMMON_H
21#define GNRC_TCP_COMMON_H
39#define PORT_UNSPEC (0)
45#define STATUS_LISTENING (1 << 0)
46#define STATUS_ALLOW_ANY_ADDR (1 << 1)
47#define STATUS_NOTIFY_USER (1 << 2)
48#define STATUS_ACCEPTED (1 << 3)
49#define STATUS_LOCKED (1 << 4)
56#define TCP_EVENTLOOP_PRIO (THREAD_PRIORITY_MAIN - 2U)
57#define TCP_EVENTLOOP_STACK_SIZE (THREAD_STACKSIZE_DEFAULT)
64#define MSK_FIN (0x0001)
65#define MSK_SYN (0x0002)
66#define MSK_RST (0x0004)
67#define MSK_PSH (0x0008)
68#define MSK_ACK (0x0010)
69#define MSK_URG (0x0020)
70#define MSK_FIN_ACK (0x0011)
71#define MSK_SYN_ACK (0x0012)
72#define MSK_RST_ACK (0x0014)
73#define MSK_SYN_FIN_ACK (0x0013)
74#define MSK_FIN_ACK_PSH (0x0019)
75#define MSK_CTL (0x003F)
76#define MSK_OFFSET (0xF000)
83#define MSG_TYPE_CONNECTION_TIMEOUT (GNRC_NETAPI_MSG_TYPE_ACK + 101)
84#define MSG_TYPE_PROBE_TIMEOUT (GNRC_NETAPI_MSG_TYPE_ACK + 102)
85#define MSG_TYPE_USER_SPEC_TIMEOUT (GNRC_NETAPI_MSG_TYPE_ACK + 103)
86#define MSG_TYPE_RETRANSMISSION (GNRC_NETAPI_MSG_TYPE_ACK + 104)
87#define MSG_TYPE_TIMEWAIT (GNRC_NETAPI_MSG_TYPE_ACK + 105)
88#define MSG_TYPE_NOTIFY_USER (GNRC_NETAPI_MSG_TYPE_ACK + 106)
94#define RTO_UNINITIALIZED (-1)
101#define LSS_32_BIT(x, y) (((int32_t) (x)) - ((int32_t) (y)) < 0)
102#define LEQ_32_BIT(x, y) (((int32_t) (x)) - ((int32_t) (y)) <= 0)
103#define GRT_32_BIT(x, y) (!LEQ_32_BIT(x, y))
104#define GEQ_32_BIT(x, y) (!LSS_32_BOT(x, y))
110#define INSIDE_WND(l_ed, seq_num, r_ed) (LEQ_32_BIT(l_ed, seq_num) && LSS_32_BIT(seq_num, r_ed))
115#define GET_OFFSET( x ) (((x) & MSK_OFFSET) >> 12)
122#define TCP_DEBUG_ENTER DEBUG("GNRC_TCP: Enter \"%s\", File: %s(%d)\n", \
123 DEBUG_FUNC, __FILE__, __LINE__)
130#define TCP_DEBUG_LEAVE DEBUG("GNRC_TCP: Leave \"%s\", File: %s(%d)\n", \
131 DEBUG_FUNC, __FILE__, __LINE__)
138#define TCP_DEBUG_ERROR(msg) DEBUG("GNRC_TCP: Error: \"%s\", Func: %s, File: %s(%d)\n", \
139 msg, DEBUG_FUNC, __FILE__, __LINE__)
146#define TCP_DEBUG_INFO(msg) DEBUG("GNRC_TCP: Info: \"%s\", Func: %s, File: %s(%d)\n", \
147 msg, DEBUG_FUNC, __FILE__, __LINE__)
_gnrc_tcp_common_tcb_list_t * _gnrc_tcp_common_get_tcb_list(void)
Function to access to TCB list.
Mutex for thread synchronization.
Generic interface to communicate with GNRC modules.
mutex_t lock
Lock of TCB list.
gnrc_tcp_tcb_t * head
Head of TCB list.
GNRC TCP transmission control block (TCB)