Kea: run_script_callouts.cc File Reference

| Kea 3.2.0-git

run_script_callouts.cc File Reference
`#include <config.h>`
`#include <asiolink/io_address.h>`
`#include <asiolink/io_service_mgr.h>`
`#include <cc/command_interpreter.h>`
`#include <hooks/hooks.h>`
`#include <run_script.h>`
`#include <run_script_log.h>`
`#include <dhcp/option6_ia.h>`
`#include <dhcp/pkt4.h>`
`#include <dhcp/pkt6.h>`
`#include <dhcpsrv/cfgmgr.h>`
`#include <dhcpsrv/lease.h>`
`#include <dhcpsrv/subnet.h>`
`#include <process/daemon.h>`
`#include <string>`
Include dependency graph for run_script_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::run_script

## Functions
int | addr6_register (CalloutHandle &handle)
| handle addr6_register hook and set environment parameters for the script.
int | lease4_decline (CalloutHandle &handle)
| handle lease4_decline hook and set environment parameters for the script.
int | lease4_expire (CalloutHandle &handle)
| handle lease4_expire hook and set environment parameters for the script.
int | lease4_recover (CalloutHandle &handle)
| handle lease4_recover hook and set environment parameters for the script.
int | lease4_release (CalloutHandle &handle)
| handle lease4_release hook and set environment parameters for the script.
int | lease4_renew (CalloutHandle &handle)
| handle lease4_renew hook and set environment parameters for the script.
int | lease6_decline (CalloutHandle &handle)
| handle lease6_decline hook and set environment parameters for the script.
int | lease6_expire (CalloutHandle &handle)
| handle lease6_expire hook and set environment parameters for the script.
int | lease6_rebind (CalloutHandle &handle)
| handle lease6_rebind hook and set environment parameters for the script.
int | lease6_recover (CalloutHandle &handle)
| handle lease6_recover hook and set environment parameters for the script.
int | lease6_release (CalloutHandle &handle)
| handle lease6_release hook and set environment parameters for the script.
int | lease6_renew (CalloutHandle &handle)
| handle lease6_renew hook and set environment parameters for the script.
int | leases4_committed (CalloutHandle &handle)
| handle leases4_committed hook and set environment parameters for the script.
int | leases6_committed (CalloutHandle &handle)
| handle leases6_committed hook and set environment parameters for the script.
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
RunScriptImplPtr | isc::run_script::impl

## Function Documentation

## ◆ addr6_register()

int addr6_register | ( | CalloutHandle & | handle | ) |

handle addr6_register hook and set environment parameters for the script.

IN: query6 address6 old_lease6 new_lease6 OUT: next_step

Definition at line 416 of file run_script_callouts.cc.

References isc::run_script::RunScriptImpl::extractLease6(), isc::run_script::RunScriptImpl::extractPkt6(), isc::run_script::RunScriptImpl::extractString(), isc::hooks::CalloutHandle::getArgument(), isc::hooks::CalloutHandle::getStatus(), isc::run_script::impl, isc::asiolink::IOAddress::IPV6_ZERO_ADDRESS(), CalloutHandle::NEXT_STEP_DROP, CalloutHandle::NEXT_STEP_SKIP, and isc::asiolink::IOAddress::toText().

Here is the call graph for this function:

## ◆ lease4_decline()

int lease4_decline | ( | CalloutHandle & | handle | ) |

handle lease4_decline hook and set environment parameters for the script.

IN: query4 lease4 OUT: next_step

Definition at line 218 of file run_script_callouts.cc.

References isc::run_script::RunScriptImpl::extractLease4(), isc::run_script::RunScriptImpl::extractPkt4(), isc::hooks::CalloutHandle::getArgument(), isc::hooks::CalloutHandle::getStatus(), isc::run_script::impl, CalloutHandle::NEXT_STEP_DROP, and CalloutHandle::NEXT_STEP_SKIP.

Here is the call graph for this function:

## ◆ lease4_expire()

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

handle lease4_expire hook and set environment parameters for the script.

IN: lease4 remove_lease OUT: next_step

Definition at line 126 of file run_script_callouts.cc.

