50 mgr->updateSubnetConfig(server_config);
57 mgr->startService(network_state);
59 }
catch (
const std::exception& ex) {
65 os <<
"Error: " << ex.what();
66 string error(os.str());
89 auto range = object_type_idx.equal_range(
"dhcp4_subnet");
90 if (std::distance(range.first, range.second)) {
94 }
catch (
const std::exception& ex) {
127 uint32_t offer_lifetime;
128 handle.
getArgument(
"offer_lifetime", offer_lifetime);
144 if (!leases4->empty()) {
145 lease4 = (*leases4)[0];
158 parking_lot->reference(query4);
162 auto const&
config =
mgr->getScopedConfig(lease4);
168 status =
mgr->shouldPing(lease4, query4, old_lease, host,
config);
171 mgr->startPing(lease4, query4, parking_lot,
config);
175 parking_lot->dereference(query4);
179 }
catch (
const std::exception& ex) {
181 .arg(query4 ? query4->getLabel() :
"<no query>")
182 .arg(lease4 ? lease4->addr_.toText() :
"<no lease>")
186 parking_lot->dereference(query4);
203 if (proc_name !=
"kea-dhcp4") {
205 <<
", expected kea-dhcp4");
213 mgr->configure(json);
214 }
catch (
const exception& ex) {
CalloutNextStep
Specifies allowed next steps.
@ NEXT_STEP_PARK
park the packet
@ NEXT_STEP_DROP
drop the packet
@ NEXT_STEP_SKIP
skip the next processing step
A generic exception that is thrown if a function is called in a prohibited way.
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 CfgMgr & instance()
returns a single instance of Configuration Manager
Per-packet callout handle.
@ NEXT_STEP_DROP
drop the packet
ParkingLotHandlePtr getParkingLotHandlePtr() const
Returns pointer to the parking lot handle for this hook point.
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 getParameters()
Get configuration parameter common code.
static std::string getProcName()
returns the process name This value is used as when forming the default PID file name
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
#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.
boost::shared_ptr< const Element > ConstElementPtr
boost::shared_ptr< AuditEntryCollection > AuditEntryCollectionPtr
boost::shared_ptr< Lease4Collection > Lease4CollectionPtr
A shared pointer to the collection of IPv4 leases.
boost::shared_ptr< Pkt4 > Pkt4Ptr
A pointer to Pkt4 object.
boost::shared_ptr< SrvConfig > SrvConfigPtr
Non-const pointer to the SrvConfig.
boost::shared_ptr< NetworkState > NetworkStatePtr
Pointer to the NetworkState object.
boost::shared_ptr< const Host > ConstHostPtr
Const pointer to the Host object.
boost::shared_ptr< Lease4 > Lease4Ptr
Pointer to a Lease4 structure.
boost::shared_ptr< ParkingLotHandle > ParkingLotHandlePtr
Pointer to the parking lot handle.
PingCheckMgrPtr mgr
PingCheckMgr singleton.
isc::log::Logger ping_check_logger("ping-check-hooks")
boost::shared_ptr< PingCheckMgr > PingCheckMgrPtr
Defines a shared pointer to a PingCheckMgr.
Defines the logger used by the top-level component of kea-lfc.
int dhcp4_srv_configured(CalloutHandle &handle)
dhcp4_srv_configured implementation.
int multi_threading_compatible()
This function is called to retrieve the multi-threading compatibility.
int lease4_offer(CalloutHandle &handle)
lease4_offer callout implementation.
int unload()
This function is called when the library is unloaded.
int cb4_updated(CalloutHandle &handle)
cb4_updated callout implementation.
int load(LibraryHandle &handle)
This function is called when the library is loaded.
const isc::log::MessageID PING_CHECK_LOAD_ERROR
const isc::log::MessageID PING_CHECK_LEASE4_OFFER_FAILED
const isc::log::MessageID PING_CHECK_DHCP4_SRV_CONFIGURED_FAILED
const isc::log::MessageID PING_CHECK_CB4_UPDATE_FAILED
const isc::log::MessageID PING_CHECK_UNLOAD
const isc::log::MessageID PING_CHECK_LOAD_OK
Tag used to access index by object type.