Kea: isc::lease_query::BulkLeaseQuery4 Class Reference

| Kea 3.2.0-git

isc::lease_query::BulkLeaseQuery4 Class Reference

Provides control flow for processing a bulk query. More...

`#include <bulk_lease_query4.h>`

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

## Public Member Functions
| BulkLeaseQuery4 (BlqQueryPtr query, const BlqPostCb &post, const BlqPushToSendCb &push_to_send, const BlqQueryCompleteCb &query_complete)
| Constructor.
virtual | ~BulkLeaseQuery4 ()
| Destructor.
size_t | getPageSize () const
| Get the page size.
dhcp::Pkt4Ptr | getQuery4 () const
| Get the DHCPv4 query.
asiolink::IOAddress | getStartAddress () const
| Get the current start address.
virtual void | init ()
| Initialization.
virtual void | start ()
| Start processing.
Public Member Functions inherited from isc::lease_query::BulkLeaseQuery
| BulkLeaseQuery (BlqQueryPtr query, const BlqPostCb &post, const BlqPushToSendCb &push_to_send, const BlqQueryCompleteCb &query_complete)
| Constructor.
virtual | ~BulkLeaseQuery ()
| Destructor.
BlqQueryPtr | getQuery ()
| Get the query.
uint8_t | getQueryType () const
| Get the query type.
Xid | getXid () const
| Get the transaction id of the query.
bool | isProcessed () const
| Processing finished predicate.
bool | isProcessing () const
| Processing in progress predicate.

## Static Public Member Functions
static std::string | leaseQueryLabel (const BlqMsgPtr &msg)
| Convenience method for generating per packet logging info.
Static Public Member Functions inherited from isc::lease_query::BulkLeaseQuery
static void | processStart (BulkLeaseQueryPtr ptr)
| Class/static start processing.

## Protected Member Functions
void | bulkQueryByClientId ()
| Start processing of a by client id bulk query.
void | bulkQueryByHWAddr ()
| Start processing of a by harware address bulk query.
void | bulkQueryByRelayId ()
| Start processing of a by relay id bulk query.
void | bulkQueryByRemoteId ()
| Start processing of a by remote id bulk query.
dhcp::OptionPtr | getQueryClientId () const
| Get the query client id for a by client id bulk query.
dhcp::HWAddrPtr | getQueryHWAddr () const
| Get the query hardware address for a by hardware address bulk query.
uint8_t | getQueryMask () const
| Get the query mask.
dhcp::OptionPtr | getQueryRelayId () const
| Get the query relay id for a by relay id bulk query.
dhcp::OptionPtr | getQueryRemoteId () const
| Get the query remote id for a by remote id bulk query.
virtual void | send (dhcp::Pkt4Ptr response)
| Send a response.
virtual void | sendActive (const dhcp::Lease4Ptr &lease)
| Send a DHCPLEASEACTIVE message.
virtual void | sendDone (BLQStatusCode status, const std::string &message="")
| Send a DHCPLEASEQUERYDONE message.
Protected Member Functions inherited from isc::lease_query::BulkLeaseQuery
virtual void | setDone ()
| Set the done flag.

## Static Protected Member Functions
static void | doBulkQueryByRelayId (BulkLeaseQuery4Ptr ptr)
| Class/static subsequent processing of a by relay id bulk query.
static void | doBulkQueryByRemoteId (BulkLeaseQuery4Ptr ptr)
| Class/static subsequent processing of a by remote id bulk query.

## Protected Attributes
size_t | page_size_
| The page size (for paged processing, taken from the MT Lease query manager or defaults to 10).
dhcp::Pkt4Ptr | query4_
| The DHCPv4 query.
dhcp::OptionPtr | query_client_id_
| The query client id (for a by client id bulk query).
time_t | query_end_time_
| The query end time.
dhcp::HWAddrPtr | query_hwaddr_
| The query hardware address (for a by hardware address bulk query).
uint8_t | query_mask_
| The query mask.
dhcp::OptionPtr | query_relay_id_
| The query relay id (for a by relay id bulk query).
dhcp::OptionPtr | query_remote_id_
| The remote id (for a by remote id bulk query).
time_t | query_start_time_
| The query start time.
size_t | sent_
| Sent response counter.
asiolink::IOAddress | start_addr_
| The start address (for paged processing).
Protected Attributes inherited from isc::lease_query::BulkLeaseQuery
bool | done_
| The processing finished.
BlqPostCb | post_
| The post callback.
BlqPushToSendCb | push_to_send_
| The pushToSend callback.
BlqQueryPtr | query_
| The query.
BlqQueryCompleteCb | query_complete_
| The queryComplete callback.
uint8_t | query_type_
| The query type.
bool | started_
| The processing is in progress.

