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
29 extern "C" {
30 #endif
31 
35 typedef 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 
52 typedef 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 
91 #ifdef __cplusplus
92 }
93 #endif
94 
95 #endif /* GNRC_TCP_FSM_H */
96 
gnrc.h
Includes all essential GNRC network stack base modules.
_gnrc_tcp_fsm
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.
event
event structure
Definition: event.h:142
_gnrc_tcp_fsm_set_mbox
void _gnrc_tcp_fsm_set_mbox(gnrc_tcp_tcb_t *tcb, mbox_t *mbox)
Associate mbox with tcb.
_transmission_control_block
Transmission control block of GNRC TCP.
Definition: tcb.h:45
mbox_t
Mailbox struct definition.
Definition: mbox.h:41
mbox.h
Mailbox API.
_gnrc_tcp_fsm_event_t
_gnrc_tcp_fsm_event_t
Events that trigger transitions in TCP FSM.
Definition: gnrc_tcp_fsm.h:52
tcb.h
GNRC TCP transmission control block (TCB)
_gnrc_tcp_fsm_state_t
_gnrc_tcp_fsm_state_t
The TCP FSM states.
Definition: gnrc_tcp_fsm.h:35
gnrc_pktsnip
Type to represent parts (either headers or payload) of a packet, called snips.
Definition: pkt.h:108