}
bool
-CqlLeaseMgr::addLease(const Lease4Ptr &lease) {
+CqlLeaseMgr::addLease(Lease4Ptr &lease) {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_CQL_ADD_ADDR4)
.arg(lease->addr_.toText());
}
bool
-CqlLeaseMgr::addLease(const Lease6Ptr &lease) {
+CqlLeaseMgr::addLease(Lease6Ptr &lease) {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_CQL_ADD_ADDR6)
.arg(lease->addr_.toText());
///
/// @throw isc::dhcp::DbOperationError An operation on the open database has
/// failed.
- virtual bool addLease(const Lease4Ptr& lease) override;
+ virtual bool addLease(Lease4Ptr& lease) override;
/// @brief Adds an IPv6 lease
///
///
/// @throw isc::dhcp::DbOperationError An operation on the open database has
/// failed.
- virtual bool addLease(const Lease6Ptr& lease) override;
+ virtual bool addLease(Lease6Ptr& lease) override;
/// @brief Basic lease access methods. Obtain leases from the database using
/// various criteria.
/// They are essential components of the interface to any database backend.
/// Each concrete database backend (e.g. MySQL) will define a class derived
/// from LeaseMgr class.
-///
-/// Failover considerations:
-/// There are no intermediate plans to implement DHCPv4 failover
-/// (draft-ietf-dhc-failover-12.txt). Currently (Oct. 2012) the DHCPv6 failover
-/// is being defined in DHC WG in IETF (draft-ietf-dhcpv6-failover-requirements,
-/// draft-ietf-dhcpv6-failover-design), but the work is not advanced enough
-/// for implementation plans yet. v4 failover requires additional parameters
-/// to be kept with a lease. It is likely that v6 failover will require similar
-/// fields. Such implementation will require database schema extension.
-/// We have designed a way to expand/upgrade schemas during upgrades: a database
-/// schema is versioned and sanity checks about required version will be done
-/// upon start and/or upgrade. With this mechanism in place, we can add new
-/// fields to the database. In particular we can use that capability to
-/// introduce failover related fields.
-///
-/// However, there is another approach that can be reliably used to provide
-/// failover, even without the actual failover protocol implemented. As the
-/// first backend will use MySQL, we will be able to use Multi-Master capability
-/// offered by MySQL and use two separate Kea instances connecting to the
-/// same database.
-///
-/// Nevertheless, we hope to have failover protocol eventually implemented in
-/// the Kea.
-
namespace isc {
namespace dhcp {
// Run the lease through a checker.
static SanityChecker checker;
- checker.checkLease(lease);
+ checker.checkLease(lease, true);
if (!lease) {
return (false);
}
// Run the lease through a checker.
static SanityChecker checker;
- checker.checkLease(lease);
+ checker.checkLease(lease, true);
if (!lease) {
return (false);
}
}
bool
-MySqlLeaseMgr::addLease(const Lease4Ptr& lease) {
+MySqlLeaseMgr::addLease(Lease4Ptr& lease) {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL,
DHCPSRV_MYSQL_ADD_ADDR4).arg(lease->addr_.toText());
}
bool
-MySqlLeaseMgr::addLease(const Lease6Ptr& lease) {
+MySqlLeaseMgr::addLease(Lease6Ptr& lease) {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL,
DHCPSRV_MYSQL_ADD_ADDR6).arg(lease->addr_.toText())
.arg(lease->type_);
///
/// @throw isc::dhcp::DbOperationError An operation on the open database has
/// failed.
- virtual bool addLease(const Lease4Ptr& lease);
+ virtual bool addLease(Lease4Ptr& lease);
/// @brief Adds an IPv6 lease
///
///
/// @throw isc::dhcp::DbOperationError An operation on the open database has
/// failed.
- virtual bool addLease(const Lease6Ptr& lease);
+ virtual bool addLease(Lease6Ptr& lease);
/// @brief Returns an IPv4 lease for specified IPv4 address
///
}
bool
-PgSqlLeaseMgr::addLease(const Lease4Ptr& lease) {
+PgSqlLeaseMgr::addLease(Lease4Ptr& lease) {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL,
DHCPSRV_PGSQL_ADD_ADDR4).arg(lease->addr_.toText());
}
bool
-PgSqlLeaseMgr::addLease(const Lease6Ptr& lease) {
+PgSqlLeaseMgr::addLease(Lease6Ptr& lease) {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL,
DHCPSRV_PGSQL_ADD_ADDR6).arg(lease->addr_.toText());
PsqlBindArray bind_array;
///
/// @throw isc::dhcp::DbOperationError An operation on the open database has
/// failed.
- virtual bool addLease(const Lease4Ptr& lease);
+ virtual bool addLease(Lease4Ptr& lease);
/// @brief Adds an IPv6 lease
///
///
/// @throw isc::dhcp::DbOperationError An operation on the open database has
/// failed.
- virtual bool addLease(const Lease6Ptr& lease);
+ virtual bool addLease(Lease6Ptr& lease);
/// @brief Returns an IPv4 lease for specified IPv4 address
///