]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#110,!156] libprocess dependency fix (in progress)
authorTomek Mrugalski <tomasz@isc.org>
Mon, 5 Nov 2018 04:05:02 +0000 (11:05 +0700)
committerTomek Mrugalski <tomasz@isc.org>
Mon, 5 Nov 2018 04:05:02 +0000 (11:05 +0700)
14 files changed:
src/lib/database/Makefile.am
src/lib/database/config_ctl_info.cc [moved from src/lib/process/config_ctl_info.cc with 97% similarity]
src/lib/database/config_ctl_info.h [moved from src/lib/process/config_ctl_info.h with 99% similarity]
src/lib/database/config_ctl_parser.cc [moved from src/lib/process/config_ctl_parser.cc with 96% similarity]
src/lib/database/config_ctl_parser.h [moved from src/lib/process/config_ctl_parser.h with 94% similarity]
src/lib/database/tests/Makefile.am
src/lib/database/tests/config_ctl_info_unittests.cc [moved from src/lib/process/tests/config_ctl_info_unittests.cc with 98% similarity]
src/lib/database/tests/config_ctl_parser_unittests.cc [moved from src/lib/process/tests/config_ctl_parser_unittests.cc with 97% similarity]
src/lib/dhcpsrv/srv_config.cc
src/lib/dhcpsrv/srv_config.h
src/lib/process/Makefile.am
src/lib/process/config_base.cc
src/lib/process/config_base.h
src/lib/process/tests/Makefile.am

index ad8d1c6db8a81a91a665f2038da66561f87eaa19..0e24608b9f555f7da6ee45b62dac1f0d9236ba7a 100644 (file)
@@ -24,6 +24,8 @@ CLEANFILES = *.gcno *.gcda db_messages.h db_messages.cc s-messages
 
 lib_LTLIBRARIES = libkea-database.la
 libkea_database_la_SOURCES  = backend_selector.cc backend_selector.h
+libkea_database_la_SOURCES += config_ctl_info.cc config_ctl_info.h
+libkea_database_la_SOURCES += config_ctl_parser.cc config_ctl_parser.h
 libkea_database_la_SOURCES += database_connection.cc database_connection.h
 libkea_database_la_SOURCES += dbaccess_parser.h dbaccess_parser.cc
 libkea_database_la_SOURCES += db_exceptions.h
