apps/: Remove/replace all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0. That value is always greater than zero now. In places just replace with #ifdef CONFIG_NET.

This commit is contained in:
Gregory Nutt 2019-02-11 16:23:55 -06:00
parent a14f3fbffb
commit b2f46360de
32 changed files with 73 additions and 77 deletions

View File

@ -247,8 +247,6 @@ examples/dhcpd
NuttX configuration settings:
CONFIG_NET=y - Of course
CONFIG_NSOCKET_DESCRIPTORS - And, of course, you must allocate some
socket descriptors.
CONFIG_NET_UDP=y - UDP support is required for DHCP
(as well as various other UDP-related
configuration settings)
@ -1261,7 +1259,6 @@ examples/poll
CONFIG_NET - Defined for general network support
CONFIG_NET_TCP - Defined for TCP/IP support
CONFIG_NSOCKET_DESCRIPTORS - Defined to be greater than 0
CONFIG_NET_TCP_READAHEAD - Defined
CONFIG_NET_NTCP_READAHEAD_BUFFERS - Defined to be greater than zero
@ -2031,8 +2028,6 @@ examples/webserver
required. These include:
CONFIG_NET=y - Of course
CONFIG_NSOCKET_DESCRIPTORS - And, of course, you must allocate some
socket descriptors.
CONFIG_NET_UDP=y - UDP support is required for DHCP
(as well as various other UDP-related
configuration settings).

View File

@ -58,14 +58,13 @@
* poll/select support. This kind of looks like overkill.
*
* CONFIG_NET - Network support must be enabled
* CONFIG_NSOCKET_DESCRIPTORS - Socket descriptors must be allocated
* CONFIG_NET_TCP - Only support on TCP (because read-ahead
* buffering s not yet support for UDP)
* CONFIG_NET_TCP_READAHEAD - TCP/IP read-ahead buffering must be enabled
*/
#if !defined(CONFIG_NET) || CONFIG_NSOCKET_DESCRIPTORS <= 0
#ifndef CONFIG_NET
# error Network socket support not enabled
#endif

View File

@ -58,14 +58,13 @@
* poll/select support. This kind of looks like overkill.
*
* CONFIG_NET - Network support must be enabled
* CONFIG_NSOCKET_DESCRIPTORS - Socket descriptors must be allocated
* CONFIG_NET_TCP - Only support on TCP (because read-ahead
* buffering s not yet support for UDP)
* CONFIG_NET_TCP_READAHEAD - TCP/IP read-ahead buffering must be enabled
*/
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 && \
defined(CONFIG_NET_TCP) && defined(CONFIG_NET_TCP_READAHEAD)
#if defined(CONFIG_NET) && defined(CONFIG_NET_TCP) && \
defined(CONFIG_NET_TCP_READAHEAD)
# define HAVE_NETPOLL 1
#else
# undef HAVE_NETPOLL

View File

@ -126,8 +126,6 @@ If you use DHCPC/D, then some special configuration network options are
required. These include:
CONFIG_NET=y Of course
CONFIG_NSOCKET_DESCRIPTORS And, of course, you must allocate some
socket descriptors.
CONFIG_NET_UDP=y UDP support is required for DHCP
(as well as various other UDP-related
configuration settings).

View File

@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET_ICMPv6_AUTOCONF) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_ICMPv6_AUTOCONF
#include <sys/socket.h>
#include <sys/ioctl.h>
@ -105,4 +105,4 @@ int netlib_icmpv6_autoconfiguration(FAR const char *ifname)
return ret;
}
#endif /* CONFIG_NET_ICMPv6_AUTOCONF && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET_ICMPv6_AUTOCONF */

View File

@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET_ARP) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_ARP
#include <sys/socket.h>
#include <sys/ioctl.h>
@ -100,4 +100,4 @@ int netlib_del_arpmapping(FAR const struct sockaddr_in *inaddr)
return ret;
}
#endif /* CONFIG_NET_ARP && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET_ARP */

View File

@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET_ARP) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_ARP
#include <sys/socket.h>
#include <sys/ioctl.h>
@ -107,4 +107,4 @@ int netlib_get_arpmapping(FAR const struct sockaddr_in *inaddr,
return ret;
}
#endif /* CONFIG_NET_ARP && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET_ARP */

View File

@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET_IPv4) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_IPv4
#include <sys/socket.h>
#include <sys/ioctl.h>
@ -102,4 +102,4 @@ int netlib_get_dripv4addr(FAR const char *ifname, FAR struct in_addr *addr)
return ret;
}
#endif /* CONFIG_NET_IPv4 && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET_IPv4 */

View File

@ -53,7 +53,7 @@
#include "netutils/netlib.h"
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
/****************************************************************************
* Pre-processor Definitions
@ -131,4 +131,4 @@ int netlib_getessid(FAR const char *ifname, FAR char *essid, size_t idlen)
return ret;
}
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET */

View File

@ -53,7 +53,7 @@
#include "netutils/netlib.h"
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
/****************************************************************************
* Pre-processor Definitions
@ -129,4 +129,4 @@ int netlib_getifstatus(FAR const char *ifname, FAR uint8_t *flags)
return ret;
}
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET */

