diff options
-rw-r--r-- | apps/include/netutils/dnsclient.h | 22 | ||||
-rw-r--r-- | nuttx/configs/dk-tm4c129x/nsh/defconfig | 17 |
2 files changed, 30 insertions, 9 deletions
diff --git a/apps/include/netutils/dnsclient.h b/apps/include/netutils/dnsclient.h index 6261ece91..943e93154 100644 --- a/apps/include/netutils/dnsclient.h +++ b/apps/include/netutils/dnsclient.h @@ -49,6 +49,22 @@ #include <netinet/in.h> /**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* If both IPv4 and IPv6 are enabled, the DNS client can support only one or + * the other. + */ + +#if !defined(CONFIG_NETUTILS_DNSCLIENT_IPv4) && \ + !defined(CONFIG_NETUTILS_DNSCLIENT_IPv6) +# ifdef CONFIG_NET_IPv6 +# define CONFIG_NETUTILS_DNSCLIENT_IPv6 1 +# else +# define CONFIG_NETUTILS_DNSCLIENT_IPv4 1 +# endif +#endif + +/**************************************************************************** * Public Function Prototypes ****************************************************************************/ @@ -127,7 +143,7 @@ int dns_query(FAR const char *hostname, FAR in_addr_t *ipaddr); * ****************************************************************************/ -#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NETUTILS_DNSCLIENT_IPv6 void dns_setserver(FAR const struct in6_addr *dnsserver); #else void dns_setserver(FAR const struct in_addr *dnsserver); @@ -155,7 +171,7 @@ void dns_getserver(FAR struct in_addr *dnsserver); * ****************************************************************************/ -#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NETUTILS_DNSCLIENT_IPv6 int dns_whois_socket(int sockfd, FAR const char *name, FAR struct sockaddr_in6 *addr); #else @@ -172,7 +188,7 @@ int dns_whois_socket(int sockfd, FAR const char *name, * ****************************************************************************/ -#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NETUTILS_DNSCLIENT_IPv6 int dns_whois(FAR const char *name, FAR struct sockaddr_in6 *addr); #else int dns_whois(FAR const char *name, FAR struct sockaddr_in *addr); diff --git a/nuttx/configs/dk-tm4c129x/nsh/defconfig b/nuttx/configs/dk-tm4c129x/nsh/defconfig index 37478a6d9..720cefed5 100644 --- a/nuttx/configs/dk-tm4c129x/nsh/defconfig +++ b/nuttx/configs/dk-tm4c129x/nsh/defconfig @@ -575,6 +575,16 @@ CONFIG_NET_GUARDSIZE=2 CONFIG_NET_ETHERNET=y # +# Network Device Operations +# +CONFIG_NETDEV_PHY_IOCTL=y + +# +# Internet Protocol Selection +# +CONFIG_NET_IPv4=y + +# # Socket Support # CONFIG_NSOCKET_DESCRIPTORS=8 @@ -583,12 +593,6 @@ CONFIG_NET_SOCKOPTS=y CONFIG_NET_SOLINGER=y # -# Network Device Operations -# -CONFIG_NETDEV_PHY_IOCTL=y -CONFIG_NET_IPv4=y - -# # Raw Socket Support # # CONFIG_NET_PKT is not set @@ -855,6 +859,7 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_NETUTILS_FTPD is not set # CONFIG_NETUTILS_JSON is not set CONFIG_NETUTILS_DNSCLIENT=y +CONFIG_NETUTILS_DNSCLIENT_IPv4=y CONFIG_NETUTILS_DNSCLIENT_ENTRIES=8 CONFIG_NETUTILS_DNSCLIENT_MAXRESPONSE=96 # CONFIG_NETUTILS_SMTP is not set |