45 for (
auto const& name : names) {
115 }
catch (
const std::exception& ex) {
118 .arg(query->getRemoteAddr().toText())
119 .arg(query->getLocalAddr().toText())
120 .arg(query->getIface())
124 static_cast<int64_t
>(1));
126 static_cast<int64_t
>(1));
144 }
catch (
const std::exception& ex) {
152 static_cast<int64_t
>(1));
198 }
catch (
const std::exception& ex) {
201 .arg(query->getRemoteAddr().toText())
202 .arg(query->getLocalAddr().toText())
203 .arg(query->getIface())
207 static_cast<int64_t
>(1));
209 static_cast<int64_t
>(1));
227 }
catch (
const std::exception& ex) {
251 if (family == AF_INET) {
252 if (proc_name !=
"kea-dhcp4") {
254 <<
", expected kea-dhcp4");
258 static_cast<int64_t
>(0));
260 static_cast<int64_t
>(0));
262 static_cast<int64_t
>(0));
264 static_cast<int64_t
>(0));
266 extended_info4_upgrade);
268 if (proc_name !=
"kea-dhcp6") {
270 <<
", expected kea-dhcp6");
274 static_cast<int64_t
>(0));
276 static_cast<int64_t
>(0));
278 extended_info6_upgrade);
284 }
catch (
const std::exception& ex) {
351 handle.
getArgument(
"audit_entries", audit_entries);
354 auto range = object_type_idx.equal_range(
"dhcp6_subnet");
355 if (std::distance(range.first, range.second)) {
361 impl.populatePrefixLengthList(cfg);
362 }
catch (
const std::exception& ex) {
363 const string error(
"Error: populatePrefixLengthList() failed");
385 impl.populatePrefixLengthList(cfg);
386 }
catch (
const std::exception& ex) {
388 const string error(
"Error: populatePrefixLengthList() failed");
CalloutNextStep
Specifies allowed next steps.
@ NEXT_STEP_DROP
drop the packet
@ NEXT_STEP_SKIP
skip the next processing step
static ElementPtr createMap(const Position &pos=ZERO_POSITION())
Creates an empty MapElement type ElementPtr.
A generic exception that is thrown when an unexpected error condition occurs.
static IOServiceMgr & instance()
Access the IOServiceMgr singleton instance.
void registerIOService(IOServicePtr io_service)
Register IOService.
void unregisterIOService(IOServicePtr io_service)
Unregister IOService.
static void checkKeywords(const SimpleKeywords &keywords, isc::data::ConstElementPtr scope)
Checks acceptable keywords with their expected type.
uint16_t getFamily() const
Returns address family.
static CfgMgr & instance()
returns a single instance of Configuration Manager
SrvConfigPtr getCurrentCfg()
Returns a pointer to the current configuration.
Per-packet callout handle.
@ NEXT_STEP_DROP
drop the packet
CalloutNextStep getStatus() const
Returns the next processing step.
void setStatus(const CalloutNextStep next)
Sets the next processing step.
void getArgument(const std::string &name, T &value) const
Get argument.
void setArgument(const std::string &name, T value)
Set argument.
isc::data::ConstElementPtr getParameter(const std::string &name)
Returns configuration parameter for the library.
std::vector< std::string > getParameterNames()
Returns names of configuration parameters for the library.
void registerCommandCallout(const std::string &command_name, CalloutPtr callout)
Register control command handler.
static void reset()
Reset the sole instance of BulkLeaseQueryService.
static void doStartListener()
Start the listener.
static int upgradeHandler(hooks::CalloutHandle &handle)
Upgrade extended information.
static std::string leaseQueryLabel(const dhcp::Pkt4Ptr &packet)
Convenience method for generating per packet logging info.
Provides configuration and control flow for processing queries.
static std::string leaseQueryLabel(const dhcp::Pkt6Ptr &packet)
Convenience method for generating per packet logging info.
static int upgradeHandler(hooks::CalloutHandle &handle)
Upgrade extended information.
static void createImpl(uint16_t family, isc::data::ConstElementPtr config)
Creates the LeaseQueryImpl singleton.
static LeaseQueryImpl & getMutableImpl()
Fetch the LeaseQueryImpl singleton.
static const LeaseQueryImpl & getImpl()
Fetch the LeaseQueryImpl singleton.
static void destroyImpl()
Destroy the LeaseQueryImpl singleton.
virtual void processQuery(isc::dhcp::PktPtr base_query) const =0
Processes a single client Lease Query.
static bool terminated_
Terminated flag.
static const isc::data::SimpleKeywords LEASE_QUERY_KEYWORDS
Keywords for Lease Query configuration.
isc::asiolink::IOServicePtr getIOService()
Get the hook I/O service.
static std::string getProcName()
returns the process name This value is used as when forming the default PID file name
static StatsMgr & instance()
Statistics Manager accessor method.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
bool del(const std::string &name)
Removes specified statistic.
void setValue(const std::string &name, const int64_t value)
Records absolute integer observation.
void addValue(const std::string &name, const int64_t value)
Records incremental integer observation.
int dhcp4_srv_configured(CalloutHandle &)
dhcp4_srv_configured callout implementation.
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 dhcp6_srv_configured(CalloutHandle &handle)
dhcp6_srv_configured callout implementation.
int cb6_updated(CalloutHandle &handle)
This callout is called at the "cb6_updated" hook.
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 load(LibraryHandle &handle)
This function is called when the library is loaded.
#define LOG_ERROR(LOGGER, MESSAGE)
Macro to conveniently test error output and log it.
#define LOG_INFO(LOGGER, MESSAGE)
Macro to conveniently test info output and log it.
#define LOG_DEBUG(LOGGER, LEVEL, MESSAGE)
Macro to conveniently test debug output and log it.
boost::shared_ptr< const Element > ConstElementPtr
boost::shared_ptr< Element > ElementPtr
boost::shared_ptr< AuditEntryCollection > AuditEntryCollectionPtr
boost::shared_ptr< Pkt4 > Pkt4Ptr
A pointer to Pkt4 object.
boost::shared_ptr< SrvConfig > SrvConfigPtr
Non-const pointer to the SrvConfig.
boost::shared_ptr< Pkt6 > Pkt6Ptr
A pointer to Pkt6 packet.
const isc::log::MessageID LEASE_QUERY_UNLOAD_OK
const isc::log::MessageID DHCP4_LEASE_QUERY_RECEIVED
const isc::log::MessageID LEASE_QUERY_LOAD_OK
const isc::log::MessageID LEASE_QUERY_LOAD_FAILED
const isc::log::MessageID DHCP6_LEASE_QUERY_PACKET_UNPACK_FAILED
const isc::log::MessageID DHCP4_LEASE_QUERY_PROCESS_FAILED
const isc::log::MessageID DHCP4_LEASE_QUERY_PACKET_UNPACK_FAILED
const isc::log::MessageID DHCP6_LEASE_QUERY_PROCESS_FAILED
isc::log::Logger lease_query_logger("lease-query-hooks")
const isc::log::MessageID DHCP6_LEASE_QUERY_RECEIVED
const int DBGLVL_TRACE_BASIC
Trace basic operations.
Defines the logger used by the top-level component of kea-lfc.
Tag used to access index by object type.