![]() |
Kea
1.5.0
|
#include <mysql_lease_mgr.h>
Inheritance diagram for isc::dhcp::MySqlLeaseMgr:Public Member Functions | |
| MySqlLeaseMgr (const db::DatabaseConnection::ParameterMap ¶meters) | |
| Constructor. More... | |
| virtual | ~MySqlLeaseMgr () |
| Destructor (closes database) More... | |
| virtual bool | addLease (const Lease4Ptr &lease) |
| Adds an IPv4 lease. More... | |
| virtual bool | addLease (const Lease6Ptr &lease) |
| Adds an IPv6 lease. More... | |
| virtual void | commit () |
| Commit Transactions. More... | |
| virtual uint64_t | deleteExpiredReclaimedLeases4 (const uint32_t secs) |
| Deletes all expired-reclaimed DHCPv4 leases. More... | |
| virtual uint64_t | deleteExpiredReclaimedLeases6 (const uint32_t secs) |
| Deletes all expired-reclaimed DHCPv6 leases. More... | |
| virtual bool | deleteLease (const isc::asiolink::IOAddress &addr) |
| Deletes a lease. More... | |
| virtual std::string | getDescription () const |
| Returns description of the backend. More... | |
| virtual void | getExpiredLeases4 (Lease4Collection &expired_leases, const size_t max_leases) const |
| Returns a collection of expired DHCPv4 leases. More... | |
| virtual void | getExpiredLeases6 (Lease6Collection &expired_leases, const size_t max_leases) const |
| Returns a collection of expired DHCPv6 leases. More... | |
| virtual Lease4Ptr | getLease4 (const ClientId &client_id, const HWAddr &hwaddr, SubnetID subnet_id) const |
| Returns IPv4 lease for the specified client identifier, HW address and subnet identifier. More... | |
| virtual Lease4Collection | getLease4 (const ClientId &clientid) const |
| Returns existing IPv4 lease for specified client-id. More... | |
| virtual Lease4Ptr | getLease4 (const ClientId &clientid, SubnetID subnet_id) const |
| Returns existing IPv4 lease for specified client-id. More... | |
| virtual Lease4Ptr | getLease4 (const isc::asiolink::IOAddress &addr) const |
| Returns an IPv4 lease for specified IPv4 address. More... | |
| virtual Lease4Collection | getLease4 (const isc::dhcp::HWAddr &hwaddr) const |
| Returns existing IPv4 leases for specified hardware address. More... | |
| virtual Lease4Ptr | getLease4 (const isc::dhcp::HWAddr &hwaddr, SubnetID subnet_id) const |
| Returns existing IPv4 leases for specified hardware address and a subnet. More... | |
| virtual Lease6Ptr | getLease6 (Lease::Type type, const isc::asiolink::IOAddress &addr) const |
| Returns existing IPv6 lease for a given IPv6 address. More... | |
| virtual Lease4Collection | getLeases4 () const |
| Returns all IPv4 leases. More... | |
| virtual Lease4Collection | getLeases4 (const asiolink::IOAddress &lower_bound_address, const LeasePageSize &page_size) const |
| Returns range of IPv4 leases using paging. More... | |
| virtual Lease4Collection | getLeases4 (SubnetID subnet_id) const |
| Returns all IPv4 leases for the particular subnet identifier. More... | |
| virtual Lease6Collection | getLeases6 () const |
| Returns all IPv6 leases. More... | |
| virtual Lease6Collection | getLeases6 (const asiolink::IOAddress &lower_bound_address, const LeasePageSize &page_size) const |
| Returns range of IPv6 leases using paging. More... | |
| virtual Lease6Collection | getLeases6 (const DUID &duid) const |
| Returns all IPv6 leases for the DUID. More... | |
| virtual Lease6Collection | getLeases6 (Lease::Type type, const DUID &duid, uint32_t iaid) const |
| Returns existing IPv6 leases for a given DUID+IA combination. More... | |
| virtual Lease6Collection | getLeases6 (Lease::Type type, const DUID &duid, uint32_t iaid, SubnetID subnet_id) const |
| Returns existing IPv6 lease for a given DUID+IA combination. More... | |
| virtual Lease6Collection | getLeases6 (SubnetID subnet_id) const |
| Returns all IPv6 leases for the particular subnet identifier. More... | |
| virtual std::string | getName () const |
| Returns backend name. More... | |
| virtual std::string | getType () const |
| Return backend type. More... | |
| virtual std::pair< uint32_t, uint32_t > | getVersion () const |
| Returns backend version. More... | |
| virtual void | rollback () |
| Rollback Transactions. More... | |
| virtual LeaseStatsQueryPtr | startLeaseStatsQuery4 () |
| Creates and runs the IPv4 lease stats query. More... | |
| virtual LeaseStatsQueryPtr | startLeaseStatsQuery6 () |
| Creates and runs the IPv6 lease stats query. More... | |
| virtual LeaseStatsQueryPtr | startSubnetLeaseStatsQuery4 (const SubnetID &subnet_id) |
| Creates and runs the IPv4 lease stats query for a single subnet. More... | |
| virtual LeaseStatsQueryPtr | startSubnetLeaseStatsQuery6 (const SubnetID &subnet_id) |
| Creates and runs the IPv6 lease stats query for a single subnet. More... | |
| virtual LeaseStatsQueryPtr | startSubnetRangeLeaseStatsQuery4 (const SubnetID &first_subnet_id, const SubnetID &last_subnet_id) |
| Creates and runs the IPv4 lease stats query for a single subnet. More... | |
| virtual LeaseStatsQueryPtr | startSubnetRangeLeaseStatsQuery6 (const SubnetID &first_subnet_id, const SubnetID &last_subnet_id) |
| Creates and runs the IPv6 lease stats query for a single subnet. More... | |
| virtual void | updateLease4 (const Lease4Ptr &lease4) |
| Updates IPv4 lease. More... | |
| virtual void | updateLease6 (const Lease6Ptr &lease6) |
| Updates IPv6 lease. More... | |
| virtual size_t | wipeLeases4 (const SubnetID &subnet_id) |
| Removes specified IPv4 leases. More... | |
| virtual size_t | wipeLeases6 (const SubnetID &subnet_id) |
| Removed specified IPv6 leases. More... | |
Public Member Functions inherited from isc::dhcp::LeaseMgr | |
| LeaseMgr () | |
| Constructor. More... | |
| virtual | ~LeaseMgr () |
| Destructor. More... | |
| Lease6Ptr | getLease6 (Lease::Type type, const DUID &duid, uint32_t iaid, SubnetID subnet_id) const |
| returns zero or one IPv6 lease for a given duid+iaid+subnet_id More... | |
| void | recountLeaseStats4 () |
| Recalculates per-subnet and global stats for IPv4 leases. More... | |
| void | recountLeaseStats6 () |
| Recalculates per-subnet and global stats for IPv6 leases. More... | |
Static Public Member Functions | |
| static std::string | getDBVersion () |
| Local version of getDBVersion() class method. More... | |
Static Public Member Functions inherited from isc::dhcp::LeaseMgr | |
| static std::string | getDBVersion () |
| Class method to return extended version info This class method must be redeclared and redefined in derived classes. More... | |
MySQL Lease Manager.
This class provides the isc::dhcp::LeaseMgr interface to the MySQL database. Use of this backend presupposes that a MySQL database is available and that the Kea schema has been created within it.
Definition at line 35 of file mysql_lease_mgr.h.
Statement Tags.
The contents of the enum are indexes into the list of SQL statements
Definition at line 571 of file mysql_lease_mgr.h.
| isc::dhcp::MySqlLeaseMgr::MySqlLeaseMgr | ( | const db::DatabaseConnection::ParameterMap & | parameters | ) |
Constructor.
Uses the following keywords in the parameters passed to it to connect to the database:
If the database is successfully opened, the version number in the schema_version table will be checked against hard-coded value in the implementation file.
Finally, all the SQL commands are pre-compiled.
| parameters | A data structure relating keywords and values concerned with the database. |
| isc::dhcp::NoDatabaseName | Mandatory database name not given |
| isc::db::DbOpenError | Error opening the database or the schema version is incorrect. |
| isc::db::DbOperationError | An operation on the open database has failed. |
Definition at line 1667 of file mysql_lease_mgr.cc.
References getVersion(), isc_throw, isc::db::MySqlConnection::mysql_, isc::db::MYSQL_SCHEMA_VERSION_MAJOR, isc::db::MYSQL_SCHEMA_VERSION_MINOR, isc::db::MySqlConnection::openDatabase(), isc::db::MySqlConnection::prepareStatements(), and isc::dhcp::tagged_statements.
Here is the call graph for this function:
|
virtual |
Destructor (closes database)
Definition at line 1704 of file mysql_lease_mgr.cc.
|
virtual |
Adds an IPv4 lease.
| lease | lease to be added |
| isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 1748 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, INSERT_LEASE4, and LOG_DEBUG.
|
virtual |
Adds an IPv6 lease.
| lease | lease to be added |
| isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 1760 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, INSERT_LEASE6, and LOG_DEBUG.
|
virtual |
Commit Transactions.
Commits all pending database operations. On databases that don't support transactions, this is a no-op.
| DbOperationError | If the commit failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2762 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc_throw, LOG_DEBUG, and isc::db::MySqlConnection::mysql_.
|
virtual |
Deletes all expired-reclaimed DHCPv4 leases.
| secs | Number of seconds since expiration of leases before they can be removed. Leases which have expired later than this time will not be deleted. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2569 of file mysql_lease_mgr.cc.
References DELETE_LEASE4_STATE_EXPIRED, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, and LOG_DEBUG.
|
virtual |
Deletes all expired-reclaimed DHCPv6 leases.
| secs | Number of seconds since expiration of leases before they can be removed. Leases which have expired later than this time will not be deleted. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2577 of file mysql_lease_mgr.cc.
References DELETE_LEASE6_STATE_EXPIRED, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, and LOG_DEBUG.
|
virtual |
Deletes a lease.
| addr | Address of the lease to be deleted. This can be an IPv4 address or an IPv6 address. |
| isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2536 of file mysql_lease_mgr.cc.
References DELETE_LEASE4, DELETE_LEASE6, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::asiolink::IOAddress::isV4(), LOG_DEBUG, isc::db::MLM_TRUE, isc::asiolink::IOAddress::toText(), and isc::asiolink::IOAddress::toUint32().
Here is the call graph for this function:
|
static |
Local version of getDBVersion() class method.
Definition at line 1710 of file mysql_lease_mgr.cc.
References isc::db::MYSQL_SCHEMA_VERSION_MAJOR, and isc::db::MYSQL_SCHEMA_VERSION_MINOR.
Referenced by isc::dhcp::Dhcpv6Srv::getVersion(), and isc::dhcp::Dhcpv4Srv::getVersion().
|
virtual |
Returns description of the backend.
This description may be multiline text that describes the backend.
Implements isc::dhcp::LeaseMgr.
Definition at line 2697 of file mysql_lease_mgr.cc.
|
virtual |
Returns a collection of expired DHCPv4 leases.
This method returns at most max_leases expired leases. The leases returned haven't been reclaimed, i.e. the database query must exclude reclaimed leases from the results returned.
| [out] | expired_leases | A container to which expired leases returned by the database backend are added. |
| max_leases | A maximum number of leases to be returned. If this value is set to 0, all expired (but not reclaimed) leases are returned. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2380 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, GET_LEASE4_EXPIRE, and LOG_DEBUG.
|
virtual |
Returns a collection of expired DHCPv6 leases.
This method returns at most max_leases expired leases. The leases returned haven't been reclaimed, i.e. the database query must exclude reclaimed leases from the results returned.
| [out] | expired_leases | A container to which expired leases returned by the database backend are added. |
| max_leases | A maximum number of leases to be returned. If this value is set to 0, all expired (but not reclaimed) leases are returned. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2388 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, GET_LEASE6_EXPIRE, and LOG_DEBUG.
|
virtual |
Returns IPv4 lease for the specified client identifier, HW address and subnet identifier.
| client_id | A client identifier. |
| hwaddr | Hardware address. |
| subnet_id | A subnet identifier. |
| isc::NotImplemented | On every call as this function is currently not implemented for the MySQL backend. |
This function is currently not implemented because allocation engine searches for the lease using HW address or client identifier. It never uses both parameters in the same time. We need to consider if this function is needed at all.
Implements isc::dhcp::LeaseMgr.
Definition at line 2030 of file mysql_lease_mgr.cc.
References isc_throw.
|
virtual |
Returns existing IPv4 lease for specified client-id.
Although in the usual case there will be only one lease, for mobile clients or clients with multiple static/fixed/reserved leases there can be more than one. Thus return type is a container, not a single pointer.
| clientid | client identifier |
| isc::dhcp::DataTruncation | Data was truncated on retrieval to fit into the space allocated for the result. This indicates a programming error. |
| isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 1999 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, GET_LEASE4_CLIENTID, isc::dhcp::ClientId::getClientId(), LOG_DEBUG, and isc::dhcp::ClientId::toText().
Here is the call graph for this function:
|
virtual |
Returns existing IPv4 lease for specified client-id.
There can be at most one lease for a given HW address in a single pool, so this method with either return a single lease or NULL.
| clientid | client identifier |
| subnet_id | identifier of the subnet that lease must belong to |
| isc::dhcp::DataTruncation | Data was truncated on retrieval to fit into the space allocated for the result. This indicates a programming error. |
| isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2040 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, GET_LEASE4_CLIENTID_SUBID, isc::dhcp::ClientId::getClientId(), LOG_DEBUG, isc::db::MLM_TRUE, and isc::dhcp::ClientId::toText().
Here is the call graph for this function:
|
virtual |
Returns an IPv4 lease for specified IPv4 address.
This method return a lease that is associated with a given address. For other query types (by hardware addr, by Client ID) there can be several leases in different subnets (e.g. for mobile clients that got address in different subnets). However, for a single address there can be only one lease, so this method returns a pointer to a single lease, not a container of leases.
| addr | address of the searched lease |
| isc::dhcp::DataTruncation | Data was truncated on retrieval to fit into the space allocated for the result. This indicates a programming error. |
| isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 1901 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, GET_LEASE4_ADDR, LOG_DEBUG, isc::db::MLM_TRUE, isc::asiolink::IOAddress::toText(), and isc::asiolink::IOAddress::toUint32().
Here is the call graph for this function:
|
virtual |
Returns existing IPv4 leases for specified hardware address.
Although in the usual case there will be only one lease, for mobile clients or clients with multiple static/fixed/reserved leases there can be more than one. Thus return type is a container, not a single pointer.
| hwaddr | hardware address of the client |
| isc::dhcp::DataTruncation | Data was truncated on retrieval to fit into the space allocated for the result. This indicates a programming error. |
| isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 1922 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, GET_LEASE4_HWADDR, isc::dhcp::HWAddr::hwaddr_, LOG_DEBUG, and isc::dhcp::HWAddr::toText().
Here is the call graph for this function:
|
virtual |
Returns existing IPv4 leases for specified hardware address and a subnet.
There can be at most one lease for a given HW address in a single pool, so this method with either return a single lease or NULL.
| hwaddr | hardware address of the client |
| subnet_id | identifier of the subnet that lease must belong to |
| isc::dhcp::DataTruncation | Data was truncated on retrieval to fit into the space allocated for the result. This indicates a programming error. |
| isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 1958 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, GET_LEASE4_HWADDR_SUBID, isc::dhcp::HWAddr::hwaddr_, LOG_DEBUG, isc::db::MLM_TRUE, and isc::dhcp::HWAddr::toText().
Here is the call graph for this function:
|
virtual |
Returns existing IPv6 lease for a given IPv6 address.
For a given address, we assume that there will be only one lease. The assumption here is that there will not be site or link-local addresses used, so there is no way of having address duplication.
| type | specifies lease type: (NA, TA or PD) |
| addr | address of the searched lease |
| isc::BadValue | record retrieved from database had an invalid lease type field. |
| isc::dhcp::DataTruncation | Data was truncated on retrieval to fit into the space allocated for the result. This indicates a programming error. |
| isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2144 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, GET_LEASE6_ADDR, LOG_DEBUG, isc::db::MLM_TRUE, and isc::asiolink::IOAddress::toText().
Here is the call graph for this function:
|
virtual |
Returns all IPv4 leases.
Implements isc::dhcp::LeaseMgr.
Definition at line 2097 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, GET_LEASE4, and LOG_DEBUG.
|
virtual |
Returns range of IPv4 leases using paging.
This method implements paged browsing of the lease database. The first parameter specifies a page size. The second parameter is optional and specifies the starting address of the range. This address is excluded from the returned range. The IPv4 zero address (default) denotes that the first page should be returned. There is no guarantee about the order of returned leases.
The typical usage of this method is as follows:
| lower_bound_address | IPv4 address used as lower bound for the returned range. |
| page_size | maximum size of the page returned. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2107 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, GET_LEASE4_PAGE, isc_throw, isc::asiolink::IOAddress::isV4(), LOG_DEBUG, isc::db::MLM_TRUE, isc::dhcp::LeasePageSize::page_size_, isc::asiolink::IOAddress::toText(), and isc::asiolink::IOAddress::toUint32().
Here is the call graph for this function:
|
virtual |
Returns all IPv4 leases for the particular subnet identifier.
| subnet_id | subnet identifier. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2076 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, GET_LEASE4_SUBID, LOG_DEBUG, and isc::db::MLM_TRUE.
|
virtual |
Returns all IPv6 leases.
Implements isc::dhcp::LeaseMgr.
Definition at line 2299 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, GET_LEASE6, and LOG_DEBUG.
|
virtual |
Returns range of IPv6 leases using paging.
This method implements paged browsing of the lease database. The first parameter specifies a page size. The second parameter is optional and specifies the starting address of the range. This address is excluded from the returned range. The IPv6 zero address (default) denotes that the first page should be returned. There is no guarantee about the order of returned leases.
The typical usage of this method is as follows:
| lower_bound_address | IPv6 address used as lower bound for the returned range. |
| page_size | maximum size of the page returned. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2334 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, GET_LEASE6_PAGE, isc_throw, isc::asiolink::IOAddress::isV6(), isc::asiolink::IOAddress::isV6Zero(), LOG_DEBUG, isc::db::MLM_TRUE, isc::dhcp::LeasePageSize::page_size_, and isc::asiolink::IOAddress::toText().
Here is the call graph for this function:
|
virtual |
Returns all IPv6 leases for the DUID.
Implements isc::dhcp::LeaseMgr.
Definition at line 2309 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, GET_LEASE6_DUID, isc::dhcp::DUID::getDuid(), LOG_DEBUG, and isc::dhcp::DUID::toText().
Here is the call graph for this function:
|
virtual |
Returns existing IPv6 leases for a given DUID+IA combination.
Although in the usual case there will be only one lease, for mobile clients or clients with multiple static/fixed/reserved leases there can be more than one. Thus return type is a container, not a single pointer.
| type | specifies lease type: (NA, TA or PD) |
| duid | client DUID |
| iaid | IA identifier |
| isc::BadValue | record retrieved from database had an invalid lease type field. |
| isc::dhcp::DataTruncation | Data was truncated on retrieval to fit into the space allocated for the result. This indicates a programming error. |
| isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2176 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, GET_LEASE6_DUID_IAID, isc::dhcp::DUID::getDuid(), LOG_DEBUG, isc::db::MLM_TRUE, and isc::dhcp::DUID::toText().
Here is the call graph for this function:
|
virtual |
Returns existing IPv6 lease for a given DUID+IA combination.
| type | specifies lease type: (NA, TA or PD) |
| duid | client DUID |
| iaid | IA identifier |
| subnet_id | subnet id of the subnet the lease belongs to |
| isc::BadValue | record retrieved from database had an invalid lease type field. |
| isc::dhcp::DataTruncation | Data was truncated on retrieval to fit into the space allocated for the result. This indicates a programming error. |
| isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2233 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, GET_LEASE6_DUID_IAID_SUBID, isc::dhcp::DUID::getDuid(), LOG_DEBUG, isc::db::MLM_TRUE, and isc::dhcp::DUID::toText().
Here is the call graph for this function:
|
virtual |
Returns all IPv6 leases for the particular subnet identifier.
| subnet_id | subnet identifier. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2278 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, GET_LEASE6_SUBID, LOG_DEBUG, and isc::db::MLM_TRUE.
|
virtual |
Returns backend name.
Each backend have specific name, e.g. "mysql" or "sqlite".
Implements isc::dhcp::LeaseMgr.
Definition at line 2686 of file mysql_lease_mgr.cc.
References isc::db::DatabaseConnection::getParameter().
Here is the call graph for this function:
|
inlinevirtual |
Return backend type.
Returns the type of the backend (e.g. "mysql", "memfile" etc.)
Implements isc::dhcp::LeaseMgr.
Definition at line 520 of file mysql_lease_mgr.h.
|
virtual |
Returns backend version.
The method is called by the constructor after opening the database but prior to preparing SQL statements, to verify that the schema version is correct. Thus it must not rely on a pre-prepared statement or formal statement execution error checking.
| isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2702 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc_throw, LOG_DEBUG, and isc::db::MySqlConnection::mysql_.
Referenced by MySqlLeaseMgr().
|
virtual |
Rollback Transactions.
Rolls back all pending database operations. On databases that don't support transactions, this is a no-op.
| DbOperationError | If the rollback failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2770 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc_throw, LOG_DEBUG, and isc::db::MySqlConnection::mysql_.
|
virtual |
Creates and runs the IPv4 lease stats query.
It creates an instance of a MySqlLeaseStatsQuery4 and then invokes its start method, which fetches its statistical data result set by executing the ALL_LEASE_STATS4 query. The query object is then returned.
Reimplemented from isc::dhcp::LeaseMgr.
Definition at line 2614 of file mysql_lease_mgr.cc.
References ALL_LEASE4_STATS.
|
virtual |
Creates and runs the IPv6 lease stats query.
It creates an instance of a MySqlLeaseStatsQuery6 and then invokes its start method, which fetches its statistical data result set by executing the ALL_LEASE_STATS6 query. The query object is then returned.
Reimplemented from isc::dhcp::LeaseMgr.
Definition at line 2644 of file mysql_lease_mgr.cc.
References ALL_LEASE6_STATS.
|
virtual |
Creates and runs the IPv4 lease stats query for a single subnet.
It creates an instance of a MySqlLeaseStatsQuery4 for a single subnet query and then invokes its start method in which the query constructs its statistical data result set. The query object is then returned.
| subnet_id | id of the subnet for which stats are desired |
Reimplemented from isc::dhcp::LeaseMgr.
Definition at line 2623 of file mysql_lease_mgr.cc.
References SUBNET_LEASE4_STATS.
|
virtual |
Creates and runs the IPv6 lease stats query for a single subnet.
It creates an instance of a MySqlLeaseStatsQuery6 for a single subnet query and then invokes its start method in which the query constructs its statistical data result set. The query object is then returned.
| subnet_id | id of the subnet for which stats are desired |
Reimplemented from isc::dhcp::LeaseMgr.
Definition at line 2653 of file mysql_lease_mgr.cc.
References SUBNET_LEASE6_STATS.
|
virtual |
Creates and runs the IPv4 lease stats query for a single subnet.
It creates an instance of a MySqlLeaseStatsQuery4 for a subnet range query and then invokes its start method in which the query constructs its statistical data result set. The query object is then returned.
| first_subnet_id | first subnet in the range of subnets |
| last_subnet_id | last subnet in the range of subnets |
Reimplemented from isc::dhcp::LeaseMgr.
Definition at line 2633 of file mysql_lease_mgr.cc.
References SUBNET_RANGE_LEASE4_STATS.
|
virtual |
Creates and runs the IPv6 lease stats query for a single subnet.
It creates an instance of a MySqlLeaseStatsQuery6 for a subnet range query and then invokes its start method in which the query constructs its statistical data result set. The query object is then returned.
| first_subnet_id | first subnet in the range of subnets |
| last_subnet_id | last subnet in the range of subnets |
Reimplemented from isc::dhcp::LeaseMgr.
Definition at line 2663 of file mysql_lease_mgr.cc.
References SUBNET_RANGE_LEASE6_STATS.
|
virtual |
Updates IPv4 lease.
Updates the record of the lease in the database (as identified by the address) with the data in the passed lease object.
| lease4 | The lease to be updated. |
| isc::dhcp::NoSuchLease | Attempt to update a lease that did not exist. |
| isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2461 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, LOG_DEBUG, isc::db::MLM_TRUE, and UPDATE_LEASE4.
|
virtual |
Updates IPv6 lease.
Updates the record of the lease in the database (as identified by the address) with the data in the passed lease object.
| lease6 | The lease to be updated. |
| isc::dhcp::NoSuchLease | Attempt to update a lease that did not exist. |
| isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2485 of file mysql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, LOG_DEBUG, and UPDATE_LEASE6.
|
virtual |
Removes specified IPv4 leases.
This rather dangerous method is able to remove all leases from specified subnet.
| subnet_id | identifier of the subnet |
Implements isc::dhcp::LeaseMgr.
Definition at line 2674 of file mysql_lease_mgr.cc.
References isc_throw.
|
virtual |
Removed specified IPv6 leases.
This rather dangerous method is able to remove all leases from specified subnet.
| subnet_id | identifier of the subnet |
Implements isc::dhcp::LeaseMgr.
Definition at line 2679 of file mysql_lease_mgr.cc.
References isc_throw.