Kea 3.1.1
load_unload.cc File Reference

Defines the load and unload hooks library functions. More...

#include <config.h>
#include <cc/data.h>
#include <dhcp/option.h>
#include <dhcpsrv/cfgmgr.h>
#include <eval/token.h>
#include <eval/eval_context.h>
#include <hooks/hooks.h>
#include <process/daemon.h>
#include <flex_id.h>
#include <flex_id_log.h>
+ Include dependency graph for flex_id/load_unload.cc:

Go to the source code of this file.

Functions

int load (LibraryHandle &handle)
 Called by the Hooks library manager when the library is loaded.
 
int multi_threading_compatible ()
 This function is called to retrieve the multi-threading compatibility.
 
int unload ()
 Called by the Hooks library manager when the library is unloaded.
 

Detailed Description

Defines the load and unload hooks library functions.

Definition in file flex_id/load_unload.cc.

Function Documentation

◆ load()

int load ( LibraryHandle & handle)

Called by the Hooks library manager when the library is loaded.

Parameters
handlelibrary handle passed for new library being loaded.
Returns
0 upon success, non-zero if the parameters passed to flex-id library are incorrect.

Definition at line 61 of file flex_id/load_unload.cc.

References Element::boolean, isc::flex_id::clearConfiguration(), isc::log::DBGLVL_TRACE_BASIC, FLEX_ID_EXPRESSION_INVALID_JSON_TYPE, FLEX_ID_IGNORE_IAID_ENABLED, FLEX_ID_IGNORE_IAID_JSON_TYPE, FLEX_ID_LOAD_ERROR, isc::flex_id::flex_id_logger, FLEX_ID_NO_IDENTIFIER_EXPRESSION, FLEX_ID_REPLACE_CLIENT_ID_JSON_TYPE, isc::dhcp::CfgMgr::getFamily(), isc::hooks::LibraryHandle::getParameter(), isc::process::Daemon::getProcName(), isc::dhcp::CfgMgr::instance(), isc_throw, LOG_DEBUG, LOG_ERROR, LOG_WARN, isc::flex_id::storeConfiguration(), Element::string, and Element::typeToName().

+ 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 161 of file flex_id/load_unload.cc.

◆ unload()

int unload ( )

Called by the Hooks library manager when the library is unloaded.

Returns
Always 0.

Definition at line 153 of file flex_id/load_unload.cc.

References isc::flex_id::flex_id_logger, FLEX_ID_UNLOAD, and LOG_INFO.