Commit 5d6c4519 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰

[5114] Minor corrections

 - spelling errors
 - overly wrapped text unwrapped
 - obsolete @todo removed
parent d04f9047
...@@ -229,34 +229,26 @@ D2ClientConfig::toElement() const { ...@@ -229,34 +229,26 @@ D2ClientConfig::toElement() const {
// Set server-ip // Set server-ip
result->set("server-ip", Element::create(server_ip_.toText())); result->set("server-ip", Element::create(server_ip_.toText()));
// Set server-port // Set server-port
result->set("server-port", result->set("server-port", Element::create(static_cast<long long>(server_port_)));
Element::create(static_cast<long long>(server_port_)));
// Set sender-ip // Set sender-ip
result->set("sender-ip", Element::create(sender_ip_.toText())); result->set("sender-ip", Element::create(sender_ip_.toText()));
// Set sender-port // Set sender-port
result->set("sender-port", result->set("sender-port", Element::create(static_cast<long long>(sender_port_)));
Element::create(static_cast<long long>(sender_port_)));
// Set max-queue-size // Set max-queue-size
result->set("max-queue-size", result->set("max-queue-size", Element::create(static_cast<long long>(max_queue_size_)));
Element::create(static_cast<long long>(max_queue_size_)));
// Set ncr-protocol // Set ncr-protocol
result->set("ncr-protocol", result->set("ncr-protocol", Element::create(dhcp_ddns::ncrProtocolToString(ncr_protocol_)));
Element::create(dhcp_ddns::
ncrProtocolToString(ncr_protocol_)));
// Set ncr-format // Set ncr-format
result->set("ncr-format", result->set("ncr-format", Element::create(dhcp_ddns::ncrFormatToString(ncr_format_)));
Element::create(dhcp_ddns::ncrFormatToString(ncr_format_)));
// Set always-include-fqdn // Set always-include-fqdn
result->set("always-include-fqdn", Element::create(always_include_fqdn_)); result->set("always-include-fqdn", Element::create(always_include_fqdn_));
// Set override-no-update // Set override-no-update
result->set("override-no-update", Element::create(override_no_update_)); result->set("override-no-update", Element::create(override_no_update_));
// Set override-client-update // Set override-client-update
result->set("override-client-update", result->set("override-client-update", Element::create(override_client_update_));
Element::create(override_client_update_));
// Set replace-client-name // Set replace-client-name
result->set("replace-client-name", result->set("replace-client-name",
Element::create(replaceClientNameModeToString Element::create(replaceClientNameModeToString(replace_client_name_mode_)));
(replace_client_name_mode_)));
// Set generated-prefix // Set generated-prefix
result->set("generated-prefix", Element::create(generated_prefix_)); result->set("generated-prefix", Element::create(generated_prefix_));
return (result); return (result);
......
...@@ -223,20 +223,19 @@ SrvConfig::toElement() const { ...@@ -223,20 +223,19 @@ SrvConfig::toElement() const {
// Set dhcp-ddns // Set dhcp-ddns
dhcp->set("dhcp-ddns", d2_client_config_->toElement()); dhcp->set("dhcp-ddns", d2_client_config_->toElement());
// Set interfaces-config // Set interfaces-config
ConstElementPtr ifaces = cfg_iface_->toElement();
dhcp->set("interfaces-config", cfg_iface_->toElement()); dhcp->set("interfaces-config", cfg_iface_->toElement());
// Set option-def // Set option-def
ConstElementPtr option_def = cfg_option_def_->toElement(); dhcp->set("option-def", cfg_option_def_->toElement());
dhcp->set("option-def", option_def);
// Set option-data // Set option-data
ConstElementPtr option_data = cfg_option_->toElement(); dhcp->set("option-data", cfg_option_->toElement());
dhcp->set("option-data", option_data);
// Set subnets // Set subnets
ConstElementPtr subnets; ConstElementPtr subnets;
if (family == AF_INET) { if (family == AF_INET) {
subnets = cfg_subnets4_->toElement(); subnets = cfg_subnets4_->toElement();
dhcp->set("subnet4", subnets);
} else { } else {
subnets = cfg_subnets6_->toElement(); subnets = cfg_subnets6_->toElement();
dhcp->set("subnet6", subnets);
} }
// Insert reservations // Insert reservations
CfgHostsList resv_list; CfgHostsList resv_list;
...@@ -252,21 +251,15 @@ SrvConfig::toElement() const { ...@@ -252,21 +251,15 @@ SrvConfig::toElement() const {
ConstElementPtr resvs = resv_list.get(subnet_id); ConstElementPtr resvs = resv_list.get(subnet_id);
(*subnet)->set("reservations", resvs); (*subnet)->set("reservations", resvs);
} }
if (family == AF_INET) {
dhcp->set("subnet4", subnets);
} else {
dhcp->set("subnet6", subnets);
}
// Set relay-supplied-options (DHCPv6)
if (family == AF_INET6) {
dhcp->set("relay-supplied-options", cfg_rsoo_->toElement());
}
// Set expired-leases-processing // Set expired-leases-processing
ConstElementPtr expired = cfg_expiration_->toElement(); ConstElementPtr expired = cfg_expiration_->toElement();
dhcp->set("expired-leases-processing", expired); dhcp->set("expired-leases-processing", expired);
// Set server-id (DHCPv6)
if (family == AF_INET6) { if (family == AF_INET6) {
// Set server-id (DHCPv6)
dhcp->set("server-id", cfg_duid_->toElement()); dhcp->set("server-id", cfg_duid_->toElement());
// Set relay-supplied-options (DHCPv6)
dhcp->set("relay-supplied-options", cfg_rsoo_->toElement());
} }
// Set lease-database // Set lease-database
CfgLeaseDbAccess lease_db(*cfg_db_access_); CfgLeaseDbAccess lease_db(*cfg_db_access_);
......
...@@ -509,7 +509,6 @@ public: ...@@ -509,7 +509,6 @@ public:
/// ///
/// @param port port and port + 1 to use /// @param port port and port + 1 to use
void setDhcp4o6Port(uint16_t port) { void setDhcp4o6Port(uint16_t port) {
/// @todo: Port is supposed to be uint16_t, not uint32_t
dhcp4o6_port_ = port; dhcp4o6_port_ = port;
} }
......
...@@ -464,7 +464,7 @@ TEST_F(SrvConfigTest, unparse) { ...@@ -464,7 +464,7 @@ TEST_F(SrvConfigTest, unparse) {
std::string params = "\"echo-client-id\": true,\n"; std::string params = "\"echo-client-id\": true,\n";
params += "\"dhcp4o6-port\": 0\n"; params += "\"dhcp4o6-port\": 0\n";
std::string trailer = "}\n}\n"; std::string trailer = "}\n}\n";
// Verify DHCPv4 // Verify DHCPv4
CfgMgr::instance().setFamily(AF_INET); CfgMgr::instance().setFamily(AF_INET);
isc::test::runToElementTest<SrvConfig> isc::test::runToElementTest<SrvConfig>
......
...@@ -647,7 +647,7 @@ private: ...@@ -647,7 +647,7 @@ private:
/// @brief Stores non-scalar configuration elements /// @brief Stores non-scalar configuration elements
ObjectStoragePtr object_values_; ObjectStoragePtr object_values_;
/// @brief Unparse a configuration objet /// @brief Unparse a configuration object
/// ///
/// @return a pointer to a configuration /// @return a pointer to a configuration
virtual isc::data::ElementPtr toElement() const; virtual isc::data::ElementPtr toElement() const;
......
...@@ -42,7 +42,7 @@ void runToElementTest(const std::string& expected, const Cfg& cfg) { ...@@ -42,7 +42,7 @@ void runToElementTest(const std::string& expected, const Cfg& cfg) {
using namespace isc::data; using namespace isc::data;
#ifdef HAVE_IS_BASE_OF #ifdef HAVE_IS_BASE_OF
static_assert(std::is_base_of<CfgToElement, Cfg>::value, static_assert(std::is_base_of<CfgToElement, Cfg>::value,
"CfgToElement is not a base of the tenplate parameter"); "CfgToElement is not a base of the template parameter");
#endif #endif
ConstElementPtr json; ConstElementPtr json;
ASSERT_NO_THROW(json = Element::fromJSON(expected)) << expected; ASSERT_NO_THROW(json = Element::fromJSON(expected)) << expected;
...@@ -69,7 +69,7 @@ template<typename Cfg> ...@@ -69,7 +69,7 @@ template<typename Cfg>
void runToElementTest(isc::data::ConstElementPtr expected, const Cfg& cfg) { void runToElementTest(isc::data::ConstElementPtr expected, const Cfg& cfg) {
#ifdef HAVE_IS_BASE_OF #ifdef HAVE_IS_BASE_OF
static_assert(std::is_base_of<isc::data::CfgToElement, Cfg>::value, static_assert(std::is_base_of<isc::data::CfgToElement, Cfg>::value,
"CfgToElement is not a base of the tenplate parameter"); "CfgToElement is not a base of the template parameter");
#endif #endif
isc::data::ConstElementPtr unparsed; isc::data::ConstElementPtr unparsed;
ASSERT_NO_THROW(unparsed = cfg.toElement()); ASSERT_NO_THROW(unparsed = cfg.toElement());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment