OpenWSN Firmware
OpenTcp

TCP implementation. More...

Data Structures

struct  tcp_ht
 
struct  tcp_vars_t
 

Enumerations

enum  { TCP_INITIAL_SEQNUM = 100, TCP_TIMEOUT = 1500 }
 
enum  TCP_STATE_enums {
  TCP_STATE_CLOSED = 0, TCP_STATE_ALMOST_SYN_RECEIVED = 1, TCP_STATE_SYN_RECEIVED = 2, TCP_STATE_ALMOST_SYN_SENT = 3,
  TCP_STATE_SYN_SENT = 4, TCP_STATE_ALMOST_ESTABLISHED = 5, TCP_STATE_ESTABLISHED = 6, TCP_STATE_ALMOST_DATA_SENT = 7,
  TCP_STATE_DATA_SENT = 8, TCP_STATE_ALMOST_DATA_RECEIVED = 9, TCP_STATE_ALMOST_FIN_WAIT_1 = 10, TCP_STATE_FIN_WAIT_1 = 11,
  TCP_STATE_ALMOST_CLOSING = 12, TCP_STATE_CLOSING = 13, TCP_STATE_FIN_WAIT_2 = 14, TCP_STATE_ALMOST_TIME_WAIT = 15,
  TCP_STATE_TIME_WAIT = 16, TCP_STATE_ALMOST_CLOSE_WAIT = 17, TCP_STATE_CLOSE_WAIT = 18, TCP_STATE_ALMOST_LAST_ACK = 19,
  TCP_STATE_LAST_ACK = 20
}
 
enum  TCP_DEFAULTS_enum { TCP_DEFAULT_DATA_OFFSET = 0x50, TCP_DEFAULT_WINDOW_SIZE = 48, TCP_DEFAULT_URGENT_POINTER = 0x0000 }
 
enum  TCP_ACK_FLAG_enum { TCP_ACK_WHATEVER = 2, TCP_ACK_YES = 1, TCP_ACK_NO = 0 }
 
enum  TCP_PSH_FLAG_enum { TCP_PSH_WHATEVER = 2, TCP_PSH_YES = 1, TCP_PSH_NO = 0 }
 
enum  TCP_RST_FLAG_enum { TCP_RST_WHATEVER = 2, TCP_RST_YES = 1, TCP_RST_NO = 0 }
 
enum  TCP_SYN_FLAG_enum { TCP_SYN_WHATEVER = 2, TCP_SYN_YES = 1, TCP_SYN_NO = 0 }
 
enum  TCP_FIN_FLAG_enum { TCP_FIN_WHATEVER = 2, TCP_FIN_YES = 1, TCP_FIN_NO = 0 }
 
enum  TCP_FLAG_POSITIONS_enum {
  TCP_ACK = 4, TCP_PSH = 3, TCP_RST = 2, TCP_SYN = 1,
  TCP_FIN = 0
}
 

Functions

void opentcp_init (void)
 
owerror_t opentcp_connect (open_addr_t *dest, uint16_t param_hisPort, uint16_t param_myPort)
 
owerror_t opentcp_send (OpenQueueEntry_t *msg)
 
void opentcp_sendDone (OpenQueueEntry_t *msg, owerror_t error)
 
void opentcp_receive (OpenQueueEntry_t *msg)
 
owerror_t opentcp_close (void)
 
bool opentcp_debugPrint (void)
 

Detailed Description

TCP implementation.

This implementation follows http://tools.ietf.org/html/rfc793.

See http://openwsn.berkeley.edu/wiki/OpenTcp for state machine and documentation.

Author
Thomas Watteyne watte.nosp@m.yne@.nosp@m.eecs..nosp@m.berk.nosp@m.eley..nosp@m.edu, August 2010

Enumeration Type Documentation

anonymous enum
Enumerator
TCP_INITIAL_SEQNUM 
TCP_TIMEOUT 
Enumerator
TCP_ACK_WHATEVER 
TCP_ACK_YES 
TCP_ACK_NO 
Enumerator
TCP_DEFAULT_DATA_OFFSET 
TCP_DEFAULT_WINDOW_SIZE 
TCP_DEFAULT_URGENT_POINTER 
Enumerator
TCP_FIN_WHATEVER 
TCP_FIN_YES 
TCP_FIN_NO 
Enumerator
TCP_ACK 
TCP_PSH 
TCP_RST 
TCP_SYN 
TCP_FIN 
Enumerator
TCP_PSH_WHATEVER 
TCP_PSH_YES 
TCP_PSH_NO 
Enumerator
TCP_RST_WHATEVER 
TCP_RST_YES 
TCP_RST_NO 
Enumerator
TCP_STATE_CLOSED 
TCP_STATE_ALMOST_SYN_RECEIVED 
TCP_STATE_SYN_RECEIVED 
TCP_STATE_ALMOST_SYN_SENT 
TCP_STATE_SYN_SENT 
TCP_STATE_ALMOST_ESTABLISHED 
TCP_STATE_ESTABLISHED 
TCP_STATE_ALMOST_DATA_SENT 
TCP_STATE_DATA_SENT 
TCP_STATE_ALMOST_DATA_RECEIVED 
TCP_STATE_ALMOST_FIN_WAIT_1 
TCP_STATE_FIN_WAIT_1 
TCP_STATE_ALMOST_CLOSING 
TCP_STATE_CLOSING 
TCP_STATE_FIN_WAIT_2 
TCP_STATE_ALMOST_TIME_WAIT 
TCP_STATE_TIME_WAIT 
TCP_STATE_ALMOST_CLOSE_WAIT 
TCP_STATE_CLOSE_WAIT 
TCP_STATE_ALMOST_LAST_ACK 
TCP_STATE_LAST_ACK 
Enumerator
TCP_SYN_WHATEVER 
TCP_SYN_YES 
TCP_SYN_NO 

Function Documentation

owerror_t opentcp_close ( void  )
owerror_t opentcp_connect ( open_addr_t dest,
uint16_t  param_hisPort,
uint16_t  param_myPort 
)
bool opentcp_debugPrint ( void  )
void opentcp_init ( void  )
void opentcp_receive ( OpenQueueEntry_t msg)
owerror_t opentcp_send ( OpenQueueEntry_t msg)
void opentcp_sendDone ( OpenQueueEntry_t msg,
owerror_t  error 
)