@@ -37,6 +37,9 @@ struct ExpirationIndexTag { };
3737// / @brief Tag for indexes by HW address, subnet-id tuple.
3838struct HWAddressSubnetIdIndexTag { };
3939
40+ // / @brief Tag for indexes by HW address.
41+ struct HWAddressIndexTag { };
42+
4043// / @brief Tag for indexes by client-id, subnet-id tuple.
4144struct ClientIdSubnetIdIndexTag { };
4245
@@ -176,25 +179,15 @@ typedef boost::multi_index_container<
176179 >
177180 >,
178181
179- // Specification of the eight index starts here.
180- boost::multi_index::ordered_non_unique<
181- boost::multi_index::tag<HWAddressSubnetIdIndexTag>,
182- // This is a composite index that combines two attributes of the
183- // Lease6 object: hardware address and subnet id.
184- boost::multi_index::composite_key<
185- Lease6,
186- // The hardware address is held in the hwaddr_ member of the
187- // Lease4 object, which is a HWAddr object. Boost does not
188- // provide a key extractor for getting a member of a member,
189- // so we need a simple method for that.
190- boost::multi_index::const_mem_fun<Lease, const std::vector<uint8_t >&,
191- &Lease::getHWAddrVector>,
192- // The subnet id is held in the subnet_id_ member of Lease6
193- // class. Note that the subnet_id_ is defined in the base
194- // class (Lease) so we have to point to this class rather
195- // than derived class: Lease6.
196- boost::multi_index::member<Lease, SubnetID, &Lease::subnet_id_>
197- >
182+ // Specification of the eighth index starts here.
183+ boost::multi_index::hashed_non_unique<
184+ boost::multi_index::tag<HWAddressIndexTag>,
185+ // The hardware address is held in the hwaddr_ member of the
186+ // Lease6 object, which is a HWAddr object. Boost does not
187+ // provide a key extractor for getting a member of a member,
188+ // so we need a simple method for that.
189+ boost::multi_index::const_mem_fun<Lease, const std::vector<uint8_t >&,
190+ &Lease::getHWAddrVector>
198191 >
199192 >
200193> Lease6Storage; // Specify the type name of this container.
@@ -364,9 +357,9 @@ typedef Lease6Storage::index<DuidIaidTypeIndexTag>::type Lease6StorageDuidIaidTy
364357// / @brief DHCPv6 lease storage index by expiration time.
365358typedef Lease6Storage::index<ExpirationIndexTag>::type Lease6StorageExpirationIndex;
366359
367- // / @brief DHCPv6 lease storage index by HW address and subnet-id .
368- typedef Lease6Storage::index<HWAddressSubnetIdIndexTag >::type
369- Lease6StorageHWAddressSubnetIdIndex ;
360+ // / @brief DHCPv6 lease storage index by HW address.
361+ typedef Lease6Storage::index<HWAddressIndexTag >::type
362+ Lease6StorageHWAddressIndex ;
370363
371364// / @brief DHCPv6 lease storage index by subnet-id.
372365typedef Lease6Storage::index<SubnetIdIndexTag>::type Lease6StorageSubnetIdIndex;
0 commit comments