![]() |
Kea 3.1.1
|
Defines the load and unload hooks library functions. More...
#include <config.h>
#include <asiolink/io_service.h>
#include <asiolink/io_service_mgr.h>
#include <cc/data.h>
#include <hooks/hooks.h>
#include <database/database_connection.h>
#include <dhcpsrv/cfgmgr.h>
#include <process/daemon.h>
#include <legal_log_log.h>
#include <legal_syslog.h>
#include <dhcpsrv/legal_log_mgr.h>
#include <rotating_file.h>
#include <boost/lexical_cast.hpp>
#include <sstream>
#include <string>
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. | |
Defines the load and unload hooks library functions.
Definition in file forensic_log/load_unload.cc.
int load | ( | LibraryHandle & | handle | ) |
Called by the Hooks library manager when the library is loaded.
Instantiates the LegalLogMgr and then opens it. If there is no type or type is logfile, use a RotatingFile else use a Database.
Definition at line 49 of file forensic_log/load_unload.cc.
References isc::dhcp::LegalLogMgrFactory::addBackend(), isc::legal_log::LegalSyslog::factory(), isc::legal_log::RotatingFile::factory(), isc::dhcp::CfgMgr::getFamily(), isc::hooks::LibraryHandle::getLibraryIndex(), isc::hooks::LibraryHandle::getParameters(), isc::process::Daemon::getProcName(), isc::dhcp::CfgMgr::instance(), isc_throw, LEGAL_LOG_DB_OPEN_CONNECTION_WITH_RETRY_FAILED, LEGAL_LOG_LOAD_ERROR, isc::legal_log::legal_log_logger, LOG_ERROR, LOG_INFO, isc::dhcp::LegalLogMgr::parseConfig(), isc::db::DatabaseConnection::redactedAccessString(), isc::dhcp::LegalLogMgrFactory::registerBackendFactory(), and isc::Exception::what().
int multi_threading_compatible | ( | ) |
This function is called to retrieve the multi-threading compatibility.
Definition at line 124 of file forensic_log/load_unload.cc.
int unload | ( | ) |
Called by the Hooks library manager when the library is unloaded.
Explicitly destroys the LegalLogMgr instance. Any errors are logged but swallowed.
Definition at line 102 of file forensic_log/load_unload.cc.
References isc::dhcp::LegalLogMgrFactory::delAllBackends(), isc::legal_log::legal_log_logger, LEGAL_LOG_UNLOAD_ERROR, LOG_ERROR, and isc::dhcp::LegalLogMgrFactory::unregisterBackendFactory().