Kea  1.5.0
isc::hooks Namespace Reference

Classes

class  CalloutHandle
 Per-packet callout handle. More...
 
class  CalloutHandleAssociate
 Base class for classes which need to be associated with a CalloutHandle object. More...
 
class  CalloutManager
 Callout Manager. More...
 
class  DuplicateHook
 Duplicate hook. More...
 
class  HooksConfig
 Wrapper class that holds hooks libraries configuration. More...
 
class  HooksLibrariesParser
 Parser for hooks library list. More...
 
class  HooksManager
 Hooks Manager. More...
 
class  InvalidHooksLibraries
 Exception thrown when a library failed to validate. More...
 
class  LibraryHandle
 Library handle. More...
 
class  LibraryManager
 Library manager. More...
 
class  LibraryManagerCollection
 Library manager collection. More...
 
class  LoadLibrariesNotCalled
 LoadLibraries not called. More...
 
class  NoCalloutManager
 No Callout Manager. More...
 
class  NoSuchArgument
 No such argument. More...
 
class  NoSuchCalloutContext
 No such callout context item. More...
 
class  NoSuchHook
 Invalid hook. More...
 
class  NoSuchLibrary
 No such library. More...
 
class  ParkingLot
 Parking lot for objects, e.g. More...
 
class  ParkingLotHandle
 Provides a limited view to the ParkingLot. More...
 
class  ParkingLots
 Collection of parking lots for various hook points. More...
 
class  PointerConverter
 Local class for conversion of void pointers to function pointers. More...
 
class  ScopedCalloutHandleState
 Wrapper class around callout handle which automatically resets handle's state. More...
 
class  ServerHooks
 Server hook collection. More...
 

Typedefs

typedef boost::shared_ptr< CalloutHandleCalloutHandlePtr
 A shared pointer to a CalloutHandle object. More...
 
typedef int(* CalloutPtr) (CalloutHandle &)
 Typedef for a callout pointer. (Callouts must have "C" linkage.) More...
 
typedef std::pair< std::string, data::ConstElementPtrHookLibInfo
 Entity that holds information about hook libraries and their parameters. More...
 
typedef std::vector< HookLibInfoHookLibsCollection
 A storage for information about hook libraries. More...
 
typedef boost::shared_ptr< HookLibsCollectionHookLibsCollectionPtr
 Shared pointer to collection of hooks libraries. More...
 
typedef boost::shared_ptr< ParkingLotHandleParkingLotHandlePtr
 Pointer to the parking lot handle. More...
 
typedef boost::shared_ptr< ParkingLotParkingLotPtr
 Type of the pointer to the parking lot. More...
 
typedef boost::shared_ptr< ParkingLotsParkingLotsPtr
 Type of the pointer to the parking lots. More...
 
typedef boost::shared_ptr< ServerHooksServerHooksPtr
 

Functions

std::vector< std::string > extractNames (const isc::hooks::HookLibsCollection &libraries)
 Extracts names from HookLibsCollection. More...
 
void hooksStaticLinkInit ()
 User-Library Initialization for Statically-Linked Kea. More...
 

Variables

isc::log::Logger callouts_logger ("callouts")
 Callouts logger. More...
 
const int HOOKS_DBG_CALLS = isc::log::DBGLVL_TRACE_BASIC_DATA
 
const int HOOKS_DBG_EXTENDED_CALLS = isc::log::DBGLVL_TRACE_DETAIL_DATA
 
const int HOOKS_DBG_TRACE = isc::log::DBGLVL_TRACE_BASIC
 Hooks debug Logging levels. More...
 
isc::log::Logger hooks_logger ("hooks")
 Hooks Logger. More...
 

Typedef Documentation

◆ CalloutHandlePtr

typedef boost::shared_ptr<CalloutHandle> isc::hooks::CalloutHandlePtr

A shared pointer to a CalloutHandle object.

Definition at line 416 of file callout_handle.h.

◆ CalloutPtr

typedef int(* isc::hooks::CalloutPtr) (CalloutHandle &)

Typedef for a callout pointer. (Callouts must have "C" linkage.)

Definition at line 22 of file library_handle.h.

◆ HookLibInfo

typedef std::pair<std::string, data::ConstElementPtr> isc::hooks::HookLibInfo

