Kea: isc::lease_query::LeaseQueryImpl Class Reference

| Kea 3.2.0-git

isc::lease_query::LeaseQueryImpl Class Referenceabstract

Provides configuration and control flow for processing queries. More...

`#include <lease_query_impl.h>`

Inheritance diagram for isc::lease_query::LeaseQueryImpl:
[legend]

## Public Member Functions
| LeaseQueryImpl (uint16_t family, const isc::data::ConstElementPtr config)
| Constructor.
virtual | ~LeaseQueryImpl ()
| Destructor.
uint16_t | getFamily ()
| Returns the protocol family of the impl.
isc::asiolink::IOServicePtr | getIOService ()
| Get the hook I/O service.
size_t | getNumRequesterPools () const
| Returns the number of valid requester pools.
size_t | getNumRequesters () const
| Returns the number of valid requester.
bool | isRequester (const isc::asiolink::IOAddress &address) const
| Checks if the given address belongs to a valid requester.
virtual void | processQuery (isc::dhcp::PktPtr base_query, bool &invalid) const =0
| Processes a single client Lease Query.
void | setIOService (isc::asiolink::IOServicePtr io_service)
| Set the hook I/O service.

## Static Public Attributes
static const isc::data::SimpleKeywords | LEASE_QUERY_KEYWORDS
| Keywords for Lease Query configuration.
static size_t | PageSize = 100
| Page size to commands.
static bool | terminated_ = false
| Terminated flag.

## Detailed Description

Provides configuration and control flow for processing queries.

Definition at line 159 of file lease_query_impl.h.

## Constructor & Destructor Documentation

## ◆ LeaseQueryImpl()

LeaseQueryImpl::LeaseQueryImpl | ( | uint16_t | family,
|  | const isc::data::ConstElementPtr | config )

Constructor.

Parameters

  family | protocol family we're handling (AF_INET or AF_INET6)
  config | input configuration

Definition at line 81 of file lease_query_impl.cc.

References isc::lease_query::BulkLeaseQueryService::create(), if(), and Element::map.

Referenced by isc::lease_query::LeaseQueryImpl4::LeaseQueryImpl4(), and isc::lease_query::LeaseQueryImpl6::LeaseQueryImpl6().

Here is the call graph for this function:

## ◆ ~LeaseQueryImpl()

LeaseQueryImpl::~LeaseQueryImpl | ( |  | ) |
| virtual

Destructor.

Definition at line 97 of file lease_query_impl.cc.

## Member Function Documentation

## ◆ getFamily()

uint16_t isc::lease_query::LeaseQueryImpl::getFamily | ( |  | ) |
| inline

Returns the protocol family of the impl.

Definition at line 206 of file lease_query_impl.h.

## ◆ getIOService()

isc::asiolink::IOServicePtr isc::lease_query::LeaseQueryImpl::getIOService | ( |  | ) |
| inline

Get the hook I/O service.

Returns
  the hook I/O service.

Definition at line 213 of file lease_query_impl.h.

Referenced by dhcp4_srv_configured(), and dhcp6_srv_configured().

## ◆ getNumRequesterPools()

size_t isc::lease_query::LeaseQueryImpl::getNumRequesterPools | ( |  | ) | const
| inline

Returns the number of valid requester pools.

Definition at line 183 of file lease_query_impl.h.

## ◆ getNumRequesters()

size_t isc::lease_query::LeaseQueryImpl::getNumRequesters | ( |  | ) | const
| inline

Returns the number of valid requester.

Definition at line 178 of file lease_query_impl.h.

## ◆ isRequester()

bool LeaseQueryImpl::isRequester | ( | const isc::asiolink::IOAddress & | address | ) | const

Checks if the given address belongs to a valid requester.

Parameters

  address | address to verify

Returns
  true if the address is in the list of requesters, false otherwise.

Definition at line 150 of file lease_query_impl.cc.

Referenced by isc::lease_query::LeaseQueryImpl4::processQuery(), and isc::lease_query::LeaseQueryImpl6::processQuery().

## ◆ processQuery()

virtual void isc::lease_query::LeaseQueryImpl::processQuery | ( | isc::dhcp::PktPtr | base_query,
|  | bool & | invalid ) const
| pure virtual

Processes a single client Lease Query.

- Validates query content
- Determines is the query is permitted
- Queries matching lease(s)
- Constructs the reply
- Sends the reply

Parameters

  base_query | lease query to process. (Implementations must use dynamic_casting).
  invalid | Reference to a flag set to true when the query is invalid (used to detect unexpected exceptions).

Implemented in isc::lease_query::LeaseQueryImpl4, and isc::lease_query::LeaseQueryImpl6.

Referenced by buffer4_receive(), and buffer6_receive().

## ◆ setIOService()

void isc::lease_query::LeaseQueryImpl::setIOService | ( | isc::asiolink::IOServicePtr | io_service | ) |
| inline

Set the hook I/O service.

Parameters

  io_service | the hook I/O service.

Definition at line 220 of file lease_query_impl.h.

## Member Data Documentation

## ◆ LEASE_QUERY_KEYWORDS

const SimpleKeywords LeaseQueryImpl::LEASE_QUERY_KEYWORDS
| static

Initial value:
=
{
{ "requesters", Element::list },
{ "advanced", Element::map },
{ "comment", Element::string },
{ "prefix-lengths", Element::list },
}
Element::map
@ map
Definition data.h:160
Element::list
@ list
Definition data.h:159
Element::string
@ string
Definition data.h:157

Keywords for Lease Query configuration.

Definition at line 203 of file lease_query_impl.h.

## ◆ PageSize

size_t LeaseQueryImpl::PageSize = 100
| static

Page size to commands.

Definition at line 228 of file lease_query_impl.h.

Referenced by isc::lease_query::BulkLeaseQueryService::AdvancedConfig::parse(), isc::lease_query::LeaseQueryImpl4::upgradeHandler(), and isc::lease_query::LeaseQueryImpl6::upgradeHandler().

## ◆ terminated_

bool LeaseQueryImpl::terminated_ = false
| static

Terminated flag.

Definition at line 225 of file lease_query_impl.h.

Referenced by isc::lease_query::BulkLeaseQueryService::acceptFilter(), load(), and unload().

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

- lease_query_impl.h
- lease_query_impl.cc