Networking: Straighten up use if IPv6/IPv4 in TCP connection logic

This commit is contained in:
Gregory Nutt
2015-01-17 15:17:35 -06:00
parent d7a71f0119
commit b187b4f381
3 changed files with 79 additions and 51 deletions

View File

@@ -1,7 +1,7 @@
/****************************************************************************
* net/tcp/tcp.h
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2014-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -269,6 +269,7 @@ extern "C"
/* Defined in tcp_conn.c ****************************************************/
struct sockaddr; /* Forward reference */
struct tcp_iphdr_s; /* Forward reference */
/****************************************************************************
@@ -393,13 +394,7 @@ int tcp_bind(FAR struct tcp_conn_s *conn,
*
****************************************************************************/
#ifdef CONFIG_NET_IPv6
int tcp_connect(FAR struct tcp_conn_s *conn,
FAR const struct sockaddr_in6 *addr);
#else
int tcp_connect(FAR struct tcp_conn_s *conn,
FAR const struct sockaddr_in *addr);
#endif
int tcp_connect(FAR struct tcp_conn_s *conn, FAR const struct sockaddr *addr);
/* Defined in tcp_ipselect.c ************************************************/
/****************************************************************************