similarity index 97%
rename from src/lib/process/config_ctl_info.cc
rename to src/lib/database/config_ctl_info.cc
index 9d841346919edc34ef9476f61e4a89fcec0164a9..feb63f77d48991f798f8c72c337d777ce1212be5 100644 (file)
@@ -5,12 +5,12 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
-#include <process/config_ctl_info.h>
+#include <database/config_ctl_info.h>
 
 using namespace isc::data;
 
 namespace isc {
-namespace process {
+namespace db {
 
 void
 ConfigDbInfo::setAccessString(const std::string& access_str) {
similarity index 99%
rename from src/lib/process/config_ctl_info.h
rename to src/lib/database/config_ctl_info.h
index b5c94eff5b185e73a2d257c9aa7e269c05b272ef..5ba0b8c63e665397cc999f2d02b245dc491625bc 100644 (file)
@@ -15,7 +15,7 @@
 #include <vector>
 
 namespace isc {
-namespace process {
+namespace db {
 
 /// @brief Provides configuration information used during a server's
 /// configuration process
similarity index 96%
rename from src/lib/process/config_ctl_parser.cc
rename to src/lib/database/config_ctl_parser.cc
index 4474876e8ed8b2351a2da84d577be866cff845e2..0e85997abaabde0a6f85d26260647188b6451e86 100644 (file)
@@ -7,7 +7,7 @@
 #include <config.h>
 
 #include <cc/dhcp_config_error.h>
-#include <process/config_ctl_parser.h>
+#include <database/config_ctl_parser.h>
 #include <database/dbaccess_parser.h>
 #include <string>
 
@@ -15,7 +15,7 @@ using namespace isc;
 using namespace isc::data;
 
 namespace isc {
-namespace process {
+namespace db {
 
 ConfigControlInfoPtr
 ConfigControlParser::parse(const data::ConstElementPtr& config_control) {
similarity index 94%
rename from src/lib/process/config_ctl_parser.h
rename to src/lib/database/config_ctl_parser.h
index 4182a1908e52cb380a6aee75cb4009a97828a94b..f228669f5d8dfe4c133380f82e7f93a6fbf528af 100644 (file)
@@ -9,10 +9,10 @@
 
 #include <cc/data.h>
 #include <cc/simple_parser.h>
-#include <process/config_ctl_info.h>
+#include <database/config_ctl_info.h>
 
 namespace isc {
-namespace process {
+namespace db {
 
 /// @brief Implements parser for config control information, "config-control"
 class ConfigControlParser : isc::data::SimpleParser {
index 4e1609d18f7342c6618da130e17399ab1894ed6b..10bc46fa831590c8f5fa2f39fe65b0045ecadc32 100644 (file)
@@ -20,6 +20,8 @@ if HAVE_GTEST
 TESTS += libdatabase_unittests
 
 libdatabase_unittests_SOURCES  = backend_selector_unittest.cc
+libdatabase_unittests_SOURCES += config_ctl_info_unittests.cc
+libdatabase_unittests_SOURCES += config_ctl_parser_unittests.cc
 libdatabase_unittests_SOURCES += database_connection_unittest.cc
 libdatabase_unittests_SOURCES += dbaccess_parser_unittest.cc
 libdatabase_unittests_SOURCES += run_unittests.cc
similarity index 98%
rename from src/lib/process/tests/config_ctl_info_unittests.cc
rename to src/lib/database/tests/config_ctl_info_unittests.cc
index 5f0c50f5d6f0a6ed4b487d2c084bb0238e29b44b..e497fc15e3c064867804096b2aedf4897f160495 100644 (file)
@@ -5,7 +5,7 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
-#include <process/config_ctl_info.h>
+#include <database/config_ctl_info.h>
 #include <exceptions/exceptions.h>
 
 #include <gtest/gtest.h>
@@ -13,7 +13,7 @@
 #include <sstream>
 #include <iostream>
 
-using namespace isc::process;
+using namespace isc::db;
 using namespace isc::data;
 
 // Verifies initializing via an access string and unparsing into elements
similarity index 97%
rename from src/lib/process/tests/config_ctl_parser_unittests.cc
rename to src/lib/database/tests/config_ctl_parser_unittests.cc
index bf1be4d1ac619bf0a639303b3b979a28524318f6..1b4fdf85fc9be7c15a5ec7bca621651eca5d43f8 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <config.h>
 #include <cc/dhcp_config_error.h>
-#include <process/config_ctl_parser.h>
+#include <database/config_ctl_parser.h>
 #include <exceptions/exceptions.h>
 
 #include <gtest/gtest.h>
@@ -14,7 +14,7 @@
 #include <sstream>
 #include <iostream>
 
-using namespace isc::process;
+using namespace isc::db;
 using namespace isc::data;
 
 // Verifies valid configurations are parsed correctly.  The test
index 967d021553fd55b9a31cd3fd3b8122cb9299f4fc..ca4369709a1e0e44b0f4ab80e62123dc59dac215 100644 (file)
@@ -38,7 +38,7 @@ SrvConfig::SrvConfig()
       decline_timer_(0), echo_v4_client_id_(true), dhcp4o6_port_(0),
       d2_client_config_(new D2ClientConfig()),
       configured_globals_(Element::createMap()),
-      cfg_consist_(new CfgConsistency()), 
+      cfg_consist_(new CfgConsistency()),
       server_tag_("") {
 }
 
@@ -128,6 +128,13 @@ SrvConfig::copy(SrvConfig& new_config) const {
          it != hooks_config_.get().end(); ++it) {
         new_config.hooks_config_.add(it->first, it->second);
     }
+
+    // Clone the config control info
+    if (config_ctl_info_) {
+        new_config.config_ctl_info_.reset(new ConfigControlInfo(*config_ctl_info_));
+    } else {
+        new_config.config_ctl_info_.reset();
+    }
 }
 
 bool
@@ -146,6 +153,15 @@ SrvConfig::equals(const SrvConfig& other) const {
         (*d2_client_config_ != *other.d2_client_config_)) {
         return (false);
     }
+
+    // Check config control info for equality.
+    if ((config_ctl_info_ && !other.config_ctl_info_) ||
+        (!config_ctl_info_ && other.config_ctl_info_) ||
+        ((config_ctl_info_ && other.config_ctl_info_) &&
+         (!config_ctl_info_->equals(*(other.config_ctl_info_))))) {
+        return (false);
+    }
+
     // Now only configured hooks libraries can differ.
     // If number of configured hooks libraries are different, then
     // configurations aren't equal.
index 3f317f0ba38aec7f55b6585636d7d39f47f22a1d..1b91d586ae5c28feb73a1cb95979f76b6c7417c2 100644 (file)
@@ -24,6 +24,7 @@
 #include <dhcpsrv/cfg_consistency.h>
 #include <dhcpsrv/client_class_def.h>
 #include <dhcpsrv/d2_client_cfg.h>
+#include <database/config_ctl_info.h>
 #include <process/config_base.h>
 #include <hooks/hooks_config.h>
 #include <cc/data.h>
@@ -392,6 +393,26 @@ public:
         return (hooks_config_);
     }
 
+    /// @brief Fetches a read-only copy of the configuration control
+    /// information
+    /// @return pointer to the const ConfigControlInfo
+    db::ConstConfigControlInfoPtr getConfigControlInfo() const {
+        return (config_ctl_info_);
+    }
+
+    /// @brief Set the configuration control information
+    ///
+    /// Updates the internal pointer to the configuration control
+    /// information with the given pointer value.  If the given pointer
+    /// is empty, the internal pointer will be reset.
+    ///
+    /// @param config_ctl_info pointer to the configuration value
+    /// to store.
+    void setConfigControlInfo(const db::ConfigControlInfoPtr&
+                              config_ctl_info) {
+        config_ctl_info_ = config_ctl_info;
+    }
+
     /// @brief Copies the current configuration to a new configuration.
     ///
     /// This method copies the parameters stored in the configuration to
@@ -683,6 +704,9 @@ private:
 
     /// @brief Logical name of the server
     std::string server_tag_;
+
+    /// @brief Configuration control information.
+    db::ConfigControlInfoPtr config_ctl_info_;
 };
 
 /// @name Pointers to the @c SrvConfig object.
index f2d838cf56e01c7032291375fc4566aa4947256d..e2fb5ed825dd9c94ebcf650a94c72628f1a81cbb 100644 (file)
@@ -28,8 +28,6 @@ DISTCLEANFILES = spec_config.h.pre
 
 lib_LTLIBRARIES = libkea-process.la
 libkea_process_la_SOURCES  = config_base.cc config_base.h
-libkea_process_la_SOURCES += config_ctl_info.cc config_ctl_info.h
-libkea_process_la_SOURCES += config_ctl_parser.cc config_ctl_parser.h
 libkea_process_la_SOURCES += d_cfg_mgr.cc d_cfg_mgr.h
 libkea_process_la_SOURCES += d_controller.cc d_controller.h
 libkea_process_la_SOURCES += d_log.cc d_log.h
index 74b4ca788f7090a8ae5e610da95d318023f972ae..f72b0209b84cb1a6afe35062254aa9ebc1731a29 100644 (file)
@@ -54,14 +54,6 @@ ConfigBase::equals(const ConfigBase& other) const {
         }
     }
 
-    // Check config control info for equality.
-    if ((config_ctl_info_ && !other.config_ctl_info_) ||
-        (!config_ctl_info_ && other.config_ctl_info_) ||
-        ((config_ctl_info_ && other.config_ctl_info_) &&
-         (!config_ctl_info_->equals(*(other.config_ctl_info_))))) {
-        return (false);
-    }
-
     return (true);
 }
 
@@ -73,13 +65,6 @@ ConfigBase::copy(ConfigBase& other) const {
          it != logging_info_.end(); ++it) {
         other.addLoggingInfo(*it);
     }
-
-    // Clone the config control info
-    if (config_ctl_info_) {
-        other.config_ctl_info_.reset(new ConfigControlInfo(*config_ctl_info_));
-    } else {
-        other.config_ctl_info_.reset();
-    }
 }
 
 ElementPtr
index bdf8fbc8843631d4c0223fe44f25d2d0184bf0ca..240b883bbe57ff4ad516be7ebbdff823d8f306a6 100644 (file)
@@ -9,7 +9,6 @@
 
 #include <cc/cfg_to_element.h>
 #include <cc/user_context.h>
-#include <process/config_ctl_info.h>
 #include <process/logging_info.h>
 
 namespace isc {
@@ -76,26 +75,6 @@ public:
     /// @return Element representation.
     virtual isc::data::ElementPtr toElement() const;
 
-    /// @brief Fetches a read-only copy of the configuration control
-    /// information
-    /// @return pointer to the const ConfigControlInfo
-    process::ConstConfigControlInfoPtr getConfigControlInfo() const {
-        return (config_ctl_info_);
-    }
-
-    /// @brief Set the configuration control information
-    ///
-    /// Updates the internal pointer to the configuration control
-    /// information with the given pointer value.  If the given pointer
-    /// is empty, the internal pointer will be reset.
-    ///
-    /// @param config_ctl_info pointer to the configuration value
-    /// to store.
-    void setConfigControlInfo(const process::ConfigControlInfoPtr&
-                              config_ctl_info) {
-        config_ctl_info_ = config_ctl_info;
-    }
-
 protected:
     /// @brief Copies the current configuration to a new configuration.
     ///
@@ -110,9 +89,6 @@ protected:
 private:
     /// @brief Logging specific information.
     process::LoggingInfoStorage logging_info_;
-
-    /// @brief Configuration control information.
-    process::ConfigControlInfoPtr config_ctl_info_;
 };
 
 /// @brief Non-const pointer to the @c SrvConfig.
index 2fe844b5d40c7636e37dc347b1871b8ff6c6122d..0d2a7e4495a6640dc0d5417770a87f9a07e1d58c 100644 (file)
@@ -23,8 +23,6 @@ TESTS += libprocess_unittests
 
 libprocess_unittests_SOURCES  = d_cfg_mgr_unittests.cc
 libprocess_unittests_SOURCES += config_base_unittests.cc
-libprocess_unittests_SOURCES += config_ctl_info_unittests.cc
-libprocess_unittests_SOURCES += config_ctl_parser_unittests.cc
 libprocess_unittests_SOURCES += d_controller_unittests.cc
 libprocess_unittests_SOURCES += daemon_unittest.cc
 libprocess_unittests_SOURCES += io_service_signal_unittests.cc