apps/netutils/netinit, apps/netutils/netlib/, and apps/include/netutils/netlib.h: Extend a few definitions to permit building netutils and netinit with only Netlink sockets enabled.

This commit is contained in:
Gregory Nutt 2019-11-19 09:49:36 -06:00
parent 91b6ad6a0d
commit 1859f56380
4 changed files with 13 additions and 8 deletions

View File

@ -104,6 +104,8 @@
# define NETLIB_SOCK_FAMILY AF_BLUETOOTH # define NETLIB_SOCK_FAMILY AF_BLUETOOTH
#elif defined(CONFIG_NET_USRSOCK) #elif defined(CONFIG_NET_USRSOCK)
# define NETLIB_SOCK_FAMILY AF_INET # define NETLIB_SOCK_FAMILY AF_INET
#elif defined(CONFIG_NET_NETLINK)
# define NETLIB_SOCK_FAMILY AF_NETLINK
#else #else
# define NETLIB_SOCK_FAMILY AF_UNSPEC # define NETLIB_SOCK_FAMILY AF_UNSPEC
#endif #endif
@ -152,6 +154,8 @@
# define NETLIB_SOCK_TYPE SOCK_DGRAM # define NETLIB_SOCK_TYPE SOCK_DGRAM
#elif NETLIB_SOCK_FAMILY == AF_BLUETOOTH #elif NETLIB_SOCK_FAMILY == AF_BLUETOOTH
# define NETLIB_SOCK_TYPE SOCK_RAW # define NETLIB_SOCK_TYPE SOCK_RAW
#elif NETLIB_SOCK_FAMILY == AF_NETLINK
# define NETLIB_SOCK_TYPE SOCK_DGRAM
#endif #endif
/**************************************************************************** /****************************************************************************

View File

@ -164,6 +164,7 @@
* not be the one that you want). * not be the one that you want).
*/ */
#undef NETINIT_HAVE_NETDEV
#if defined(CONFIG_DRIVERS_IEEE80211) /* Usually also has CONFIG_NET_ETHERNET */ #if defined(CONFIG_DRIVERS_IEEE80211) /* Usually also has CONFIG_NET_ETHERNET */
# define NET_DEVNAME "wlan0" # define NET_DEVNAME "wlan0"
# define NETINIT_HAVE_NETDEV # define NETINIT_HAVE_NETDEV
@ -188,14 +189,10 @@
#elif defined(CONFIG_NET_LOCAL) #elif defined(CONFIG_NET_LOCAL)
# define NET_DEVNAME "lo" # define NET_DEVNAME "lo"
# define NETINIT_HAVE_NETDEV # define NETINIT_HAVE_NETDEV
#elif defined(CONFIG_NET_USRSOCK)
# undef NETINIT_HAVE_NETDEV
#elif !defined(CONFIG_NET_LOOPBACK)
# error ERROR: No link layer protocol defined
#endif #endif
/* If we have no network device (only only the local loopback device), then we /* If we have no network device (perhaps only USRSOCK, local loopback, or
* cannot support the network monitor. * Netlink sockets), then we cannot support the network monitor.
*/ */
#ifndef NETINIT_HAVE_NETDEV #ifndef NETINIT_HAVE_NETDEV

View File

@ -76,6 +76,8 @@
# define AF_FAMILY AF_BLUETOOTH # define AF_FAMILY AF_BLUETOOTH
#elif defined(CONFIG_NET_USRSOCK) #elif defined(CONFIG_NET_USRSOCK)
# define AF_FAMILY AF_INET # define AF_FAMILY AF_INET
#elif defined(CONFIG_NET_NETLINK)
# define AF_FAMILY AF_NETLINK
#endif #endif
/**************************************************************************** /****************************************************************************

View File

@ -75,6 +75,8 @@
# define AF_FAMILY AF_BLUETOOTH # define AF_FAMILY AF_BLUETOOTH
#elif defined(CONFIG_NET_USRSOCK) #elif defined(CONFIG_NET_USRSOCK)
# define AF_FAMILY AF_INET # define AF_FAMILY AF_INET
#elif defined(CONFIG_NET_NETLINK)
# define AF_FAMILY AF_NETLINK
#endif #endif
/**************************************************************************** /****************************************************************************