Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: networking: convert dns_resolver.txt to ReST

- add SPDX header;
- adjust titles and chapters, adding proper markups;
- comment out text-only TOC from html/pdf output;

- mark code blocks and literals as such;

- adjust identation, whitespaces and blank lines;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Mauro Carvalho Chehab and committed by
David S. Miller
9dfe1361 5f32c920

+30 -31
+25 -27
Documentation/networking/dns_resolver.txt Documentation/networking/dns_resolver.rst
··· 1 - =================== 2 - DNS Resolver Module 3 - =================== 1 + .. SPDX-License-Identifier: GPL-2.0 4 2 5 - Contents: 3 + =================== 4 + DNS Resolver Module 5 + =================== 6 + 7 + .. Contents: 6 8 7 9 - Overview. 8 10 - Compilation. ··· 14 12 - Debugging. 15 13 16 14 17 - ======== 18 - OVERVIEW 15 + Overview 19 16 ======== 20 17 21 18 The DNS resolver module provides a way for kernel services to make DNS queries ··· 34 33 This code is extracted from the CIFS filesystem. 35 34 36 35 37 - =========== 38 - COMPILATION 36 + Compilation 39 37 =========== 40 38 41 - The module should be enabled by turning on the kernel configuration options: 39 + The module should be enabled by turning on the kernel configuration options:: 42 40 43 41 CONFIG_DNS_RESOLVER - tristate "DNS Resolver support" 44 42 45 43 46 - ========== 47 - SETTING UP 44 + Setting up 48 45 ========== 49 46 50 47 To set up this facility, the /etc/request-key.conf file must be altered so that 51 48 /sbin/request-key can appropriately direct the upcalls. For example, to handle 52 49 basic dname to IPv4/IPv6 address resolution, the following line should be 53 - added: 50 + added:: 51 + 54 52 55 53 #OP TYPE DESC CO-INFO PROGRAM ARG1 ARG2 ARG3 ... 56 54 #====== ============ ======= ======= ========================== 57 55 create dns_resolver * * /usr/sbin/cifs.upcall %k 58 56 59 57 To direct a query for query type 'foo', a line of the following should be added 60 - before the more general line given above as the first match is the one taken. 58 + before the more general line given above as the first match is the one taken:: 61 59 62 60 create dns_resolver foo:* * /usr/sbin/dns.foo %k 63 61 64 62 65 - ===== 66 - USAGE 63 + Usage 67 64 ===== 68 65 69 66 To make use of this facility, one of the following functions that are 70 - implemented in the module can be called after doing: 67 + implemented in the module can be called after doing:: 71 68 72 69 #include <linux/dns_resolver.h> 73 70 74 - (1) int dns_query(const char *type, const char *name, size_t namelen, 75 - const char *options, char **_result, time_t *_expiry); 71 + :: 72 + 73 + int dns_query(const char *type, const char *name, size_t namelen, 74 + const char *options, char **_result, time_t *_expiry); 76 75 77 76 This is the basic access function. It looks for a cached DNS query and if 78 77 it doesn't find it, it upcalls to userspace to make a new DNS query, which 79 78 may then be cached. The key description is constructed as a string of the 80 - form: 79 + form:: 81 80 82 81 [<type>:]<name> 83 82 ··· 108 107 the use of KEYCTL_KEYRING_CLEAR on the keyring ID. 109 108 110 109 111 - =============================== 112 - READING DNS KEYS FROM USERSPACE 110 + Reading DNS Keys from Userspace 113 111 =============================== 114 112 115 113 Keys of dns_resolver type can be read from userspace using keyctl_read() or 116 114 "keyctl read/print/pipe". 117 115 118 116 119 - ========= 120 - MECHANISM 117 + Mechanism 121 118 ========= 122 119 123 120 The dnsresolver module registers a key type called "dns_resolver". Keys of ··· 146 147 information about request-key function. 147 148 148 149 149 - ========= 150 - DEBUGGING 150 + Debugging 151 151 ========= 152 152 153 153 Debugging messages can be turned on dynamically by writing a 1 into the 154 - following file: 154 + following file:: 155 155 156 - /sys/module/dnsresolver/parameters/debug 156 + /sys/module/dnsresolver/parameters/debug
+1
Documentation/networking/index.rst
··· 52 52 dctcp 53 53 decnet 54 54 defza 55 + dns_resolver 55 56 56 57 .. only:: subproject and html 57 58
+1 -1
net/ceph/Kconfig
··· 39 39 be resolved using the CONFIG_DNS_RESOLVER facility. 40 40 41 41 For information on how to use CONFIG_DNS_RESOLVER consult 42 - Documentation/networking/dns_resolver.txt 42 + Documentation/networking/dns_resolver.rst 43 43 44 44 If unsure, say N.
+1 -1
net/dns_resolver/Kconfig
··· 19 19 SMB2 later. DNS Resolver is supported by the userspace upcall 20 20 helper "/sbin/dns.resolver" via /etc/request-key.conf. 21 21 22 - See <file:Documentation/networking/dns_resolver.txt> for further 22 + See <file:Documentation/networking/dns_resolver.rst> for further 23 23 information. 24 24 25 25 To compile this as a module, choose M here: the module will be called
+1 -1
net/dns_resolver/dns_key.c
··· 1 1 /* Key type used to cache DNS lookups made by the kernel 2 2 * 3 - * See Documentation/networking/dns_resolver.txt 3 + * See Documentation/networking/dns_resolver.rst 4 4 * 5 5 * Copyright (c) 2007 Igor Mammedov 6 6 * Author(s): Igor Mammedov (niallain@gmail.com)
+1 -1
net/dns_resolver/dns_query.c
··· 1 1 /* Upcall routine, designed to work as a key type and working through 2 2 * /sbin/request-key to contact userspace when handling DNS queries. 3 3 * 4 - * See Documentation/networking/dns_resolver.txt 4 + * See Documentation/networking/dns_resolver.rst 5 5 * 6 6 * Copyright (c) 2007 Igor Mammedov 7 7 * Author(s): Igor Mammedov (niallain@gmail.com)