mirror of
https://github.com/apache/nuttx.git
synced 2025-12-19 10:54:48 +08:00
This commit adds an initial implemented of TCP delayed ACKs as specified in RFC 1122.
Squashed commit of the following:
net/tmp: Rename the unacked field of the tcp connection structure to tx_unacked. Too confusing with the implementation of delayed RX ACKs.
net/tcp: Initial implementation of TCP delayed ACKs.
net/tcp: Add delayed ACK configuration selection. Rename tcp_ack() to tcp_synack(). It may or may not send a ACK. It will always send SYN or SYN/ACK.
This commit is contained in:
@@ -175,15 +175,19 @@ struct tcp_conn_s
|
||||
uint8_t timer; /* The retransmission timer (units: half-seconds) */
|
||||
uint8_t nrtx; /* The number of retransmissions for the last
|
||||
* segment sent */
|
||||
#ifdef CONFIG_NET_TCP_DELAYED_ACK
|
||||
uint8_t rx_unackseg; /* Number of un-ACKed received segments */
|
||||
uint8_t rx_acktimer; /* Time since last ACK sent (units: half-seconds) */
|
||||
#endif
|
||||
uint16_t lport; /* The local TCP port, in network byte order */
|
||||
uint16_t rport; /* The remoteTCP port, in network byte order */
|
||||
uint16_t mss; /* Current maximum segment size for the
|
||||
* connection */
|
||||
uint16_t winsize; /* Current window size of the connection */
|
||||
#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
|
||||
uint32_t unacked; /* Number bytes sent but not yet ACKed */
|
||||
uint32_t tx_unacked; /* Number bytes sent but not yet ACKed */
|
||||
#else
|
||||
uint16_t unacked; /* Number bytes sent but not yet ACKed */
|
||||
uint16_t tx_unacked; /* Number bytes sent but not yet ACKed */
|
||||
#endif
|
||||
|
||||
/* If the TCP socket is bound to a local address, then this is
|
||||
@@ -941,7 +945,7 @@ ssize_t tcp_sendfile(FAR struct socket *psock, FAR struct file *infile,
|
||||
void tcp_reset(FAR struct net_driver_s *dev);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: tcp_ack
|
||||
* Name: tcp_synack
|
||||
*
|
||||
* Description:
|
||||
* Send the SYN or SYNACK response.
|
||||
@@ -959,8 +963,8 @@ void tcp_reset(FAR struct net_driver_s *dev);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void tcp_ack(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
|
||||
uint8_t ack);
|
||||
void tcp_synack(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
|
||||
uint8_t ack);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: tcp_appsend
|
||||
|
||||
Reference in New Issue
Block a user