Kea: lease_cmds_callouts.cc File Reference

| Kea 3.0.0

lease_cmds_callouts.cc File Reference
`#include <config.h>`
`#include <lease_cmds.h>`
`#include <lease_cmds_log.h>`
`#include <binding_variables.h>`
`#include <cc/command_interpreter.h>`
`#include <dhcpsrv/cfgmgr.h>`
`#include <hooks/hooks.h>`
`#include <process/daemon.h>`
Include dependency graph for lease_cmds_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::lease_cmds

## Functions
int | lease4_add (CalloutHandle &handle)
| This is a command callout for 'lease4-add' command.
int | lease4_del (CalloutHandle &handle)
| This is a command callout for 'lease4-del' command.
int | lease4_get (CalloutHandle &handle)
| This is a command callout for 'lease4-get' command.
int | lease4_get_all (CalloutHandle &handle)
| This is a command callout for 'lease4-get-all' command.
int | lease4_get_by_client_id (CalloutHandle &handle)
| This is a command callout for 'lease4-get-by-client-id' command.
int | lease4_get_by_hostname (CalloutHandle &handle)
| This is a command callout for 'lease4-get-by-hostname' command.
int | lease4_get_by_hw_address (CalloutHandle &handle)
| This is a command callout for 'lease4-get-by-hw-address' command.
int | lease4_get_page (CalloutHandle &handle)
| This is a command callout for 'lease4-get-page' command.
int | lease4_offer (CalloutHandle &handle)
| lease4_offer callout implementation.
int | lease4_resend_ddns (CalloutHandle &handle)
| This is a command callout for 'lease4-resend-ddns' command.
int | lease4_update (CalloutHandle &handle)
| This is a command callout for 'lease4-update' command.
int | lease4_wipe (CalloutHandle &handle)
| This is a command callout for 'lease4-wipe' command.
int | lease4_write (CalloutHandle &handle)
| This is a command callout for 'lease4-write' command.
int | lease6_add (CalloutHandle &handle)
| This is a command callout for 'lease6-add' command.
int | lease6_bulk_apply (CalloutHandle &handle)
| This is a command callout for 'lease6-bulk-apply' command.
int | lease6_del (CalloutHandle &handle)
| This is a command callout for 'lease6-del' command.
int | lease6_get (CalloutHandle &handle)
| This is a command callout for 'lease6-get' command.
int | lease6_get_all (CalloutHandle &handle)
| This is a command callout for 'lease6-get-all' command.
int | lease6_get_by_duid (CalloutHandle &handle)
| This is a command callout for 'lease6-get-by-duid' command.
int | lease6_get_by_hostname (CalloutHandle &handle)
| This is a command callout for 'lease6-get-by-hostname' command.
int | lease6_get_page (CalloutHandle &handle)
| This is a command callout for 'lease6-get-page' command.
int | lease6_resend_ddns (CalloutHandle &handle)
| This is a command callout for 'lease6-resend-ddns' command.
int | lease6_update (CalloutHandle &handle)
| This is a command callout for 'lease6-update' command.
int | lease6_wipe (CalloutHandle &handle)
| This is a command callout for 'lease6-wipe' command.
int | lease6_write (CalloutHandle &handle)
| This is a command callout for 'lease6-write' command.
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 | multi_threading_compatible ()
| This function is called to retrieve the multi-threading compatibility.
int | unload ()
| This function is called when the library is unloaded.

## Variables
BindingVariableMgrPtr | isc::lease_cmds::binding_var_mgr
| Singleton that manages configured binding variables.

## Function Documentation

## ◆ lease4_add()

int lease4_add | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease4-add' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 otherwise.

Definition at line 46 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease4_del()

int lease4_del | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease4-del' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 otherwise.

Definition at line 200 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease4_get()

int lease4_get | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease4-get' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 otherwise.

Definition at line 79 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease4_get_all()

int lease4_get_all | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease4-get-all' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 if an error occurs, 3 if no leases are returned.

Definition at line 101 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease4_get_by_client_id()

int lease4_get_by_client_id | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease4-get-by-client-id' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 if an error occurs, 3 if no leases are returned.

Definition at line 156 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease4_get_by_hostname()

int lease4_get_by_hostname | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease4-get-by-hostname' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 if an error occurs, 3 if no leases are returned.

Definition at line 178 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease4_get_by_hw_address()

int lease4_get_by_hw_address | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease4-get-by-hw-address' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 if an error occurs, 3 if no leases are returned.

Definition at line 145 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease4_get_page()

int lease4_get_page | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease4-get-page' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 if an error occurs, 3 if no leases are returned.

Definition at line 123 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease4_offer()

int lease4_offer | ( | CalloutHandle & | handle | ) |

lease4_offer callout implementation.

Parameters

  handle | callout handle.

