Kea  1.5.0
isc::lease_cmds::LeaseCmdsImpl Class Reference

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...
 

Detailed Description

Wrapper class around reservation command handlers.

Definition at line 43 of file lease_cmds.cc.

Member Function Documentation

◆ getParameters()

LeaseCmdsImpl::Parameters isc::lease_cmds::LeaseCmdsImpl::getParameters ( bool  v6,
const ConstElementPtr args 
)

◆ lease4DelHandler()

int isc::lease_cmds::LeaseCmdsImpl::lease4DelHandler ( CalloutHandle handle)

lease4-del command handler

Provides the implementation for isc::lease_cmds::LeaseCmds::lease4DelHandler

Parameters
handleCallout context - which is expected to contain the delete command JSON text in the "command" argument
Returns
0 upon success, non-zero otherwise

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:

◆ lease4UpdateHandler()

int isc::lease_cmds::LeaseCmdsImpl::lease4UpdateHandler ( CalloutHandle handle)

lease4-update handler

Provides the implementation for isc::lease_cmds::LeaseCmds::lease4UpdateHandler

Parameters
handleCallout context - which is expected to contain the update command JSON text in the "command" argument
Returns
0 upon success, non-zero otherwise

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:

◆ lease4WipeHandler()

int isc::lease_cmds::LeaseCmdsImpl::lease4WipeHandler ( CalloutHandle handle)

lease4-wipe handler

Provides the implementation for isc::lease_cmds::LeaseCmds::lease4WipeHandler

Parameters
handleCallout context - which is expected to contain the wipe command JSON text in the "command" argument
Returns
0 upon success, non-zero otherwise

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:

◆ lease6DelHandler()

int isc::lease_cmds::LeaseCmdsImpl::lease6DelHandler ( CalloutHandle handle)

◆ lease6UpdateHandler()

int isc::lease_cmds::LeaseCmdsImpl::lease6UpdateHandler ( CalloutHandle handle)

lease6-update handler

Provides the implementation for isc::lease_cmds::LeaseCmds::lease6UpdateHandler

Parameters
handleCallout context - which is expected to contain the update command JSON text in the "command" argument
Returns
0 upon success, non-zero otherwise

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:

◆ lease6WipeHandler()

int isc::lease_cmds::LeaseCmdsImpl::lease6WipeHandler ( CalloutHandle handle)

lease6-wipe handler

Provides the implementation for isc::lease_cmds::LeaseCmds::lease6WipeHandler

Parameters
handleCallout context - which is expected to contain the wipe command JSON text in the "command" argument
Returns
0 upon success, non-zero otherwise
Todo:
: consider extending the code with wipe-leases:

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:

◆ leaseAddHandler()

int isc::lease_cmds::LeaseCmdsImpl::leaseAddHandler ( CalloutHandle handle)

lease4-add, lease6-add command handler

Provides the implementation for isc::lease_cmds::LeaseCmds::leaseAddHandler

Parameters
handleCallout context - which is expected to contain the add command JSON text in the "command" argument
Returns
0 upon success, non-zero otherwise

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:

◆ leaseGetAllHandler()

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.

Parameters
handleCallout context - which is expected to contain the get command JSON text in the "command" argument
Returns
0 upon success, non-zero otherwise.

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:

◆ leaseGetHandler()

◆ leaseGetPageHandler()

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.

Parameters
handleCallout context - which is expected to contain the get commands JSON text in the "command" argument.
Returns
0 if the handler has been invoked successfully, 1 if an error occurs, 3 if no leases are returned.

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:

The documentation for this class was generated from the following file: