17 #include <boost/shared_ptr.hpp>
59 const uint8_t* identifier_begin,
const size_t identifier_len)
const;
75 const uint8_t* identifier_begin,
76 const size_t identifier_len);
206 size_t& source_index,
207 uint64_t lower_host_id,
224 size_t& source_index,
225 uint64_t lower_host_id,
242 size_t& source_index,
243 uint64_t lower_host_id,
260 size_t& source_index,
261 uint64_t lower_host_id,
277 uint64_t lower_host_id,
293 uint64_t lower_host_id,
309 uint64_t lower_host_id,
325 uint64_t lower_host_id,
384 const uint8_t* identifier_begin,
const size_t identifier_len)
const;
398 const uint8_t* identifier_begin,
const size_t identifier_len);
449 const uint8_t* identifier_begin,
const size_t identifier_len)
const;
463 const uint8_t* identifier_begin,
const size_t identifier_len);
568 const uint8_t* identifier_begin,
const size_t identifier_len);
590 const uint8_t* identifier_begin,
const size_t identifier_len);
598 return (std::string(
"configuration file"));
650 template<
typename Storage>
652 const uint8_t* identifier,
653 const size_t identifier_len,
654 Storage& storage)
const;
666 template<
typename Storage>
667 void getAllInternal4(
const SubnetID& subnet_id,
668 Storage& storage)
const;
680 template<
typename Storage>
681 void getAllInternal6(
const SubnetID& subnet_id,
682 Storage& storage)
const;
694 template<
typename Storage>
695 void getAllbyHostnameInternal(
const std::string& hostname,
696 Storage& storage)
const;
709 template<
typename Storage>
710 void getAllbyHostnameInternal4(
const std::string& hostname,
712 Storage& storage)
const;
725 template<
typename Storage>
726 void getAllbyHostnameInternal6(
const std::string& hostname,
728 Storage& storage)
const;
743 template<
typename Storage>
744 void getPageInternal4(
const SubnetID& subnet_id,
745 uint64_t lower_host_id,
747 Storage& storage)
const;
762 template<
typename Storage>
763 void getPageInternal6(
const SubnetID& subnet_id,
764 uint64_t lower_host_id,
766 Storage& storage)
const;
780 template<
typename Storage>
781 void getPageInternal(uint64_t lower_host_id,
783 Storage& storage)
const;
796 template<
typename Storage>
798 Storage& storage)
const;
811 template<
typename Storage>
813 Storage& storage)
const;
828 template<
typename Storage>
830 getAllInternal6(
const SubnetID& subnet_id,
832 Storage& storage)
const;
851 getHostInternal(
const SubnetID& subnet_id,
const bool subnet6,
853 const uint8_t* identifier,
854 const size_t identifier_len)
const;
869 template<
typename ReturnType,
typename Storage>
870 ReturnType getHostInternal6(
const SubnetID& subnet_id,
873 template<
typename ReturnType>
875 const uint8_t prefix_len)
const;
888 virtual void add4(
const HostPtr& host);
901 virtual void add6(
const HostPtr& host);
904 uint64_t next_host_id_ = 0;
925 bool ip_reservations_unique_ =
true;
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 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 a 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.