References isc::run_script::RunScriptImpl::extractBoolean(), isc::run_script::RunScriptImpl::extractLease4(), isc::hooks::CalloutHandle::getArgument(), isc::hooks::CalloutHandle::getStatus(), isc::run_script::impl, CalloutHandle::NEXT_STEP_DROP, and CalloutHandle::NEXT_STEP_SKIP.

Here is the call graph for this function:

## ◆ lease4_recover()

int lease4_recover | ( | CalloutHandle & | handle | ) |

handle lease4_recover hook and set environment parameters for the script.

IN: lease4 OUT: next_step

Definition at line 149 of file run_script_callouts.cc.

References isc::run_script::RunScriptImpl::extractLease4(), isc::hooks::CalloutHandle::getArgument(), isc::hooks::CalloutHandle::getStatus(), isc::run_script::impl, CalloutHandle::NEXT_STEP_DROP, and CalloutHandle::NEXT_STEP_SKIP.

Here is the call graph for this function:

## ◆ lease4_release()

int lease4_release | ( | CalloutHandle & | handle | ) |

handle lease4_release hook and set environment parameters for the script.

IN: query4 lease4 OUT: next_step

Definition at line 195 of file run_script_callouts.cc.

References isc::run_script::RunScriptImpl::extractLease4(), isc::run_script::RunScriptImpl::extractPkt4(), isc::hooks::CalloutHandle::getArgument(), isc::hooks::CalloutHandle::getStatus(), isc::run_script::impl, CalloutHandle::NEXT_STEP_DROP, and CalloutHandle::NEXT_STEP_SKIP.

Here is the call graph for this function:

## ◆ lease4_renew()

int lease4_renew | ( | CalloutHandle & | handle | ) |

handle lease4_renew hook and set environment parameters for the script.

IN: query4 subnet4 clientid hwaddr lease4 OUT: next_step

Definition at line 94 of file run_script_callouts.cc.

References isc::run_script::RunScriptImpl::extractClientId(), isc::run_script::RunScriptImpl::extractHWAddr(), isc::run_script::RunScriptImpl::extractLease4(), isc::run_script::RunScriptImpl::extractPkt4(), isc::run_script::RunScriptImpl::extractSubnet4(), isc::hooks::CalloutHandle::getArgument(), isc::hooks::CalloutHandle::getStatus(), isc::run_script::impl, CalloutHandle::NEXT_STEP_DROP, and CalloutHandle::NEXT_STEP_SKIP.

Here is the call graph for this function:

## ◆ lease6_decline()

int lease6_decline | ( | CalloutHandle & | handle | ) |

handle lease6_decline hook and set environment parameters for the script.

IN: query6 lease6 OUT: next_step

Definition at line 393 of file run_script_callouts.cc.

References isc::run_script::RunScriptImpl::extractLease6(), isc::run_script::RunScriptImpl::extractPkt6(), isc::hooks::CalloutHandle::getArgument(), isc::hooks::CalloutHandle::getStatus(), isc::run_script::impl, CalloutHandle::NEXT_STEP_DROP, and CalloutHandle::NEXT_STEP_SKIP.

Here is the call graph for this function:

## ◆ lease6_expire()

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

handle lease6_expire hook and set environment parameters for the script.

IN: lease6 remove_lease OUT: next_step

Definition at line 301 of file run_script_callouts.cc.

References isc::run_script::RunScriptImpl::extractBoolean(), isc::run_script::RunScriptImpl::extractLease6(), isc::hooks::CalloutHandle::getArgument(), isc::hooks::CalloutHandle::getStatus(), isc::run_script::impl, CalloutHandle::NEXT_STEP_DROP, and CalloutHandle::NEXT_STEP_SKIP.

Here is the call graph for this function:

## ◆ lease6_rebind()

int lease6_rebind | ( | CalloutHandle & | handle | ) |

handle lease6_rebind hook and set environment parameters for the script.

IN: query6 lease6 ia_na/ia_pd OUT: next_step

Definition at line 271 of file run_script_callouts.cc.

References isc::run_script::RunScriptImpl::extractLease6(), isc::run_script::RunScriptImpl::extractOptionIA(), isc::run_script::RunScriptImpl::extractPkt6(), isc::hooks::CalloutHandle::getArgument(), isc::hooks::CalloutHandle::getStatus(), isc::run_script::impl, CalloutHandle::NEXT_STEP_DROP, CalloutHandle::NEXT_STEP_SKIP, and isc::dhcp::Lease::TYPE_NA.

Here is the call graph for this function:

## ◆ lease6_recover()

int lease6_recover | ( | CalloutHandle & | handle | ) |

handle lease6_recover hook and set environment parameters for the script.

IN: lease6 OUT: next_step

Definition at line 324 of file run_script_callouts.cc.

References isc::run_script::RunScriptImpl::extractLease6(), isc::hooks::CalloutHandle::getArgument(), isc::hooks::CalloutHandle::getStatus(), isc::run_script::impl, CalloutHandle::NEXT_STEP_DROP, and CalloutHandle::NEXT_STEP_SKIP.

Here is the call graph for this function:

## ◆ lease6_release()

int lease6_release | ( | CalloutHandle & | handle | ) |

handle lease6_release hook and set environment parameters for the script.

IN: query6 lease6 OUT: next_step

Definition at line 370 of file run_script_callouts.cc.

References isc::run_script::RunScriptImpl::extractLease6(), isc::run_script::RunScriptImpl::extractPkt6(), isc::hooks::CalloutHandle::getArgument(), isc::hooks::CalloutHandle::getStatus(), isc::run_script::impl, CalloutHandle::NEXT_STEP_DROP, and CalloutHandle::NEXT_STEP_SKIP.

Here is the call graph for this function:

## ◆ lease6_renew()

int lease6_renew | ( | CalloutHandle & | handle | ) |

handle lease6_renew hook and set environment parameters for the script.

IN: query6 lease6 ia_na/ia_pd OUT: next_step

Definition at line 241 of file run_script_callouts.cc.

References isc::run_script::RunScriptImpl::extractLease6(), isc::run_script::RunScriptImpl::extractOptionIA(), isc::run_script::RunScriptImpl::extractPkt6(), isc::hooks::CalloutHandle::getArgument(), isc::hooks::CalloutHandle::getStatus(), isc::run_script::impl, CalloutHandle::NEXT_STEP_DROP, CalloutHandle::NEXT_STEP_SKIP, and isc::dhcp::Lease::TYPE_NA.

Here is the call graph for this function:

## ◆ leases4_committed()

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

handle leases4_committed hook and set environment parameters for the script.

IN: query4 leases4 deleted_leases4 OUT: next_step

Definition at line 169 of file run_script_callouts.cc.

References isc::run_script::RunScriptImpl::extractLeases4(), isc::run_script::RunScriptImpl::extractPkt4(), isc::hooks::CalloutHandle::getArgument(), isc::hooks::CalloutHandle::getStatus(), isc::run_script::impl, CalloutHandle::NEXT_STEP_DROP, and CalloutHandle::NEXT_STEP_SKIP.

Here is the call graph for this function:

## ◆ leases6_committed()

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

handle leases6_committed hook and set environment parameters for the script.

IN: query6 leases6 deleted_leases6 OUT: next_step

Definition at line 344 of file run_script_callouts.cc.

References isc::run_script::RunScriptImpl::extractLeases6(), isc::run_script::RunScriptImpl::extractPkt6(), isc::hooks::CalloutHandle::getArgument(), isc::hooks::CalloutHandle::getStatus(), isc::run_script::impl, 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 52 of file run_script_callouts.cc.

References isc::dhcp::CfgMgr::getFamily(), isc::process::Daemon::getProcName(), isc::run_script::impl, isc::dhcp::CfgMgr::instance(), isc_throw, LOG_ERROR, LOG_INFO, RUN_SCRIPT_LOAD, RUN_SCRIPT_LOAD_ERROR, and isc::run_script::run_script_logger.

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 445 of file run_script_callouts.cc.

## ◆ unload()

int unload | ( |  | ) |

This function is called when the library is unloaded.

Returns
  always 0.

Definition at line 84 of file run_script_callouts.cc.

References isc::run_script::impl, LOG_INFO, isc::run_script::run_script_logger, and RUN_SCRIPT_UNLOAD.