#include <dhcpsrv/cfgmgr.h>
#include <dhcpsrv/parsers/client_class_def_parser.h>
#include <dhcp4/json_config_parser.h>
-#include <dhcpsrv/option_space_container.h>
#include <dhcpsrv/parsers/dbaccess_parser.h>
#include <dhcpsrv/parsers/dhcp_parsers.h>
#include <dhcpsrv/parsers/expiration_config_parser.h>
libkea_dhcp___la_SOURCES += option_definition.cc option_definition.h
libkea_dhcp___la_SOURCES += option_opaque_data_tuples.cc option_opaque_data_tuples.h
libkea_dhcp___la_SOURCES += option_space.cc option_space.h
+libkea_dhcp___la_SOURCES += option_space_container.h
libkea_dhcp___la_SOURCES += option_string.cc option_string.h
libkea_dhcp___la_SOURCES += protocol_util.cc protocol_util.h
libkea_dhcp___la_SOURCES += pkt.cc pkt.h
VendorOptionDefContainers LibDHCP::vendor6_defs_;
+// Static container with option definitions created in runtime.
+OptionDefSpaceContainer LibDHCP::runtime_option_defs_;
+
+
// Those two vendor classes are used for cable modems:
/// DOCSIS3.0 compatible cable modem
return (OptionDefinitionPtr());
}
+void
+LibDHCP::setRuntimeOptionDefs(const OptionDefSpaceContainer& defs) {
+
+}
+
+void
+LibDHCP::clearRuntimeOptionDefs() {
+ runtime_option_defs_.clearItems();
+}
+
+
bool
LibDHCP::isStandardOption(const Option::Universe u, const uint16_t code) {
if (u == Option::V6) {
#define LIBDHCP_H
#include <dhcp/option_definition.h>
+#include <dhcp/option_space_container.h>
#include <dhcp/pkt6.h>
#include <util/buffer.h>
const OptionBuffer& buf,
isc::dhcp::OptionCollection& options);
+
+ /// @brief Copies option definitions created at runtime.
+ ///
+ /// Copied option definitions will be used as "runtime" option definitions.
+ /// A typical use case is to set option definitions specified by the user
+ /// in the server configuration. These option definitions should be removed
+ /// or replaced with new option definitions upon reconfiguration.
+ ///
+ /// @param defs Const reference to a container holding option definitions
+ /// grouped by option spaces.
+ static void setRuntimeOptionDefs(const OptionDefSpaceContainer& defs);
+
+ /// @brief Removes runtime option definitions.
+ static void clearRuntimeOptionDefs();
+
private:
/// Initialize standard DHCPv4 option definitions.
/// Container for v6 vendor option definitions
static VendorOptionDefContainers vendor6_defs_;
+
+ /// Container for additional option defnitions created in runtime.
+ static OptionDefSpaceContainer runtime_option_defs_;
};
}
#include <dhcp/option.h>
#include <dhcp/option_data_types.h>
+#include <dhcp/option_space_container.h>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/mem_fun.hpp>
typedef std::pair<OptionDefContainerNameIndex::const_iterator,
OptionDefContainerNameIndex::const_iterator> OptionDefContainerNameRange;
+typedef OptionSpaceContainer<
+ OptionDefContainer, OptionDefinitionPtr, std::string
+> OptionDefSpaceContainer;
+
} // namespace isc::dhcp
} // namespace isc
if HAVE_PGSQL
libkea_dhcpsrv_la_SOURCES += pgsql_lease_mgr.cc pgsql_lease_mgr.h
endif
-libkea_dhcpsrv_la_SOURCES += option_space_container.h
libkea_dhcpsrv_la_SOURCES += pool.cc pool.h
libkea_dhcpsrv_la_SOURCES += srv_config.cc srv_config.h
libkea_dhcpsrv_la_SOURCES += subnet.cc subnet.h
#define CFG_OPTION_H
#include <dhcp/option.h>
+#include <dhcp/option_space_container.h>
#include <dhcpsrv/key_from_key.h>
-#include <dhcpsrv/option_space_container.h>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/sequenced_index.hpp>
#define CFG_OPTION_DEF_H
#include <dhcp/option_definition.h>
-#include <dhcpsrv/option_space_container.h>
+#include <dhcp/option_space_container.h>
#include <string>
namespace isc {
#include <asiolink/io_address.h>
#include <cc/data.h>
#include <dhcp/option_definition.h>
+#include <dhcp/option_space_container.h>
#include <dhcpsrv/d2_client_cfg.h>
#include <dhcpsrv/cfg_iface.h>
#include <dhcpsrv/cfg_option.h>
-#include <dhcpsrv/option_space_container.h>
#include <dhcpsrv/subnet.h>
#include <dhcpsrv/parsers/dhcp_config_parser.h>
#include <exceptions/exceptions.h>
namespace isc {
namespace dhcp {
-/// @brief Storage for option definitions.
-typedef OptionSpaceContainer<OptionDefContainer,
- OptionDefinitionPtr, std::string> OptionDefStorage;
-/// @brief Shared pointer to option definitions storage.
-typedef boost::shared_ptr<OptionDefStorage> OptionDefStoragePtr;
-
/// Collection of containers holding option spaces. Each container within
/// a particular option space holds so-called option descriptors.
typedef OptionSpaceContainer<OptionContainer, OptionDescriptor,
#include <asiolink/io_address.h>
#include <dhcp/option.h>
#include <dhcp/classify.h>
+#include <dhcp/option_space_container.h>
#include <dhcpsrv/cfg_option.h>
-#include <dhcpsrv/option_space_container.h>
#include <dhcpsrv/pool.h>
#include <dhcpsrv/triplet.h>
#include <dhcpsrv/lease.h>