MySqlBinding::createInteger<uint32_t>(), // cache_max_age
MySqlBinding::createInteger<uint32_t>(), // offer lifetime
MySqlBinding::createString(ALLOCATOR_TYPE_BUF_LENGTH), // allocator
+ MySqlBinding::createInteger<float>(), // ddns_ttl_percent
+ MySqlBinding::createInteger<uint32_t>(), // ddns_ttl
+ MySqlBinding::createInteger<uint32_t>(), // ddns_ttl_min
+ MySqlBinding::createInteger<uint32_t>(), // ddns_ttl_max
MySqlBinding::createString(SERVER_TAG_BUF_LENGTH) // server_tag
};
last_subnet->setAllocatorType(out_bindings[73]->getString());
}
- // server_tag at 74.
+ // ddns_ttl_percent at 74.
+ if (!out_bindings[74]->amNull()) {
+ last_subnet->setDdnsTtlPercent(out_bindings[74]->getFloat());
+ }
+
+ // ddns_ttl at 75.
+ if (!out_bindings[75]->amNull()) {
+ last_subnet->setDdnsTtl(out_bindings[75]->getInteger<uint32_t>());
+ }
+
+ // ddns_ttl_min at 76.
+ if (!out_bindings[76]->amNull()) {
+ last_subnet->setDdnsTtlMin(out_bindings[76]->getInteger<uint32_t>());
+ }
+
+ // ddns_ttl_max at 77.
+ if (!out_bindings[77]->amNull()) {
+ last_subnet->setDdnsTtlMax(out_bindings[77]->getInteger<uint32_t>());
+ }
+
+ // server_tag at 78.
// Subnet ready. Add it to the list.
auto ret = subnets.insert(last_subnet);
}
}
- // Check for new server tags at 74.
- if (!out_bindings[74]->amNull() &&
- (last_tag != out_bindings[74]->getString())) {
- last_tag = out_bindings[74]->getString();
+ // Check for new server tags at 78.
+ if (!out_bindings[78]->amNull() &&
+ (last_tag != out_bindings[78]->getString())) {
+ last_tag = out_bindings[78]->getString();
if (!last_tag.empty() && !last_subnet->hasServerTag(ServerTag(last_tag))) {
last_subnet->setServerTag(last_tag);
}
MySqlBinding::condCreateFloat(subnet->getCacheThreshold(Network::Inheritance::NONE)),
condCreateInteger<uint32_t>(subnet->getCacheMaxAge(Network::Inheritance::NONE)),
condCreateInteger<uint32_t>(subnet->getOfferLft(Network::Inheritance::NONE)),
- MySqlBinding::condCreateString(subnet->getAllocatorType(Network::Inheritance::NONE))
+ MySqlBinding::condCreateString(subnet->getAllocatorType(Network::Inheritance::NONE)),
+ MySqlBinding::condCreateFloat(subnet->getDdnsTtlPercent(Network::Inheritance::NONE)),
+ condCreateInteger<uint32_t>(subnet->getDdnsTtl(Network::Inheritance::NONE)),
+ condCreateInteger<uint32_t>(subnet->getDdnsTtlMin(Network::Inheritance::NONE)),
+ condCreateInteger<uint32_t>(subnet->getDdnsTtlMax(Network::Inheritance::NONE)),
};
MySqlTransaction transaction(conn_);
MySqlBinding::createInteger<uint32_t>(), // cache_max_age
MySqlBinding::createInteger<uint32_t>(), // offer lifetime
MySqlBinding::createString(ALLOCATOR_TYPE_BUF_LENGTH), // allocator
+ MySqlBinding::createInteger<float>(), // ddns_ttl_percent
+ MySqlBinding::createInteger<uint32_t>(), // ddns_ttl
+ MySqlBinding::createInteger<uint32_t>(), // ddns_ttl_min
+ MySqlBinding::createInteger<uint32_t>(), // ddns_ttl_max
MySqlBinding::createString(SERVER_TAG_BUF_LENGTH) // server_tag
};
last_network->setAllocatorType(out_bindings[47]->getString());
}
- // server_tag at 48.
+ // ddns_ttl_percent at 48.
+ if (!out_bindings[48]->amNull()) {
+ last_network->setDdnsTtlPercent(out_bindings[48]->getFloat());
+ }
+
+ // ddns_ttl at 49.
+ if (!out_bindings[49]->amNull()) {
+ last_network->setDdnsTtl(out_bindings[49]->getInteger<uint32_t>());
+ }
+
+ // ddns_ttl_min at 50.
+ if (!out_bindings[50]->amNull()) {
+ last_network->setDdnsTtlMin(out_bindings[50]->getInteger<uint32_t>());
+ }
+
+ // ddns_ttl_max at 51.
+ if (!out_bindings[51]->amNull()) {
+ last_network->setDdnsTtlMax(out_bindings[51]->getInteger<uint32_t>());
+ }
+
+ // server_tag at 52.
// Add the shared network.
auto ret = shared_networks.push_back(last_network);
}
// Check for new server tags.
- if (!out_bindings[48]->amNull() &&
- (last_tag != out_bindings[48]->getString())) {
- last_tag = out_bindings[48]->getString();
+ if (!out_bindings[52]->amNull() &&
+ (last_tag != out_bindings[52]->getString())) {
+ last_tag = out_bindings[52]->getString();
if (!last_tag.empty() && !last_network->hasServerTag(ServerTag(last_tag))) {
last_network->setServerTag(last_tag);
}
MySqlBinding::condCreateFloat(shared_network->getCacheThreshold(Network::Inheritance::NONE)),
condCreateInteger<uint32_t>(shared_network->getCacheMaxAge(Network::Inheritance::NONE)),
condCreateInteger<uint32_t>(shared_network->getOfferLft(Network::Inheritance::NONE)),
- MySqlBinding::condCreateString(shared_network->getAllocatorType(Network::Inheritance::NONE))
+ MySqlBinding::condCreateString(shared_network->getAllocatorType(Network::Inheritance::NONE)),
+ MySqlBinding::condCreateFloat(shared_network->getDdnsTtlPercent(Network::Inheritance::NONE)),
+ condCreateInteger<uint32_t>(shared_network->getDdnsTtl(Network::Inheritance::NONE)),
+ condCreateInteger<uint32_t>(shared_network->getDdnsTtlMin(Network::Inheritance::NONE)),
+ condCreateInteger<uint32_t>(shared_network->getDdnsTtlMax(Network::Inheritance::NONE))
};
MySqlTransaction transaction(conn_);
" cache_threshold,"
" cache_max_age,"
" offer_lifetime,"
- " allocator"
+ " allocator,"
+ " ddns_ttl_percent,"
+ " ddns_ttl,"
+ " ddns_ttl_min,"
+ " ddns_ttl_max"
") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
- " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" },
+ " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
+ " ?, ?, ?, ?)" },
// Insert association of the subnet with a server.
{ MySqlConfigBackendDHCPv4Impl::INSERT_SUBNET4_SERVER,
" cache_threshold,"
" cache_max_age,"
" offer_lifetime,"
- " allocator"
+ " allocator,"
+ " ddns_ttl_percent,"
+ " ddns_ttl,"
+ " ddns_ttl_min,"
+ " ddns_ttl_max"
") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
- " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" },
+ " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
+ " ?, ?, ?, ?)" },
// Insert association of the shared network with a server.
{ MySqlConfigBackendDHCPv4Impl::INSERT_SHARED_NETWORK4_SERVER,
" reservations_in_subnet = ?,"
" reservations_out_of_pool = ?,"
" cache_threshold = ?,"
- " cache_max_age = ?, "
- " offer_lifetime = ?, "
- " allocator = ? "
+ " cache_max_age = ?,"
+ " offer_lifetime = ?,"
+ " allocator = ?,"
+ " ddns_ttl_percent = ?,"
+ " ddns_ttl = ?,"
+ " ddns_ttl_min = ?,"
+ " ddns_ttl_max = ? "
"WHERE subnet_id = ? OR subnet_prefix = ?" },
// Update existing shared network.
" reservations_out_of_pool = ?,"
" cache_threshold = ?,"
" cache_max_age = ?,"
- " offer_lifetime = ?, "
- " allocator = ? "
+ " offer_lifetime = ?,"
+ " allocator = ?,"
+ " ddns_ttl_percent = ?,"
+ " ddns_ttl = ?,"
+ " ddns_ttl_min = ?,"
+ " ddns_ttl_max = ? "
"WHERE name = ?" },
// Update existing option definition.
MySqlBinding::createInteger<uint32_t>(), // cache_max_age
MySqlBinding::createString(ALLOCATOR_TYPE_BUF_LENGTH), // allocator
MySqlBinding::createString(ALLOCATOR_TYPE_BUF_LENGTH), // pd_allocator
+ MySqlBinding::createInteger<float>(), // ddns_ttl_percent
+ MySqlBinding::createInteger<uint32_t>(), // ddns_ttl
+ MySqlBinding::createInteger<uint32_t>(), // ddns_ttl_min
+ MySqlBinding::createInteger<uint32_t>(), // ddns_ttl_max
MySqlBinding::createString(SERVER_TAG_BUF_LENGTH) // server_tag
};
last_subnet->setPdAllocatorType(out_bindings[98]->getString());
}
- // server_tag (99 / last)
+ // ddns_ttl_percent at 99
+ if (!out_bindings[99]->amNull()) {
+ last_subnet->setDdnsTtlPercent(out_bindings[99]->getFloat());
+ }
+
+ // ddns_ttl at 100
+ if (!out_bindings[100]->amNull()) {
+ last_subnet->setDdnsTtl(out_bindings[100]->getInteger<uint32_t>());
+ }
+
+ // ddns_ttl_min at 101
+ if (!out_bindings[101]->amNull()) {
+ last_subnet->setDdnsTtlMin(out_bindings[101]->getInteger<uint32_t>());
+ }
+
+ // ddns_ttl_max at 102
+ if (!out_bindings[102]->amNull()) {
+ last_subnet->setDdnsTtlMax(out_bindings[102]->getInteger<uint32_t>());
+ }
+
+ // server_tag (103 / last)
// Subnet ready. Add it to the list.
auto ret = subnets.insert(last_subnet);
}
// Check for new server tags.
- if (!out_bindings[99]->amNull() &&
- (last_tag != out_bindings[99]->getString())) {
- last_tag = out_bindings[99]->getString();
+ if (!out_bindings[103]->amNull() &&
+ (last_tag != out_bindings[103]->getString())) {
+ last_tag = out_bindings[103]->getString();
if (!last_tag.empty() && !last_subnet->hasServerTag(ServerTag(last_tag))) {
last_subnet->setServerTag(last_tag);
}
MySqlBinding::condCreateFloat(subnet->getCacheThreshold(Network::Inheritance::NONE)),
condCreateInteger<uint32_t>(subnet->getCacheMaxAge(Network::Inheritance::NONE)),
MySqlBinding::condCreateString(subnet->getAllocatorType(Network::Inheritance::NONE)),
- MySqlBinding::condCreateString(subnet->getPdAllocatorType(Network::Inheritance::NONE))
+ MySqlBinding::condCreateString(subnet->getPdAllocatorType(Network::Inheritance::NONE)),
+ MySqlBinding::condCreateFloat(subnet->getDdnsTtlPercent(Network::Inheritance::NONE)),
+ condCreateInteger<uint32_t>(subnet->getDdnsTtl(Network::Inheritance::NONE)),
+ condCreateInteger<uint32_t>(subnet->getDdnsTtlMin(Network::Inheritance::NONE)),
+ condCreateInteger<uint32_t>(subnet->getDdnsTtlMax(Network::Inheritance::NONE))
};
MySqlTransaction transaction(conn_);
MySqlBinding::createInteger<uint32_t>(), // cache_max_age
MySqlBinding::createString(ALLOCATOR_TYPE_BUF_LENGTH), // allocator
MySqlBinding::createString(ALLOCATOR_TYPE_BUF_LENGTH), // pd_allocator
+ MySqlBinding::createInteger<float>(), // ddns_ttl_percent
+ MySqlBinding::createInteger<uint32_t>(), // ddns_ttl
+ MySqlBinding::createInteger<uint32_t>(), // ddns_ttl_min
+ MySqlBinding::createInteger<uint32_t>(), // ddns_ttl_max
MySqlBinding::createString(SERVER_TAG_BUF_LENGTH) // server_tag
};
last_network->setPdAllocatorType(out_bindings[48]->getString());
}
- // server_tag at 49.
+ // ddns_ttl_percent at 49.
+ if (!out_bindings[49]->amNull()) {
+ last_network->setDdnsTtlPercent(out_bindings[49]->getFloat());
+ }
+
+ // ddns_ttl at 50.
+ if (!out_bindings[50]->amNull()) {
+ last_network->setDdnsTtl(out_bindings[50]->getInteger<uint32_t>());
+ }
+
+ // ddns_ttl_min at 51.
+ if (!out_bindings[51]->amNull()) {
+ last_network->setDdnsTtlMin(out_bindings[51]->getInteger<uint32_t>());
+ }
+
+ // ddns_ttl_max at 52.
+ if (!out_bindings[52]->amNull()) {
+ last_network->setDdnsTtlMax(out_bindings[52]->getInteger<uint32_t>());
+ }
+
+ // server_tag at 53.
// Add the shared network.
auto ret = shared_networks.push_back(last_network);
}
// Check for new server tags.
- if (!out_bindings[49]->amNull() &&
- (last_tag != out_bindings[49]->getString())) {
- last_tag = out_bindings[49]->getString();
+ if (!out_bindings[53]->amNull() &&
+ (last_tag != out_bindings[53]->getString())) {
+ last_tag = out_bindings[53]->getString();
if (!last_tag.empty() && !last_network->hasServerTag(ServerTag(last_tag))) {
last_network->setServerTag(last_tag);
}
MySqlBinding::condCreateFloat(shared_network->getCacheThreshold(Network::Inheritance::NONE)),
condCreateInteger<uint32_t>(shared_network->getCacheMaxAge(Network::Inheritance::NONE)),
MySqlBinding::condCreateString(shared_network->getAllocatorType(Network::Inheritance::NONE)),
- MySqlBinding::condCreateString(shared_network->getPdAllocatorType(Network::Inheritance::NONE))
+ MySqlBinding::condCreateString(shared_network->getPdAllocatorType(Network::Inheritance::NONE)),
+ MySqlBinding::condCreateFloat(shared_network->getDdnsTtlPercent(Network::Inheritance::NONE)),
+ condCreateInteger<uint32_t>(shared_network->getDdnsTtl(Network::Inheritance::NONE)),
+ condCreateInteger<uint32_t>(shared_network->getDdnsTtlMin(Network::Inheritance::NONE)),
+ condCreateInteger<uint32_t>(shared_network->getDdnsTtlMax(Network::Inheritance::NONE)),
};
MySqlTransaction transaction(conn_);
" cache_threshold,"
" cache_max_age,"
" allocator,"
- " pd_allocator"
+ " pd_allocator,"
+ " ddns_ttl_percent,"
+ " ddns_ttl,"
+ " ddns_ttl_min,"
+ " ddns_ttl_max"
") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
- " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" },
+ " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
+ " ?, ?, ?, ?)" },
// Insert association of the subnet with a server.
{ MySqlConfigBackendDHCPv6Impl::INSERT_SUBNET6_SERVER,
" cache_threshold,"
" cache_max_age,"
" allocator,"
- " pd_allocator"
+ " pd_allocator,"
+ " ddns_ttl_percent,"
+ " ddns_ttl,"
+ " ddns_ttl_min,"
+ " ddns_ttl_max"
") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
- " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" },
+ " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
+ " ?, ?, ?, ?)" },
// Insert association of the shared network with a server.
{ MySqlConfigBackendDHCPv6Impl::INSERT_SHARED_NETWORK6_SERVER,
" cache_threshold = ?,"
" cache_max_age = ?,"
" allocator = ?,"
- " pd_allocator = ? "
+ " pd_allocator = ?,"
+ " ddns_ttl_percent = ?,"
+ " ddns_ttl = ?,"
+ " ddns_ttl_min = ?,"
+ " ddns_ttl_max = ? "
"WHERE subnet_id = ? OR subnet_prefix = ?" },
// Update existing shared network.
" cache_threshold = ?,"
" cache_max_age = ?,"
" allocator = ?,"
- " pd_allocator = ? "
+ " pd_allocator = ?,"
+ " ddns_ttl_percent = ?,"
+ " ddns_ttl = ?,"
+ " ddns_ttl_min = ?,"
+ " ddns_ttl_max = ? "
"WHERE name = ?" },
// Update existing option definition.
" s.cache_max_age," \
" s.offer_lifetime, " \
" s.allocator, " \
+ " s.ddns_ttl_percent," \
+ " s.ddns_ttl," \
+ " s.ddns_ttl_min," \
+ " s.ddns_ttl_max," \
" srv.tag " \
"FROM dhcp4_subnet AS s " \
server_join \
" s.cache_max_age," \
" s.allocator," \
" s.pd_allocator," \
+ " s.ddns_ttl_percent," \
+ " s.ddns_ttl," \
+ " s.ddns_ttl_min," \
+ " s.ddns_ttl_max," \
" srv.tag " \
"FROM dhcp6_subnet AS s " \
server_join \
" n.cache_max_age," \
" n.offer_lifetime, " \
" n.allocator, " \
+ " n.ddns_ttl_percent," \
+ " n.ddns_ttl," \
+ " n.ddns_ttl_min," \
+ " n.ddns_ttl_max," \
" s.tag " \
"FROM dhcp4_shared_network AS n " \
server_join \
" n.cache_max_age," \
" n.allocator," \
" n.pd_allocator," \
+ " n.ddns_ttl_percent," \
+ " n.ddns_ttl," \
+ " n.ddns_ttl_min," \
+ " n.ddns_ttl_max," \
" s.tag " \
"FROM dhcp6_shared_network AS n " \
server_join \
subnet->setCacheMaxAge(20);
subnet->setOfferLft(77);
subnet->setAllocatorType("random");
+ subnet->setDdnsTtl(880);
Pool4Ptr pool1(new Pool4(IOAddress("192.0.2.10"),
IOAddress("192.0.2.20")));
subnet->getCfgOption()->add(*test_options_[1], test_options_[1]->space_name_);
subnet->getCfgOption()->add(*test_options_[2], test_options_[2]->space_name_);
+
test_subnets_.push_back(subnet);
// Adding another subnet with the same subnet id to test
subnet->setDdnsReplaceClientNameMode(D2ClientConfig::ReplaceClientNameMode::RCM_WHEN_PRESENT);
subnet->setDdnsGeneratedPrefix("myhost");
subnet->setDdnsQualifyingSuffix("example.org");
+ subnet->setDdnsTtlPercent(0.50);
+ subnet->setDdnsTtlMin(300);
+ subnet->setDdnsTtlMax(700);
subnet->getCfgOption()->add(*test_options_[0], test_options_[0]->space_name_);
shared_network->setCacheMaxAge(21);
shared_network->setOfferLft(78);
shared_network->setAllocatorType("iterative");
+ shared_network->setDdnsTtlPercent(0.70);
+ shared_network->setDdnsTtlMin(200);
+ shared_network->setDdnsTtlMax(800);
// Add several options to the shared network.
shared_network->getCfgOption()->add(*test_options_[2], test_options_[2]->space_name_);
shared_network->setDdnsReplaceClientNameMode(D2ClientConfig::ReplaceClientNameMode::RCM_WHEN_PRESENT);
shared_network->setDdnsGeneratedPrefix("myhost");
shared_network->setDdnsQualifyingSuffix("example.org");
+ shared_network->setDdnsTtl(9000);
shared_network->getCfgOption()->add(*test_options_[0], test_options_[0]->space_name_);
test_networks_.push_back(shared_network);
subnet->setDdnsSendUpdates(false);
subnet->setAllocatorType("random");
subnet->setPdAllocatorType("iterative");
+ subnet->setDdnsTtl(880);
Pool6Ptr pool1(new Pool6(Lease::TYPE_NA,
IOAddress("2001:db8::10"),
subnet->setDdnsReplaceClientNameMode(D2ClientConfig::ReplaceClientNameMode::RCM_WHEN_PRESENT);
subnet->setDdnsGeneratedPrefix("myhost");
subnet->setDdnsQualifyingSuffix("example.org");
+ subnet->setDdnsTtlPercent(0.50);
+ subnet->setDdnsTtlMin(300);
+ subnet->setDdnsTtlMax(700);
subnet->getCfgOption()->add(*test_options_[0], test_options_[0]->space_name_);
shared_network->setDdnsSendUpdates(false);
shared_network->setAllocatorType("iterative");
shared_network->setPdAllocatorType("random");
+ shared_network->setDdnsTtlPercent(0.70);
+ shared_network->setDdnsTtlMin(200);
+ shared_network->setDdnsTtlMax(800);
// Add several options to the shared network.
shared_network->getCfgOption()->add(*test_options_[2], test_options_[2]->space_name_);
shared_network->setDdnsReplaceClientNameMode(D2ClientConfig::ReplaceClientNameMode::RCM_WHEN_PRESENT);
shared_network->setDdnsGeneratedPrefix("myhost");
shared_network->setDdnsQualifyingSuffix("example.org");
+ shared_network->setDdnsTtl(9000);
shared_network->getCfgOption()->add(*test_options_[0], test_options_[0]->space_name_);
test_networks_.push_back(shared_network);