Loading...
Searching...
No Matches
gnrc_tcp_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 gnrc_tcp_fsm.h.

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

Go to the source code of this file.

enum  _gnrc_tcp_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. More...
 
enum  _gnrc_tcp_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. More...
 
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.
 
void _gnrc_tcp_fsm_set_mbox (gnrc_tcp_tcb_t *tcb, mbox_t *mbox)
 Associate mbox with tcb.
 
_gnrc_tcp_fsm_state_t _gnrc_tcp_fsm_get_state (gnrc_tcp_tcb_t *tcb)
 Get latest FSM state from given TCB.
 

Enumeration Type Documentation

◆ _gnrc_tcp_fsm_event_t

Events that trigger transitions in TCP FSM.

Definition at line 52 of file gnrc_tcp_fsm.h.

◆ _gnrc_tcp_fsm_state_t

The TCP FSM states.

Definition at line 35 of file gnrc_tcp_fsm.h.

Function Documentation

◆ _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.

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

◆ _gnrc_tcp_fsm_get_state()

_gnrc_tcp_fsm_state_t _gnrc_tcp_fsm_get_state ( gnrc_tcp_tcb_t tcb)

Get latest FSM state from given TCB.

Parameters
[in]tcbTCB to get state from.
Returns
Current TCB state.

◆ _gnrc_tcp_fsm_set_mbox()

void _gnrc_tcp_fsm_set_mbox ( gnrc_tcp_tcb_t tcb,
mbox_t mbox 
)

Associate mbox with tcb.

Messages sent from the FSM will be stored in the mbox.

Parameters
[in,out]tcbTCB to set message box on.
[in]mboxMessage box used to store messages from the FSM. If mbox is NULL, no messages will be stored.