CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
dns::NormalResolver Class Reference

#include <dns.h>

Inheritance diagram for dns::NormalResolver:
Collaboration diagram for dns::NormalResolver:

Public Member Functions

virtual bool SetResolvers (const std::vector< std::string > &resolvers)
 
virtual bool SetSearchDomains (const std::vector< std::string > &domains)
 
virtual void SetSystemResolvers ()
 
virtual void SetSystemSearchDomains ()
 
virtual ~NormalResolver ()
 
- 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 NormalResolverCreate (const bool ipv4_only, const unsigned retries, const unsigned timeout_ms)
 

Protected Member Functions

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)
 
 NormalResolver ()
 
- Protected Member Functions inherited from dns::Resolver
bool IsIpv4Address (const std::string &address)
 
bool IsIpv6Address (const std::string &address)
 

Private Member Functions

 FRIEND_TEST (T_Dns, NormalResolverConstruct)
 

Private Attributes

CaresResolvercares_resolver_
 
HostfileResolverhostfile_resolver_
 

Additional Inherited Members

- Static Public Attributes inherited from dns::Resolver
static const unsigned kDefaultMinTtl = 60
 
static const unsigned kDefaultMaxTtl = 84600
 
- 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_
 

Detailed Description

The normal resolver combines Hostfile and C-ares resolver. First looks up host names in the host file. All non-matches are looked up by c-ares.

Definition at line 383 of file dns.h.

Constructor & Destructor Documentation

dns::NormalResolver::~NormalResolver ( )
virtual

Definition at line 1360 of file dns.cc.

dns::NormalResolver::NormalResolver ( )
protected

Definition at line 1352 of file dns.cc.

Referenced by Create().

Here is the caller graph for this function:

Member Function Documentation

NormalResolver * dns::NormalResolver::Create ( const bool  ipv4_only,
const unsigned  retries,
const unsigned  timeout_ms 
)
static

Creates hostfile and c-ares resolvers and uses c-ares resolvers search domains for the hostfile resolver.

Definition at line 1259 of file dns.cc.

Referenced by download::DownloadManager::Init(), and download::DownloadManager::SetDnsParameters().

Here is the call graph for this function:

Here is the caller graph for this function:

void dns::NormalResolver::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 
)
protectedvirtual

First pass done by the hostfile resolver, all successfully resolved names are skipped by the c-ares resolver.

Implements dns::Resolver.

Definition at line 1330 of file dns.cc.

Here is the call graph for this function:

dns::NormalResolver::FRIEND_TEST ( T_Dns  ,
NormalResolverConstruct   
)
private
bool dns::NormalResolver::SetResolvers ( const std::vector< std::string > &  resolvers)
virtual

Makes only sense for the c-ares resolver.

Implements dns::Resolver.

Definition at line 1290 of file dns.cc.

Here is the call graph for this function:

bool dns::NormalResolver::SetSearchDomains ( const std::vector< std::string > &  domains)
virtual

Set new search domains for both resolvers or for none.

Implements dns::Resolver.

Definition at line 1298 of file dns.cc.

Here is the call graph for this function:

void dns::NormalResolver::SetSystemResolvers ( )
virtual

Implements dns::Resolver.

Definition at line 1313 of file dns.cc.

Here is the call graph for this function:

void dns::NormalResolver::SetSystemSearchDomains ( )
virtual

Implements dns::Resolver.

Definition at line 1318 of file dns.cc.

Here is the call graph for this function:

Member Data Documentation

CaresResolver* dns::NormalResolver::cares_resolver_
private
HostfileResolver* dns::NormalResolver::hostfile_resolver_
private

Definition at line 408 of file dns.h.

Referenced by Create(), DoResolve(), SetSearchDomains(), SetSystemSearchDomains(), and ~NormalResolver().


The documentation for this class was generated from the following files: