mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 14:05:33 +00:00
[#946] Checkpoint: code done, new tests to add
This commit is contained in:
committed by
Marcin Siodelski
parent
cb75f05bf5
commit
619d7c30bb
@@ -310,6 +310,12 @@ public:
|
||||
MySqlBinding::createString(CLIENT_CLASS_BUF_LENGTH), // pool: client_class
|
||||
MySqlBinding::createString(REQUIRE_CLIENT_CLASSES_BUF_LENGTH), // pool: require_client_classes
|
||||
MySqlBinding::createString(USER_CONTEXT_BUF_LENGTH), // pool: user_context
|
||||
MySqlBinding::createInteger<uint8_t>(), // ddns_send_updates
|
||||
MySqlBinding::createInteger<uint8_t>(), // ddns_override_no_update
|
||||
MySqlBinding::createInteger<uint8_t>(), // ddns_override_client_update
|
||||
MySqlBinding::createInteger<uint8_t>(), // ddns_replace_client_name
|
||||
MySqlBinding::createString(DNS_NAME_BUF_LENGTH), // ddns_generated_prefix
|
||||
MySqlBinding::createString(DNS_NAME_BUF_LENGTH), // ddns_qualifying_suffix
|
||||
MySqlBinding::createString(SERVER_TAG_BUF_LENGTH) // server_tag
|
||||
};
|
||||
|
||||
@@ -425,6 +431,7 @@ public:
|
||||
last_subnet->addRelayAddress(IOAddress(relay_element->get(i)->stringValue()));
|
||||
}
|
||||
}
|
||||
|
||||
// require_client_classes
|
||||
ElementPtr require_element = out_bindings[14]->getJSON();
|
||||
if (require_element) {
|
||||
@@ -488,7 +495,38 @@ public:
|
||||
|
||||
// pool client_class, require_client_classes and user_context
|
||||
|
||||
// server_tag at 58
|
||||
// ddns_send_updates at 58
|
||||
if (!out_bindings[58]->amNull()) {
|
||||
last_subnet->setDdnsSendUpdates(out_bindings[58]->getBool());
|
||||
}
|
||||
|
||||
// ddns_override_no_update at 59
|
||||
if (!out_bindings[59]->amNull()) {
|
||||
last_subnet->setDdnsOverrideNoUpdate(out_bindings[59]->getBool());
|
||||
}
|
||||
|
||||
// ddns_override_client_update at 60
|
||||
if (!out_bindings[60]->amNull()) {
|
||||
last_subnet->setDdnsOverrideClientUpdate(out_bindings[60]->getBool());
|
||||
}
|
||||
|
||||
// ddns_replace_client_name at 61
|
||||
if (!out_bindings[61]->amNull()) {
|
||||
last_subnet->setDdnsReplaceClientNameMode(static_cast<D2ClientConfig::ReplaceClientNameMode>
|
||||
(out_bindings[61]->getInteger<uint8_t>()));
|
||||
}
|
||||
|
||||
// ddns_generated_prefix at 62
|
||||
if (!out_bindings[62]->amNull()) {
|
||||
last_subnet->setDdnsGeneratedPrefix(out_bindings[62]->getString());
|
||||
}
|
||||
|
||||
// ddns_qualifying_suffix at 63
|
||||
if (!out_bindings[63]->amNull()) {
|
||||
last_subnet->setDdnsQualifyingSuffix(out_bindings[63]->getString());
|
||||
}
|
||||
|
||||
// server_tag at 64
|
||||
|
||||
// Subnet ready. Add it to the list.
|
||||
auto ret = subnets.push_back(last_subnet);
|
||||
@@ -502,9 +540,9 @@ public:
|
||||
}
|
||||
|
||||
// Check for new server tags.
|
||||
if (!out_bindings[58]->amNull() &&
|
||||
(last_tag != out_bindings[58]->getString())) {
|
||||
last_tag = out_bindings[58]->getString();
|
||||
if (!out_bindings[64]->amNull() &&
|
||||
(last_tag != out_bindings[64]->getString())) {
|
||||
last_tag = out_bindings[64]->getString();
|
||||
if (!last_tag.empty() && !last_subnet->hasServerTag(ServerTag(last_tag))) {
|
||||
last_subnet->setServerTag(last_tag);
|
||||
}
|
||||
@@ -908,6 +946,16 @@ public:
|
||||
hr_mode_binding = MySqlBinding::createNull();
|
||||
}
|
||||
|
||||
// Create binding for DDNS replace client name mode.
|
||||
MySqlBindingPtr ddns_rcn_mode_binding;
|
||||
auto ddns_rcn_mode = subnet->getDdnsReplaceClientNameMode(Network::Inheritance::NONE);
|
||||
if (!ddns_rcn_mode.unspecified()) {
|
||||
ddns_rcn_mode_binding = MySqlBinding::createInteger<uint8_t>(static_cast<uint8_t>
|
||||
(ddns_rcn_mode.get()));
|
||||
} else {
|
||||
ddns_rcn_mode_binding = MySqlBinding::createNull();
|
||||
}
|
||||
|
||||
// Create binding with shared network name if the subnet belongs to a
|
||||
// shared network.
|
||||
MySqlBindingPtr shared_network_binding;
|
||||
@@ -962,7 +1010,13 @@ public:
|
||||
MySqlBinding::condCreateBool(subnet->getCalculateTeeTimes(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateFloat(subnet->getT1Percent(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateFloat(subnet->getT2Percent(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateBool(subnet->getAuthoritative(Network::Inheritance::NONE))
|
||||
MySqlBinding::condCreateBool(subnet->getAuthoritative(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateBool(subnet->getDdnsSendUpdates(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateBool(subnet->getDdnsOverrideNoUpdate(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateBool(subnet->getDdnsOverrideClientUpdate(Network::Inheritance::NONE)),
|
||||
ddns_rcn_mode_binding,
|
||||
MySqlBinding::condCreateString(subnet->getDdnsGeneratedPrefix(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateString(subnet->getDdnsQualifyingSuffix(Network::Inheritance::NONE))
|
||||
};
|
||||
|
||||
MySqlTransaction transaction(conn_);
|
||||
@@ -1200,6 +1254,12 @@ public:
|
||||
MySqlBinding::createString(SERVER_HOSTNAME_BUF_LENGTH), // server_hostname
|
||||
MySqlBinding::createInteger<uint32_t>(), // min_valid_lifetime
|
||||
MySqlBinding::createInteger<uint32_t>(), // max_valid_lifetime
|
||||
MySqlBinding::createInteger<uint8_t>(), // ddns_send_updates
|
||||
MySqlBinding::createInteger<uint8_t>(), // ddns_override_no_update
|
||||
MySqlBinding::createInteger<uint8_t>(), // ddns_override_client_update
|
||||
MySqlBinding::createInteger<uint8_t>(), // ddns_replace_client_name
|
||||
MySqlBinding::createString(DNS_NAME_BUF_LENGTH), // ddns_generated_prefix
|
||||
MySqlBinding::createString(DNS_NAME_BUF_LENGTH), // ddns_qualifying_suffix
|
||||
MySqlBinding::createString(SERVER_TAG_BUF_LENGTH) // server_tag
|
||||
};
|
||||
|
||||
@@ -1346,6 +1406,37 @@ public:
|
||||
|
||||
// {min,max}_valid_lifetime
|
||||
|
||||
// ddns_send_updates at 34
|
||||
if (!out_bindings[34]->amNull()) {
|
||||
last_network->setDdnsSendUpdates(out_bindings[34]->getBool());
|
||||
}
|
||||
|
||||
// ddns_override_no_update at 35
|
||||
if (!out_bindings[35]->amNull()) {
|
||||
last_network->setDdnsOverrideNoUpdate(out_bindings[35]->getBool());
|
||||
}
|
||||
|
||||
// ddns_override_client_update at 36
|
||||
if (!out_bindings[36]->amNull()) {
|
||||
last_network->setDdnsOverrideClientUpdate(out_bindings[36]->getBool());
|
||||
}
|
||||
|
||||
// ddns_replace_client_name at 37
|
||||
if (!out_bindings[37]->amNull()) {
|
||||
last_network->setDdnsReplaceClientNameMode(static_cast<D2ClientConfig::ReplaceClientNameMode>
|
||||
(out_bindings[37]->getInteger<uint8_t>()));
|
||||
}
|
||||
|
||||
// ddns_generated_prefix at 38
|
||||
if (!out_bindings[38]->amNull()) {
|
||||
last_network->setDdnsGeneratedPrefix(out_bindings[38]->getString());
|
||||
}
|
||||
|
||||
// ddns_qualifying_suffix at 39
|
||||
if (!out_bindings[39]->amNull()) {
|
||||
last_network->setDdnsQualifyingSuffix(out_bindings[39]->getString());
|
||||
}
|
||||
|
||||
// Add the shared network.
|
||||
auto ret = shared_networks.push_back(last_network);
|
||||
|
||||
@@ -1358,9 +1449,9 @@ public:
|
||||
}
|
||||
|
||||
// Check for new server tags.
|
||||
if (!out_bindings[34]->amNull() &&
|
||||
(last_tag != out_bindings[34]->getString())) {
|
||||
last_tag = out_bindings[34]->getString();
|
||||
if (!out_bindings[40]->amNull() &&
|
||||
(last_tag != out_bindings[40]->getString())) {
|
||||
last_tag = out_bindings[40]->getString();
|
||||
if (!last_tag.empty() && !last_network->hasServerTag(ServerTag(last_tag))) {
|
||||
last_network->setServerTag(last_tag);
|
||||
}
|
||||
@@ -1486,6 +1577,16 @@ public:
|
||||
hr_mode_binding = MySqlBinding::createNull();
|
||||
}
|
||||
|
||||
// Create binding for DDNS replace client name mode.
|
||||
MySqlBindingPtr ddns_rcn_mode_binding;
|
||||
auto ddns_rcn_mode = shared_network->getDdnsReplaceClientNameMode(Network::Inheritance::NONE);
|
||||
if (!ddns_rcn_mode.unspecified()) {
|
||||
ddns_rcn_mode_binding = MySqlBinding::createInteger<uint8_t>(static_cast<uint8_t>
|
||||
(ddns_rcn_mode.get()));
|
||||
} else {
|
||||
ddns_rcn_mode_binding = MySqlBinding::createNull();
|
||||
}
|
||||
|
||||
MySqlBindingCollection in_bindings = {
|
||||
MySqlBinding::createString(shared_network->getName()),
|
||||
MySqlBinding::condCreateString(shared_network->getClientClass(Network::Inheritance::NONE)),
|
||||
@@ -1507,7 +1608,13 @@ public:
|
||||
MySqlBinding::condCreateBool(shared_network->getAuthoritative(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateString(shared_network->getFilename(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateIPv4Address(shared_network->getSiaddr(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateString(shared_network->getSname(Network::Inheritance::NONE))
|
||||
MySqlBinding::condCreateString(shared_network->getSname(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateBool(shared_network->getDdnsSendUpdates(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateBool(shared_network->getDdnsOverrideNoUpdate(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateBool(shared_network->getDdnsOverrideClientUpdate(Network::Inheritance::NONE)),
|
||||
ddns_rcn_mode_binding,
|
||||
MySqlBinding::condCreateString(shared_network->getDdnsGeneratedPrefix(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateString(shared_network->getDdnsQualifyingSuffix(Network::Inheritance::NONE))
|
||||
};
|
||||
|
||||
MySqlTransaction transaction(conn_);
|
||||
@@ -2348,9 +2455,15 @@ TaggedStatementArray tagged_statements = { {
|
||||
" calculate_tee_times,"
|
||||
" t1_percent,"
|
||||
" t2_percent,"
|
||||
" authoritative"
|
||||
" authoritative,"
|
||||
" ddns_send_updates,"
|
||||
" ddns_override_no_update,"
|
||||
" ddns_override_client_update,"
|
||||
" ddns_replace_client_name,"
|
||||
" ddns_generated_prefix,"
|
||||
" ddns_qualifying_suffix"
|
||||
") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
|
||||
"?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" },
|
||||
"?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" },
|
||||
|
||||
// Insert association of the subnet with a server.
|
||||
{ MySqlConfigBackendDHCPv4Impl::INSERT_SUBNET4_SERVER,
|
||||
@@ -2385,9 +2498,15 @@ TaggedStatementArray tagged_statements = { {
|
||||
" authoritative,"
|
||||
" boot_file_name,"
|
||||
" next_server,"
|
||||
" server_hostname"
|
||||
" server_hostname,"
|
||||
" ddns_send_updates,"
|
||||
" ddns_override_no_update,"
|
||||
" ddns_override_client_update,"
|
||||
" ddns_replace_client_name,"
|
||||
" ddns_generated_prefix,"
|
||||
" ddns_qualifying_suffix"
|
||||
") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
|
||||
" ?, ?, ?, ?, ?, ?, ?, ?, ?)" },
|
||||
" ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" },
|
||||
|
||||
// Insert association of the shared network with a server.
|
||||
{ MySqlConfigBackendDHCPv4Impl::INSERT_SHARED_NETWORK4_SERVER,
|
||||
@@ -2452,7 +2571,13 @@ TaggedStatementArray tagged_statements = { {
|
||||
" calculate_tee_times = ?,"
|
||||
" t1_percent = ?,"
|
||||
" t2_percent = ?,"
|
||||
" authoritative = ? "
|
||||
" authoritative = ?,"
|
||||
" ddns_send_updates = ?,"
|
||||
" ddns_override_no_update = ?,"
|
||||
" ddns_override_client_update = ?,"
|
||||
" ddns_replace_client_name = ?,"
|
||||
" ddns_generated_prefix = ?,"
|
||||
" ddns_qualifying_suffix = ? "
|
||||
"WHERE subnet_id = ? OR subnet_prefix = ?" },
|
||||
|
||||
// Update existing shared network.
|
||||
@@ -2478,7 +2603,13 @@ TaggedStatementArray tagged_statements = { {
|
||||
" authoritative = ?,"
|
||||
" boot_file_name = ?,"
|
||||
" next_server = ?,"
|
||||
" server_hostname = ? "
|
||||
" server_hostname = ?,"
|
||||
" ddns_send_updates = ?,"
|
||||
" ddns_override_no_update = ?,"
|
||||
" ddns_override_client_update = ?,"
|
||||
" ddns_replace_client_name = ?,"
|
||||
" ddns_generated_prefix = ?,"
|
||||
" ddns_qualifying_suffix = ? "
|
||||
"WHERE name = ?" },
|
||||
|
||||
// Update existing option definition.
|
||||
|
@@ -344,6 +344,12 @@ public:
|
||||
MySqlBinding::createString(CLIENT_CLASS_BUF_LENGTH), // pd pool: client_class
|
||||
MySqlBinding::createString(REQUIRE_CLIENT_CLASSES_BUF_LENGTH), // pd pool: require_client_classes
|
||||
MySqlBinding::createString(USER_CONTEXT_BUF_LENGTH), // pd pool: user_context
|
||||
MySqlBinding::createInteger<uint8_t>(), // ddns_send_updates
|
||||
MySqlBinding::createInteger<uint8_t>(), // ddns_override_no_update
|
||||
MySqlBinding::createInteger<uint8_t>(), // ddns_override_client_update
|
||||
MySqlBinding::createInteger<uint8_t>(), // ddns_replace_client_name
|
||||
MySqlBinding::createString(DNS_NAME_BUF_LENGTH), // ddns_generated_prefix
|
||||
MySqlBinding::createString(DNS_NAME_BUF_LENGTH), // ddns_qualifying_suffix
|
||||
MySqlBinding::createString(SERVER_TAG_BUF_LENGTH) // server_tag
|
||||
};
|
||||
|
||||
@@ -525,7 +531,38 @@ public:
|
||||
// 79 is pd pool require_client_classes
|
||||
// 80 is pd pool user_context
|
||||
|
||||
// server_tag (81 / last)
|
||||
// ddns_send_updates (81)
|
||||
if (!out_bindings[81]->amNull()) {
|
||||
last_subnet->setDdnsSendUpdates(out_bindings[81]->getBool());
|
||||
}
|
||||
|
||||
// ddns_override_no_update (82)
|
||||
if (!out_bindings[82]->amNull()) {
|
||||
last_subnet->setDdnsOverrideNoUpdate(out_bindings[82]->getBool());
|
||||
}
|
||||
|
||||
// ddns_override_client_update (83)
|
||||
if (!out_bindings[83]->amNull()) {
|
||||
last_subnet->setDdnsOverrideClientUpdate(out_bindings[83]->getBool());
|
||||
}
|
||||
|
||||
// ddns_replace_client_name (84)
|
||||
if (!out_bindings[84]->amNull()) {
|
||||
last_subnet->setDdnsReplaceClientNameMode(static_cast<D2ClientConfig::ReplaceClientNameMode>
|
||||
(out_bindings[84]->getInteger<uint8_t>()));
|
||||
}
|
||||
|
||||
// ddns_generated_prefix (85)
|
||||
if (!out_bindings[85]->amNull()) {
|
||||
last_subnet->setDdnsGeneratedPrefix(out_bindings[85]->getString());
|
||||
}
|
||||
|
||||
// ddns_qualifying_suffix (86)
|
||||
if (!out_bindings[86]->amNull()) {
|
||||
last_subnet->setDdnsQualifyingSuffix(out_bindings[86]->getString());
|
||||
}
|
||||
|
||||
// server_tag (87 / last)
|
||||
|
||||
// Subnet ready. Add it to the list.
|
||||
auto ret = subnets.push_back(last_subnet);
|
||||
@@ -539,9 +576,9 @@ public:
|
||||
}
|
||||
|
||||
// Check for new server tags.
|
||||
if (!out_bindings[81]->amNull() &&
|
||||
(last_tag != out_bindings[81]->getString())) {
|
||||
last_tag = out_bindings[81]->getString();
|
||||
if (!out_bindings[87]->amNull() &&
|
||||
(last_tag != out_bindings[87]->getString())) {
|
||||
last_tag = out_bindings[87]->getString();
|
||||
if (!last_tag.empty() && !last_subnet->hasServerTag(ServerTag(last_tag))) {
|
||||
last_subnet->setServerTag(last_tag);
|
||||
}
|
||||
@@ -1148,6 +1185,16 @@ public:
|
||||
hr_mode_binding = MySqlBinding::createNull();
|
||||
}
|
||||
|
||||
// Create binding for DDNS replace client name mode.
|
||||
MySqlBindingPtr ddns_rcn_mode_binding;
|
||||
auto ddns_rcn_mode = subnet->getDdnsReplaceClientNameMode(Network::Inheritance::NONE);
|
||||
if (!ddns_rcn_mode.unspecified()) {
|
||||
ddns_rcn_mode_binding = MySqlBinding::createInteger<uint8_t>(static_cast<uint8_t>
|
||||
(ddns_rcn_mode.get()));
|
||||
} else {
|
||||
ddns_rcn_mode_binding = MySqlBinding::createNull();
|
||||
}
|
||||
|
||||
// Create binding with shared network name if the subnet belongs to a
|
||||
// shared network.
|
||||
MySqlBindingPtr shared_network_binding;
|
||||
@@ -1210,7 +1257,13 @@ public:
|
||||
MySqlBinding::condCreateBool(subnet->getCalculateTeeTimes(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateFloat(subnet->getT1Percent(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateFloat(subnet->getT2Percent(Network::Inheritance::NONE)),
|
||||
interface_id_binding
|
||||
interface_id_binding,
|
||||
MySqlBinding::condCreateBool(subnet->getDdnsSendUpdates(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateBool(subnet->getDdnsOverrideNoUpdate(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateBool(subnet->getDdnsOverrideClientUpdate(Network::Inheritance::NONE)),
|
||||
ddns_rcn_mode_binding,
|
||||
MySqlBinding::condCreateString(subnet->getDdnsGeneratedPrefix(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateString(subnet->getDdnsQualifyingSuffix(Network::Inheritance::NONE))
|
||||
};
|
||||
|
||||
MySqlTransaction transaction(conn_);
|
||||
@@ -1524,6 +1577,12 @@ public:
|
||||
MySqlBinding::createInteger<uint32_t>(), // max_preferred_lifetime
|
||||
MySqlBinding::createInteger<uint32_t>(), // min_valid_lifetime
|
||||
MySqlBinding::createInteger<uint32_t>(), // max_valid_lifetime
|
||||
MySqlBinding::createInteger<uint8_t>(), // ddns_send_updates
|
||||
MySqlBinding::createInteger<uint8_t>(), // ddns_override_no_update
|
||||
MySqlBinding::createInteger<uint8_t>(), // ddns_override_client_update
|
||||
MySqlBinding::createInteger<uint8_t>(), // ddns_replace_client_name
|
||||
MySqlBinding::createString(DNS_NAME_BUF_LENGTH), // ddns_generated_prefix
|
||||
MySqlBinding::createString(DNS_NAME_BUF_LENGTH), // ddns_qualifying_suffix
|
||||
MySqlBinding::createString(SERVER_TAG_BUF_LENGTH) // server_tag
|
||||
};
|
||||
|
||||
@@ -1669,6 +1728,39 @@ public:
|
||||
|
||||
// {min,max)_valid_lifetime
|
||||
|
||||
// ddns_send_updates at 35
|
||||
if (!out_bindings[35]->amNull()) {
|
||||
last_network->setDdnsSendUpdates(out_bindings[35]->getBool());
|
||||
}
|
||||
|
||||
// ddns_override_no_update at 36
|
||||
if (!out_bindings[36]->amNull()) {
|
||||
last_network->setDdnsOverrideNoUpdate(out_bindings[36]->getBool());
|
||||
}
|
||||
|
||||
// ddns_override_client_update at 37
|
||||
if (!out_bindings[37]->amNull()) {
|
||||
last_network->setDdnsOverrideClientUpdate(out_bindings[37]->getBool());
|
||||
}
|
||||
|
||||
// ddns_replace_client_name at 38
|
||||
if (!out_bindings[38]->amNull()) {
|
||||
last_network->setDdnsReplaceClientNameMode(static_cast<D2ClientConfig::ReplaceClientNameMode>
|
||||
(out_bindings[38]->getInteger<uint8_t>()));
|
||||
}
|
||||
|
||||
// ddns_generated_prefix at 39
|
||||
if (!out_bindings[39]->amNull()) {
|
||||
last_network->setDdnsGeneratedPrefix(out_bindings[39]->getString());
|
||||
}
|
||||
|
||||
// ddns_qualifying_suffix at 40
|
||||
if (!out_bindings[40]->amNull()) {
|
||||
last_network->setDdnsQualifyingSuffix(out_bindings[40]->getString());
|
||||
}
|
||||
|
||||
// server_tag at 41
|
||||
|
||||
// Add the shared network.
|
||||
auto ret = shared_networks.push_back(last_network);
|
||||
|
||||
@@ -1692,9 +1784,9 @@ public:
|
||||
}
|
||||
|
||||
// Check for new server tags.
|
||||
if (!out_bindings[35]->amNull() &&
|
||||
(last_tag != out_bindings[35]->getString())) {
|
||||
last_tag = out_bindings[35]->getString();
|
||||
if (!out_bindings[41]->amNull() &&
|
||||
(last_tag != out_bindings[41]->getString())) {
|
||||
last_tag = out_bindings[41]->getString();
|
||||
if (!last_tag.empty() && !last_network->hasServerTag(ServerTag(last_tag))) {
|
||||
last_network->setServerTag(last_tag);
|
||||
}
|
||||
@@ -1820,6 +1912,16 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// Create binding for DDNS replace client name mode.
|
||||
MySqlBindingPtr ddns_rcn_mode_binding;
|
||||
auto ddns_rcn_mode = shared_network->getDdnsReplaceClientNameMode(Network::Inheritance::NONE);
|
||||
if (!ddns_rcn_mode.unspecified()) {
|
||||
ddns_rcn_mode_binding = MySqlBinding::createInteger<uint8_t>(static_cast<uint8_t>
|
||||
(ddns_rcn_mode.get()));
|
||||
} else {
|
||||
ddns_rcn_mode_binding = MySqlBinding::createNull();
|
||||
}
|
||||
|
||||
MySqlBindingCollection in_bindings = {
|
||||
MySqlBinding::createString(shared_network->getName()),
|
||||
MySqlBinding::condCreateString(shared_network->getClientClass(Network::Inheritance::NONE)),
|
||||
@@ -1841,7 +1943,13 @@ public:
|
||||
MySqlBinding::condCreateBool(shared_network->getCalculateTeeTimes(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateFloat(shared_network->getT1Percent(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateFloat(shared_network->getT2Percent(Network::Inheritance::NONE)),
|
||||
interface_id_binding
|
||||
interface_id_binding,
|
||||
MySqlBinding::condCreateBool(shared_network->getDdnsSendUpdates(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateBool(shared_network->getDdnsOverrideNoUpdate(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateBool(shared_network->getDdnsOverrideClientUpdate(Network::Inheritance::NONE)),
|
||||
ddns_rcn_mode_binding,
|
||||
MySqlBinding::condCreateString(shared_network->getDdnsGeneratedPrefix(Network::Inheritance::NONE)),
|
||||
MySqlBinding::condCreateString(shared_network->getDdnsQualifyingSuffix(Network::Inheritance::NONE))
|
||||
};
|
||||
|
||||
MySqlTransaction transaction(conn_);
|
||||
@@ -2807,9 +2915,15 @@ TaggedStatementArray tagged_statements = { {
|
||||
" calculate_tee_times,"
|
||||
" t1_percent,"
|
||||
" t2_percent,"
|
||||
" interface_id"
|
||||
" interface_id,"
|
||||
" ddns_send_updates,"
|
||||
" ddns_override_no_update,"
|
||||
" ddns_override_client_update,"
|
||||
" ddns_replace_client_name,"
|
||||
" ddns_generated_prefix,"
|
||||
" ddns_qualifying_suffix"
|
||||
") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
|
||||
" ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" },
|
||||
" ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" },
|
||||
|
||||
// Insert association of the subnet with a server.
|
||||
{ MySqlConfigBackendDHCPv6Impl::INSERT_SUBNET6_SERVER,
|
||||
@@ -2849,9 +2963,15 @@ TaggedStatementArray tagged_statements = { {
|
||||
" calculate_tee_times,"
|
||||
" t1_percent,"
|
||||
" t2_percent,"
|
||||
" interface_id"
|
||||
" interface_id,"
|
||||
" ddns_send_updates,"
|
||||
" ddns_override_no_update,"
|
||||
" ddns_override_client_update,"
|
||||
" ddns_replace_client_name,"
|
||||
" ddns_generated_prefix,"
|
||||
" ddns_qualifying_suffix"
|
||||
") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
|
||||
" ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" },
|
||||
" ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" },
|
||||
|
||||
// Insert association of the shared network with a server.
|
||||
{ MySqlConfigBackendDHCPv6Impl::INSERT_SHARED_NETWORK6_SERVER,
|
||||
@@ -2913,7 +3033,13 @@ TaggedStatementArray tagged_statements = { {
|
||||
" calculate_tee_times = ?,"
|
||||
" t1_percent = ?,"
|
||||
" t2_percent = ?,"
|
||||
" interface_id = ? "
|
||||
" interface_id = ?,"
|
||||
" ddns_send_updates = ?,"
|
||||
" ddns_override_no_update = ?,"
|
||||
" ddns_override_client_update = ?,"
|
||||
" ddns_replace_client_name = ?,"
|
||||
" ddns_generated_prefix = ?,"
|
||||
" ddns_qualifying_suffix = ? "
|
||||
"WHERE subnet_id = ? OR subnet_prefix = ?" },
|
||||
|
||||
// Update existing shared network.
|
||||
@@ -2939,7 +3065,13 @@ TaggedStatementArray tagged_statements = { {
|
||||
" calculate_tee_times = ?,"
|
||||
" t1_percent = ?,"
|
||||
" t2_percent = ?,"
|
||||
" interface_id = ? "
|
||||
" interface_id = ?,"
|
||||
" ddns_send_updates = ?,"
|
||||
" ddns_override_no_update = ?,"
|
||||
" ddns_override_client_update = ?,"
|
||||
" ddns_replace_client_name = ?,"
|
||||
" ddns_generated_prefix = ?,"
|
||||
" ddns_qualifying_suffix = ? "
|
||||
"WHERE name = ?" },
|
||||
|
||||
// Update existing option definition.
|
||||
|
@@ -109,6 +109,12 @@ namespace {
|
||||
" p.client_class," \
|
||||
" p.require_client_classes," \
|
||||
" p.user_context," \
|
||||
" s.ddns_send_updates," \
|
||||
" s.ddns_override_no_update," \
|
||||
" s.ddns_override_client_update," \
|
||||
" s.ddns_replace_client_name," \
|
||||
" s.ddns_generated_prefix," \
|
||||
" s.ddns_qualifying_suffix," \
|
||||
" srv.tag " \
|
||||
"FROM dhcp4_subnet AS s " \
|
||||
server_join \
|
||||
@@ -228,6 +234,12 @@ namespace {
|
||||
" d.client_class," \
|
||||
" d.require_client_classes," \
|
||||
" d.user_context," \
|
||||
" s.ddns_send_updates," \
|
||||
" s.ddns_override_no_update," \
|
||||
" s.ddns_override_client_update," \
|
||||
" s.ddns_replace_client_name," \
|
||||
" s.ddns_generated_prefix," \
|
||||
" s.ddns_qualifying_suffix," \
|
||||
" srv.tag " \
|
||||
"FROM dhcp6_subnet AS s " \
|
||||
server_join \
|
||||
@@ -427,6 +439,12 @@ namespace {
|
||||
" n.server_hostname," \
|
||||
" n.min_valid_lifetime," \
|
||||
" n.max_valid_lifetime," \
|
||||
" n.ddns_send_updates," \
|
||||
" n.ddns_override_no_update," \
|
||||
" n.ddns_override_client_update," \
|
||||
" n.ddns_replace_client_name," \
|
||||
" n.ddns_generated_prefix," \
|
||||
" n.ddns_qualifying_suffix," \
|
||||
" s.tag " \
|
||||
"FROM dhcp4_shared_network AS n " \
|
||||
server_join \
|
||||
@@ -498,6 +516,12 @@ namespace {
|
||||
" n.max_preferred_lifetime," \
|
||||
" n.min_valid_lifetime," \
|
||||
" n.max_valid_lifetime," \
|
||||
" n.ddns_send_updates," \
|
||||
" n.ddns_override_no_update," \
|
||||
" n.ddns_override_client_update," \
|
||||
" n.ddns_replace_client_name," \
|
||||
" n.ddns_generated_prefix," \
|
||||
" n.ddns_qualifying_suffix," \
|
||||
" s.tag " \
|
||||
"FROM dhcp6_shared_network AS n " \
|
||||
server_join \
|
||||
|
@@ -70,6 +70,8 @@ constexpr unsigned long SERVER_TAG_BUF_LENGTH = 256;
|
||||
|
||||
constexpr unsigned long SERVER_DESCRIPTION_BUF_LENGTH = 65536;
|
||||
|
||||
constexpr unsigned long DNS_NAME_BUF_LENGTH = 255;
|
||||
|
||||
//*}
|
||||
|
||||
} // end of namespace isc::cb
|
||||
|
Reference in New Issue
Block a user