boB Rudis 5 yıl önce
ebeveyn
işleme
400455af55
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: 1D7529BE14E2BBA9
  1. 1
      NAMESPACE
  2. 21
      R/RcppExports.R
  3. 20
      R/resolver.R
  4. 1
      R/set-res-types.R
  5. 5
      man/gdns_context.Rd
  6. 5
      man/gdns_get_address.Rd
  7. 17
      man/gdns_get_hosts.Rd
  8. 17
      man/gdns_get_resolution_type.Rd
  9. 17
      man/gdns_get_resolvconf.Rd
  10. 31
      man/gdns_get_root_servers.Rd
  11. 17
      man/gdns_get_timeout.Rd
  12. 17
      man/gdns_get_tls_ca_file.Rd
  13. 17
      man/gdns_get_tls_ca_path.Rd
  14. 17
      man/gdns_get_transports.Rd
  15. 1
      man/gdns_lib_version.Rd
  16. 5
      man/gdns_query.Rd
  17. 19
      man/gdns_set_hosts.Rd
  18. 17
      man/gdns_set_resolution_type.Rd
  19. 17
      man/gdns_set_round_robin_upstreams.Rd
  20. 17
      man/gdns_set_timeout.Rd
  21. 17
      man/gdns_set_tls_ca_file.Rd
  22. 17
      man/gdns_set_tls_ca_path.Rd
  23. 19
      man/gdns_update_resolvers.Rd
  24. 15
      man/int_gdns_get_root_servers.Rd
  25. 12
      src/RcppExports.cpp
  26. 51
      src/clandnstine-main.cpp
  27. 2
      src/resolver.cpp

1
NAMESPACE

@ -8,6 +8,7 @@ export(gdns_get_address)
export(gdns_get_hosts)
export(gdns_get_resolution_type)
export(gdns_get_resolvconf)
export(gdns_get_root_servers)
export(gdns_get_timeout)
export(gdns_get_tls_ca_file)
export(gdns_get_tls_ca_path)

21
R/RcppExports.R

@ -3,6 +3,7 @@
#' Return gdns library version
#'
#' @family utlity functions
#' @export
gdns_lib_version <- function() {
.Call(`_clandnstine_gdns_lib_version`)
@ -18,6 +19,7 @@ int_gdns_update_resolvers <- function(gctx, resolvers) {
#'
#' @param gctx gdns resolver context created with [gdns_resolver()]
#' @param timeout number of milliseconds (integer; i.e. not-fractional)
#' @family context functions
#' @export
gdns_set_timeout <- function(gctx, timeout) {
.Call(`_clandnstine_gdns_set_timeout`, gctx, timeout)
@ -26,6 +28,7 @@ gdns_set_timeout <- function(gctx, timeout) {
#' Retreive the number of milliseconds to wait for request to return
#'
#' @param gctx gdns resolver context created with [gdns_resolver()]
#' @family context functions
#' @export
gdns_get_timeout <- function(gctx) {
.Call(`_clandnstine_gdns_get_timeout`, gctx)
@ -37,6 +40,7 @@ gdns_get_timeout <- function(gctx) {
#' @md
#' @param gctx gdns resolver context created with [gdns_resolver()]
#' @param flag if `TRUE` (the default) round robin queries when using more than one stub resolver,
#' @family context functions
#' @export
gdns_set_round_robin_upstreams <- function(gctx, flag = TRUE) {
.Call(`_clandnstine_gdns_set_round_robin_upstreams`, gctx, flag)
@ -63,6 +67,7 @@ int_gdns_set_resolution_type <- function(gctx, res_type) {
#' Retreive what transports are used for DNS lookups.
#'
#' @param gctx gdns resolver context created with [gdns_resolver()]
#' @family context functions
#' @export
gdns_get_transports <- function(gctx) {
.Call(`_clandnstine_gdns_get_transports`, gctx)
@ -71,6 +76,7 @@ gdns_get_transports <- function(gctx) {
#' Retreive the value of the localnames namespace
#'
#' @param gctx gdns resolver context created with [gdns_resolver()]
#' @family context functions
#' @export
gdns_get_hosts <- function(gctx) {
.Call(`_clandnstine_gdns_get_hosts`, gctx)
@ -79,6 +85,7 @@ gdns_get_hosts <- function(gctx) {
#' Retreive the value with which the context's upstream recursive servers and suffixes were initialized
#'
#' @param gctx gdns resolver context created with [gdns_resolver()]
#' @family context functions
#' @export
gdns_get_resolvconf <- function(gctx) {
.Call(`_clandnstine_gdns_get_resolvconf`, gctx)
@ -87,6 +94,7 @@ gdns_get_resolvconf <- function(gctx) {
#' Retreive the value with which the context's upstream recursive servers and suffixes were initialized
#'
#' @param gctx gdns resolver context created with [gdns_resolver()]
#' @family context functions
#' @export
gdns_get_tls_ca_path <- function(gctx) {
.Call(`_clandnstine_gdns_get_tls_ca_path`, gctx)
@ -95,6 +103,7 @@ gdns_get_tls_ca_path <- function(gctx) {
#' Retreive the file location with CA certificates for verification purposes
#'
#' @param gctx gdns resolver context created with [gdns_resolver()]
#' @family context functions
#' @export
gdns_get_tls_ca_file <- function(gctx) {
.Call(`_clandnstine_gdns_get_tls_ca_file`, gctx)
@ -104,6 +113,7 @@ gdns_get_tls_ca_file <- function(gctx) {
#'
#' @param gctx gdns resolver context created with [gdns_resolver()]
#' @param ca_path directory with Certificate Authority certificates
#' @family context functions
#' @export
gdns_set_tls_ca_path <- function(gctx, ca_path) {
.Call(`_clandnstine_gdns_set_tls_ca_path`, gctx, ca_path)
@ -113,11 +123,20 @@ gdns_set_tls_ca_path <- function(gctx, ca_path) {
#'
#' @param gctx gdns resolver context created with [gdns_resolver()]
#' @param ca_file file with Certificate Authority certificates
#' @family context functions
#' @export
gdns_set_tls_ca_file <- function(gctx, ca_file) {
.Call(`_clandnstine_gdns_set_tls_ca_file`, gctx, ca_file)
}
#' Retrieve the list of addresses in use for looking up top-level domains in use by the context.
#'
#' @param gctx gdns resolver context created with [gdns_resolver()]
#' @keywords internal
int_gdns_get_root_servers <- function(gctx) {
.Call(`_clandnstine_int_gdns_get_root_servers`, gctx)
}
#' Test whether an object is an external pointer
#'
#' @param x object to test
@ -144,6 +163,7 @@ int_gdns_context <- function(resolvers) {
#'
#' @param gctx gdns resolver context created with [gdns_resolver()]
#' @param host to lookup
#' @family query functions
#' @export
#' @examples
#' x <- gdns_resolver()
@ -165,6 +185,7 @@ int_gdns_query <- function(gctx, name, rr, include_reporting = FALSE) {
#'
#' @param gctx gdns resolver context created with [gdns_resolver()]
#' @export
#' @family context functions
#' @examples
#' x <- gdns_context()
#' gdns_get_resolution_type(x)

20
R/resolver.R

@ -6,6 +6,7 @@
#' @param resolvers character vector of valid DNS over TLS resolvers;
#' Defaults to Quad9 (`9.9.9.9`).
#' @export
#' @family query functions
#' @examples
#' x <- gdns_context()
#' x <- gdns_context("1.1.1.1")
@ -19,10 +20,11 @@ gdns_context <- function(resolvers = "9.9.9.9") {
#' maintains a list of DNS over TLS servers.
#' @param gctx gdns resolver context created with [gdns_resolver()]
#' @param resolvers character vector of valid DNS over TLS resolvers
#' @family context functions
#' @export
#' @examples
#' x <- gdns_context()
#' x <- gdns_update_resolvers("1.1.1.1")
#' x <- gdns_update_resolvers(x, "1.1.1.1")
gdns_update_resolvers<- function(gctx, resolvers) {
int_gdns_update_resolvers(gctx, resolvers)
}
@ -33,9 +35,10 @@ gdns_update_resolvers<- function(gctx, resolvers) {
#' @param hosts_file path to a valid `hosts` file (e.g. "`/etc/hosts`). This value
#' will be [path.expand()]ed.
#' @export
#' @family context functions
#' @examples
#' x <- gdns_context()
#' x <- gdns_set_hosts(x, "/etc/hosts")
#' gdns_set_hosts(x, "/etc/hosts")
gdns_set_hosts<- function(gctx, hosts_file) {
hosts_file <- path.expand(hosts_file[1])
stopifnot(file.exists(hosts_file))
@ -43,6 +46,18 @@ gdns_set_hosts<- function(gctx, hosts_file) {
}
#' Retrieve the list of addresses in use for looking up top-level domains in use by the context.
#'
#' @param gctx gdns resolver context created with [gdns_resolver()]
#' @export
#' @family context functions
# x <- gdns_context()
# gdns_get_root_servers(x)
gdns_get_root_servers <- function(gctx) {
x <- int_gdns_get_root_servers(gctx);
if (length(x)) jsonlite::fromJSON(x) else NULL
}
#' Arbitrary DNS queries
#'
#' Perform any valid resource record inquiry for a given name. See `Details`.
@ -148,6 +163,7 @@ gdns_set_hosts<- function(gctx, hosts_file) {
#' @param include_reporting if `TRUE` include debugging information for queries
#' such as the length of time it takes for each query. Default: `FALSE`
#' @references <https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml>
#' @family query functions
#' @export
#' @examples
#' x <- gdns_resolver()

1
R/set-res-types.R

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

5
man/gdns_context.Rd

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

5
man/gdns_get_address.Rd

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

17
man/gdns_get_hosts.Rd

@ -12,3 +12,20 @@ gdns_get_hosts(gctx)
\description{
Retreive the value of the localnames namespace
}
\seealso{
Other context functions: \code{\link{gdns_get_resolution_type}},
\code{\link{gdns_get_resolvconf}},
\code{\link{gdns_get_root_servers}},
\code{\link{gdns_get_timeout}},
\code{\link{gdns_get_tls_ca_file}},
\code{\link{gdns_get_tls_ca_path}},
\code{\link{gdns_get_transports}},
\code{\link{gdns_set_hosts}},
\code{\link{gdns_set_resolution_type}},
\code{\link{gdns_set_round_robin_upstreams}},
\code{\link{gdns_set_timeout}},
\code{\link{gdns_set_tls_ca_file}},
\code{\link{gdns_set_tls_ca_path}},
\code{\link{gdns_update_resolvers}}
}
\concept{context functions}

17
man/gdns_get_resolution_type.Rd

@ -16,3 +16,20 @@ Get the current resolution type setting
x <- gdns_context()
gdns_get_resolution_type(x)
}
\seealso{
Other context functions: \code{\link{gdns_get_hosts}},
\code{\link{gdns_get_resolvconf}},
\code{\link{gdns_get_root_servers}},
\code{\link{gdns_get_timeout}},
\code{\link{gdns_get_tls_ca_file}},
\code{\link{gdns_get_tls_ca_path}},
\code{\link{gdns_get_transports}},
\code{\link{gdns_set_hosts}},
\code{\link{gdns_set_resolution_type}},
\code{\link{gdns_set_round_robin_upstreams}},
\code{\link{gdns_set_timeout}},
\code{\link{gdns_set_tls_ca_file}},
\code{\link{gdns_set_tls_ca_path}},
\code{\link{gdns_update_resolvers}}
}
\concept{context functions}

17
man/gdns_get_resolvconf.Rd

@ -12,3 +12,20 @@ gdns_get_resolvconf(gctx)
\description{
Retreive the value with which the context's upstream recursive servers and suffixes were initialized
}
\seealso{
Other context functions: \code{\link{gdns_get_hosts}},
\code{\link{gdns_get_resolution_type}},
\code{\link{gdns_get_root_servers}},
\code{\link{gdns_get_timeout}},
\code{\link{gdns_get_tls_ca_file}},
\code{\link{gdns_get_tls_ca_path}},
\code{\link{gdns_get_transports}},
\code{\link{gdns_set_hosts}},
\code{\link{gdns_set_resolution_type}},
\code{\link{gdns_set_round_robin_upstreams}},
\code{\link{gdns_set_timeout}},
\code{\link{gdns_set_tls_ca_file}},
\code{\link{gdns_set_tls_ca_path}},
\code{\link{gdns_update_resolvers}}
}
\concept{context functions}

31
man/gdns_get_root_servers.Rd

@ -0,0 +1,31 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/resolver.R
\name{gdns_get_root_servers}
\alias{gdns_get_root_servers}
\title{Retrieve the list of addresses in use for looking up top-level domains in use by the context.}
\usage{
gdns_get_root_servers(gctx)
}
\arguments{
\item{gctx}{gdns resolver context created with \code{\link[=gdns_resolver]{gdns_resolver()}}}
}
\description{
Retrieve the list of addresses in use for looking up top-level domains in use by the context.
}
\seealso{
Other context functions: \code{\link{gdns_get_hosts}},
\code{\link{gdns_get_resolution_type}},
\code{\link{gdns_get_resolvconf}},
\code{\link{gdns_get_timeout}},
\code{\link{gdns_get_tls_ca_file}},
\code{\link{gdns_get_tls_ca_path}},
\code{\link{gdns_get_transports}},
\code{\link{gdns_set_hosts}},
\code{\link{gdns_set_resolution_type}},
\code{\link{gdns_set_round_robin_upstreams}},
\code{\link{gdns_set_timeout}},
\code{\link{gdns_set_tls_ca_file}},
\code{\link{gdns_set_tls_ca_path}},
\code{\link{gdns_update_resolvers}}
}
\concept{context functions}

17
man/gdns_get_timeout.Rd

@ -12,3 +12,20 @@ gdns_get_timeout(gctx)
\description{
Retreive the number of milliseconds to wait for request to return
}
\seealso{
Other context functions: \code{\link{gdns_get_hosts}},
\code{\link{gdns_get_resolution_type}},
\code{\link{gdns_get_resolvconf}},
\code{\link{gdns_get_root_servers}},
\code{\link{gdns_get_tls_ca_file}},
\code{\link{gdns_get_tls_ca_path}},
\code{\link{gdns_get_transports}},
\code{\link{gdns_set_hosts}},
\code{\link{gdns_set_resolution_type}},
\code{\link{gdns_set_round_robin_upstreams}},
\code{\link{gdns_set_timeout}},
\code{\link{gdns_set_tls_ca_file}},
\code{\link{gdns_set_tls_ca_path}},
\code{\link{gdns_update_resolvers}}
}
\concept{context functions}

17
man/gdns_get_tls_ca_file.Rd

@ -12,3 +12,20 @@ gdns_get_tls_ca_file(gctx)
\description{
Retreive the file location with CA certificates for verification purposes
}
\seealso{
Other context functions: \code{\link{gdns_get_hosts}},
\code{\link{gdns_get_resolution_type}},
\code{\link{gdns_get_resolvconf}},
\code{\link{gdns_get_root_servers}},
\code{\link{gdns_get_timeout}},
\code{\link{gdns_get_tls_ca_path}},
\code{\link{gdns_get_transports}},
\code{\link{gdns_set_hosts}},
\code{\link{gdns_set_resolution_type}},
\code{\link{gdns_set_round_robin_upstreams}},
\code{\link{gdns_set_timeout}},
\code{\link{gdns_set_tls_ca_file}},
\code{\link{gdns_set_tls_ca_path}},
\code{\link{gdns_update_resolvers}}
}
\concept{context functions}

17
man/gdns_get_tls_ca_path.Rd

@ -12,3 +12,20 @@ gdns_get_tls_ca_path(gctx)
\description{
Retreive the value with which the context's upstream recursive servers and suffixes were initialized
}
\seealso{
Other context functions: \code{\link{gdns_get_hosts}},
\code{\link{gdns_get_resolution_type}},
\code{\link{gdns_get_resolvconf}},
\code{\link{gdns_get_root_servers}},
\code{\link{gdns_get_timeout}},
\code{\link{gdns_get_tls_ca_file}},
\code{\link{gdns_get_transports}},
\code{\link{gdns_set_hosts}},
\code{\link{gdns_set_resolution_type}},
\code{\link{gdns_set_round_robin_upstreams}},
\code{\link{gdns_set_timeout}},
\code{\link{gdns_set_tls_ca_file}},
\code{\link{gdns_set_tls_ca_path}},
\code{\link{gdns_update_resolvers}}
}
\concept{context functions}

17
man/gdns_get_transports.Rd

@ -12,3 +12,20 @@ gdns_get_transports(gctx)
\description{
Retreive what transports are used for DNS lookups.
}
\seealso{
Other context functions: \code{\link{gdns_get_hosts}},
\code{\link{gdns_get_resolution_type}},
\code{\link{gdns_get_resolvconf}},
\code{\link{gdns_get_root_servers}},
\code{\link{gdns_get_timeout}},
\code{\link{gdns_get_tls_ca_file}},
\code{\link{gdns_get_tls_ca_path}},
\code{\link{gdns_set_hosts}},
\code{\link{gdns_set_resolution_type}},
\code{\link{gdns_set_round_robin_upstreams}},
\code{\link{gdns_set_timeout}},
\code{\link{gdns_set_tls_ca_file}},
\code{\link{gdns_set_tls_ca_path}},
\code{\link{gdns_update_resolvers}}
}
\concept{context functions}

1
man/gdns_lib_version.Rd

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

5
man/gdns_query.Rd

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

19
man/gdns_set_hosts.Rd

@ -17,5 +17,22 @@ Initialized the context's local names namespace with values from the given hosts
}
\examples{
x <- gdns_context()
x <- gdns_set_hosts(x, "/etc/hosts")
gdns_set_hosts(x, "/etc/hosts")
}
\seealso{
Other context functions: \code{\link{gdns_get_hosts}},
\code{\link{gdns_get_resolution_type}},
\code{\link{gdns_get_resolvconf}},
\code{\link{gdns_get_root_servers}},
\code{\link{gdns_get_timeout}},
\code{\link{gdns_get_tls_ca_file}},
\code{\link{gdns_get_tls_ca_path}},
\code{\link{gdns_get_transports}},
\code{\link{gdns_set_resolution_type}},
\code{\link{gdns_set_round_robin_upstreams}},
\code{\link{gdns_set_timeout}},
\code{\link{gdns_set_tls_ca_file}},
\code{\link{gdns_set_tls_ca_path}},
\code{\link{gdns_update_resolvers}}
}
\concept{context functions}

17
man/gdns_set_resolution_type.Rd

@ -18,3 +18,20 @@ Specify whether DNS queries are performed with recursive lookups or as a stub re
x <- gdns_context()
x <- gdns_set_resolution_type(x, "stub")
}
\seealso{
Other context functions: \code{\link{gdns_get_hosts}},
\code{\link{gdns_get_resolution_type}},
\code{\link{gdns_get_resolvconf}},
\code{\link{gdns_get_root_servers}},
\code{\link{gdns_get_timeout}},
\code{\link{gdns_get_tls_ca_file}},
\code{\link{gdns_get_tls_ca_path}},
\code{\link{gdns_get_transports}},
\code{\link{gdns_set_hosts}},
\code{\link{gdns_set_round_robin_upstreams}},
\code{\link{gdns_set_timeout}},
\code{\link{gdns_set_tls_ca_file}},
\code{\link{gdns_set_tls_ca_path}},
\code{\link{gdns_update_resolvers}}
}
\concept{context functions}

17
man/gdns_set_round_robin_upstreams.Rd

@ -16,3 +16,20 @@ gdns_set_round_robin_upstreams(gctx, flag = TRUE)
Set/unset context to round robin queries over the available upstreams
when resolving with the stub resolution type.
}
\seealso{
Other context functions: \code{\link{gdns_get_hosts}},
\code{\link{gdns_get_resolution_type}},
\code{\link{gdns_get_resolvconf}},
\code{\link{gdns_get_root_servers}},
\code{\link{gdns_get_timeout}},
\code{\link{gdns_get_tls_ca_file}},
\code{\link{gdns_get_tls_ca_path}},
\code{\link{gdns_get_transports}},
\code{\link{gdns_set_hosts}},
\code{\link{gdns_set_resolution_type}},
\code{\link{gdns_set_timeout}},
\code{\link{gdns_set_tls_ca_file}},
\code{\link{gdns_set_tls_ca_path}},
\code{\link{gdns_update_resolvers}}
}
\concept{context functions}

17
man/gdns_set_timeout.Rd

@ -14,3 +14,20 @@ gdns_set_timeout(gctx, timeout)
\description{
Specify the number of milliseconds to wait for request to return
}
\seealso{
Other context functions: \code{\link{gdns_get_hosts}},
\code{\link{gdns_get_resolution_type}},
\code{\link{gdns_get_resolvconf}},
\code{\link{gdns_get_root_servers}},
\code{\link{gdns_get_timeout}},
\code{\link{gdns_get_tls_ca_file}},
\code{\link{gdns_get_tls_ca_path}},
\code{\link{gdns_get_transports}},
\code{\link{gdns_set_hosts}},
\code{\link{gdns_set_resolution_type}},
\code{\link{gdns_set_round_robin_upstreams}},
\code{\link{gdns_set_tls_ca_file}},
\code{\link{gdns_set_tls_ca_path}},
\code{\link{gdns_update_resolvers}}
}
\concept{context functions}

17
man/gdns_set_tls_ca_file.Rd

@ -14,3 +14,20 @@ gdns_set_tls_ca_file(gctx, ca_file)
\description{
Specify the file with CA certificates for verification purposes
}
\seealso{
Other context functions: \code{\link{gdns_get_hosts}},
\code{\link{gdns_get_resolution_type}},
\code{\link{gdns_get_resolvconf}},
\code{\link{gdns_get_root_servers}},
\code{\link{gdns_get_timeout}},
\code{\link{gdns_get_tls_ca_file}},
\code{\link{gdns_get_tls_ca_path}},
\code{\link{gdns_get_transports}},
\code{\link{gdns_set_hosts}},
\code{\link{gdns_set_resolution_type}},
\code{\link{gdns_set_round_robin_upstreams}},
\code{\link{gdns_set_timeout}},
\code{\link{gdns_set_tls_ca_path}},
\code{\link{gdns_update_resolvers}}
}
\concept{context functions}

17
man/gdns_set_tls_ca_path.Rd

@ -14,3 +14,20 @@ gdns_set_tls_ca_path(gctx, ca_path)
\description{
Specify where the location for CA certificates for verification purposes are located
}
\seealso{
Other context functions: \code{\link{gdns_get_hosts}},
\code{\link{gdns_get_resolution_type}},
\code{\link{gdns_get_resolvconf}},
\code{\link{gdns_get_root_servers}},
\code{\link{gdns_get_timeout}},
\code{\link{gdns_get_tls_ca_file}},
\code{\link{gdns_get_tls_ca_path}},
\code{\link{gdns_get_transports}},
\code{\link{gdns_set_hosts}},
\code{\link{gdns_set_resolution_type}},
\code{\link{gdns_set_round_robin_upstreams}},
\code{\link{gdns_set_timeout}},
\code{\link{gdns_set_tls_ca_file}},
\code{\link{gdns_update_resolvers}}
}
\concept{context functions}

19
man/gdns_update_resolvers.Rd

@ -20,5 +20,22 @@ maintains a list of DNS over TLS servers.
}
\examples{
x <- gdns_context()
x <- gdns_update_resolvers("1.1.1.1")
x <- gdns_update_resolvers(x, "1.1.1.1")
}
\seealso{
Other context functions: \code{\link{gdns_get_hosts}},
\code{\link{gdns_get_resolution_type}},
\code{\link{gdns_get_resolvconf}},
\code{\link{gdns_get_root_servers}},
\code{\link{gdns_get_timeout}},
\code{\link{gdns_get_tls_ca_file}},
\code{\link{gdns_get_tls_ca_path}},
\code{\link{gdns_get_transports}},
\code{\link{gdns_set_hosts}},
\code{\link{gdns_set_resolution_type}},
\code{\link{gdns_set_round_robin_upstreams}},
\code{\link{gdns_set_timeout}},
\code{\link{gdns_set_tls_ca_file}},
\code{\link{gdns_set_tls_ca_path}}
}
\concept{context functions}

15
man/int_gdns_get_root_servers.Rd

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

12
src/RcppExports.cpp

@ -177,6 +177,17 @@ BEGIN_RCPP
return rcpp_result_gen;
END_RCPP
}
// int_gdns_get_root_servers
CharacterVector int_gdns_get_root_servers(SEXP gctx);
RcppExport SEXP _clandnstine_int_gdns_get_root_servers(SEXP gctxSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< SEXP >::type gctx(gctxSEXP);
rcpp_result_gen = Rcpp::wrap(int_gdns_get_root_servers(gctx));
return rcpp_result_gen;
END_RCPP
}
// check_is_xptr
void check_is_xptr(SEXP s);
RcppExport SEXP _clandnstine_check_is_xptr(SEXP sSEXP) {
@ -274,6 +285,7 @@ static const R_CallMethodDef CallEntries[] = {
{"_clandnstine_gdns_get_tls_ca_file", (DL_FUNC) &_clandnstine_gdns_get_tls_ca_file, 1},
{"_clandnstine_gdns_set_tls_ca_path", (DL_FUNC) &_clandnstine_gdns_set_tls_ca_path, 2},
{"_clandnstine_gdns_set_tls_ca_file", (DL_FUNC) &_clandnstine_gdns_set_tls_ca_file, 2},
{"_clandnstine_int_gdns_get_root_servers", (DL_FUNC) &_clandnstine_int_gdns_get_root_servers, 1},
{"_clandnstine_check_is_xptr", (DL_FUNC) &_clandnstine_check_is_xptr, 1},
{"_clandnstine_is_null_xptr_", (DL_FUNC) &_clandnstine_is_null_xptr_, 1},
{"_clandnstine_int_gdns_context", (DL_FUNC) &_clandnstine_int_gdns_context, 1},

51
src/clandnstine-main.cpp

@ -7,6 +7,7 @@ using namespace Rcpp;
extern void check_is_xptr(SEXP s);
//' Return gdns library version
//'
//' @family utlity functions
//' @export
// [[Rcpp::export]]
std::string gdns_lib_version() {
@ -48,6 +49,7 @@ SEXP int_gdns_update_resolvers(SEXP gctx, std::vector< std::string > resolvers)
//'
//' @param gctx gdns resolver context created with [gdns_resolver()]
//' @param timeout number of milliseconds (integer; i.e. not-fractional)
//' @family context functions
//' @export
// [[Rcpp::export]]
SEXP gdns_set_timeout(SEXP gctx, long timeout) {
@ -71,6 +73,7 @@ SEXP gdns_set_timeout(SEXP gctx, long timeout) {
//' Retreive the number of milliseconds to wait for request to return
//'
//' @param gctx gdns resolver context created with [gdns_resolver()]
//' @family context functions
//' @export
// [[Rcpp::export]]
DoubleVector gdns_get_timeout(SEXP gctx) {
@ -101,6 +104,7 @@ DoubleVector gdns_get_timeout(SEXP gctx) {
//' @md
//' @param gctx gdns resolver context created with [gdns_resolver()]
//' @param flag if `TRUE` (the default) round robin queries when using more than one stub resolver,
//' @family context functions
//' @export
// [[Rcpp::export]]
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) {
//' Retreive what transports are used for DNS lookups.
//'
//' @param gctx gdns resolver context created with [gdns_resolver()]
//' @family context functions
//' @export
// [[Rcpp::export]]
CharacterVector gdns_get_transports(SEXP gctx) {
@ -233,6 +238,7 @@ CharacterVector gdns_get_transports(SEXP gctx) {
//' Retreive the value of the localnames namespace
//'
//' @param gctx gdns resolver context created with [gdns_resolver()]
//' @family context functions
//' @export
// [[Rcpp::export]]
CharacterVector gdns_get_hosts(SEXP gctx) {
@ -257,6 +263,7 @@ CharacterVector gdns_get_hosts(SEXP gctx) {
//' Retreive the value with which the context's upstream recursive servers and suffixes were initialized
//'
//' @param gctx gdns resolver context created with [gdns_resolver()]
//' @family context functions
//' @export
// [[Rcpp::export]]
CharacterVector gdns_get_resolvconf(SEXP gctx) {
@ -281,6 +288,7 @@ CharacterVector gdns_get_resolvconf(SEXP gctx) {
//' Retreive the value with which the context's upstream recursive servers and suffixes were initialized
//'
//' @param gctx gdns resolver context created with [gdns_resolver()]
//' @family context functions
//' @export
// [[Rcpp::export]]
StringVector gdns_get_tls_ca_path(SEXP gctx) {
@ -305,6 +313,7 @@ StringVector gdns_get_tls_ca_path(SEXP gctx) {
//' Retreive the file location with CA certificates for verification purposes
//'
//' @param gctx gdns resolver context created with [gdns_resolver()]
//' @family context functions
//' @export
// [[Rcpp::export]]
StringVector gdns_get_tls_ca_file(SEXP gctx) {
@ -330,6 +339,7 @@ StringVector gdns_get_tls_ca_file(SEXP gctx) {
//'
//' @param gctx gdns resolver context created with [gdns_resolver()]
//' @param ca_path directory with Certificate Authority certificates
//' @family context functions
//' @export
// [[Rcpp::export]]
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) {
//'
//' @param gctx gdns resolver context created with [gdns_resolver()]
//' @param ca_file file with Certificate Authority certificates
//' @family context functions
//' @export
// [[Rcpp::export]]
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) {
return(gctx);
}
//' Retrieve the list of addresses in use for looking up top-level domains in use by the context.
//'
//' @param gctx gdns resolver context created with [gdns_resolver()]
//' @keywords internal
// [[Rcpp::export]]
CharacterVector int_gdns_get_root_servers(SEXP gctx) {
check_is_xptr(gctx);
getdns_context *ctxt = (getdns_context *)R_ExternalPtrAddr(gctx);
if (gctx == NULL) return(R_NilValue);
getdns_return_t r;
getdns_list *addresses;
if ((r = getdns_context_get_dns_root_servers(ctxt, &addresses))) {
Rf_error(getdns_get_errorstr_by_id(r));
}
if (addresses) {
Rcout << "HERE" << std::endl;
char *lst = getdns_print_json_list(addresses, 0);
if (lst) {
Rcout << lst << std::endl;
std::string out = std::string(lst);
free(lst);
free(addresses);
return(wrap(out));
} else {
free(addresses);
return(CharacterVector());
}
} else {
return(CharacterVector());
}
}

2
src/resolver.cpp

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

Yükleniyor…
İptal
Kaydet