Loading...
Searching...
No Matches
gnrc_tcp_fsm.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
20#ifndef GNRC_TCP_FSM_H
21#define GNRC_TCP_FSM_H
22
23#include <stdint.h>
24#include "mbox.h"
25#include "net/gnrc.h"
26#include "net/gnrc/tcp/tcb.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
35typedef enum {
36 FSM_STATE_CLOSED = 0,
37 FSM_STATE_LISTEN,
38 FSM_STATE_SYN_SENT,
39 FSM_STATE_SYN_RCVD,
40 FSM_STATE_ESTABLISHED,
41 FSM_STATE_CLOSE_WAIT,
42 FSM_STATE_LAST_ACK,
43 FSM_STATE_FIN_WAIT_1,
44 FSM_STATE_FIN_WAIT_2,
45 FSM_STATE_CLOSING,
46 FSM_STATE_TIME_WAIT
48
52typedef enum {
53 FSM_EVENT_CALL_OPEN, /* User function call: open */
54 FSM_EVENT_CALL_SEND, /* User function call: send */
55 FSM_EVENT_CALL_RECV, /* User function call: recv */
56 FSM_EVENT_CALL_CLOSE, /* User function call: close */
57 FSM_EVENT_CALL_ABORT, /* User function call: abort */
58 FSM_EVENT_RCVD_PKT, /* Packet received from peer */
59 FSM_EVENT_TIMEOUT_TIMEWAIT, /* Timeout: timewait */
60 FSM_EVENT_TIMEOUT_RETRANSMIT, /* Timeout: retransmit */
61 FSM_EVENT_TIMEOUT_CONNECTION, /* Timeout: connection */
62 FSM_EVENT_SEND_PROBE, /* Send zero window probe */
63 FSM_EVENT_CLEAR_RETRANSMIT /* Clear retransmission mechanism */
65
80 gnrc_pktsnip_t *in_pkt, void *buf, size_t len);
81
90
99
100#ifdef __cplusplus
101}
102#endif
103
104#endif /* GNRC_TCP_FSM_H */
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 maschine.
_gnrc_tcp_fsm_event_t
Events that trigger transitions in TCP FSM.
_gnrc_tcp_fsm_state_t
The TCP FSM states.
Mailbox API.
event structure
Definition event.h:148
Type to represent parts (either headers or payload) of a packet, called snips.
Definition pkt.h:108
Mailbox struct definition.
Definition mbox.h:41
TCP sock type.
Definition sock_types.h:101
GNRC TCP transmission control block (TCB)