Definition at line 390 of file lease_cmds_callouts.cc.

References isc::lease_cmds::binding_var_mgr, isc::hooks::CalloutHandle::getStatus(), LEASE_CMDS_LEASE4_OFFER_FAILED, isc::lease_cmds::lease_cmds_logger, LOG_ERROR, CalloutHandle::NEXT_STEP_DROP, and CalloutHandle::NEXT_STEP_SKIP.

Here is the call graph for this function:

## ◆ lease4_resend_ddns()

int lease4_resend_ddns | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease4-resend-ddns' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 otherwise.

Definition at line 266 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease4_update()

int lease4_update | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease4-update' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 otherwise.

Definition at line 222 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease4_wipe()

int lease4_wipe | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease4-wipe' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 otherwise.

Definition at line 244 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease4_write()

int lease4_write | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease4-write' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 otherwise.

Definition at line 288 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease6_add()

int lease6_add | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease6-add' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 otherwise.

Definition at line 57 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease6_bulk_apply()

int lease6_bulk_apply | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease6-bulk-apply' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 otherwise.

Definition at line 68 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease6_del()

int lease6_del | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease6-del' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 otherwise.

Definition at line 211 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease6_get()

int lease6_get | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease6-get' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 otherwise.

Definition at line 90 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease6_get_all()

int lease6_get_all | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease6-get-all' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 if an error occurs, 3 if no leases are returned.

Definition at line 112 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease6_get_by_duid()

int lease6_get_by_duid | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease6-get-by-duid' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 if an error occurs, 3 if no leases are returned.

Definition at line 167 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease6_get_by_hostname()

int lease6_get_by_hostname | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease6-get-by-hostname' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 if an error occurs, 3 if no leases are returned.

Definition at line 189 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease6_get_page()

int lease6_get_page | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease6-get-page' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 if an error occurs, 3 if no leases are returned.

Definition at line 134 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease6_resend_ddns()

int lease6_resend_ddns | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease6-resend-ddns' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 otherwise.

Definition at line 277 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease6_update()

int lease6_update | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease6-update' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 otherwise.

Definition at line 233 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease6_wipe()

int lease6_wipe | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease6-wipe' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 otherwise.

Definition at line 255 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ lease6_write()

int lease6_write | ( | CalloutHandle & | handle | ) |

This is a command callout for 'lease6-write' command.

Parameters

  handle | Callout handle used to retrieve a command and provide a response.

Returns
  0 if this callout has been invoked successfully, 1 otherwise.

Definition at line 299 of file lease_cmds_callouts.cc.

Referenced by load().

## ◆ leases4_committed()

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

leases4_committed callout implementation.

Parameters

  handle | callout handle.

Definition at line 412 of file lease_cmds_callouts.cc.

References isc::lease_cmds::binding_var_mgr, isc::hooks::CalloutHandle::getStatus(), LEASE_CMDS_LEASES4_COMMITTED_FAILED, isc::lease_cmds::lease_cmds_logger, 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 434 of file lease_cmds_callouts.cc.

References isc::lease_cmds::binding_var_mgr, isc::hooks::CalloutHandle::getStatus(), LEASE_CMDS_LEASES6_COMMITTED_FAILED, isc::lease_cmds::lease_cmds_logger, 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 308 of file lease_cmds_callouts.cc.

References isc::lease_cmds::binding_var_mgr, isc::dhcp::CfgMgr::getFamily(), isc::hooks::LibraryHandle::getParameters(), isc::process::Daemon::getProcName(), isc::dhcp::CfgMgr::instance(), isc_throw, lease4_add(), lease4_del(), lease4_get(), lease4_get_all(), lease4_get_by_client_id(), lease4_get_by_hostname(), lease4_get_by_hw_address(), lease4_get_page(), lease4_resend_ddns(), lease4_update(), lease4_wipe(), lease4_write(), lease6_add(), lease6_bulk_apply(), lease6_del(), lease6_get(), lease6_get_all(), lease6_get_by_duid(), lease6_get_by_hostname(), lease6_get_page(), lease6_resend_ddns(), lease6_update(), lease6_wipe(), lease6_write(), LEASE_CMDS_INIT_OK, LEASE_CMDS_LOAD_ERROR, isc::lease_cmds::lease_cmds_logger, LOG_ERROR, LOG_INFO, and isc::hooks::LibraryHandle::registerCommandCallout().

Here is the call graph for this function:

## ◆ 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 383 of file lease_cmds_callouts.cc.

## ◆ unload()

int unload | ( |  | ) |

This function is called when the library is unloaded.

Returns
  0 if deregistration was successful, 1 otherwise

Definition at line 375 of file lease_cmds_callouts.cc.

References LEASE_CMDS_DEINIT_OK, isc::lease_cmds::lease_cmds_logger, and LOG_INFO.