53 impl->startServices(network_state, HAServerType::DHCPv4);
56 }
catch (
const std::exception& ex) {
61 os <<
"Error: " << ex.what();
62 string error(os.str());
79 impl->buffer4Receive(handle);
81 }
catch (
const std::exception& ex) {
100 impl->subnet4Select(handle);
102 }
catch (
const std::exception& ex) {
123 impl->leases4Committed(handle);
125 }
catch (
const std::exception& ex) {
145 impl->lease4ServerDecline(handle);
146 }
catch (
const std::exception& ex) {
162 handle.
getArgument(
"network_state", network_state);
163 impl->startServices(network_state, HAServerType::DHCPv6);
166 }
catch (
const std::exception& ex) {
171 os <<
"Error: " << ex.what();
172 string error(os.str());
190 impl->buffer6Receive(handle);
192 }
catch (
const std::exception& ex) {
211 impl->subnet6Select(handle);
213 }
catch (
const std::exception& ex) {
233 impl->leases6Committed(handle);
235 }
catch (
const std::exception& ex) {
249 impl->commandProcessed(handle);
251 }
catch (
const std::exception& ex) {
263 impl->heartbeatHandler(handle);
265 }
catch (
const std::exception& ex) {
277 impl->synchronizeHandler(handle);
279 }
catch (
const std::exception& ex) {
290 impl->scopesHandler(handle);
292 }
catch (
const std::exception& ex) {
303 impl->continueHandler(handle);
305 }
catch (
const std::exception& ex) {
316 impl->maintenanceNotifyHandler(handle);
318 }
catch (
const std::exception& ex) {
329 impl->maintenanceStartHandler(handle);
331 }
catch (
const std::exception& ex) {
342 impl->maintenanceCancelHandler(handle);
344 }
catch (
const std::exception& ex) {
355 impl->haResetHandler(handle);
357 }
catch (
const std::exception& ex) {
368 impl->syncCompleteNotifyHandler(handle);
369 }
catch (
const std::exception& ex) {
392 if (family == AF_INET) {
393 if (proc_name !=
"kea-dhcp4") {
395 <<
", expected kea-dhcp4");
398 if (proc_name !=
"kea-dhcp6") {
400 <<
", expected kea-dhcp6");
404 impl = boost::make_shared<HAImpl>();
405 impl->configure(config);
417 }
catch (
const std::exception& ex) {
A generic exception that is thrown when an unexpected error condition occurs.
static IOServiceMgr & instance()
Access the IOServiceMgr singleton instance.
static CfgMgr & instance()
returns a single instance of Configuration Manager
Per-packet callout handle.
CalloutNextStep
Specifies allowed next steps.
@ NEXT_STEP_DROP
drop the packet
@ NEXT_STEP_SKIP
skip the next processing step
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.
void registerCommandCallout(const std::string &command_name, CalloutPtr callout)
Register control command handler.
static std::string getProcName()
returns the process name This value is used as when forming the default PID file name
This file contains several functions and constants that are used for handling commands and responses ...
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
int lease4_server_decline(CalloutHandle &handle)
lease4_server_decline callout implementation.
int subnet4_select(CalloutHandle &handle)
subnet4_select callout implementation.
int maintenance_cancel_command(CalloutHandle &handle)
ha-maintenance-cancel command handler implementation.
int dhcp4_srv_configured(CalloutHandle &handle)
dhcp4_srv_configured callout implementation.
int leases6_committed(CalloutHandle &handle)
leases6_committed callout implementation.
int sync_complete_notify_command(CalloutHandle &handle)
ha-sync-complete-notify command handler implementation.
int scopes_command(CalloutHandle &handle)
ha-scopes command handler implementation.
int heartbeat_command(CalloutHandle &handle)
Heartbeat command handler implementation.
int command_processed(CalloutHandle &handle)
command_processed callout implementation.
int leases4_committed(CalloutHandle &handle)
leases4_committed callout implementation.
int multi_threading_compatible()
This function is called to retrieve the multi-threading compatibility.
int maintenance_notify_command(CalloutHandle &handle)
ha-maintenance-notify command handler implementation.
int subnet6_select(CalloutHandle &handle)
subnet6_select callout implementation.
int unload()
This function is called when the library is unloaded.
int dhcp6_srv_configured(CalloutHandle &handle)
dhcp6_srv_configured callout implementation.
int buffer4_receive(CalloutHandle &handle)
buffer4_receive callout implementation.
int continue_command(CalloutHandle &handle)
ha-continue command handler implementation.
int ha_reset_command(CalloutHandle &handle)
ha-reset command handler implementation.
int maintenance_start_command(CalloutHandle &handle)
ha-maintenance-start command handler implementation.
int buffer6_receive(CalloutHandle &handle)
buffer6_receive callout implementation.
int sync_command(CalloutHandle &handle)
ha-sync command handler implementation.
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.
const int CONTROL_RESULT_ERROR
Status code indicating a general failure.
boost::shared_ptr< const Element > ConstElementPtr
boost::shared_ptr< NetworkState > NetworkStatePtr
Pointer to the NetworkState object.
const isc::log::MessageID HA_BUFFER4_RECEIVE_FAILED
boost::shared_ptr< HAImpl > HAImplPtr
Pointer to the High Availability hooks library implementation.
const isc::log::MessageID HA_DEINIT_OK
const isc::log::MessageID HA_COMMAND_PROCESSED_FAILED
const isc::log::MessageID HA_LEASES4_COMMITTED_FAILED
const isc::log::MessageID HA_CONTINUE_HANDLER_FAILED
const isc::log::MessageID HA_MAINTENANCE_CANCEL_HANDLER_FAILED
const isc::log::MessageID HA_HEARTBEAT_HANDLER_FAILED
isc::log::Logger ha_logger("ha-hooks")
const isc::log::MessageID HA_RESET_HANDLER_FAILED
const isc::log::MessageID HA_DHCP6_START_SERVICE_FAILED
const isc::log::MessageID HA_MAINTENANCE_START_HANDLER_FAILED
const isc::log::MessageID HA_BUFFER6_RECEIVE_FAILED
const isc::log::MessageID HA_SYNC_COMPLETE_NOTIFY_HANDLER_FAILED
const isc::log::MessageID HA_SUBNET6_SELECT_FAILED
const isc::log::MessageID HA_LEASE4_SERVER_DECLINE_FAILED
const isc::log::MessageID HA_INIT_OK
const isc::log::MessageID HA_SUBNET4_SELECT_FAILED
const isc::log::MessageID HA_MISSING_CONFIGURATION
const isc::log::MessageID HA_LEASES6_COMMITTED_FAILED
const isc::log::MessageID HA_DHCP4_START_SERVICE_FAILED
const isc::log::MessageID HA_CONFIGURATION_FAILED
const isc::log::MessageID HA_MAINTENANCE_NOTIFY_HANDLER_FAILED
const isc::log::MessageID HA_SYNC_HANDLER_FAILED
const isc::log::MessageID HA_SCOPES_HANDLER_FAILED
Defines the logger used by the top-level component of kea-lfc.