![]() |
Kea 3.1.1
|
#include <config.h>
#include <asiolink/io_service.h>
#include <asiolink/io_service_mgr.h>
#include <database/audit_entry.h>
#include <hooks/hooks.h>
#include <dhcpsrv/cfgmgr.h>
#include <lease_query_log.h>
#include <lease_query_impl_factory.h>
#include <blq_service.h>
#include <process/daemon.h>
#include <stats/stats_mgr.h>
#include <string>
#include <vector>
Go to the source code of this file.
Functions | |
int | buffer4_receive (CalloutHandle &handle) |
This callout is called at the "buffer4_receive" hook. | |
int | buffer6_receive (CalloutHandle &handle) |
This callout is called at the "buffer6_receive" hook. | |
int | cb6_updated (CalloutHandle &handle) |
This callout is called at the "cb6_updated" hook. | |
int | dhcp4_srv_configured (CalloutHandle &) |
dhcp4_srv_configured callout implementation. | |
int | dhcp6_srv_configured (CalloutHandle &handle) |
dhcp6_srv_configured callout implementation. | |
int | load (LibraryHandle &handle) |
This function is called when the library is loaded. | |
int | multi_threading_compatible () |
This function is called to retrieve the multi-threading compatibility. | |
int | unload () |
This function is called when the library is unloaded. | |
int buffer4_receive | ( | CalloutHandle & | handle | ) |
This callout is called at the "buffer4_receive" hook.
If the inbound packet hasn't been unpacked, it is unpacked. If it is anything other than DHCPLEASEQUERY we set the call status to NEXT_STEP_SKIP and return 0 to indicate success (i.e. we ignore the packet).
The query is passed into LeaseQueryImpl4::processQuery() which carries out all aspects of responding to it:
handle | CalloutHandle. |
Definition at line 101 of file lease_query_callouts.cc.
References isc::stats::StatsMgr::addValue(), isc::log::DBGLVL_TRACE_BASIC, isc::lease_query::DHCP4_LEASE_QUERY_PACKET_UNPACK_FAILED, isc::lease_query::DHCP4_LEASE_QUERY_PROCESS_FAILED, isc::lease_query::DHCP4_LEASE_QUERY_RECEIVED, isc::dhcp::DHCPLEASEQUERY, isc::hooks::CalloutHandle::getArgument(), isc::lease_query::LeaseQueryImplFactory::getImpl(), isc::hooks::CalloutHandle::getStatus(), isc::stats::StatsMgr::instance(), isc::lease_query::lease_query_logger, isc::lease_query::LeaseQueryImpl4::leaseQueryLabel(), LOG_DEBUG, CalloutHandle::NEXT_STEP_DROP, CalloutHandle::NEXT_STEP_SKIP, isc::lease_query::LeaseQueryImpl::processQuery(), and isc::hooks::CalloutHandle::setStatus().
int buffer6_receive | ( | CalloutHandle & | handle | ) |
This callout is called at the "buffer6_receive" hook.
If the inbound packet hasn't been unpacked, it is unpacked. If it is anything other than DHCPV6_LEASEQUERY we set the call status to NEXT_STEP_SKIP and return 0 to indicate success (i.e. we ignore the packet).
The query is passed into LeaseQueryImpl6::processQuery() which carries out all aspects of responding to it:
handle | CalloutHandle. |
Definition at line 183 of file lease_query_callouts.cc.
References isc::stats::StatsMgr::addValue(), isc::log::DBGLVL_TRACE_BASIC, isc::lease_query::DHCP6_LEASE_QUERY_PACKET_UNPACK_FAILED, isc::lease_query::DHCP6_LEASE_QUERY_PROCESS_FAILED, isc::lease_query::DHCP6_LEASE_QUERY_RECEIVED, DHCPV6_LEASEQUERY, isc::hooks::CalloutHandle::getArgument(), isc::lease_query::LeaseQueryImplFactory::getImpl(), isc::hooks::CalloutHandle::getStatus(), isc::stats::StatsMgr::instance(), isc::lease_query::lease_query_logger, isc::lease_query::LeaseQueryImpl6::leaseQueryLabel(), LOG_DEBUG, CalloutHandle::NEXT_STEP_DROP, CalloutHandle::NEXT_STEP_SKIP, isc::lease_query::LeaseQueryImpl::processQuery(), and isc::hooks::CalloutHandle::setStatus().
int cb6_updated | ( | CalloutHandle & | handle | ) |
This callout is called at the "cb6_updated" hook.
If it detects that any subnets were altered by the update it repopulates the prefix length list.
handle | CalloutHandle. |
Definition at line 348 of file lease_query_callouts.cc.
References isc::db::error, isc::hooks::CalloutHandle::getArgument(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::lease_query::LeaseQueryImplFactory::getImpl(), isc::dhcp::CfgMgr::instance(), and isc::hooks::CalloutHandle::setArgument().
int dhcp4_srv_configured | ( | CalloutHandle & | ) |
dhcp4_srv_configured callout implementation.
Starts the listener.
handle | callout handle. |
Definition at line 334 of file lease_query_callouts.cc.
References isc::lease_query::BulkLeaseQueryService::doStartListener(), isc::lease_query::LeaseQueryImpl::getIOService(), isc::lease_query::LeaseQueryImplFactory::getMutableImpl(), isc::asiolink::IOServiceMgr::instance(), and isc::asiolink::IOServiceMgr::registerIOService().
int dhcp6_srv_configured | ( | CalloutHandle & | handle | ) |
dhcp6_srv_configured callout implementation.
Starts the listener.
handle | callout handle. |
Definition at line 378 of file lease_query_callouts.cc.
References isc::lease_query::BulkLeaseQueryService::doStartListener(), isc::db::error, isc::hooks::CalloutHandle::getArgument(), isc::lease_query::LeaseQueryImplFactory::getImpl(), isc::lease_query::LeaseQueryImpl::getIOService(), isc::lease_query::LeaseQueryImplFactory::getMutableImpl(), isc::asiolink::IOServiceMgr::instance(), isc::hooks::CalloutHandle::NEXT_STEP_DROP, isc::asiolink::IOServiceMgr::registerIOService(), isc::hooks::CalloutHandle::setArgument(), and isc::hooks::CalloutHandle::setStatus().
int load | ( | LibraryHandle & | handle | ) |
This function is called when the library is loaded.
Reset lease-query related stats.
Definition at line 245 of file lease_query_callouts.cc.
References isc::lease_query::LeaseQueryImplFactory::createImpl(), isc::lease_query::LeaseQueryImplFactory::destroyImpl(), isc::dhcp::CfgMgr::getFamily(), isc::process::Daemon::getProcName(), isc::dhcp::CfgMgr::instance(), isc::stats::StatsMgr::instance(), isc_throw, isc::lease_query::LEASE_QUERY_LOAD_FAILED, isc::lease_query::LEASE_QUERY_LOAD_OK, isc::lease_query::lease_query_logger, LOG_ERROR, LOG_INFO, isc::hooks::LibraryHandle::registerCommandCallout(), isc::stats::StatsMgr::setValue(), and isc::lease_query::LeaseQueryImpl::terminated_.
int multi_threading_compatible | ( | ) |
This function is called to retrieve the multi-threading compatibility.
Definition at line 401 of file lease_query_callouts.cc.
int unload | ( | ) |
This function is called when the library is unloaded.
Remove lease-query stats.
Definition at line 301 of file lease_query_callouts.cc.
References isc::stats::StatsMgr::del(), isc::lease_query::LeaseQueryImplFactory::destroyImpl(), isc::lease_query::LeaseQueryImplFactory::getMutableImpl(), isc::asiolink::IOServiceMgr::instance(), isc::dhcp::CfgMgr::instance(), isc::stats::StatsMgr::instance(), isc::lease_query::lease_query_logger, isc::lease_query::LEASE_QUERY_UNLOAD_OK, LOG_INFO, isc::lease_query::BulkLeaseQueryService::reset(), isc::lease_query::LeaseQueryImpl::terminated_, and isc::asiolink::IOServiceMgr::unregisterIOService().