![]() |
Kea
1.5.0
|
Wrapper class around reservation command handlers. More...
Inheritance diagram for isc::lease_cmds::LeaseCmdsImpl:Classes | |
| class | Parameters |
| Parameters specified for lease commands. More... | |
Public Member Functions | |
| Parameters | getParameters (bool v6, const ConstElementPtr &args) |
| Extracts parameters required for reservation-get and reservation-del. More... | |
| int | lease4DelHandler (CalloutHandle &handle) |
| lease4-del command handler More... | |
| int | lease4UpdateHandler (CalloutHandle &handle) |
| lease4-update handler More... | |
| int | lease4WipeHandler (CalloutHandle &handle) |
| lease4-wipe handler More... | |
| int | lease6DelHandler (CalloutHandle &handle) |
| lease6-del command handler More... | |
| int | lease6UpdateHandler (CalloutHandle &handle) |
| lease6-update handler More... | |
| int | lease6WipeHandler (CalloutHandle &handle) |
| lease6-wipe handler More... | |
| int | leaseAddHandler (CalloutHandle &handle) |
| lease4-add, lease6-add command handler More... | |
| int | leaseGetAllHandler (CalloutHandle &handle) |
| lease4-get-all, lease6-get-all commands handler More... | |
| int | leaseGetHandler (CalloutHandle &handle) |
| lease4-get, lease6-get command handler More... | |
| int | leaseGetPageHandler (hooks::CalloutHandle &handle) |
| lease4-get-page, lease6-get-page commands handler More... | |
Wrapper class around reservation command handlers.
Definition at line 43 of file lease_cmds.cc.
| LeaseCmdsImpl::Parameters isc::lease_cmds::LeaseCmdsImpl::getParameters | ( | bool | v6, |
| const ConstElementPtr & | args | ||
| ) |
Extracts parameters required for reservation-get and reservation-del.
See Parameters class for detailed description of what is expected in the args structure.
| v6 | whether addresses allowed are v4 (false) or v6 (true) |
| args | arguments passed to command |
| BadValue | if input arguments don't make sense. |
Definition at line 304 of file lease_cmds.cc.
References isc::lease_cmds::LeaseCmdsImpl::Parameters::addr, isc::lease_cmds::LeaseCmdsImpl::Parameters::client_id, isc::lease_cmds::LeaseCmdsImpl::Parameters::duid, isc::dhcp::DUID::fromText(), isc::dhcp::HWAddr::fromText(), isc::dhcp::ClientId::fromText(), isc::lease_cmds::LeaseCmdsImpl::Parameters::hwaddr, isc::lease_cmds::LeaseCmdsImpl::Parameters::iaid, isc_throw, isc::asiolink::IOAddress::isV4(), isc::asiolink::IOAddress::isV6(), isc::lease_cmds::LeaseCmdsImpl::Parameters::lease_type, isc::lease_cmds::LeaseCmdsImpl::Parameters::query_type, isc::lease_cmds::LeaseCmdsImpl::Parameters::subnet_id, isc::dhcp::Lease::TYPE_NA, isc::dhcp::Lease::TYPE_PD, isc::dhcp::Lease::TYPE_TA, and isc::dhcp::Lease::TYPE_V4.
Here is the call graph for this function:| int isc::lease_cmds::LeaseCmdsImpl::lease4DelHandler | ( | CalloutHandle & | handle | ) |
lease4-del command handler
Provides the implementation for isc::lease_cmds::LeaseCmds::lease4DelHandler
| handle | Callout context - which is expected to contain the delete command JSON text in the "command" argument |
Definition at line 704 of file lease_cmds.cc.
References isc::lease_cmds::LeaseCmdsImpl::Parameters::addr, isc::lease_cmds::LeaseCmdsImpl::Parameters::client_id, isc::config::CONTROL_RESULT_EMPTY, isc::dhcp::LeaseMgr::getLease4(), isc::lease_cmds::LeaseCmdsImpl::Parameters::hwaddr, isc::dhcp::LeaseMgrFactory::instance(), isc::asiolink::IOAddress::IPV4_ZERO_ADDRESS(), isc_throw, isc::lease_cmds::LeaseCmdsImpl::Parameters::query_type, and isc::lease_cmds::LeaseCmdsImpl::Parameters::subnet_id.
Here is the call graph for this function:| int isc::lease_cmds::LeaseCmdsImpl::lease4UpdateHandler | ( | CalloutHandle & | handle | ) |
lease4-update handler
Provides the implementation for isc::lease_cmds::LeaseCmds::lease4UpdateHandler
| handle | Callout context - which is expected to contain the update command JSON text in the "command" argument |
Definition at line 834 of file lease_cmds.cc.
References isc::dhcp::LeaseMgr::addLease(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::instance(), isc::dhcp::LeaseMgrFactory::instance(), isc_throw, isc::lease_cmds::Lease4Parser::parse(), and isc::dhcp::LeaseMgr::updateLease4().
Here is the call graph for this function:| int isc::lease_cmds::LeaseCmdsImpl::lease4WipeHandler | ( | CalloutHandle & | handle | ) |
lease4-wipe handler
Provides the implementation for isc::lease_cmds::LeaseCmds::lease4WipeHandler
| handle | Callout context - which is expected to contain the wipe command JSON text in the "command" argument |
Definition at line 904 of file lease_cmds.cc.
References isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::data::SimpleParser::getUint32(), isc::dhcp::CfgMgr::instance(), isc::dhcp::LeaseMgrFactory::instance(), and isc::dhcp::LeaseMgr::wipeLeases4().
Here is the call graph for this function:| int isc::lease_cmds::LeaseCmdsImpl::lease6DelHandler | ( | CalloutHandle & | handle | ) |
lease6-del command handler
Provides the implementation for isc::lease_cmds::LeaseCmds::lease6DelHandler
| handle | Callout context - which is expected to contain the delete command JSON text in the "command" argument |
Definition at line 777 of file lease_cmds.cc.
References isc::lease_cmds::LeaseCmdsImpl::Parameters::addr, isc::config::CONTROL_RESULT_EMPTY, isc::lease_cmds::LeaseCmdsImpl::Parameters::duid, isc::dhcp::LeaseMgr::getLease6(), isc::lease_cmds::LeaseCmdsImpl::Parameters::iaid, isc::dhcp::LeaseMgrFactory::instance(), isc::asiolink::IOAddress::IPV6_ZERO_ADDRESS(), isc_throw, isc::lease_cmds::LeaseCmdsImpl::Parameters::lease_type, isc::lease_cmds::LeaseCmdsImpl::Parameters::query_type, and isc::lease_cmds::LeaseCmdsImpl::Parameters::subnet_id.
Here is the call graph for this function:| int isc::lease_cmds::LeaseCmdsImpl::lease6UpdateHandler | ( | CalloutHandle & | handle | ) |
lease6-update handler
Provides the implementation for isc::lease_cmds::LeaseCmds::lease6UpdateHandler
| handle | Callout context - which is expected to contain the update command JSON text in the "command" argument |
Definition at line 869 of file lease_cmds.cc.
References isc::dhcp::LeaseMgr::addLease(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::instance(), isc::dhcp::LeaseMgrFactory::instance(), isc_throw, isc::lease_cmds::Lease6Parser::parse(), and isc::dhcp::LeaseMgr::updateLease6().
Here is the call graph for this function:| int isc::lease_cmds::LeaseCmdsImpl::lease6WipeHandler | ( | CalloutHandle & | handle | ) |
lease6-wipe handler
Provides the implementation for isc::lease_cmds::LeaseCmds::lease6WipeHandler
| handle | Callout context - which is expected to contain the wipe command JSON text in the "command" argument |
Definition at line 950 of file lease_cmds.cc.
References isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::data::SimpleParser::getUint32(), isc::dhcp::CfgMgr::instance(), isc::dhcp::LeaseMgrFactory::instance(), and isc::dhcp::LeaseMgr::wipeLeases6().
Here is the call graph for this function:| int isc::lease_cmds::LeaseCmdsImpl::leaseAddHandler | ( | CalloutHandle & | handle | ) |
lease4-add, lease6-add command handler
Provides the implementation for isc::lease_cmds::LeaseCmds::leaseAddHandler
| handle | Callout context - which is expected to contain the add command JSON text in the "command" argument |
Definition at line 238 of file lease_cmds.cc.
References isc::dhcp::LeaseMgr::addLease(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::instance(), isc::dhcp::LeaseMgrFactory::instance(), isc_throw, isc::lease_cmds::lease_cmds_logger, LOG_ERROR, LOG_INFO, isc::lease_cmds::Lease4Parser::parse(), isc::lease_cmds::Lease6Parser::parse(), and isc::dhcp::Lease::TYPE_NA.
Here is the call graph for this function:| int isc::lease_cmds::LeaseCmdsImpl::leaseGetAllHandler | ( | CalloutHandle & | handle | ) |
lease4-get-all, lease6-get-all commands handler
These commands attempt to retrieve all IPv4 or IPv6 leases, or all IPv4 or all IPv6 leases belonging to the particular subnets. If no subnet identifiers are provided, it returns all IPv4 or IPv6 leases from the database.
| handle | Callout context - which is expected to contain the get command JSON text in the "command" argument |
Definition at line 502 of file lease_cmds.cc.
References isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_ERROR, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), isc::dhcp::LeaseMgr::getLeases4(), isc::dhcp::LeaseMgr::getLeases6(), isc::dhcp::LeaseMgrFactory::instance(), and isc_throw.
Here is the call graph for this function:| int isc::lease_cmds::LeaseCmdsImpl::leaseGetHandler | ( | CalloutHandle & | handle | ) |
lease4-get, lease6-get command handler
Provides the implementation for isc::lease_cmds::LeaseCmds::leaseGetHandler
| handle | Callout context - which is expected to contain the get command JSON text in the "command" argument |
Definition at line 412 of file lease_cmds.cc.
References isc::lease_cmds::LeaseCmdsImpl::Parameters::addr, isc::lease_cmds::LeaseCmdsImpl::Parameters::client_id, isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), isc::lease_cmds::LeaseCmdsImpl::Parameters::duid, isc::dhcp::LeaseMgr::getLease4(), isc::dhcp::LeaseMgr::getLease6(), isc::lease_cmds::LeaseCmdsImpl::Parameters::hwaddr, isc::lease_cmds::LeaseCmdsImpl::Parameters::iaid, isc::dhcp::LeaseMgrFactory::instance(), isc_throw, isc::lease_cmds::LeaseCmdsImpl::Parameters::lease_type, isc::lease_cmds::LeaseCmdsImpl::Parameters::query_type, and isc::lease_cmds::LeaseCmdsImpl::Parameters::subnet_id.
Here is the call graph for this function:| int isc::lease_cmds::LeaseCmdsImpl::leaseGetPageHandler | ( | hooks::CalloutHandle & | handle | ) |
lease4-get-page, lease6-get-page commands handler
These commands attempt to retrieve 1 page of leases. The maximum size of the page is specified by the caller. The caller also specifies the last address returned in the previous page. The new page starts from the first address following the address specified by the caller. If the first page should be returned the IPv4 zero address, IPv6 zero address or the keyword "start" should be provided instead of the last address.
| handle | Callout context - which is expected to contain the get commands JSON text in the "command" argument. |
Definition at line 585 of file lease_cmds.cc.
References isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_ERROR, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), isc::dhcp::LeaseMgr::getLeases4(), isc::dhcp::LeaseMgr::getLeases6(), isc::dhcp::LeaseMgrFactory::instance(), and isc_throw.
Here is the call graph for this function: