xiaoxiang781216 commented on code in PR #10622: URL: https://github.com/apache/nuttx/pull/10622#discussion_r1325899189
########## include/nuttx/net/dns.h: ########## @@ -247,6 +247,16 @@ int dns_register_notify(dns_callback_t callback, FAR void *arg); int dns_unregister_notify(dns_callback_t callback, FAR void *arg); +/**************************************************************************** + * Name: dns_set_queryaddrtype + * + * Description: + * Configure the address type to be used for queries. + * + ****************************************************************************/ + +int dns_set_queryaddrtype(sa_family_t addrtype); Review Comment: ```suggestion int dns_set_queryfamily(sa_family_t addrtype); ``` ########## libs/libc/netdb/lib_dnsqueryaddrtype.c: ########## @@ -0,0 +1,98 @@ +/**************************************************************************** + * libs/libc/netdb/lib_dnsqueryaddrtype.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +#include <sys/types.h> +#include <errno.h> +#include <assert.h> +#include <debug.h> + +#include "netdb/lib_dns.h" + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static int g_query_addrtype = AF_UNSPEC; + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: dns_isavail_queryaddrtype + * + * Description: + * Determine if the specified address type is available for DNS query. + * + ****************************************************************************/ + +bool dns_isavail_queryaddrtype(sa_family_t addrtype) Review Comment: ```suggestion bool dns_is_queryfamily(sa_family_t addrtype) ``` ########## libs/libc/netdb/CMakeLists.txt: ########## @@ -55,6 +55,7 @@ if(CONFIG_LIBC_NETDB) list(APPEND SRCS lib_dnsinit.c lib_dnsbind.c lib_dnsquery.c) list(APPEND SRCS lib_dnsaddserver.c lib_dnsdefaultserver.c) list(APPEND SRCS lib_dnsforeach.c lib_dnsnotify.c) + list(APPEND SRCS lib_dnsqueryaddrtype.c) Review Comment: ```suggestion list(APPEND SRCS lib_dnsqueryfamily.c) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
