Boost (http://www.boost.org/) library for almost everything, and can use Botan
(http://botan.randombit.net/) or OpenSSL (https://www.openssl.org/) for
cryptographic operations. It can also optionally use PostgreSQL
-(http://www.postgresql.org/) and/or MySQL (http://www.mysql.com/) as a database.
+(http://www.postgresql.org/) and/or MySQL (http://www.mysql.com/) and/or
+Cassandra (http://cassandra.apache.org/) as a database.
- Kea can use googletest for unit-tests (http://code.google.com/p/googletest/).
+ Kea can use googletest for unit-tests (https://github.com/google/googletest).
- Kea uses ISC Forge (http://kea.isc.org/wiki/IscForge) for conformance testing.
+ Kea uses ISC Forge (https://github.com/isc-projects/forge/) for conformance testing.
the DHCPv4 server. In this case, set the value to the empty string:
<screen>
"Dhcp4": { "lease-database": { <userinput>"host" : ""</userinput>, ... }, ... }
+</screen>
+ For Cassandra:
+<screen>
+"Dhcp4": { "lease-database": { <userinput>"contact_points": ""</userinput>, ... }, ... }
+ </screen>
+ Should the database use a port different than default, it may be
+ specified as well:
+ <screen>
+ "Dhcp4": { "lease-database": { <userinput>"port" : 12345</userinput>, ... }, ... }
</screen>
Should the database be located on a different system, you may need to specify a longer interval
for the connection timeout:
the DHCPv6 server. In this case, set the value to the empty string:
<screen>
"Dhcp6": { "lease-database": { <userinput>"host" : ""</userinput>, ... }, ... }
+</screen>
+ For Cassandra:
+<screen>
+"Dhcp6": { "lease-database": { <userinput>"contact_points": ""</userinput>, ... }, ... }
+ </screen>
+ Should the database use a port different than default, it may be
+ specified as well:
+ <screen>
+ "Dhcp4": { "lease-database": { <userinput>"port" : 12345</userinput>, ... }, ... }
++>>>>>>> isc-master
</screen>
Should the database be located on a different system, you may need to specify a longer interval
for the connection timeout:
CassError rc;
// Set up the values of the parameters
const char* contact_points = "127.0.0.1";
- string scontact_points;
+ std::string scontact_points;
try {
- scontact_points = getParameter("contact_points");
+ scontact_points = getParameter("contact-points");
contact_points = scontact_points.c_str();
} catch (...) {
- // No host. Fine, we'll use "localhost".
+ // No host. Fine, we'll use "127.0.0.1".
}
const char* port = NULL;
result++;
}
}
- return (result);
+ return result;
}
+ size_t
+ CqlLeaseMgr::wipeLeases4(const SubnetID& /*subnet_id*/) {
+ isc_throw(NotImplemented, "wipeLeases4 is not implemented for Cassandra backend");
+ }
+
+ size_t
+ CqlLeaseMgr::wipeLeases6(const SubnetID& /*subnet_id*/) {
+ isc_throw(NotImplemented, "wipeLeases6 is not implemented for Cassandra backend");
+ }
+
std::string
CqlLeaseMgr::getName() const {
std::string name = "";
/// time will not be deleted.
///
/// @return Number of leases deleted.
- virtual uint64_t deleteExpiredReclaimedLeases6(const uint32_t );
+ virtual uint64_t deleteExpiredReclaimedLeases6(const uint32_t secs);
+ /// @brief Removes specified IPv4 leases.
+ ///
+ /// This rather dangerous method is able to remove all leases from specified
+ /// subnet.
+ ///
+ /// @todo: Not implemented yet.
+ ///
+ /// @param subnet_id identifier of the subnet
+ /// @return number of leases removed.
+ virtual size_t wipeLeases4(const SubnetID& subnet_id);
+
+ /// @brief Removed specified IPv6 leases.
+ ///
+ /// This rather dangerous method is able to remove all leases from specified
+ /// subnet.
+ ///
+ /// @todo: Not implemented yet.
+ ///
+ /// @param subnet_id identifier of the subnet
+ /// @return number of leases removed.
+ virtual size_t wipeLeases6(const SubnetID& subnet_id);
+
/// @brief Return backend type
///
/// @return Type of the backend.
int64_t lfc_interval = 0;
int64_t timeout = 0;
+ int64_t port = 0;
// 2. Update the copy with the passed keywords.
- BOOST_FOREACH(ConfigPair param, config_value->mapValue()) {
+ BOOST_FOREACH(ConfigPair param, database_config->mapValue()) {
try {
- if ((param.first == "persist") || (param.first == "readonly")) {
+ if ((param.first == "persist") || (param.first == "readonly") ||
+ (param.first == "tcp-nodelay")) {
values_copy[param.first] = (param.second->boolValue() ?
"true" : "false");
values_copy[param.first] =
boost::lexical_cast<std::string>(timeout);
+ } else if (param.first == "reconnect-wait-time") {
+ timeout = param.second->intValue();
+ values_copy[param.first] =
+ boost::lexical_cast<std::string>(timeout);
+
+ } else if (param.first == "request-timeout") {
+ timeout = param.second->intValue();
+ values_copy[param.first] =
+ boost::lexical_cast<std::string>(timeout);
+
+ } else if (param.first == "tcp-keepalive") {
+ timeout = param.second->intValue();
+ values_copy[param.first] =
+ boost::lexical_cast<std::string>(timeout);
++
+ } else if (param.first == "port") {
+ port = param.second->intValue();
+ values_copy[param.first] =
+ boost::lexical_cast<std::string>(port);
+
} else {
values_copy[param.first] = param.second->stringValue();
}
testDeleteExpiredReclaimedLeases4();
}
-}; // Of anonymous namespace
+ // Tests that leases from specific subnet can be removed.
+ TEST_F(CqlLeaseMgrTest, DISABLED_wipeLeases4) {
+ testWipeLeases4();
+ }
+
+ // Tests that leases from specific subnet can be removed.
+ TEST_F(CqlLeaseMgrTest, DISABLED_wipeLeases6) {
+ testWipeLeases6();
+ }
+
+} // namespace
++