Kea: ha_callouts.cc File Reference

| Kea 3.0.2-git

ha_callouts.cc File Reference
`#include <config.h>`
`#include <ha_impl.h>`
`#include <ha_log.h>`
`#include <asiolink/io_service.h>`
`#include <asiolink/io_service_mgr.h>`
`#include <cc/command_interpreter.h>`
`#include <dhcpsrv/cfgmgr.h>`
`#include <dhcpsrv/network_state.h>`
`#include <exceptions/exceptions.h>`
`#include <hooks/hooks.h>`
`#include <process/daemon.h>`
`#include <sstream>`
`#include <string>`
Include dependency graph for ha_callouts.cc:

Go to the source code of this file.

## Namespaces
namespace | isc
| Defines the logger used by the top-level component of kea-lfc.
namespace | isc::ha

## Functions
int | buffer4_receive (CalloutHandle &handle)
| buffer4_receive callout implementation.
int | buffer6_receive (CalloutHandle &handle)
| buffer6_receive callout implementation.
int | command_processed (CalloutHandle &handle)
| command_processed callout implementation.
int | continue_command (CalloutHandle &handle)
| ha-continue command handler implementation.
int | dhcp4_srv_configured (CalloutHandle &handle)
| dhcp4_srv_configured callout implementation.
int | dhcp6_srv_configured (CalloutHandle &handle)
| dhcp6_srv_configured callout implementation.
int | ha_reset_command (CalloutHandle &handle)
| ha-reset command handler implementation.
int | heartbeat_command (CalloutHandle &handle)
| Heartbeat command handler implementation.
int | lease4_expire (CalloutHandle &handle)
| lease4_expire callout implementation.
int | lease4_server_decline (CalloutHandle &handle)
| lease4_server_decline callout implementation.
int | lease6_expire (CalloutHandle &handle)
| lease6_expire callout implementation.
int | leases4_committed (CalloutHandle &handle)
| leases4_committed callout implementation.
int | leases6_committed (CalloutHandle &handle)
| leases6_committed callout implementation.
int | load (LibraryHandle &handle)
| This function is called when the library is loaded.
int | maintenance_cancel_command (CalloutHandle &handle)
| ha-maintenance-cancel command handler implementation.
int | maintenance_notify_command (CalloutHandle &handle)
| ha-maintenance-notify command handler implementation.
int | maintenance_start_command (CalloutHandle &handle)
| ha-maintenance-start command handler implementation.
int | multi_threading_compatible ()
| This function is called to retrieve the multi-threading compatibility.
int | scopes_command (CalloutHandle &handle)
| ha-scopes command handler implementation.
int | subnet4_select (CalloutHandle &handle)
| subnet4_select callout implementation.
int | subnet6_select (CalloutHandle &handle)
| subnet6_select callout implementation.
int | sync_command (CalloutHandle &handle)
| ha-sync command handler implementation.
int | sync_complete_notify_command (CalloutHandle &handle)
| ha-sync-complete-notify command handler implementation.
int | unload ()
| This function is called when the library is unloaded.

## Variables
HAImplPtr | isc::ha::impl

## Function Documentation

## ◆ buffer4_receive()

int buffer4_receive | ( | CalloutHandle & | handle | ) |

buffer4_receive callout implementation.

Parameters

  handle | callout handle.

Definition at line 72 of file ha_callouts.cc.

References isc::hooks::CalloutHandle::getStatus(), isc::ha::HA_BUFFER4_RECEIVE_FAILED, isc::ha::ha_logger, isc::ha::impl, LOG_ERROR, and CalloutHandle::NEXT_STEP_DROP.

Here is the call graph for this function:

## ◆ buffer6_receive()

int buffer6_receive | ( | CalloutHandle & | handle | ) |

buffer6_receive callout implementation.

Parameters

  handle | callout handle.

Definition at line 201 of file ha_callouts.cc.

References isc::hooks::CalloutHandle::getStatus(), isc::ha::HA_BUFFER6_RECEIVE_FAILED, isc::ha::ha_logger, isc::ha::impl, LOG_ERROR, CalloutHandle::NEXT_STEP_DROP, and CalloutHandle::NEXT_STEP_SKIP.

Here is the call graph for this function:

## ◆ command_processed()

int command_processed | ( | CalloutHandle & | handle | ) |

command_processed callout implementation.

Parameters

  handle | callout handle.

Definition at line 286 of file ha_callouts.cc.

References isc::ha::HA_COMMAND_PROCESSED_FAILED, isc::ha::ha_logger, isc::ha::impl, and LOG_ERROR.

## ◆ continue_command()

int continue_command | ( | CalloutHandle & | handle | ) |

ha-continue command handler implementation.

Definition at line 340 of file ha_callouts.cc.

References isc::ha::HA_CONTINUE_HANDLER_FAILED, isc::ha::ha_logger, isc::ha::impl, and LOG_ERROR.

Referenced by load().

## ◆ dhcp4_srv_configured()

int dhcp4_srv_configured | ( | CalloutHandle & | handle | ) |

