boB Rudis 9 months ago
parent
commit
400455af55
No known key found for this signature in database

+ 1
- 0
NAMESPACE View File

@@ -8,6 +8,7 @@ export(gdns_get_address)
8 8
 export(gdns_get_hosts)
9 9
 export(gdns_get_resolution_type)
10 10
 export(gdns_get_resolvconf)
11
+export(gdns_get_root_servers)
11 12
 export(gdns_get_timeout)
12 13
 export(gdns_get_tls_ca_file)
13 14
 export(gdns_get_tls_ca_path)

+ 21
- 0
R/RcppExports.R View File

@@ -3,6 +3,7 @@
3 3
 
4 4
 #' Return gdns library version
5 5
 #'
6
+#' @family utlity functions
6 7
 #' @export
7 8
 gdns_lib_version <- function() {
8 9
     .Call(`_clandnstine_gdns_lib_version`)
@@ -18,6 +19,7 @@ int_gdns_update_resolvers <- function(gctx, resolvers) {
18 19
 #'
19 20
 #' @param gctx gdns resolver context created with [gdns_resolver()]
20 21
 #' @param timeout number of milliseconds (integer; i.e. not-fractional)
22
+#' @family context functions
21 23
 #' @export
22 24
 gdns_set_timeout <- function(gctx, timeout) {
23 25
     .Call(`_clandnstine_gdns_set_timeout`, gctx, timeout)
@@ -26,6 +28,7 @@ gdns_set_timeout <- function(gctx, timeout) {
26 28
 #' Retreive the number of milliseconds to wait for request to return
27 29
 #'
28 30
 #' @param gctx gdns resolver context created with [gdns_resolver()]
31
+#' @family context functions
29 32
 #' @export
30 33
 gdns_get_timeout <- function(gctx) {
31 34
     .Call(`_clandnstine_gdns_get_timeout`, gctx)
@@ -37,6 +40,7 @@ gdns_get_timeout <- function(gctx) {
37 40
 #' @md
38 41
 #' @param gctx gdns resolver context created with [gdns_resolver()]
39 42
 #' @param flag if `TRUE` (the default) round robin queries when using more than one stub resolver,
43
+#' @family context functions
40 44
 #' @export
41 45
 gdns_set_round_robin_upstreams <- function(gctx, flag = TRUE) {
42 46
     .Call(`_clandnstine_gdns_set_round_robin_upstreams`, gctx, flag)
@@ -63,6 +67,7 @@ int_gdns_set_resolution_type <- function(gctx, res_type) {
63 67
 #' Retreive what transports are used for DNS lookups.
64 68
 #'
65 69
 #' @param gctx gdns resolver context created with [gdns_resolver()]
70
+#' @family context functions
66 71
 #' @export
67 72
 gdns_get_transports <- function(gctx) {
68 73
     .Call(`_clandnstine_gdns_get_transports`, gctx)
@@ -71,6 +76,7 @@ gdns_get_transports <- function(gctx) {
71 76
 #' Retreive the value of the localnames namespace
72 77
 #'
73 78
 #' @param gctx gdns resolver context created with [gdns_resolver()]
79
+#' @family context functions
74 80
 #' @export
75 81
 gdns_get_hosts <- function(gctx) {
76 82
     .Call(`_clandnstine_gdns_get_hosts`, gctx)
@@ -79,6 +85,7 @@ gdns_get_hosts <- function(gctx) {
79 85
 #' Retreive the value with which the context's upstream recursive servers and suffixes were initialized
80 86
 #'
81 87
 #' @param gctx gdns resolver context created with [gdns_resolver()]
88
+#' @family context functions
82 89
 #' @export
83 90
 gdns_get_resolvconf <- function(gctx) {
84 91
     .Call(`_clandnstine_gdns_get_resolvconf`, gctx)
@@ -87,6 +94,7 @@ gdns_get_resolvconf <- function(gctx) {
87 94
 #' Retreive the value with which the context's upstream recursive servers and suffixes were initialized
88 95
 #'
89 96
 #' @param gctx gdns resolver context created with [gdns_resolver()]
97
+#' @family context functions
90 98
 #' @export
91 99
 gdns_get_tls_ca_path <- function(gctx) {
92 100
     .Call(`_clandnstine_gdns_get_tls_ca_path`, gctx)
@@ -95,6 +103,7 @@ gdns_get_tls_ca_path <- function(gctx) {
95 103
 #' Retreive the file location with CA certificates for verification purposes
96 104
 #'
97 105
 #' @param gctx gdns resolver context created with [gdns_resolver()]
106
+#' @family context functions
98 107
 #' @export
99 108
 gdns_get_tls_ca_file <- function(gctx) {
100 109
     .Call(`_clandnstine_gdns_get_tls_ca_file`, gctx)
@@ -104,6 +113,7 @@ gdns_get_tls_ca_file <- function(gctx) {
104 113
 #'
105 114
 #' @param gctx gdns resolver context created with [gdns_resolver()]
106 115
 #' @param ca_path directory with Certificate Authority certificates
116
+#' @family context functions
107 117
 #' @export
108 118
 gdns_set_tls_ca_path <- function(gctx, ca_path) {
109 119
     .Call(`_clandnstine_gdns_set_tls_ca_path`, gctx, ca_path)
@@ -113,11 +123,20 @@ gdns_set_tls_ca_path <- function(gctx, ca_path) {
113 123
 #'
114 124
 #' @param gctx gdns resolver context created with [gdns_resolver()]
115 125
 #' @param ca_file file with Certificate Authority certificates
126
+#' @family context functions
116 127
 #' @export
117 128
 gdns_set_tls_ca_file <- function(gctx, ca_file) {
118 129
     .Call(`_clandnstine_gdns_set_tls_ca_file`, gctx, ca_file)
119 130
 }
120 131
 
132
+#' Retrieve the list of addresses in use for looking up top-level domains in use by the context.
133
+#'
134
+#' @param gctx gdns resolver context created with [gdns_resolver()]
135
+#' @keywords internal
136
+int_gdns_get_root_servers <- function(gctx) {
137
+    .Call(`_clandnstine_int_gdns_get_root_servers`, gctx)
138
+}
139
+
121 140
 #' Test whether an object is an external pointer
122 141
 #'
123 142
 #' @param x object to test
@@ -144,6 +163,7 @@ int_gdns_context <- function(resolvers) {
144 163
 #'
145 164
 #' @param gctx gdns resolver context created with [gdns_resolver()]
146 165
 #' @param host to lookup
166
+#' @family query functions
147 167
 #' @export
148 168
 #' @examples
149 169
 #' x <- gdns_resolver()
@@ -165,6 +185,7 @@ int_gdns_query <- function(gctx, name, rr, include_reporting = FALSE) {
165 185
 #'
166 186
 #' @param gctx gdns resolver context created with [gdns_resolver()]
167 187
 #' @export
188
+#' @family context functions
168 189
 #' @examples
169 190
 #' x <- gdns_context()
170 191
 #' gdns_get_resolution_type(x)

+ 18
- 2
R/resolver.R View File

@@ -6,6 +6,7 @@
6 6
 #' @param resolvers character vector of valid DNS over TLS resolvers;
7 7
 #'        Defaults to Quad9 (`9.9.9.9`).
8 8
 #' @export
9
+#' @family query functions
9 10
 #' @examples
10 11
 #' x <- gdns_context()
11 12
 #' x <- gdns_context("1.1.1.1")
@@ -19,10 +20,11 @@ gdns_context <- function(resolvers = "9.9.9.9") {
19 20
 #'       maintains a list of DNS over TLS servers.
20 21
 #' @param gctx gdns resolver context created with [gdns_resolver()]
21 22
 #' @param resolvers character vector of valid DNS over TLS resolvers
23
+#' @family context functions
22 24
 #' @export
23 25
 #' @examples
24 26
 #' x <- gdns_context()
25
-#' x <- gdns_update_resolvers("1.1.1.1")
27
+#' x <- gdns_update_resolvers(x, "1.1.1.1")
26 28
 gdns_update_resolvers<- function(gctx, resolvers) {
27 29
   int_gdns_update_resolvers(gctx, resolvers)
28 30
 }
@@ -33,9 +35,10 @@ gdns_update_resolvers<- function(gctx, resolvers) {
33 35
 #' @param hosts_file path to a valid `hosts` file (e.g. "`/etc/hosts`). This value
34 36
 #'        will be [path.expand()]ed.
35 37
 #' @export
38
+#' @family context functions
36 39
 #' @examples
37 40
 #' x <- gdns_context()
38
-#' x <- gdns_set_hosts(x, "/etc/hosts")
41
+#' gdns_set_hosts(x, "/etc/hosts")
39 42
 gdns_set_hosts<- function(gctx, hosts_file) {
40 43
   hosts_file <- path.expand(hosts_file[1])
41 44
   stopifnot(file.exists(hosts_file))
@@ -43,6 +46,18 @@ gdns_set_hosts<- function(gctx, hosts_file) {
43 46
 }
44 47
 
45 48
 
49
+#' Retrieve the list of addresses in use for looking up top-level domains in use by the context.
50
+#'
51
+#' @param gctx gdns resolver context created with [gdns_resolver()]
52
+#' @export
53
+#' @family context functions
54
+# x <- gdns_context()
55
+# gdns_get_root_servers(x)
56
+gdns_get_root_servers <- function(gctx) {
57
+  x <- int_gdns_get_root_servers(gctx);
58
+  if (length(x)) jsonlite::fromJSON(x) else NULL
59
+}
60
+
46 61
 #' Arbitrary DNS queries
47 62
 #'
48 63
 #' Perform any valid resource record inquiry for a given name. See `Details`.
@@ -148,6 +163,7 @@ gdns_set_hosts<- function(gctx, hosts_file) {
148 163
 #' @param include_reporting if `TRUE` include debugging information for queries
149 164
 #'        such as the length of time it takes for each query. Default: `FALSE`
150 165
 #' @references <https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml>
166
+#' @family query functions
151 167
 #' @export
152 168
 #' @examples
153 169
 #' x <- gdns_resolver()

+ 1
- 0
R/set-res-types.R View File

@@ -4,6 +4,7 @@
4 4
 #'
5 5
 #' @param gctx gdns resolver context created with [gdns_resolver()]
6 6
 #' @param res_type length 1 character vector of either "`stub`" or "`recursive`"
7
+#' @family context functions
7 8
 #' @export
8 9
 #' @examples
9 10
 #' x <- gdns_context()

+ 5
- 0
man/gdns_context.Rd View File

@@ -23,3 +23,8 @@ maintains a list of DNS over TLS servers.
23 23
 x <- gdns_context()
24 24
 x <- gdns_context("1.1.1.1")
25 25
 }
26
+\seealso{
27
+Other query functions: \code{\link{gdns_get_address}},
28
+  \code{\link{gdns_query}}
29
+}
30
+\concept{query functions}

+ 5
- 0
man/gdns_get_address.Rd View File

@@ -19,3 +19,8 @@ x <- gdns_resolver()
19 19
 gdns_get_address(x, "yahoo.com")
20 20
 x \%>\% gdns_get_address("yahoo.com")
21 21
 }
22
+\seealso{
23
+Other query functions: \code{\link{gdns_context}},
24
+  \code{\link{gdns_query}}
25
+}
26
+\concept{query functions}

+ 17
- 0
man/gdns_get_hosts.Rd View File

@@ -12,3 +12,20 @@ gdns_get_hosts(gctx)
12 12
 \description{
13 13
 Retreive the value of the localnames namespace
14 14
 }
15
+\seealso{
16
+Other context functions: \code{\link{gdns_get_resolution_type}},
17
+  \code{\link{gdns_get_resolvconf}},
18
+  \code{\link{gdns_get_root_servers}},
19
+  \code{\link{gdns_get_timeout}},
20
+  \code{\link{gdns_get_tls_ca_file}},
21
+  \code{\link{gdns_get_tls_ca_path}},
22
+  \code{\link{gdns_get_transports}},
23
+  \code{\link{gdns_set_hosts}},
24
+  \code{\link{gdns_set_resolution_type}},
25
+  \code{\link{gdns_set_round_robin_upstreams}},
26
+  \code{\link{gdns_set_timeout}},
27
+  \code{\link{gdns_set_tls_ca_file}},
28
+  \code{\link{gdns_set_tls_ca_path}},
29
+  \code{\link{gdns_update_resolvers}}
30
+}
31
+\concept{context functions}

+ 17
- 0
man/gdns_get_resolution_type.Rd View File

@@ -16,3 +16,20 @@ Get the current resolution type setting
16 16
 x <- gdns_context()
17 17
 gdns_get_resolution_type(x)
18 18
 }
19
+\seealso{
20
+Other context functions: \code{\link{gdns_get_hosts}},
21
+  \code{\link{gdns_get_resolvconf}},
22
+  \code{\link{gdns_get_root_servers}},
23
+  \code{\link{gdns_get_timeout}},
24
+  \code{\link{gdns_get_tls_ca_file}},
25
+  \code{\link{gdns_get_tls_ca_path}},
26
+  \code{\link{gdns_get_transports}},
27
+  \code{\link{gdns_set_hosts}},
28
+  \code{\link{gdns_set_resolution_type}},
29
+  \code{\link{gdns_set_round_robin_upstreams}},
30
+  \code{\link{gdns_set_timeout}},
31
+  \code{\link{gdns_set_tls_ca_file}},
32
+  \code{\link{gdns_set_tls_ca_path}},
33
+  \code{\link{gdns_update_resolvers}}
34
+}
35
+\concept{context functions}

+ 17
- 0
man/gdns_get_resolvconf.Rd View File

@@ -12,3 +12,20 @@ gdns_get_resolvconf(gctx)
12 12
 \description{
13 13
 Retreive the value with which the context's upstream recursive servers and suffixes were initialized
14 14
 }
15
+\seealso{
16
+Other context functions: \code{\link{gdns_get_hosts}},
17
+  \code{\link{gdns_get_resolution_type}},
18
+  \code{\link{gdns_get_root_servers}},
19
+  \code{\link{gdns_get_timeout}},
20
+  \code{\link{gdns_get_tls_ca_file}},
21
+  \code{\link{gdns_get_tls_ca_path}},
22
+  \code{\link{gdns_get_transports}},
23
+  \code{\link{gdns_set_hosts}},
24
+  \code{\link{gdns_set_resolution_type}},
25
+  \code{\link{gdns_set_round_robin_upstreams}},
26
+  \code{\link{gdns_set_timeout}},
27
+  \code{\link{gdns_set_tls_ca_file}},
28
+  \code{\link{gdns_set_tls_ca_path}},
29
+  \code{\link{gdns_update_resolvers}}
30
+}
31
+\concept{context functions}

+ 31
- 0
man/gdns_get_root_servers.Rd View File

@@ -0,0 +1,31 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/resolver.R
3
+\name{gdns_get_root_servers}
4
+\alias{gdns_get_root_servers}
5
+\title{Retrieve the list of addresses in use for looking up top-level domains in use by the context.}
6
+\usage{
7
+gdns_get_root_servers(gctx)
8
+}
9
+\arguments{
10
+\item{gctx}{gdns resolver context created with \code{\link[=gdns_resolver]{gdns_resolver()}}}
11
+}
12
+\description{
13
+Retrieve the list of addresses in use for looking up top-level domains in use by the context.
14
+}
15
+\seealso{
16
+Other context functions: \code{\link{gdns_get_hosts}},
17
+  \code{\link{gdns_get_resolution_type}},
18
+  \code{\link{gdns_get_resolvconf}},
19
+  \code{\link{gdns_get_timeout}},
20
+  \code{\link{gdns_get_tls_ca_file}},
21
+  \code{\link{gdns_get_tls_ca_path}},
22
+  \code{\link{gdns_get_transports}},
23
+  \code{\link{gdns_set_hosts}},
24
+  \code{\link{gdns_set_resolution_type}},
25
+  \code{\link{gdns_set_round_robin_upstreams}},
26
+  \code{\link{gdns_set_timeout}},
27
+  \code{\link{gdns_set_tls_ca_file}},
28
+  \code{\link{gdns_set_tls_ca_path}},
29
+  \code{\link{gdns_update_resolvers}}
30
+}
31
+\concept{context functions}

+ 17
- 0
man/gdns_get_timeout.Rd View File

@@ -12,3 +12,20 @@ gdns_get_timeout(gctx)
12 12
 \description{
13 13
 Retreive the number of milliseconds to wait for request to return
14 14
 }
15
+\seealso{
16
+Other context functions: \code{\link{gdns_get_hosts}},
17
+  \code{\link{gdns_get_resolution_type}},
18
+  \code{\link{gdns_get_resolvconf}},
19
+  \code{\link{gdns_get_root_servers}},
20
+  \code{\link{gdns_get_tls_ca_file}},
21
+  \code{\link{gdns_get_tls_ca_path}},
22
+  \code{\link{gdns_get_transports}},
23
+  \code{\link{gdns_set_hosts}},
24
+  \code{\link{gdns_set_resolution_type}},
25
+  \code{\link{gdns_set_round_robin_upstreams}},
26
+  \code{\link{gdns_set_timeout}},
27
+  \code{\link{gdns_set_tls_ca_file}},
28
+  \code{\link{gdns_set_tls_ca_path}},
29
+  \code{\link{gdns_update_resolvers}}
30
+}
31
+\concept{context functions}

+ 17
- 0
man/gdns_get_tls_ca_file.Rd View File

@@ -12,3 +12,20 @@ gdns_get_tls_ca_file(gctx)
12 12
 \description{
13 13
 Retreive the file location with CA certificates for verification purposes
14 14
 }
15
+\seealso{
16
+Other context functions: \code{\link{gdns_get_hosts}},
17
+  \code{\link{gdns_get_resolution_type}},
18
+  \code{\link{gdns_get_resolvconf}},
19
+  \code{\link{gdns_get_root_servers}},
20
+  \code{\link{gdns_get_timeout}},
21
+  \code{\link{gdns_get_tls_ca_path}},
22
+  \code{\link{gdns_get_transports}},
23
+  \code{\link{gdns_set_hosts}},
24
+  \code{\link{gdns_set_resolution_type}},
25
+  \code{\link{gdns_set_round_robin_upstreams}},
26
+  \code{\link{gdns_set_timeout}},
27
+  \code{\link{gdns_set_tls_ca_file}},
28
+  \code{\link{gdns_set_tls_ca_path}},
29
+  \code{\link{gdns_update_resolvers}}
30
+}
31
+\concept{context functions}

+ 17
- 0
man/gdns_get_tls_ca_path.Rd View File

@@ -12,3 +12,20 @@ gdns_get_tls_ca_path(gctx)
12 12
 \description{
13 13
 Retreive the value with which the context's upstream recursive servers and suffixes were initialized
14 14
 }
15
+\seealso{
16
+Other context functions: \code{\link{gdns_get_hosts}},
17
+  \code{\link{gdns_get_resolution_type}},
18
+  \code{\link{gdns_get_resolvconf}},
19
+  \code{\link{gdns_get_root_servers}},
20
+  \code{\link{gdns_get_timeout}},
21
+  \code{\link{gdns_get_tls_ca_file}},
22
+  \code{\link{gdns_get_transports}},
23
+  \code{\link{gdns_set_hosts}},
24
+  \code{\link{gdns_set_resolution_type}},
25
+  \code{\link{gdns_set_round_robin_upstreams}},
26
+  \code{\link{gdns_set_timeout}},
27
+  \code{\link{gdns_set_tls_ca_file}},
28
+  \code{\link{gdns_set_tls_ca_path}},
29
+  \code{\link{gdns_update_resolvers}}
30
+}
31
+\concept{context functions}

+ 17
- 0
man/gdns_get_transports.Rd View File

@@ -12,3 +12,20 @@ gdns_get_transports(gctx)
12 12
 \description{
13 13
 Retreive what transports are used for DNS lookups.
14 14
 }
15
+\seealso{
16
+Other context functions: \code{\link{gdns_get_hosts}},
17
+  \code{\link{gdns_get_resolution_type}},
18
+  \code{\link{gdns_get_resolvconf}},
19
+  \code{\link{gdns_get_root_servers}},
20
+  \code{\link{gdns_get_timeout}},
21
+  \code{\link{gdns_get_tls_ca_file}},
22
+  \code{\link{gdns_get_tls_ca_path}},
23
+  \code{\link{gdns_set_hosts}},
24
+  \code{\link{gdns_set_resolution_type}},
25
+  \code{\link{gdns_set_round_robin_upstreams}},
26
+  \code{\link{gdns_set_timeout}},
27
+  \code{\link{gdns_set_tls_ca_file}},
28
+  \code{\link{gdns_set_tls_ca_path}},
29
+  \code{\link{gdns_update_resolvers}}
30
+}
31
+\concept{context functions}

+ 1
- 0
man/gdns_lib_version.Rd View File

@@ -9,3 +9,4 @@ gdns_lib_version()
9 9
 \description{
10 10
 Return gdns library version
11 11
 }
12
+\concept{utlity functions}

+ 5
- 0
man/gdns_query.Rd View File

@@ -127,3 +127,8 @@ gdns_query(x, "example.com")
127 127
 \references{
128 128
 \url{https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml}
129 129
 }
130
+\seealso{
131
+Other query functions: \code{\link{gdns_context}},
132
+  \code{\link{gdns_get_address}}
133
+}
134
+\concept{query functions}

+ 18
- 1
man/gdns_set_hosts.Rd View File

@@ -17,5 +17,22 @@ Initialized the context's local names namespace with values from the given hosts
17 17
 }
18 18
 \examples{
19 19
 x <- gdns_context()
20
-x <- gdns_set_hosts(x, "/etc/hosts")
20
+gdns_set_hosts(x, "/etc/hosts")
21 21
 }
22
+\seealso{
23
+Other context functions: \code{\link{gdns_get_hosts}},
24
+  \code{\link{gdns_get_resolution_type}},
25
+  \code{\link{gdns_get_resolvconf}},
26
+  \code{\link{gdns_get_root_servers}},
27
+  \code{\link{gdns_get_timeout}},
28
+  \code{\link{gdns_get_tls_ca_file}},
29
+  \code{\link{gdns_get_tls_ca_path}},
30
+  \code{\link{gdns_get_transports}},
31
+  \code{\link{gdns_set_resolution_type}},
32
+  \code{\link{gdns_set_round_robin_upstreams}},
33
+  \code{\link{gdns_set_timeout}},
34
+  \code{\link{gdns_set_tls_ca_file}},
35
+  \code{\link{gdns_set_tls_ca_path}},
36
+  \code{\link{gdns_update_resolvers}}
37
+}
38
+\concept{context functions}

+ 17
- 0
man/gdns_set_resolution_type.Rd View File

@@ -18,3 +18,20 @@ Specify whether DNS queries are performed with recursive lookups or as a stub re
18 18
 x <- gdns_context()
19 19
 x <- gdns_set_resolution_type(x, "stub")
20 20
 }
21
+\seealso{
22
+Other context functions: \code{\link{gdns_get_hosts}},
23
+  \code{\link{gdns_get_resolution_type}},
24
+  \code{\link{gdns_get_resolvconf}},
25
+  \code{\link{gdns_get_root_servers}},
26
+  \code{\link{gdns_get_timeout}},
27
+  \code{\link{gdns_get_tls_ca_file}},
28
+  \code{\link{gdns_get_tls_ca_path}},
29
+  \code{\link{gdns_get_transports}},
30
+  \code{\link{gdns_set_hosts}},
31
+  \code{\link{gdns_set_round_robin_upstreams}},
32
+  \code{\link{gdns_set_timeout}},
33
+  \code{\link{gdns_set_tls_ca_file}},
34
+  \code{\link{gdns_set_tls_ca_path}},
35
+  \code{\link{gdns_update_resolvers}}
36
+}
37
+\concept{context functions}

+ 17
- 0
man/gdns_set_round_robin_upstreams.Rd View File

@@ -16,3 +16,20 @@ gdns_set_round_robin_upstreams(gctx, flag = TRUE)
16 16
 Set/unset context to round robin queries over the available upstreams
17 17
 when resolving with the stub resolution type.
18 18
 }
19
+\seealso{
20
+Other context functions: \code{\link{gdns_get_hosts}},
21
+  \code{\link{gdns_get_resolution_type}},
22
+  \code{\link{gdns_get_resolvconf}},
23
+  \code{\link{gdns_get_root_servers}},
24
+  \code{\link{gdns_get_timeout}},
25
+  \code{\link{gdns_get_tls_ca_file}},
26
+  \code{\link{gdns_get_tls_ca_path}},
27
+  \code{\link{gdns_get_transports}},
28
+  \code{\link{gdns_set_hosts}},
29
+  \code{\link{gdns_set_resolution_type}},
30
+  \code{\link{gdns_set_timeout}},
31
+  \code{\link{gdns_set_tls_ca_file}},
32
+  \code{\link{gdns_set_tls_ca_path}},
33
+  \code{\link{gdns_update_resolvers}}
34
+}
35
+\concept{context functions}

+ 17
- 0
man/gdns_set_timeout.Rd View File

@@ -14,3 +14,20 @@ gdns_set_timeout(gctx, timeout)
14 14
 \description{
15 15
 Specify the number of milliseconds to wait for request to return
16 16
 }
17
+\seealso{
18
+Other context functions: \code{\link{gdns_get_hosts}},
19
+  \code{\link{gdns_get_resolution_type}},
20
+  \code{\link{gdns_get_resolvconf}},
21
+  \code{\link{gdns_get_root_servers}},
22
+  \code{\link{gdns_get_timeout}},
23
+  \code{\link{gdns_get_tls_ca_file}},
24
+  \code{\link{gdns_get_tls_ca_path}},
25
+  \code{\link{gdns_get_transports}},
26
+  \code{\link{gdns_set_hosts}},
27
+  \code{\link{gdns_set_resolution_type}},
28
+  \code{\link{gdns_set_round_robin_upstreams}},
29
+  \code{\link{gdns_set_tls_ca_file}},
30
+  \code{\link{gdns_set_tls_ca_path}},
31
+  \code{\link{gdns_update_resolvers}}
32
+}
33
+\concept{context functions}

+ 17
- 0
man/gdns_set_tls_ca_file.Rd View File

@@ -14,3 +14,20 @@ gdns_set_tls_ca_file(gctx, ca_file)
14 14
 \description{
15 15
 Specify the file with CA certificates for verification purposes
16 16
 }
17
+\seealso{
18
+Other context functions: \code{\link{gdns_get_hosts}},
19
+  \code{\link{gdns_get_resolution_type}},
20
+  \code{\link{gdns_get_resolvconf}},
21
+  \code{\link{gdns_get_root_servers}},
22
+  \code{\link{gdns_get_timeout}},
23
+  \code{\link{gdns_get_tls_ca_file}},
24
+  \code{\link{gdns_get_tls_ca_path}},
25
+  \code{\link{gdns_get_transports}},
26
+  \code{\link{gdns_set_hosts}},
27
+  \code{\link{gdns_set_resolution_type}},
28
+  \code{\link{gdns_set_round_robin_upstreams}},
29
+  \code{\link{gdns_set_timeout}},
30
+  \code{\link{gdns_set_tls_ca_path}},
31
+  \code{\link{gdns_update_resolvers}}
32
+}
33
+\concept{context functions}

+ 17
- 0
man/gdns_set_tls_ca_path.Rd View File

@@ -14,3 +14,20 @@ gdns_set_tls_ca_path(gctx, ca_path)
14 14
 \description{
15 15
 Specify where the location for CA certificates for verification purposes are located
16 16
 }
17
+\seealso{
18
+Other context functions: \code{\link{gdns_get_hosts}},
19
+  \code{\link{gdns_get_resolution_type}},
20
+  \code{\link{gdns_get_resolvconf}},
21
+  \code{\link{gdns_get_root_servers}},
22
+  \code{\link{gdns_get_timeout}},
23
+  \code{\link{gdns_get_tls_ca_file}},
24
+  \code{\link{gdns_get_tls_ca_path}},
25
+  \code{\link{gdns_get_transports}},
26
+  \code{\link{gdns_set_hosts}},
27
+  \code{\link{gdns_set_resolution_type}},
28
+  \code{\link{gdns_set_round_robin_upstreams}},
29
+  \code{\link{gdns_set_timeout}},
30
+  \code{\link{gdns_set_tls_ca_file}},
31
+  \code{\link{gdns_update_resolvers}}
32
+}
33
+\concept{context functions}

+ 18
- 1
man/gdns_update_resolvers.Rd View File

@@ -20,5 +20,22 @@ maintains a list of DNS over TLS servers.
20 20
 }
21 21
 \examples{
22 22
 x <- gdns_context()
23
-x <- gdns_update_resolvers("1.1.1.1")
23
+x <- gdns_update_resolvers(x, "1.1.1.1")
24 24
 }
25
+\seealso{
26
+Other context functions: \code{\link{gdns_get_hosts}},
27
+  \code{\link{gdns_get_resolution_type}},
28
+  \code{\link{gdns_get_resolvconf}},
29
+  \code{\link{gdns_get_root_servers}},
30
+  \code{\link{gdns_get_timeout}},
31
+  \code{\link{gdns_get_tls_ca_file}},
32
+  \code{\link{gdns_get_tls_ca_path}},
33
+  \code{\link{gdns_get_transports}},
34
+  \code{\link{gdns_set_hosts}},
35
+  \code{\link{gdns_set_resolution_type}},
36
+  \code{\link{gdns_set_round_robin_upstreams}},
37
+  \code{\link{gdns_set_timeout}},
38
+  \code{\link{gdns_set_tls_ca_file}},
39
+  \code{\link{gdns_set_tls_ca_path}}
40
+}
41
+\concept{context functions}

+ 15
- 0
man/int_gdns_get_root_servers.Rd View File

@@ -0,0 +1,15 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/RcppExports.R
3
+\name{int_gdns_get_root_servers}
4
+\alias{int_gdns_get_root_servers}
5
+\title{Retrieve the list of addresses in use for looking up top-level domains in use by the context.}
6
+\usage{
7
+int_gdns_get_root_servers(gctx)
8
+}
9
+\arguments{
10
+\item{gctx}{gdns resolver context created with \code{\link[=gdns_resolver]{gdns_resolver()}}}
11
+}
12
+\description{
13
+Retrieve the list of addresses in use for looking up top-level domains in use by the context.
14
+}
15
+\keyword{internal}

+ 12
- 0
src/RcppExports.cpp View File

@@ -177,6 +177,17 @@ BEGIN_RCPP
177 177
     return rcpp_result_gen;
178 178
 END_RCPP
179 179
 }
180
+// int_gdns_get_root_servers
181
+CharacterVector int_gdns_get_root_servers(SEXP gctx);
182
+RcppExport SEXP _clandnstine_int_gdns_get_root_servers(SEXP gctxSEXP) {
183
+BEGIN_RCPP
184
+    Rcpp::RObject rcpp_result_gen;
185
+    Rcpp::RNGScope rcpp_rngScope_gen;
186
+    Rcpp::traits::input_parameter< SEXP >::type gctx(gctxSEXP);
187
+    rcpp_result_gen = Rcpp::wrap(int_gdns_get_root_servers(gctx));
188
+    return rcpp_result_gen;
189
+END_RCPP
190
+}
180 191
 // check_is_xptr
181 192
 void check_is_xptr(SEXP s);
182 193
 RcppExport SEXP _clandnstine_check_is_xptr(SEXP sSEXP) {
@@ -274,6 +285,7 @@ static const R_CallMethodDef CallEntries[] = {
274 285
     {"_clandnstine_gdns_get_tls_ca_file", (DL_FUNC) &_clandnstine_gdns_get_tls_ca_file, 1},
275 286
     {"_clandnstine_gdns_set_tls_ca_path", (DL_FUNC) &_clandnstine_gdns_set_tls_ca_path, 2},
276 287
     {"_clandnstine_gdns_set_tls_ca_file", (DL_FUNC) &_clandnstine_gdns_set_tls_ca_file, 2},
288
+    {"_clandnstine_int_gdns_get_root_servers", (DL_FUNC) &_clandnstine_int_gdns_get_root_servers, 1},
277 289
     {"_clandnstine_check_is_xptr", (DL_FUNC) &_clandnstine_check_is_xptr, 1},
278 290
     {"_clandnstine_is_null_xptr_", (DL_FUNC) &_clandnstine_is_null_xptr_, 1},
279 291
     {"_clandnstine_int_gdns_context", (DL_FUNC) &_clandnstine_int_gdns_context, 1},

+ 51
- 0
src/clandnstine-main.cpp View File

@@ -7,6 +7,7 @@ using namespace Rcpp;
7 7
 extern void check_is_xptr(SEXP s);
8 8
 //' Return gdns library version
9 9
 //'
10
+//' @family utlity functions
10 11
 //' @export
11 12
 // [[Rcpp::export]]
12 13
 std::string gdns_lib_version() {
@@ -48,6 +49,7 @@ SEXP int_gdns_update_resolvers(SEXP gctx, std::vector< std::string > resolvers)
48 49
 //'
49 50
 //' @param gctx gdns resolver context created with [gdns_resolver()]
50 51
 //' @param timeout number of milliseconds (integer; i.e. not-fractional)
52
+//' @family context functions
51 53
 //' @export
52 54
 // [[Rcpp::export]]
53 55
 SEXP gdns_set_timeout(SEXP gctx, long timeout) {
@@ -71,6 +73,7 @@ SEXP gdns_set_timeout(SEXP gctx, long timeout) {
71 73
 //' Retreive the number of milliseconds to wait for request to return
72 74
 //'
73 75
 //' @param gctx gdns resolver context created with [gdns_resolver()]
76
+//' @family context functions
74 77
 //' @export
75 78
 // [[Rcpp::export]]
76 79
 DoubleVector gdns_get_timeout(SEXP gctx) {
@@ -101,6 +104,7 @@ DoubleVector gdns_get_timeout(SEXP gctx) {
101 104
 //' @md
102 105
 //' @param gctx gdns resolver context created with [gdns_resolver()]
103 106
 //' @param flag if `TRUE` (the default) round robin queries when using more than one stub resolver,
107
+//' @family context functions
104 108
 //' @export
105 109
 // [[Rcpp::export]]
106 110
 SEXP gdns_set_round_robin_upstreams(SEXP gctx, bool flag=true) {
@@ -196,6 +200,7 @@ SEXP int_gdns_set_resolution_type(SEXP gctx, int res_type) {
196 200
 //' Retreive what transports are used for DNS lookups.
197 201
 //'
198 202
 //' @param gctx gdns resolver context created with [gdns_resolver()]
203
+//' @family context functions
199 204
 //' @export
200 205
 // [[Rcpp::export]]
201 206
 CharacterVector gdns_get_transports(SEXP gctx) {
@@ -233,6 +238,7 @@ CharacterVector gdns_get_transports(SEXP gctx) {
233 238
 //' Retreive the value of the localnames namespace
234 239
 //'
235 240
 //' @param gctx gdns resolver context created with [gdns_resolver()]
241
+//' @family context functions
236 242
 //' @export
237 243
 // [[Rcpp::export]]
238 244
 CharacterVector gdns_get_hosts(SEXP gctx) {
@@ -257,6 +263,7 @@ CharacterVector gdns_get_hosts(SEXP gctx) {
257 263
 //' Retreive the value with which the context's upstream recursive servers and suffixes were initialized
258 264
 //'
259 265
 //' @param gctx gdns resolver context created with [gdns_resolver()]
266
+//' @family context functions
260 267
 //' @export
261 268
 // [[Rcpp::export]]
262 269
 CharacterVector gdns_get_resolvconf(SEXP gctx) {
@@ -281,6 +288,7 @@ CharacterVector gdns_get_resolvconf(SEXP gctx) {
281 288
 //' Retreive the value with which the context's upstream recursive servers and suffixes were initialized
282 289
 //'
283 290
 //' @param gctx gdns resolver context created with [gdns_resolver()]
291
+//' @family context functions
284 292
 //' @export
285 293
 // [[Rcpp::export]]
286 294
 StringVector gdns_get_tls_ca_path(SEXP gctx) {
@@ -305,6 +313,7 @@ StringVector gdns_get_tls_ca_path(SEXP gctx) {
305 313
 //' Retreive the file location with CA certificates for verification purposes
306 314
 //'
307 315
 //' @param gctx gdns resolver context created with [gdns_resolver()]
316
+//' @family context functions
308 317
 //' @export
309 318
 // [[Rcpp::export]]
310 319
 StringVector gdns_get_tls_ca_file(SEXP gctx) {
@@ -330,6 +339,7 @@ StringVector gdns_get_tls_ca_file(SEXP gctx) {
330 339
 //'
331 340
 //' @param gctx gdns resolver context created with [gdns_resolver()]
332 341
 //' @param ca_path directory with Certificate Authority certificates
342
+//' @family context functions
333 343
 //' @export
334 344
 // [[Rcpp::export]]
335 345
 SEXP gdns_set_tls_ca_path(SEXP gctx, std::string ca_path) {
@@ -354,6 +364,7 @@ SEXP gdns_set_tls_ca_path(SEXP gctx, std::string ca_path) {
354 364
 //'
355 365
 //' @param gctx gdns resolver context created with [gdns_resolver()]
356 366
 //' @param ca_file file with Certificate Authority certificates
367
+//' @family context functions
357 368
 //' @export
358 369
 // [[Rcpp::export]]
359 370
 SEXP gdns_set_tls_ca_file(SEXP gctx, std::string ca_file) {
@@ -373,3 +384,43 @@ SEXP gdns_set_tls_ca_file(SEXP gctx, std::string ca_file) {
373 384
   return(gctx);
374 385
 
375 386
 }
387
+
388
+//' Retrieve the list of addresses in use for looking up top-level domains in use by the context.
389
+//'
390
+//' @param gctx gdns resolver context created with [gdns_resolver()]
391
+//' @keywords internal
392
+// [[Rcpp::export]]
393
+CharacterVector int_gdns_get_root_servers(SEXP gctx) {
394
+
395
+  check_is_xptr(gctx);
396
+
397
+  getdns_context *ctxt = (getdns_context *)R_ExternalPtrAddr(gctx);
398
+
399
+  if (gctx == NULL) return(R_NilValue);
400
+
401
+  getdns_return_t r;
402
+  getdns_list *addresses;
403
+
404
+  if ((r = getdns_context_get_dns_root_servers(ctxt, &addresses))) {
405
+    Rf_error(getdns_get_errorstr_by_id(r));
406
+  }
407
+
408
+  if (addresses) {
409
+    Rcout << "HERE" << std::endl;
410
+    char *lst = getdns_print_json_list(addresses, 0);
411
+    if (lst) {
412
+      Rcout << lst << std::endl;
413
+      std::string out = std::string(lst);
414
+      free(lst);
415
+      free(addresses);
416
+      return(wrap(out));
417
+    } else {
418
+      free(addresses);
419
+      return(CharacterVector());
420
+    }
421
+  } else {
422
+    return(CharacterVector());
423
+  }
424
+
425
+
426
+}

+ 2
- 0
src/resolver.cpp View File

@@ -77,6 +77,7 @@ SEXP int_gdns_context(std::vector< std::string > resolvers) {
77 77
 //'
78 78
 //' @param gctx gdns resolver context created with [gdns_resolver()]
79 79
 //' @param host to lookup
80
+//' @family query functions
80 81
 //' @export
81 82
 //' @examples
82 83
 //' x <- gdns_resolver()
@@ -251,6 +252,7 @@ CharacterVector int_gdns_query(SEXP gctx, std::string name, uint16_t rr,
251 252
 //'
252 253
 //' @param gctx gdns resolver context created with [gdns_resolver()]
253 254
 //' @export
255
+//' @family context functions
254 256
 //' @examples
255 257
 //' x <- gdns_context()
256 258
 //' gdns_get_resolution_type(x)

Loading…
Cancel
Save