## Detailed Description

Provides control flow for processing a bulk query.

Definition at line 59 of file bulk_lease_query4.h.

## Constructor & Destructor Documentation

## ◆ BulkLeaseQuery4()

isc::lease_query::BulkLeaseQuery4::BulkLeaseQuery4 | ( | BlqQueryPtr | query,
|  | const BlqPostCb & | post,
|  | const BlqPushToSendCb & | push_to_send,
|  | const BlqQueryCompleteCb & | query_complete )
| inline

Constructor.

Parameters

  query | The query.
  post | The post callback.
  push_to_send | The pushToSend callback.
  query_complete | The queryComplete callback.

Exceptions

  BadValue | if the query is invalid for a number reasons.

Definition at line 69 of file bulk_lease_query4.h.

References isc::lease_query::BulkLeaseQuery::BulkLeaseQuery(), init(), page_size_, query4_, query_client_id_, query_end_time_, query_hwaddr_, query_mask_, query_relay_id_, query_remote_id_, query_start_time_, sent_, and start_addr_.

Here is the call graph for this function:

## ◆ ~BulkLeaseQuery4()

virtual isc::lease_query::BulkLeaseQuery4::~BulkLeaseQuery4 | ( |  | ) |
| inlinevirtual

Destructor.

Definition at line 86 of file bulk_lease_query4.h.

## Member Function Documentation

## ◆ bulkQueryByClientId()

void BulkLeaseQuery4::bulkQueryByClientId | ( |  | ) |
| protected

Start processing of a by client id bulk query.

Definition at line 246 of file bulk_lease_query4.cc.

References isc::lease_query::BLQ_STATUS_Success, isc::dhcp::LeaseMgr::getLease4(), isc::dhcp::LeaseMgrFactory::instance(), isc_throw, query_client_id_, query_end_time_, query_start_time_, sendActive(), sendDone(), and isc::dhcp::Lease::STATE_DEFAULT.

Referenced by start().

Here is the call graph for this function:

## ◆ bulkQueryByHWAddr()

void BulkLeaseQuery4::bulkQueryByHWAddr | ( |  | ) |
| protected

Start processing of a by harware address bulk query.

Definition at line 283 of file bulk_lease_query4.cc.

References isc::lease_query::BLQ_STATUS_Success, isc::dhcp::LeaseMgr::getLease4(), isc::dhcp::LeaseMgrFactory::instance(), isc_throw, query_end_time_, query_hwaddr_, query_start_time_, sendActive(), sendDone(), and isc::dhcp::Lease::STATE_DEFAULT.

Referenced by start().

Here is the call graph for this function:

## ◆ bulkQueryByRelayId()

void BulkLeaseQuery4::bulkQueryByRelayId | ( |  | ) |
| protected

Start processing of a by relay id bulk query.

Definition at line 319 of file bulk_lease_query4.cc.

References isc::lease_query::BLQ_STATUS_Success, CHECK_TERMINATED, doBulkQueryByRelayId(), isc::dhcp::LeaseMgr::getLeases4ByRelayId(), isc::dhcp::LeaseMgrFactory::instance(), isc_throw, page_size_, isc::lease_query::BulkLeaseQuery::post_, query_end_time_, query_relay_id_, query_start_time_, sendActive(), sendDone(), start_addr_, and isc::dhcp::Lease::STATE_DEFAULT.

Referenced by start().

Here is the call graph for this function:

## ◆ bulkQueryByRemoteId()

void BulkLeaseQuery4::bulkQueryByRemoteId | ( |  | ) |
| protected

Start processing of a by remote id bulk query.

Definition at line 365 of file bulk_lease_query4.cc.

References isc::lease_query::BLQ_STATUS_Success, CHECK_TERMINATED, doBulkQueryByRemoteId(), isc::dhcp::LeaseMgr::getLeases4ByRemoteId(), isc::dhcp::LeaseMgrFactory::instance(), isc_throw, page_size_, isc::lease_query::BulkLeaseQuery::post_, query_end_time_, query_remote_id_, query_start_time_, sendActive(), sendDone(), start_addr_, and isc::dhcp::Lease::STATE_DEFAULT.

Referenced by start().

Here is the call graph for this function:

## ◆ doBulkQueryByRelayId()

void isc::lease_query::BulkLeaseQuery4::doBulkQueryByRelayId | ( | BulkLeaseQuery4Ptr | ptr | ) |
| inlinestaticprotected

Class/static subsequent processing of a by relay id bulk query.

Parameters

  ptr | Pointer to a BulkLeaseQuery4 object (must not be null).

Definition at line 135 of file bulk_lease_query4.h.

Referenced by bulkQueryByRelayId().

## ◆ doBulkQueryByRemoteId()

void isc::lease_query::BulkLeaseQuery4::doBulkQueryByRemoteId | ( | BulkLeaseQuery4Ptr | ptr | ) |
| inlinestaticprotected

Class/static subsequent processing of a by remote id bulk query.

Parameters

  ptr | Pointer to a BulkLeaseQuery4 object (must not be null).

Definition at line 146 of file bulk_lease_query4.h.

Referenced by bulkQueryByRemoteId().

## ◆ getPageSize()

size_t isc::lease_query::BulkLeaseQuery4::getPageSize | ( |  | ) | const
| inline

Get the page size.

Definition at line 115 of file bulk_lease_query4.h.

References page_size_.

## ◆ getQuery4()

dhcp::Pkt4Ptr isc::lease_query::BulkLeaseQuery4::getQuery4 | ( |  | ) | const
| inline

Get the DHCPv4 query.

Definition at line 105 of file bulk_lease_query4.h.

References query4_.

## ◆ getQueryClientId()

dhcp::OptionPtr isc::lease_query::BulkLeaseQuery4::getQueryClientId | ( |  | ) | const
| inlineprotected

Get the query client id for a by client id bulk query.

Returns
  The query client id for a by client id bulk query or null.

Definition at line 179 of file bulk_lease_query4.h.

References query_client_id_.

## ◆ getQueryHWAddr()

dhcp::HWAddrPtr isc::lease_query::BulkLeaseQuery4::getQueryHWAddr | ( |  | ) | const
| inlineprotected

Get the query hardware address for a by hardware address bulk query.

Returns
  The query client id for a by client id bulk query or null.

Definition at line 186 of file bulk_lease_query4.h.

References query_hwaddr_.

## ◆ getQueryMask()

uint8_t isc::lease_query::BulkLeaseQuery4::getQueryMask | ( |  | ) | const
| inlineprotected

Get the query mask.

Definition at line 172 of file bulk_lease_query4.h.

References query_mask_.

## ◆ getQueryRelayId()

dhcp::OptionPtr isc::lease_query::BulkLeaseQuery4::getQueryRelayId | ( |  | ) | const
| inlineprotected

Get the query relay id for a by relay id bulk query.

Returns
  The query relay id for a by relay id bulk query or null.

Definition at line 193 of file bulk_lease_query4.h.

References query_relay_id_.

## ◆ getQueryRemoteId()

dhcp::OptionPtr isc::lease_query::BulkLeaseQuery4::getQueryRemoteId | ( |  | ) | const
| inlineprotected

Get the query remote id for a by remote id bulk query.

Returns
  The remote id for a by remote id bulk query or null.

Definition at line 200 of file bulk_lease_query4.h.

References query_remote_id_.

## ◆ getStartAddress()

asiolink::IOAddress isc::lease_query::BulkLeaseQuery4::getStartAddress | ( |  | ) | const
| inline

Get the current start address.

Definition at line 110 of file bulk_lease_query4.h.

References start_addr_.

## ◆ init()

void BulkLeaseQuery4::init | ( |  | ) |
| virtual

Initialization.

Check the query and fill processing context fields.