View File

@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET_IPv4) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_IPv4
#include <sys/socket.h>
#include <sys/ioctl.h>
@ -102,4 +102,4 @@ int netlib_get_ipv4addr(FAR const char *ifname, FAR struct in_addr *addr)
return ret;
}
#endif /* CONFIG_NET_IPv4 && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET_IPv4 */

View File

@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET_IPv4) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_IPv4
#include <sys/socket.h>
#include <sys/ioctl.h>
@ -102,4 +102,5 @@ int netlib_get_ipv4netmask(FAR const char *ifname, FAR struct in_addr *addr)
return ret;
}
#endif /* CONFIG_NET_IPv4 && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET_IPv4 */

View File

@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET_IPv6) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_IPv6
#include <sys/socket.h>
#include <sys/ioctl.h>
@ -103,4 +103,5 @@ int netlib_get_ipv6addr(FAR const char *ifname, FAR struct in6_addr *addr)
return ret;
}
#endif /* CONFIG_NET_IPv6 && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET_IPv6 */

View File

@ -52,7 +52,7 @@
#include "netutils/netlib.h"
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
/****************************************************************************
* Pre-processor Definitions
@ -127,4 +127,5 @@ int netlib_getmacaddr(const char *ifname, uint8_t *macaddr)
return ret;
}
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET */

View File

@ -50,8 +50,7 @@
#include "nuttx/wireless/pktradio.h"
#include "netutils/netlib.h"
#if (defined(CONFIG_NET_6LOWPAN) || defined(CONFIG_NET_IEEE802154)) && \
CONFIG_NSOCKET_DESCRIPTORS > 0
#if defined(CONFIG_NET_6LOWPAN) || defined(CONFIG_NET_IEEE802154)
/****************************************************************************
* Public Functions
@ -109,4 +108,5 @@ int netlib_getnodnodeaddr(FAR const char *ifname,
return ret;
}
#endif /* (CONFIG_NET_6LOWPAN || CONFIG_NET_IEEE802154) && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET_6LOWPAN || CONFIG_NET_IEEE802154 */

View File

@ -52,8 +52,7 @@
#include "netutils/netlib.h"
#if (defined(CONFIG_NET_6LOWPAN) || defined(CONFIG_NET_IEEE802154)) && \
CONFIG_NSOCKET_DESCRIPTORS > 0
#if defined(CONFIG_NET_6LOWPAN) || defined(CONFIG_NET_IEEE802154)
/****************************************************************************
* Public Functions
@ -108,4 +107,5 @@ int netlib_getpanid(FAR const char *ifname, FAR uint8_t *panid)
return ret;
}
#endif /* (CONFIG_NET_6LOWPAN || CONFIG_NET_IEEE802154) && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET_6LOWPAN || CONFIG_NET_IEEE802154 */

View File

@ -50,8 +50,7 @@
#include "nuttx/wireless/pktradio.h"
#include "netutils/netlib.h"
#if (defined(CONFIG_NET_6LOWPAN) || defined(CONFIG_NET_IEEE802154)) && \
CONFIG_NSOCKET_DESCRIPTORS > 0
#if defined(CONFIG_NET_6LOWPAN) || defined(CONFIG_NET_IEEE802154)
/****************************************************************************
* Public Functions
@ -109,4 +108,5 @@ int netlib_getproperties(FAR const char *ifname,
return ret;
}
#endif /* (CONFIG_NET_6LOWPAN || CONFIG_NET_IEEE802154) && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET_6LOWPAN || CONFIG_NET_IEEE802154 */

View File

@ -52,8 +52,7 @@
#include "nuttx/wireless/pktradio.h"
#include "netutils/netlib.h"
#if (defined(CONFIG_NET_6LOWPAN) || defined(CONFIG_NET_IEEE802154)) && \
CONFIG_NSOCKET_DESCRIPTORS > 0
#if defined(CONFIG_NET_6LOWPAN) || defined(CONFIG_NET_IEEE802154)
/****************************************************************************
* Private Functions
@ -190,5 +189,5 @@ bool netlib_nodeaddrconv(FAR const char *addrstr,
return false;
}
#endif /* (CONFIG_NET_6LOWPAN || CONFIG_NET_IEEE802154) && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET_6LOWPAN || CONFIG_NET_IEEE802154 */

View File

@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET_ARP) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_ARP
#include <sys/socket.h>
#include <sys/ioctl.h>
@ -105,4 +105,4 @@ int netlib_set_arpmapping(FAR const struct sockaddr_in *inaddr,
return ret;
}
#endif /* CONFIG_NET_ARP && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET_ARP */

View File

@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET_IPv4) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_IPv4
#include <sys/socket.h>
#include <sys/ioctl.h>
@ -142,4 +142,5 @@ int netlib_set_dripv4addr(FAR const char *ifname,
return ret;
}
#endif /* CONFIG_NET_IPv4 && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET_IPv4 */

