* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-
-#ifndef PDNS_BINDBACKEND_HH
-#define PDNS_BINDBACKEND_HH
-
+#pragma once
#include <string>
#include <map>
#include <set>
return ret;
}
+ size_t getEntriesCount() const
+ {
+ std::lock_guard<std::mutex> lock(s_lock);
+ return d_records->size();
+ }
+
private:
static std::mutex s_lock;
shared_ptr<T> d_records;
bool current();
//! configure how often this domain should be checked for changes (on disk)
void setCheckInterval(time_t seconds);
+ time_t getCheckInterval() const
+ {
+ return d_checkinterval;
+ }
DNSName d_name; //!< actual name of the domain
DomainInfo::DomainKind d_kind; //!< the kind of domain
void getAllDomains(vector<DomainInfo> *domains, bool include_disabled=false) override;
static DNSBackend *maker();
- static pthread_mutex_t s_startup_lock;
+ static std::mutex s_startup_lock;
void setFresh(uint32_t domain_id) override;
void setNotified(uint32_t id, uint32_t serial) override;
bool addDomainKey(const DNSName& name, const KeyData& key, int64_t& id) override;
bool activateDomainKey(const DNSName& name, unsigned int id) override;
bool deactivateDomainKey(const DNSName& name, unsigned int id) override;
+ bool publishDomainKey(const DNSName& name, unsigned int id) override;
+ bool unpublishDomainKey(const DNSName& name, unsigned int id) override;
bool getTSIGKey(const DNSName& name, DNSName* algorithm, string* content) override;
bool setTSIGKey(const DNSName& name, const DNSName& algorithm, const string& content) override;
bool deleteTSIGKey(const DNSName& name) override;
ordered_unique<tag<NameTag>, member<BB2DomainInfo, DNSName, &BB2DomainInfo::d_name> >
> > state_t;
static state_t s_state;
- static pthread_rwlock_t s_state_lock;
+ static ReadWriteLock s_state_lock;
void parseZoneFile(BB2DomainInfo *bbd);
void rediscover(string *status=nullptr) override;
// for supermaster support
bool superMasterBackend(const string &ip, const DNSName &domain, const vector<DNSResourceRecord>&nsset, string *nameserver, string *account, DNSBackend **db) override;
- static pthread_mutex_t s_supermaster_config_lock;
+ static std::mutex s_supermaster_config_lock;
bool createSlaveDomain(const string &ip, const DNSName &domain, const string &nameserver, const string &account) override;
private:
unique_ptr<SSqlStatement> d_GetLastInsertedKeyIdQuery_stmt;
unique_ptr<SSqlStatement> d_activateDomainKeyQuery_stmt;
unique_ptr<SSqlStatement> d_deactivateDomainKeyQuery_stmt;
+ unique_ptr<SSqlStatement> d_publishDomainKeyQuery_stmt;
+ unique_ptr<SSqlStatement> d_unpublishDomainKeyQuery_stmt;
unique_ptr<SSqlStatement> d_getTSIGKeyQuery_stmt;
unique_ptr<SSqlStatement> d_setTSIGKeyQuery_stmt;
unique_ptr<SSqlStatement> d_deleteTSIGKeyQuery_stmt;
static void insertRecord(std::shared_ptr<recordstorage_t>& records, const DNSName& zoneName, const DNSName &qname, const QType &qtype, const string &content, int ttl, const std::string& hashed=string(), bool *auth=nullptr);
void reload() override;
static string DLDomStatusHandler(const vector<string>&parts, Utility::pid_t ppid);
+ static string DLDomExtendedStatusHandler(const vector<string>&parts, Utility::pid_t ppid);
static string DLListRejectsHandler(const vector<string>&parts, Utility::pid_t ppid);
static string DLReloadNowHandler(const vector<string>&parts, Utility::pid_t ppid);
static string DLAddDomainHandler(const vector<string>&parts, Utility::pid_t ppid);
static void doEmptyNonTerminals(std::shared_ptr<recordstorage_t>& records, const DNSName& zoneName, bool nsec3zone, NSEC3PARAMRecordContent ns3pr);
void loadConfig(string *status=nullptr);
};
-
-#endif /* PDNS_BINDBACKEND_HH */