Exceptions

  BadValue | if the query is invalid for a number reasons.

Implements isc::lease_query::BulkLeaseQuery.

Definition at line 86 of file bulk_lease_query4.cc.

References isc::lease_query::BLQ_STATUS_MalformedQuery, isc::lease_query::BLQ_STATUS_NotAllowed, isc::dhcp::DHO_DHCP_AGENT_OPTIONS, isc::dhcp::DHO_DHCP_CLIENT_IDENTIFIER, isc::dhcp::DHO_QUERY_END_TIME, isc::dhcp::DHO_QUERY_START_TIME, DHO_VSS, isc::lease_query::BulkLeaseQueryService::instance(), isc_throw, page_size_, query4_, isc::lease_query::BulkLeaseQuery::query_, query_client_id_, query_end_time_, query_hwaddr_, query_mask_, query_relay_id_, query_remote_id_, query_start_time_, isc::dhcp::RAI_OPTION_RELAY_ID, isc::dhcp::RAI_OPTION_REMOTE_ID, and sendDone().

Referenced by BulkLeaseQuery4().

Here is the call graph for this function:

## ◆ leaseQueryLabel()

std::string BulkLeaseQuery4::leaseQueryLabel | ( | const BlqMsgPtr & | msg | ) |
| static

Convenience method for generating per packet logging info.

Parameters

  msg | Lease query message.

Definition at line 77 of file bulk_lease_query4.cc.

References isc::lease_query::LeaseQueryImpl4::leaseQueryLabel().

Referenced by isc::lease_query::LeaseQueryConnection::startQuery().

Here is the call graph for this function:

## ◆ send()

void BulkLeaseQuery4::send | ( | dhcp::Pkt4Ptr | response | ) |
| protectedvirtual

Send a response.

Parameters

  response | The response packet.

Definition at line 411 of file bulk_lease_query4.cc.

References CHECK_TERMINATED, isc::dhcp::LibDHCP::DHO_DHCP_SERVER_IDENTIFIER_DEF(), isc::lease_query::BulkLeaseQueryService::instance(), isc_throw, isc::lease_query::BulkLeaseQuery::push_to_send_, sent_, and isc::dhcp::Option::V4.

Referenced by sendActive(), and sendDone().

Here is the call graph for this function:

## ◆ sendActive()

void BulkLeaseQuery4::sendActive | ( | const dhcp::Lease4Ptr & | lease | ) |
| protectedvirtual

Send a DHCPLEASEACTIVE message.

Parameters

  lease | The lease.

Definition at line 459 of file bulk_lease_query4.cc.

References isc::lease_query::LeaseQueryImpl4::addLeaseTimes(), isc::lease_query::LeaseQueryImpl4::addRelayAgentInfo(), isc::dhcp::DHCPLEASEACTIVE, isc::dhcp::DHO_BASE_TIME, isc::dhcp::DHO_DHCP_CLIENT_IDENTIFIER, isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::instance(), query4_, send(), and isc::dhcp::Option::V4.

Referenced by bulkQueryByClientId(), bulkQueryByHWAddr(), bulkQueryByRelayId(), and bulkQueryByRemoteId().

Here is the call graph for this function:

## ◆ sendDone()

void BulkLeaseQuery4::sendDone | ( | BLQStatusCode | status,
|  | const std::string & | message = "" )
| protectedvirtual

Send a DHCPLEASEQUERYDONE message.

Parameters

  status | The status code.
  message | The optional message.

Definition at line 435 of file bulk_lease_query4.cc.

References isc::lease_query::BLQ_STATUS_Success, isc::dhcp::DHCPLEASEQUERYDONE, isc::dhcp::LibDHCP::DHO_STATUS_CODE_DEF(), query4_, send(), isc::lease_query::BulkLeaseQuery::setDone(), and isc::dhcp::Option::V4.

Referenced by bulkQueryByClientId(), bulkQueryByHWAddr(), bulkQueryByRelayId(), bulkQueryByRemoteId(), and init().

Here is the call graph for this function:

## ◆ start()

void BulkLeaseQuery4::start | ( |  | ) |
| virtual

Start processing.

Implements isc::lease_query::BulkLeaseQuery.

Definition at line 217 of file bulk_lease_query4.cc.

References bulkQueryByClientId(), bulkQueryByHWAddr(), bulkQueryByRelayId(), bulkQueryByRemoteId(), isc_throw, query_mask_, and isc::lease_query::BulkLeaseQuery::started_.

Here is the call graph for this function:

## Member Data Documentation

## ◆ page_size_

size_t isc::lease_query::BulkLeaseQuery4::page_size_
| protected

The page size (for paged processing, taken from the MT Lease query manager or defaults to 10).

Definition at line 212 of file bulk_lease_query4.h.

Referenced by BulkLeaseQuery4(), bulkQueryByRelayId(), bulkQueryByRemoteId(), getPageSize(), and init().

## ◆ query4_

dhcp::Pkt4Ptr isc::lease_query::BulkLeaseQuery4::query4_
| protected

The DHCPv4 query.

Definition at line 205 of file bulk_lease_query4.h.

Referenced by BulkLeaseQuery4(), getQuery4(), init(), sendActive(), and sendDone().

## ◆ query_client_id_

dhcp::OptionPtr isc::lease_query::BulkLeaseQuery4::query_client_id_
| protected

The query client id (for a by client id bulk query).

Definition at line 223 of file bulk_lease_query4.h.

Referenced by BulkLeaseQuery4(), bulkQueryByClientId(), getQueryClientId(), and init().

## ◆ query_end_time_

time_t isc::lease_query::BulkLeaseQuery4::query_end_time_
| protected

The query end time.

Definition at line 238 of file bulk_lease_query4.h.

Referenced by BulkLeaseQuery4(), bulkQueryByClientId(), bulkQueryByHWAddr(), bulkQueryByRelayId(), bulkQueryByRemoteId(), and init().

## ◆ query_hwaddr_

dhcp::HWAddrPtr isc::lease_query::BulkLeaseQuery4::query_hwaddr_
| protected

The query hardware address (for a by hardware address bulk query).

Definition at line 226 of file bulk_lease_query4.h.

Referenced by BulkLeaseQuery4(), bulkQueryByHWAddr(), getQueryHWAddr(), and init().

## ◆ query_mask_

uint8_t isc::lease_query::BulkLeaseQuery4::query_mask_
| protected

The query mask.

1 - by client id 2 - by hardware address 4 - by relay id 8 - by remote id

Definition at line 220 of file bulk_lease_query4.h.

Referenced by BulkLeaseQuery4(), getQueryMask(), init(), and start().

## ◆ query_relay_id_

dhcp::OptionPtr isc::lease_query::BulkLeaseQuery4::query_relay_id_
| protected

The query relay id (for a by relay id bulk query).

Definition at line 229 of file bulk_lease_query4.h.

Referenced by BulkLeaseQuery4(), bulkQueryByRelayId(), getQueryRelayId(), and init().

## ◆ query_remote_id_

dhcp::OptionPtr isc::lease_query::BulkLeaseQuery4::query_remote_id_
| protected

The remote id (for a by remote id bulk query).

Definition at line 232 of file bulk_lease_query4.h.

Referenced by BulkLeaseQuery4(), bulkQueryByRemoteId(), getQueryRemoteId(), and init().

## ◆ query_start_time_

time_t isc::lease_query::BulkLeaseQuery4::query_start_time_
| protected

The query start time.

Definition at line 235 of file bulk_lease_query4.h.

Referenced by BulkLeaseQuery4(), bulkQueryByClientId(), bulkQueryByHWAddr(), bulkQueryByRelayId(), bulkQueryByRemoteId(), and init().

## ◆ sent_

size_t isc::lease_query::BulkLeaseQuery4::sent_
| protected

Sent response counter.

Definition at line 241 of file bulk_lease_query4.h.

Referenced by BulkLeaseQuery4(), and send().

## ◆ start_addr_

asiolink::IOAddress isc::lease_query::BulkLeaseQuery4::start_addr_
| protected

The start address (for paged processing).

Definition at line 208 of file bulk_lease_query4.h.

Referenced by BulkLeaseQuery4(), bulkQueryByRelayId(), bulkQueryByRemoteId(), and getStartAddress().

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

- bulk_lease_query4.h
- bulk_lease_query4.cc