49 impl->startService(io_service, network_state, HAServerType::DHCPv4);
51 }
catch (
const std::exception& ex) {
64 if (status == CalloutHandle::NEXT_STEP_DROP) {
69 impl->buffer4Receive(handle);
71 }
catch (
const std::exception& ex) {
85 if (status == CalloutHandle::NEXT_STEP_DROP ||
86 status == CalloutHandle::NEXT_STEP_SKIP) {
91 impl->leases4Committed(handle);
93 }
catch (
const std::exception& ex) {
110 handle.
getArgument(
"network_state", network_state);
111 impl->startService(io_service, network_state, HAServerType::DHCPv6);
113 }
catch (
const std::exception& ex) {
126 if (status == CalloutHandle::NEXT_STEP_DROP ||
127 status == CalloutHandle::NEXT_STEP_SKIP) {
132 impl->buffer6Receive(handle);
134 }
catch (
const std::exception& ex) {
148 if (status == CalloutHandle::NEXT_STEP_DROP ||
149 status == CalloutHandle::NEXT_STEP_SKIP) {
154 impl->leases6Committed(handle);
156 }
catch (
const std::exception& ex) {
170 impl->commandProcessed(handle);
172 }
catch (
const std::exception& ex) {
184 impl->heartbeatHandler(handle);
186 }
catch (
const std::exception& ex) {
198 impl->synchronizeHandler(handle);
200 }
catch (
const std::exception& ex) {
211 impl->scopesHandler(handle);
213 }
catch (
const std::exception& ex) {
224 impl->continueHandler(handle);
226 }
catch (
const std::exception& ex) {
237 impl->maintenanceNotifyHandler(handle);
239 }
catch (
const std::exception& ex) {
250 impl->maintenanceStartHandler(handle);
252 }
catch (
const std::exception& ex) {
263 impl->maintenanceCancelHandler(handle);
265 }
catch (
const std::exception& ex) {
276 impl->haResetHandler(handle);
278 }
catch (
const std::exception& ex) {
299 uint16_t family = CfgMgr::instance().getFamily();
300 const std::string& proc_name = Daemon::getProcName();
301 if (family == AF_INET) {
302 if (proc_name !=
"kea-dhcp4") {
304 <<
", expected kea-dhcp4");
307 if (proc_name !=
"kea-dhcp6") {
309 <<
", expected kea-dhcp6");
313 impl = boost::make_shared<HAImpl>();
314 impl->configure(config);
325 }
catch (
const std::exception& ex) {
int buffer4_receive(CalloutHandle &handle)
buffer4_receive callout implementation.
int maintenance_notify_command(CalloutHandle &handle)
ha-maintenance-notify command handler implementation.
int continue_command(CalloutHandle &handle)
ha-continue command handler implementation.
const isc::log::MessageID HA_BUFFER6_RECEIVE_FAILED
#define LOG_INFO(LOGGER, MESSAGE)
Macro to conveniently test info output and log it.
const isc::log::MessageID HA_CONTINUE_HANDLER_FAILED
const isc::log::MessageID HA_COMMAND_PROCESSED_FAILED
boost::shared_ptr< HAImpl > HAImplPtr
Pointer to the High Availability hooks library implementation.
int load(LibraryHandle &handle)
This function is called when the library is loaded.
const isc::log::MessageID HA_CONFIGURATION_FAILED
const isc::log::MessageID HA_LEASES6_COMMITTED_FAILED
const isc::log::MessageID HA_SYNC_HANDLER_FAILED
int unload()
This function is called when the library is unloaded.
#define LOG_ERROR(LOGGER, MESSAGE)
Macro to conveniently test error output and log it.
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
const int CONTROL_RESULT_ERROR
Status code indicating a general failure.
const isc::log::MessageID HA_HEARTBEAT_HANDLER_FAILED
void registerCommandCallout(const std::string &command_name, CalloutPtr callout)
Register control command handler.
int scopes_command(CalloutHandle &handle)
ha-scopes command handler implementation.
int maintenance_start_command(CalloutHandle &handle)
ha-maintenance-start command handler implementation.
int ha_reset_command(CalloutHandle &handle)
ha-reset command handler implementation.
int buffer6_receive(CalloutHandle &handle)
buffer6_receive callout implementation.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
int heartbeat_command(CalloutHandle &handle)
Heartbeat command handler implementation.
const isc::log::MessageID HA_DEINIT_OK
int leases4_committed(CalloutHandle &handle)
leases4_committed callout implementation.
Per-packet callout handle.
const isc::log::MessageID HA_INIT_OK
A generic exception that is thrown when an unexpected error condition occurs.
int dhcp6_srv_configured(CalloutHandle &handle)
dhcp6_srv_configured callout implementation.
const isc::log::MessageID HA_DHCP4_START_SERVICE_FAILED
CalloutNextStep
Specifies allowed next steps.
boost::shared_ptr< const Element > ConstElementPtr
const isc::log::MessageID HA_SCOPES_HANDLER_FAILED
int dhcp4_srv_configured(CalloutHandle &handle)
dhcp4_srv_configured callout implementation.
const isc::log::MessageID HA_BUFFER4_RECEIVE_FAILED
Defines the logger used by the top-level component of kea-dhcp-ddns.
const isc::log::MessageID HA_MAINTENANCE_NOTIFY_HANDLER_FAILED
const isc::log::MessageID HA_MAINTENANCE_CANCEL_HANDLER_FAILED
const isc::log::MessageID HA_MAINTENANCE_START_HANDLER_FAILED
int maintenance_cancel_command(CalloutHandle &handle)
ha-maintenance-cancel command handler implementation.
This file contains several functions and constants that are used for handling commands and responses ...
int leases6_committed(CalloutHandle &handle)
leases6_committed callout implementation.
int multi_threading_compatible()
This function is called to retrieve the multi-threading compatibility.
isc::data::ConstElementPtr getParameter(const std::string &name)
Returns configuration parameter for the library.
boost::shared_ptr< NetworkState > NetworkStatePtr
Pointer to the NetworkState object.
const isc::log::MessageID HA_LEASES4_COMMITTED_FAILED
isc::log::Logger ha_logger("ha-hooks")
void getArgument(const std::string &name, T &value) const
Get argument.
const isc::log::MessageID HA_MISSING_CONFIGURATION
const isc::log::MessageID HA_RESET_HANDLER_FAILED
int command_processed(CalloutHandle &handle)
command_processed callout implementation.
int sync_command(CalloutHandle &handle)
ha-sync command handler implementation.
CalloutNextStep getStatus() const
Returns the next processing step.
const isc::log::MessageID HA_DHCP6_START_SERVICE_FAILED