15 #include <boost/noncopyable.hpp> 16 #include <boost/scoped_ptr.hpp> 73 static void addBackend(
const std::string& access);
79 static bool delBackend(
const std::string& db_type);
124 const uint8_t* identifier_begin,
125 const size_t identifier_len)
const;
161 const uint8_t* identifier_begin,
162 const size_t identifier_len)
const;
179 const uint8_t* identifier_begin,
const size_t identifier_len)
const;
213 const uint8_t* identifier_begin,
214 const size_t identifier_len)
const;
231 const uint8_t* identifier_begin,
const size_t identifier_len)
const;
283 const uint8_t* identifier_begin,
const size_t identifier_len);
297 const uint8_t* identifier_begin,
const size_t identifier_len);
305 return (std::string(
"host_mgr"));
312 return (alternate_sources_);
357 const uint8_t* identifier_begin,
358 const size_t identifier_len)
const;
373 static boost::scoped_ptr<HostMgr>& getHostMgrPtr();
static HostMgr & instance()
Returns a sole instance of the HostMgr.
virtual ConstHostPtr get6Any(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const
Returns any host connected to the IPv6 subnet.
boost::shared_ptr< Host > HostPtr
Pointer to the Host object.
void setNegativeCaching(bool negative_caching)
Sets the negative caching flag.
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...
virtual void cache(ConstHostPtr host) const
Cache an answer.
boost::shared_ptr< BaseHostDataSource > HostDataSourcePtr
HostDataSource pointer.
bool getNegativeCaching() const
Returns the negative caching flag.
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)
boost::shared_ptr< CacheHostDataSource > CacheHostDataSourcePtr
CacheHostDataSource pointer.
static bool delBackend(const std::string &db_type)
Delete an alternate host backend (aka host data source).
std::vector< ConstHostPtr > ConstHostCollection
Collection of the const Host objects.
static void create()
Creates new instance of the HostMgr.
virtual void cacheNegative(const SubnetID &ipv4_subnet_id, const SubnetID &ipv6_subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const
Cache a negative answer.
boost::shared_ptr< const Host > ConstHostPtr
Const pointer to the Host object.
Defines the logger used by the top-level component of kea-dhcp-ddns.
HostDataSourcePtr getHostDataSource() const
Returns the first host data source.
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 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.
Base interface for the classes implementing simple data source for host reservations.
std::vector< HostDataSourcePtr > HostDataSourceList
HostDataSource list.
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)
static void delAllBackends()
Delete all alternate backends.
static void addBackend(const std::string &access)
Add an alternate host backend (aka host data source).
bool negative_caching_
The negative caching flag.
static bool checkCacheBackend(bool logging=false)
Check for the cache host backend.
virtual std::string getType() const
Return backend type.
IdentifierType
Type of the host identifier.
The IOAddress class represents an IP addresses (version agnostic)
virtual ConstHostPtr get4Any(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const
Returns any host connected to the IPv4 subnet.
HostDataSourceList & getHostDataSourceList()
Returns the host data source list.
virtual void add(const HostPtr &host)
Adds a new host to the alternate data source.
uint32_t SubnetID
Unique identifier for a subnet (both v4 and v6)
virtual ConstHostCollection getAll4(const asiolink::IOAddress &address) const
Returns a collection of hosts using the specified IPv4 address.
virtual bool del(const SubnetID &subnet_id, const asiolink::IOAddress &addr)
Attempts to delete a host by address.