diff options
author | Bagas Sanjaya <bagasdotme@gmail.com> | 2025-09-24 09:06:24 +0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2025-09-26 15:21:34 -0700 |
commit | 1b1fe672337bb7549f637853c1c9536872d3d19c (patch) | |
tree | 998a4555bbe7212327b101f5c63408798f22a964 | |
parent | 84a27b5a4cedd0b19381e27e8026614ddf3e900f (diff) |
net: dns_resolver: Move dns_query() explanation out of code block
Documentation for dns_query() is placed in the function's literal code
block snippet instead. Move it out of there.
Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250924020626.17073-3-bagasdotme@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r-- | Documentation/networking/dns_resolver.rst | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/Documentation/networking/dns_resolver.rst b/Documentation/networking/dns_resolver.rst index 5cec37bedf99..fbbd2c4635cb 100644 --- a/Documentation/networking/dns_resolver.rst +++ b/Documentation/networking/dns_resolver.rst @@ -64,44 +64,42 @@ before the more general line given above as the first match is the one taken:: Usage ===== -To make use of this facility, one of the following functions that are -implemented in the module can be called after doing:: +To make use of this facility, first ``dns_resolver.h`` must be included:: #include <linux/dns_resolver.h> - :: +Then queries may be made by calling:: int dns_query(const char *type, const char *name, size_t namelen, const char *options, char **_result, time_t *_expiry); - This is the basic access function. It looks for a cached DNS query and if - it doesn't find it, it upcalls to userspace to make a new DNS query, which - may then be cached. The key description is constructed as a string of the - form:: +This is the basic access function. It looks for a cached DNS query and if +it doesn't find it, it upcalls to userspace to make a new DNS query, which +may then be cached. The key description is constructed as a string of the +form:: [<type>:]<name> - where <type> optionally specifies the particular upcall program to invoke, - and thus the type of query to do, and <name> specifies the string to be - looked up. The default query type is a straight hostname to IP address - set lookup. +where <type> optionally specifies the particular upcall program to invoke, +and thus the type of query, and <name> specifies the string to be looked up. +The default query type is a straight hostname to IP address set lookup. - The name parameter is not required to be a NUL-terminated string, and its - length should be given by the namelen argument. +The name parameter is not required to be a NUL-terminated string, and its +length should be given by the namelen argument. - The options parameter may be NULL or it may be a set of options - appropriate to the query type. +The options parameter may be NULL or it may be a set of options +appropriate to the query type. - The return value is a string appropriate to the query type. For instance, - for the default query type it is just a list of comma-separated IPv4 and - IPv6 addresses. The caller must free the result. +The return value is a string appropriate to the query type. For instance, +for the default query type it is just a list of comma-separated IPv4 and +IPv6 addresses. The caller must free the result. - The length of the result string is returned on success, and a negative - error code is returned otherwise. -EKEYREJECTED will be returned if the - DNS lookup failed. +The length of the result string is returned on success, and a negative +error code is returned otherwise. -EKEYREJECTED will be returned if the +DNS lookup failed. - If _expiry is non-NULL, the expiry time (TTL) of the result will be - returned also. +If _expiry is non-NULL, the expiry time (TTL) of the result will be +returned also. The kernel maintains an internal keyring in which it caches looked up keys. This can be cleared by any process that has the CAP_SYS_ADMIN capability by |