OpenVPN
|
Go to the source code of this file.
Data Structures | |
struct | dns_domain |
struct | dns_server_addr |
struct | dns_server |
struct | dns_options |
Enumerations | |
enum | dns_security { DNS_SECURITY_UNSET, DNS_SECURITY_NO, DNS_SECURITY_YES, DNS_SECURITY_OPTIONAL } |
enum | dns_server_transport { DNS_TRANSPORT_UNSET, DNS_TRANSPORT_PLAIN, DNS_TRANSPORT_HTTPS, DNS_TRANSPORT_TLS } |
Functions | |
bool | dns_server_priority_parse (long *priority, const char *str, bool pulled) |
Parses a string DNS server priority and validates it. More... | |
struct dns_server * | dns_server_get (struct dns_server **entry, long priority, struct gc_arena *gc) |
Find or create DNS server with priority in a linked list. More... | |
void | dns_domain_list_append (struct dns_domain **entry, char **domains, struct gc_arena *gc) |
Appends DNS domain parameters to a linked list. More... | |
bool | dns_server_addr_parse (struct dns_server *server, const char *addr) |
Parses a string IPv4 or IPv6 address and optional colon separated port, into a in_addr or in6_addr respectively plus a in_port_t port. More... | |
bool | dns_options_verify (int msglevel, const struct dns_options *o) |
Checks validity of DNS options. More... | |
struct dns_options | clone_dns_options (const struct dns_options o, struct gc_arena *gc) |
Makes a deep copy of the passed DNS options. More... | |
void | dns_options_preprocess_pull (struct dns_options *o) |
Saves and resets the server options, so that pulled ones don't mix in. More... | |
void | dns_options_postprocess_pull (struct dns_options *o) |
Merges pulled DNS servers with static ones into an ordered list. More... | |
void | setenv_dns_options (const struct dns_options *o, struct env_set *es) |
Puts the DNS options into an environment set. More... | |
void | show_dns_options (const struct dns_options *o) |
Prints configured DNS options. More... | |
enum dns_security |
enum dns_server_transport |
struct dns_options clone_dns_options | ( | const struct dns_options | o, |
struct gc_arena * | gc | ||
) |
Makes a deep copy of the passed DNS options.
o | Pointer to the DNS options to clone |
gc | Pointer to the gc_arena to use for the clone |
Definition at line 251 of file dns.c.
References clone_dns_domains(), clone_dns_servers(), dns_options::gc, dns_options::search_domains, dns_options::servers, and dns_options::servers_prepull.
Referenced by pre_connect_restore(), and pre_connect_save().
void dns_domain_list_append | ( | struct dns_domain ** | entry, |
char ** | domains, | ||
struct gc_arena * | gc | ||
) |
Appends DNS domain parameters to a linked list.
entry | Address of the first list entry pointer |
domains | Address of the first domain parameter |
gc | The gc the new list items should be allocated in |
Definition at line 141 of file dns.c.
References ALLOC_OBJ_CLEAR_GC, dns_domain::name, and dns_domain::next.
Referenced by add_option().
void dns_options_postprocess_pull | ( | struct dns_options * | o | ) |
Merges pulled DNS servers with static ones into an ordered list.
o | Pointer to the DNS options to modify |
Definition at line 269 of file dns.c.
References dns_server::next, dns_server::priority, dns_options::servers, and dns_options::servers_prepull.
Referenced by options_postprocess_pull().
void dns_options_preprocess_pull | ( | struct dns_options * | o | ) |
Saves and resets the server options, so that pulled ones don't mix in.
o | Pointer to the DNS options to modify |
Definition at line 262 of file dns.c.
References dns_options::servers, and dns_options::servers_prepull.
Referenced by options_postprocess_mutate().
bool dns_options_verify | ( | int | msglevel, |
const struct dns_options * | o | ||
) |
Checks validity of DNS options.
msglevel | The message level to log errors with |
o | Pointer to the DNS options to validate |
Definition at line 197 of file dns.c.
References dns_server::addr_count, msg, dns_server::next, dns_server::priority, dns_options::servers, and dns_options::servers_prepull.
Referenced by options_postprocess_pull(), and options_postprocess_verify().
bool dns_server_addr_parse | ( | struct dns_server * | server, |
const char * | addr | ||
) |
Parses a string IPv4 or IPv6 address and optional colon separated port, into a in_addr or in6_addr respectively plus a in_port_t port.
server | Pointer to DNS server the address is parsed for |
addr | Address as string |
Definition at line 55 of file dns.c.
References dns_server_addr::a4, dns_server_addr::a6, dns_server::addr, dns_server::addr_count, dns_server_port_parse(), dns_server_addr::family, dns_server_addr::in, openvpn_getaddrinfo(), dns_server_addr::port, and SIZE.
Referenced by add_option().
struct dns_server* dns_server_get | ( | struct dns_server ** | entry, |
long | priority, | ||
struct gc_arena * | gc | ||
) |
Find or create DNS server with priority in a linked list.
The list is ordered by priority.
entry | Address of the first list entry pointer |
priority | Priority of the DNS server to find / create |
gc | The gc new list items should be allocated in |
Definition at line 175 of file dns.c.
References ALLOC_OBJ_CLEAR_GC, dns_server::next, and dns_server::priority.
Referenced by add_option().
bool dns_server_priority_parse | ( | long * | priority, |
const char * | str, | ||
bool | pulled | ||
) |
Parses a string DNS server priority and validates it.
priority | Pointer to where the priority should be stored |
str | Priority string to parse |
pulled | Whether this was pulled from a server |
Definition at line 160 of file dns.c.
Referenced by add_option().
void setenv_dns_options | ( | const struct dns_options * | o, |
struct env_set * | es | ||
) |
Puts the DNS options into an environment set.
o | Pointer to the DNS options to set |
es | Pointer to the env_set to set the options into |
Definition at line 368 of file dns.c.
References dns_server_addr::a4, dns_server_addr::a6, dns_server::addr, dns_server::addr_count, dns_server::dnssec, dnssec_value(), dns_server::domains, es, dns_server_addr::family, gc_free(), gc_new(), dns_server_addr::in, dns_domain::name, dns_domain::next, dns_server::next, dns_server_addr::port, print_in6_addr(), print_in_addr_t(), print_in_port_t(), dns_options::search_domains, dns_options::servers, setenv_dns_option(), dns_server::sni, dns_server::transport, and transport_value().
Referenced by options_postprocess_pull(), and setenv_settings().
void show_dns_options | ( | const struct dns_options * | o | ) |
Prints configured DNS options.
o | Pointer to the DNS options to print |
Definition at line 430 of file dns.c.
References dns_server_addr::a4, dns_server_addr::a6, dns_server::addr, dns_server::addr_count, D_SHOW_PARMS, dns_server::dnssec, dnssec_value(), dns_server::domains, dns_server_addr::family, gc_free(), gc_new(), dns_server_addr::in, msg, dns_domain::name, dns_domain::next, dns_server::next, dns_server_addr::port, print_in6_addr(), print_in_addr_t(), print_in_port_t(), dns_options::search_domains, dns_options::servers, dns_options::servers_prepull, dns_server::sni, dns_server::transport, and transport_value().
Referenced by show_settings().