![]() |
Kea 3.1.1
|
Wrapper class around reservation command handlers. More...
Classes | |
class | Parameters |
Parameters specified for reservation-get and reservation-del. More... | |
Public Member Functions | |
HostCmdsImpl () | |
Constructor. | |
~HostCmdsImpl () | |
Destructor. | |
int | reservationAddHandler (CalloutHandle &handle) |
reservation-add command handler | |
int | reservationDelHandler (CalloutHandle &handle) |
reservation-del command handler | |
int | reservationGetAllHandler (CalloutHandle &handle) |
reservation-get-all command handler | |
int | reservationGetByAddressHandler (CalloutHandle &handle) |
reservation-get-by-address command handler | |
int | reservationGetByHostnameHandler (CalloutHandle &handle) |
reservation-get-by-hostname command handler | |
int | reservationGetByIdHandler (CalloutHandle &handle) |
reservation-get-by-id command handler | |
int | reservationGetHandler (CalloutHandle &handle) |
reservation-get command handler | |
int | reservationGetPageHandler (CalloutHandle &handle) |
reservation-get-page command handler | |
int | reservationUpdateHandler (CalloutHandle &handle) |
reservation-update command handler | |
Wrapper class around reservation command handlers.
Definition at line 42 of file host_cmds.cc.
isc::host_cmds::HostCmdsImpl::HostCmdsImpl | ( | ) |
Constructor.
Definition at line 319 of file host_cmds.cc.
References isc::dhcp::CfgMgr::getFamily(), isc::dhcp::HostMgr::getHostDataSource(), isc::dhcp::CfgMgr::instance(), and isc::dhcp::HostMgr::instance().
isc::host_cmds::HostCmdsImpl::~HostCmdsImpl | ( | ) |
Destructor.
Definition at line 340 of file host_cmds.cc.
int isc::host_cmds::HostCmdsImpl::reservationAddHandler | ( | CalloutHandle & | handle | ) |
reservation-add command handler
Provides the implementation for isc::host_cmds::HostCmds::reservationAddHandler
handle | Callout context - which is expected to contain the add command JSON text in the "command" argument |
Definition at line 345 of file host_cmds.cc.
References isc::dhcp::HostMgr::add(), isc::dhcp::ALTERNATE_SOURCES, isc::config::CmdsImpl::cmd_args_, isc::config::CmdsImpl::extractCommand(), isc::dhcp::HostMgr::getHostDataSource(), isc::host_cmds::host_cmds_logger, HOST_CMDS_RESERV_ADD, HOST_CMDS_RESERV_ADD_FAILED, HOST_CMDS_RESERV_ADD_SUCCESS, isc::dhcp::HostMgr::instance(), isc_throw, LOG_ERROR, LOG_INFO, isc::host_cmds::HostDataParser< ParserBase >::parseWithSubnet(), isc::config::CmdsImpl::setErrorResponse(), isc::config::CmdsImpl::setSuccessResponse(), isc::dhcp::IPv6Resrv::TYPE_NA, and isc::dhcp::UNSPECIFIED_SOURCE.
int isc::host_cmds::HostCmdsImpl::reservationDelHandler | ( | CalloutHandle & | handle | ) |
reservation-del command handler
Provides the implementation for isc::host_cmds::HostCmds::reservationDelHandler
handle | Callout context - which is expected to contain the delete command JSON text in the "command" argument |
Definition at line 864 of file host_cmds.cc.
References isc::host_cmds::HostCmdsImpl::Parameters::addr, isc::dhcp::ALTERNATE_SOURCES, isc::config::CmdsImpl::cmd_args_, isc::config::CONTROL_RESULT_EMPTY, isc::dhcp::HostMgr::del(), isc::dhcp::HostMgr::del4(), isc::dhcp::HostMgr::del6(), isc::config::CmdsImpl::extractCommand(), isc::host_cmds::host_cmds_logger, HOST_CMDS_RESERV_DEL, HOST_CMDS_RESERV_DEL_FAILED, HOST_CMDS_RESERV_DEL_SUCCESS, isc::host_cmds::HostCmdsImpl::Parameters::ident, isc::dhcp::HostMgr::instance(), LOG_ERROR, LOG_INFO, isc::host_cmds::HostCmdsImpl::Parameters::operation_target, isc::host_cmds::HostCmdsImpl::Parameters::query_by_addr, isc::config::CmdsImpl::setErrorResponse(), isc::config::CmdsImpl::setSuccessResponse(), isc::host_cmds::HostCmdsImpl::Parameters::subnet_id, isc::host_cmds::HostCmdsImpl::Parameters::type, and isc::dhcp::UNSPECIFIED_SOURCE.
int isc::host_cmds::HostCmdsImpl::reservationGetAllHandler | ( | CalloutHandle & | handle | ) |
reservation-get-all command handler
Provides the implementation for isc::host_cmds::HostCmds::reservationGetAllHandler
handle | Callout context - which is expected to contain the reservation-get-all command JSON text in the "command" argument |
Definition at line 1107 of file host_cmds.cc.
References isc::dhcp::ALL_SOURCES, isc::config::CmdsImpl::cmd_args_, isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_SUCCESS, Element::create(), isc::config::createAnswer(), Element::createList(), Element::createMap(), isc::config::CmdsImpl::extractCommand(), isc::dhcp::HostMgr::getAll4(), isc::dhcp::HostMgr::getAll6(), isc::host_cmds::host_cmds_logger, HOST_CMDS_RESERV_GET_ALL, HOST_CMDS_RESERV_GET_ALL_FAILED, HOST_CMDS_RESERV_GET_ALL_SUCCESS, isc::dhcp::HostMgr::instance(), isc::asiolink::IOAddress::IPV4_ZERO_ADDRESS(), LOG_ERROR, LOG_INFO, isc::host_cmds::HostCmdsImpl::Parameters::operation_target, isc::config::CmdsImpl::setErrorResponse(), isc::config::CmdsImpl::setResponse(), isc::host_cmds::HostCmdsImpl::Parameters::subnet_id, and isc::dhcp::UNSPECIFIED_SOURCE.
int isc::host_cmds::HostCmdsImpl::reservationGetByAddressHandler | ( | CalloutHandle & | handle | ) |
reservation-get-by-address command handler
Provides the implementation for isc::host_cmds::HostCmds::reservationGetByAddressHandler
handle | Callout context - which is expected to contain the get command JSON text in the "command" argument |
Definition at line 773 of file host_cmds.cc.
References isc::host_cmds::HostCmdsImpl::Parameters::addr, isc::dhcp::ALL_SOURCES, isc::config::CmdsImpl::cmd_args_, isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_SUCCESS, Element::create(), isc::config::createAnswer(), Element::createList(), Element::createMap(), isc::config::CmdsImpl::extractCommand(), isc::dhcp::HostMgr::getAll4(), isc::dhcp::HostMgr::getAll6(), isc::host_cmds::HostCmdsImpl::Parameters::has_subnet_id, isc::host_cmds::host_cmds_logger, HOST_CMDS_RESERV_GET_BY_ADDRESS, HOST_CMDS_RESERV_GET_BY_ADDRESS_FAILED, HOST_CMDS_RESERV_GET_BY_ADDRESS_SUCCESS, isc::dhcp::HostMgr::instance(), isc::asiolink::IOAddress::IPV4_ZERO_ADDRESS(), LOG_ERROR, LOG_INFO, isc::host_cmds::HostCmdsImpl::Parameters::operation_target, isc::config::CmdsImpl::setErrorResponse(), isc::config::CmdsImpl::setResponse(), isc::host_cmds::HostCmdsImpl::Parameters::subnet_id, and isc::dhcp::UNSPECIFIED_SOURCE.
int isc::host_cmds::HostCmdsImpl::reservationGetByHostnameHandler | ( | CalloutHandle & | handle | ) |
reservation-get-by-hostname command handler
Provides the implementation for isc::host_cmds::HostCmds::reservationGetByHostnameHandler
handle | Callout context - which is expected to contain the reservation-get-by-hostname command JSON text in the "command" argument |
Definition at line 1271 of file host_cmds.cc.
References isc::dhcp::ALL_SOURCES, isc::config::CmdsImpl::cmd_args_, isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_SUCCESS, Element::create(), isc::config::createAnswer(), Element::createList(), Element::createMap(), isc::config::CmdsImpl::extractCommand(), isc::dhcp::HostMgr::getAllbyHostname(), isc::dhcp::HostMgr::getAllbyHostname4(), isc::dhcp::HostMgr::getAllbyHostname6(), isc::host_cmds::HostCmdsImpl::Parameters::has_subnet_id, isc::host_cmds::host_cmds_logger, HOST_CMDS_RESERV_GET_BY_HOSTNAME, HOST_CMDS_RESERV_GET_BY_HOSTNAME_FAILED, HOST_CMDS_RESERV_GET_BY_HOSTNAME_SUCCESS, isc::host_cmds::HostCmdsImpl::Parameters::hostname, isc::dhcp::HostMgr::instance(), isc::asiolink::IOAddress::IPV4_ZERO_ADDRESS(), isc_throw, LOG_ERROR, LOG_INFO, isc::host_cmds::HostCmdsImpl::Parameters::operation_target, isc::config::CmdsImpl::setErrorResponse(), isc::config::CmdsImpl::setResponse(), isc::host_cmds::HostCmdsImpl::Parameters::subnet_id, and isc::dhcp::UNSPECIFIED_SOURCE.
int isc::host_cmds::HostCmdsImpl::reservationGetByIdHandler | ( | CalloutHandle & | handle | ) |
reservation-get-by-id command handler
Provides the implementation for isc::host_cmds::HostCmds::reservationGetByIdHandler
handle | Callout context - which is expected to contain the reservation-get-by-id command JSON text in the "command" argument |
Definition at line 1363 of file host_cmds.cc.
References isc::dhcp::ALL_SOURCES, isc::config::CmdsImpl::cmd_args_, isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_SUCCESS, Element::create(), isc::config::createAnswer(), Element::createList(), Element::createMap(), isc::config::CmdsImpl::extractCommand(), isc::dhcp::HostMgr::getAll(), isc::host_cmds::host_cmds_logger, HOST_CMDS_RESERV_GET_BY_ID, HOST_CMDS_RESERV_GET_BY_ID_FAILED, HOST_CMDS_RESERV_GET_BY_ID_SUCCESS, isc::host_cmds::HostCmdsImpl::Parameters::ident, isc::dhcp::HostMgr::instance(), LOG_ERROR, LOG_INFO, isc::host_cmds::HostCmdsImpl::Parameters::operation_target, isc::config::CmdsImpl::setErrorResponse(), isc::config::CmdsImpl::setResponse(), isc::host_cmds::HostCmdsImpl::Parameters::type, and isc::dhcp::UNSPECIFIED_SOURCE.
int isc::host_cmds::HostCmdsImpl::reservationGetHandler | ( | CalloutHandle & | handle | ) |
reservation-get command handler
Provides the implementation for isc::host_cmds::HostCmds::reservationGetHandler
handle | Callout context - which is expected to contain the get command JSON text in the "command" argument |
Definition at line 702 of file host_cmds.cc.
References isc::host_cmds::HostCmdsImpl::Parameters::addr, isc::dhcp::ALL_SOURCES, isc::config::CmdsImpl::cmd_args_, isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_SUCCESS, Element::create(), isc::config::createAnswer(), isc::config::CmdsImpl::extractCommand(), isc::dhcp::HostMgr::get4(), isc::dhcp::HostMgr::get6(), isc::host_cmds::host_cmds_logger, HOST_CMDS_RESERV_GET, HOST_CMDS_RESERV_GET_FAILED, HOST_CMDS_RESERV_GET_SUCCESS, isc::host_cmds::HostCmdsImpl::Parameters::ident, isc::dhcp::HostMgr::instance(), isc::asiolink::IOAddress::isV4(), LOG_ERROR, LOG_INFO, isc::host_cmds::HostCmdsImpl::Parameters::operation_target, isc::host_cmds::HostCmdsImpl::Parameters::query_by_addr, isc::config::CmdsImpl::setErrorResponse(), isc::config::CmdsImpl::setResponse(), isc::host_cmds::HostCmdsImpl::Parameters::subnet_id, isc::host_cmds::HostCmdsImpl::Parameters::type, and isc::dhcp::UNSPECIFIED_SOURCE.
int isc::host_cmds::HostCmdsImpl::reservationGetPageHandler | ( | CalloutHandle & | handle | ) |
reservation-get-page command handler
Provides the implementation for isc::host_cmds::HostCmds::reservationGetPageHandler
handle | Callout context - which is expected to contain the reservation-get-page command JSON text in the "command" argument |
Definition at line 1175 of file host_cmds.cc.
References isc::config::CmdsImpl::cmd_args_, isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_SUCCESS, Element::create(), isc::config::createAnswer(), Element::createList(), Element::createMap(), isc::config::CmdsImpl::extractCommand(), isc::dhcp::HostMgr::getPage4(), isc::dhcp::HostMgr::getPage6(), isc::host_cmds::HostCmdsImpl::Parameters::has_subnet_id, isc::host_cmds::host_cmds_logger, HOST_CMDS_RESERV_GET_PAGE, HOST_CMDS_RESERV_GET_PAGE_FAILED, HOST_CMDS_RESERV_GET_PAGE_SUCCESS, isc::host_cmds::HostCmdsImpl::Parameters::host_id, isc::dhcp::HostMgr::instance(), isc::asiolink::IOAddress::IPV4_ZERO_ADDRESS(), LOG_ERROR, LOG_INFO, isc::host_cmds::HostCmdsImpl::Parameters::page_limit, isc::config::CmdsImpl::setErrorResponse(), isc::config::CmdsImpl::setResponse(), isc::host_cmds::HostCmdsImpl::Parameters::source_index, and isc::host_cmds::HostCmdsImpl::Parameters::subnet_id.
int isc::host_cmds::HostCmdsImpl::reservationUpdateHandler | ( | CalloutHandle & | handle | ) |
reservation-update command handler
Provides the implementation for isc::host_cmds::HostCmds::reservationUpdateHandler.
handle | callout context |
Definition at line 1431 of file host_cmds.cc.
References isc::dhcp::ALTERNATE_SOURCES, isc::config::CmdsImpl::cmd_args_, isc::config::CONTROL_ARGUMENTS, isc::config::CmdsImpl::extractCommand(), isc::dhcp::HostMgr::getHostDataSource(), isc::host_cmds::host_cmds_logger, HOST_CMDS_RESERV_UPDATE, HOST_CMDS_RESERV_UPDATE_FAILED, HOST_CMDS_RESERV_UPDATE_SUCCESS, isc::dhcp::HostMgr::instance(), isc_throw, LOG_ERROR, LOG_INFO, Element::map, isc::host_cmds::HostDataParser< ParserBase >::parseWithSubnet(), isc::config::CmdsImpl::setErrorResponse(), isc::config::CmdsImpl::setSuccessResponse(), isc::dhcp::IPv6Resrv::TYPE_NA, Element::typeToName(), isc::dhcp::UNSPECIFIED_SOURCE, and isc::dhcp::HostMgr::update().