summaryrefslogtreecommitdiff
path: root/nuttx/net/tcp
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-01-16 12:30:18 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-01-16 12:30:18 -0600
commit80ea43c7c968cd7f9617ab8a69892b4214e6664c (patch)
tree0fd0ccd53493c12a7cd79a322e48680763715228 /nuttx/net/tcp
parent9d7bd7674895cf2d6f21501396f6945a14231e7b (diff)
downloadpx4-nuttx-80ea43c7c968cd7f9617ab8a69892b4214e6664c.tar.gz
px4-nuttx-80ea43c7c968cd7f9617ab8a69892b4214e6664c.tar.bz2
px4-nuttx-80ea43c7c968cd7f9617ab8a69892b4214e6664c.zip
Networking: Replace all references to net_ipaddr_t with either in_addr_t on net_ipv6addr_t. The goal is to support both IPv4 and IPv6 simultaneously. This requires that the two types be distinct and not conditionally typedef'ed to net_ipaddr_t.
Diffstat (limited to 'nuttx/net/tcp')
-rw-r--r--nuttx/net/tcp/tcp_conn.c15
-rw-r--r--nuttx/net/tcp/tcp_send_buffered.c4
-rw-r--r--nuttx/net/tcp/tcp_send_unbuffered.c4
3 files changed, 11 insertions, 12 deletions
diff --git a/nuttx/net/tcp/tcp_conn.c b/nuttx/net/tcp/tcp_conn.c
index 1ce526560..f23694c5e 100644
--- a/nuttx/net/tcp/tcp_conn.c
+++ b/nuttx/net/tcp/tcp_conn.c
@@ -104,8 +104,7 @@ static uint16_t g_last_tcp_port;
****************************************************************************/
#ifdef CONFIG_NETDEV_MULTINIC
-static FAR struct tcp_conn_s *tcp_listener(net_ipaddr_t ipaddr,
- uint16_t portno)
+static FAR struct tcp_conn_s *tcp_listener(in_addr_t ipaddr, uint16_t portno)
#else
static FAR struct tcp_conn_s *tcp_listener(uint16_t portno)
#endif
@@ -132,11 +131,11 @@ static FAR struct tcp_conn_s *tcp_listener(uint16_t portno)
* with INADDR_ANY.
*/
- if (net_ipaddr_cmp(conn->u.ipv4.laddr, ipaddr) ||
+ if (net_ipv4addr_cmp(conn->u.ipv4.laddr, ipaddr) ||
#ifdef CONFIG_NET_IPv6
- net_ipaddr_cmp(conn->u.ipv4.laddr, g_allzeroaddr))
+ net_ipv4addr_cmp(conn->u.ipv4.laddr, g_ipv4_allzeroaddr))
#else
- net_ipaddr_cmp(conn->u.ipv4.laddr, INADDR_ANY))
+ net_ipv4addr_cmp(conn->u.ipv4.laddr, INADDR_ANY))
#endif
#endif
{
@@ -176,7 +175,7 @@ static FAR struct tcp_conn_s *tcp_listener(uint16_t portno)
****************************************************************************/
#ifdef CONFIG_NETDEV_MULTINIC
-static int tcp_selectport(net_ipaddr_t ipaddr, uint16_t portno)
+static int tcp_selectport(in_addr_t ipaddr, uint16_t portno)
#else
static int tcp_selectport(uint16_t portno)
#endif
@@ -525,7 +524,7 @@ FAR struct tcp_conn_s *tcp_active(FAR struct net_driver_s *dev,
tcp->destport == conn->lport &&
tcp->srcport == conn->rport &&
#ifdef CONFIG_NETDEV_MULTINIC
- (net_ipaddr_cmp(conn->u.ipv4.laddr, g_allzeroaddr) ||
+ (net_ipaddr_cmp(conn->u.ipv4.laddr, g_ipv4_allzeroaddr) ||
net_ipaddr_cmp(destipaddr, conn->u.ipv4.laddr)) &&
#endif
net_ipaddr_cmp(srcipaddr, conn->u.ipv4.raddr))
@@ -668,7 +667,7 @@ int tcp_bind(FAR struct tcp_conn_s *conn,
net_lock_t flags;
int port;
#ifdef CONFIG_NETDEV_MULTINIC
- net_ipaddr_t ipaddr;
+ in_addr_t ipaddr;
#endif
/* Verify or select a local port and address */
diff --git a/nuttx/net/tcp/tcp_send_buffered.c b/nuttx/net/tcp/tcp_send_buffered.c
index 66a983190..fdf875cc0 100644
--- a/nuttx/net/tcp/tcp_send_buffered.c
+++ b/nuttx/net/tcp/tcp_send_buffered.c
@@ -829,9 +829,9 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR const void *buf,
/* Notify the device driver of the availability of TX data */
#ifdef CONFIG_NET_MULTILINK
- netdev_txnotify(conn->u.ipv4.laddr, conn->u.ipv4.raddr);
+ netdev_ipv4_txnotify(conn->u.ipv4.laddr, conn->u.ipv4.raddr);
#else
- netdev_txnotify(conn->u.ipv4.raddr);
+ netdev_ipv4_txnotify(conn->u.ipv4.raddr);
#endif
result = len;
}
diff --git a/nuttx/net/tcp/tcp_send_unbuffered.c b/nuttx/net/tcp/tcp_send_unbuffered.c
index 90380640b..5649d3aa1 100644
--- a/nuttx/net/tcp/tcp_send_unbuffered.c
+++ b/nuttx/net/tcp/tcp_send_unbuffered.c
@@ -597,9 +597,9 @@ ssize_t psock_tcp_send(FAR struct socket *psock,
/* Notify the device driver of the availability of TX data */
#ifdef CONFIG_NET_MULTILINK
- netdev_txnotify(conn->u.ipv4.laddr, conn->u.ipv4.raddr);
+ netdev_ipv4_txnotify(conn->u.ipv4.laddr, conn->u.ipv4.raddr);
#else
- netdev_txnotify(conn->u.ipv4.raddr);
+ netdev_ipv4_txnotify(conn->u.ipv4.raddr);
#endif
/* Wait for the send to complete or an error to occur: NOTES: (1)