You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
768 B
25 lines
768 B
5 years ago
|
.transport_trans <- c("tls" = 1202L, "tcp" = 1201L, "udp" = 1200L)
|
||
|
|
||
|
#' Specifies what transport(s) is/ar used for DNS lookups
|
||
|
#'
|
||
|
#' @param gctx gdns resolver context created with [gdns_resolver()]
|
||
|
#' @param transports character vector of any/all of "`udp`", "`tcp`" or "`tls`".
|
||
|
#' Order matters as it specifies that the library will use to try to
|
||
|
#' perform the lookups.
|
||
|
#' @export
|
||
|
#' @examples
|
||
|
#' x <- gdns_context()
|
||
|
#' x <- gdns_set_transports(x, "tls")
|
||
|
gdns_set_transports <- function(gctx, transports = c("tls", "udp", "tcp")) {
|
||
|
|
||
|
match.arg(
|
||
|
unique(tolower(trimws(transports))), c("tls", "udp", "tcp"),
|
||
|
several.ok = TRUE
|
||
|
) -> transports
|
||
|
|
||
|
transports <- unname(.transport_trans[transports])
|
||
|
|
||
|
int_gdns_set_transports(gctx, transports)
|
||
|
|
||
|
}
|