pdns  4.5.1
About: PowerDNS daemon - a high performance authoritative nameserver.
  Fossies Dox: pdns-4.5.1.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

UeberBackend Class Reference

This is a very magic backend that allows us to load modules dynamically, and query them in order. More...

#include <ueberbackend.hh>

Inheritance diagram for UeberBackend:
[legend]
Collaboration diagram for UeberBackend:
[legend]

Classes

class  handle
 the very magic handle for UeberBackend questions More...
 
struct  Question
 

Public Member Functions

 UeberBackend (const string &pname="default")
  More...
 
 ~UeberBackend ()
  More...
 
bool superMasterBackend (const string &ip, const DNSName &domain, const vector< DNSResourceRecord > &nsset, string *nameserver, string *account, DNSBackend **db)
  More...
 
bool superMasterAdd (const string &ip, const string &nameserver, const string &account)
  More...
 
void cleanup ()
  More...
 
void lookup (const QType &, const DNSName &qdomain, int zoneId, DNSPacket *pkt_p=nullptr)
  More...
 
bool getAuth (const DNSName &target, const QType &qtype, SOAData *sd, bool cachedOk=true)
 Determines if we are authoritative for a zone, and at what level. More...
 
bool getSOAUncached (const DNSName &domain, SOAData &sd)
 Load SOA info from backends, ignoring the cache. More...
 
bool get (DNSZoneRecord &r)
  More...
 
void getAllDomains (vector< DomainInfo > *domains, bool include_disabled=false)
  More...
 
void getUnfreshSlaveInfos (vector< DomainInfo > *domains)
  More...
 
void getUpdatedMasters (vector< DomainInfo > *domains)
  More...
 
bool getDomainInfo (const DNSName &domain, DomainInfo &di, bool getSerial=true)
  More...
 
bool createDomain (const DNSName &domain, const DomainInfo::DomainKind kind, const vector< ComboAddress > &masters, const string &account)
  More...
 
bool doesDNSSEC ()
  More...
 
bool addDomainKey (const DNSName &name, const DNSBackend::KeyData &key, int64_t &id)
  More...
 
bool getDomainKeys (const DNSName &name, std::vector< DNSBackend::KeyData > &keys)
  More...
 
bool getAllDomainMetadata (const DNSName &name, std::map< std::string, std::vector< std::string > > &meta)
  More...
 
bool getDomainMetadata (const DNSName &name, const std::string &kind, std::vector< std::string > &meta)
  More...
 
bool setDomainMetadata (const DNSName &name, const std::string &kind, const std::vector< std::string > &meta)
  More...
 
bool removeDomainKey (const DNSName &name, unsigned int id)
  More...
 
bool activateDomainKey (const DNSName &name, unsigned int id)
  More...
 
bool deactivateDomainKey (const DNSName &name, unsigned int id)
  More...
 
bool publishDomainKey (const DNSName &name, unsigned int id)
  More...
 
bool unpublishDomainKey (const DNSName &name, unsigned int id)
  More...
 
bool getTSIGKey (const DNSName &name, DNSName *algorithm, string *content)
  More...
 
bool setTSIGKey (const DNSName &name, const DNSName &algorithm, const string &content)
  More...
 
bool deleteTSIGKey (const DNSName &name)
  More...
 
bool getTSIGKeys (std::vector< struct TSIGKey > &keys)
  More...
 
void alsoNotifies (const DNSName &domain, set< string > *ips)
  More...
 
void rediscover (string *status=0)
  More...
 
void reload ()
  More...
 
bool searchRecords (const string &pattern, int maxResults, vector< DNSResourceRecord > &result)
  More...
 
bool searchComments (const string &pattern, int maxResults, vector< Comment > &result)
  More...
 
void updateZoneCache ()
  More...
 
bool inTransaction ()
  More...
 

Static Public Member Functions

static bool loadmodule (const string &name)
 Loads a module and reports it to all UeberBackend threads. More...
 
static bool loadModules (const vector< string > &modules, const string &path)
  More...
 
static void go (void)
  More...
 

Public Attributes

vector< DNSBackend * > backends
 This contains all registered backends. More...
 

Static Public Attributes

static vector< UeberBackend * > instances
 Tracks all created UeberBackend instances for us. More...
 
static std::mutex instances_lock
  More...
 

Private Member Functions

int cacheHas (const Question &q, vector< DNSZoneRecord > &rrs)
  More...
 
void addNegCache (const Question &q)
  More...
 
