NET: Rename some non-configurable constants UIP_ to IP_ or TCP_
This commit is contained in:
parent
b77fda2c95
commit
a251259f90
|
@ -105,7 +105,7 @@
|
|||
* This should normally not be changed.
|
||||
*/
|
||||
|
||||
#define UIP_TTL 64
|
||||
#define IP_TTL 64
|
||||
|
||||
#ifdef CONFIG_NET_TCP_REASSEMBLY
|
||||
# ifndef CONFIG_NET_TCP_REASS_MAXAGE
|
||||
|
@ -160,7 +160,7 @@
|
|||
*
|
||||
* Since the TCP connections are statically allocated, turning this
|
||||
* configuration knob down results in less RAM used. Each TCP
|
||||
* connection requires approximatly 30 bytes of memory.
|
||||
* connection requires approximately 30 bytes of memory.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_NET_TCP_CONNS
|
||||
|
@ -194,7 +194,7 @@
|
|||
* This should not be changed.
|
||||
*/
|
||||
|
||||
#define UIP_RTO 3
|
||||
#define TCP_RTO 3
|
||||
|
||||
/* The maximum number of times a segment should be retransmitted
|
||||
* before the connection should be aborted.
|
||||
|
@ -202,7 +202,7 @@
|
|||
* This should not be changed.
|
||||
*/
|
||||
|
||||
#define UIP_MAXRTX 8
|
||||
#define TCP_MAXRTX 8
|
||||
|
||||
/* The maximum number of times a SYN segment should be retransmitted
|
||||
* before a connection request should be deemed to have been
|
||||
|
@ -211,7 +211,7 @@
|
|||
* This should not need to be changed.
|
||||
*/
|
||||
|
||||
#define UIP_MAXSYNRTX 5
|
||||
#define TCP_MAXSYNRTX 5
|
||||
|
||||
/* The TCP maximum segment size. This is should not be set to more
|
||||
* than CONFIG_NET_BUFSIZE - NET_LL_HDRLEN - IPTCP_HDRLEN.
|
||||
|
|
|
@ -122,7 +122,7 @@ void icmp_send(FAR struct net_driver_s *dev, FAR net_ipaddr_t *destaddr)
|
|||
picmp->len[0] = (dev->d_sndlen >> 8);
|
||||
picmp->len[1] = (dev->d_sndlen & 0xff);
|
||||
picmp->nexthdr = IP_PROTO_ICMP;
|
||||
picmp->hoplimit = UIP_TTL;
|
||||
picmp->hoplimit = IP_TTL;
|
||||
|
||||
net_ipaddr_copy(picmp->srcipaddr, &dev->d_ipaddr);
|
||||
net_ipaddr_copy(picmp->destipaddr, destaddr);
|
||||
|
@ -138,7 +138,7 @@ void icmp_send(FAR struct net_driver_s *dev, FAR net_ipaddr_t *destaddr)
|
|||
picmp->ipid[1] = g_ipid & 0xff;
|
||||
picmp->ipoffset[0] = TCPFLAG_DONTFRAG >> 8;
|
||||
picmp->ipoffset[1] = TCPFLAG_DONTFRAG & 0xff;
|
||||
picmp->ttl = UIP_TTL;
|
||||
picmp->ttl = IP_TTL;
|
||||
picmp->proto = IP_PROTO_ICMP;
|
||||
|
||||
net_ipaddr_hdrcopy(picmp->srcipaddr, &dev->d_ipaddr);
|
||||
|
|
|
@ -515,8 +515,8 @@ FAR struct tcp_conn_s *tcp_alloc_accept(FAR struct tcp_iphdr_s *buf)
|
|||
{
|
||||
/* Fill in the necessary fields for the new connection. */
|
||||
|
||||
conn->rto = UIP_RTO;
|
||||
conn->timer = UIP_RTO;
|
||||
conn->rto = TCP_RTO;
|
||||
conn->timer = TCP_RTO;
|
||||
conn->sa = 0;
|
||||
conn->sv = 4;
|
||||
conn->nrtx = 0;
|
||||
|
@ -679,7 +679,7 @@ int tcp_connect(FAR struct tcp_conn_s *conn,
|
|||
conn->unacked = 1; /* TCP length of the SYN is one. */
|
||||
conn->nrtx = 0;
|
||||
conn->timer = 1; /* Send the SYN next time around. */
|
||||
conn->rto = UIP_RTO;
|
||||
conn->rto = TCP_RTO;
|
||||
conn->sa = 0;
|
||||
conn->sv = 16; /* Initial value of the RTT variance. */
|
||||
conn->lport = htons((uint16_t)port);
|
||||
|
|
|
@ -98,7 +98,7 @@ static void tcp_sendcomplete(FAR struct net_driver_s *dev)
|
|||
{
|
||||
FAR struct tcp_iphdr_s *pbuf = BUF;
|
||||
|
||||
pbuf->ttl = UIP_TTL;
|
||||
pbuf->ttl = IP_TTL;
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
|
||||
|
|
|
@ -408,7 +408,7 @@ static uint16_t psock_send_interrupt(FAR struct net_driver_s *dev,
|
|||
|
||||
/* Increment the retransmit count on this write buffer. */
|
||||
|
||||
if (++WRB_NRTX(wrb) >= UIP_MAXRTX)
|
||||
if (++WRB_NRTX(wrb) >= TCP_MAXRTX)
|
||||
{
|
||||
nlldbg("Expiring wrb=%p nrtx=%u\n", wrb, WRB_NRTX(wrb));
|
||||
|
||||
|
@ -473,7 +473,7 @@ static uint16_t psock_send_interrupt(FAR struct net_driver_s *dev,
|
|||
|
||||
/* Free any write buffers that have exceed the retry count */
|
||||
|
||||
if (++WRB_NRTX(wrb) >= UIP_MAXRTX)
|
||||
if (++WRB_NRTX(wrb) >= TCP_MAXRTX)
|
||||
{
|
||||
nlldbg("Expiring wrb=%p nrtx=%u\n", wrb, WRB_NRTX(wrb));
|
||||
|
||||
|
|
|
@ -164,11 +164,11 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
|
|||
#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
|
||||
conn->expired > 0 ||
|
||||
#else
|
||||
conn->nrtx == UIP_MAXRTX ||
|
||||
conn->nrtx == TCP_MAXRTX ||
|
||||
#endif
|
||||
((conn->tcpstateflags == TCP_SYN_SENT ||
|
||||
conn->tcpstateflags == TCP_SYN_RCVD) &&
|
||||
conn->nrtx == UIP_MAXSYNRTX)
|
||||
conn->nrtx == TCP_MAXSYNRTX)
|
||||
)
|
||||
{
|
||||
conn->tcpstateflags = TCP_CLOSED;
|
||||
|
@ -189,7 +189,7 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
|
|||
|
||||
/* Exponential backoff. */
|
||||
|
||||
conn->timer = UIP_RTO << (conn->nrtx > 4 ? 4: conn->nrtx);
|
||||
conn->timer = TCP_RTO << (conn->nrtx > 4 ? 4: conn->nrtx);
|
||||
(conn->nrtx)++;
|
||||
|
||||
/* Ok, so we need to retransmit. We do this differently
|
||||
|
|
|
@ -467,7 +467,7 @@ int udp_connect(FAR struct udp_conn_s *conn,
|
|||
net_ipaddr_copy(conn->ripaddr, g_allzeroaddr);
|
||||
}
|
||||
|
||||
conn->ttl = UIP_TTL;
|
||||
conn->ttl = IP_TTL;
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue