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/hashed_index.hpp>
18#include <boost/multi_index/ordered_index.hpp>
19#include <boost/multi_index_container.hpp>
20#include <boost/multi_index/composite_key.hpp>
81typedef boost::multi_index_container<
84 boost::multi_index::indexed_by<
88 boost::multi_index::ordered_unique<
89 boost::multi_index::tag<AddressIndexTag>,
90 boost::multi_index::member<Lease, isc::asiolink::IOAddress, &Lease::addr_>
94 boost::multi_index::ordered_non_unique<
95 boost::multi_index::tag<DuidIaidTypeIndexTag>,
98 boost::multi_index::composite_key<
102 boost::multi_index::const_mem_fun<Lease6, const std::vector<uint8_t>&,
106 boost::multi_index::member<Lease6, uint32_t, &Lease6::iaid_>,
107 boost::multi_index::member<Lease6, Lease::Type, &Lease6::type_>
112 boost::multi_index::ordered_non_unique<
113 boost::multi_index::tag<ExpirationIndexTag>,
118 boost::multi_index::composite_key<
121 boost::multi_index::const_mem_fun<
Lease, bool,
124 boost::multi_index::const_mem_fun<
Lease, int64_t,
131 boost::multi_index::ordered_unique<
132 boost::multi_index::tag<SubnetIdIndexTag>,
133 boost::multi_index::composite_key<
136 boost::multi_index::member<
Lease,
140 boost::multi_index::member<
Lease,
148 boost::multi_index::ordered_non_unique<
149 boost::multi_index::tag<DuidIndexTag>,
150 boost::multi_index::const_mem_fun<
Lease6,
151 const std::vector<uint8_t>&,
157 boost::multi_index::ordered_non_unique<
158 boost::multi_index::tag<HostnameIndexTag>,
159 boost::multi_index::member<Lease, std::string, &Lease::hostname_>
163 boost::multi_index::ordered_non_unique<
164 boost::multi_index::tag<SubnetIdPoolIdIndexTag>,
167 boost::multi_index::composite_key<
173 boost::multi_index::member<Lease, SubnetID, &Lease::subnet_id_>,
178 boost::multi_index::member<Lease, uint32_t, &Lease::pool_id_>
183 boost::multi_index::hashed_non_unique<
184 boost::multi_index::tag<HWAddressIndexTag>,
189 boost::multi_index::const_mem_fun<Lease, const std::vector<uint8_t>&,
211typedef boost::multi_index_container<
215 boost::multi_index::indexed_by<
219 boost::multi_index::ordered_unique<
220 boost::multi_index::tag<AddressIndexTag>,
223 boost::multi_index::member<Lease, isc::asiolink::IOAddress, &Lease::addr_>
227 boost::multi_index::ordered_non_unique<
228 boost::multi_index::tag<HWAddressSubnetIdIndexTag>,
231 boost::multi_index::composite_key<
237 boost::multi_index::const_mem_fun<Lease, const std::vector<uint8_t>&,
243 boost::multi_index::member<Lease, SubnetID, &Lease::subnet_id_>
248 boost::multi_index::ordered_non_unique<
249 boost::multi_index::tag<ClientIdSubnetIdIndexTag>,
252 boost::multi_index::composite_key<
256 boost::multi_index::const_mem_fun<Lease4, const std::vector<uint8_t>&,
259 boost::multi_index::member<Lease, uint32_t, &Lease::subnet_id_>
264 boost::multi_index::ordered_non_unique<
265 boost::multi_index::tag<ExpirationIndexTag>,
270 boost::multi_index::composite_key<
273 boost::multi_index::const_mem_fun<
Lease, bool,
276 boost::multi_index::const_mem_fun<
Lease, int64_t,
283 boost::multi_index::ordered_non_unique<
284 boost::multi_index::tag<SubnetIdIndexTag>,
285 boost::multi_index::member<Lease, isc::dhcp::SubnetID, &Lease::subnet_id_>
290 boost::multi_index::ordered_non_unique<
291 boost::multi_index::tag<HostnameIndexTag>,
292 boost::multi_index::member<Lease, std::string, &Lease::hostname_>
298 boost::multi_index::hashed_non_unique<
299 boost::multi_index::tag<RemoteIdIndexTag>,
300 boost::multi_index::member<
Lease4,
301 std::vector<uint8_t>,
308 boost::multi_index::ordered_non_unique<
309 boost::multi_index::tag<RelayIdIndexTag>,
310 boost::multi_index::composite_key<
313 boost::multi_index::member<
Lease4,
314 std::vector<uint8_t>,
317 boost::multi_index::member<
Lease,
324 boost::multi_index::ordered_non_unique<
325 boost::multi_index::tag<SubnetIdPoolIdIndexTag>,
328 boost::multi_index::composite_key<
334 boost::multi_index::member<Lease, SubnetID, &Lease::subnet_id_>,
339 boost::multi_index::member<Lease, uint32_t, &Lease::pool_id_>
361typedef Lease6Storage::index<HWAddressIndexTag>::type
383typedef Lease4Storage::index<HWAddressSubnetIdIndexTag>::type
387typedef Lease4Storage::index<ClientIdSubnetIdIndexTag>::type
403typedef std::pair<Lease4StorageRemoteIdIndex::const_iterator,
423 const std::vector<uint8_t>&
id)
452typedef boost::multi_index_container<
455 boost::multi_index::indexed_by<
457 boost::multi_index::ordered_non_unique<
458 boost::multi_index::tag<RelayIdIndexTag>,
459 boost::multi_index::composite_key<
462 std::vector<uint8_t>,
471 boost::multi_index::hashed_non_unique<
472 boost::multi_index::tag<LeaseAddressIndexTag>,
493typedef boost::multi_index_container<
496 boost::multi_index::indexed_by<
498 boost::multi_index::hashed_non_unique<
499 boost::multi_index::tag<RemoteIdIndexTag>,
501 std::vector<uint8_t>,
506 boost::multi_index::hashed_non_unique<
507 boost::multi_index::tag<LeaseAddressIndexTag>,
516typedef Lease6ExtendedInfoRelayIdTable::index<RelayIdIndexTag>::type
520typedef Lease6ExtendedInfoRelayIdTable::index<LeaseAddressIndexTag>::type
524typedef Lease6ExtendedInfoRemoteIdTable::index<RemoteIdIndexTag>::type
528typedef std::pair<RemoteIdIndex::const_iterator, RemoteIdIndex::const_iterator>
532typedef Lease6ExtendedInfoRemoteIdTable::index<LeaseAddressIndexTag>::type
The IOAddress class represents an IP addresses (version agnostic)
Lease6 extended informations for Bulk Lease Query.
Lease6ExtendedInfo(const isc::asiolink::IOAddress &lease_addr, const std::vector< uint8_t > &id)
Constructor.
std::vector< uint8_t > id_
Remote or relay opaque identifier.
isc::asiolink::IOAddress lease_addr_
Lease address.
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_ > >, boost::multi_index::hashed_non_unique< boost::multi_index::tag< RemoteIdIndexTag >, boost::multi_index::member< Lease4, std::vector< uint8_t >, &Lease4::remote_id_ > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< RelayIdIndexTag >, boost::multi_index::composite_key< Lease4, boost::multi_index::member< Lease4, std::vector< uint8_t >, &Lease4::relay_id_ >, boost::multi_index::member< Lease, isc::asiolink::IOAddress, &Lease::addr_ > > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SubnetIdPoolIdIndexTag >, boost::multi_index::composite_key< Lease4, boost::multi_index::member< Lease, SubnetID, &Lease::subnet_id_ >, boost::multi_index::member< Lease, uint32_t, &Lease::pool_id_ > > > > > Lease4Storage
A multi index container holding DHCPv4 leases.
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_unique< boost::multi_index::tag< SubnetIdIndexTag >, boost::multi_index::composite_key< Lease6, boost::multi_index::member< Lease, isc::dhcp::SubnetID, &Lease::subnet_id_ >, boost::multi_index::member< Lease, isc::asiolink::IOAddress, &Lease::addr_ > > >, 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_ > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SubnetIdPoolIdIndexTag >, boost::multi_index::composite_key< Lease6, boost::multi_index::member< Lease, SubnetID, &Lease::subnet_id_ >, boost::multi_index::member< Lease, uint32_t, &Lease::pool_id_ > > >, boost::multi_index::hashed_non_unique< boost::multi_index::tag< HWAddressIndexTag >, boost::multi_index::const_mem_fun< Lease, const std::vector< uint8_t > &, &Lease::getHWAddrVector > > > > Lease6Storage
A multi index container holding DHCPv6 leases.
boost::multi_index_container< Lease6ExtendedInfoPtr, boost::multi_index::indexed_by< boost::multi_index::hashed_non_unique< boost::multi_index::tag< RemoteIdIndexTag >, boost::multi_index::member< Lease6ExtendedInfo, std::vector< uint8_t >, &Lease6ExtendedInfo::id_ > >, boost::multi_index::hashed_non_unique< boost::multi_index::tag< LeaseAddressIndexTag >, boost::multi_index::member< Lease6ExtendedInfo, isc::asiolink::IOAddress, &Lease6ExtendedInfo::lease_addr_ > > > > Lease6ExtendedInfoRemoteIdTable
A multi index container holding lease6 extended info for by remote id.
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< SubnetIdPoolIdIndexTag >::type Lease6StorageSubnetIdPoolIdIndex
DHCPv6 lease storage index subnet-id and pool-id.
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.
Lease6Storage::index< HWAddressIndexTag >::type Lease6StorageHWAddressIndex
DHCPv6 lease storage index by HW address.
Lease4Storage::index< HostnameIndexTag >::type Lease4StorageHostnameIndex
DHCPv4 lease storage index by hostname.
std::pair< Lease4StorageRemoteIdIndex::const_iterator, Lease4StorageRemoteIdIndex::const_iterator > Lease4StorageRemoteIdRange
DHCPv4 lease storage range by remote-id.
Lease6Storage::index< HostnameIndexTag >::type Lease6StorageHostnameIndex
DHCPv6 lease storage index by hostname.
Lease4Storage::index< ClientIdSubnetIdIndexTag >::type Lease4StorageClientIdSubnetIdIndex
DHCPv4 lease storage index by client-id and subnet-id.
Lease4Storage::index< HWAddressSubnetIdIndexTag >::type Lease4StorageHWAddressSubnetIdIndex
DHCPv4 lease storage index by HW address and subnet-id.
Lease6ExtendedInfoRelayIdTable::index< LeaseAddressIndexTag >::type LeaseAddressRelayIdIndex
Lease6 extended information by lease address index of by relay id table.
Lease6ExtendedInfoRelayIdTable::index< RelayIdIndexTag >::type RelayIdIndex
Lease6 extended information by relay id index.
Lease4Storage::index< RemoteIdIndexTag >::type Lease4StorageRemoteIdIndex
DHCPv4 lease storage index by remote-id.
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
std::pair< RemoteIdIndex::const_iterator, RemoteIdIndex::const_iterator > RemoteIdIndexRange
Lease6 extended information by remote id range.
Lease4Storage::index< SubnetIdIndexTag >::type Lease4StorageSubnetIdIndex
DHCPv4 lease storage index subnet-id.
Lease4Storage::index< AddressIndexTag >::type Lease4StorageAddressIndex
DHCPv4 lease storage index by address.
boost::shared_ptr< Lease4 > Lease4Ptr
Pointer to a Lease4 structure.
Lease6ExtendedInfoRemoteIdTable::index< LeaseAddressIndexTag >::type LeaseAddressRemoteIdIndex
Lease6 extended information by lease address index of by remote id table.
Lease6Storage::index< SubnetIdIndexTag >::type Lease6StorageSubnetIdIndex
DHCPv6 lease storage index by subnet-id.
boost::multi_index_container< Lease6ExtendedInfoPtr, boost::multi_index::indexed_by< boost::multi_index::ordered_non_unique< boost::multi_index::tag< RelayIdIndexTag >, boost::multi_index::composite_key< Lease6ExtendedInfo, boost::multi_index::member< Lease6ExtendedInfo, std::vector< uint8_t >, &Lease6ExtendedInfo::id_ >, boost::multi_index::member< Lease6ExtendedInfo, isc::asiolink::IOAddress, &Lease6ExtendedInfo::lease_addr_ > > >, boost::multi_index::hashed_non_unique< boost::multi_index::tag< LeaseAddressIndexTag >, boost::multi_index::member< Lease6ExtendedInfo, isc::asiolink::IOAddress, &Lease6ExtendedInfo::lease_addr_ > > > > Lease6ExtendedInfoRelayIdTable
A multi index container holding lease6 extended info for by relay id.
boost::shared_ptr< Lease6ExtendedInfo > Lease6ExtendedInfoPtr
Pointer to a Lease6ExtendedInfo object.
Lease6ExtendedInfoRemoteIdTable::index< RemoteIdIndexTag >::type RemoteIdIndex
Lease6 extended information by remote id index.
Lease4Storage::index< SubnetIdPoolIdIndexTag >::type Lease4StorageSubnetIdPoolIdIndex
DHCPv4 lease storage index subnet-id and pool-id.
Lease4Storage::index< RelayIdIndexTag >::type Lease4StorageRelayIdIndex
DHCPv4 lease storage index by relay-id.
Defines the logger used by the top-level component of kea-lfc.
Tag for indexes by address.
Tag for indexes by client-id, subnet-id tuple.
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.
Tag for indexes by HW address, subnet-id tuple.
Tag for index using hostname.
Structure that holds a lease for IPv4 address.
std::vector< uint8_t > remote_id_
Remote identifier for Bulk Lease Query.
std::vector< uint8_t > relay_id_
Relay identifier for Bulk Lease Query.
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.
Tag for indexes by lease address.
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.
isc::asiolink::IOAddress addr_
IPv4 ot IPv6 address.
Tag for index using relay-id.
Tag for index using remote-id.
Tag for indexes by subnet-id (and address for v6).
Tag for indexes by subnet-id and pool-id.