]> granicus.if.org Git - pdns/commitdiff
auth: use override in backends to prevent future mistakes
authorKees Monshouwer <mind04@monshouwer.org>
Mon, 5 Jun 2017 19:39:43 +0000 (21:39 +0200)
committermind04 <mind04@monshouwer.org>
Mon, 5 Jun 2017 22:42:43 +0000 (00:42 +0200)
15 files changed:
modules/bindbackend/bindbackend2.hh
modules/geoipbackend/geoipbackend.hh
modules/godbcbackend/sodbc.hh
modules/ldapbackend/ldapbackend.hh
modules/luabackend/luabackend.hh
modules/mydnsbackend/mydnsbackend.hh
modules/opendbxbackend/odbxbackend.cc
modules/opendbxbackend/odbxbackend.hh
modules/oraclebackend/oraclebackend.hh
modules/pipebackend/pipebackend.hh
modules/randombackend/randombackend.cc
modules/remotebackend/remotebackend.cc
modules/remotebackend/remotebackend.hh
modules/tinydnsbackend/tinydnsbackend.hh
pdns/backends/gsql/gsqlbackend.hh

index d8c6f50c22f149d78306faad1059142860fab5bf..08e424ab90109d41cdad94e4d421dc3783796ce0 100644 (file)
@@ -188,44 +188,43 @@ class Bind2Backend : public DNSBackend
 public:
   Bind2Backend(const string &suffix="", bool loadZones=true); 
   ~Bind2Backend();
-  void getUnfreshSlaveInfos(vector<DomainInfo> *unfreshDomains);
-  void getUpdatedMasters(vector<DomainInfo> *changedDomains);
-  bool getDomainInfo(const DNSName &domain, DomainInfo &di);
+  void getUnfreshSlaveInfos(vector<DomainInfo> *unfreshDomains) override;
+  void getUpdatedMasters(vector<DomainInfo> *changedDomains) override;
+  bool getDomainInfo(const DNSName &domain, DomainInfo &di) override;
   time_t getCtime(const string &fname);
    // DNSSEC
-  virtual bool getBeforeAndAfterNamesAbsolute(uint32_t id, const DNSName& qname, DNSName& unhashed, DNSName& before, DNSName& after);
-  void lookup(const QType &, const DNSName &qdomain, DNSPacket *p=0, int zoneId=-1);
-  bool list(const DNSName &target, int id, bool include_disabled=false);
-  bool get(DNSResourceRecord &);
-  //  bool get(DNSZoneRecord &) override;
-  void getAllDomains(vector<DomainInfo> *domains, bool include_disabled=false);
+  bool getBeforeAndAfterNamesAbsolute(uint32_t id, const DNSName& qname, DNSName& unhashed, DNSName& before, DNSName& after) override;
+  void lookup(const QType &, const DNSName &qdomain, DNSPacket *p=0, int zoneId=-1) override;
+  bool list(const DNSName &target, int id, bool include_disabled=false) override;
+  bool get(DNSResourceRecord &) override;
+  void getAllDomains(vector<DomainInfo> *domains, bool include_disabled=false) override;
 
   static DNSBackend *maker();
   static pthread_mutex_t s_startup_lock;
 
-  void setFresh(uint32_t domain_id);
-  void setNotified(uint32_t id, uint32_t serial);
-  bool startTransaction(const DNSName &qname, int id);
-  bool feedRecord(const DNSResourceRecord &rr, const DNSName &ordername);
-  bool commitTransaction();
-  bool abortTransaction();
-  void alsoNotifies(const DNSName &domain, set<string> *ips);
-  bool searchRecords(const string &pattern, int maxResults, vector<DNSResourceRecord>& result);
+  void setFresh(uint32_t domain_id) override;
+  void setNotified(uint32_t id, uint32_t serial) override;
+  bool startTransaction(const DNSName &qname, int id) override;
+  bool feedRecord(const DNSResourceRecord &rr, const DNSName &ordername) override;
+  bool commitTransaction() override;
+  bool abortTransaction() override;
+  void alsoNotifies(const DNSName &domain, set<string> *ips) override;
+  bool searchRecords(const string &pattern, int maxResults, vector<DNSResourceRecord>& result) override;
 
 // the DNSSEC related (getDomainMetadata has broader uses too)
-  virtual bool getAllDomainMetadata(const DNSName& name, std::map<std::string, std::vector<std::string> >& meta);
-  virtual bool getDomainMetadata(const DNSName& name, const std::string& kind, std::vector<std::string>& meta);
-  virtual bool setDomainMetadata(const DNSName& name, const std::string& kind, const std::vector<std::string>& meta);
-  virtual bool getDomainKeys(const DNSName& name, std::vector<KeyData>& keys);
-  virtual bool removeDomainKey(const DNSName& name, unsigned int id);
-  virtual bool addDomainKey(const DNSName& name, const KeyData& key, int64_t& id);
-  virtual bool activateDomainKey(const DNSName& name, unsigned int id);
-  virtual bool deactivateDomainKey(const DNSName& name, unsigned int id);
-  virtual bool getTSIGKey(const DNSName& name, DNSName* algorithm, string* content);
-  virtual bool setTSIGKey(const DNSName& name, const DNSName& algorithm, const string& content);
-  virtual bool deleteTSIGKey(const DNSName& name);
-  virtual bool getTSIGKeys(std::vector< struct TSIGKey > &keys);
-  virtual bool doesDNSSEC();
+  bool getAllDomainMetadata(const DNSName& name, std::map<std::string, std::vector<std::string> >& meta) override;
+  bool getDomainMetadata(const DNSName& name, const std::string& kind, std::vector<std::string>& meta) override;
+  bool setDomainMetadata(const DNSName& name, const std::string& kind, const std::vector<std::string>& meta) override;
+  bool getDomainKeys(const DNSName& name, std::vector<KeyData>& keys) override;
+  bool removeDomainKey(const DNSName& name, unsigned int id) override;
+  bool addDomainKey(const DNSName& name, const KeyData& key, int64_t& id) override;
+  bool activateDomainKey(const DNSName& name, unsigned int id) override;
+  bool deactivateDomainKey(const DNSName& name, unsigned int id) override;
+  bool 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;
+  bool getTSIGKeys(std::vector< struct TSIGKey > &keys) override;
+  bool doesDNSSEC() override;
   // end of DNSSEC 
 
   typedef multi_index_container < BB2DomainInfo , 
index 79bfca291fb474b2362898882859ee665057ba8b..6f0c67898053bb793e843d43f163277d7a318b67 100644 (file)
@@ -51,22 +51,22 @@ public:
   GeoIPBackend(const std::string& suffix="");
   ~GeoIPBackend();
 
-  virtual void lookup(const QType &qtype, const DNSName &qdomain, DNSPacket *pkt_p=0, int zoneId=-1);
-  virtual bool list(const DNSName &target, int domain_id, bool include_disabled=false) { return false; } // not supported
-  virtual bool get(DNSResourceRecord &r);
-  virtual void reload();
-  virtual void rediscover(string *status = 0);
-  virtual bool getDomainInfo(const DNSName& domain, DomainInfo &di);
+  void lookup(const QType &qtype, const DNSName &qdomain, DNSPacket *pkt_p=0, int zoneId=-1) override;
+  bool list(const DNSName &target, int domain_id, bool include_disabled=false) override { return false; } // not supported
+  bool get(DNSResourceRecord &r) override;
+  void reload() override;
+  void rediscover(string *status = 0) override;
+  bool getDomainInfo(const DNSName& domain, DomainInfo &di) override;
 
   // dnssec support
-  virtual bool doesDNSSEC() { return d_dnssec; };
-  virtual bool getAllDomainMetadata(const DNSName& name, std::map<std::string, std::vector<std::string> >& meta);
-  virtual bool getDomainMetadata(const DNSName& name, const std::string& kind, std::vector<std::string>& meta);
-  virtual bool getDomainKeys(const DNSName& name, std::vector<DNSBackend::KeyData>& keys);
-  virtual bool removeDomainKey(const DNSName& name, unsigned int id);
-  virtual bool addDomainKey(const DNSName& name, const KeyData& key, int64_t& id);
-  virtual bool activateDomainKey(const DNSName& name, unsigned int id);
-  virtual bool deactivateDomainKey(const DNSName& name, unsigned int id);
+  bool doesDNSSEC() override { return d_dnssec; };
+  bool getAllDomainMetadata(const DNSName& name, std::map<std::string, std::vector<std::string> >& meta) override;
+  bool getDomainMetadata(const DNSName& name, const std::string& kind, std::vector<std::string>& meta) override;
+  bool getDomainKeys(const DNSName& name, std::vector<DNSBackend::KeyData>& keys) override;
+  bool removeDomainKey(const DNSName& name, unsigned int id) override;
+  bool addDomainKey(const DNSName& name, const KeyData& key, int64_t& id) override;
+  bool activateDomainKey(const DNSName& name, unsigned int id) override;
+  bool deactivateDomainKey(const DNSName& name, unsigned int id) override;
 
   enum GeoIPQueryAttribute {
     ASn,
index 9a1468f7b61a1ad8a639b3dc42f02d1095f7e87b..d01377a4cd960c46a9cb2eb48aa99e69cc743ef6 100644 (file)
@@ -67,9 +67,9 @@ public:
 
   SSqlStatement* prepare(const string& query, int nparams);
   void execute(const string& query);
-  void startTransaction();
-  void rollback();
-  void commit();
+  void startTransaction() override;
+  void rollback() override;
+  void commit() override;
 
   //! Returns an exception.
   SSqlException sPerrorException( const std::string & reason );
index f3e584c8dfb289b7fe319c76f5a75ebac3fac245..265d93e800aa2f0f4f199350d88db65e09ee5767 100644 (file)
@@ -139,15 +139,15 @@ class LdapBackend : public DNSBackend
     ~LdapBackend();
 
     // Native backend
-    bool list( const DNSName& target, int domain_id, bool include_disabled=false );
-    void lookup( const QType& qtype, const DNSName& qdomain, DNSPacket* p = 0, int zoneid = -1 );
-    bool get( DNSResourceRecord& rr );
+    bool list( const DNSName& target, int domain_id, bool include_disabled=false ) override;
+    void lookup( const QType& qtype, const DNSName& qdomain, DNSPacket* p = 0, int zoneid = -1 ) override;
+    bool get( DNSResourceRecord& rr ) override;
 
-    bool getDomainInfo( const string& domain, DomainInfo& di );
+    bool getDomainInfo( const string& domain, DomainInfo& di ) override;
 
     // Master backend
-    void getUpdatedMasters( vector<DomainInfo>* domains );
-    void setNotified( uint32_t id, uint32_t serial );
+    void getUpdatedMasters( vector<DomainInfo>* domains ) override;
+    void setNotified( uint32_t id, uint32_t serial ) override;
 };
 
 #endif /* LDAPBACKEND_HH */
index 7b4722bfb673b6e7050e7e0a2eb61ffd9faa7a11..c6004a06392034ebc41fd717ffff44a53e9429a8 100644 (file)
@@ -54,11 +54,11 @@ public:
 
     LUABackend(const string &suffix="");
     ~LUABackend();
-    bool list(const DNSName &target, int domain_id, bool include_disabled=false);
-    void lookup(const QType &qtype, const DNSName &qname, DNSPacket *p, int domain_id);
-    bool get(DNSResourceRecord &rr);
+    bool list(const DNSName &target, int domain_id, bool include_disabled=false) override;
+    void lookup(const QType &qtype, const DNSName &qname, DNSPacket *p, int domain_id) override;
+    bool get(DNSResourceRecord &rr) override;
     //! fills the soadata struct with the SOA details. Returns false if there is no SOA.
-    bool getSOA(const string &name, SOAData &soadata, DNSPacket *p=0);
+    bool getSOA(const string &name, SOAData &soadata, DNSPacket *p=0) override;
 
 
 //  MASTER BACKEND
index 28c56e3cd29928a10e93a0767f939a144d3991b1..0ee6afa134007d666f29dc37a9c16dc861a33939 100644 (file)
@@ -36,11 +36,11 @@ public:
   MyDNSBackend(const string &suffix);
   ~MyDNSBackend();
   
-  void lookup(const QType &, const DNSName &qdomain, DNSPacket *p=0, int zoneId=-1);
-  bool list(const DNSName &target, int domain_id, bool include_disabled=false);
-  bool get(DNSResourceRecord &r);
-  bool getSOA(const DNSName& name, SOAData& soadata, DNSPacket*);
-  void getAllDomains(vector<DomainInfo> *domains, bool include_disabled=false);
+  void lookup(const QType &, const DNSName &qdomain, DNSPacket *p=0, int zoneId=-1) override;
+  bool list(const DNSName &target, int domain_id, bool include_disabled=false) override;
+  bool get(DNSResourceRecord &r) override;
+  bool getSOA(const DNSName& name, SOAData& soadata, DNSPacket*) override;
+  void getAllDomains(vector<DomainInfo> *domains, bool include_disabled=false) override;
 private:
   SMySQL *d_db; 
 
index d6e9fb963a11b6dbafd9f97d0b681942cd186a57..5932f4da93afd7cc3f7c245ef80db1c8c15d14f0 100644 (file)
@@ -674,7 +674,7 @@ bool OdbxBackend::createSlaveDomain( const string& ip, const string& domain, con
 
 
 
-bool OdbxBackend::feedRecord( const DNSResourceRecord& rr, const DNSName ordername )
+bool OdbxBackend::feedRecord( const DNSResourceRecord& rr, const DNSName& ordername )
 {
         try
         {
index efe3b6b4cdd9c674ba0a5f6768508c6c5bb0aea6..67f01067972c842c4373aa15208553710e137840 100644 (file)
@@ -76,26 +76,26 @@ public:
         OdbxBackend( const string& suffix="" );
         ~OdbxBackend();
 
-        void lookup( const QType& qtype, const DNSName& qdomain, DNSPacket* p = 0, int zoneid = -1 );
-        bool getSOA( const DNSName& domain, SOAData& sd, DNSPacket* p );
-        bool list( const DNSName& target, int domain_id, bool include_disabled=false );
-        bool get( DNSResourceRecord& rr );
-
-        bool startTransaction( const string& domain, int domain_id );
-        bool commitTransaction();
-        bool abortTransaction();
-
-        bool isMaster( const string& domain, const string& ip );
-        bool getDomainInfo( const string& domain, DomainInfo& di );
-        bool feedRecord( const DNSResourceRecord& rr, const DNSName ordername );
-        bool createSlaveDomain( const string& ip, const string& domain, const string &nameserver, const string& account );
-        bool superMasterBackend( const string& ip, const string& domain, const vector<DNSResourceRecord>& nsset, string *nameserver, string* account, DNSBackend** ddb );
-
-        void getUpdatedMasters( vector<DomainInfo>* updated );
-        void getUnfreshSlaveInfos( vector<DomainInfo>* unfresh );
-
-        void setFresh( uint32_t domain_id );
-        void setNotified( uint32_t domain_id, uint32_t serial );
+        void lookup( const QType& qtype, const DNSName& qdomain, DNSPacket* p = 0, int zoneid = -1 ) override;
+        bool getSOA( const DNSName& domain, SOAData& sd, DNSPacket* p ) override;
+        bool list( const DNSName& target, int domain_id, bool include_disabled=false ) override;
+        bool get( DNSResourceRecord& rr ) override;
+
+        bool startTransaction( const string& domain, int domain_id ) override;
+        bool commitTransaction() override;
+        bool abortTransaction() override;
+
+        bool isMaster( const string& domain, const string& ip ) override;
+        bool getDomainInfo( const string& domain, DomainInfo& di ) override;
+        bool feedRecord( const DNSResourceRecord& rr, const DNSName& ordername ) override;
+        bool createSlaveDomain( const string& ip, const string& domain, const string &nameserver, const string& account ) override;
+        bool superMasterBackend( const string& ip, const string& domain, const vector<DNSResourceRecord>& nsset, string *nameserver, string* account, DNSBackend** ddb ) override;
+
+        void getUpdatedMasters( vector<DomainInfo>* updated ) override;
+        void getUnfreshSlaveInfos( vector<DomainInfo>* unfresh ) override;
+
+        void setFresh( uint32_t domain_id ) override;
+        void setNotified( uint32_t domain_id, uint32_t serial ) override;
 };
 
 
index 2013fb53b6b93ad7bdad93adecbbf0ede75d4b66..c141a93ad4e1f494920ffb41b5eacc2c141a6ae8 100644 (file)
@@ -64,51 +64,51 @@ public:
   virtual ~OracleBackend();
 
   void lookup(const QType &qtype, const DNSName& qname, DNSPacket *p = 0,
-              int zoneId = -1);
+              int zoneId = -1) override;
 
   bool getBeforeAndAfterNames(uint32_t zoneId, const DNSName& zone,
                               const DNSName& name,
-                              DNSName& before, DNSName& after);
+                              DNSName& before, DNSName& after) override;
   bool getBeforeAndAfterNamesAbsolute(uint32_t zoneId,
                                       const DNSName& name,
                                       DNSName& unhashed,
                                       DNSName& before,
-                                      DNSName& after);
-  bool get(DNSResourceRecord &rr);
-  vector<string> getDomainMasters(const DNSName& domain, int zoneId);
-  bool isMaster(const DNSName& domain, const string &master);
-  bool getDomainInfo(const DNSName& domain, DomainInfo &di);
-  void alsoNotifies(const DNSName& domain, set<string> *addrs);
-  void getUnfreshSlaveInfos(vector<DomainInfo>* domains);
-  void getUpdatedMasters(vector<DomainInfo>* domains);
-  void setFresh(uint32_t zoneId);
-  void setNotified(uint32_t zoneId, uint32_t serial);
-  bool list(const DNSName& domain, int zoneId, bool include_disabled=false);
-  bool startTransaction(const DNSName& domain, int zoneId);
-  bool feedRecord(const DNSResourceRecord &rr, const DNSName ordername);
-  bool commitTransaction();
-  bool abortTransaction();
+                                      DNSName& after) override;
+  bool get(DNSResourceRecord &rr) override;
+  vector<string> getDomainMasters(const DNSName& domain, int zoneId) override;
+  bool isMaster(const DNSName& domain, const string &master) override;
+  bool getDomainInfo(const DNSName& domain, DomainInfo &di) override;
+  void alsoNotifies(const DNSName& domain, set<string> *addrs) override;
+  void getUnfreshSlaveInfos(vector<DomainInfo>* domains) override;
+  void getUpdatedMasters(vector<DomainInfo>* domains) override;
+  void setFresh(uint32_t zoneId) override;
+  void setNotified(uint32_t zoneId, uint32_t serial) override;
+  bool list(const DNSName& domain, int zoneId, bool include_disabled=false) override;
+  bool startTransaction(const DNSName& domain, int zoneId) override;
+  bool feedRecord(const DNSResourceRecord &rr, const DNSName ordername) override;
+  bool commitTransaction() override;
+  bool abortTransaction() override;
   bool superMasterBackend(const string &ip, const DNSName& domain,
                           const vector<DNSResourceRecord> &nsset,
                           string *account, string *nameserver,
-                          DNSBackend **backend);
+                          DNSBackend **backend) override;
   bool createSlaveDomain(const string &ip, const DNSName& domain,
-                         const string &nameserver, const string &account);
-
-  bool getAllDomainMetadata(const DNSName& name, std::map<std::string, std::vector<std::string> >& meta)
-  bool getDomainMetadata(const DNSName& name, const std::string& kind, std::vector<std::string>& meta);
-  bool setDomainMetadata(const DNSName& name, const std::string& kind, const std::vector<std::string>& meta);
-
-  bool getTSIGKey(const DNSName& name, DNSName* algorithm, string* content);
-  bool delTSIGKey(const DNSName& name);
-  bool setTSIGKey(const DNSName& name, const DNSName& algorithm, const string& content);
-  bool getTSIGKeys(std::vector< struct TSIGKey > &keys);
-
-  bool getDomainKeys(const DNSName& name, vector<KeyData>& keys);
-  bool removeDomainKey(const DNSName& name, unsigned int id);
-  bool addDomainKey(const DNSName& name, const KeyData& key, int64_t& id);
-  bool activateDomainKey(const DNSName& name, unsigned int id);
-  bool deactivateDomainKey(const DNSName& name, unsigned int id);
+                         const string &nameserver, const string &account) override;
+
+  bool getAllDomainMetadata(const DNSName& name, std::map<std::string, std::vector<std::string> >& meta) override;
+  bool getDomainMetadata(const DNSName& name, const std::string& kind, std::vector<std::string>& meta) override;
+  bool setDomainMetadata(const DNSName& name, const std::string& kind, const std::vector<std::string>& meta) override;
+
+  bool getTSIGKey(const DNSName& name, DNSName* algorithm, string* content) override;
+  bool delTSIGKey(const DNSName& name) override;
+  bool setTSIGKey(const DNSName& name, const DNSName& algorithm, const string& content) override;
+  bool getTSIGKeys(std::vector< struct TSIGKey > &keys) override;
+
+  bool getDomainKeys(const DNSName& name, vector<KeyData>& keys) override;
+  bool removeDomainKey(const DNSName& name, unsigned int id) override;
+  bool addDomainKey(const DNSName& name, const KeyData& key, int64_t& id) override;
+  bool activateDomainKey(const DNSName& name, unsigned int id) override;
+  bool deactivateDomainKey(const DNSName& name, unsigned int id) override;
 
 private:
 