void addCache (const Question &q, vector< DNSZoneRecord > &&rrs)
  More...
 

Private Attributes

handle d_handle
  More...
 
vector< DNSZoneRecordd_answers
  More...
 
vector< DNSZoneRecord >::const_iterator d_cachehandleiter
  More...
 
struct UeberBackend::Question d_question
  More...
 
unsigned int d_cache_ttl
  More...
 
unsigned int d_negcache_ttl
  More...
 
uint16_t d_qtype
  More...
 
bool d_negcached
  More...
 
bool d_cached
  More...
 
bool d_stale
  More...
 

Static Private Attributes

static std::mutex d_mut
  More...
 
static std::condition_variable d_cond
  More...
 
static AtomicCounters_backendQueries = nullptr
  More...
 
static bool d_go =false
  More...
 
static bool s_doANYLookupsOnly =false
  More...
 

Detailed Description

This is a very magic backend that allows us to load modules dynamically, and query them in order.

This is persistent over all UeberBackend instantiations across multiple threads.

The UeberBackend is transparent for exceptions, which should fall straight through.

Definition at line 43 of file ueberbackend.hh.

Member Data Documentation

◆ backends

◆ d_answers

vector<DNSZoneRecord> UeberBackend::d_answers
private

Definition at line 140 of file ueberbackend.hh.

Referenced by get(), getAuth(), and lookup().

◆ d_cache_ttl

unsigned int UeberBackend::d_cache_ttl
private

Definition at line 153 of file ueberbackend.hh.

Referenced by addCache(), cacheHas(), getAuth(), getSOAUncached(), and UeberBackend().

◆ d_cached

bool UeberBackend::d_cached
private

Definition at line 157 of file ueberbackend.hh.

Referenced by get(), lookup(), and UeberBackend().

◆ d_cachehandleiter

vector<DNSZoneRecord>::const_iterator UeberBackend::d_cachehandleiter
private

Definition at line 141 of file ueberbackend.hh.

Referenced by get(), and lookup().

◆ d_cond

std::condition_variable UeberBackend::d_cond
staticprivate

Definition at line 144 of file ueberbackend.hh.

Referenced by go(), and lookup().

◆ d_go

bool UeberBackend::d_go =false
staticprivate

Definition at line 159 of file ueberbackend.hh.

Referenced by go(), and lookup().

◆ d_handle

handle UeberBackend::d_handle
private

Definition at line 139 of file ueberbackend.hh.

Referenced by get(), and lookup().

◆ d_mut

std::mutex UeberBackend::d_mut
staticprivate

Definition at line 143 of file ueberbackend.hh.

Referenced by go(), and lookup().

◆ d_negcache_ttl

unsigned int UeberBackend::d_negcache_ttl
private

Definition at line 153 of file ueberbackend.hh.

Referenced by addNegCache(), cacheHas(), getAuth(), getSOAUncached(), and UeberBackend().

◆ d_negcached

bool UeberBackend::d_negcached
private

Definition at line 156 of file ueberbackend.hh.

Referenced by get(), lookup(), and UeberBackend().

◆ d_qtype

uint16_t UeberBackend::d_qtype
private

Definition at line 154 of file ueberbackend.hh.

Referenced by get(), lookup(), and UeberBackend().

◆ d_question

struct UeberBackend::Question UeberBackend::d_question
private

Referenced by get(), getAuth(), getSOAUncached(), and lookup().

◆ d_stale

bool UeberBackend::d_stale
private

Definition at line 160 of file ueberbackend.hh.

Referenced by lookup(), and UeberBackend().

◆ instances

vector< UeberBackend * > UeberBackend::instances
static

Tracks all created UeberBackend instances for us.

We use this vector to notify existing threads of new modules

Definition at line 56 of file ueberbackend.hh.

Referenced by cleanup(), UeberBackend(), and UeberBackend::handle::~handle().

◆ instances_lock

std::mutex UeberBackend::instances_lock
static

Definition at line 57 of file ueberbackend.hh.

Referenced by cleanup(), and UeberBackend().

◆ s_backendQueries

AtomicCounter * UeberBackend::s_backendQueries = nullptr
staticprivate

Definition at line 158 of file ueberbackend.hh.

Referenced by go().

◆ s_doANYLookupsOnly

bool UeberBackend::s_doANYLookupsOnly =false
staticprivate

Definition at line 161 of file ueberbackend.hh.

Referenced by go(), and lookup().


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