]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2088] Changed sets by lists
authorFrancis Dupont <fdupont@isc.org>
Tue, 14 Sep 2021 13:08:09 +0000 (15:08 +0200)
committerRazvan Becheriu <razvan@isc.org>
Thu, 16 Sep 2021 13:14:59 +0000 (16:14 +0300)
src/lib/d2srv/d2_stats.cc
src/lib/d2srv/d2_stats.h
src/lib/d2srv/d2_tsig_key.cc
src/lib/d2srv/d2_tsig_key.h

index 3d3d3b6ff19c2c49e06887a52a13069b94e368ac..8534f13924587559acdfc7a19628ed78ba71b12d 100644 (file)
@@ -17,14 +17,14 @@ using namespace isc::stats;
 namespace isc {
 namespace d2 {
 
-set<string>
+const list<string>
 D2Stats::ncr = {
     "ncr-received",
     "ncr-invalid",
     "ncr-error"
 };
 
-set<string>
+const list<string>
 D2Stats::update = {
     "update-sent",
     "update-signed",
@@ -34,7 +34,7 @@ D2Stats::update = {
     "update-error"
 };
 
-set<string>
+const list<string>
 D2Stats::key = {
     "update-sent",
     "update-success",
index 4bfd1da7ab191c97ad3cccdfa90d3883d7cc64fb..b4122b4910672b4ea20ddbbb8ec067c75789aa80 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef D2_STATS_H
 #define D2_STATS_H
 
-#include <set>
+#include <list>
 #include <string>
 
 namespace isc {
@@ -21,7 +21,7 @@ public:
     /// - ncr-received
     /// - ncr-invalid
     /// - ncr-error
-    static std::set<std::string> ncr;
+    static const std::list<std::string> ncr;
 
     /// @brief Global DNS update statistics names.
     ///
@@ -31,7 +31,7 @@ public:
     /// - update-success
     /// - update-timeout
     /// - update-error
-    static std::set<std::string> update;
+    static const std::list<std::string> update;
 
     /// @brief Key DNS update statistics names.
     ///
@@ -39,7 +39,7 @@ public:
     /// - update-success
     /// - update-timeout
     /// - update-error
-    static std::set<std::string> key;
+    static const std::list<std::string> key;
 
     /// @brief Initialize D2 statistics.
     ///
index 196d278b041366ebb6ad4b03dd6161a800bceb92..75dc5277a4e25366f105dba60febde9d3c4df98b 100644 (file)
@@ -29,6 +29,10 @@ D2TsigKey::D2TsigKey(const Name& key_name, const Name& algorithm_name,
     initStats();
 }
 
+D2TsigKey::~D2TsigKey() {
+    removeStats();
+}
+
 void
 D2TsigKey::initStats() {
     StatsMgr& stats_mgr = StatsMgr::instance();
@@ -39,7 +43,8 @@ D2TsigKey::initStats() {
     }
 }
 
-D2TsigKey::~D2TsigKey() {
+void
+D2TsigKey::removeStats() {
     StatsMgr& stats_mgr = StatsMgr::instance();
     const string& kname = getKeyName().toText();
     for (const auto& name : D2Stats::key) {
index b5bb6358a17328d282ed1b3aa2447ad588f19936..0101b4b2ef3a04d4c3871969813a2c9e51493aa6 100644 (file)
@@ -62,6 +62,9 @@ public:
 private:
     /// @brief Initialize key statistics.
     void initStats();
+
+    /// @brief Remove key statistics.
+    void removeStats();
 };
 
 /// @brief Type of pointer to a D2 TSIG key.