From: Marcin Siodelski Date: Wed, 27 Mar 2019 18:22:17 +0000 (+0100) Subject: [#103,!289] Added by-id index to shared networks collection. X-Git-Tag: Kea-1.6.0-beta~281 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38b2a2e48a321d6317a21fdafd3fbbf8e5401dc1;p=thirdparty%2Fkea.git [#103,!289] Added by-id index to shared networks collection. --- diff --git a/src/lib/dhcpsrv/shared_network.h b/src/lib/dhcpsrv/shared_network.h index c73588ec2a..041b2a0ce9 100644 --- a/src/lib/dhcpsrv/shared_network.h +++ b/src/lib/dhcpsrv/shared_network.h @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -26,6 +27,9 @@ namespace dhcp { /// @brief A tag for accessing random access index. struct SharedNetworkRandomAccessIndexTag { }; +/// @brief A tag for accessing index by id. +struct SharedNetworkIdIndexTag { }; + /// @brief A tag for accessing index by shared network name. struct SharedNetworkNameIndexTag { }; @@ -170,20 +174,26 @@ typedef boost::multi_index_container< boost::multi_index::random_access< boost::multi_index::tag >, - // Second index allows for access by shared network's name. + // Second index allows for access by shared network id. + boost::multi_index::hashed_non_unique< + boost::multi_index::tag, + boost::multi_index::const_mem_fun + >, + // Third index allows for access by shared network's name. boost::multi_index::ordered_unique< boost::multi_index::tag, boost::multi_index::const_mem_fun >, - // Third index allows for access by server identifier specified for the + // Fourth index allows for access by server identifier specified for the // network. boost::multi_index::ordered_non_unique< boost::multi_index::tag, boost::multi_index::const_mem_fun >, - // Fourth index allows for searching using subnet modification time. + // Fifth index allows for searching using subnet modification time. boost::multi_index::ordered_non_unique< boost::multi_index::tag, boost::multi_index::const_mem_fun >, - // Second index allows for access by shared network's name. + // Second index allows for access by shared network id. + boost::multi_index::hashed_non_unique< + boost::multi_index::tag, + boost::multi_index::const_mem_fun + >, + // Third index allows for access by shared network's name. boost::multi_index::ordered_unique< boost::multi_index::tag, boost::multi_index::const_mem_fun >, - // Third index allows for searching using subnet modification time. + // Fourth index allows for searching using subnet modification time. boost::multi_index::ordered_non_unique< boost::multi_index::tag, boost::multi_index::const_mem_fun