]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Appease clang-tidy.
authorMiod Vallat <miod.vallat@powerdns.com>
Fri, 11 Apr 2025 09:29:05 +0000 (11:29 +0200)
committerMiod Vallat <miod.vallat@powerdns.com>
Fri, 11 Apr 2025 13:29:27 +0000 (15:29 +0200)
33 files changed:
modules/bindbackend/bindbackend2.cc
modules/bindbackend/bindbackend2.hh
modules/bindbackend/binddnssec.cc
modules/geoipbackend/geoipbackend.cc
modules/geoipbackend/geoipbackend.hh
modules/ldapbackend/ldapbackend.hh
modules/ldapbackend/native.cc
modules/ldapbackend/primary.cc
modules/lmdbbackend/lmdbbackend.cc
modules/lmdbbackend/lmdbbackend.hh
modules/pipebackend/pipebackend.cc
modules/remotebackend/remotebackend.cc
modules/remotebackend/remotebackend.hh
pdns/auth-primarycommunicator.cc
pdns/auth-secondarycommunicator.cc
pdns/backends/gsql/gsqlbackend.cc
pdns/backends/gsql/gsqlbackend.hh
pdns/communicator.hh
pdns/dbdnsseckeeper.cc
pdns/dnsbackend.cc
pdns/dnssecinfra.hh
pdns/dnsseckeeper.hh
pdns/dnssecsigner.cc
pdns/dynhandler.cc
pdns/ixfrutils.cc
pdns/ixfrutils.hh
pdns/ixplore.cc
pdns/pdnsutil.cc
pdns/serialtweaker.cc
pdns/test-communicator_hh.cc
pdns/test-ueberbackend_cc.cc
pdns/test-zonemd_cc.cc
pdns/test-zoneparser_tng_cc.cc

index 7caf87b500b5447bf16a3b50d3b0ec62036dcc80..77525b7aa7395d61202d0b0b1d490293fe891916 100644 (file)
@@ -202,21 +202,21 @@ void Bind2Backend::setFresh(uint32_t domain_id)
   setLastCheck(domain_id, time(nullptr));
 }
 
