17#include <boost/scoped_ptr.hpp>
18#include <boost/shared_ptr.hpp>
65 const uint8_t* identifier_begin,
const size_t identifier_len)
const;
81 const uint8_t* identifier_begin,
82 const size_t identifier_len);
212 size_t& source_index,
213 uint64_t lower_host_id,
230 size_t& source_index,
231 uint64_t lower_host_id,
248 size_t& source_index,
249 uint64_t lower_host_id,
266 size_t& source_index,
267 uint64_t lower_host_id,
283 uint64_t lower_host_id,
299 uint64_t lower_host_id,
315 uint64_t lower_host_id,
331 uint64_t lower_host_id,
390 const uint8_t* identifier_begin,
const size_t identifier_len)
const;
404 const uint8_t* identifier_begin,
const size_t identifier_len);
455 const uint8_t* identifier_begin,
const size_t identifier_len)
const;
469 const uint8_t* identifier_begin,
const size_t identifier_len);
573 const uint8_t* identifier_begin,
const size_t identifier_len);
594 const uint8_t* identifier_begin,
const size_t identifier_len);
611 return (std::string(
"configuration file"));
666 template<
typename Storage>
668 const uint8_t* identifier,
669 const size_t identifier_len,
670 Storage& storage)
const;
682 template<
typename Storage>
683 void getAllInternal4(
const SubnetID& subnet_id,
684 Storage& storage)
const;
696 template<
typename Storage>
697 void getAllInternal6(
const SubnetID& subnet_id,
698 Storage& storage)
const;
710 template<
typename Storage>
711 void getAllbyHostnameInternal(
const std::string& hostname,
712 Storage& storage)
const;
725 template<
typename Storage>
726 void getAllbyHostnameInternal4(
const std::string& hostname,
728 Storage& storage)
const;
741 template<
typename Storage>
742 void getAllbyHostnameInternal6(
const std::string& hostname,
744 Storage& storage)
const;
759 template<
typename Storage>
760 void getPageInternal4(
const SubnetID& subnet_id,
761 uint64_t lower_host_id,
763 Storage& storage)
const;
778 template<
typename Storage>
779 void getPageInternal6(
const SubnetID& subnet_id,
780 uint64_t lower_host_id,
782 Storage& storage)
const;
796 template<
typename Storage>
797 void getPageInternal(uint64_t lower_host_id,
799 Storage& storage)
const;
812 template<
typename Storage>
814 Storage& storage)
const;
827 template<
typename Storage>
829 Storage& storage)
const;
842 getAllInternal4(
const SubnetID& subnet_id,
857 template<
typename Storage>
859 getAllInternal6(
const SubnetID& subnet_id,
861 Storage& storage)
const;
880 getHostInternal(
const SubnetID& subnet_id,
const bool subnet6,
882 const uint8_t* identifier,
883 const size_t identifier_len)
const;
898 template<
typename ReturnType,
typename Storage>
899 ReturnType getHostInternal6(
const SubnetID& subnet_id,
902 template<
typename ReturnType>
904 const uint8_t prefix_len)
const;
917 virtual void add4(
const HostPtr& host);
930 virtual void add6(
const HostPtr& host);
933 uint64_t next_host_id_ = 0;
954 bool ip_reservations_unique_ =
true;
957 const boost::scoped_ptr<std::mutex> mutex_;
The IOAddress class represents an IP addresses (version agnostic)
Base interface for the classes implementing simple data source for host reservations.
Represents the host reservations specified in the configuration file.
virtual ~CfgHosts()
Destructor.
virtual void update(HostPtr const &host)
Attempts to update an existing host entry.
virtual size_t delAll4(const SubnetID &subnet_id)
Attempts to delete all hosts for a given IPv4 subnet.
virtual void add(const HostPtr &host)
Adds a new host to the collection.
virtual ConstHostCollection getPage6(const SubnetID &subnet_id, size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) const
Returns range of hosts in a DHCPv6 subnet.
virtual bool del4(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len)
Attempts to delete a host by (subnet4-id, identifier, identifier-type)
virtual bool del(const SubnetID &subnet_id, const asiolink::IOAddress &addr)
Attempts to delete hosts by address.
virtual bool setIPReservationsUnique(const bool unique)
Controls whether IP reservations are unique or non-unique.
virtual size_t delAll6(const SubnetID &subnet_id)
Attempts to delete all hosts for a given IPv6 subnet.
virtual ConstHostPtr get6(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const
Returns a host connected to the IPv6 subnet.
virtual ConstHostCollection getAllbyHostname(const std::string &hostname) const
Return all hosts with a hostname.
virtual bool del6(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len)
Attempts to delete a host by (subnet6-id, identifier, identifier-type)
virtual ConstHostCollection getPage4(const SubnetID &subnet_id, size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) const
Returns range of hosts in a DHCPv4 subnet.
virtual ConstHostCollection getAll4(const SubnetID &subnet_id) const
Return all hosts in a DHCPv4 subnet.
virtual ConstHostPtr get4(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const
Returns a host connected to the IPv4 subnet.
virtual ConstHostCollection getAll6(const SubnetID &subnet_id) const
Return all hosts in a DHCPv6 subnet.
virtual ConstHostCollection getAllbyHostname6(const std::string &hostname, const SubnetID &subnet_id) const
Return all hosts with a hostname in a DHCPv6 subnet.
virtual std::string getType() const
Return backend type.
isc::data::ElementPtr toElement() const
Unparse a configuration object.
virtual ConstHostCollection getAllbyHostname4(const std::string &hostname, const SubnetID &subnet_id) const
Return all hosts with a hostname in a DHCPv4 subnet.
virtual ConstHostCollection getAll(const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const
Return all hosts connected to any subnet for which reservations have been made using a specified iden...
Wraps value holding size of the page with host reservations.
IdentifierType
Type of the host identifier.
Interface for retrieving writable host reservations.
boost::shared_ptr< Element > ElementPtr
boost::shared_ptr< const CfgHosts > ConstCfgHostsPtr
Const pointer.
boost::multi_index_container< HostPtr, boost::multi_index::indexed_by< boost::multi_index::ordered_non_unique< boost::multi_index::composite_key< Host, boost::multi_index::const_mem_fun< Host, const std::vector< uint8_t > &, &Host::getIdentifier >, boost::multi_index::const_mem_fun< Host, Host::IdentifierType, &Host::getIdentifierType > > >, boost::multi_index::ordered_non_unique< boost::multi_index::const_mem_fun< Host, const asiolink::IOAddress &, &Host::getIPv4Reservation > >, boost::multi_index::ordered_non_unique< boost::multi_index::const_mem_fun< Host, SubnetID, &Host::getIPv4SubnetID > >, boost::multi_index::ordered_non_unique< boost::multi_index::const_mem_fun< Host, SubnetID, &Host::getIPv6SubnetID > >, boost::multi_index::ordered_unique< boost::multi_index::const_mem_fun< Host, uint64_t, &Host::getHostId > >, boost::multi_index::ordered_non_unique< boost::multi_index::const_mem_fun< Host, std::string, &Host::getLowerHostname > > > > HostContainer
Multi-index container holding host reservations.
boost::shared_ptr< Host > HostPtr
Pointer to the Host object.
std::vector< ConstHostPtr > ConstHostCollection
Collection of the const Host objects.
boost::multi_index_container< HostResrv6Tuple, boost::multi_index::indexed_by< boost::multi_index::ordered_non_unique< boost::multi_index::const_mem_fun< HostResrv6Tuple, const asiolink::IOAddress &, &HostResrv6Tuple::getPrefix > >, boost::multi_index::ordered_non_unique< boost::multi_index::composite_key< HostResrv6Tuple, boost::multi_index::member< HostResrv6Tuple, const SubnetID, &HostResrv6Tuple::subnet_id_ >, boost::multi_index::const_mem_fun< HostResrv6Tuple, const asiolink::IOAddress &, &HostResrv6Tuple::getPrefix > > >, boost::multi_index::ordered_non_unique< boost::multi_index::member< HostResrv6Tuple, const SubnetID, &HostResrv6Tuple::subnet_id_ > >, boost::multi_index::ordered_non_unique< boost::multi_index::const_mem_fun< HostResrv6Tuple, uint64_t, &HostResrv6Tuple::getHostId > >, boost::multi_index::ordered_non_unique< boost::multi_index::const_mem_fun< HostResrv6Tuple, const asiolink::IOAddress &, &HostResrv6Tuple::getPrefix > > > > HostContainer6
Multi-index container holding IPv6 reservations.
std::vector< HostPtr > HostCollection
Collection of the Host objects.
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
boost::shared_ptr< CfgHosts > CfgHostsPtr
Non-const pointer.
boost::shared_ptr< const Host > ConstHostPtr
Const pointer to the Host object.
Defines the logger used by the top-level component of kea-lfc.
Abstract class for configuration Cfg_* classes.