![]() |
CernVM-FS
2.13.0
|
#include <dns.h>
Classes | |
struct | HostEntry |
Public Member Functions | |
virtual | ~HostfileResolver () |
virtual bool | SetResolvers (const std::vector< std::string > &) |
virtual bool | SetSearchDomains (const std::vector< std::string > &domains) |
virtual void | SetSystemResolvers () |
virtual void | SetSystemSearchDomains () |
![]() | |
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 HostfileResolver * | Create (const std::string &path, bool ipv4_only) |
Protected Member Functions | |
HostfileResolver (const bool ipv4_only) | |
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) |
![]() | |
bool | IsIpv4Address (const std::string &address) |
bool | IsIpv6Address (const std::string &address) |
Private Member Functions | |
void | ParseHostFile () |
Private Attributes | |
std::map< std::string, HostEntry > | host_map_ |
FILE * | fhosts_ |
Static Private Attributes | |
static const int | kIpMaxLength = 45 |
static const int | kHostnameMaxLength = 253 |
Friends | |
class | NormalResolver |
Additional Inherited Members | |
![]() | |
static const unsigned | kDefaultMinTtl = 60 |
static const unsigned | kDefaultMaxTtl = 86400 |
![]() | |
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_ |
Resolves against static name information like in /etc/hosts. Setting resolver addresses is a no-op for this resolver. Search domains are not automatically found but need to be set. Not the most efficient implementation but in the context of cvmfs should be called at most every 5 minutes.
|
explicitprotected |
|
static |
Opens a file descriptor to the host file that stays open until destruction. If no path is given, the HOST_ALIASES environment variable is evaluated followed by /etc/hosts.
Definition at line 1051 of file dns.cc.
Referenced by dns::NormalResolver::Create().
|
protectedvirtual |
Creates a fresh reverse lookup map
Implements dns::Resolver.
Definition at line 1094 of file dns.cc.
Referenced by dns::NormalResolver::DoResolve().
|
private |
TODO: this should be only necessary when the modification timestamp changed.
Definition at line 1162 of file dns.cc.
Referenced by DoResolve().
|
inlinevirtual |
A list of new resolvers in the form <IP address>="">[:port].
Implements dns::Resolver.
|
virtual |
Implements dns::Resolver.
Definition at line 1250 of file dns.cc.
Referenced by dns::NormalResolver::Create(), dns::NormalResolver::SetSearchDomains(), and dns::NormalResolver::SetSystemSearchDomains().
|
inlinevirtual |
Implements dns::Resolver.
|
virtual |
Implements dns::Resolver.
|
friend |
|
private |
Open the file descriptor when the resolver is constructed and only release on destruction. Thereby we can be relatively sure to not see I/O errors once constructed.
Definition at line 375 of file dns.h.
Referenced by Create(), ParseHostFile(), and ~HostfileResolver().
|
private |
Host names to lists of IPv4 and IPv6 addresses. Reverse lookup in the hosts file.
Definition at line 368 of file dns.h.
Referenced by DoResolve(), and ParseHostFile().
|
staticprivate |
Definition at line 362 of file dns.h.
Referenced by ParseHostFile().
|
staticprivate |
Definition at line 361 of file dns.h.
Referenced by ParseHostFile().