This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 9dfd0ebce9e0be7f5d44be8b66b7f078531755fe Author: Marco Casaroli <[email protected]> AuthorDate: Wed Oct 21 17:21:15 2026 +0200 Documentation: Describe res_init() and dn_skipname(). Add res_init() and dn_skipname() to the DNS functions of <resolv.h>, and say which configuration each one needs. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]> --- Documentation/reference/user/11_network.rst | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Documentation/reference/user/11_network.rst b/Documentation/reference/user/11_network.rst index d7f87a16b95..fcee9069cfc 100644 --- a/Documentation/reference/user/11_network.rst +++ b/Documentation/reference/user/11_network.rst @@ -562,13 +562,28 @@ DNS Query Functions (``resolv.h``) These functions send DNS queries for any record type and return the raw answer message. ``arpa/nameser.h`` gives the constants and the macros that parse the answer. ``res_mkquery()`` is always available with -``CONFIG_LIBC_NETDB``. The other three need ``CONFIG_NETDB_DNSCLIENT`` and use -the same name servers, timeouts and retries as the DNS client. +``CONFIG_LIBC_NETDB``. ``res_init()``, ``res_send()``, ``res_query()`` and +``res_search()`` need ``CONFIG_NETDB_DNSCLIENT``; the last three use the same +name servers, timeouts and retries as the DNS client. ``dn_comp()``, +``dn_expand()`` and ``dn_skipname()`` are always available with +``CONFIG_LIBC_NETDB``. + - :c:func:`res_init` - :c:func:`res_mkquery` - :c:func:`res_send` - :c:func:`res_query` - :c:func:`res_search` + - :c:func:`dn_skipname` + +.. c:function:: int res_init(void); + + Initialize the resolver. The DNS client gets the name servers at each + query: from ``CONFIG_NETDB_RESOLVCONF_PATH`` with + ``CONFIG_NETDB_RESOLVCONF``, otherwise from the list that + ``dns_add_nameserver()`` changes. Thus a change of the name servers is + used at the next query, and ``res_init()`` has nothing to do. + + :return: Always 0. .. c:function:: int res_mkquery(int op, const char *dname, int rclass, int type, const unsigned char *data, int datalen, const unsigned char *newrr, unsigned char *buf, int buflen); @@ -598,3 +613,12 @@ the same name servers, timeouts and retries as the DNS client. .. c:function:: int res_search(const char *dname, int rclass, int type, unsigned char *answer, int anslen); The same as :c:func:`res_query`. NuttX has no search list. + +.. c:function:: int dn_skipname(const unsigned char *src, const unsigned char *end); + + Find the size of the compressed domain name at ``src`` in a DNS message + that ends at ``end``, without expanding it. The name ends at the root + label or at a compression pointer. + + :return: The size of the name in bytes on success; -1 if the name is not + valid or does not end before ``end``.
