Commit 7f62f7f1 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰

[3590] Hook libraries information is now stored in SrvConfig

parent 2f45d13a
......@@ -515,6 +515,11 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
if (config_pair.first == "hooks-libraries") {
hooks_parser.parse(config_pair.second);
hooks_parser.verifyLibraries();
// We need to store hooks information in the configuration.
hooks::HookLibsCollection libs;
hooks_parser.getLibraries(libs);
srv_cfg->setLibraries(libs);
continue;
}
......
......@@ -737,6 +737,11 @@ configureDhcp6Server(Dhcpv6Srv&, isc::data::ConstElementPtr config_set) {
if (config_pair.first == "hooks-libraries") {
hooks_parser.parse(config_pair.second);
hooks_parser.verifyLibraries();
// We need to store hooks information in the configuration.
hooks::HookLibsCollection libs;
hooks_parser.getLibraries(libs);
srv_config->setLibraries(libs);
continue;
}
......
......@@ -22,6 +22,7 @@
#include <dhcpsrv/client_class_def.h>
#include <dhcpsrv/d2_client_cfg.h>
#include <dhcpsrv/logging_info.h>
#include <hooks/libinfo.h>
#include <cc/data.h>
#include <boost/shared_ptr.hpp>
#include <vector>
......@@ -521,6 +522,19 @@ public:
d2_client_config_ = d2_client_config;
}
/// @brief Returns a list of hook libraries
/// @return a list of hook libraries
const hooks::HookLibsCollection& getLibraries() const {
return (libraries_);
}
/// @brief Sets the list of hook libraries
///
/// @params libs a coolection of libraries to remember.
void setLibraries(const hooks::HookLibsCollection& libs) {
libraries_ = libs;
}
private:
/// @brief Sequence number identifying the configuration.
......@@ -609,6 +623,9 @@ private:
uint32_t dhcp4o6_port_;
D2ClientConfigPtr d2_client_config_;
/// List of hook libraries.
hooks::HookLibsCollection libraries_;
};
/// @name Pointers to the @c SrvConfig object.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment