Kea  1.9.9-git
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  LibrariesStillOpened
 Libraries still opened. 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 isc::log::MessageID HOOKS_ALL_CALLOUTS_DEREGISTERED = "HOOKS_ALL_CALLOUTS_DEREGISTERED"
 
const isc::log::MessageID HOOKS_CALLOUT_CALLED = "HOOKS_CALLOUT_CALLED"
 
const isc::log::MessageID HOOKS_CALLOUT_DEREGISTERED = "HOOKS_CALLOUT_DEREGISTERED"
 
const isc::log::MessageID HOOKS_CALLOUT_ERROR = "HOOKS_CALLOUT_ERROR"
 
const isc::log::MessageID HOOKS_CALLOUT_EXCEPTION = "HOOKS_CALLOUT_EXCEPTION"
 
const isc::log::MessageID HOOKS_CALLOUT_REGISTRATION = "HOOKS_CALLOUT_REGISTRATION"
 
const isc::log::MessageID HOOKS_CALLOUTS_BEGIN = "HOOKS_CALLOUTS_BEGIN"
 
const isc::log::MessageID HOOKS_CALLOUTS_COMPLETE = "HOOKS_CALLOUTS_COMPLETE"
 
const isc::log::MessageID HOOKS_CALLOUTS_REMOVED = "HOOKS_CALLOUTS_REMOVED"
 
const isc::log::MessageID HOOKS_CLOSE_ERROR = "HOOKS_CLOSE_ERROR"
 
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...
 
const isc::log::MessageID HOOKS_HOOK_LIST_RESET = "HOOKS_HOOK_LIST_RESET"
 
const isc::log::MessageID HOOKS_INCORRECT_VERSION = "HOOKS_INCORRECT_VERSION"
 
const isc::log::MessageID HOOKS_LIBRARY_CLOSED = "HOOKS_LIBRARY_CLOSED"
 
const isc::log::MessageID HOOKS_LIBRARY_LOADED = "HOOKS_LIBRARY_LOADED"
 
const isc::log::MessageID HOOKS_LIBRARY_LOADING = "HOOKS_LIBRARY_LOADING"
 
const isc::log::MessageID HOOKS_LIBRARY_MULTI_THREADING_COMPATIBLE = "HOOKS_LIBRARY_MULTI_THREADING_COMPATIBLE"
 
const isc::log::MessageID HOOKS_LIBRARY_MULTI_THREADING_NOT_COMPATIBLE = "HOOKS_LIBRARY_MULTI_THREADING_NOT_COMPATIBLE"
 
const isc::log::MessageID HOOKS_LIBRARY_UNLOADED = "HOOKS_LIBRARY_UNLOADED"
 
const isc::log::MessageID HOOKS_LIBRARY_UNLOADING = "HOOKS_LIBRARY_UNLOADING"
 
const isc::log::MessageID HOOKS_LIBRARY_VERSION = "HOOKS_LIBRARY_VERSION"
 
const isc::log::MessageID HOOKS_LOAD_ERROR = "HOOKS_LOAD_ERROR"
 
const isc::log::MessageID HOOKS_LOAD_EXCEPTION = "HOOKS_LOAD_EXCEPTION"
 
const isc::log::MessageID HOOKS_LOAD_FRAMEWORK_EXCEPTION = "HOOKS_LOAD_FRAMEWORK_EXCEPTION"
 
const isc::log::MessageID HOOKS_LOAD_SUCCESS = "HOOKS_LOAD_SUCCESS"
 
isc::log::Logger hooks_logger ("hooks")
 Hooks Logger. More...
 
const isc::log::MessageID HOOKS_MULTI_THREADING_COMPATIBLE_EXCEPTION = "HOOKS_MULTI_THREADING_COMPATIBLE_EXCEPTION"
 
const isc::log::MessageID HOOKS_NO_LOAD = "HOOKS_NO_LOAD"
 
const isc::log::MessageID HOOKS_NO_UNLOAD = "HOOKS_NO_UNLOAD"
 
const isc::log::MessageID HOOKS_NO_VERSION = "HOOKS_NO_VERSION"
 
const isc::log::MessageID HOOKS_OPEN_ERROR = "HOOKS_OPEN_ERROR"
 
const isc::log::MessageID HOOKS_STD_CALLOUT_REGISTERED = "HOOKS_STD_CALLOUT_REGISTERED"
 
const isc::log::MessageID HOOKS_UNLOAD_ERROR = "HOOKS_UNLOAD_ERROR"
 
const isc::log::MessageID HOOKS_UNLOAD_EXCEPTION = "HOOKS_UNLOAD_EXCEPTION"
 
const isc::log::MessageID HOOKS_UNLOAD_FRAMEWORK_EXCEPTION = "HOOKS_UNLOAD_FRAMEWORK_EXCEPTION"
 
const isc::log::MessageID HOOKS_UNLOAD_SUCCESS = "HOOKS_UNLOAD_SUCCESS"
 
const isc::log::MessageID HOOKS_VERSION_EXCEPTION = "HOOKS_VERSION_EXCEPTION"
 

Typedef Documentation

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

A shared pointer to a CalloutHandle object.

Definition at line 436 of file callout_handle.h.

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.

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.

A storage for information about hook libraries.

Definition at line 31 of file libinfo.h.

Shared pointer to collection of hooks libraries.

Definition at line 34 of file libinfo.h.

Pointer to the parking lot handle.

Definition at line 375 of file parking_lots.h.

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

Type of the pointer to the parking lot.

Definition at line 288 of file parking_lots.h.

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

Type of the pointer to the parking lots.

Definition at line 415 of file parking_lots.h.

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

Definition at line 42 of file server_hooks.h.

Function Documentation

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().

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 428 of file library_manager.cc.

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

+ Here is the call graph for this function:

Variable Documentation

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().

const isc::log::MessageID isc::hooks::HOOKS_ALL_CALLOUTS_DEREGISTERED = "HOOKS_ALL_CALLOUTS_DEREGISTERED"

Definition at line 11 of file hooks_messages.h.

Referenced by isc::hooks::CalloutManager::deregisterAllCallouts().

const isc::log::MessageID isc::hooks::HOOKS_CALLOUT_CALLED = "HOOKS_CALLOUT_CALLED"

Definition at line 15 of file hooks_messages.h.

Referenced by isc::hooks::CalloutManager::callCallouts().

const isc::log::MessageID isc::hooks::HOOKS_CALLOUT_DEREGISTERED = "HOOKS_CALLOUT_DEREGISTERED"

Definition at line 16 of file hooks_messages.h.

Referenced by isc::hooks::CalloutManager::deregisterCallout().

const isc::log::MessageID isc::hooks::HOOKS_CALLOUT_ERROR = "HOOKS_CALLOUT_ERROR"

Definition at line 17 of file hooks_messages.h.

Referenced by isc::hooks::CalloutManager::callCallouts().

const isc::log::MessageID isc::hooks::HOOKS_CALLOUT_EXCEPTION = "HOOKS_CALLOUT_EXCEPTION"

Definition at line 18 of file hooks_messages.h.

Referenced by isc::hooks::CalloutManager::callCallouts().

const isc::log::MessageID isc::hooks::HOOKS_CALLOUT_REGISTRATION = "HOOKS_CALLOUT_REGISTRATION"

Definition at line 19 of file hooks_messages.h.

Referenced by isc::hooks::CalloutManager::registerCallout().

const isc::log::MessageID isc::hooks::HOOKS_CALLOUTS_BEGIN = "HOOKS_CALLOUTS_BEGIN"

Definition at line 12 of file hooks_messages.h.

Referenced by isc::hooks::CalloutManager::callCallouts().

const isc::log::MessageID isc::hooks::HOOKS_CALLOUTS_COMPLETE = "HOOKS_CALLOUTS_COMPLETE"

Definition at line 13 of file hooks_messages.h.

Referenced by isc::hooks::CalloutManager::callCallouts().

const isc::log::MessageID isc::hooks::HOOKS_CALLOUTS_REMOVED = "HOOKS_CALLOUTS_REMOVED"

Definition at line 14 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::prepareUnloadLibrary().

const isc::log::MessageID isc::hooks::HOOKS_CLOSE_ERROR = "HOOKS_CLOSE_ERROR"

Definition at line 20 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::closeLibrary().

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::prepareUnloadLibrary(), isc::hooks::LibraryManager::runLoad(), and isc::hooks::LibraryManager::unloadLibrary().

const isc::log::MessageID isc::hooks::HOOKS_HOOK_LIST_RESET = "HOOKS_HOOK_LIST_RESET"

Definition at line 21 of file hooks_messages.h.

Referenced by isc::hooks::ServerHooks::reset().

const isc::log::MessageID isc::hooks::HOOKS_INCORRECT_VERSION = "HOOKS_INCORRECT_VERSION"

Definition at line 22 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::checkVersion().

const isc::log::MessageID isc::hooks::HOOKS_LIBRARY_CLOSED = "HOOKS_LIBRARY_CLOSED"

Definition at line 23 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::closeLibrary().

const isc::log::MessageID isc::hooks::HOOKS_LIBRARY_LOADED = "HOOKS_LIBRARY_LOADED"

Definition at line 24 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::loadLibrary().

const isc::log::MessageID isc::hooks::HOOKS_LIBRARY_LOADING = "HOOKS_LIBRARY_LOADING"

Definition at line 25 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::loadLibrary().

const isc::log::MessageID isc::hooks::HOOKS_LIBRARY_MULTI_THREADING_COMPATIBLE = "HOOKS_LIBRARY_MULTI_THREADING_COMPATIBLE"
const isc::log::MessageID isc::hooks::HOOKS_LIBRARY_MULTI_THREADING_NOT_COMPATIBLE = "HOOKS_LIBRARY_MULTI_THREADING_NOT_COMPATIBLE"
const isc::log::MessageID isc::hooks::HOOKS_LIBRARY_UNLOADED = "HOOKS_LIBRARY_UNLOADED"

Definition at line 28 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::unloadLibrary().

const isc::log::MessageID isc::hooks::HOOKS_LIBRARY_UNLOADING = "HOOKS_LIBRARY_UNLOADING"

Definition at line 29 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::unloadLibrary().

const isc::log::MessageID isc::hooks::HOOKS_LIBRARY_VERSION = "HOOKS_LIBRARY_VERSION"

Definition at line 30 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::checkVersion().

const isc::log::MessageID isc::hooks::HOOKS_LOAD_ERROR = "HOOKS_LOAD_ERROR"

Definition at line 31 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::runLoad().

const isc::log::MessageID isc::hooks::HOOKS_LOAD_EXCEPTION = "HOOKS_LOAD_EXCEPTION"

Definition at line 32 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::runLoad().

const isc::log::MessageID isc::hooks::HOOKS_LOAD_FRAMEWORK_EXCEPTION = "HOOKS_LOAD_FRAMEWORK_EXCEPTION"

Definition at line 33 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::runLoad().

const isc::log::MessageID isc::hooks::HOOKS_LOAD_SUCCESS = "HOOKS_LOAD_SUCCESS"

Definition at line 34 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::runLoad().

const isc::log::MessageID isc::hooks::HOOKS_MULTI_THREADING_COMPATIBLE_EXCEPTION = "HOOKS_MULTI_THREADING_COMPATIBLE_EXCEPTION"
const isc::log::MessageID isc::hooks::HOOKS_NO_LOAD = "HOOKS_NO_LOAD"

Definition at line 36 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::runLoad().

const isc::log::MessageID isc::hooks::HOOKS_NO_UNLOAD = "HOOKS_NO_UNLOAD"

Definition at line 37 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::prepareUnloadLibrary().

const isc::log::MessageID isc::hooks::HOOKS_NO_VERSION = "HOOKS_NO_VERSION"

Definition at line 38 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::checkVersion().

const isc::log::MessageID isc::hooks::HOOKS_OPEN_ERROR = "HOOKS_OPEN_ERROR"

Definition at line 39 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::openLibrary().

const isc::log::MessageID isc::hooks::HOOKS_STD_CALLOUT_REGISTERED = "HOOKS_STD_CALLOUT_REGISTERED"
const isc::log::MessageID isc::hooks::HOOKS_UNLOAD_ERROR = "HOOKS_UNLOAD_ERROR"

Definition at line 41 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::prepareUnloadLibrary().

const isc::log::MessageID isc::hooks::HOOKS_UNLOAD_EXCEPTION = "HOOKS_UNLOAD_EXCEPTION"

Definition at line 42 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::prepareUnloadLibrary().

const isc::log::MessageID isc::hooks::HOOKS_UNLOAD_FRAMEWORK_EXCEPTION = "HOOKS_UNLOAD_FRAMEWORK_EXCEPTION"

Definition at line 43 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::prepareUnloadLibrary().

const isc::log::MessageID isc::hooks::HOOKS_UNLOAD_SUCCESS = "HOOKS_UNLOAD_SUCCESS"

Definition at line 44 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::prepareUnloadLibrary().

const isc::log::MessageID isc::hooks::HOOKS_VERSION_EXCEPTION = "HOOKS_VERSION_EXCEPTION"

Definition at line 45 of file hooks_messages.h.

Referenced by isc::hooks::LibraryManager::checkVersion().