Kea 3.1.1
ddns_tuning_callouts.cc File Reference
#include <config.h>
#include <database/audit_entry.h>
#include <ddns_tuning.h>
#include <ddns_tuning_log.h>
#include <cc/command_interpreter.h>
#include <dhcp/option_string.h>
#include <dhcp/option4_client_fqdn.h>
#include <dhcp/option6_client_fqdn.h>
#include <dhcpsrv/cfgmgr.h>
#include <dhcpsrv/subnet.h>
#include <dhcp/pkt4.h>
#include <dhcp/pkt6.h>
#include <hooks/hooks.h>
#include <process/daemon.h>
#include <string>
+ Include dependency graph for ddns_tuning_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::ddns_tuning
 

Functions

int cb4_updated (CalloutHandle &handle)
 This callout is called at the "cb4_updated" hook.
 
int cb6_updated (CalloutHandle &handle)
 This callout is called at the "cb6_updated" hook.
 
int ddns4_update (CalloutHandle &handle)
 This callout is called at the "ddns4_update" hook.
 
int ddns6_update (CalloutHandle &handle)
 This callout is called at the "ddns6_update" hook.
 
int dhcp4_srv_configured (CalloutHandle &handle)
 This callout is called at the "dhcp4_srv_configured" hook.
 
int dhcp6_srv_configured (CalloutHandle &handle)
 This callout is called at the "dhcp6_srv_configured" hook.
 
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

DdnsTuningImplPtr isc::ddns_tuning::impl
 

Function Documentation

◆ cb4_updated()

int cb4_updated ( CalloutHandle & handle)

This callout is called at the "cb4_updated" hook.

If it detects that any subnets were altered by the update it replaces the subnet expression cache contents with new expressions for the subnets contained in current server configuration. If any of the subnet expressions fail to parse this function will return a non-zero value.

Parameters
handleCalloutHandle.
Returns
0 upon success, number of expressions that failed otherwise.

Definition at line 57 of file ddns_tuning_callouts.cc.

References isc::hooks::CalloutHandle::getArgument(), isc::ddns_tuning::impl, and isc::dhcp::CfgMgr::instance().

+ Here is the call graph for this function:

◆ cb6_updated()

int cb6_updated ( CalloutHandle & handle)

This callout is called at the "cb6_updated" hook.

If it detects that any subnets were altered by the update it replaces the subnet expression cache contents with new expressions for the subnets contained in current server configuration. If any of the subnet expressions fail to parse this function will return a non-zero value.

Parameters
handleCalloutHandle.
Returns
0 upon success, number of expressions that failed otherwise.

Definition at line 189 of file ddns_tuning_callouts.cc.

References isc::hooks::CalloutHandle::getArgument(), isc::ddns_tuning::impl, and isc::dhcp::CfgMgr::instance().

+ Here is the call graph for this function:

◆ ddns4_update()

int ddns4_update ( CalloutHandle & handle)

This callout is called at the "ddns4_update" hook.

Attempts to calculate a host name for the given client query for the given subnet based on configured host name expressions. If this results in a different, non-empty host name value then the original host name:

  1. The new name is qualified based on the given DDNS behavioral parameters (i.e. ddns-qualifying-suffix)

The forward and reverse flag arguments are not currently used.

Parameters
handleCalloutHandle.
Returns
0 upon success, non-zero otherwise

Definition at line 112 of file ddns_tuning_callouts.cc.

References isc::log::DBGLVL_TRACE_BASIC, DDNS_TUNING4_CALCULATED_HOSTNAME, DDNS_TUNING4_PROCESS_ERROR, DDNS_TUNING4_SKIPPING_DDNS, isc::ddns_tuning::ddns_tuning_logger, isc::hooks::CalloutHandle::getArgument(), isc::dhcp::CfgMgr::getD2ClientMgr(), isc::dhcp::OptionDataTypeUtil::getLabelCount(), isc::hooks::CalloutHandle::getStatus(), isc::ddns_tuning::impl, isc::dhcp::CfgMgr::instance(), isc_throw, LOG_DEBUG, LOG_ERROR, CalloutHandle::NEXT_STEP_DROP, isc::dhcp::D2ClientMgr::qualifyName(), and isc::hooks::CalloutHandle::setArgument().

