12#include <boost/multi_index_container.hpp>
13#include <boost/multi_index/composite_key.hpp>
14#include <boost/multi_index/mem_fun.hpp>
15#include <boost/multi_index/member.hpp>
16#include <boost/multi_index/ordered_index.hpp>
17#include <boost/multi_index/sequenced_index.hpp>
18#include <boost/multi_index/hashed_index.hpp>
19#include <boost/multi_index/identity.hpp>
45typedef boost::multi_index_container<
49 boost::multi_index::indexed_by<
51 boost::multi_index::sequenced<
52 boost::multi_index::tag<HostSequencedIndexTag>
55 boost::multi_index::hashed_unique<
56 boost::multi_index::tag<HostHashedIndexTag>,
57 boost::multi_index::identity<dhcp::HostPtr>
63 boost::multi_index::ordered_non_unique<
64 boost::multi_index::tag<HostIdentifierIndexTag>,
68 boost::multi_index::composite_key<
73 boost::multi_index::const_mem_fun<
79 boost::multi_index::const_mem_fun<
88 boost::multi_index::ordered_non_unique<
89 boost::multi_index::tag<HostAddress4IndexTag>,
115typedef std::pair<HostContainerIdentifierIndex::iterator,
125typedef std::pair<HostContainerAddress4Index::iterator,
142 subnet_id_(host ? host->getIPv6SubnetID() :
dhcp::SUBNET_ID_UNUSED) {
156 return (
resrv_.getPrefix());
171typedef boost::multi_index_container<
177 boost::multi_index::indexed_by<
180 boost::multi_index::ordered_non_unique<
181 boost::multi_index::tag<Resv6AddressIndexTag>,
185 boost::multi_index::const_mem_fun<
190 boost::multi_index::ordered_unique<
191 boost::multi_index::tag<Resv6SubnetAddressIndexTag>,
195 boost::multi_index::composite_key<
208 boost::multi_index::const_mem_fun<
221typedef Resv6Container::index<Resv6AddressIndexTag>::type
225typedef std::pair<Resv6ContainerAddressIndex::iterator,
232typedef Resv6Container::index<Resv6SubnetAddressIndexTag>::type
236typedef std::pair<Resv6ContainerSubnetAddressIndex::iterator,
The IOAddress class represents an IP addresses (version agnostic)
Represents a device with IPv4 and/or IPv6 reservations.
IdentifierType
Type of the host identifier.
IdentifierType getIdentifierType() const
Returns the identifier type.
const asiolink::IOAddress & getIPv4Reservation() const
Returns reserved IPv4 address.
const std::vector< uint8_t > & getIdentifier() const
Returns the identifier in a binary form.
IPv6 reservation for a host.
boost::shared_ptr< Host > HostPtr
Pointer to the Host object.
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
HostContainer::index< HostAddress4IndexTag >::type HostContainerAddress4Index
Reserved Ipv4 address index type in the HostContainer.
std::pair< Resv6ContainerSubnetAddressIndex::iterator, Resv6ContainerSubnetAddressIndex::iterator > Resv6ContainerSubnetAddressIndexRange
Results range returned using the Resv6ContainerSubnetAddressIndex.
HostContainer::index< HostIdentifierIndexTag >::type HostContainerIdentifierIndex
Identifier index type in the HostContainer.
std::pair< HostContainerAddress4Index::iterator, HostContainerAddress4Index::iterator > HostContainerAddress4IndexRange
Results range returned using the HostContainerAddress4Index.
HostContainer::index< HostHashedIndexTag >::type HostContainerHashedIndex
Hashed index type in the HostContainer.
std::pair< HostContainerIdentifierIndex::iterator, HostContainerIdentifierIndex::iterator > HostContainerIdentifierIndexRange
Results range returned using the HostContainerIdentifierIndex.
boost::multi_index_container< dhcp::HostPtr, boost::multi_index::indexed_by< boost::multi_index::sequenced< boost::multi_index::tag< HostSequencedIndexTag > >, boost::multi_index::hashed_unique< boost::multi_index::tag< HostHashedIndexTag >, boost::multi_index::identity< dhcp::HostPtr > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< HostIdentifierIndexTag >, boost::multi_index::composite_key< dhcp::Host, boost::multi_index::const_mem_fun< dhcp::Host, const std::vector< uint8_t > &, &dhcp::Host::getIdentifier >, boost::multi_index::const_mem_fun< dhcp::Host, dhcp::Host::IdentifierType, &dhcp::Host::getIdentifierType > > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< HostAddress4IndexTag >, boost::multi_index::const_mem_fun< dhcp::Host, const asiolink::IOAddress &, &dhcp::Host::getIPv4Reservation > > > > HostContainer
Multi-index container holding host cache entries.
std::pair< Resv6ContainerAddressIndex::iterator, Resv6ContainerAddressIndex::iterator > Resv6ContainerAddressIndexRange
Results range returned using the Resv6ContainerAddressIndex.
boost::multi_index_container< HostResrv6Tuple, boost::multi_index::indexed_by< boost::multi_index::ordered_non_unique< boost::multi_index::tag< Resv6AddressIndexTag >, boost::multi_index::const_mem_fun< HostResrv6Tuple, const asiolink::IOAddress &, &HostResrv6Tuple::getKey > >, boost::multi_index::ordered_unique< boost::multi_index::tag< Resv6SubnetAddressIndexTag >, boost::multi_index::composite_key< HostResrv6Tuple, boost::multi_index::member< HostResrv6Tuple, const dhcp::SubnetID, &HostResrv6Tuple::subnet_id_ >, boost::multi_index::const_mem_fun< HostResrv6Tuple, const asiolink::IOAddress &, &HostResrv6Tuple::getKey > > > > > Resv6Container
Multi-index container holding IPv6 reservations.
Resv6Container::index< Resv6AddressIndexTag >::type Resv6ContainerAddressIndex
First index type in the Resv6Container.
HostContainer::index< HostSequencedIndexTag >::type HostContainerSequencedIndex
Sequenced index type in the HostContainer.
Resv6Container::index< Resv6SubnetAddressIndexTag >::type Resv6ContainerSubnetAddressIndex
Second index type in the Resv6Container.
Defines the logger used by the top-level component of kea-lfc.
Tag for the index for searching by reserved IPv4 address.
Tag for the hashed index.
Tag for the index for searching by identifier.
Defines one entry for the Host Container for v6 hosts.
const dhcp::IPv6Resrv resrv_
Address or prefix reservation.
dhcp::HostPtr host_
Pointer to the host object.
HostResrv6Tuple(const dhcp::IPv6Resrv &resrv, const dhcp::HostPtr &host)
Default constructor.
const dhcp::SubnetID subnet_id_
Value of the IPv6 Subnet-id.
const asiolink::IOAddress & getKey() const
Key extractor (used in the second composite key)
Tag for the sequenced index.
Tag for the index for searching by address.
Tag for the index for searching by subnet and address.