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
// 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) {
#include <vector>
namespace isc {
-namespace process {
+namespace db {
/// @brief Provides configuration information used during a server's
/// configuration process
#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>
using namespace isc::data;
namespace isc {
-namespace process {
+namespace db {
ConfigControlInfoPtr
ConfigControlParser::parse(const data::ConstElementPtr& config_control) {
#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 {
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
// 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>
#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
#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>
#include <sstream>
#include <iostream>
-using namespace isc::process;
+using namespace isc::db;
using namespace isc::data;
// Verifies valid configurations are parsed correctly. The test
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_("") {
}
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
(*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.
#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>
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
/// @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.
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
}
}
- // 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);
}
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
#include <cc/cfg_to_element.h>
#include <cc/user_context.h>
-#include <process/config_ctl_info.h>
#include <process/logging_info.h>
namespace isc {
/// @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.
///
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.
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