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

@ -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);