Kea 2.7.6
flex_option_callouts.cc File Reference
#include <config.h>
#include <flex_option.h>
#include <flex_option_log.h>
#include <cc/command_interpreter.h>
#include <hooks/hooks.h>
#include <dhcp/pkt4.h>
#include <dhcp/pkt6.h>
#include <dhcpsrv/cfgmgr.h>
#include <process/daemon.h>
+ Include dependency graph for flex_option_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::flex_option
 

Functions

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 pkt4_send (CalloutHandle &handle)
 This callout is called at the "pkt4_send" hook.
 
int pkt6_send (CalloutHandle &handle)
 This callout is called at the "pkt6_send" hook.
 
int unload ()
 This function is called when the library is unloaded.
 

Variables

FlexOptionImplPtr isc::flex_option::impl
 

Function Documentation

◆ 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 124 of file flex_option_callouts.cc.

References FLEX_OPTION_LOAD_ERROR, isc::flex_option::flex_option_logger, isc::dhcp::CfgMgr::getFamily(), isc::hooks::LibraryHandle::getParameter(), isc::process::Daemon::getProcName(), isc::flex_option::impl, isc::dhcp::CfgMgr::instance(), isc_throw, and LOG_ERROR.

+ 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 165 of file flex_option_callouts.cc.

◆ pkt4_send()

int pkt4_send ( CalloutHandle & handle)

This callout is called at the "pkt4_send" hook.

It retrieves v4 query and response packets, and then adds, supersedes or removes option values in the response according to expressions evaluated on the query.

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

Definition at line 47 of file flex_option_callouts.cc.

References isc::flex_option::flex_option_logger, FLEX_OPTION_PROCESS_ERROR, isc::hooks::CalloutHandle::getArgument(), isc::hooks::CalloutHandle::getStatus(), isc::flex_option::impl, isc_throw, LOG_ERROR, isc::hooks::CalloutHandle::NEXT_STEP_DROP, isc::hooks::CalloutHandle::NEXT_STEP_SKIP, and isc::dhcp::Option::V4.

+ Here is the call graph for this function:

◆ pkt6_send()

int pkt6_send ( CalloutHandle & handle)

This callout is called at the "pkt6_send" hook.

It retrieves v6 query and response packets, and then adds, supersedes or removes option values in the response according to expressions evaluated on the query.

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

Definition at line 88 of file flex_option_callouts.cc.

References isc::flex_option::flex_option_logger, FLEX_OPTION_PROCESS_ERROR, isc::hooks::CalloutHandle::getArgument(), isc::hooks::CalloutHandle::getStatus(), isc::flex_option::impl, isc_throw, LOG_ERROR, isc::hooks::CalloutHandle::NEXT_STEP_DROP, isc::hooks::CalloutHandle::NEXT_STEP_SKIP, and isc::dhcp::Option::V6.

+ Here is the call graph for this function:

◆ unload()

int unload ( )

This function is called when the library is unloaded.

Returns
always 0.

Definition at line 156 of file flex_option_callouts.cc.

References isc::flex_option::flex_option_logger, FLEX_OPTION_UNLOAD, isc::flex_option::impl, and LOG_INFO.