-bool Bind2Backend::startTransaction(const ZoneName& qname, int id)
+bool Bind2Backend::startTransaction(const ZoneName& qname, int domainId)
 {
-  if (id < 0) {
+  if (domainId < 0) {
     d_transaction_tmpname.clear();
-    d_transaction_id = id;
+    d_transaction_id = domainId;
     return false;
   }
-  if (id == 0) {
+  if (domainId == 0) {
     throw DBException("domain_id 0 is invalid for this backend.");
   }
 
-  d_transaction_id = id;
+  d_transaction_id = domainId;
   d_transaction_qname = qname;
   BB2DomainInfo bbd;
-  if (safeGetBBDomainInfo(id, &bbd)) {
+  if (safeGetBBDomainInfo(domainId, &bbd)) {
     d_transaction_tmpname = bbd.d_filename + "XXXXXX";
     int fd = mkstemp(&d_transaction_tmpname.at(0));
     if (fd == -1) {
@@ -436,26 +436,26 @@ void Bind2Backend::getUnfreshSecondaryInfos(vector<DomainInfo>* unfreshDomains)
   }
 }
 
-bool Bind2Backend::getDomainInfo(const ZoneName& domain, DomainInfo& di, bool getSerial)
+bool Bind2Backend::getDomainInfo(const ZoneName& domain, DomainInfo& info, bool getSerial)
 {
   BB2DomainInfo bbd;
   if (!safeGetBBDomainInfo(domain, &bbd))
     return false;
 
-  di.id = bbd.d_id;
-  di.zone = domain;
-  di.primaries = bbd.d_primaries;
-  di.last_check = bbd.d_lastcheck;
-  di.backend = this;
-  di.kind = bbd.d_kind;
-  di.serial = 0;
+  info.id = bbd.d_id;
+  info.zone = domain;
+  info.primaries = bbd.d_primaries;
+  info.last_check = bbd.d_lastcheck;
+  info.backend = this;
+  info.kind = bbd.d_kind;
+  info.serial = 0;
   if (getSerial) {
     try {
       SOAData sd;
       sd.serial = 0;
 
       getSOA(bbd.d_name, sd); // we might not *have* a SOA yet
-      di.serial = sd.serial;
+      info.serial = sd.serial;
     }
     catch (...) {
     }
@@ -525,7 +525,7 @@ void Bind2Backend::parseZoneFile(BB2DomainInfo* bbd)
 
 /** THIS IS AN INTERNAL FUNCTION! It does moadnsparser prio impedance matching
     Much of the complication is due to the efforts to benefit from std::string reference counting copy on write semantics */
-void Bind2Backend::insertRecord(std::shared_ptr<recordstorage_t>& records, const ZoneName& zoneName, const DNSName& qname, const QType& qtype, const string& content, int ttl, const std::string& hashed, bool* auth)
+void Bind2Backend::insertRecord(std::shared_ptr<recordstorage_t>& records, const ZoneName& zoneName, const DNSName& qname, const QType& qtype, const string& content, int ttl, const std::string& hashed, const bool* auth)
 {
   Bind2DNSRecord bdr;
   bdr.qname = qname;
@@ -1291,15 +1291,15 @@ bool Bind2Backend::handle::get_normal(DNSResourceRecord& r)
   return true;
 }
 
-bool Bind2Backend::list(const ZoneName& /* target */, int id, bool /* include_disabled */)
+bool Bind2Backend::list(const ZoneName& /* target */, int domainId, bool /* include_disabled */)
 {
   BB2DomainInfo bbd;
 
-  if (!safeGetBBDomainInfo(id, &bbd))
+  if (!safeGetBBDomainInfo(domainId, &bbd))
     return false;
 
   d_handle.reset();
-  DLOG(g_log << "Bind2Backend constructing handle for list of " << id << endl);
+  DLOG(g_log << "Bind2Backend constructing handle for list of " << domainId << endl);
 
   if (!bbd.d_loaded) {
     throw PDNSException("zone was not loaded, perhaps because of: " + bbd.d_status);
@@ -1309,7 +1309,7 @@ bool Bind2Backend::list(const ZoneName& /* target */, int id, bool /* include_di
   d_handle.d_qname_iter = d_handle.d_records->begin();
   d_handle.d_qname_end = d_handle.d_records->end(); // iter now points to a vector of pointers to vector<BBResourceRecords>
 
-  d_handle.id = id;
+  d_handle.id = domainId;
   d_handle.domain = bbd.d_name;
   d_handle.d_list = true;
   return true;
@@ -1355,7 +1355,7 @@ bool Bind2Backend::autoPrimariesList(std::vector<AutoPrimary>& primaries)
   return true;
 }
 
-bool Bind2Backend::autoPrimaryBackend(const string& ip, const ZoneName& /* domain */, const vector<DNSResourceRecord>& /* nsset */, string* /* nameserver */, string* account, DNSBackend** db)
+bool Bind2Backend::autoPrimaryBackend(const string& ipAddress, const ZoneName& /* domain */, const vector<DNSResourceRecord>& /* nsset */, string* /* nameserver */, string* account, DNSBackend** backend)
 {
   // Check whether we have a configfile available.
   if (getArg("autoprimary-config").empty())
@@ -1373,18 +1373,18 @@ bool Bind2Backend::autoPrimaryBackend(const string& ip, const ZoneName& /* domai
   while (getline(c_if, line)) {
     std::istringstream ii(line);
     ii >> sip;
-    if (sip == ip) {
+    if (sip == ipAddress) {
       ii >> saccount;
       break;
     }
   }
   c_if.close();
 
-  if (sip != ip) // ip not found in authorization list - reject
+  if (sip != ipAddress) // ip not found in authorization list - reject
     return false;
 
   // ip authorized as autoprimary - accept
-  *db = this;
+  *backend = this;
   if (saccount.length() > 0)
     *account = saccount.c_str();
 
@@ -1414,13 +1414,13 @@ BB2DomainInfo Bind2Backend::createDomainEntry(const ZoneName& domain, const stri
   return bbd;
 }
 
-bool Bind2Backend::createSecondaryDomain(const string& ip, const ZoneName& domain, const string& /* nameserver */, const string& account)
+bool Bind2Backend::createSecondaryDomain(const string& ipAddress, const ZoneName& domain, const string& /* nameserver */, const string& account)
 {
   string filename = getArg("autoprimary-destdir") + '/' + domain.toStringNoDot();
 
   g_log << Logger::Warning << d_logprefix
         << " Writing bind config zone statement for superslave zone '" << domain
-        << "' from autoprimary " << ip << endl;
+        << "' from autoprimary " << ipAddress << endl;
 
   {
     std::lock_guard<std::mutex> l2(s_autosecondary_config_lock);
@@ -1436,14 +1436,14 @@ bool Bind2Backend::createSecondaryDomain(const string& ip, const ZoneName& domai
     c_of << "zone \"" << domain.toStringNoDot() << "\" {" << endl;
     c_of << "\ttype secondary;" << endl;
     c_of << "\tfile \"" << filename << "\";" << endl;
-    c_of << "\tprimaries { " << ip << "; };" << endl;
+    c_of << "\tprimaries { " << ipAddress << "; };" << endl;
     c_of << "};" << endl;
     c_of.close();
   }
 
   BB2DomainInfo bbd = createDomainEntry(domain, filename);
   bbd.d_kind = DomainInfo::Secondary;
-  bbd.d_primaries.push_back(ComboAddress(ip, 53));
+  bbd.d_primaries.push_back(ComboAddress(ipAddress, 53));
   bbd.setCtime();
   safePutBBDomainInfo(bbd);
 
index 8b0adb2d8cb227929b1ba63f877f0382f31ff3a5..f4ba903d1b663d38c1e65d11d90cba2d6561a905 100644 (file)
@@ -184,12 +184,12 @@ public:
   unsigned int getCapabilities() override;
   void getUnfreshSecondaryInfos(vector<DomainInfo>* unfreshDomains) override;
   void getUpdatedPrimaries(vector<DomainInfo>& changedDomains, std::unordered_set<DNSName>& catalogs, CatalogHashMap& catalogHashes) override;
-  bool getDomainInfo(const ZoneName& domain, DomainInfo& di, bool getSerial = true) override;
+  bool getDomainInfo(const ZoneName& domain, DomainInfo& info, bool getSerial = true) override;
   time_t getCtime(const string& fname);
   // DNSSEC
   bool getBeforeAndAfterNamesAbsolute(uint32_t id, const DNSName& qname, DNSName& unhashed, DNSName& before, DNSName& after) override;
   void lookup(const QType&, const DNSName& qdomain, int zoneId, DNSPacket* p = nullptr) override;
-  bool list(const ZoneName& target, int id, bool include_disabled = false) override;
+  bool list(const ZoneName& target, int domainId, bool include_disabled = false) override;
   bool get(DNSResourceRecord&) override;
   void getAllDomains(vector<DomainInfo>* domains, bool getSerial, bool include_disabled = false) override;
 
@@ -199,7 +199,7 @@ public:
   void setStale(uint32_t domain_id) override;
   void setFresh(uint32_t domain_id) override;
   void setNotified(uint32_t id, uint32_t serial) override;
-  bool startTransaction(const ZoneName& qname, int id) override;
+  bool startTransaction(const ZoneName& qname, int domainId) override;
   bool feedRecord(const DNSResourceRecord& rr, const DNSName& ordername, bool ordernameIsNSEC3 = false) override;
   bool commitTransaction() override;
   bool abortTransaction() override;
@@ -211,12 +211,12 @@ public:
   bool getDomainMetadata(const ZoneName& name, const std::string& kind, std::vector<std::string>& meta) override;
   bool setDomainMetadata(const ZoneName& name, const std::string& kind, const std::vector<std::string>& meta) override;
   bool getDomainKeys(const ZoneName& name, std::vector<KeyData>& keys) override;
-  bool removeDomainKey(const ZoneName& name, unsigned int id) override;
-  bool addDomainKey(const ZoneName& name, const KeyData& key, int64_t& id) override;
-  bool activateDomainKey(const ZoneName& name, unsigned int id) override;
-  bool deactivateDomainKey(const ZoneName& name, unsigned int id) override;
-  bool publishDomainKey(const ZoneName& name, unsigned int id) override;
-  bool unpublishDomainKey(const ZoneName& name, unsigned int id) override;
+  bool removeDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool addDomainKey(const ZoneName& name, const KeyData& key, int64_t& keyId) override;
+  bool activateDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool deactivateDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool publishDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool unpublishDomainKey(const ZoneName& name, unsigned int keyId) 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;
@@ -234,9 +234,9 @@ public:
 
   // for autoprimary support
   bool autoPrimariesList(std::vector<AutoPrimary>& primaries) override;
-  bool autoPrimaryBackend(const string& ip, const ZoneName& domain, const vector<DNSResourceRecord>& nsset, string* nameserver, string* account, DNSBackend** db) override;
+  bool autoPrimaryBackend(const string& ipAddress, const ZoneName& domain, const vector<DNSResourceRecord>& nsset, string* nameserver, string* account, DNSBackend** backend) override;
   static std::mutex s_autosecondary_config_lock;
-  bool createSecondaryDomain(const string& ip, const ZoneName& domain, const string& nameserver, const string& account) override;
+  bool createSecondaryDomain(const string& ipAddress, const ZoneName& domain, const string& nameserver, const string& account) override;
 
 private:
   void setupDNSSEC();
@@ -313,7 +313,7 @@ private:
 
   void queueReloadAndStore(unsigned int id);
   static bool findBeforeAndAfterUnhashed(std::shared_ptr<const recordstorage_t>& records, const DNSName& qname, DNSName& unhashed, DNSName& before, DNSName& after);
-  static void insertRecord(std::shared_ptr<recordstorage_t>& records, const ZoneName& zoneName, const DNSName& qname, const QType& qtype, const string& content, int ttl, const std::string& hashed = string(), bool* auth = nullptr);
+  static void insertRecord(std::shared_ptr<recordstorage_t>& records, const ZoneName& zoneName, const DNSName& qname, const QType& qtype, const string& content, int ttl, const std::string& hashed = string(), const 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);
index 4e3ce26072be48c159ba3f77a3bd43eb105e9142..20f00691cdefa3364a753e4a1a742300ad86d761 100644 (file)
@@ -210,6 +210,7 @@ unsigned int Bind2Backend::getCapabilities()
   return caps;
 }
 
+// NOLINTNEXTLINE(readability-convert-member-functions-to-static)
 bool Bind2Backend::getNSEC3PARAM(const ZoneName& name, NSEC3PARAMRecordContent* ns3p)
 {
   BB2DomainInfo bbd;
@@ -346,13 +347,13 @@ bool Bind2Backend::getDomainKeys(const ZoneName& name, std::vector<KeyData>& key
   return true;
 }
 
-bool Bind2Backend::removeDomainKey(const ZoneName& name, unsigned int id)
+bool Bind2Backend::removeDomainKey(const ZoneName& name, unsigned int keyId)
 {
   if (!d_dnssecdb || d_hybrid)
     return false;
 
   try {
-    d_deleteDomainKeyQuery_stmt->bind("domain", name)->bind("key_id", id)->execute()->reset();
+    d_deleteDomainKeyQuery_stmt->bind("domain", name)->bind("key_id", keyId)->execute()->reset();
   }
   catch (SSqlException& se) {
     throw PDNSException("Error accessing DNSSEC database in BIND backend, removeDomainKeys(): " + se.txtReason());
@@ -360,7 +361,7 @@ bool Bind2Backend::removeDomainKey(const ZoneName& name, unsigned int id)
   return true;
 }
 
-bool Bind2Backend::addDomainKey(const ZoneName& name, const KeyData& key, int64_t& id)
+bool Bind2Backend::addDomainKey(const ZoneName& name, const KeyData& key, int64_t& keyId)
 {
   if (!d_dnssecdb || d_hybrid)
     return false;
@@ -375,33 +376,33 @@ bool Bind2Backend::addDomainKey(const ZoneName& name, const KeyData& key, int64_
   try {
     d_GetLastInsertedKeyIdQuery_stmt->execute();
     if (!d_GetLastInsertedKeyIdQuery_stmt->hasNextRow()) {
-      id = -2;
+      keyId = -2;
       return true;
     }
     SSqlStatement::row_t row;
     d_GetLastInsertedKeyIdQuery_stmt->nextRow(row);
     ASSERT_ROW_COLUMNS("get-last-inserted-key-id-query", row, 1);
-    id = std::stoi(row[0]);
+    keyId = std::stoi(row[0]);
     d_GetLastInsertedKeyIdQuery_stmt->reset();
-    if (id == 0) {
+    if (keyId == 0) {
       // No insert took place, report as error.
-      id = -1;
+      keyId = -1;
     }
     return true;
   }
   catch (SSqlException& e) {
-    id = -2;
+    keyId = -2;
     return true;
   }
 }
 
-bool Bind2Backend::activateDomainKey(const ZoneName& name, unsigned int id)
+bool Bind2Backend::activateDomainKey(const ZoneName& name, unsigned int keyId)
 {
   if (!d_dnssecdb || d_hybrid)
     return false;
 
   try {
-    d_activateDomainKeyQuery_stmt->bind("domain", name)->bind("key_id", id)->execute()->reset();
+    d_activateDomainKeyQuery_stmt->bind("domain", name)->bind("key_id", keyId)->execute()->reset();
   }
   catch (SSqlException& se) {
     throw PDNSException("Error accessing DNSSEC database in BIND backend, activateDomainKey(): " + se.txtReason());
@@ -409,13 +410,13 @@ bool Bind2Backend::activateDomainKey(const ZoneName& name, unsigned int id)
   return true;
 }
 
-bool Bind2Backend::deactivateDomainKey(const ZoneName& name, unsigned int id)
+bool Bind2Backend::deactivateDomainKey(const ZoneName& name, unsigned int keyId)
 {
   if (!d_dnssecdb || d_hybrid)
     return false;
 
   try {
-    d_deactivateDomainKeyQuery_stmt->bind("domain", name)->bind("key_id", id)->execute()->reset();
+    d_deactivateDomainKeyQuery_stmt->bind("domain", name)->bind("key_id", keyId)->execute()->reset();
   }
   catch (SSqlException& se) {
     throw PDNSException("Error accessing DNSSEC database in BIND backend, deactivateDomainKey(): " + se.txtReason());
@@ -423,13 +424,13 @@ bool Bind2Backend::deactivateDomainKey(const ZoneName& name, unsigned int id)
   return true;
 }
 
-bool Bind2Backend::publishDomainKey(const ZoneName& name, unsigned int id)
+bool Bind2Backend::publishDomainKey(const ZoneName& name, unsigned int keyId)
 {
   if (!d_dnssecdb || d_hybrid)
     return false;
 
   try {
-    d_publishDomainKeyQuery_stmt->bind("domain", name)->bind("key_id", id)->execute()->reset();
+    d_publishDomainKeyQuery_stmt->bind("domain", name)->bind("key_id", keyId)->execute()->reset();
   }
   catch (SSqlException& se) {
     throw PDNSException("Error accessing DNSSEC database in BIND backend, publishDomainKey(): " + se.txtReason());
@@ -437,13 +438,13 @@ bool Bind2Backend::publishDomainKey(const ZoneName& name, unsigned int id)
   return true;
 }
 
-bool Bind2Backend::unpublishDomainKey(const ZoneName& name, unsigned int id)
+bool Bind2Backend::unpublishDomainKey(const ZoneName& name, unsigned int keyId)
 {
   if (!d_dnssecdb || d_hybrid)
     return false;
 
   try {
-    d_unpublishDomainKeyQuery_stmt->bind("domain", name)->bind("key_id", id)->execute()->reset();
+    d_unpublishDomainKeyQuery_stmt->bind("domain", name)->bind("key_id", keyId)->execute()->reset();
   }
   catch (SSqlException& se) {
     throw PDNSException("Error accessing DNSSEC database in BIND backend, unpublishDomainKey(): " + se.txtReason());
index 60e9b2361121caaa36bb236d7813ff112f1d50fd..b096ec012b506efe424b18a2723020ead6263be8 100644 (file)
@@ -1021,7 +1021,7 @@ bool GeoIPBackend::getDomainKeys(const ZoneName& name, std::vector<DNSBackend::K
   return false;
 }
 
-bool GeoIPBackend::removeDomainKey(const ZoneName& name, unsigned int id)
+bool GeoIPBackend::removeDomainKey(const ZoneName& name, unsigned int keyId)
 {
   if (!d_dnssec)
     return false;
@@ -1040,7 +1040,7 @@ bool GeoIPBackend::removeDomainKey(const ZoneName& name, unsigned int id)
         for (size_t i = 0; i < glob_result.gl_pathc; i++) {
           if (regexec(&reg, glob_result.gl_pathv[i], 5, regm, 0) == 0) {
             auto kid = pdns::checked_stoi<unsigned int>(glob_result.gl_pathv[i] + regm[3].rm_so);
-            if (kid == id) {
+            if (kid == keyId) {
               if (unlink(glob_result.gl_pathv[i])) {
                 cerr << "Cannot delete key:" << strerror(errno) << endl;
               }
@@ -1057,7 +1057,7 @@ bool GeoIPBackend::removeDomainKey(const ZoneName& name, unsigned int id)
   return false;
 }
 
-bool GeoIPBackend::addDomainKey(const ZoneName& name, const KeyData& key, int64_t& id)
+bool GeoIPBackend::addDomainKey(const ZoneName& name, const KeyData& key, int64_t& keyId)
 {
   if (!d_dnssec)
     return false;
@@ -1088,14 +1088,14 @@ bool GeoIPBackend::addDomainKey(const ZoneName& name, const KeyData& key, int64_
       ofstream ofs(pathname.str().c_str());
       ofs.write(key.content.c_str(), key.content.size());
       ofs.close();
-      id = nextid;
+      keyId = nextid;
       return true;
     }
   }
   return false;
 }
 
-bool GeoIPBackend::activateDomainKey(const ZoneName& name, unsigned int id)
+bool GeoIPBackend::activateDomainKey(const ZoneName& name, unsigned int keyId)
 {
   if (!d_dnssec)
     return false;
@@ -1112,7 +1112,7 @@ bool GeoIPBackend::activateDomainKey(const ZoneName& name, unsigned int id)
         for (size_t i = 0; i < glob_result.gl_pathc; i++) {
           if (regexec(&reg, glob_result.gl_pathv[i], 5, regm, 0) == 0) {
             auto kid = pdns::checked_stoi<unsigned int>(glob_result.gl_pathv[i] + regm[3].rm_so);
-            if (kid == id && !strcmp(glob_result.gl_pathv[i] + regm[4].rm_so, "0")) {
+            if (kid == keyId && !strcmp(glob_result.gl_pathv[i] + regm[4].rm_so, "0")) {
               ostringstream newpath;
               newpath << getArg("dnssec-keydir") << "/" << dom.domain.toStringNoDot() << "." << pdns::checked_stoi<unsigned int>(glob_result.gl_pathv[i] + regm[2].rm_so) << "." << kid << ".1.key";
               if (rename(glob_result.gl_pathv[i], newpath.str().c_str())) {
@@ -1130,7 +1130,7 @@ bool GeoIPBackend::activateDomainKey(const ZoneName& name, unsigned int id)
   return false;
 }
 
-bool GeoIPBackend::deactivateDomainKey(const ZoneName& name, unsigned int id)
+bool GeoIPBackend::deactivateDomainKey(const ZoneName& name, unsigned int keyId)
 {
   if (!d_dnssec)
     return false;
@@ -1147,7 +1147,7 @@ bool GeoIPBackend::deactivateDomainKey(const ZoneName& name, unsigned int id)
         for (size_t i = 0; i < glob_result.gl_pathc; i++) {
           if (regexec(&reg, glob_result.gl_pathv[i], 5, regm, 0) == 0) {
             auto kid = pdns::checked_stoi<unsigned int>(glob_result.gl_pathv[i] + regm[3].rm_so);
-            if (kid == id && !strcmp(glob_result.gl_pathv[i] + regm[4].rm_so, "1")) {
+            if (kid == keyId && !strcmp(glob_result.gl_pathv[i] + regm[4].rm_so, "1")) {
               ostringstream newpath;
               newpath << getArg("dnssec-keydir") << "/" << dom.domain.toStringNoDot() << "." << pdns::checked_stoi<unsigned int>(glob_result.gl_pathv[i] + regm[2].rm_so) << "." << kid << ".0.key";
               if (rename(glob_result.gl_pathv[i], newpath.str().c_str())) {
index 9275d05f0c6beda6467fce2bc4d53e6ff4d2db67..0203d4bf41b46768e91336503e0bc5d5b63aa2e6 100644 (file)
@@ -76,12 +76,12 @@ public:
   bool getAllDomainMetadata(const ZoneName& name, std::map<std::string, std::vector<std::string>>& meta) override;
   bool getDomainMetadata(const ZoneName& name, const std::string& kind, std::vector<std::string>& meta) override;
   bool getDomainKeys(const ZoneName& name, std::vector<DNSBackend::KeyData>& keys) override;
-  bool removeDomainKey(const ZoneName& name, unsigned int id) override;
-  bool addDomainKey(const ZoneName& name, const KeyData& key, int64_t& id) override;
-  bool activateDomainKey(const ZoneName& name, unsigned int id) override;
-  bool deactivateDomainKey(const ZoneName& name, unsigned int id) override;
-  bool publishDomainKey(const ZoneName& name, unsigned int id) override;
-  bool unpublishDomainKey(const ZoneName& name, unsigned int id) override;
+  bool removeDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool addDomainKey(const ZoneName& name, const KeyData& key, int64_t& keyId) override;
+  bool activateDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool deactivateDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool publishDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool unpublishDomainKey(const ZoneName& name, unsigned int keyId) override;
 
 private:
   static ReadWriteLock s_state_lock;
index b6209b2496ddc796e6307cb462e2cbea06f29682..a64a673fbbb2a2809c17e8eb6e4ce29d6b8d776c 100644 (file)
@@ -175,7 +175,7 @@ public:
   void lookup(const QType& qtype, const DNSName& qdomain, int zoneid, DNSPacket* p = nullptr) override;
   bool get(DNSResourceRecord& rr) override;
 
-  bool getDomainInfo(const ZoneName& domain, DomainInfo& di, bool getSerial = true) override;
+  bool getDomainInfo(const ZoneName& domain, DomainInfo& info, bool getSerial = true) override;
 
   // Primary backend
   void getUpdatedPrimaries(vector<DomainInfo>& domains, std::unordered_set<DNSName>& catalogs, CatalogHashMap& catalogHashes) override;
index 6373b7c64b6d84d8cf8bdc88b4ca68c860c86640..0875fa39ba1e4e7d2f81d633c0d592c328cd2e7a 100644 (file)
@@ -318,7 +318,7 @@ bool LdapBackend::get(DNSResourceRecord& rr)
   return true;
 }
 
-bool LdapBackend::getDomainInfo(const ZoneName& domain, DomainInfo& di, bool /* getSerial */)
+bool LdapBackend::getDomainInfo(const ZoneName& domain, DomainInfo& info, bool /* getSerial */)
 {
   string filter;
   SOAData sd;
@@ -347,7 +347,7 @@ bool LdapBackend::getDomainInfo(const ZoneName& domain, DomainInfo& di, bool /*
   catch (LDAPNoConnection& lnc) {
     g_log << Logger::Warning << d_myname << " Connection to LDAP lost, trying to reconnect" << endl;
     if (reconnect())
-      this->getDomainInfo(domain, di);
+      this->getDomainInfo(domain, info);
     else
       throw PDNSException("Failed to reconnect to LDAP server");
   }
@@ -364,42 +364,42 @@ bool LdapBackend::getDomainInfo(const ZoneName& domain, DomainInfo& di, bool /*
     fillSOAData(result["sOARecord"][0], sd);
 
     if (result.count("PdnsDomainId") && !result["PdnsDomainId"].empty())
-      di.id = std::stoi(result["PdnsDomainId"][0]);
+      info.id = std::stoi(result["PdnsDomainId"][0]);
     else
-      di.id = 0;
+      info.id = 0;
 
-    di.serial = sd.serial;
-    di.zone = domain;
+    info.serial = sd.serial;
+    info.zone = domain;
 
     if (result.count("PdnsDomainLastCheck") && !result["PdnsDomainLastCheck"].empty())
-      pdns::checked_stoi_into(di.last_check, result["PdnsDomainLastCheck"][0]);
+      pdns::checked_stoi_into(info.last_check, result["PdnsDomainLastCheck"][0]);
     else
-      di.last_check = 0;
+      info.last_check = 0;
 
     if (result.count("PdnsDomainNotifiedSerial") && !result["PdnsDomainNotifiedSerial"].empty())
-      pdns::checked_stoi_into(di.notified_serial, result["PdnsDomainNotifiedSerial"][0]);
+      pdns::checked_stoi_into(info.notified_serial, result["PdnsDomainNotifiedSerial"][0]);
     else
-      di.notified_serial = 0;
+      info.notified_serial = 0;
 
     if (result.count("PdnsDomainMaster") && !result["PdnsDomainMaster"].empty()) {
       for (const auto& m : result["PdnsDomainMaster"])
-        di.primaries.emplace_back(m, 53);
+        info.primaries.emplace_back(m, 53);
     }
 
     if (result.count("PdnsDomainType") && !result["PdnsDomainType"].empty()) {
       string kind = result["PdnsDomainType"][0];
       if (kind == "master")
-        di.kind = DomainInfo::Primary;
+        info.kind = DomainInfo::Primary;
       else if (kind == "slave")
-        di.kind = DomainInfo::Secondary;
+        info.kind = DomainInfo::Secondary;
       else
-        di.kind = DomainInfo::Native;
+        info.kind = DomainInfo::Native;
     }
     else {
-      di.kind = DomainInfo::Native;
+      info.kind = DomainInfo::Native;
     }
 
-    di.backend = this;
+    info.backend = this;
     return true;
   }
 
index ddee33b611dd77fdcd113a6deb92e2188d33417b..5f21acf89054517e509216a45c5de67e2269c576 100644 (file)
@@ -62,8 +62,9 @@ void LdapBackend::getUpdatedPrimaries(vector<DomainInfo>& domains, std::unordere
       continue;
 
     DomainInfo di;
-    if (!getDomainInfo(ZoneName(result["associatedDomain"][0]), di))
+    if (!getDomainInfo(ZoneName(result["associatedDomain"][0]), di)) {
       continue;
+    }
 
     if (di.notified_serial < di.serial)
       domains.push_back(di);
index da492110fe0babbf7b8c9afedd202bbf9bbfcf7d..69143e4cd6a8282b79fb481296c70fc15b48212e 100644 (file)
@@ -1655,7 +1655,7 @@ bool LMDBBackend::getSerial(DomainInfo& di)
   return false;
 }
 
-bool LMDBBackend::getDomainInfo(const ZoneName& domain, DomainInfo& di, bool getserial)
+bool LMDBBackend::getDomainInfo(const ZoneName& domain, DomainInfo& info, bool getserial)
 {
   {
     auto txn = d_tdomains->getROTransaction();
@@ -1665,22 +1665,22 @@ bool LMDBBackend::getDomainInfo(const ZoneName& domain, DomainInfo& di, bool get
 
     // for (auto& iter = range.first ; iter != range.second; ++iter) {
     //   found = true;
-    //   di.id = iter.getID();
-    //   di.backend = this;
+    //   info.id = iter.getID();
+    //   info.backend = this;
     // }
 
     // if (!found) {
     //   return false;
     // }
-    if (!(di.id = txn.get<0>(domain, di))) {
+    if (!(info.id = txn.get<0>(domain, info))) {
       return false;
     }
 
-    di.backend = this;
+    info.backend = this;
   }
 
   if (getserial) {
-    getSerial(di);
+    getSerial(info);
   }
 
   return true;
@@ -2017,38 +2017,38 @@ bool LMDBBackend::getDomainKeys(const ZoneName& name, std::vector<KeyData>& keys
   return true;
 }
 
-bool LMDBBackend::removeDomainKey(const ZoneName& name, unsigned int id)
+bool LMDBBackend::removeDomainKey(const ZoneName& name, unsigned int keyId)
 {
   auto txn = d_tkdb->getRWTransaction();
   KeyDataDB kdb;
-  if (txn.get(id, kdb)) {
+  if (txn.get(keyId, kdb)) {
     if (kdb.domain == name) {
-      txn.del(id);
+      txn.del(keyId);
       txn.commit();
       return true;
     }
   }
-  // cout << "??? wanted to remove domain key for domain "<<name<<" with id "<<id<<", could not find it"<<endl;
+  // cout << "??? wanted to remove domain key for domain "<<name<<" with id "<<keyId<<", could not find it"<<endl;
   return true;
 }
 
-bool LMDBBackend::addDomainKey(const ZoneName& name, const KeyData& key, int64_t& id)
+bool LMDBBackend::addDomainKey(const ZoneName& name, const KeyData& key, int64_t& keyId)
 {
   auto txn = d_tkdb->getRWTransaction();
   KeyDataDB kdb{name, key.content, key.flags, key.active, key.published};
-  id = txn.put(kdb, 0, d_random_ids);
+  keyId = txn.put(kdb, 0, d_random_ids);
   txn.commit();
 
   return true;
 }
 
-bool LMDBBackend::activateDomainKey(const ZoneName& name, unsigned int id)
+bool LMDBBackend::activateDomainKey(const ZoneName& name, unsigned int keyId)
 {
   auto txn = d_tkdb->getRWTransaction();
   KeyDataDB kdb;
-  if (txn.get(id, kdb)) {
+  if (txn.get(keyId, kdb)) {
     if (kdb.domain == name) {
-      txn.modify(id, [](KeyDataDB& kdbarg) {
+      txn.modify(keyId, [](KeyDataDB& kdbarg) {
         kdbarg.active = true;
       });
       txn.commit();
@@ -2056,34 +2056,34 @@ bool LMDBBackend::activateDomainKey(const ZoneName& name, unsigned int id)
     }
   }
 
-  // cout << "??? wanted to activate domain key for domain "<<name<<" with id "<<id<<", could not find it"<<endl;
+  // cout << "??? wanted to activate domain key for domain "<<name<<" with id "<<keyId<<", could not find it"<<endl;
   return true;
 }
 
-bool LMDBBackend::deactivateDomainKey(const ZoneName& name, unsigned int id)
+bool LMDBBackend::deactivateDomainKey(const ZoneName& name, unsigned int keyId)
 {
   auto txn = d_tkdb->getRWTransaction();
   KeyDataDB kdb;
-  if (txn.get(id, kdb)) {
+  if (txn.get(keyId, kdb)) {
     if (kdb.domain == name) {
-      txn.modify(id, [](KeyDataDB& kdbarg) {
+      txn.modify(keyId, [](KeyDataDB& kdbarg) {
         kdbarg.active = false;
       });
       txn.commit();
       return true;
     }
   }
-  // cout << "??? wanted to deactivate domain key for domain "<<name<<" with id "<<id<<", could not find it"<<endl;
+  // cout << "??? wanted to deactivate domain key for domain "<<name<<" with id "<<keyId<<", could not find it"<<endl;
   return true;
 }
 
-bool LMDBBackend::publishDomainKey(const ZoneName& name, unsigned int id)
+bool LMDBBackend::publishDomainKey(const ZoneName& name, unsigned int keyId)
 {
   auto txn = d_tkdb->getRWTransaction();
   KeyDataDB kdb;
-  if (txn.get(id, kdb)) {
+  if (txn.get(keyId, kdb)) {
     if (kdb.domain == name) {
-      txn.modify(id, [](KeyDataDB& kdbarg) {
+      txn.modify(keyId, [](KeyDataDB& kdbarg) {
         kdbarg.published = true;
       });
       txn.commit();
@@ -2091,24 +2091,24 @@ bool LMDBBackend::publishDomainKey(const ZoneName& name, unsigned int id)
     }
   }
 
-  // cout << "??? wanted to hide domain key for domain "<<name<<" with id "<<id<<", could not find it"<<endl;
+  // cout << "??? wanted to hide domain key for domain "<<name<<" with id "<<keyId<<", could not find it"<<endl;
   return true;
 }
 
-bool LMDBBackend::unpublishDomainKey(const ZoneName& name, unsigned int id)
+bool LMDBBackend::unpublishDomainKey(const ZoneName& name, unsigned int keyId)
 {
   auto txn = d_tkdb->getRWTransaction();
   KeyDataDB kdb;
-  if (txn.get(id, kdb)) {
+  if (txn.get(keyId, kdb)) {
     if (kdb.domain == name) {
-      txn.modify(id, [](KeyDataDB& kdbarg) {
+      txn.modify(keyId, [](KeyDataDB& kdbarg) {
         kdbarg.published = false;
       });
       txn.commit();
       return true;
     }
   }
-  // cout << "??? wanted to unhide domain key for domain "<<name<<" with id "<<id<<", could not find it"<<endl;
+  // cout << "??? wanted to unhide domain key for domain "<<name<<" with id "<<keyId<<", could not find it"<<endl;
   return true;
 }
 
@@ -2331,22 +2331,22 @@ bool LMDBBackend::getBeforeAndAfterNamesAbsolute(uint32_t id, const DNSName& qna
   return true;
 }
 
-bool LMDBBackend::getBeforeAndAfterNames(uint32_t id, const ZoneName& zonenameU, const DNSName& qname, DNSName& before, DNSName& after)
+bool LMDBBackend::getBeforeAndAfterNames(uint32_t domainId, const ZoneName& zonenameU, const DNSName& qname, DNSName& before, DNSName& after)
 {
   ZoneName zonename = zonenameU.makeLowerCase();
-  //  cout << __PRETTY_FUNCTION__<< ": "<<id <<", "<<zonename << ", '"<<qname<<"'"<<endl;
+  //  cout << __PRETTY_FUNCTION__<< ": "<<domainId <<", "<<zonename << ", '"<<qname<<"'"<<endl;
 
-  auto txn = getRecordsROTransaction(id);
+  auto txn = getRecordsROTransaction(domainId);
   compoundOrdername co;
   DNSName qname2 = qname.makeRelative(zonename);
-  string matchkey = co(id, qname2);
+  string matchkey = co(domainId, qname2);
   auto cursor = txn->txn->getCursor(txn->db->dbi);
   MDBOutVal key, val;
   // cout<<"Lower_bound for "<<qname2<<endl;
   if (cursor.lower_bound(matchkey, key, val)) {
     // cout << "Hit end of database, bummer"<<endl;
     cursor.last(key, val);
-    if (co.getDomainID(key.getNoStripHeader<string_view>()) == id) {
+    if (co.getDomainID(key.getNoStripHeader<string_view>()) == domainId) {
       before = co.getQName(key.getNoStripHeader<string_view>()) + zonename;
       after = zonename;
     }
@@ -2356,7 +2356,7 @@ bool LMDBBackend::getBeforeAndAfterNames(uint32_t id, const ZoneName& zonenameU,
   }
   // cout<<"Cursor is at "<<co.getQName(key.get<string_view>()) <<", in zone id "<<co.getDomainID(key.get<string_view>())<< endl;
 
-  if (co.getQType(key.getNoStripHeader<string_view>()).getCode() && co.getDomainID(key.getNoStripHeader<string_view>()) == id && co.getQName(key.getNoStripHeader<string_view>()) == qname2) { // don't match ENTs
+  if (co.getQType(key.getNoStripHeader<string_view>()).getCode() && co.getDomainID(key.getNoStripHeader<string_view>()) == domainId && co.getQName(key.getNoStripHeader<string_view>()) == qname2) { // don't match ENTs
     // cout << "Had an exact match!"<<endl;
     before = qname2 + zonename;
     int rc;
@@ -2365,14 +2365,14 @@ bool LMDBBackend::getBeforeAndAfterNames(uint32_t id, const ZoneName& zonenameU,
       if (rc)
         break;
 
-      if (co.getDomainID(key.getNoStripHeader<string_view>()) == id && key.getNoStripHeader<StringView>().rfind(matchkey, 0) == 0)
+      if (co.getDomainID(key.getNoStripHeader<string_view>()) == domainId && key.getNoStripHeader<StringView>().rfind(matchkey, 0) == 0)
         continue;
       LMDBResourceRecord lrr;
       deserializeFromBuffer(val.get<StringView>(), lrr);
       if (co.getQType(key.getNoStripHeader<string_view>()).getCode() && (lrr.auth || co.getQType(key.getNoStripHeader<string_view>()).getCode() == QType::NS))
         break;
     }
-    if (rc || co.getDomainID(key.getNoStripHeader<string_view>()) != id) {
+    if (rc || co.getDomainID(key.getNoStripHeader<string_view>()) != domainId) {
       // cout << "We hit the end of the zone or database. 'after' is apex" << endl;
       after = zonename;
       return false;
@@ -2381,7 +2381,7 @@ bool LMDBBackend::getBeforeAndAfterNames(uint32_t id, const ZoneName& zonenameU,
     return true;
   }
 
-  if (co.getDomainID(key.getNoStripHeader<string_view>()) != id) {
+  if (co.getDomainID(key.getNoStripHeader<string_view>()) != domainId) {
     // cout << "Ended up in next zone, 'after' is zonename" <<endl;
     after = zonename;
     // cout << "Now hunting for previous" << endl;
@@ -2393,8 +2393,8 @@ bool LMDBBackend::getBeforeAndAfterNames(uint32_t id, const ZoneName& zonenameU,
         return false;
       }
 
-      if (co.getDomainID(key.getNoStripHeader<string_view>()) != id) {
-        // cout<<"Reversed into zone, but found wrong zone id " << co.getDomainID(key.getNoStripHeader<string_view>()) << " != "<<id<<endl;
+      if (co.getDomainID(key.getNoStripHeader<string_view>()) != domainId) {
+        // cout<<"Reversed into zone, but found wrong zone id " << co.getDomainID(key.getNoStripHeader<string_view>()) << " != "<<domainId<<endl;
         // "this can't happen"
         return false;
       }
@@ -2425,7 +2425,7 @@ bool LMDBBackend::getBeforeAndAfterNames(uint32_t id, const ZoneName& zonenameU,
     int rc = cursor.next(key, val);
     if (!rc)
       ++skips;
-    if (rc || co.getDomainID(key.getNoStripHeader<string_view>()) != id) {
+    if (rc || co.getDomainID(key.getNoStripHeader<string_view>()) != domainId) {
       // cout << "  oops, hit end of database or zone. This means after is apex" <<endl;
       after = zonename;
       break;
@@ -2437,7 +2437,7 @@ bool LMDBBackend::getBeforeAndAfterNames(uint32_t id, const ZoneName& zonenameU,
 
   for (;;) {
     int rc = cursor.prev(key, val);
-    if (rc || co.getDomainID(key.getNoStripHeader<string_view>()) != id) {
+    if (rc || co.getDomainID(key.getNoStripHeader<string_view>()) != domainId) {
       // XX I don't think this case can happen
       // cout << "We hit the beginning of the zone or database.. now what" << endl;
       return false;
index eb1ae68ea3a182e44f21af8dc701a97d9e808b33..65fa274644711ba6369b85afcaba6d1c0eb220b2 100644 (file)
@@ -63,9 +63,9 @@ public:
   ~LMDBBackend();
 
   unsigned int getCapabilities() override { return CAP_DNSSEC | CAP_DIRECT | CAP_LIST | CAP_CREATE; }
-  bool list(const ZoneName& target, int id, bool include_disabled) override;
+  bool list(const ZoneName& target, int domainId, bool include_disabled) override;
 
-  bool getDomainInfo(const ZoneName& domain, DomainInfo& di, bool getserial = true) override;
+  bool getDomainInfo(const ZoneName& domain, DomainInfo& info, bool getserial = true) override;
   bool createDomain(const ZoneName& domain, const DomainInfo::DomainKind kind, const vector<ComboAddress>& primaries, const string& account) override;
 
   bool startTransaction(const ZoneName& domain, int domain_id = -1) override;
@@ -94,7 +94,7 @@ public:
   // catalog zones
   bool getCatalogMembers(const ZoneName& catalog, vector<CatalogInfo>& members, CatalogInfo::CatalogType type) override;
   bool setOptions(const ZoneName& domain, const std::string& options) override;
-  bool setCatalog(const ZoneName& domain, const ZoneName& options) override;
+  bool setCatalog(const ZoneName& domain, const ZoneName& catalog) override;
 
   bool setPrimaries(const ZoneName& domain, const vector<ComboAddress>& primaries) override;
   bool setKind(const ZoneName& domain, const DomainInfo::DomainKind kind) override;
@@ -121,12 +121,12 @@ public:
   bool deleteDomain(const ZoneName& domain) override;
 
   bool getDomainKeys(const ZoneName& name, std::vector<KeyData>& keys) override;
-  bool removeDomainKey(const ZoneName& name, unsigned int id) override;
-  bool addDomainKey(const ZoneName& name, const KeyData& key, int64_t& id) override;
-  bool activateDomainKey(const ZoneName& name, unsigned int id) override;
-  bool deactivateDomainKey(const ZoneName& name, unsigned int id) override;
-  bool publishDomainKey(const ZoneName& name, unsigned int id) override;
-  bool unpublishDomainKey(const ZoneName& name, unsigned int id) override;
+  bool removeDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool addDomainKey(const ZoneName& name, const KeyData& key, int64_t& keyId) override;
+  bool activateDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool deactivateDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool publishDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool unpublishDomainKey(const ZoneName& name, unsigned int keyId) override;
 
   // TSIG
   bool getTSIGKey(const DNSName& name, DNSName& algorithm, string& content) override;
@@ -138,7 +138,7 @@ public:
 
   bool getBeforeAndAfterNamesAbsolute(uint32_t id, const DNSName& qname, DNSName& unhashed, DNSName& before, DNSName& after) override;
 
-  bool getBeforeAndAfterNames(uint32_t id, const ZoneName& zonename, const DNSName& qname, DNSName& before, DNSName& after) override;
+  bool getBeforeAndAfterNames(uint32_t domainId, const ZoneName& zonename, const DNSName& qname, DNSName& before, DNSName& after) override;
 
   bool updateDNSSECOrderNameAndAuth(uint32_t domain_id, const DNSName& qname, const DNSName& ordername, bool auth, const uint16_t qtype = QType::ANY) override;
 
index 5a7b74d2abe0091ce436df5f3c9a7285a1cd726c..0f80cc916b55133aaa63d03a069a2da6e8528946 100644 (file)
@@ -195,7 +195,7 @@ void PipeBackend::lookup(const QType& qtype, const DNSName& qname, int zoneId, D
   d_qname = qname;
 }
 
-bool PipeBackend::list(const ZoneName& target, int inZoneId, bool /* include_disabled */)
+bool PipeBackend::list(const ZoneName& target, int domain_id, bool /* include_disabled */)
 {
   try {
     launch();
@@ -205,16 +205,16 @@ bool PipeBackend::list(const ZoneName& target, int inZoneId, bool /* include_dis
 
     // type    qname           qclass  qtype   id      ip-address
     if (d_abiVersion >= 4)
-      query << "AXFR\t" << inZoneId << "\t" << target.toStringRootDot();
+      query << "AXFR\t" << domain_id << "\t" << target.toStringRootDot();
     else
-      query << "AXFR\t" << inZoneId;
+      query << "AXFR\t" << domain_id;
 
     d_coproc->send(query.str());
   }
   catch (PDNSException& ae) {
     g_log << Logger::Error << kBackendId << " Error from coprocess: " << ae.reason << endl;
   }
-  d_qname = DNSName(std::to_string(inZoneId)); // why do we store a number here??
+  d_qname = DNSName(std::to_string(domain_id)); // why do we store a number here??
   return true;
 }
 
index b035dccae212e8ba4ae34c313597c8aaed0473c0..61f16330284990fdc88769feee59b8bdd46fa93f 100644 (file)
@@ -411,7 +411,7 @@ bool RemoteBackend::getDomainKeys(const ZoneName& name, std::vector<DNSBackend::
   return true;
 }
 
-bool RemoteBackend::removeDomainKey(const ZoneName& name, unsigned int id)
+bool RemoteBackend::removeDomainKey(const ZoneName& name, unsigned int keyId)
 {
   // no point doing dnssec if it's not supported
   if (!d_dnssec) {
@@ -420,13 +420,13 @@ bool RemoteBackend::removeDomainKey(const ZoneName& name, unsigned int id)
 
   Json query = Json::object{
     {"method", "removeDomainKey"},
-    {"parameters", Json::object{{"name", name.toString()}, {"id", static_cast<int>(id)}}}};
+    {"parameters", Json::object{{"name", name.toString()}, {"id", static_cast<int>(keyId)}}}};
 
   Json answer;
   return this->send(query) && this->recv(answer);
 }
 
-bool RemoteBackend::addDomainKey(const ZoneName& name, const KeyData& key, int64_t& id)
+bool RemoteBackend::addDomainKey(const ZoneName& name, const KeyData& key, int64_t& keyId)
 {
   // no point doing dnssec if it's not supported
   if (!d_dnssec) {
@@ -442,11 +442,11 @@ bool RemoteBackend::addDomainKey(const ZoneName& name, const KeyData& key, int64
     return false;
   }
 
-  id = answer["result"].int_value();
-  return id >= 0;
+  keyId = answer["result"].int_value();
+  return keyId >= 0;
 }
 
-bool RemoteBackend::activateDomainKey(const ZoneName& name, unsigned int id)
+bool RemoteBackend::activateDomainKey(const ZoneName& name, unsigned int keyId)
 {
   // no point doing dnssec if it's not supported
   if (!d_dnssec) {
@@ -455,13 +455,13 @@ bool RemoteBackend::activateDomainKey(const ZoneName& name, unsigned int id)
 
   Json query = Json::object{
     {"method", "activateDomainKey"},
-    {"parameters", Json::object{{"name", name.toString()}, {"id", static_cast<int>(id)}}}};
+    {"parameters", Json::object{{"name", name.toString()}, {"id", static_cast<int>(keyId)}}}};
 
   Json answer;
   return this->send(query) && this->recv(answer);
 }
 
-bool RemoteBackend::deactivateDomainKey(const ZoneName& name, unsigned int id)
+bool RemoteBackend::deactivateDomainKey(const ZoneName& name, unsigned int keyId)
 {
   // no point doing dnssec if it's not supported
   if (!d_dnssec) {
@@ -470,13 +470,13 @@ bool RemoteBackend::deactivateDomainKey(const ZoneName& name, unsigned int id)
 
   Json query = Json::object{
     {"method", "deactivateDomainKey"},
-    {"parameters", Json::object{{"name", name.toString()}, {"id", static_cast<int>(id)}}}};
+    {"parameters", Json::object{{"name", name.toString()}, {"id", static_cast<int>(keyId)}}}};
 
   Json answer;
   return this->send(query) && this->recv(answer);
 }
 
-bool RemoteBackend::publishDomainKey(const ZoneName& name, unsigned int id)
+bool RemoteBackend::publishDomainKey(const ZoneName& name, unsigned int keyId)
 {
   // no point doing dnssec if it's not supported
   if (!d_dnssec) {
@@ -485,13 +485,13 @@ bool RemoteBackend::publishDomainKey(const ZoneName& name, unsigned int id)
 
   Json query = Json::object{
     {"method", "publishDomainKey"},
-    {"parameters", Json::object{{"name", name.toString()}, {"id", static_cast<int>(id)}}}};
+    {"parameters", Json::object{{"name", name.toString()}, {"id", static_cast<int>(keyId)}}}};
 
   Json answer;
   return this->send(query) && this->recv(answer);
 }
 
-bool RemoteBackend::unpublishDomainKey(const ZoneName& name, unsigned int id)
+bool RemoteBackend::unpublishDomainKey(const ZoneName& name, unsigned int keyId)
 {
   // no point doing dnssec if it's not supported
   if (!d_dnssec) {
@@ -500,7 +500,7 @@ bool RemoteBackend::unpublishDomainKey(const ZoneName& name, unsigned int id)
 
   Json query = Json::object{
     {"method", "unpublishDomainKey"},
-    {"parameters", Json::object{{"name", name.toString()}, {"id", static_cast<int>(id)}}}};
+    {"parameters", Json::object{{"name", name.toString()}, {"id", static_cast<int>(keyId)}}}};
 
   Json answer;
   return this->send(query) && this->recv(answer);
@@ -620,7 +620,7 @@ void RemoteBackend::parseDomainInfo(const Json& obj, DomainInfo& di)
   di.backend = this;
 }
 
-bool RemoteBackend::getDomainInfo(const ZoneName& domain, DomainInfo& di, bool /* getSerial */)
+bool RemoteBackend::getDomainInfo(const ZoneName& domain, DomainInfo& info, bool /* getSerial */)
 {
   if (domain.empty()) {
     return false;
@@ -635,7 +635,7 @@ bool RemoteBackend::getDomainInfo(const ZoneName& domain, DomainInfo& di, bool /
     return false;
   }
 
-  this->parseDomainInfo(answer["result"], di);
+  this->parseDomainInfo(answer["result"], info);
   return true;
 }
 
@@ -651,7 +651,7 @@ void RemoteBackend::setNotified(uint32_t id, uint32_t serial)
   }
 }
 
-bool RemoteBackend::autoPrimaryBackend(const string& ip, const ZoneName& domain, const vector<DNSResourceRecord>& nsset, string* nameserver, string* account, DNSBackend** ddb)
+bool RemoteBackend::autoPrimaryBackend(const string& ipAddress, const ZoneName& domain, const vector<DNSResourceRecord>& nsset, string* nameserver, string* account, DNSBackend** ddb)
 {
   Json::array rrset;
 
@@ -667,7 +667,7 @@ bool RemoteBackend::autoPrimaryBackend(const string& ip, const ZoneName& domain,
 
   Json query = Json::object{
     {"method", "superMasterBackend"},
-    {"parameters", Json::object{{"ip", ip}, {"domain", domain.toString()}, {"nsset", rrset}}}};
+    {"parameters", Json::object{{"ip", ipAddress}, {"domain", domain.toString()}, {"nsset", rrset}}}};
 
   *ddb = nullptr;
 
@@ -688,12 +688,12 @@ bool RemoteBackend::autoPrimaryBackend(const string& ip, const ZoneName& domain,
   return true;
 }
 
-bool RemoteBackend::createSecondaryDomain(const string& ip, const ZoneName& domain, const string& nameserver, const string& account)
+bool RemoteBackend::createSecondaryDomain(const string& ipAddress, const ZoneName& domain, const string& nameserver, const string& account)
 {
   Json query = Json::object{
     {"method", "createSlaveDomain"},
     {"parameters", Json::object{
-                     {"ip", ip},
+                     {"ip", ipAddress},
                      {"domain", domain.toString()},
                      {"nameserver", nameserver},
                      {"account", account},
index 5aa7b5b73ab87aa2982b390aff5ba77d34972e5f..b91f373eea4c6e06e8e8320da621b3a001affc40 100644 (file)
@@ -178,16 +178,16 @@ public:
   bool getTSIGKey(const DNSName& name, DNSName& algorithm, std::string& content) override;
   bool getBeforeAndAfterNamesAbsolute(uint32_t id, const DNSName& qname, DNSName& unhashed, DNSName& before, DNSName& after) override;
   bool setDomainMetadata(const DNSName& name, const string& kind, const std::vector<std::basic_string<char>>& meta) override;
-  bool removeDomainKey(const ZoneName& name, unsigned int id) override;
-  bool addDomainKey(const ZoneName& name, const KeyData& key, int64_t& id) override;
-  bool activateDomainKey(const ZoneName& name, unsigned int id) override;
-  bool deactivateDomainKey(const ZoneName& name, unsigned int id) override;
-  bool publishDomainKey(const ZoneName& name, unsigned int id) override;
-  bool unpublishDomainKey(const ZoneName& name, unsigned int id) override;
-  bool getDomainInfo(const ZoneName& domain, DomainInfo& di, bool getSerial = true) override;
+  bool removeDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool addDomainKey(const ZoneName& name, const KeyData& key, int64_t& keyId) override;
+  bool activateDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool deactivateDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool publishDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool unpublishDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool getDomainInfo(const ZoneName& domain, DomainInfo& info, bool getSerial = true) override;
   void setNotified(uint32_t id, uint32_t serial) override;
-  bool autoPrimaryBackend(const string& ip, const ZoneName& domain, const vector<DNSResourceRecord>& nsset, string* nameserver, string* account, DNSBackend** ddb) override;
-  bool createSecondaryDomain(const string& ip, const ZoneName& domain, const string& nameserver, const string& account) override;
+  bool autoPrimaryBackend(const string& ipAddress, const ZoneName& domain, const vector<DNSResourceRecord>& nsset, string* nameserver, string* account, DNSBackend** ddb) override;
+  bool createSecondaryDomain(const string& ipAddress, const ZoneName& domain, const string& nameserver, const string& account) override;
   bool replaceRRSet(uint32_t domain_id, const DNSName& qname, const QType& qt, const vector<DNSResourceRecord>& rrset) override;
   bool feedRecord(const DNSResourceRecord& r, const DNSName& ordername, bool ordernameIsNSEC3 = false) override;
   bool feedEnts(int domain_id, map<DNSName, bool>& nonterm) override;
index a52ea897714165d6d42640e2dd63d45ab760b887..577ace0d8405ef07ed273ac4e7178501a66fb7af 100644 (file)
@@ -111,14 +111,14 @@ void CommunicatorClass::queueNotifyDomain(const DomainInfo& di, UeberBackend* B)
     g_log << Logger::Warning << "Request to queue notification for domain '" << di.zone << "' was processed, but no valid nameservers or ALSO-NOTIFYs found. Not notifying!" << endl;
 }
 
-bool CommunicatorClass::notifyDomain(const ZoneName& domain, UeberBackend* B)
+bool CommunicatorClass::notifyDomain(const ZoneName& domain, UeberBackend* ueber)
 {
   DomainInfo di;
-  if (!B->getDomainInfo(domain, di)) {
+  if (!ueber->getDomainInfo(domain, di)) {
     g_log << Logger::Warning << "No such domain '" << domain << "' in our database" << endl;
     return false;
   }
-  queueNotifyDomain(di, B);
+  queueNotifyDomain(di, ueber);
   // call backend and tell them we sent out the notification - even though that is premature
   if (di.serial != di.notified_serial)
     di.backend->setNotified(di.id, di.serial);
@@ -265,7 +265,7 @@ time_t CommunicatorClass::doNotifications(PacketHandler* P)
           continue;
         }
 
-        sendNotification(remote.sin4.sin_family == AF_INET ? d_nsock4 : d_nsock6, domain, remote, id, B);
+       CommunicatorClass::sendNotification(remote.sin4.sin_family == AF_INET ? d_nsock4 : d_nsock6, domain, remote, id, B);
         drillHole(domain, ip);
       }
       catch (ResolverException& re) {
@@ -280,7 +280,7 @@ time_t CommunicatorClass::doNotifications(PacketHandler* P)
   return d_nq.earliest();
 }
 
-void CommunicatorClass::sendNotification(int sock, const ZoneName& domain, const ComboAddress& remote, uint16_t id, UeberBackend* B)
+void CommunicatorClass::sendNotification(int sock, const ZoneName& domain, const ComboAddress& remote, uint16_t notificationId, UeberBackend* ueber)
 {
   vector<string> meta;
   DNSName tsigkeyname;
@@ -288,17 +288,17 @@ void CommunicatorClass::sendNotification(int sock, const ZoneName& domain, const
   string tsigsecret64;
   string tsigsecret;
 
-  if (::arg().mustDo("send-signed-notify") && B->getDomainMetadata(domain, "TSIG-ALLOW-AXFR", meta) && meta.size() > 0) {
+  if (::arg().mustDo("send-signed-notify") && ueber->getDomainMetadata(domain, "TSIG-ALLOW-AXFR", meta) && meta.size() > 0) {
     tsigkeyname = DNSName(meta[0]);
   }
 
   vector<uint8_t> packet;
   DNSPacketWriter pw(packet, domain, QType::SOA, 1, Opcode::Notify);
-  pw.getHeader()->id = id;
+  pw.getHeader()->id = notificationId;
   pw.getHeader()->aa = true;
 
   if (tsigkeyname.empty() == false) {
-    if (!B->getTSIGKey(tsigkeyname, tsigalgorithm, tsigsecret64)) {
+    if (!ueber->getTSIGKey(tsigkeyname, tsigalgorithm, tsigsecret64)) {
       g_log << Logger::Error << "TSIG key '" << tsigkeyname << "' for domain '" << domain << "' not found" << endl;
       return;
     }
@@ -309,7 +309,7 @@ void CommunicatorClass::sendNotification(int sock, const ZoneName& domain, const
       trc.d_algoName = tsigalgorithm;
     trc.d_time = time(nullptr);
     trc.d_fudge = 300;
-    trc.d_origID = ntohs(id);
+    trc.d_origID = ntohs(notificationId);
     trc.d_eRcode = 0;
     if (B64Decode(tsigsecret64, tsigsecret) == -1) {
       g_log << Logger::Error << "Unable to Base-64 decode TSIG key '" << tsigkeyname << "' for domain '" << domain << "'" << endl;
@@ -323,15 +323,15 @@ void CommunicatorClass::sendNotification(int sock, const ZoneName& domain, const
   }
 }
 
-void CommunicatorClass::drillHole(const ZoneName& domain, const string& ip)
+void CommunicatorClass::drillHole(const ZoneName& domain, const string& ipAddress)
 {
-  (*d_holes.lock())[pair(domain, ip)] = time(nullptr);
+  (*d_holes.lock())[pair(domain, ipAddress)] = time(nullptr);
 }
 
-bool CommunicatorClass::justNotified(const ZoneName& domain, const string& ip)
+bool CommunicatorClass::justNotified(const ZoneName& domain, const string& ipAddress)
 {
   auto holes = d_holes.lock();
-  auto it = holes->find(pair(domain, ip));
+  auto it = holes->find(pair(domain, ipAddress));
   if (it == holes->end()) {
     // no hole
     return false;
@@ -362,7 +362,7 @@ void CommunicatorClass::makeNotifySockets()
   }
 }
 
-void CommunicatorClass::notify(const ZoneName& domain, const string& ip)
+void CommunicatorClass::notify(const ZoneName& domain, const string& ipAddress)
 {
-  d_nq.add(domain, ip);
+  d_nq.add(domain, ipAddress);
 }
index f05347dcfbe1fff56ef3f5432fbe4af75c35cdd9..463346fbdc04994eb1b5290f300b951fe58328b8 100644 (file)
@@ -425,7 +425,7 @@ static bool catalogProcess(const DomainInfo& di, vector<DNSResourceRecord>& rrs,
   return catalogDiff(di, fromXFR, fromDB, logPrefix);
 }
 
-void CommunicatorClass::ixfrSuck(const ZoneName& domain, const TSIGTriplet& tt, const ComboAddress& laddr, const ComboAddress& remote, ZoneStatus& zs, vector<DNSRecord>* axfr)
+void CommunicatorClass::ixfrSuck(const ZoneName& domain, const TSIGTriplet& tsig, const ComboAddress& laddr, const ComboAddress& remote, ZoneStatus& status, vector<DNSRecord>* axfr)
 {
   string logPrefix = "IXFR-in zone '" + domain.toLogString() + "', primary '" + remote.toString() + "', ";
 
@@ -451,8 +451,8 @@ void CommunicatorClass::ixfrSuck(const ZoneName& domain, const TSIGTriplet& tt,
     soatimes drsoa_soatimes = {di.serial, 0, 0, 0, 0};
     DNSRecord drsoa;
     drsoa.setContent(std::make_shared<SOARecordContent>(g_rootdnsname, g_rootdnsname, drsoa_soatimes));
-    auto deltas = getIXFRDeltas(remote, domain, drsoa, xfrTimeout, false, tt, laddr.sin4.sin_family ? &laddr : nullptr, ((size_t)::arg().asNum("xfr-max-received-mbytes")) * 1024 * 1024);
-    zs.numDeltas = deltas.size();
+    auto deltas = getIXFRDeltas(remote, domain, drsoa, xfrTimeout, false, tsig, laddr.sin4.sin_family ? &laddr : nullptr, ((size_t)::arg().asNum("xfr-max-received-mbytes")) * 1024 * 1024);
+    status.numDeltas = deltas.size();
     //    cout<<"Got "<<deltas.size()<<" deltas from serial "<<di.serial<<", applying.."<<endl;
 
     for (const auto& d : deltas) {
@@ -510,7 +510,7 @@ void CommunicatorClass::ixfrSuck(const ZoneName& domain, const TSIGTriplet& tt,
           if (dr.d_type == QType::SOA) {
             //            cout<<"New SOA: "<<x.d_content->getZoneRepresentation()<<endl;
             auto sr = getRR<SOARecordContent>(dr);
-            zs.soa_serial = sr->d_st.serial;
+            status.soa_serial = sr->d_st.serial;
           }
 
           replacement.push_back(rr);
@@ -752,7 +752,7 @@ void CommunicatorClass::suck(const ZoneName& domain, const ComboAddress& remote,
         logPrefix = "I" + logPrefix; // XFR -> IXFR
         vector<DNSRecord> axfr;
         g_log << Logger::Notice << logPrefix << "starting IXFR" << endl;
-        ixfrSuck(domain, tt, laddr, remote, zs, &axfr);
+        CommunicatorClass::ixfrSuck(domain, tt, laddr, remote, zs, &axfr);
         if (!axfr.empty()) {
           g_log << Logger::Notice << logPrefix << "IXFR turned into an AXFR" << endl;
           logPrefix[0] = 'A'; // IXFR -> AXFR
index 1dafd5bbdc04980192a38355d21915436b3bccae..42f6b525cd4df172a4cce18914ad02f4fae13ead 100644 (file)
@@ -351,7 +351,7 @@ bool GSQLBackend::setAccount(const ZoneName &domain, const string &account)
   return true;
 }
 
-bool GSQLBackend::getDomainInfo(const ZoneName &domain, DomainInfo &di, bool getSerial)
+bool GSQLBackend::getDomainInfo(const ZoneName &domain, DomainInfo &info, bool getSerial)
 {
   /* fill DomainInfo from database info:
      id,name,master IP(s),last_check,notified_serial,type,account */
@@ -376,34 +376,34 @@ bool GSQLBackend::getDomainInfo(const ZoneName &domain, DomainInfo &di, bool get
 
   ASSERT_ROW_COLUMNS("info-zone-query", d_result[0], 9);
 
-  pdns::checked_stoi_into(di.id, d_result[0][0]);
+  pdns::checked_stoi_into(info.id, d_result[0][0]);
   try {
-    di.zone=ZoneName(d_result[0][1]);
-    di.catalog = (!d_result[0][7].empty() ? ZoneName(d_result[0][7]) : ZoneName());
+    info.zone=ZoneName(d_result[0][1]);
+    info.catalog = (!d_result[0][7].empty() ? ZoneName(d_result[0][7]) : ZoneName());
   } catch (...) {
     return false;
   }
   string type=d_result[0][5];
-  di.options = d_result[0][6];
-  di.account = d_result[0][8];
-  di.kind = DomainInfo::stringToKind(type);
+  info.options = d_result[0][6];
+  info.account = d_result[0][8];
+  info.kind = DomainInfo::stringToKind(type);
 
   vector<string> primaries;
   stringtok(primaries, d_result[0][2], " ,\t");
   for (const auto& m : primaries)
-    di.primaries.emplace_back(m, 53);
-  pdns::checked_stoi_into(di.last_check, d_result[0][3]);
-  pdns::checked_stoi_into(di.notified_serial, d_result[0][4]);
-  di.backend=this;
+    info.primaries.emplace_back(m, 53);
+  pdns::checked_stoi_into(info.last_check, d_result[0][3]);
+  pdns::checked_stoi_into(info.notified_serial, d_result[0][4]);
+  info.backend=this;
 
-  di.serial = 0;
+  info.serial = 0;
   if(getSerial) {
     try {
       SOAData sd;
       if(!getSOA(domain, sd))
         g_log<<Logger::Notice<<"No serial for '"<<domain<<"' found - zone is missing?"<<endl;
       else
-        di.serial = sd.serial;
+        info.serial = sd.serial;
     }
     catch(PDNSException &ae){
       g_log<<Logger::Error<<"Error retrieving serial for '"<<domain<<"': "<<ae.reason<<endl;
@@ -989,7 +989,7 @@ bool GSQLBackend::getBeforeAndAfterNamesAbsolute(uint32_t id, const DNSName& qna
   return true;
 }
 
-bool GSQLBackend::addDomainKey(const ZoneName& name, const KeyData& key, int64_t& id)
+bool GSQLBackend::addDomainKey(const ZoneName& name, const KeyData& key, int64_t& keyId)
 {
   if(!d_dnssecQueries)
     return false;
@@ -1010,7 +1010,7 @@ bool GSQLBackend::addDomainKey(const ZoneName& name, const KeyData& key, int64_t
     if (d_AddDomainKeyQuery_stmt->hasNextRow()) {
       SSqlStatement::row_t row;
       d_AddDomainKeyQuery_stmt->nextRow(row);
-      id = std::stoi(row[0]);
+      keyId = std::stoi(row[0]);
       d_AddDomainKeyQuery_stmt->reset();
       return true;
     } else {
@@ -1026,27 +1026,27 @@ bool GSQLBackend::addDomainKey(const ZoneName& name, const KeyData& key, int64_t
 
     d_GetLastInsertedKeyIdQuery_stmt->execute();
     if (!d_GetLastInsertedKeyIdQuery_stmt->hasNextRow()) {
-      id = -2;
+      keyId = -2;
       return true;
     }
     SSqlStatement::row_t row;
     d_GetLastInsertedKeyIdQuery_stmt->nextRow(row);
     ASSERT_ROW_COLUMNS("get-last-inserted-key-id-query", row, 1);
-    id = std::stoi(row[0]);
+    keyId = std::stoi(row[0]);
     d_GetLastInsertedKeyIdQuery_stmt->reset();
-    if (id == 0) {
+    if (keyId == 0) {
       // No insert took place, report as error.
-      id = -1;
+      keyId = -1;
     }
     return true;
   }
   catch (SSqlException &e) {
-    id = -2;
+    keyId = -2;
     return true;
   }
 }
 
-bool GSQLBackend::activateDomainKey(const ZoneName& name, unsigned int id)
+bool GSQLBackend::activateDomainKey(const ZoneName& name, unsigned int keyId)
 {
   if(!d_dnssecQueries)
     return false;
@@ -1057,18 +1057,18 @@ bool GSQLBackend::activateDomainKey(const ZoneName& name, unsigned int id)
     // clang-format off
     d_ActivateDomainKeyQuery_stmt->
       bind("domain", name)->
-      bind("key_id", id)->
+      bind("key_id", keyId)->
       execute()->
       reset();
     // clang-format on
   }
   catch (SSqlException &e) {
-    throw PDNSException("GSQLBackend unable to activate key with id "+ std::to_string(id) + " for domain '" + name.toLogString() + "': "+e.txtReason());
+    throw PDNSException("GSQLBackend unable to activate key with id "+ std::to_string(keyId) + " for domain '" + name.toLogString() + "': "+e.txtReason());
   }
   return true;
 }
 
-bool GSQLBackend::deactivateDomainKey(const ZoneName& name, unsigned int id)
+bool GSQLBackend::deactivateDomainKey(const ZoneName& name, unsigned int keyId)
 {
   if(!d_dnssecQueries)
     return false;
@@ -1079,18 +1079,18 @@ bool GSQLBackend::deactivateDomainKey(const ZoneName& name, unsigned int id)
     // clang-format off
     d_DeactivateDomainKeyQuery_stmt->
       bind("domain", name)->
-      bind("key_id", id)->
+      bind("key_id", keyId)->
       execute()->
       reset();
     // clang-format on
   }
   catch (SSqlException &e) {
-    throw PDNSException("GSQLBackend unable to deactivate key with id "+ std::to_string(id) + " for domain '" + name.toLogString() + "': "+e.txtReason());
+    throw PDNSException("GSQLBackend unable to deactivate key with id "+ std::to_string(keyId) + " for domain '" + name.toLogString() + "': "+e.txtReason());
   }
   return true;
 }
 
-bool GSQLBackend::publishDomainKey(const ZoneName& name, unsigned int id)
+bool GSQLBackend::publishDomainKey(const ZoneName& name, unsigned int keyId)
 {
   if(!d_dnssecQueries)
     return false;
@@ -1101,18 +1101,18 @@ bool GSQLBackend::publishDomainKey(const ZoneName& name, unsigned int id)
     // clang-format off
     d_PublishDomainKeyQuery_stmt->
       bind("domain", name)->
-      bind("key_id", id)->
+      bind("key_id", keyId)->
       execute()->
       reset();
     // clang-format on
   }
   catch (SSqlException &e) {
-    throw PDNSException("GSQLBackend unable to publish key with id "+ std::to_string(id) + " for domain '" + name.toLogString() + "': "+e.txtReason());
+    throw PDNSException("GSQLBackend unable to publish key with id "+ std::to_string(keyId) + " for domain '" + name.toLogString() + "': "+e.txtReason());
   }
   return true;
 }
 
-bool GSQLBackend::unpublishDomainKey(const ZoneName& name, unsigned int id)
+bool GSQLBackend::unpublishDomainKey(const ZoneName& name, unsigned int keyId)
 {
   if(!d_dnssecQueries)
     return false;
@@ -1123,20 +1123,20 @@ bool GSQLBackend::unpublishDomainKey(const ZoneName& name, unsigned int id)
     // clang-format off
     d_UnpublishDomainKeyQuery_stmt->
       bind("domain", name)->
-      bind("key_id", id)->
+      bind("key_id", keyId)->
       execute()->
       reset();
     // clang-format on
   }
   catch (SSqlException &e) {
-    throw PDNSException("GSQLBackend unable to unpublish key with id "+ std::to_string(id) + " for domain '" + name.toLogString() + "': "+e.txtReason());
+    throw PDNSException("GSQLBackend unable to unpublish key with id "+ std::to_string(keyId) + " for domain '" + name.toLogString() + "': "+e.txtReason());
   }
   return true;
 }
 
 
 
-bool GSQLBackend::removeDomainKey(const ZoneName& name, unsigned int id)
+bool GSQLBackend::removeDomainKey(const ZoneName& name, unsigned int keyId)
 {
   if(!d_dnssecQueries)
     return false;
@@ -1147,13 +1147,13 @@ bool GSQLBackend::removeDomainKey(const ZoneName& name, unsigned int id)
     // clang-format off
     d_RemoveDomainKeyQuery_stmt->
       bind("domain", name)->
-      bind("key_id", id)->
+      bind("key_id", keyId)->
       execute()->
       reset();
     // clang-format on
   }
   catch (SSqlException &e) {
-    throw PDNSException("GSQLBackend unable to remove key with id "+ std::to_string(id) + " for domain '" + name.toLogString() + "': "+e.txtReason());
+    throw PDNSException("GSQLBackend unable to remove key with id "+ std::to_string(keyId) + " for domain '" + name.toLogString() + "': "+e.txtReason());
   }
   return true;
 }
@@ -1609,7 +1609,7 @@ bool GSQLBackend::autoPrimariesList(std::vector<AutoPrimary>& primaries)
   return true;
 }
 
-bool GSQLBackend::autoPrimaryBackend(const string& ip, const ZoneName& domain, const vector<DNSResourceRecord>& nsset, string* nameserver, string* account, DNSBackend** ddb)
+bool GSQLBackend::autoPrimaryBackend(const string& ipAddress, const ZoneName& domain, const vector<DNSResourceRecord>& nsset, string* nameserver, string* account, DNSBackend** ddb)
 {
   // check if we know the ip/ns couple in the database
   for(const auto & i : nsset) {
@@ -1618,7 +1618,7 @@ bool GSQLBackend::autoPrimaryBackend(const string& ip, const ZoneName& domain, c
 
       // clang-format off
       d_AutoPrimaryInfoQuery_stmt->
-        bind("ip", ip)->
+        bind("ip", ipAddress)->
         bind("nameserver", i.content)->
         execute()->
         getResult(d_result)->
@@ -1626,7 +1626,7 @@ bool GSQLBackend::autoPrimaryBackend(const string& ip, const ZoneName& domain, c
       // clang-format on
     }
     catch (SSqlException &e) {
-      throw PDNSException("GSQLBackend unable to search for a autoprimary with IP " + ip + " and nameserver name '" + i.content + "' for domain '" + domain.toLogString() + "': " + e.txtReason());
+      throw PDNSException("GSQLBackend unable to search for a autoprimary with IP " + ipAddress + " and nameserver name '" + i.content + "' for domain '" + domain.toLogString() + "': " + e.txtReason());
     }
     if(!d_result.empty()) {
       ASSERT_ROW_COLUMNS("autoprimary-query", d_result[0], 1);
@@ -1666,10 +1666,10 @@ bool GSQLBackend::createDomain(const ZoneName& domain, const DomainInfo::DomainK
   return true;
 }
 
-bool GSQLBackend::createSecondaryDomain(const string& ip, const ZoneName& domain, const string& nameserver, const string& account)
+bool GSQLBackend::createSecondaryDomain(const string& ipAddress, const ZoneName& domain, const string& nameserver, const string& account)
 {
   string name;
-  vector<ComboAddress> primaries({ComboAddress(ip, 53)});
+  vector<ComboAddress> primaries({ComboAddress(ipAddress, 53)});
   try {
     if (!nameserver.empty()) {
       // figure out all IP addresses for the primary
index 3ee05ca7c438930ea66973b18da80cfd2cb7a311..5a9e51baf49125de40918e50241f931fa3ff2fec 100644 (file)
@@ -206,18 +206,18 @@ public:
   bool feedEnts(int domain_id, map<DNSName,bool>& nonterm) override;
   bool feedEnts3(int domain_id, const DNSName &domain, map<DNSName,bool> &nonterm, const NSEC3PARAMRecordContent& ns3prc, bool narrow) override;
   bool createDomain(const ZoneName& domain, const DomainInfo::DomainKind kind, const vector<ComboAddress>& primaries, const string& account) override;
-  bool createSecondaryDomain(const string& ip, const ZoneName& domain, const string& nameserver, const string& account) override;
+  bool createSecondaryDomain(const string& ipAddress, const ZoneName& domain, const string& nameserver, const string& account) override;
   bool deleteDomain(const ZoneName &domain) override;
   bool autoPrimaryAdd(const AutoPrimary& primary) override;
   bool autoPrimaryRemove(const AutoPrimary& primary) override;
   bool autoPrimariesList(std::vector<AutoPrimary>& primaries) override;
-  bool autoPrimaryBackend(const string& ip, const ZoneName& domain, const vector<DNSResourceRecord>& nsset, string* nameserver, string* account, DNSBackend** db) override;
+  bool autoPrimaryBackend(const string& ipAddress, const ZoneName& domain, const vector<DNSResourceRecord>& nsset, string* nameserver, string* account, DNSBackend** db) override;
   void setStale(uint32_t domain_id) override;
   void setFresh(uint32_t domain_id) override;
   void getUnfreshSecondaryInfos(vector<DomainInfo>* domains) override;
   void getUpdatedPrimaries(vector<DomainInfo>& updatedDomains, std::unordered_set<DNSName>& catalogs, CatalogHashMap& catalogHashes) override;
   bool getCatalogMembers(const ZoneName& catalog, vector<CatalogInfo>& members, CatalogInfo::CatalogType type) override;
-  bool getDomainInfo(const ZoneName &domain, DomainInfo &di, bool getSerial=true) override;
+  bool getDomainInfo(const ZoneName &domain, DomainInfo &info, bool getSerial=true) override;
   void setNotified(uint32_t domain_id, uint32_t serial) override;
   bool setPrimaries(const ZoneName& domain, const vector<ComboAddress>& primaries) override;
   bool setKind(const ZoneName &domain, const DomainInfo::DomainKind kind) override;
@@ -238,11 +238,11 @@ public:
   bool getDomainMetadata(const ZoneName& name, const std::string& kind, std::vector<std::string>& meta) override;
   bool setDomainMetadata(const ZoneName& name, const std::string& kind, const std::vector<std::string>& meta) override;
 
-  bool removeDomainKey(const ZoneName& name, unsigned int id) override;
-  bool activateDomainKey(const ZoneName& name, unsigned int id) override;
-  bool deactivateDomainKey(const ZoneName& name, unsigned int id) override;
-  bool publishDomainKey(const ZoneName& name, unsigned int id) override;
-  bool unpublishDomainKey(const ZoneName& name, unsigned int id) override;
+  bool removeDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool activateDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool deactivateDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool publishDomainKey(const ZoneName& name, unsigned int keyId) override;
+  bool unpublishDomainKey(const ZoneName& name, unsigned int keyId) override;
 
   bool getTSIGKey(const DNSName& name, DNSName& algorithm, string& content) override;
   bool setTSIGKey(const DNSName& name, const DNSName& algorithm, const string& content) override;
index 7af12f9811918e471401b7ba527cd8d967b48d7d..2ff0e2d56c9ca0feaff8fcc5a026ad3baf864ffa 100644 (file)
@@ -169,16 +169,16 @@ public:
   time_t doNotifications(PacketHandler* P);
   void go();
 
-  void drillHole(const ZoneName& domain, const string& ip);
-  bool justNotified(const ZoneName& domain, const string& ip);
+  void drillHole(const ZoneName& domain, const string& ipAddress);
+  bool justNotified(const ZoneName& domain, const string& ipAddress);
   void addSuckRequest(const ZoneName& domain, const ComboAddress& primary, SuckRequest::RequestPriority, bool force = false);
   void addSecondaryCheckRequest(const DomainInfo& di, const ComboAddress& remote);
   void addTryAutoPrimaryRequest(const DNSPacket& p);
-  void notify(const ZoneName& domain, const string& ip);
+  void notify(const ZoneName& domain, const string& ipAddress);
   void mainloop();
   void retrievalLoopThread();
-  void sendNotification(int sock, const ZoneName& domain, const ComboAddress& remote, uint16_t id, UeberBackend* B);
-  bool notifyDomain(const ZoneName& domain, UeberBackend* B);
+  static void sendNotification(int sock, const ZoneName& domain, const ComboAddress& remote, uint16_t notificationId, UeberBackend* ueber);
+  bool notifyDomain(const ZoneName& domain, UeberBackend* ueber);
   vector<pair<ZoneName, ComboAddress>> getSuckRequests();
   size_t getSuckRequestsWaiting();
 
@@ -190,7 +190,7 @@ private:
   LockGuarded<map<pair<ZoneName, string>, time_t>> d_holes;
 
   void suck(const ZoneName& domain, const ComboAddress& remote, bool force = false);
-  void ixfrSuck(const ZoneName& domain, const TSIGTriplet& tt, const ComboAddress& laddr, const ComboAddress& remote, ZoneStatus& zs, vector<DNSRecord>* axfr);
+  static void ixfrSuck(const ZoneName& domain, const TSIGTriplet& tsig, const ComboAddress& laddr, const ComboAddress& remote, ZoneStatus& status, vector<DNSRecord>* axfr);
 
   void secondaryRefresh(PacketHandler* P);
   void primaryUpdateCheck(PacketHandler* P);
index d3ce6015f835f952e3ff1121f5a50a456fdb80da..de797a0d7295ad17a5d3bfcc0ee03cafeff7ac61 100644 (file)
@@ -86,7 +86,7 @@ bool DNSSECKeeper::isPresigned(const ZoneName& name, bool useCache)
 }
 
 
-bool DNSSECKeeper::addKey(const ZoneName& name, bool setSEPBit, int algorithm, int64_t& id, int bits, bool active, bool published)
+bool DNSSECKeeper::addKey(const ZoneName& name, bool setSEPBit, int algorithm, int64_t& keyId, int bits, bool active, bool published)
 {
   if(!bits) {
     if(algorithm <= 10)
@@ -111,7 +111,7 @@ bool DNSSECKeeper::addKey(const ZoneName& name, bool setSEPBit, int algorithm, i
   }
   DNSSECPrivateKey dspk;
   dspk.setKey(dpk, setSEPBit ? 257 : 256, algorithm);
-  return addKey(name, dspk, id, active, published) && clearKeyCache(name);
+  return addKey(name, dspk, keyId, active, published) && clearKeyCache(name);
 }
 
 void DNSSECKeeper::clearAllCaches() {
@@ -140,7 +140,7 @@ void DNSSECKeeper::clearCaches(const ZoneName& name)
   (void)clearMetaCache(name);
 }
 
-bool DNSSECKeeper::addKey(const ZoneName& name, const DNSSECPrivateKey& dpk, int64_t& id, bool active, bool published)
+bool DNSSECKeeper::addKey(const ZoneName& name, const DNSSECPrivateKey& dpk, int64_t& keyId, bool active, bool published)
 {
   DNSBackend::KeyData kd;
   kd.flags = dpk.getFlags(); // the dpk doesn't get stored, only they key part
@@ -148,7 +148,7 @@ bool DNSSECKeeper::addKey(const ZoneName& name, const DNSSECPrivateKey& dpk, int
   kd.published = published;
   kd.content = dpk.getKey()->convertToISC();
  // now store it
-  return d_keymetadb->addDomainKey(name, kd, id) && clearKeyCache(name);
+  return d_keymetadb->addDomainKey(name, kd, keyId) && clearKeyCache(name);
 }
 
 
@@ -158,12 +158,12 @@ static bool keyCompareByKindAndID(const DNSSECKeeper::keyset_t::value_type& a, c
          pair(!b.second.keyType, b.second.id);
 }
 
-DNSSECPrivateKey DNSSECKeeper::getKeyById(const ZoneName& zname, unsigned int id)
+DNSSECPrivateKey DNSSECKeeper::getKeyById(const ZoneName& zname, unsigned int keyId)
 {
   vector<DNSBackend::KeyData> keys;
   d_keymetadb->getDomainKeys(zname, keys);
   for(const DNSBackend::KeyData& kd :  keys) {
-    if(kd.id != id)
+    if(kd.id != keyId)
       continue;
 
     DNSKEYRecordContent dkrc;
@@ -173,33 +173,33 @@ DNSSECPrivateKey DNSSECKeeper::getKeyById(const ZoneName& zname, unsigned int id
 
     return dpk;
   }
-  throw runtime_error("Can't find a key with id "+std::to_string(id)+" for zone '"+zname.toLogString()+"'");
+  throw runtime_error("Can't find a key with id "+std::to_string(keyId)+" for zone '"+zname.toLogString()+"'");
 }
 
 
-bool DNSSECKeeper::removeKey(const ZoneName& zname, unsigned int id)
+bool DNSSECKeeper::removeKey(const ZoneName& zname, unsigned int keyId)
 {
-  return d_keymetadb->removeDomainKey(zname, id) && clearKeyCache(zname);
+  return d_keymetadb->removeDomainKey(zname, keyId) && clearKeyCache(zname);
 }
 
-bool DNSSECKeeper::deactivateKey(const ZoneName& zname, unsigned int id)
+bool DNSSECKeeper::deactivateKey(const ZoneName& zname, unsigned int keyId)
 {
-  return d_keymetadb->deactivateDomainKey(zname, id) && clearKeyCache(zname);
+  return d_keymetadb->deactivateDomainKey(zname, keyId) && clearKeyCache(zname);
 }
 
-bool DNSSECKeeper::activateKey(const ZoneName& zname, unsigned int id)
+bool DNSSECKeeper::activateKey(const ZoneName& zname, unsigned int keyId)
 {
-  return d_keymetadb->activateDomainKey(zname, id) && clearKeyCache(zname);
+  return d_keymetadb->activateDomainKey(zname, keyId) && clearKeyCache(zname);
 }
 
-bool DNSSECKeeper::unpublishKey(const ZoneName& zname, unsigned int id)
+bool DNSSECKeeper::unpublishKey(const ZoneName& zname, unsigned int keyId)
 {
-  return d_keymetadb->unpublishDomainKey(zname, id) && clearKeyCache(zname);
+  return d_keymetadb->unpublishDomainKey(zname, keyId) && clearKeyCache(zname);
 }
 
-bool DNSSECKeeper::publishKey(const ZoneName& zname, unsigned int id)
+bool DNSSECKeeper::publishKey(const ZoneName& zname, unsigned int keyId)
 {
-  return d_keymetadb->publishDomainKey(zname, id) && clearKeyCache(zname);
+  return d_keymetadb->publishDomainKey(zname, keyId) && clearKeyCache(zname);
 }
 
 void DNSSECKeeper::getFromMetaOrDefault(const ZoneName& zname, const std::string& key, std::string& value, const std::string& defaultvalue)
index db5fc19af744ef4e93a5f9243ef3cd0ab513bd3e..fe33b449408e00729ce48c084054e52ebcc2a68d 100644 (file)
@@ -300,10 +300,10 @@ bool DNSBackend::get(DNSZoneRecord& zoneRecord)
   return true;
 }
 
-bool DNSBackend::getBeforeAndAfterNames(uint32_t id, const ZoneName& zonename, const DNSName& qname, DNSName& before, DNSName& after)
+bool DNSBackend::getBeforeAndAfterNames(uint32_t domainId, const ZoneName& zonename, const DNSName& qname, DNSName& before, DNSName& after)
 {
   DNSName unhashed;
-  bool ret = this->getBeforeAndAfterNamesAbsolute(id, qname.makeRelative(zonename).makeLowerCase(), unhashed, before, after);
+  bool ret = this->getBeforeAndAfterNamesAbsolute(domainId, qname.makeRelative(zonename).makeLowerCase(), unhashed, before, after);
   DNSName lczonename = zonename.makeLowerCase();
   before += lczonename;
   after += lczonename;
index 3a9b8c8b0115030df8832b47518f0f0fbaea553c..b75b36b839e2ceb116ac599f0f4a375868d8f7f8 100644 (file)
@@ -292,7 +292,7 @@ string hashQNameWithSalt(const std::string& salt, unsigned int iterations, const
 void incrementHash(std::string& raw);
 void decrementHash(std::string& raw);
 
-void addRRSigs(DNSSECKeeper& dk, UeberBackend& db, const std::set<ZoneName>& authSet, vector<DNSZoneRecord>& rrs, DNSPacket* packet=nullptr);
+void addRRSigs(DNSSECKeeper& dsk, UeberBackend& ueber, const std::set<ZoneName>& authSet, vector<DNSZoneRecord>& rrs, DNSPacket* packet=nullptr);
 
 void addTSIG(DNSPacketWriter& pw, TSIGRecordContent& trc, const DNSName& tsigkeyname, const string& tsigsecret, const string& tsigprevious, bool timersonly);
 bool validateTSIG(const std::string& packet, size_t sigPos, const TSIGTriplet& tt, const TSIGRecordContent& trc, const std::string& previousMAC, const std::string& theirMAC, bool timersOnly, unsigned int dnsHeaderOffset=0);
index 5af42115d118820766b8beedf89e4e1f67b00218..05e3f76d16695c86dc62756b46769f74fcacf6f5 100644 (file)
@@ -195,19 +195,19 @@ public:
   bool isSecuredZone(const ZoneName& zone, bool useCache=true);
   keyset_t getEntryPoints(const ZoneName& zname);
   keyset_t getKeys(const ZoneName& zone, bool useCache = true);
-  DNSSECPrivateKey getKeyById(const ZoneName& zone, unsigned int id);
-  bool addKey(const ZoneName& zname, bool setSEPBit, int algorithm, int64_t& id, int bits=0, bool active=true, bool published=true);
-  bool addKey(const ZoneName& zname, const DNSSECPrivateKey& dpk, int64_t& id, bool active=true, bool published=true);
-  bool removeKey(const ZoneName& zname, unsigned int id);
-  bool activateKey(const ZoneName& zname, unsigned int id);
-  bool deactivateKey(const ZoneName& zname, unsigned int id);
-  bool publishKey(const ZoneName& zname, unsigned int id);
-  bool unpublishKey(const ZoneName& zname, unsigned int id);
-  bool checkKeys(const ZoneName& zname, std::optional<std::reference_wrapper<std::vector<std::string>>> errorMessages);
-
-  bool getNSEC3PARAM(const ZoneName& zname, NSEC3PARAMRecordContent* n3p=nullptr, bool* narrow=nullptr, bool useCache=true);
+  DNSSECPrivateKey getKeyById(const ZoneName& zname, unsigned int keyId);
+  bool addKey(const ZoneName& zname, bool setSEPBit, int algorithm, int64_t& keyId, int bits=0, bool active=true, bool published=true);
+  bool addKey(const ZoneName& zname, const DNSSECPrivateKey& dpk, int64_t& keyId, bool active=true, bool published=true);
+  bool removeKey(const ZoneName& zname, unsigned int keyId);
+  bool activateKey(const ZoneName& zname, unsigned int keyId);
+  bool deactivateKey(const ZoneName& zname, unsigned int keyId);
+  bool publishKey(const ZoneName& zname, unsigned int keyId);
+  bool unpublishKey(const ZoneName& zname, unsigned int keyId);
+  bool checkKeys(const ZoneName& zone, std::optional<std::reference_wrapper<std::vector<std::string>>> errorMessages);
+
+  bool getNSEC3PARAM(const ZoneName& zname, NSEC3PARAMRecordContent* ns3p=nullptr, bool* narrow=nullptr, bool useCache=true);
   bool checkNSEC3PARAM(const NSEC3PARAMRecordContent& ns3p, string& msg);
-  bool setNSEC3PARAM(const ZoneName& zname, const NSEC3PARAMRecordContent& n3p, const bool& narrow=false);
+  bool setNSEC3PARAM(const ZoneName& zname, const NSEC3PARAMRecordContent& ns3p, const bool& narrow=false);
   bool unsetNSEC3PARAM(const ZoneName& zname);
   void getPreRRSIGs(UeberBackend& db, vector<DNSZoneRecord>& rrs, uint32_t signTTL, DNSPacket* p=nullptr);
   bool isPresigned(const ZoneName& zname, bool useCache=true);
@@ -306,7 +306,7 @@ private:
 
 uint32_t localtime_format_YYYYMMDDSS(time_t t, uint32_t seq);
 // for SOA-EDIT
-uint32_t calculateEditSOA(uint32_t old_serial, DNSSECKeeper& dk, const ZoneName& zonename);
+uint32_t calculateEditSOA(uint32_t old_serial, DNSSECKeeper& dsk, const ZoneName& zonename);
 uint32_t calculateEditSOA(uint32_t old_serial, const string& kind, const ZoneName& zonename);
 // for SOA-EDIT-DNSUPDATE/API
 bool increaseSOARecord(DNSResourceRecord& dr, const string& increaseKind, const string& editKind);
index 50fe1a3b6482763318cb2c526241f0cbf9de491b..e092db02c66c701203eb68a953fa75fed1af81ef 100644 (file)
@@ -106,7 +106,7 @@ static void fillOutRRSIG(DNSSECPrivateKey& dpk, const DNSName& signQName, RRSIGR
 
 /* this is where the RRSIGs begin, keys are retrieved,
    but the actual signing happens in fillOutRRSIG */
-static int getRRSIGsForRRSET(DNSSECKeeper& dk, const ZoneName& signer, const DNSName& signQName, uint16_t signQType, uint32_t signTTL,
+static int getRRSIGsForRRSET(DNSSECKeeper& dsk, const ZoneName& signer, const DNSName& signQName, uint16_t signQType, uint32_t signTTL,
                              const sortedRecords_t& toSign, vector<RRSIGRecordContent>& rrcs)
 {
   if(toSign.empty())
@@ -122,7 +122,7 @@ static int getRRSIGsForRRSET(DNSSECKeeper& dk, const ZoneName& signer, const DNS
   rrc.d_signer = signer;
   rrc.d_tag = 0;
 
-  DNSSECKeeper::keyset_t keys = dk.getKeys(signer);
+  DNSSECKeeper::keyset_t keys = dsk.getKeys(signer);
 
   for(DNSSECKeeper::keyset_t::value_type& keymeta : keys) {
     if(!keymeta.second.active)
@@ -143,7 +143,7 @@ static int getRRSIGsForRRSET(DNSSECKeeper& dk, const ZoneName& signer, const DNS
 }
 
 // this is the entrypoint from DNSPacket
-static void addSignature(DNSSECKeeper& dk, UeberBackend& db, const ZoneName& signer, const DNSName& signQName, const DNSName& wildcardname, uint16_t signQType,
+static void addSignature(DNSSECKeeper& dsk, UeberBackend& ueber, const ZoneName& signer, const DNSName& signQName, const DNSName& wildcardname, uint16_t signQType,
                          uint32_t signTTL, DNSResourceRecord::Place signPlace,
                          sortedRecords_t& toSign, vector<DNSZoneRecord>& outsigned, uint32_t origTTL, DNSPacket* packet)
 {
@@ -153,12 +153,12 @@ static void addSignature(DNSSECKeeper& dk, UeberBackend& db, const ZoneName& sig
   if(toSign.empty())
     return;
   vector<RRSIGRecordContent> rrcs;
-  if(dk.isPresigned(signer) || (directDNSKEYSignature && signQType == QType::DNSKEY)) {
+  if(dsk.isPresigned(signer) || (directDNSKEYSignature && signQType == QType::DNSKEY)) {
     //cerr<<"Doing presignatures"<<endl;
-    dk.getPreRRSIGs(db, outsigned, origTTL, packet); // does it all
+    dsk.getPreRRSIGs(ueber, outsigned, origTTL, packet); // does it all
   }
   else {
-    if(getRRSIGsForRRSET(dk, signer, wildcardname.countLabels() ? wildcardname : signQName, signQType, signTTL, toSign, rrcs) < 0)  {
+    if(getRRSIGsForRRSET(dsk, signer, wildcardname.countLabels() ? wildcardname : signQName, signQType, signTTL, toSign, rrcs) < 0)  {
       // cerr<<"Error signing a record!"<<endl;
       return;
     }
@@ -190,13 +190,13 @@ static bool rrsigncomp(const DNSZoneRecord& a, const DNSZoneRecord& b)
   return std::tie(a.dr.d_place, a.dr.d_type) < std::tie(b.dr.d_place, b.dr.d_type);
 }
 
-static bool getBestAuthFromSet(const set<ZoneName>& authSet, const DNSName& name, ZoneName& auth)
+static bool getBestAuthFromSet(const set<ZoneName>& authSet, const DNSName& name, ZoneName& signer)
 {
-  auth.trimToLabels(0);
+  signer.trimToLabels(0);
   ZoneName sname(name);
   do {
     if(authSet.find(sname) != authSet.end()) {
-      auth = sname;
+      signer = sname;
       return true;
     }
   }
@@ -205,7 +205,7 @@ static bool getBestAuthFromSet(const set<ZoneName>& authSet, const DNSName& name
   return false;
 }
 
-void addRRSigs(DNSSECKeeper& dk, UeberBackend& db, const set<ZoneName>& authSet, vector<DNSZoneRecord>& rrs, DNSPacket* packet)
+void addRRSigs(DNSSECKeeper& dsk, UeberBackend& ueber, const set<ZoneName>& authSet, vector<DNSZoneRecord>& rrs, DNSPacket* packet)
 {
   stable_sort(rrs.begin(), rrs.end(), rrsigncomp);
 
@@ -224,7 +224,7 @@ void addRRSigs(DNSSECKeeper& dk, UeberBackend& db, const set<ZoneName>& authSet,
   for(auto pos = rrs.cbegin(); pos != rrs.cend(); ++pos) {
     if(pos != rrs.cbegin() && (signQType != pos->dr.d_type  || signQName != pos->dr.d_name)) {
       if (getBestAuthFromSet(authSet, authQName, signer))
-        addSignature(dk, db, signer, signQName, wildcardQName, signQType, signTTL, signPlace, toSign, signedRecords, origTTL, packet);
+        addSignature(dsk, ueber, signer, signQName, wildcardQName, signQType, signTTL, signPlace, toSign, signedRecords, origTTL, packet);
     }
     signedRecords.push_back(*pos);
     signQName = pos->dr.d_name.makeLowerCase();
@@ -250,6 +250,6 @@ void addRRSigs(DNSSECKeeper& dk, UeberBackend& db, const set<ZoneName>& authSet,
     }
   }
   if (getBestAuthFromSet(authSet, authQName, signer))
-    addSignature(dk, db, signer, signQName, wildcardQName, signQType, signTTL, signPlace, toSign, signedRecords, origTTL, packet);
+    addSignature(dsk, ueber, signer, signQName, wildcardQName, signQType, signTTL, signPlace, toSign, signedRecords, origTTL, packet);
   rrs.swap(signedRecords);
 }
index 2fef06ac1f6f40280767d7c7e696ba17946eb41c..074c574caa4cb0efb22a62451bd7f9bbf71a3132 100644 (file)
@@ -348,8 +348,9 @@ string DLNotifyHandler(const vector<string>& parts, Utility::pid_t /* ppid */)
     } catch (...) {
       return "Failed to parse zone as valid DNS name";
     }
-    if(!Communicator.notifyDomain(domain, &B))
+    if(!Communicator.notifyDomain(domain, &B)) {
       return "Failed to add to the queue - see log";
+    }
     return "Added to queue";
   }
 }
index 5babad55f467eb6ac25399cd9b9b93d967840989..43ddadaa1e07b651ab8b75b3a03b3d09d0372fc8 100644 (file)
 #include "zoneparser-tng.hh"
 #include "dnsparser.hh"
 
-uint32_t getSerialFromPrimary(const ComboAddress& primary, const ZoneName& zone, shared_ptr<const SOARecordContent>& sr, const TSIGTriplet& tt, const uint16_t timeout)
+uint32_t getSerialFromPrimary(const ComboAddress& primary, const ZoneName& zone, shared_ptr<const SOARecordContent>& soarecord, const TSIGTriplet& tsig, const uint16_t timeout)
 {
   vector<uint8_t> packet;
   DNSPacketWriter pw(packet, zone, QType::SOA);
-  if(!tt.algo.empty()) {
+  if(!tsig.algo.empty()) {
     TSIGRecordContent trc;
-    trc.d_algoName = tt.algo;
+    trc.d_algoName = tsig.algo;
     trc.d_time = time(nullptr);
     trc.d_fudge = 300;
     trc.d_origID=ntohs(pw.getHeader()->id);
     trc.d_eRcode=0;
-    addTSIG(pw, trc, tt.name, tt.secret, "", false);
+    addTSIG(pw, trc, tsig.name, tsig.secret, "", false);
   }
 
   Socket s(primary.sin4.sin_family, SOCK_DGRAM);
@@ -66,9 +66,9 @@ uint32_t getSerialFromPrimary(const ComboAddress& primary, const ZoneName& zone,
   }
   for(const auto& r: mdp.d_answers) {
     if(r.d_type == QType::SOA) {
-      sr = getRR<SOARecordContent>(r);
-      if(sr != nullptr) {
-        return sr->d_st.serial;
+      soarecord = getRR<SOARecordContent>(r);
+      if(soarecord != nullptr) {
+        return soarecord->d_st.serial;
       }
     }
   }
index 92579181b27b1413e5b082678d0753a4565a291c..da22415f3ef5ec1252a55db6febd6967d7f092d6 100644 (file)
@@ -56,7 +56,7 @@ typedef multi_index_container <
     > /* indexed_by */
 > /* multi_index_container */ records_t;
 
-uint32_t getSerialFromPrimary(const ComboAddress& primary, const ZoneName& zone, shared_ptr<const SOARecordContent>& sr, const TSIGTriplet& tt = TSIGTriplet(), const uint16_t timeout = 2);
+uint32_t getSerialFromPrimary(const ComboAddress& primary, const ZoneName& zone, shared_ptr<const SOARecordContent>& soarecord, const TSIGTriplet& tsig = TSIGTriplet(), const uint16_t timeout = 2);
 uint32_t getSerialFromDir(const std::string& dir);
 uint32_t getSerialFromRecords(const records_t& records, DNSRecord& soaret);
 void writeZoneToDisk(const records_t& records, const ZoneName& zone, const std::string& directory);
index bf8bd064afde8106c2a60bc15f985ea2fc0020ee..1421b315b397324255ac787afc4d089bbf35227e 100644 (file)
@@ -73,6 +73,7 @@ int main(int argc, char** argv) {
     }
     if(command=="diff") {
       records_t before, after;
+      // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
       ZoneName zone(argv[2]);
       cout<<"Loading before from "<<argv[3]<<endl;
       loadZoneFromDisk(before, argv[3], zone);
@@ -108,6 +109,7 @@ int main(int argc, char** argv) {
 
        Next up, loop this every REFRESH seconds */
 
+    // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
     ZoneName zone(argv[4]);
     ComboAddress primary(argv[2], atoi(argv[3]));
     string directory(argv[5]);
index c144571792a984ede70cf4dc063f0787e6962c18..ea202ea925808e1f4aa14f0b0c92d7b259f47e5a 100644 (file)
@@ -205,11 +205,11 @@ static int usage(const std::string_view synopsis)
   return EXIT_FAILURE;
 }
 
-static bool rectifyZone(DNSSECKeeper& dk, const ZoneName& zone, bool quiet = false, bool rectifyTransaction = true)
+static bool rectifyZone(DNSSECKeeper& dsk, const ZoneName& zone, bool quiet = false, bool rectifyTransaction = true)
 {
   string output;
   string error;
-  bool ret = dk.rectifyZone(zone, error, output, rectifyTransaction);
+  bool ret = dsk.rectifyZone(zone, error, output, rectifyTransaction);
   if (!quiet || !ret) {
     // When quiet, only print output if there was an error
     if (!output.empty()) {
@@ -944,7 +944,7 @@ static int checkAllZones(DNSSECKeeper &dk, bool exitOnError)
   return EXIT_FAILURE;
 }
 
-static int increaseSerial(const ZoneName& zone, DNSSECKeeper &dk)
+static int increaseSerial(const ZoneName& zone, DNSSECKeeper &dsk)
 {
   UtilBackend B("default"); //NOLINT(readability-identifier-length)
   SOAData sd;
@@ -953,7 +953,7 @@ static int increaseSerial(const ZoneName& zone, DNSSECKeeper &dk)
     return -1;
   }
 
-  if (dk.isPresigned(zone)) {
+  if (dsk.isPresigned(zone)) {
     cerr<<"Serial increase of presigned zone '"<<zone<<"' is not allowed."<<endl;
     return -1;
   }
@@ -972,7 +972,7 @@ static int increaseSerial(const ZoneName& zone, DNSSECKeeper &dk)
   }
 
   string soaEditKind;
-  dk.getSoaEdit(zone, soaEditKind);
+  dsk.getSoaEdit(zone, soaEditKind);
 
   DNSResourceRecord rr;
   makeIncreasedSOARecord(sd, "SOA-EDIT-INCREASE", soaEditKind, rr);
@@ -989,7 +989,7 @@ static int increaseSerial(const ZoneName& zone, DNSSECKeeper &dk)
   if (sd.db->doesDNSSEC()) {
     NSEC3PARAMRecordContent ns3pr;
     bool narrow = false;
-    bool haveNSEC3=dk.getNSEC3PARAM(zone, &ns3pr, &narrow);
+    bool haveNSEC3=dsk.getNSEC3PARAM(zone, &ns3pr, &narrow);
 
     DNSName ordername;
     if(haveNSEC3) {
@@ -2038,7 +2038,7 @@ static void verifyCrypto(const string& zone)
   }
 }
 
-static bool disableDNSSECOnZone(DNSSECKeeper& dk, const ZoneName& zone)
+static bool disableDNSSECOnZone(DNSSECKeeper& dsk, const ZoneName& zone)
 {
   UtilBackend B("default"); //NOLINT(readability-identifier-length)
   DomainInfo di;
@@ -2049,7 +2049,7 @@ static bool disableDNSSECOnZone(DNSSECKeeper& dk, const ZoneName& zone)
   }
 
   string error, info;
-  bool ret = dk.unSecureZone(zone, error);
+  bool ret = dsk.unSecureZone(zone, error);
   if (!ret) {
     cerr << error << endl;
   }
@@ -2387,7 +2387,7 @@ static bool showZone(DNSSECKeeper& dnsseckeeper, const ZoneName& zone, bool expo
   return true;
 }
 
-static bool secureZone(DNSSECKeeper& dk, const ZoneName& zone)
+static bool secureZone(DNSSECKeeper& dsk, const ZoneName& zone)
 {
   // temp var for addKey
   int64_t id{-1};
@@ -2410,7 +2410,7 @@ static bool secureZone(DNSSECKeeper& dk, const ZoneName& zone)
      throw runtime_error("ZSK key size must be equal to or greater than 0");
   }
 
-  if(dk.isSecuredZone(zone)) {
+  if(dsk.isSecuredZone(zone)) {
     cerr << "Zone '"<<zone<<"' already secure, remove keys with pdnsutil remove-zone-key if needed"<<endl;
     return false;
   }
@@ -2438,7 +2438,7 @@ static bool secureZone(DNSSECKeeper& dk, const ZoneName& zone)
 
     int k_real_algo = DNSSECKeeper::shorthand2algorithm(k_algo);
 
-    if (!dk.addKey(zone, true, k_real_algo, id, k_size, true, true)) {
+    if (!dsk.addKey(zone, true, k_real_algo, id, k_size, true, true)) {
       cerr<<"No backend was able to secure '"<<zone<<"', most likely because no DNSSEC"<<endl;
       cerr<<"capable backends are loaded, or because the backends have DNSSEC disabled."<<endl;
       cerr<<"For the Generic SQL backends, set the 'gsqlite3-dnssec', 'gmysql-dnssec' or"<<endl;
@@ -2452,7 +2452,7 @@ static bool secureZone(DNSSECKeeper& dk, const ZoneName& zone)
 
     int z_real_algo = DNSSECKeeper::shorthand2algorithm(z_algo);
 
-    if (!dk.addKey(zone, false, z_real_algo, id, z_size, true, true)) {
+    if (!dsk.addKey(zone, false, z_real_algo, id, z_size, true, true)) {
       cerr<<"No backend was able to secure '"<<zone<<"', most likely because no DNSSEC"<<endl;
       cerr<<"capable backends are loaded, or because the backends have DNSSEC disabled."<<endl;
       cerr<<"For the Generic SQL backends, set the 'gsqlite3-dnssec', 'gmysql-dnssec' or"<<endl;
@@ -2461,7 +2461,7 @@ static bool secureZone(DNSSECKeeper& dk, const ZoneName& zone)
     }
   }
 
-  if(!dk.isSecuredZone(zone)) {
+  if(!dsk.isSecuredZone(zone)) {
     cerr<<"Failed to secure zone. Is your backend dnssec enabled? (set "<<endl;
     cerr<<"gsqlite3-dnssec, or gmysql-dnssec etc). Check this first."<<endl;
     cerr<<"If you run with the BIND backend, make sure you have configured"<<endl;
@@ -2470,13 +2470,13 @@ static bool secureZone(DNSSECKeeper& dk, const ZoneName& zone)
     return false;
   }
 
-  // rectifyZone(dk, zone);
-  // showZone(dk, zone);
+  // rectifyZone(dsk, zone);
+  // showZone(dsk, zone);
   cout<<"Zone "<<zone<<" secured"<<endl;
   return true;
 }
 
-static int testSchema(DNSSECKeeper& dk, const ZoneName& zone)
+static int testSchema(DNSSECKeeper& dsk, const ZoneName& zone)
 {
   cout<<"Note: test-schema will try to create the zone, but it will not remove it."<<endl;
   cout<<"Please clean up after this."<<endl;
@@ -2557,9 +2557,9 @@ static int testSchema(DNSSECKeeper& dk, const ZoneName& zone)
   db->commitTransaction();
 
   cout<<"Securing zone"<<endl;
-  secureZone(dk, zone);
+  secureZone(dsk, zone);
   cout<<"Rectifying zone"<<endl;
-  rectifyZone(dk, zone);
+  rectifyZone(dsk, zone);
   cout<<"Checking underscore ordering"<<endl;
   DNSName before, after;
   db->getBeforeAndAfterNames(di.id, zone, DNSName("z")+zone, before, after);
index 4bba4ea5d3a47b86ea22ec3c3bdbe1ff0a881cf0..834fe1adfcd9c5b014cb13cd1e439cbcd93fec74 100644 (file)
@@ -79,9 +79,9 @@ uint32_t calculateEditSOA(uint32_t old_serial, const string& kind, const ZoneNam
   return old_serial;
 }
 
-uint32_t calculateEditSOA(uint32_t old_serial, DNSSECKeeper& dk, const ZoneName& zonename) {
+uint32_t calculateEditSOA(uint32_t old_serial, DNSSECKeeper& dsk, const ZoneName& zonename) {
   string kind;
-  dk.getSoaEdit(zonename, kind);
+  dsk.getSoaEdit(zonename, kind);
   return calculateEditSOA(old_serial, kind, zonename);
 }
 
index aca5a47d5c1f1cfb2fd7fbe2293dc954b7bc71aa..7b3eb70cc2ddd05ea8278cb688884347cf16e772 100644 (file)
@@ -74,7 +74,7 @@ BOOST_AUTO_TEST_CASE(test_axfr_queue_insert_and_priority_order_after_modify)
     {ZoneName("test4.com"), ComboAddress("0.0.0.0"), false, {SuckRequest::PdnsControl, 4}},
     {ZoneName("test5.com"), ComboAddress("0.0.0.0"), false, {SuckRequest::PdnsControl, 3}},
   };
-  SuckRequest rr = {ZoneName("test3.com"), ComboAddress("0.0.0.0"), false, {SuckRequest::PdnsControl, 5}};
+  SuckRequest rr1 = {ZoneName("test3.com"), ComboAddress("0.0.0.0"), false, {SuckRequest::PdnsControl, 5}};
   SuckRequest rr2 = {ZoneName("test4.com"), ComboAddress("0.0.0.0"), false, {SuckRequest::Api, 6}};
 
   UniQueue suckDomains;
@@ -85,9 +85,9 @@ BOOST_AUTO_TEST_CASE(test_axfr_queue_insert_and_priority_order_after_modify)
   suckDomains.insert(sr[3]);
   suckDomains.insert(sr[4]);
 
-  auto res = suckDomains.insert(rr);
+  auto res = suckDomains.insert(rr1);
   BOOST_CHECK(!res.second);
-  suckDomains.modify(res.first, [priorityAndOrder = rr.priorityAndOrder](SuckRequest& so) {
+  suckDomains.modify(res.first, [priorityAndOrder = rr1.priorityAndOrder](SuckRequest& so) {
     if (priorityAndOrder.first < so.priorityAndOrder.first) {
       so.priorityAndOrder = priorityAndOrder;
     }
index ae94432f98e3c7783ec116c261517203a55a1baf..3b42baa09cdbfe97435e39800d6abe802ef29ed0 100644 (file)
@@ -55,7 +55,7 @@ public:
 
   struct SimpleDNSZone
   {
-    SimpleDNSZone(const ZoneName& name, uint64_t id): d_records(std::make_shared<RecordStorage>()), d_name(name), d_id(id)
+    SimpleDNSZone(ZoneName name, uint64_t domainId): d_records(std::make_shared<RecordStorage>()), d_name(std::move(name)), d_id(domainId)
     {
     }
     std::shared_ptr<RecordStorage> d_records;
@@ -76,7 +76,7 @@ public:
 
   struct SimpleMetaData
   {
-    SimpleMetaData(const ZoneName& name, const std::string& kind, const std::vector<std::string>& values): d_name(name), d_kind(kind), d_values(values)
+    SimpleMetaData(ZoneName name, std::string kind, std::vector<std::string> values): d_name(std::move(name)), d_kind(std::move(kind)), d_values(std::move(values))
     {
     }
 
@@ -96,7 +96,7 @@ public:
                        member<SimpleMetaData, ZoneName, &SimpleMetaData::d_name>,
                        member<SimpleMetaData, std::string, &SimpleMetaData::d_kind>
                        >,
-                     composite_key_compare<CanonZoneNameCompare, std::less<std::string> >
+                     composite_key_compare<CanonZoneNameCompare, std::less<> >
                      >
       >
     > MetaDataStorage;
@@ -248,7 +248,7 @@ public:
   {
   }
 
-  bool getAuth(const ZoneName& target, SOAData* sd) override
+  bool getAuth(const ZoneName& target, SOAData* soadata) override
   {
     static const ZoneName best("d.0.1.0.0.2.ip6.arpa.");
 
@@ -268,14 +268,14 @@ public:
         return false;
       }
 
-      fillSOAData(range.first->d_content, *sd);
-      sd->ttl = range.first->d_ttl;
-      sd->qname = best;
-      sd->domain_id = zoneId;
+      fillSOAData(range.first->d_content, *soadata);
+      soadata->ttl = range.first->d_ttl;
+      soadata->qname = best;
+      soadata->domain_id = zoneId;
       return true;
     }
 
-    return getSOA(target, *sd);
+    return getSOA(target, *soadata);
   }
 
   size_t d_authLookupCount{0};
@@ -1162,11 +1162,11 @@ BOOST_AUTO_TEST_CASE(test_multi_backends_metadata) {
 
     {
       // check that it has not been updated in the second backend
-      const auto& it = SimpleBackend::s_metadata[2].find(std::tuple(ZoneName("powerdns.org."), "test-data-b"));
-      BOOST_REQUIRE(it != SimpleBackend::s_metadata[2].end());
-      BOOST_REQUIRE_EQUAL(it->d_values.size(), 2U);
-      BOOST_CHECK_EQUAL(it->d_values.at(0), "value1");
-      BOOST_CHECK_EQUAL(it->d_values.at(1), "value2");
+      const auto& iter = SimpleBackend::s_metadata[2].find(std::tuple(ZoneName("powerdns.org."), "test-data-b"));
+      BOOST_REQUIRE(iter != SimpleBackend::s_metadata[2].end());
+      BOOST_REQUIRE_EQUAL(iter->d_values.size(), 2U);
+      BOOST_CHECK_EQUAL(iter->d_values.at(0), "value1");
+      BOOST_CHECK_EQUAL(iter->d_values.at(1), "value2");
     }
     };
 
index 0e1a6eff9b087611a32f2d61d3c6c6a413b76918..a71d7815db6396382f49291de6db75c58ccd12d3 100644 (file)
@@ -17,15 +17,15 @@ static void testZoneMD(const std::string& zone, const std::string& file, bool ex
   if (!p) {
     p = ".";
   }
-  ZoneName z(zone);
+  ZoneName zonename(zone);
   std::ostringstream pathbuf;
   pathbuf << p << "/../regression-tests/zones/" + file;
-  ZoneParserTNG zpt(pathbuf.str(), z);
+  ZoneParserTNG zpt(pathbuf.str(), zonename);
 
   bool validationDone = false, validationOK = false;
 
   try {
-    auto zonemd = pdns::ZoneMD(z);
+    auto zonemd = pdns::ZoneMD(zonename);
     zonemd.readRecords(zpt);
     zonemd.verify(validationDone, validationOK);
   }
index 6f9db38686b2f1ee8f350f3d11687999cd9f0667..8f710d0a9b9f2bcc0020acfc1f815f38f1488482 100644 (file)
@@ -26,12 +26,12 @@ BOOST_AUTO_TEST_CASE(test_tng_record_types) {
   if(!p)
     p = ".";
   pathbuf << p << "/../regression-tests/zones/unit.test";
-  ZoneParserTNG zp(pathbuf.str(), ZoneName("unit.test"));
+  ZoneParserTNG zoneparser(pathbuf.str(), ZoneName("unit.test"));
   DNSResourceRecord rr;
 
   ifstream ifs(pathbuf.str());
 
-  while(zp.get(rr)) {
+  while(zoneparser.get(rr)) {
     // make sure these concur.
     std::string host, type, data;
     unsigned int ttl;
@@ -63,7 +63,7 @@ BOOST_AUTO_TEST_CASE(test_tng_record_generate) {
 
   {
     /* simple case */
-    ZoneParserTNG zp(pathbuf.str(), ZoneName("unit2.test"));
+    ZoneParserTNG zoneparser(pathbuf.str(), ZoneName("unit2.test"));
 
     const vector<string> expected = {
       "0.01.0003.000005.00000007.unit2.test.",
@@ -87,7 +87,7 @@ BOOST_AUTO_TEST_CASE(test_tng_record_generate) {
 
     for (auto const & exp : expected) {
       DNSResourceRecord rr;
-      zp.get(rr);
+      zoneparser.get(rr);
       BOOST_CHECK_EQUAL(rr.qname.toString(), exp);
       BOOST_CHECK_EQUAL(rr.ttl, 86400U);
       BOOST_CHECK_EQUAL(rr.qclass, 1U);
@@ -98,7 +98,7 @@ BOOST_AUTO_TEST_CASE(test_tng_record_generate) {
 
   {
     /* GENERATE with a step of 2, and the template radix defaulting to 'd' */
-    ZoneParserTNG zp(std::vector<std::string>({"$GENERATE 0-4/2 $.${1,2,o}.${3,4}.${5,6,X}.${7,8,x}    86400   IN      A 1.2.3.4"}), ZoneName("unit2.test"));
+    ZoneParserTNG zoneparser(std::vector<std::string>({"$GENERATE 0-4/2 $.${1,2,o}.${3,4}.${5,6,X}.${7,8,x}    86400   IN      A 1.2.3.4"}), ZoneName("unit2.test"));
 
     const vector<string> expected = {
       "0.01.0003.000005.00000007.unit2.test.",
@@ -108,7 +108,7 @@ BOOST_AUTO_TEST_CASE(test_tng_record_generate) {
 
     for (auto const & exp : expected) {
       DNSResourceRecord rr;
-      zp.get(rr);
+      zoneparser.get(rr);
       BOOST_CHECK_EQUAL(rr.qname.toString(), exp);
       BOOST_CHECK_EQUAL(rr.ttl, 86400U);
       BOOST_CHECK_EQUAL(rr.qclass, 1U);
@@ -117,13 +117,13 @@ BOOST_AUTO_TEST_CASE(test_tng_record_generate) {
     }
     {
       DNSResourceRecord rr;
-      BOOST_CHECK(!zp.get(rr));
+      BOOST_CHECK(!zoneparser.get(rr));
     }
   }
 
   {
     /* GENERATE with a larger initial counter and a large stop */
-    ZoneParserTNG zp(std::vector<std::string>({"$GENERATE 4294967294-4294967295/2 $    86400   IN      A 1.2.3.4"}), ZoneName("unit2.test"));
+    ZoneParserTNG zoneparser(std::vector<std::string>({"$GENERATE 4294967294-4294967295/2 $    86400   IN      A 1.2.3.4"}), ZoneName("unit2.test"));
 
     const vector<string> expected = {
       "4294967294.unit2.test.",
@@ -131,7 +131,7 @@ BOOST_AUTO_TEST_CASE(test_tng_record_generate) {
 
     for (auto const & exp : expected) {
       DNSResourceRecord rr;
-      zp.get(rr);
+      zoneparser.get(rr);
       BOOST_CHECK_EQUAL(rr.qname.toString(), exp);
       BOOST_CHECK_EQUAL(rr.ttl, 86400U);
       BOOST_CHECK_EQUAL(rr.qclass, 1U);
@@ -140,84 +140,84 @@ BOOST_AUTO_TEST_CASE(test_tng_record_generate) {
     }
     {
       DNSResourceRecord rr;
-      BOOST_CHECK(!zp.get(rr));
+      BOOST_CHECK(!zoneparser.get(rr));
     }
   }
 
   {
     /* test invalid generate parameters: stop greater than start */
-    ZoneParserTNG zp(std::vector<std::string>({"$GENERATE 5-4 $.${1,2,o}.${3,4,d}.${5,6,X}.${7,8,x}    86400   IN      A 1.2.3.4"}), ZoneName("test"));
+    ZoneParserTNG zoneparser(std::vector<std::string>({"$GENERATE 5-4 $.${1,2,o}.${3,4,d}.${5,6,X}.${7,8,x}    86400   IN      A 1.2.3.4"}), ZoneName("test"));
     DNSResourceRecord rr;
-    BOOST_CHECK_THROW(zp.get(rr), std::exception);
+    BOOST_CHECK_THROW(zoneparser.get(rr), std::exception);
   }
 
   {
     /* test invalid generate parameters: no stop */
-    ZoneParserTNG zp(std::vector<std::string>({"$GENERATE 5 $.${1,2,o}.${3,4,d}.${5,6,X}.${7,8,x}      86400   IN      A 1.2.3.4"}), ZoneName("test"));
+    ZoneParserTNG zoneparser(std::vector<std::string>({"$GENERATE 5 $.${1,2,o}.${3,4,d}.${5,6,X}.${7,8,x}      86400   IN      A 1.2.3.4"}), ZoneName("test"));
     DNSResourceRecord rr;
-    BOOST_CHECK_THROW(zp.get(rr), std::exception);
+    BOOST_CHECK_THROW(zoneparser.get(rr), std::exception);
   }
 
   {
     /* test invalid generate parameters: invalid step */
-    ZoneParserTNG zp(std::vector<std::string>({"$GENERATE 0-4/0 $.${1,2,o}.${3,4,d}.${5,6,X}.${7,8,x}  86400   IN      A 1.2.3.4"}), ZoneName("test"));
+    ZoneParserTNG zoneparser(std::vector<std::string>({"$GENERATE 0-4/0 $.${1,2,o}.${3,4,d}.${5,6,X}.${7,8,x}  86400   IN      A 1.2.3.4"}), ZoneName("test"));
     DNSResourceRecord rr;
-    BOOST_CHECK_THROW(zp.get(rr), std::exception);
+    BOOST_CHECK_THROW(zoneparser.get(rr), std::exception);
   }
 
   {
     /* test invalid generate parameters: negative counter */
-    ZoneParserTNG zp(std::vector<std::string>({"$GENERATE -1-4/1 $.${1,2,o}.${3,4,d}.${5,6,X}.${7,8,x} 86400   IN      A 1.2.3.4"}), ZoneName("test"));
+    ZoneParserTNG zoneparser(std::vector<std::string>({"$GENERATE -1-4/1 $.${1,2,o}.${3,4,d}.${5,6,X}.${7,8,x} 86400   IN      A 1.2.3.4"}), ZoneName("test"));
     DNSResourceRecord rr;
-    BOOST_CHECK_THROW(zp.get(rr), std::exception);
+    BOOST_CHECK_THROW(zoneparser.get(rr), std::exception);
   }
   {
     /* test invalid generate parameters: counter out of bounds */
-    ZoneParserTNG zp(std::vector<std::string>({"$GENERATE 4294967296-4/1 $.${1,2,o}.${3,4,d}.${5,6,X}.${7,8,x} 86400   IN      A 1.2.3.4"}), ZoneName("test"));
+    ZoneParserTNG zoneparser(std::vector<std::string>({"$GENERATE 4294967296-4/1 $.${1,2,o}.${3,4,d}.${5,6,X}.${7,8,x} 86400   IN      A 1.2.3.4"}), ZoneName("test"));
     DNSResourceRecord rr;
-    BOOST_CHECK_THROW(zp.get(rr), std::exception);
+    BOOST_CHECK_THROW(zoneparser.get(rr), std::exception);
   }
 
   {
     /* test invalid generate parameters: negative stop */
-    ZoneParserTNG zp(std::vector<std::string>({"$GENERATE 0--4/1 $.${1,2,o}.${3,4,d}.${5,6,X}.${7,8,x} 86400   IN      A 1.2.3.4"}), ZoneName("test"));
+    ZoneParserTNG zoneparser(std::vector<std::string>({"$GENERATE 0--4/1 $.${1,2,o}.${3,4,d}.${5,6,X}.${7,8,x} 86400   IN      A 1.2.3.4"}), ZoneName("test"));
     DNSResourceRecord rr;
-    BOOST_CHECK_THROW(zp.get(rr), std::exception);
+    BOOST_CHECK_THROW(zoneparser.get(rr), std::exception);
   }
 
   {
     /* test invalid generate parameters: stop out of bounds */
-    ZoneParserTNG zp(std::vector<std::string>({"$GENERATE 0-4294967296/1 $.${1,2,o}.${3,4,d}.${5,6,X}.${7,8,x} 86400   IN      A 1.2.3.4"}), ZoneName("test"));
+    ZoneParserTNG zoneparser(std::vector<std::string>({"$GENERATE 0-4294967296/1 $.${1,2,o}.${3,4,d}.${5,6,X}.${7,8,x} 86400   IN      A 1.2.3.4"}), ZoneName("test"));
     DNSResourceRecord rr;
-    BOOST_CHECK_THROW(zp.get(rr), std::exception);
+    BOOST_CHECK_THROW(zoneparser.get(rr), std::exception);
   }
 
   {
     /* test invalid generate parameters: negative step */
-    ZoneParserTNG zp(std::vector<std::string>({"$GENERATE 0-4/-1 $.${1,2,o}.${3,4,d}.${5,6,X}.${7,8,x} 86400   IN      A 1.2.3.4"}), ZoneName("test"));
+    ZoneParserTNG zoneparser(std::vector<std::string>({"$GENERATE 0-4/-1 $.${1,2,o}.${3,4,d}.${5,6,X}.${7,8,x} 86400   IN      A 1.2.3.4"}), ZoneName("test"));
     DNSResourceRecord rr;
-    BOOST_CHECK_THROW(zp.get(rr), std::exception);
+    BOOST_CHECK_THROW(zoneparser.get(rr), std::exception);
   }
 
   {
     /* test invalid generate parameters: no offset */
-    ZoneParserTNG zp(std::vector<std::string>({"$GENERATE 0-4/1 $.${}.${3,4,d}.${5,6,X}.${7,8,x}       86400   IN      A 1.2.3.4"}), ZoneName("test"));
+    ZoneParserTNG zoneparser(std::vector<std::string>({"$GENERATE 0-4/1 $.${}.${3,4,d}.${5,6,X}.${7,8,x}       86400   IN      A 1.2.3.4"}), ZoneName("test"));
     DNSResourceRecord rr;
-    BOOST_CHECK_THROW(zp.get(rr), PDNSException);
+    BOOST_CHECK_THROW(zoneparser.get(rr), PDNSException);
   }
 
   {
     /* test invalid generate parameters: invalid offset */
-    ZoneParserTNG zp(std::vector<std::string>({"$GENERATE 0-4/1 $.${a,2,o}.${3,4,d}.${5,6,X}.${7,8,x}  86400   IN      A 1.2.3.4"}), ZoneName("test"));
+    ZoneParserTNG zoneparser(std::vector<std::string>({"$GENERATE 0-4/1 $.${a,2,o}.${3,4,d}.${5,6,X}.${7,8,x}  86400   IN      A 1.2.3.4"}), ZoneName("test"));
     DNSResourceRecord rr;
-    BOOST_CHECK_THROW(zp.get(rr), PDNSException);
+    BOOST_CHECK_THROW(zoneparser.get(rr), PDNSException);
   }
 }
 
 BOOST_AUTO_TEST_CASE(test_tng_upgrade) {
-  ZoneParserTNG zp(std::vector<std::string>({"foo.test. 86400 IN TYPE1 \\# 4 c0000304"}), ZoneName("test"), true);
+  ZoneParserTNG zoneparser(std::vector<std::string>({"foo.test. 86400 IN TYPE1 \\# 4 c0000304"}), ZoneName("test"), true);
   DNSResourceRecord rr;
-  zp.get(rr);
+  zoneparser.get(rr);
 
   BOOST_CHECK_EQUAL(rr.qtype.toString(), QType(QType::A).toString());
   BOOST_CHECK_EQUAL(rr.content, std::string("192.0.3.4"));