2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 05:55:28 +00:00

[5009] Implemented get6(subnet_id, address) function for SQL backends.

Also removed uint32_t cast operator from IOAddress to remove
ambiguity when calling this new function.
This commit is contained in:
Marcin Siodelski
2016-09-20 09:29:06 +02:00
parent bb34f5f3fe
commit 8cce1aa713
29 changed files with 261 additions and 48 deletions

View File

@@ -361,7 +361,7 @@ public:
// Address: uint32_t
// The address in the Lease structure is an IOAddress object. Convert
// this to an integer for storage.
addr4_ = static_cast<uint32_t>(lease_->addr_);
addr4_ = lease_->addr_.toUint32();
bind_[0].buffer_type = MYSQL_TYPE_LONG;
bind_[0].buffer = reinterpret_cast<char*>(&addr4_);
bind_[0].is_unsigned = MLM_TRUE;
@@ -1596,7 +1596,7 @@ MySqlLeaseMgr::getLease4(const isc::asiolink::IOAddress& addr) const {
MYSQL_BIND inbind[1];
memset(inbind, 0, sizeof(inbind));
uint32_t addr4 = static_cast<uint32_t>(addr);
uint32_t addr4 = addr.toUint32();
inbind[0].buffer_type = MYSQL_TYPE_LONG;
inbind[0].buffer = reinterpret_cast<char*>(&addr4);
inbind[0].is_unsigned = MLM_TRUE;
@@ -1960,7 +1960,7 @@ MySqlLeaseMgr::updateLease4(const Lease4Ptr& lease) {
MYSQL_BIND where;
memset(&where, 0, sizeof(where));
uint32_t addr4 = static_cast<uint32_t>(lease->addr_);
uint32_t addr4 = lease->addr_.toUint32();
where.buffer_type = MYSQL_TYPE_LONG;
where.buffer = reinterpret_cast<char*>(&addr4);
where.is_unsigned = MLM_TRUE;
@@ -2032,7 +2032,7 @@ MySqlLeaseMgr::deleteLease(const isc::asiolink::IOAddress& addr) {
memset(inbind, 0, sizeof(inbind));
if (addr.isV4()) {
uint32_t addr4 = static_cast<uint32_t>(addr);
uint32_t addr4 = addr.toUint32();
inbind[0].buffer_type = MYSQL_TYPE_LONG;
inbind[0].buffer = reinterpret_cast<char*>(&addr4);