Loading...
Searching...
No Matches
gnrc_tcp_fsm.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
18
19#include <stdint.h>
20#include "mbox.h"
21#include "net/gnrc.h"
22#include "net/gnrc/tcp/tcb.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
31typedef enum {
32 FSM_STATE_CLOSED = 0,
33 FSM_STATE_LISTEN,
34 FSM_STATE_SYN_SENT,
35 FSM_STATE_SYN_RCVD,
36 FSM_STATE_ESTABLISHED,
37 FSM_STATE_CLOSE_WAIT,
38 FSM_STATE_LAST_ACK,
39 FSM_STATE_FIN_WAIT_1,
40 FSM_STATE_FIN_WAIT_2,
41 FSM_STATE_CLOSING,
42 FSM_STATE_TIME_WAIT
44
48typedef enum {
49 FSM_EVENT_CALL_OPEN, /* User function call: open */
50 FSM_EVENT_CALL_SEND, /* User function call: send */
51 FSM_EVENT_CALL_RECV, /* User function call: recv */
52 FSM_EVENT_CALL_CLOSE, /* User function call: close */
53 FSM_EVENT_CALL_ABORT, /* User function call: abort */
54 FSM_EVENT_RCVD_PKT, /* Packet received from peer */
55 FSM_EVENT_TIMEOUT_TIMEWAIT, /* Timeout: timewait */
56 FSM_EVENT_TIMEOUT_RETRANSMIT, /* Timeout: retransmit */
57 FSM_EVENT_TIMEOUT_CONNECTION, /* Timeout: connection */
58 FSM_EVENT_SEND_PROBE, /* Send zero window probe */
59 FSM_EVENT_CLEAR_RETRANSMIT /* Clear retransmission mechanism */
61
76 gnrc_pktsnip_t *in_pkt, void *buf, size_t len);
77
86
95
96#ifdef __cplusplus
97}
98#endif
99
Includes all essential GNRC network stack base modules.
_gnrc_tcp_fsm_state_t _gnrc_tcp_fsm_get_state(gnrc_tcp_tcb_t *tcb)
Get latest FSM state from given TCB.
void _gnrc_tcp_fsm_set_mbox(gnrc_tcp_tcb_t *tcb, mbox_t *mbox)
Associate mbox with tcb.
int _gnrc_tcp_fsm(gnrc_tcp_tcb_t *tcb, _gnrc_tcp_fsm_event_t event, gnrc_pktsnip_t *in_pkt, void *buf, size_t len)
TCP finite state machine.
_gnrc_tcp_fsm_event_t
Events that trigger transitions in TCP FSM.
_gnrc_tcp_fsm_state_t
The TCP FSM states.
struct gnrc_pktsnip gnrc_pktsnip_t
Type to represent parts (either headers or payload) of a packet, called snips.
Mailbox API.
event structure
Definition event.h:142
Mailbox struct definition.
Definition mbox.h:38
GNRC TCP transmission control block (TCB)
struct sock_tcp gnrc_tcp_tcb_t
Transmission control block of GNRC TCP.