13#include <boost/noncopyable.hpp>
14#include <boost/shared_ptr.hpp>
38class LibraryManagerCollection;
77 bool multi_threading_enabled =
false);
258 static std::vector<std::string>
validateLibraries(
const std::vector<std::string>& libraries,
259 bool multi_threading_enabled =
false);
296 static void park(
const std::string& hook_name, T parked_object,
297 std::function<
void()> unpark_callback) {
299 getParkingLotPtr(hook_name)->park(parked_object, unpark_callback);
313 static bool unpark(
const std::string& hook_name, T parked_object) {
315 getParkingLotPtr(hook_name)->
unpark(parked_object,
true));
325 static bool drop(
const std::string& hook_name, T parked_object) {
327 getParkingLotPtr(hook_name)->
drop(parked_object));
340 static void reference(
const std::string& hook_name, T parked_object) {
342 getParkingLotPtr(hook_name)->reference(parked_object);
399 bool multi_threading_enabled);
405 bool unloadLibrariesInternal();
408 void prepareUnloadLibrariesInternal();
416 bool calloutsPresentInternal(
int index);
427 bool commandHandlersPresentInternal(
const std::string& command_name);
444 void callCommandHandlersInternal(
const std::string& command_name,
450 boost::shared_ptr<CalloutHandle> createCalloutHandleInternal();
467 std::vector<std::string> getLibraryNamesInternal()
const;
479 boost::shared_ptr<LibraryManagerCollection> lm_collection_;
484 boost::shared_ptr<CalloutManager> callout_manager_;
This is a base class for exceptions thrown from the DNS library module.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Per-packet callout handle.
static int registerHook(const std::string &name)
Register Hook.
static LibraryHandle & postCalloutsLibraryHandle()
Return post-callouts library handle.
static bool calloutsPresent(int index)
Are callouts present?
static bool unpark(const std::string &hook_name, T parked_object)
Forces unparking the object (packet).
static void setTestMode(bool mode)
Set test mode.
static std::vector< std::string > getLibraryNames()
Return list of loaded libraries.
static void callCommandHandlers(const std::string &command_name, CalloutHandle &handle)
Calls the callouts/command handlers for a given command name.
static const int CONTEXT_CREATE
Index numbers for pre-defined hooks.
static std::vector< std::string > validateLibraries(const std::vector< std::string > &libraries, bool multi_threading_enabled=false)
Validate library list.
static bool unloadLibraries()
Unload libraries.
static bool loadLibraries(const HookLibsCollection &libraries, bool multi_threading_enabled=false)
Load and reload libraries.
static const int CONTEXT_DESTROY
static void park(const std::string &hook_name, T parked_object, std::function< void()> unpark_callback)
Park an object (packet).
static LibraryHandle & preCalloutsLibraryHandle()
Return pre-callouts library handle.
static bool commandHandlersPresent(const std::string &command_name)
Checks if control command handlers are present for the specified command.
static boost::shared_ptr< CalloutHandle > createCalloutHandle()
Return callout handle.
static void reference(const std::string &hook_name, T parked_object)
Increases reference counter for the parked object.
static void callCallouts(int index, CalloutHandle &handle)
Calls the callouts for a given hook.
static bool getTestMode()
Get test mode.
static HookLibsCollection getLibraryInfo()
Return list of loaded libraries with its parameters.
static void prepareUnloadLibraries()
Prepare the unloading of libraries.
static bool drop(const std::string &hook_name, T parked_object)
Removes parked object without calling a callback.
static void clearParkingLots()
Clears any parking packets.
LibrariesStillOpened(const char *file, size_t line, const char *what)
static ServerHooks & getServerHooks()
Return ServerHooks object.
static const int CONTEXT_DESTROY
static const int CONTEXT_CREATE
Index numbers for pre-defined hooks.
std::vector< HookLibInfo > HookLibsCollection
A storage for information about hook libraries.
Defines the logger used by the top-level component of kea-lfc.