dhcp4_srv_configured callout implementation.

Parameters

  handle | callout handle.

Definition at line 49 of file ha_callouts.cc.

References isc::ha::DHCPv4, isc::db::error, isc::hooks::CalloutHandle::getArgument(), isc::ha::HA_DHCP4_START_SERVICE_FAILED, isc::ha::ha_logger, isc::ha::impl, isc::asiolink::IOServiceMgr::instance(), LOG_ERROR, isc::hooks::CalloutHandle::NEXT_STEP_DROP, isc::asiolink::IOServiceMgr::registerIOService(), isc::hooks::CalloutHandle::setArgument(), and isc::hooks::CalloutHandle::setStatus().

Here is the call graph for this function:

## ◆ dhcp6_srv_configured()

int dhcp6_srv_configured | ( | CalloutHandle & | handle | ) |

dhcp6_srv_configured callout implementation.

Parameters

  handle | callout handle.

Definition at line 178 of file ha_callouts.cc.

References isc::ha::DHCPv6, isc::db::error, isc::hooks::CalloutHandle::getArgument(), isc::ha::HA_DHCP6_START_SERVICE_FAILED, isc::ha::ha_logger, isc::ha::impl, isc::asiolink::IOServiceMgr::instance(), LOG_ERROR, isc::hooks::CalloutHandle::NEXT_STEP_DROP, isc::asiolink::IOServiceMgr::registerIOService(), isc::hooks::CalloutHandle::setArgument(), and isc::hooks::CalloutHandle::setStatus().

Here is the call graph for this function:

## ◆ ha_reset_command()

int ha_reset_command | ( | CalloutHandle & | handle | ) |

ha-reset command handler implementation.

Definition at line 392 of file ha_callouts.cc.

References isc::ha::ha_logger, isc::ha::HA_RESET_HANDLER_FAILED, isc::ha::impl, and LOG_ERROR.

Referenced by load().

## ◆ heartbeat_command()

int heartbeat_command | ( | CalloutHandle & | handle | ) |

Heartbeat command handler implementation.

Definition at line 300 of file ha_callouts.cc.

References isc::ha::HA_HEARTBEAT_HANDLER_FAILED, isc::ha::ha_logger, isc::ha::impl, and LOG_ERROR.

Referenced by load().

## ◆ lease4_expire()

int lease4_expire | ( | CalloutHandle & | handle | ) |

lease4_expire callout implementation.

Parameters

  handle | callout handle.

Definition at line 158 of file ha_callouts.cc.

References isc::hooks::CalloutHandle::getStatus(), isc::ha::HA_LEASE4_EXPIRE_FAILED, isc::ha::ha_logger, isc::ha::impl, LOG_ERROR, and CalloutHandle::NEXT_STEP_SKIP.

Here is the call graph for this function:

## ◆ lease4_server_decline()

int lease4_server_decline | ( | CalloutHandle & | handle | ) |

lease4_server_decline callout implementation.

Parameters

  handle | callout handle.

Definition at line 137 of file ha_callouts.cc.

References isc::hooks::CalloutHandle::getStatus(), isc::ha::HA_LEASE4_SERVER_DECLINE_FAILED, isc::ha::ha_logger, isc::ha::impl, LOG_ERROR, CalloutHandle::NEXT_STEP_DROP, and CalloutHandle::NEXT_STEP_SKIP.

Here is the call graph for this function:

## ◆ lease6_expire()

int lease6_expire | ( | CalloutHandle & | handle | ) |

lease6_expire callout implementation.

Parameters

  handle | callout handle.

Definition at line 266 of file ha_callouts.cc.

References isc::hooks::CalloutHandle::getStatus(), isc::ha::HA_LEASE6_EXPIRE_FAILED, isc::ha::ha_logger, isc::ha::impl, LOG_ERROR, and CalloutHandle::NEXT_STEP_SKIP.

Here is the call graph for this function:

## ◆ leases4_committed()

int leases4_committed | ( | CalloutHandle & | handle | ) |

leases4_committed callout implementation.

Parameters

  handle | callout handle.

Definition at line 115 of file ha_callouts.cc.

References isc::hooks::CalloutHandle::getStatus(), isc::ha::HA_LEASES4_COMMITTED_FAILED, isc::ha::ha_logger, isc::ha::impl, LOG_ERROR, CalloutHandle::NEXT_STEP_DROP, and CalloutHandle::NEXT_STEP_SKIP.

Here is the call graph for this function:

## ◆ leases6_committed()

int leases6_committed | ( | CalloutHandle & | handle | ) |

leases6_committed callout implementation.

Parameters

  handle | callout handle.

Definition at line 244 of file ha_callouts.cc.

References isc::hooks::CalloutHandle::getStatus(), isc::ha::HA_LEASES6_COMMITTED_FAILED, isc::ha::ha_logger, isc::ha::impl, LOG_ERROR, CalloutHandle::NEXT_STEP_DROP, and CalloutHandle::NEXT_STEP_SKIP.

Here is the call graph for this function:

## ◆ load()

int load | ( | LibraryHandle & | handle | ) |

