7#ifndef MEMFILE_LEASE_STORAGE_H
8#define MEMFILE_LEASE_STORAGE_H
14#include <boost/multi_index/indexed_by.hpp>
15#include <boost/multi_index/member.hpp>
16#include <boost/multi_index/mem_fun.hpp>
17#include <boost/multi_index/ordered_index.hpp>
18#include <boost/multi_index_container.hpp>
19#include <boost/multi_index/composite_key.hpp>
65typedef boost::multi_index_container<
68 boost::multi_index::indexed_by<
72 boost::multi_index::ordered_unique<
73 boost::multi_index::tag<AddressIndexTag>,
74 boost::multi_index::member<Lease, isc::asiolink::IOAddress, &Lease::addr_>
78 boost::multi_index::ordered_non_unique<
79 boost::multi_index::tag<DuidIaidTypeIndexTag>,
82 boost::multi_index::composite_key<
86 boost::multi_index::const_mem_fun<Lease6, const std::vector<uint8_t>&,
90 boost::multi_index::member<Lease6, uint32_t, &Lease6::iaid_>,
91 boost::multi_index::member<Lease6, Lease::Type, &Lease6::type_>
96 boost::multi_index::ordered_non_unique<
97 boost::multi_index::tag<ExpirationIndexTag>,
102 boost::multi_index::composite_key<
105 boost::multi_index::const_mem_fun<
Lease, bool,
108 boost::multi_index::const_mem_fun<
Lease, int64_t,
115 boost::multi_index::ordered_non_unique<
116 boost::multi_index::tag<SubnetIdIndexTag>,
123 boost::multi_index::ordered_non_unique<
124 boost::multi_index::tag<DuidIndexTag>,
125 boost::multi_index::const_mem_fun<
Lease6,
126 const std::vector<uint8_t>&,
132 boost::multi_index::ordered_non_unique<
133 boost::multi_index::tag<HostnameIndexTag>,
134 boost::multi_index::member<Lease, std::string, &Lease::hostname_>
151typedef boost::multi_index_container<
155 boost::multi_index::indexed_by<
159 boost::multi_index::ordered_unique<
160 boost::multi_index::tag<AddressIndexTag>,
163 boost::multi_index::member<Lease, isc::asiolink::IOAddress, &Lease::addr_>
167 boost::multi_index::ordered_non_unique<
168 boost::multi_index::tag<HWAddressSubnetIdIndexTag>,
171 boost::multi_index::composite_key<
177 boost::multi_index::const_mem_fun<Lease, const std::vector<uint8_t>&,
183 boost::multi_index::member<Lease, SubnetID, &Lease::subnet_id_>
188 boost::multi_index::ordered_non_unique<
189 boost::multi_index::tag<ClientIdSubnetIdIndexTag>,
192 boost::multi_index::composite_key<
196 boost::multi_index::const_mem_fun<Lease4, const std::vector<uint8_t>&,
199 boost::multi_index::member<Lease, uint32_t, &Lease::subnet_id_>
204 boost::multi_index::ordered_non_unique<
205 boost::multi_index::tag<ExpirationIndexTag>,
210 boost::multi_index::composite_key<
213 boost::multi_index::const_mem_fun<
Lease, bool,
216 boost::multi_index::const_mem_fun<
Lease, int64_t,
223 boost::multi_index::ordered_non_unique<
224 boost::multi_index::tag<SubnetIdIndexTag>,
225 boost::multi_index::member<Lease, isc::dhcp::SubnetID, &Lease::subnet_id_>
230 boost::multi_index::ordered_non_unique<
231 boost::multi_index::tag<HostnameIndexTag>,
232 boost::multi_index::member<Lease, std::string, &Lease::hostname_>
268typedef Lease4Storage::index<HWAddressSubnetIdIndexTag>::type
272typedef Lease4Storage::index<ClientIdSubnetIdIndexTag>::type
boost::multi_index_container< Lease4Ptr, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< AddressIndexTag >, boost::multi_index::member< Lease, isc::asiolink::IOAddress, &Lease::addr_ > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< HWAddressSubnetIdIndexTag >, boost::multi_index::composite_key< Lease4, boost::multi_index::const_mem_fun< Lease, const std::vector< uint8_t > &, &Lease::getHWAddrVector >, boost::multi_index::member< Lease, SubnetID, &Lease::subnet_id_ > > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< ClientIdSubnetIdIndexTag >, boost::multi_index::composite_key< Lease4, boost::multi_index::const_mem_fun< Lease4, const std::vector< uint8_t > &, &Lease4::getClientIdVector >, boost::multi_index::member< Lease, uint32_t, &Lease::subnet_id_ > > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< ExpirationIndexTag >, boost::multi_index::composite_key< Lease4, boost::multi_index::const_mem_fun< Lease, bool, &Lease::stateExpiredReclaimed >, boost::multi_index::const_mem_fun< Lease, int64_t, &Lease::getExpirationTime > > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SubnetIdIndexTag >, boost::multi_index::member< Lease, isc::dhcp::SubnetID, &Lease::subnet_id_ > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< HostnameIndexTag >, boost::multi_index::member< Lease, std::string, &Lease::hostname_ > > > > Lease4Storage
A multi index container holding DHCPv4 leases.
Lease6Storage::index< ExpirationIndexTag >::type Lease6StorageExpirationIndex
DHCPv6 lease storage index by expiration time.
Lease6Storage::index< DuidIndexTag >::type Lease6StorageDuidIndex
DHCPv6 lease storage index by DUID.
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
Lease6Storage::index< DuidIaidTypeIndexTag >::type Lease6StorageDuidIaidTypeIndex
DHCPv6 lease storage index by DUID, IAID, lease type.
Lease4Storage::index< ExpirationIndexTag >::type Lease4StorageExpirationIndex
DHCPv4 lease storage index by expiration time.
Lease6Storage::index< AddressIndexTag >::type Lease6StorageAddressIndex
DHCPv6 lease storage index by address.
Lease4Storage::index< HostnameIndexTag >::type Lease4StorageHostnameIndex
DHCPv4 lease storage index by hostname.
Lease6Storage::index< HostnameIndexTag >::type Lease6StorageHostnameIndex
DHCPv6 lease storage index by hostname.
Lease4Storage::index< ClientIdSubnetIdIndexTag >::type Lease4StorageClientIdSubnetIdIndex
DHCPv4 lease storage index by client and subnet identifier.
Lease4Storage::index< HWAddressSubnetIdIndexTag >::type Lease4StorageHWAddressSubnetIdIndex
DHCPv4 lease storage index by HW address and subnet identifier.
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
boost::multi_index_container< Lease6Ptr, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< AddressIndexTag >, boost::multi_index::member< Lease, isc::asiolink::IOAddress, &Lease::addr_ > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< DuidIaidTypeIndexTag >, boost::multi_index::composite_key< Lease6, boost::multi_index::const_mem_fun< Lease6, const std::vector< uint8_t > &, &Lease6::getDuidVector >, boost::multi_index::member< Lease6, uint32_t, &Lease6::iaid_ >, boost::multi_index::member< Lease6, Lease::Type, &Lease6::type_ > > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< ExpirationIndexTag >, boost::multi_index::composite_key< Lease6, boost::multi_index::const_mem_fun< Lease, bool, &Lease::stateExpiredReclaimed >, boost::multi_index::const_mem_fun< Lease, int64_t, &Lease::getExpirationTime > > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SubnetIdIndexTag >, boost::multi_index::member< Lease, isc::dhcp::SubnetID, &Lease::subnet_id_ > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< DuidIndexTag >, boost::multi_index::const_mem_fun< Lease6, const std::vector< uint8_t > &, &Lease6::getDuidVector > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< HostnameIndexTag >, boost::multi_index::member< Lease, std::string, &Lease::hostname_ > > > > Lease6Storage
A multi index container holding DHCPv6 leases.
Lease4Storage::index< SubnetIdIndexTag >::type Lease4StorageSubnetIdIndex
DHCPv4 lease storage index subnet identifier.
Lease4Storage::index< AddressIndexTag >::type Lease4StorageAddressIndex
DHCPv4 lease storage index by address.
boost::shared_ptr< Lease4 > Lease4Ptr
Pointer to a Lease4 structure.
Lease6Storage::index< SubnetIdIndexTag >::type Lease6StorageSubnetIdIndex
DHCPv6 lease storage index by Subnet-id.
Defines the logger used by the top-level component of kea-lfc.
Tag for indexes by address.
Tag for indexes by client and subnet identifiers.
Tag for indexes by DUID, IAID, lease type tuple.
Tag for index using DUID.
Tag for indexes by expiration time.
Tag for indexes by HW address, subnet identifier tuple.
Tag for index using hostname.
Structure that holds a lease for IPv4 address.
const std::vector< uint8_t > & getClientIdVector() const
Returns a client identifier.
Structure that holds a lease for IPv6 address and/or prefix.
const std::vector< uint8_t > & getDuidVector() const
Returns a reference to a vector representing a DUID.
a common structure for IPv4 and IPv6 leases
bool stateExpiredReclaimed() const
Indicates if the lease is in the "expired-reclaimed" state.
SubnetID subnet_id_
Subnet identifier.
const std::vector< uint8_t > & getHWAddrVector() const
Returns raw (as vector) hardware address.
int64_t getExpirationTime() const
Returns lease expiration time.
Tag for indexes by subnet-id.