![]() |
Kea 3.1.1
|
Provides control flow for processing a bulk query. More...
#include <bulk_lease_query6.h>
Public Member Functions | |
BulkLeaseQuery6 (BlqQueryPtr query, const BlqPostCb &post, const BlqPushToSendCb &push_to_send, const BlqQueryCompleteCb &query_complete) | |
Constructor. | |
virtual | ~BulkLeaseQuery6 () |
Destructor. | |
const asiolink::IOAddress & | getLinkAddress () const |
Get the link address. | |
size_t | getPageSize () const |
Get the page size. | |
dhcp::Pkt6Ptr | getQuery6 () const |
Get the DHCPv6 query. | |
asiolink::IOAddress | getStartAddress () const |
Get the current start address. | |
virtual void | init () |
Initialization. | |
const dhcp::SubnetIDSet & | links () const |
Get the links set. | |
virtual void | start () |
Start processing. | |
![]() | |
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 void | processStart (BulkLeaseQueryPtr ptr) |
Class/static start processing. | |
Protected Member Functions | |
void | bulkQueryByClientId () |
Start processing of a by client id bulk query. | |
void | bulkQueryByIpAddress () |
Start processing of a by ip address bulk query. | |
void | bulkQueryByLinkAddress () |
Start processing of a by link address bulk query. | |
void | bulkQueryByLinkAddressNext () |
Subsequent processing of a by link address bulk query. | |
void | bulkQueryByRelayId () |
Start processing of a by relay id bulk query. | |
void | bulkQueryByRelayIdNext () |
Subsequent processing of a by relay id bulk query. | |
void | bulkQueryByRemoteId () |
Start processing of a by remote id bulk query. | |
void | bulkQueryByRemoteIdNext () |
Subsequent processing of a by remote id bulk query. | |
dhcp::OptionCustomPtr | getLeaseQueryOption () const |
Get the lease query option. | |
dhcp::DuidPtr | getQueryClientId () const |
Get the query client id for a by client id bulk query. | |
dhcp::Option6IAAddrPtr | getQueryIpAddress () const |
Get the query ip address for a by ip address bulk query. | |
dhcp::DuidPtr | 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::Pkt6Ptr response) const |
Send a response. | |
virtual void | sendReply (dhcp::OptionPtr status) |
Send a final reply. | |
![]() | |
virtual void | setDone () |
Set the done flag. | |
Static Protected Member Functions | |
static void | doBulkQueryByLinkAddressNext (BulkLeaseQuery6Ptr ptr) |
Class/static subsequent processing of a by link address bulk query. | |
static void | doBulkQueryByRelayIdNext (BulkLeaseQuery6Ptr ptr) |
Class/static subsequent processing of a by relay id bulk query. | |
static void | doBulkQueryByRemoteIdNext (BulkLeaseQuery6Ptr ptr) |
Class/static subsequent processing of a by remote id bulk query. | |
Protected Attributes | |
asiolink::IOAddress | link_addr_ |
The link address. | |
dhcp::SubnetIDSet | links_ |
The links the link address (when not ::) belongs to. | |
dhcp::OptionCustomPtr | lq_option_ |
The lease query option. | |
size_t | page_size_ |
The page size (for paged processing, taken from the MT Lease query manager or defaults to 10). | |
dhcp::Pkt6Ptr | query6_ |
The DHCPv6 query. | |
dhcp::DuidPtr | query_client_id_ |
The query client id (for a by client id bulk query). | |
dhcp::Option6IAAddrPtr | query_iaaddr_ |
The query ip address (for a by ip address bulk query). | |
dhcp::DuidPtr | 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). | |
asiolink::IOAddress | start_addr_ |
The start address (for paged processing). | |
![]() | |
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. | |
Provides control flow for processing a bulk query.
Definition at line 28 of file bulk_lease_query6.h.
|
inline |
Constructor.
query | The query. |
post | The post callback. |
push_to_send | The pushToSend callback. |
query_complete | The queryComplete callback. |
BadValue | if the query is invalid for a number reasons. |
Definition at line 38 of file bulk_lease_query6.h.
References isc::lease_query::BulkLeaseQuery::BulkLeaseQuery(), init(), link_addr_, links_, lq_option_, page_size_, query6_, query_client_id_, query_iaaddr_, query_relay_id_, query_remote_id_, and start_addr_.
|
inlinevirtual |
Destructor.
Definition at line 53 of file bulk_lease_query6.h.
|
protected |
Start processing of a by client id bulk query.
Definition at line 230 of file bulk_lease_query6.cc.
References isc::lease_query::LeaseQueryImpl6::initData(), isc::lease_query::LeaseQueryImpl6::initDone(), isc::lease_query::LeaseQueryImpl6::initReply(), isc_throw, link_addr_, isc::lease_query::LeaseQueryImpl6::makeClientOption(), query6_, query_client_id_, isc::lease_query::LeaseQueryImpl6::queryByClientId(), send(), sendReply(), and isc::lease_query::BulkLeaseQuery::setDone().
Referenced by start().
|
protected |
Start processing of a by ip address bulk query.
Definition at line 193 of file bulk_lease_query6.cc.
References isc::lease_query::LeaseQueryImplFactory::getImpl(), isc::lease_query::LeaseQueryImpl6::getPrefixLengthList(), isc::lease_query::LeaseQueryImpl6::initDone(), isc::lease_query::LeaseQueryImpl6::initReply(), isc_throw, isc::lease_query::LeaseQueryImpl6::makeClientOption(), query6_, query_iaaddr_, isc::lease_query::LeaseQueryImpl6::queryByIpAddress(), send(), sendReply(), and isc::lease_query::BulkLeaseQuery::setDone().
Referenced by start().
|
protected |
Start processing of a by link address bulk query.
Definition at line 454 of file bulk_lease_query6.cc.
References doBulkQueryByLinkAddressNext(), isc::lease_query::LeaseQueryImpl6::initData(), isc::lease_query::LeaseQueryImpl6::initReply(), isc::dhcp::LeaseMgrFactory::instance(), link_addr_, links_, isc::lease_query::LeaseQueryImpl6::makeClientOption(), isc::lease_query::LeaseQueryImpl6::makeStatusOption(), page_size_, isc::lease_query::BulkLeaseQuery::post_, query6_, isc::lease_query::LeaseQueryImpl6::queryByLinkStart(), send(), sendReply(), start_addr_, and STATUS_NotAllowed.
Referenced by start().
|
protected |
Subsequent processing of a by link address bulk query.
Definition at line 504 of file bulk_lease_query6.cc.
References doBulkQueryByLinkAddressNext(), isc::lease_query::LeaseQueryImpl6::initData(), isc::lease_query::LeaseQueryImpl6::initDone(), links_, isc::lease_query::LeaseQueryImpl6::makeClientOption(), page_size_, isc::lease_query::BulkLeaseQuery::post_, query6_, isc::lease_query::LeaseQueryImpl6::queryByLinkNext(), send(), isc::lease_query::BulkLeaseQuery::setDone(), and start_addr_.
|
protected |
Start processing of a by relay id bulk query.
Definition at line 277 of file bulk_lease_query6.cc.
References doBulkQueryByRelayIdNext(), isc::lease_query::LeaseQueryImpl6::initData(), isc::lease_query::LeaseQueryImpl6::initReply(), isc::dhcp::LeaseMgrFactory::instance(), isc_throw, link_addr_, links_, isc::lease_query::LeaseQueryImpl6::makeClientOption(), isc::lease_query::LeaseQueryImpl6::makeStatusOption(), page_size_, isc::lease_query::BulkLeaseQuery::post_, query6_, query_relay_id_, isc::lease_query::LeaseQueryImpl6::queryByRelayIdStart(), send(), sendReply(), start_addr_, and STATUS_NotAllowed.
Referenced by start().
|
protected |
Subsequent processing of a by relay id bulk query.
Definition at line 329 of file bulk_lease_query6.cc.
References doBulkQueryByRelayIdNext(), isc::lease_query::LeaseQueryImpl6::initData(), isc::lease_query::LeaseQueryImpl6::initDone(), isc_throw, links_, isc::lease_query::LeaseQueryImpl6::makeClientOption(), page_size_, isc::lease_query::BulkLeaseQuery::post_, query6_, query_relay_id_, isc::lease_query::LeaseQueryImpl6::queryByRelayIdNext(), send(), isc::lease_query::BulkLeaseQuery::setDone(), and start_addr_.
|
protected |
Start processing of a by remote id bulk query.
Definition at line 365 of file bulk_lease_query6.cc.
References doBulkQueryByRemoteIdNext(), isc::lease_query::LeaseQueryImpl6::initData(), isc::lease_query::LeaseQueryImpl6::initReply(), isc::dhcp::LeaseMgrFactory::instance(), isc_throw, link_addr_, links_, isc::lease_query::LeaseQueryImpl6::makeClientOption(), isc::lease_query::LeaseQueryImpl6::makeStatusOption(), page_size_, isc::lease_query::BulkLeaseQuery::post_, query6_, query_remote_id_, isc::lease_query::LeaseQueryImpl6::queryByRemoteIdStart(), send(), sendReply(), start_addr_, and STATUS_NotAllowed.
Referenced by start().
|
protected |
Subsequent processing of a by remote id bulk query.
Definition at line 418 of file bulk_lease_query6.cc.
References doBulkQueryByRemoteIdNext(), isc::lease_query::LeaseQueryImpl6::initData(), isc::lease_query::LeaseQueryImpl6::initDone(), isc_throw, links_, isc::lease_query::LeaseQueryImpl6::makeClientOption(), page_size_, isc::lease_query::BulkLeaseQuery::post_, query6_, query_remote_id_, isc::lease_query::LeaseQueryImpl6::queryByRemoteIdNext(), send(), isc::lease_query::BulkLeaseQuery::setDone(), and start_addr_.
|
inlinestaticprotected |
Class/static subsequent processing of a by link address bulk query.
ptr | Pointer to a BulkLeaseQuery6 object (must not be null). |
Definition at line 146 of file bulk_lease_query6.h.
Referenced by bulkQueryByLinkAddress(), and bulkQueryByLinkAddressNext().
|
inlinestaticprotected |
Class/static subsequent processing of a by relay id bulk query.
ptr | Pointer to a BulkLeaseQuery6 object (must not be null). |
Definition at line 118 of file bulk_lease_query6.h.
Referenced by bulkQueryByRelayId(), and bulkQueryByRelayIdNext().
|
inlinestaticprotected |
Class/static subsequent processing of a by remote id bulk query.
ptr | Pointer to a BulkLeaseQuery6 object (must not be null). |
Definition at line 132 of file bulk_lease_query6.h.
Referenced by bulkQueryByRemoteId(), and bulkQueryByRemoteIdNext().
|
inlineprotected |
Get the lease query option.
Definition at line 165 of file bulk_lease_query6.h.
References lq_option_.
|
inline |
|
inline |
|
inline |
|
inlineprotected |
Get the query client id for a by client id bulk query.
Definition at line 179 of file bulk_lease_query6.h.
References query_client_id_.
|
inlineprotected |
Get the query ip address for a by ip address bulk query.
Definition at line 172 of file bulk_lease_query6.h.
References query_iaaddr_.
|
inlineprotected |
Get the query relay id for a by relay id bulk query.
Definition at line 186 of file bulk_lease_query6.h.
References query_relay_id_.
|
inlineprotected |
Get the query remote id for a by remote id bulk query.
Definition at line 193 of file bulk_lease_query6.h.
References query_remote_id_.
|
inline |
Get the current start address.
Definition at line 87 of file bulk_lease_query6.h.
References start_addr_.
|
virtual |
Initialization.
Check the query and fill processing context fields.
BadValue | if the query is invalid for a number reasons. |
Implements isc::lease_query::BulkLeaseQuery.
Definition at line 48 of file bulk_lease_query6.cc.
References D6O_CLIENTID, D6O_IAADDR, D6O_LQ_QUERY, D6O_RELAY_ID, D6O_REMOTE_ID, isc::lease_query::BulkLeaseQueryService::instance(), isc_throw, link_addr_, LQ6QT_BY_ADDRESS, LQ6QT_BY_CLIENTID, LQ6QT_BY_LINK_ADDRESS, LQ6QT_BY_RELAY_ID, LQ6QT_BY_REMOTE_ID, lq_option_, isc::lease_query::LeaseQueryImpl6::makeStatusOption(), page_size_, query6_, isc::lease_query::BulkLeaseQuery::query_, query_client_id_, query_iaaddr_, query_relay_id_, query_remote_id_, isc::lease_query::BulkLeaseQuery::query_type_, sendReply(), STATUS_MalformedQuery, STATUS_UnknownQueryType, and isc::lease_query::LeaseQueryImpl6::testServerId().
Referenced by BulkLeaseQuery6().
|
static |
Convenience method for generating per packet logging info.
msg | Lease query message. |
Definition at line 39 of file bulk_lease_query6.cc.
References isc::lease_query::LeaseQueryImpl6::leaseQueryLabel().
Referenced by isc::lease_query::LeaseQueryConnection::popPendingQuery(), isc::lease_query::LeaseQueryConnection::requestReceived(), isc::lease_query::LeaseQueryConnection::sendNextResponse(), and isc::lease_query::LeaseQueryConnection::startQuery().
|
inline |
|
protectedvirtual |
Send a response.
response | The response packet. |
Definition at line 536 of file bulk_lease_query6.cc.
References CHECK_TERMINATED, isc_throw, and isc::lease_query::BulkLeaseQuery::push_to_send_.
Referenced by bulkQueryByClientId(), bulkQueryByIpAddress(), bulkQueryByLinkAddress(), bulkQueryByLinkAddressNext(), bulkQueryByRelayId(), bulkQueryByRelayIdNext(), bulkQueryByRemoteId(), bulkQueryByRemoteIdNext(), and sendReply().
|
protectedvirtual |
Send a final reply.
status | The status code option. |
Definition at line 545 of file bulk_lease_query6.cc.
References isc::lease_query::LeaseQueryImpl6::initReply(), query6_, send(), and isc::lease_query::BulkLeaseQuery::setDone().
Referenced by bulkQueryByClientId(), bulkQueryByIpAddress(), bulkQueryByLinkAddress(), bulkQueryByRelayId(), bulkQueryByRemoteId(), and init().
|
virtual |
Start processing.
Implements isc::lease_query::BulkLeaseQuery.
Definition at line 165 of file bulk_lease_query6.cc.
References bulkQueryByClientId(), bulkQueryByIpAddress(), bulkQueryByLinkAddress(), bulkQueryByRelayId(), bulkQueryByRemoteId(), isc_throw, LQ6QT_BY_ADDRESS, LQ6QT_BY_CLIENTID, LQ6QT_BY_LINK_ADDRESS, LQ6QT_BY_RELAY_ID, LQ6QT_BY_REMOTE_ID, isc::lease_query::BulkLeaseQuery::query_type_, and isc::lease_query::BulkLeaseQuery::started_.
|
protected |
The link address.
Definition at line 201 of file bulk_lease_query6.h.
Referenced by BulkLeaseQuery6(), bulkQueryByClientId(), bulkQueryByLinkAddress(), bulkQueryByRelayId(), bulkQueryByRemoteId(), getLinkAddress(), and init().
|
protected |
The links the link address (when not ::) belongs to.
Definition at line 204 of file bulk_lease_query6.h.
Referenced by BulkLeaseQuery6(), bulkQueryByLinkAddress(), bulkQueryByLinkAddressNext(), bulkQueryByRelayId(), bulkQueryByRelayIdNext(), bulkQueryByRemoteId(), bulkQueryByRemoteIdNext(), and links().
|
protected |
The lease query option.
Definition at line 214 of file bulk_lease_query6.h.
Referenced by BulkLeaseQuery6(), getLeaseQueryOption(), and init().
|
protected |
The page size (for paged processing, taken from the MT Lease query manager or defaults to 10).
Definition at line 211 of file bulk_lease_query6.h.
Referenced by BulkLeaseQuery6(), bulkQueryByLinkAddress(), bulkQueryByLinkAddressNext(), bulkQueryByRelayId(), bulkQueryByRelayIdNext(), bulkQueryByRemoteId(), bulkQueryByRemoteIdNext(), getPageSize(), and init().
|
protected |
The DHCPv6 query.
Definition at line 198 of file bulk_lease_query6.h.
Referenced by BulkLeaseQuery6(), bulkQueryByClientId(), bulkQueryByIpAddress(), bulkQueryByLinkAddress(), bulkQueryByLinkAddressNext(), bulkQueryByRelayId(), bulkQueryByRelayIdNext(), bulkQueryByRemoteId(), bulkQueryByRemoteIdNext(), getQuery6(), init(), and sendReply().
|
protected |
The query client id (for a by client id bulk query).
Definition at line 220 of file bulk_lease_query6.h.
Referenced by BulkLeaseQuery6(), bulkQueryByClientId(), getQueryClientId(), and init().
|
protected |
The query ip address (for a by ip address bulk query).
Definition at line 217 of file bulk_lease_query6.h.
Referenced by BulkLeaseQuery6(), bulkQueryByIpAddress(), getQueryIpAddress(), and init().
|
protected |
The query relay id (for a by relay id bulk query).
Definition at line 223 of file bulk_lease_query6.h.
Referenced by BulkLeaseQuery6(), bulkQueryByRelayId(), bulkQueryByRelayIdNext(), getQueryRelayId(), and init().
|
protected |
The remote id (for a by remote id bulk query).
Definition at line 226 of file bulk_lease_query6.h.
Referenced by BulkLeaseQuery6(), bulkQueryByRemoteId(), bulkQueryByRemoteIdNext(), getQueryRemoteId(), and init().
|
protected |
The start address (for paged processing).
Definition at line 207 of file bulk_lease_query6.h.
Referenced by BulkLeaseQuery6(), bulkQueryByLinkAddress(), bulkQueryByLinkAddressNext(), bulkQueryByRelayId(), bulkQueryByRelayIdNext(), bulkQueryByRemoteId(), bulkQueryByRemoteIdNext(), and getStartAddress().