This function is called when the library is loaded.

Parameters

  handle | library handle

Returns
  0 when initialization is successful, 1 otherwise

Definition at line 420 of file ha_callouts.cc.

References continue_command(), isc::config::CONTROL_RESULT_ERROR, isc::dhcp::CfgMgr::getFamily(), isc::hooks::LibraryHandle::getParameter(), isc::process::Daemon::getProcName(), isc::ha::HA_CONFIGURATION_FAILED, isc::ha::HA_INIT_OK, isc::ha::ha_logger, isc::ha::HA_MISSING_CONFIGURATION, ha_reset_command(), heartbeat_command(), isc::ha::impl, isc::dhcp::CfgMgr::instance(), isc_throw, LOG_ERROR, LOG_INFO, maintenance_cancel_command(), maintenance_notify_command(), maintenance_start_command(), isc::hooks::LibraryHandle::registerCommandCallout(), scopes_command(), sync_command(), and sync_complete_notify_command().

Here is the call graph for this function:

## ◆ maintenance_cancel_command()

int maintenance_cancel_command | ( | CalloutHandle & | handle | ) |

ha-maintenance-cancel command handler implementation.

Definition at line 379 of file ha_callouts.cc.

References isc::ha::ha_logger, isc::ha::HA_MAINTENANCE_CANCEL_HANDLER_FAILED, isc::ha::impl, and LOG_ERROR.

Referenced by load().

## ◆ maintenance_notify_command()

int maintenance_notify_command | ( | CalloutHandle & | handle | ) |

ha-maintenance-notify command handler implementation.

Definition at line 353 of file ha_callouts.cc.

References isc::ha::ha_logger, isc::ha::HA_MAINTENANCE_NOTIFY_HANDLER_FAILED, isc::ha::impl, and LOG_ERROR.

Referenced by load().

## ◆ maintenance_start_command()

int maintenance_start_command | ( | CalloutHandle & | handle | ) |

ha-maintenance-start command handler implementation.

Definition at line 366 of file ha_callouts.cc.

References isc::ha::ha_logger, isc::ha::HA_MAINTENANCE_START_HANDLER_FAILED, isc::ha::impl, and LOG_ERROR.

Referenced by load().

## ◆ multi_threading_compatible()

int multi_threading_compatible | ( |  | ) |

This function is called to retrieve the multi-threading compatibility.

Returns
  1 which means compatible with multi-threading.

Definition at line 481 of file ha_callouts.cc.

## ◆ scopes_command()

int scopes_command | ( | CalloutHandle & | handle | ) |

ha-scopes command handler implementation.

Definition at line 327 of file ha_callouts.cc.

References isc::ha::ha_logger, isc::ha::HA_SCOPES_HANDLER_FAILED, isc::ha::impl, and LOG_ERROR.

Referenced by load().

## ◆ subnet4_select()

int subnet4_select | ( | CalloutHandle & | handle | ) |

subnet4_select callout implementation.

Parameters

  handle | callout handle.

Definition at line 93 of file ha_callouts.cc.

References isc::hooks::CalloutHandle::getStatus(), isc::ha::ha_logger, isc::ha::HA_SUBNET4_SELECT_FAILED, isc::ha::impl, LOG_ERROR, and CalloutHandle::NEXT_STEP_DROP.

Here is the call graph for this function:

## ◆ subnet6_select()

int subnet6_select | ( | CalloutHandle & | handle | ) |

subnet6_select callout implementation.

Parameters

  handle | callout handle.

Definition at line 223 of file ha_callouts.cc.

References isc::hooks::CalloutHandle::getStatus(), isc::ha::ha_logger, isc::ha::HA_SUBNET6_SELECT_FAILED, isc::ha::impl, LOG_ERROR, and CalloutHandle::NEXT_STEP_DROP.

Here is the call graph for this function:

## ◆ sync_command()

int sync_command | ( | CalloutHandle & | handle | ) |

ha-sync command handler implementation.

Definition at line 314 of file ha_callouts.cc.

References isc::ha::ha_logger, isc::ha::HA_SYNC_HANDLER_FAILED, isc::ha::impl, and LOG_ERROR.

Referenced by load().

## ◆ sync_complete_notify_command()

int sync_complete_notify_command | ( | CalloutHandle & | handle | ) |

ha-sync-complete-notify command handler implementation.

Definition at line 405 of file ha_callouts.cc.

References isc::ha::ha_logger, isc::ha::HA_SYNC_COMPLETE_NOTIFY_HANDLER_FAILED, isc::ha::impl, and LOG_ERROR.

Referenced by load().

## ◆ unload()

int unload | ( |  | ) |

This function is called when the library is unloaded.

Returns
  0 if deregistration was successful, 1 otherwise

Definition at line 469 of file ha_callouts.cc.

References isc::ha::HA_DEINIT_OK, isc::ha::ha_logger, isc::ha::impl, isc::asiolink::IOServiceMgr::instance(), LOG_INFO, and isc::asiolink::IOServiceMgr::unregisterIOService().

Here is the call graph for this function: