7#ifndef LEASE_QUERY_IMPL_H
8#define LEASE_QUERY_IMPL_H
17#include <boost/functional/hash.hpp>
18#include <unordered_set>
31#define CHECK_TERMINATED \
32 if (LeaseQueryImpl::terminated_) { \
33 isc_throw(isc::lease_query::QueryTerminated, "terminated"); \
43 : family_(family) { };
64 return (addresses_.size());
77 std::unordered_set<asiolink::IOAddress, boost::hash<asiolink::IOAddress> > addresses_;
101 return (address_list_.size());
121 return (address_list_.getFamily());
128 return (io_service_);
135 io_service_ = io_service;
This is a base class for exceptions thrown from the DNS library module.
Exception(const char *file, size_t line, const char *what)
Constructor for a given type for exceptions with file name and file line number.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
The IOAddress class represents an IP addresses (version agnostic)
Manages a unique list of IP addresses.
size_t size() const
Returns the number of addresses in the list.
bool contains(const isc::asiolink::IOAddress &address) const
Checks if an address is present in the list.
AddressList(uint16_t family)
Constructor.
uint16_t getFamily()
Returns the protocol family of the address list.
void insert(const isc::asiolink::IOAddress &address)
Inserts an address into the list.
virtual void processQuery(isc::dhcp::PktPtr base_query) const =0
Processes a single client Lease Query.
uint16_t getFamily()
Returns the protocol family of the impl.
static bool terminated_
Terminated flag.
LeaseQueryImpl(uint16_t family, const isc::data::ConstElementPtr config)
Constructor.
static const isc::data::SimpleKeywords LEASE_QUERY_KEYWORDS
Keywords for Lease Query configuration.
size_t getNumRequesters() const
Returns the number of valid requester.
isc::asiolink::IOServicePtr getIOService()
Get the hook I/O service.
bool isRequester(const isc::asiolink::IOAddress &address) const
Checks if the given address belongs to a valid requester.
void setIOService(isc::asiolink::IOServicePtr io_service)
Set the hook I/O service.
static size_t PageSize
Page size to commands.
virtual ~LeaseQueryImpl()
Destructor.
QueryTerminated(const char *file, size_t line, const char *what)
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
boost::shared_ptr< const Element > ConstElementPtr
std::map< std::string, isc::data::Element::types > SimpleKeywords
This specifies all accepted keywords with their types.
boost::shared_ptr< isc::dhcp::Pkt > PktPtr
A pointer to either Pkt4 or Pkt6 packet.
boost::shared_ptr< LeaseQueryImpl > LeaseQueryImplPtr
Defines a smart pointer to LeaseQueryImpl instance.
Defines the logger used by the top-level component of kea-lfc.