CernVM-FS
2.12.0
|
#include <dns.h>
Public Member Functions | |
virtual | ~CaresResolver () |
virtual bool | SetResolvers (const std::vector< std::string > &resolvers) |
virtual bool | SetSearchDomains (const std::vector< std::string > &domains) |
virtual void | SetSystemResolvers () |
virtual void | SetSystemSearchDomains () |
Public Member Functions inherited from dns::Resolver | |
Resolver (const bool ipv4_only, const unsigned retries, const unsigned timeout_ms) | |
virtual | ~Resolver () |
Host | Resolve (const std::string &name) |
void | ResolveMany (const std::vector< std::string > &names, std::vector< Host > *hosts) |
const std::vector< std::string > & | domains () const |
bool | ipv4_only () const |
const std::vector< std::string > & | resolvers () const |
unsigned | retries () const |
unsigned | timeout_ms () const |
void | set_throttle (const unsigned throttle) |
unsigned | throttle () const |
void | set_min_ttl (unsigned seconds) |
unsigned | min_ttl () const |
void | set_max_ttl (unsigned seconds) |
unsigned | max_ttl () const |
Static Public Member Functions | |
static CaresResolver * | Create (const bool ipv4_only, const unsigned retries, const unsigned timeout_ms) |
Static Public Attributes | |
static const unsigned | kMaxAddresses = 16 |
Static Public Attributes inherited from dns::Resolver | |
static const unsigned | kDefaultMinTtl = 60 |
static const unsigned | kDefaultMaxTtl = 86400 |
Protected Member Functions | |
CaresResolver (const bool ipv4_only, const unsigned retries, const unsigned timeout_ms) | |
virtual void | DoResolve (const std::vector< std::string > &names, const std::vector< bool > &skip, std::vector< std::vector< std::string > > *ipv4_addresses, std::vector< std::vector< std::string > > *ipv6_addresses, std::vector< Failures > *failures, std::vector< unsigned > *ttls, std::vector< std::string > *fqdns) |
Protected Member Functions inherited from dns::Resolver | |
bool | IsIpv4Address (const std::string &address) |
bool | IsIpv6Address (const std::string &address) |
Private Member Functions | |
void | WaitOnCares () |
Private Attributes | |
ares_channel * | channel_ |
char * | lookup_options_ |
std::vector< std::string > | system_resolvers_ |
std::vector< std::string > | system_domains_ |
Friends | |
class | NormalResolver |
Additional Inherited Members | |
Protected Attributes inherited from dns::Resolver | |
std::vector< std::string > | domains_ |
bool | ipv4_only_ |
std::vector< std::string > | resolvers_ |
unsigned | retries_ |
unsigned | timeout_ms_ |
unsigned | throttle_ |
unsigned | min_ttl_ |
unsigned | max_ttl_ |
Prng | prng_ |
Implementation of the Resolver interface using the c-ares library.
|
protected |
|
static |
Returns a CaresResolver readily initialized, or NULL if an error occurs.
Definition at line 743 of file dns.cc.
Referenced by dns::NormalResolver::Create(), and s3fanout::S3FanoutManager::S3FanoutManager().
|
protectedvirtual |
Pushes all the DNS queries into the c-ares channel and waits for the results on the file descriptors.
Implements dns::Resolver.
Definition at line 840 of file dns.cc.
Referenced by dns::NormalResolver::DoResolve().
|
virtual |
A list of new resolvers in the form <IP address>="">[:port].
Implements dns::Resolver.
Definition at line 917 of file dns.cc.
Referenced by dns::NormalResolver::SetResolvers(), and SetSystemResolvers().
|
virtual |
Changes the options of the active channel. This is hacky and deals with c-ares internal data structures because there is no way to do it via public APIs.
Implements dns::Resolver.
Definition at line 933 of file dns.cc.
Referenced by dns::NormalResolver::SetSearchDomains(), and SetSystemSearchDomains().
|
virtual |
Implements dns::Resolver.
Definition at line 975 of file dns.cc.
Referenced by dns::NormalResolver::SetSystemResolvers().
|
virtual |
Implements dns::Resolver.
Definition at line 981 of file dns.cc.
Referenced by dns::NormalResolver::SetSystemSearchDomains().
|
private |
Polls on c-ares sockets and triggers call-backs execution. Might be necessary to call this repeatadly.
Definition at line 991 of file dns.cc.
Referenced by DoResolve().
|
friend |
|
private |
Definition at line 319 of file dns.h.
Referenced by Create(), DoResolve(), SetResolvers(), SetSearchDomains(), WaitOnCares(), and ~CaresResolver().
|
static |
More IP addresses for a single name will be ignored. Due to c-ares exponential backoff, the number of retries should be limited to 2. That results in 2 apptempts with the given timeout and a third one with the timeout doubled.
Definition at line 293 of file dns.h.
Referenced by dns::CaresExtractIpv4(), and dns::CaresExtractIpv6().
|
private |
Definition at line 320 of file dns.h.
Referenced by Create(), and ~CaresResolver().
|
private |
Definition at line 322 of file dns.h.
Referenced by Create(), and SetSystemSearchDomains().
|
private |
Definition at line 321 of file dns.h.
Referenced by Create(), and SetSystemResolvers().