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 {
// Set server-ip
result->set("server-ip", Element::create(server_ip_.toText()));
// Set server-port
result->set("server-port",
Element::create(static_cast<long long>(server_port_)));
result->set("server-port", Element::create(static_cast<long long>(server_port_)));
// Set sender-ip
result->set("sender-ip", Element::create(sender_ip_.toText()));
// Set sender-port
result->set("sender-port",
Element::create(static_cast<long long>(sender_port_)));
result->set("sender-port", Element::create(static_cast<long long>(sender_port_)));
// Set max-queue-size
result->set("max-queue-size",
Element::create(static_cast<long long>(max_queue_size_)));
result->set("max-queue-size", Element::create(static_cast<long long>(max_queue_size_)));
// Set ncr-protocol
result->set("ncr-protocol",
Element::create(dhcp_ddns::
ncrProtocolToString(ncr_protocol_)));
result->set("ncr-protocol", Element::create(dhcp_ddns::ncrProtocolToString(ncr_protocol_)));
// Set ncr-format
result->set("ncr-format",
Element::create(dhcp_ddns::ncrFormatToString(ncr_format_)));
result->set("ncr-format", Element::create(dhcp_ddns::ncrFormatToString(ncr_format_)));
// Set always-include-fqdn
result->set("always-include-fqdn", Element::create(always_include_fqdn_));
// Set override-no-update
result->set("override-no-update", Element::create(override_no_update_));
// Set override-client-update
result->set("override-client-update",
Element::create(override_client_update_));
result->set("override-client-update", Element::create(override_client_update_));
// Set replace-client-name
result->set("replace-client-name",
Element::create(replaceClientNameModeToString
(replace_client_name_mode_)));
Element::create(replaceClientNameModeToString(replace_client_name_mode_)));
// Set generated-prefix
result->set("generated-prefix", Element::create(generated_prefix_));
return (result);
......
......@@ -223,20 +223,19 @@ SrvConfig::toElement() const {
// Set dhcp-ddns
dhcp->set("dhcp-ddns", d2_client_config_->toElement());
// Set interfaces-config
ConstElementPtr ifaces = cfg_iface_->toElement();
dhcp->set("interfaces-config", cfg_iface_->toElement());
// Set option-def
ConstElementPtr option_def = cfg_option_def_->toElement();
dhcp->set("option-def", option_def);
dhcp->set("option-def", cfg_option_def_->toElement());
// Set option-data
ConstElementPtr option_data = cfg_option_->toElement();
dhcp->set("option-data", option_data);
dhcp->set("option-data", cfg_option_->toElement());
// Set subnets
ConstElementPtr subnets;
if (family == AF_INET) {
subnets = cfg_subnets4_->toElement();
dhcp->set("subnet4", subnets);
} else {
subnets = cfg_subnets6_->toElement();
dhcp->set("subnet6", subnets);
}
// Insert reservations
CfgHostsList resv_list;
......@@ -252,21 +251,15 @@ SrvConfig::toElement() const {
ConstElementPtr resvs = resv_list.get(subnet_id);
(*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
ConstElementPtr expired = cfg_expiration_->toElement();
dhcp->set("expired-leases-processing", expired);
// Set server-id (DHCPv6)
if (family == AF_INET6) {
// Set server-id (DHCPv6)
dhcp->set("server-id", cfg_duid_->toElement());
// Set relay-supplied-options (DHCPv6)
dhcp->set("relay-supplied-options", cfg_rsoo_->toElement());
}
// Set lease-database
CfgLeaseDbAccess lease_db(*cfg_db_access_);
......
......@@ -509,7 +509,6 @@ public:
///
/// @param port port and port + 1 to use
void setDhcp4o6Port(uint16_t port) {
/// @todo: Port is supposed to be uint16_t, not uint32_t
dhcp4o6_port_ = port;
}
......
......@@ -464,7 +464,7 @@ TEST_F(SrvConfigTest, unparse) {
std::string params = "\"echo-client-id\": true,\n";
params += "\"dhcp4o6-port\": 0\n";
std::string trailer = "}\n}\n";
// Verify DHCPv4
CfgMgr::instance().setFamily(AF_INET);
isc::test::runToElementTest<SrvConfig>
......
......@@ -647,7 +647,7 @@ private:
/// @brief Stores non-scalar configuration elements
ObjectStoragePtr object_values_;
/// @brief Unparse a configuration objet
/// @brief Unparse a configuration object
///
/// @return a pointer to a configuration
virtual isc::data::ElementPtr toElement() const;
......
......@@ -42,7 +42,7 @@ void runToElementTest(const std::string& expected, const Cfg& cfg) {
using namespace isc::data;
#ifdef HAVE_IS_BASE_OF
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
ConstElementPtr json;
ASSERT_NO_THROW(json = Element::fromJSON(expected)) << expected;
......@@ -69,7 +69,7 @@ template<typename Cfg>
void runToElementTest(isc::data::ConstElementPtr expected, const Cfg& cfg) {
#ifdef HAVE_IS_BASE_OF
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
isc::data::ConstElementPtr unparsed;
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