fsm.h File Reference

TCP finite state maschine declarations. More...

Detailed Description

TCP finite state maschine declarations.

Author
Simon Brummer simon.nosp@m..bru.nosp@m.mmer@.nosp@m.post.nosp@m.eo.de

Definition in file fsm.h.

#include <stdint.h>
#include "net/gnrc.h"
#include "net/gnrc/tcp/tcb.h"
+ Include dependency graph for fsm.h:

Go to the source code of this file.

enum  fsm_state_t {
  FSM_STATE_CLOSED = 0, FSM_STATE_LISTEN, FSM_STATE_SYN_SENT, FSM_STATE_SYN_RCVD,
  FSM_STATE_ESTABLISHED, FSM_STATE_CLOSE_WAIT, FSM_STATE_LAST_ACK, FSM_STATE_FIN_WAIT_1,
  FSM_STATE_FIN_WAIT_2, FSM_STATE_CLOSING, FSM_STATE_TIME_WAIT
}
 The TCP FSM states.
 
enum  fsm_event_t {
  FSM_EVENT_CALL_OPEN, FSM_EVENT_CALL_SEND, FSM_EVENT_CALL_RECV, FSM_EVENT_CALL_CLOSE,
  FSM_EVENT_CALL_ABORT, FSM_EVENT_RCVD_PKT, FSM_EVENT_TIMEOUT_TIMEWAIT, FSM_EVENT_TIMEOUT_RETRANSMIT,
  FSM_EVENT_TIMEOUT_CONNECTION, FSM_EVENT_SEND_PROBE, FSM_EVENT_CLEAR_RETRANSMIT
}
 Events that trigger transitions in TCP FSM.
 
int _fsm (gnrc_tcp_tcb_t *tcb, fsm_event_t event, gnrc_pktsnip_t *in_pkt, void *buf, size_t len)
 TCP finite state maschine. More...
 

Function Documentation

◆ _fsm()

int _fsm ( gnrc_tcp_tcb_t tcb,
fsm_event_t  event,
gnrc_pktsnip_t in_pkt,
void *  buf,
size_t  len 
)

TCP finite state maschine.

Parameters
[in,out]tcbTCB holding the connection information.
[in]eventCurrent event that triggers FSM transition.
[in]in_pktIncoming packet. Only not NULL in case of event RCVD_PKT.
[in,out]bufBuffer for send and receive functions.
[in]lenNumber of bytes to send or receive.
Returns
Zero on success Positive Number, number of bytes sent from or copied into buf. -ENOSYS if event is not implemented