Entity that holds information about hook libraries and their parameters.

The first parameter is a full filename with path to the library. The second parameter is a map of parameters that configure the library. There's always at least one parameter: "library", which contains the library name.

Definition at line 28 of file libinfo.h.

◆ HookLibsCollection

A storage for information about hook libraries.

Definition at line 31 of file libinfo.h.

◆ HookLibsCollectionPtr

Shared pointer to collection of hooks libraries.

Definition at line 34 of file libinfo.h.

◆ ParkingLotHandlePtr

Pointer to the parking lot handle.

Definition at line 292 of file parking_lots.h.

◆ ParkingLotPtr

typedef boost::shared_ptr<ParkingLot> isc::hooks::ParkingLotPtr

Type of the pointer to the parking lot.

Definition at line 219 of file parking_lots.h.

◆ ParkingLotsPtr

typedef boost::shared_ptr<ParkingLots> isc::hooks::ParkingLotsPtr

Type of the pointer to the parking lots.

Definition at line 328 of file parking_lots.h.

◆ ServerHooksPtr

typedef boost::shared_ptr<ServerHooks> isc::hooks::ServerHooksPtr

Definition at line 42 of file server_hooks.h.

Function Documentation

◆ extractNames()

std::vector< std::string > isc::hooks::extractNames ( const isc::hooks::HookLibsCollection libraries)

Extracts names from HookLibsCollection.

Extracts library names from full library information structure.

Parameters
librariesHook libraries collection
Returns
vector of strings with library names

Definition at line 19 of file libinfo.cc.

Referenced by isc::hooks::HooksConfig::verifyLibraries().

◆ hooksStaticLinkInit()

void isc::hooks::hooksStaticLinkInit ( )

User-Library Initialization for Statically-Linked Kea.

If Kea is statically-linked, a user-created hooks library will not be able to access symbols in it. In particular, it will not be able to access singleton objects.

The hooks framework handles some of this. For example, although there is a singleton ServerHooks object, hooks framework objects store a reference to it when they are created. When the user library needs to register a callout (which requires access to the ServerHooks information), it accesses the ServerHooks object through a pointer passed from the Kea image.

The logging framework is more problematical. Here the code is partly statically linked (the Kea logging library) and partly shared (the log4cplus). The state of the former is not accessible to the user library, but the state of the latter is. So within the user library, we need to initialize the Kea logging library but not initialize the log4cplus code. Some of the initialization is done when the library is loaded, but other parts are done at run-time.

This function - to be called by the user library code in its load() function when running against a statically linked Kea - initializes the Kea logging library. In particular, it loads the message dictionary with the text of the Kea messages.

Note
This means that the virtual address space is loaded with two copies of the message dictionary. Depending on how the user libraries are linked, loading multiple user libraries may involve loading one message dictionary per library.

Definition at line 374 of file library_manager.cc.

References isc::log::initLogger(), and isc::log::isLoggingInitialized().

+ Here is the call graph for this function:

Variable Documentation

◆ callouts_logger

isc::log::Logger isc::hooks::callouts_logger

Callouts logger.

This is the specialized logger used to log messages pertaining to the callouts execution. In particular, it logs when the callout is invoked and when it ends. It also logs the callout execution times.

Definition at line 44 of file hooks_log.h.

Referenced by isc::hooks::CalloutManager::callCallouts(), isc::hooks::CalloutManager::deregisterAllCallouts(), isc::hooks::CalloutManager::deregisterCallout(), and isc::hooks::CalloutManager::registerCallout().

◆ HOOKS_DBG_CALLS

◆ HOOKS_DBG_EXTENDED_CALLS

◆ HOOKS_DBG_TRACE

const int isc::hooks::HOOKS_DBG_TRACE = isc::log::DBGLVL_TRACE_BASIC

Hooks debug Logging levels.

Defines the levels used to output debug messages in the Hooks framework. Note that higher numbers equate to more verbose (and detailed) output.

Definition at line 22 of file hooks_log.h.

Referenced by isc::hooks::LibraryManager::loadLibrary(), isc::hooks::LibraryManager::runLoad(), isc::hooks::LibraryManager::runUnload(), and isc::hooks::LibraryManager::unloadLibrary().

◆ hooks_logger