View File

@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET_IPv6) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_IPv6
#include <sys/socket.h>
#include <sys/ioctl.h>
@ -103,4 +103,5 @@ int netlib_set_dripv6addr(FAR const char *ifname,
return ret;
}
#endif /* CONFIG_NET_IPv6 && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET_IPv6 */

View File

@ -52,8 +52,7 @@
#include "netutils/netlib.h"
#if (defined(CONFIG_NET_6LOWPAN) || defined(CONFIG_NET_IEEE802154)) && \
CONFIG_NSOCKET_DESCRIPTORS > 0
#if defined(CONFIG_NET_6LOWPAN) || defined(CONFIG_NET_IEEE802154)
/****************************************************************************
* Public Functions
@ -108,4 +107,5 @@ int netlib_seteaddr(FAR const char *ifname, FAR const uint8_t *eaddr)
return ret;
}
#endif /* (CONFIG_NET_6LOWPAN || CONFIG_NET_IEEE802154) && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET_6LOWPAN || CONFIG_NET_IEEE802154 */

View File

@ -53,7 +53,7 @@
#include "netutils/netlib.h"
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
/****************************************************************************
* Pre-processor Definitions
@ -131,4 +131,5 @@ int netlib_setessid(FAR const char *ifname, FAR const char *essid)
return ret;
}
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET */

View File

@ -52,7 +52,7 @@
#include "netutils/netlib.h"
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
/****************************************************************************
* Pre-processor Definitions
@ -167,4 +167,5 @@ int netlib_ifdown(const char *ifname)
return ret;
}
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET */

View File

@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET_IPv4) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_IPv4
#include <sys/socket.h>
#include <sys/ioctl.h>
@ -102,4 +102,5 @@ int netlib_set_ipv4addr(FAR const char *ifname, FAR const struct in_addr *addr)
return ret;
}
#endif /* CONFIG_NET_IPv4 && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET_IPv4 */

View File

@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET_IPv4) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_IPv4
#include <sys/socket.h>
#include <sys/ioctl.h>
@ -102,4 +102,5 @@ int netlib_set_ipv4netmask(FAR const char *ifname,
return ret;
}
#endif /* CONFIG_NET_IPv4 && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET_IPv4 */

View File

@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET_IPv6) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_IPv6
#include <sys/socket.h>
#include <sys/ioctl.h>
@ -103,4 +103,5 @@ int netlib_set_ipv6addr(FAR const char *ifname,
return ret;
}
#endif /* CONFIG_NET_IPv6 && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET_IPv6 */

View File

@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET_IPv6) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_IPv6
#include <sys/socket.h>
#include <sys/ioctl.h>
@ -102,4 +102,5 @@ int netlib_set_ipv6netmask(FAR const char *ifname,
return ret;
}
#endif /* CONFIG_NET_IPv6 && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET_IPv6 */

View File

@ -52,7 +52,7 @@
#include "netutils/netlib.h"
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
/****************************************************************************
* Pre-processor Definitions
@ -133,4 +133,5 @@ int netlib_setmacaddr(const char *ifname, const uint8_t *macaddr)
return ret;
}
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET */

View File

@ -50,8 +50,7 @@
#include "nuttx/wireless/pktradio.h"
#include "netutils/netlib.h"
#if (defined(CONFIG_NET_6LOWPAN) || defined(CONFIG_NET_IEEE802154)) && \
CONFIG_NSOCKET_DESCRIPTORS > 0
#if defined(CONFIG_NET_6LOWPAN) || defined(CONFIG_NET_IEEE802154)
/****************************************************************************
* Public Functions
@ -105,4 +104,5 @@ int netlib_setnodeaddr(FAR const char *ifname,
return ret;
}
#endif /* (CONFIG_NET_6LOWPAN || CONFIG_NET_IEEE802154) && CONFIG_NSOCKET_DESCRIPTORS */
#endif /* CONFIG_NET_6LOWPAN || CONFIG_NET_IEEE802154 */

View File

@ -512,7 +512,7 @@ int tftpput(FAR const char *local, FAR const char *remote, in_addr_t addr,
goto errout;
}
result = tftpput_cb(remote, addr, binary, tftp_read, (void *)fd);
result = tftpput_cb(remote, addr, binary, tftp_read, (FAR void *)fd);
close(fd);

View File

@ -1828,9 +1828,6 @@ NSH-Specific Configuration Settings
* CONFIG_NET=y
Of course, networking must be enabled
* CONFIG_NSOCKET_DESCRIPTORS
And, of course, you must allocate some socket descriptors.
* CONFIG_NET_TCP=y
TCP/IP support is required for telnet (as well as various other TCP-related
configuration settings).
@ -1862,9 +1859,6 @@ NSH-Specific Configuration Settings
* CONFIG_NET=y
Of course, networking must be enabled
* CONFIG_NSOCKET_DESCRIPTORS
And, of course, you must allocate some socket descriptors.
* CONFIG_NET_UDP=y
UDP support is required for DHCP (as well as various other UDP-related
configuration settings)