From 0fee10c4cfe34db23efcb73d8feaeb1bb33e9329 Mon Sep 17 00:00:00 2001 From: Marcin Siodelski Date: Wed, 3 Apr 2019 21:07:34 +0200 Subject: [PATCH] [#103,!289] Added indexes by option id for. --- src/lib/dhcp/option_definition.h | 7 +++++++ src/lib/dhcp/option_space_container.h | 5 ++++- src/lib/dhcpsrv/cfg_option.h | 8 ++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/lib/dhcp/option_definition.h b/src/lib/dhcp/option_definition.h index 2d05c7dfa5..f644e6efb0 100644 --- a/src/lib/dhcp/option_definition.h +++ b/src/lib/dhcp/option_definition.h @@ -822,6 +822,13 @@ typedef boost::multi_index_container< boost::posix_time::ptime, &data::StampedElement::getModificationTime > + >, + // Start definition of index #4. + // Use StampedElement::getId as a key. + boost::multi_index::hashed_non_unique< + boost::multi_index::tag, + boost::multi_index::const_mem_fun > > > OptionDefContainer; diff --git a/src/lib/dhcp/option_space_container.h b/src/lib/dhcp/option_space_container.h index 8a7736f46d..4f54bb0cf3 100644 --- a/src/lib/dhcp/option_space_container.h +++ b/src/lib/dhcp/option_space_container.h @@ -1,4 +1,4 @@ -// Copyright (C) 2013-2017 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2013-2019 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -13,6 +13,9 @@ namespace isc { namespace dhcp { +/// @brief A tag for accessing DHCP options and definitions by id. +struct OptionIdIndexTag { }; + /// @brief Simple container for option spaces holding various items. /// /// This helper class is used to store items of various types diff --git a/src/lib/dhcpsrv/cfg_option.h b/src/lib/dhcpsrv/cfg_option.h index cfe7b5f703..bd54ff59bd 100644 --- a/src/lib/dhcpsrv/cfg_option.h +++ b/src/lib/dhcpsrv/cfg_option.h @@ -211,6 +211,14 @@ typedef boost::multi_index_container< boost::posix_time::ptime, &data::StampedElement::getModificationTime > + >, + + // Start definition of index #4. + // Use StampedElement::getId as a key. + boost::multi_index::hashed_non_unique< + boost::multi_index::tag, + boost::multi_index::const_mem_fun > > > OptionContainer; -- 2.47.2