index 92ed12fe65557cdee965883f95430f714f8e077e..abdfb858296d08a5efd6d9f8eaa3f494777dbf8b 100644 (file)
@@ -53,10 +53,10 @@ class PipeBackend : public DNSBackend
 public:
   PipeBackend(const string &suffix="");
   ~PipeBackend();
-  void lookup(const QType&, const DNSName& qdomain, DNSPacket *p=0, int zoneId=-1);
-  bool list(const DNSName& target, int domain_id, bool include_disabled=false);
-  bool get(DNSResourceRecord &r);
-  string directBackendCmd(const string &query);
+  void lookup(const QType&, const DNSName& qdomain, DNSPacket *p=0, int zoneId=-1) override;
+  bool list(const DNSName& target, int domain_id, bool include_disabled=false) override;
+  bool get(DNSResourceRecord &r) override;
+  string directBackendCmd(const string &query) override;
   static DNSBackend *maker();
   
 private:
index 7e433048f0fc2efa31d4dc1e6d99f6ac8c7d941c..286e606b1a7a6911d2853ae22d22a85de7f1c635 100644 (file)
@@ -44,11 +44,11 @@ public:
     d_ourdomain.chopOff();
   }
 
-  bool list(const DNSName &target, int id, bool include_disabled) {
+  bool list(const DNSName &target, int id, bool include_disabled) override {
     return false; // we don't support AXFR
   }
 
-  void lookup(const QType &type, const DNSName &qdomain, DNSPacket *p, int zoneId)
+  void lookup(const QType &type, const DNSName &qdomain, DNSPacket *p, int zoneId) override
   {
     if(qdomain == d_ourdomain){
       if(type.getCode() == QType::SOA || type.getCode() == QType::ANY) {
@@ -69,7 +69,7 @@ public:
     }
   }
 
-  bool get(DNSResourceRecord &rr)
+  bool get(DNSResourceRecord &rr) override
   {
     if(d_answer.empty())
       return false;
index fe26ad3f7b8272f058eb04981b23ea0fc2268cd7..ef2fbb2c6848e531d132f005a335c040c574339c 100644 (file)
@@ -716,7 +716,7 @@ bool RemoteBackend::replaceRRSet(uint32_t domain_id, const DNSName& qname, const
    return true;
 }
 
-bool RemoteBackend::feedRecord(const DNSResourceRecord &rr, const DNSName ordername) {
+bool RemoteBackend::feedRecord(const DNSResourceRecord &rr, const DNSName &ordername) {
    Json query = Json::object{
      { "method", "feedRecord" },
      { "parameters", Json::object{
index ba2a9407a6afbdddbf983df7af773e5e8e6a0fd4..b44af82c98c27d5a08b36795c1bdb9148093e70e 100644 (file)
@@ -153,41 +153,41 @@ class RemoteBackend : public DNSBackend
   RemoteBackend(const std::string &suffix="");
   ~RemoteBackend();
 
-  void lookup(const QType &qtype, const DNSName& qdomain, DNSPacket *pkt_p=0, int zoneId=-1);
-  bool get(DNSResourceRecord &rr);
-  bool list(const DNSName& target, int domain_id, bool include_disabled=false);
-
-  virtual bool getAllDomainMetadata(const DNSName& name, std::map<std::string, std::vector<std::string> >& meta);
-  virtual bool getDomainMetadata(const DNSName& name, const std::string& kind, std::vector<std::string>& meta);
-  virtual bool getDomainKeys(const DNSName& name, std::vector<DNSBackend::KeyData>& keys);
-  virtual bool getTSIGKey(const DNSName& name, DNSName* algorithm, std::string* content);
-  virtual bool getBeforeAndAfterNamesAbsolute(uint32_t id, const DNSName& qname, DNSName& unhashed, DNSName& before, DNSName& after);
-  virtual bool setDomainMetadata(const DNSName& name, const string& kind, const std::vector<std::basic_string<char> >& meta);
-  virtual bool removeDomainKey(const DNSName& name, unsigned int id);
-  virtual bool addDomainKey(const DNSName& name, const KeyData& key, int64_t& id);
-  virtual bool activateDomainKey(const DNSName& name, unsigned int id);
-  virtual bool deactivateDomainKey(const DNSName& name, unsigned int id);
-  virtual bool getDomainInfo(const DNSName& domain, DomainInfo& di);
-  virtual void setNotified(uint32_t id, uint32_t serial);
-  virtual bool doesDNSSEC();
-  virtual bool isMaster(const DNSName& name, const string &ip);
-  virtual bool superMasterBackend(const string &ip, const DNSName& domain, const vector<DNSResourceRecord>&nsset, string *nameserver, string *account, DNSBackend **ddb);
-  virtual bool createSlaveDomain(const string &ip, const DNSName& domain, const string& nameserver, const string &account);
-  virtual bool replaceRRSet(uint32_t domain_id, const DNSName& qname, const QType& qt, const vector<DNSResourceRecord>& rrset);
-  virtual bool feedRecord(const DNSResourceRecord &r, const DNSName ordername);
-  virtual bool feedEnts(int domain_id, map<DNSName,bool>& nonterm);
-  virtual bool feedEnts3(int domain_id, const DNSName& domain, map<DNSName,bool>& nonterm, const NSEC3PARAMRecordContent& ns3prc, bool narrow);
-  virtual bool startTransaction(const DNSName& domain, int domain_id);
-  virtual bool commitTransaction();
-  virtual bool abortTransaction();
-  virtual bool calculateSOASerial(const DNSName& domain, const SOAData& sd, time_t& serial);
-  virtual bool setTSIGKey(const DNSName& name, const DNSName& algorithm, const string& content);
-  virtual bool deleteTSIGKey(const DNSName& name);
-  virtual bool getTSIGKeys(std::vector< struct TSIGKey > &keys);
-  virtual string directBackendCmd(const string& querystr);
-  virtual bool searchRecords(const string &pattern, int maxResults, vector<DNSResourceRecord>& result);
-  virtual bool searchComments(const string &pattern, int maxResults, vector<Comment>& result);
-  virtual void getAllDomains(vector<DomainInfo> *domains, bool include_disabled=false);
+  void lookup(const QType &qtype, const DNSName& qdomain, DNSPacket *pkt_p=0, int zoneId=-1) override;
+  bool get(DNSResourceRecord &rr) override;
+  bool list(const DNSName& target, int domain_id, bool include_disabled=false) override;
+
+  bool getAllDomainMetadata(const DNSName& name, std::map<std::string, std::vector<std::string> >& meta) override;
+  bool getDomainMetadata(const DNSName& name, const std::string& kind, std::vector<std::string>& meta) override;
+  bool getDomainKeys(const DNSName& name, std::vector<DNSBackend::KeyData>& keys) override;
+  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 DNSName& name, unsigned int id) override;
+  bool addDomainKey(const DNSName& name, const KeyData& key, int64_t& id) override;
+  bool activateDomainKey(const DNSName& name, unsigned int id) override;
+  bool deactivateDomainKey(const DNSName& name, unsigned int id) override;
+  bool getDomainInfo(const DNSName& domain, DomainInfo& di) override;
+  void setNotified(uint32_t id, uint32_t serial) override;
+  bool doesDNSSEC() override;
+  bool isMaster(const DNSName& name, const string &ip) override;
+  bool superMasterBackend(const string &ip, const DNSName& domain, const vector<DNSResourceRecord>&nsset, string *nameserver, string *account, DNSBackend **ddb) override;
+  bool createSlaveDomain(const string &ip, const DNSName& 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) override;
+  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 startTransaction(const DNSName& domain, int domain_id) override;
+  bool commitTransaction() override;
+  bool abortTransaction() override;
+  bool calculateSOASerial(const DNSName& domain, const SOAData& sd, time_t& serial) override;
+  bool setTSIGKey(const DNSName& name, const DNSName& algorithm, const string& content) override;
+  bool deleteTSIGKey(const DNSName& name) override;
+  bool getTSIGKeys(std::vector< struct TSIGKey > &keys) override;
+  string directBackendCmd(const string& querystr) override;
+  bool searchRecords(const string &pattern, int maxResults, vector<DNSResourceRecord>& result) override;
+  bool searchComments(const string &pattern, int maxResults, vector<Comment>& result) override;
+  void getAllDomains(vector<DomainInfo> *domains, bool include_disabled=false) override;
 
   static DNSBackend *maker();
 
index 56f7add24d16b331e3f1f7b75158bd745666491d..bdb4888dac2b58e2ed113e08057022d2369c0ee9 100644 (file)
@@ -68,14 +68,14 @@ class TinyDNSBackend : public DNSBackend
 public:
   // Methods for simple operation
   TinyDNSBackend(const string &suffix);
-  void lookup(const QType &qtype, const DNSName &qdomain, DNSPacket *pkt_p=0, int zoneId=-1);
-  bool list(const DNSName &target, int domain_id, bool include_disabled=false);
-  bool get(DNSResourceRecord &rr);
-  void getAllDomains(vector<DomainInfo> *domains, bool include_disabled=false);
+  void lookup(const QType &qtype, const DNSName &qdomain, DNSPacket *pkt_p=0, int zoneId=-1) override;
+  bool list(const DNSName &target, int domain_id, bool include_disabled=false) override;
+  bool get(DNSResourceRecord &rr) override;
+  void getAllDomains(vector<DomainInfo> *domains, bool include_disabled=false) override;
 
   //Master mode operation
-  void getUpdatedMasters(vector<DomainInfo>* domains);
-  void setNotified(uint32_t id, uint32_t serial);
+  void getUpdatedMasters(vector<DomainInfo>* domains) override;
+  void setNotified(uint32_t id, uint32_t serial) override;
 private:
   vector<string> getLocations();
 
index 5335bdc38120a9733c5844480f6596ca68bcbcfa..559c8043c370ebeb849af13e9ac5824ef632a472 100644 (file)
@@ -179,70 +179,68 @@ public:
     release(&d_SearchCommentsQuery_stmt);
   }
 
-  void lookup(const QType &, const DNSName &qdomain, DNSPacket *p=0, int zoneId=-1);
-  bool list(const DNSName &target, int domain_id, bool include_disabled=false);
-  bool get(DNSResourceRecord &r);
-  void getAllDomains(vector<DomainInfo> *domains, bool include_disabled=false);
-  bool isMaster(const DNSName &domain, const string &ip);
-  void alsoNotifies(const DNSName &domain, set<string> *ips);
-  bool startTransaction(const DNSName &domain, int domain_id=-1);
-  bool commitTransaction();
-  bool abortTransaction();
-  bool feedRecord(const DNSResourceRecord &r, const DNSName &ordername);
-  bool feedEnts(int domain_id, map<DNSName,bool>& nonterm);
-  bool feedEnts3(int domain_id, const DNSName &domain, map<DNSName,bool> &nonterm, const NSEC3PARAMRecordContent& ns3prc, bool narrow);
-  bool createDomain(const DNSName &domain, const string &type, const string &masters, const string &account);
-  bool createDomain(const DNSName &domain) {
+  void lookup(const QType &, const DNSName &qdomain, DNSPacket *p=0, int zoneId=-1) override;
+  bool list(const DNSName &target, int domain_id, bool include_disabled=false) override;
+  bool get(DNSResourceRecord &r) override;
+  void getAllDomains(vector<DomainInfo> *domains, bool include_disabled=false) override;
+  bool isMaster(const DNSName &domain, const string &ip) override;
+  void alsoNotifies(const DNSName &domain, set<string> *ips) override;
+  bool startTransaction(const DNSName &domain, int domain_id=-1) override;
+  bool commitTransaction() override;
+  bool abortTransaction() override;
+  bool feedRecord(const DNSResourceRecord &r, const DNSName &ordername) override;
+  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 DNSName &domain) override {
     return createDomain(domain, "NATIVE", "", "");
   };
-  bool createSlaveDomain(const string &ip, const DNSName &domain, const string &nameserver, const string &account);
-  bool deleteDomain(const DNSName &domain);
-  bool superMasterBackend(const string &ip, const DNSName &domain, const vector<DNSResourceRecord>&nsset, string *nameserver, string *account, DNSBackend **db);
-  void setFresh(uint32_t domain_id);
-  void getUnfreshSlaveInfos(vector<DomainInfo> *domains);
-  void getUpdatedMasters(vector<DomainInfo> *updatedDomains);
-  bool getDomainInfo(const DNSName &domain, DomainInfo &di);
-  void setNotified(uint32_t domain_id, uint32_t serial);
-  bool setMaster(const DNSName &domain, const string &ip);
-  bool setKind(const DNSName &domain, const DomainInfo::DomainKind kind);
-  bool setAccount(const DNSName &domain, const string &account);
+  bool createSlaveDomain(const string &ip, const DNSName &domain, const string &nameserver, const string &account) override;
+  bool deleteDomain(const DNSName &domain) override;
+  bool superMasterBackend(const string &ip, const DNSName &domain, const vector<DNSResourceRecord>&nsset, string *nameserver, string *account, DNSBackend **db) override;
+  void setFresh(uint32_t domain_id) override;
+  void getUnfreshSlaveInfos(vector<DomainInfo> *domains) override;
+  void getUpdatedMasters(vector<DomainInfo> *updatedDomains) override;
+  bool getDomainInfo(const DNSName &domain, DomainInfo &di) override;
+  void setNotified(uint32_t domain_id, uint32_t serial) override;
+  bool setMaster(const DNSName &domain, const string &ip) override;
+  bool setKind(const DNSName &domain, const DomainInfo::DomainKind kind) override;
+  bool setAccount(const DNSName &domain, const string &account) override;
 
-  virtual bool getBeforeAndAfterNamesAbsolute(uint32_t id, const DNSName& qname, DNSName& unhashed, DNSName& before, DNSName& after);
-  virtual bool updateDNSSECOrderNameAndAuth(uint32_t domain_id, const DNSName& qname, const DNSName& ordername, bool auth, const uint16_t=QType::ANY);
+  bool getBeforeAndAfterNamesAbsolute(uint32_t id, const DNSName& qname, DNSName& unhashed, DNSName& before, DNSName& after) override;
+  bool updateDNSSECOrderNameAndAuth(uint32_t domain_id, const DNSName& qname, const DNSName& ordername, bool auth, const uint16_t=QType::ANY) override;
 
-  virtual bool updateEmptyNonTerminals(uint32_t domain_id, set<DNSName>& insert ,set<DNSName>& erase, bool remove);
-  virtual bool doesDNSSEC();
+  bool updateEmptyNonTerminals(uint32_t domain_id, set<DNSName>& insert ,set<DNSName>& erase, bool remove) override;
+  bool doesDNSSEC() override;
 
-  virtual bool calculateSOASerial(const DNSName& domain, const SOAData& sd, time_t& serial);
+  bool calculateSOASerial(const DNSName& domain, const SOAData& sd, time_t& serial) override;
 
-  bool replaceRRSet(uint32_t domain_id, const DNSName& qname, const QType& qt, const vector<DNSResourceRecord>& rrset);
-  bool listSubZone(const DNSName &zone, int domain_id);
-  bool addDomainKey(const DNSName& name, const KeyData& key, int64_t& id);
-  bool getDomainKeys(const DNSName& name, std::vector<KeyData>& keys);
-  bool getAllDomainMetadata(const DNSName& name, std::map<std::string, std::vector<std::string> >& meta);
-  bool getDomainMetadata(const DNSName& name, const std::string& kind, std::vector<std::string>& meta);
-  bool setDomainMetadata(const DNSName& name, const std::string& kind, const std::vector<std::string>& meta);
-  bool clearDomainAllMetadata(const DNSName& domain);
+  bool replaceRRSet(uint32_t domain_id, const DNSName& qname, const QType& qt, const vector<DNSResourceRecord>& rrset) override;
+  bool listSubZone(const DNSName &zone, int domain_id) override;
+  bool addDomainKey(const DNSName& name, const KeyData& key, int64_t& id) override;
+  bool getDomainKeys(const DNSName& name, std::vector<KeyData>& keys) override;
+  bool getAllDomainMetadata(const DNSName& name, std::map<std::string, std::vector<std::string> >& meta) override;
+  bool getDomainMetadata(const DNSName& name, const std::string& kind, std::vector<std::string>& meta) override;
+  bool setDomainMetadata(const DNSName& name, const std::string& kind, const std::vector<std::string>& meta) override;
   
-  bool removeDomainKey(const DNSName& name, unsigned int id);
-  bool activateDomainKey(const DNSName& name, unsigned int id);
-  bool deactivateDomainKey(const DNSName& name, unsigned int id);
+  bool removeDomainKey(const DNSName& name, unsigned int id) override;
+  bool activateDomainKey(const DNSName& name, unsigned int id) override;
+  bool deactivateDomainKey(const DNSName& name, unsigned int id) override;
   
-  bool getTSIGKey(const DNSName& name, DNSName* algorithm, string* content);
-  bool setTSIGKey(const DNSName& name, const DNSName& algorithm, const string& content);
-  bool deleteTSIGKey(const DNSName& name);
-  bool getTSIGKeys(std::vector< struct TSIGKey > &keys);
+  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;
+  bool getTSIGKeys(std::vector< struct TSIGKey > &keys) override;
 
-  bool listComments(const uint32_t domain_id);
-  bool getComment(Comment& comment);
-  void feedComment(const Comment& comment);
-  bool replaceComments(const uint32_t domain_id, const DNSName& qname, const QType& qt, const vector<Comment>& comments);
-  bool replaceComments(const uint32_t domain_id, const string& qname, const QType& qt, const vector<Comment>& comments);
-  string directBackendCmd(const string &query);
-  bool searchRecords(const string &pattern, int maxResults, vector<DNSResourceRecord>& result);
-  bool searchComments(const string &pattern, int maxResults, vector<Comment>& result);
+  bool listComments(const uint32_t domain_id) override;
+  bool getComment(Comment& comment) override;
+  void feedComment(const Comment& comment) override;
+  bool replaceComments(const uint32_t domain_id, const DNSName& qname, const QType& qt, const vector<Comment>& comments) override;
+  string directBackendCmd(const string &query) override;
+  bool searchRecords(const string &pattern, int maxResults, vector<DNSResourceRecord>& result) override;
+  bool searchComments(const string &pattern, int maxResults, vector<Comment>& result) override;
 
 protected:
+  bool createDomain(const DNSName &domain, const string &type, const string &masters, const string &account);
   string pattern2SQLPattern(const string& pattern);
   void extractRecord(const SSqlStatement::row_t& row, DNSResourceRecord& rr);
   void extractComment(const SSqlStatement::row_t& row, Comment& c);