From 13df5a4fc813c0744f78d40fed3c1e36485fe5a6 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 6 Jul 2014 16:19:26 -0600 Subject: NET: Rename some non-configurable constants UIP_ to IP_ or TCP_ --- nuttx/include/nuttx/net/netconfig.h | 10 +++++----- nuttx/net/icmp/icmp_send.c | 4 ++-- nuttx/net/tcp/tcp_conn.c | 6 +++--- nuttx/net/tcp/tcp_send.c | 2 +- nuttx/net/tcp/tcp_send_buffered.c | 4 ++-- nuttx/net/tcp/tcp_timer.c | 6 +++--- nuttx/net/udp/udp_conn.c | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) (limited to 'nuttx') diff --git a/nuttx/include/nuttx/net/netconfig.h b/nuttx/include/nuttx/net/netconfig.h index 4f976f47a..d34574429 100644 --- a/nuttx/include/nuttx/net/netconfig.h +++ b/nuttx/include/nuttx/net/netconfig.h @@ -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. diff --git a/nuttx/net/icmp/icmp_send.c b/nuttx/net/icmp/icmp_send.c index 77135adcb..18de2c01a 100644 --- a/nuttx/net/icmp/icmp_send.c +++ b/nuttx/net/icmp/icmp_send.c @@ -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); diff --git a/nuttx/net/tcp/tcp_conn.c b/nuttx/net/tcp/tcp_conn.c index 2cfeb7e3d..a505cc221 100644 --- a/nuttx/net/tcp/tcp_conn.c +++ b/nuttx/net/tcp/tcp_conn.c @@ -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); diff --git a/nuttx/net/tcp/tcp_send.c b/nuttx/net/tcp/tcp_send.c index 46e24bcdf..4f615721e 100644 --- a/nuttx/net/tcp/tcp_send.c +++ b/nuttx/net/tcp/tcp_send.c @@ -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 diff --git a/nuttx/net/tcp/tcp_send_buffered.c b/nuttx/net/tcp/tcp_send_buffered.c index 1dc9c8839..cdce9ddd6 100644 --- a/nuttx/net/tcp/tcp_send_buffered.c +++ b/nuttx/net/tcp/tcp_send_buffered.c @@ -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)); diff --git a/nuttx/net/tcp/tcp_timer.c b/nuttx/net/tcp/tcp_timer.c index d74bad15f..2109f33c5 100644 --- a/nuttx/net/tcp/tcp_timer.c +++ b/nuttx/net/tcp/tcp_timer.c @@ -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 diff --git a/nuttx/net/udp/udp_conn.c b/nuttx/net/udp/udp_conn.c index ffe8cb1a8..15ca13e3c 100644 --- a/nuttx/net/udp/udp_conn.c +++ b/nuttx/net/udp/udp_conn.c @@ -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; } -- cgit v1.2.3