From: Marcin Siodelski Date: Wed, 3 Apr 2019 19:07:34 +0000 (+0200) Subject: [#103,!289] Added indexes by option id for. X-Git-Tag: Kea-1.6.0-beta~280 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fee10c4cfe34db23efcb73d8feaeb1bb33e9329;p=thirdparty%2Fkea.git [#103,!289] Added indexes by option id for. --- 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;