+ Here is the call graph for this function:

◆ ddns6_update()

int ddns6_update ( CalloutHandle & handle)

This callout is called at the "ddns6_update" hook.

Attempts to calculate a host name for the given client query for the given subnet based on configured host name expressions. If this results in a different, non-empty host name value then the original host name:

  1. The new name is qualified based on the given DDNS behavioral parameters (i.e. ddns-qualifying-suffix)

The forward and reverse flag arguments are not currently used.

Parameters
handleCalloutHandle.
Returns
0 upon success, non-zero otherwise

Definition at line 244 of file ddns_tuning_callouts.cc.

References isc::log::DBGLVL_TRACE_BASIC, DDNS_TUNING6_CALCULATED_HOSTNAME, DDNS_TUNING6_PROCESS_ERROR, DDNS_TUNING6_SKIPPING_DDNS, isc::ddns_tuning::ddns_tuning_logger, isc::hooks::CalloutHandle::getArgument(), isc::dhcp::CfgMgr::getD2ClientMgr(), isc::dhcp::OptionDataTypeUtil::getLabelCount(), isc::hooks::CalloutHandle::getStatus(), isc::ddns_tuning::impl, isc::dhcp::CfgMgr::instance(), isc_throw, LOG_DEBUG, LOG_ERROR, CalloutHandle::NEXT_STEP_DROP, isc::dhcp::D2ClientMgr::qualifyName(), and isc::hooks::CalloutHandle::setArgument().

+ Here is the call graph for this function:

◆ dhcp4_srv_configured()

int dhcp4_srv_configured ( CalloutHandle & handle)

This callout is called at the "dhcp4_srv_configured" hook.

It replaces the subnet expression cache contents with new expressions for the subnets contained in the server configuration passed in via the handle. If any of the subnet expressions fail to parse this function will return a non-zero value.

Parameters
handleCalloutHandle.
Returns
0 upon success, number of expressions that failed otherwise

Definition at line 86 of file ddns_tuning_callouts.cc.

References isc::db::error, isc::hooks::CalloutHandle::getArgument(), isc::ddns_tuning::impl, isc::hooks::CalloutHandle::NEXT_STEP_DROP, 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)

This callout is called at the "dhcp6_srv_configured" hook.

It replaces the subnet expression cache contents with new expressions for the subnets contained in the server configuration passed in via the handle. If any of the subnet expressions fail to parse this function will return a non-zero value.

Parameters
handleCalloutHandle.
Returns
0 upon success, number of expressions that failed otherwise

Definition at line 218 of file ddns_tuning_callouts.cc.

References isc::db::error, isc::hooks::CalloutHandle::getArgument(), isc::ddns_tuning::impl, isc::hooks::CalloutHandle::NEXT_STEP_DROP, isc::hooks::CalloutHandle::setArgument(), and isc::hooks::CalloutHandle::setStatus().

+ Here is the call graph for this function:

◆ load()

int load ( LibraryHandle & handle)

This function is called when the library is loaded.

Parameters
handlelibrary handle
Returns
0 when initialization is successful, 1 otherwise

Definition at line 314 of file ddns_tuning_callouts.cc.

References DDNS_TUNING_LOAD_ERROR, DDNS_TUNING_LOAD_OK, isc::ddns_tuning::ddns_tuning_logger, isc::dhcp::CfgMgr::getFamily(), isc::hooks::LibraryHandle::getParameters(), isc::process::Daemon::getProcName(), isc::ddns_tuning::impl, isc::dhcp::CfgMgr::instance(), isc_throw, LOG_ERROR, and LOG_INFO.

+ 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 356 of file ddns_tuning_callouts.cc.

◆ unload()

int unload ( )

This function is called when the library is unloaded.

Returns
always 0.

Definition at line 347 of file ddns_tuning_callouts.cc.

References isc::ddns_tuning::ddns_tuning_logger, DDNS_TUNING_UNLOAD, isc::ddns_tuning::impl, and LOG_INFO.