Kea 2.7.5
|
Represents the host reservations specified in the configuration file. More...
#include <cfg_hosts.h>
Public Member Functions | |
CfgHosts () | |
Constructor. | |
virtual | ~CfgHosts () |
Destructor. | |
virtual void | add (const HostPtr &host) |
Adds a new host to the collection. | |
virtual bool | del (const SubnetID &subnet_id, const asiolink::IOAddress &addr) |
Attempts to delete hosts by address. | |
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 | 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 size_t | delAll4 (const SubnetID &subnet_id) |
Attempts to delete all hosts for a given IPv4 subnet. | |
virtual size_t | delAll6 (const SubnetID &subnet_id) |
Attempts to delete all hosts for a given IPv6 subnet. | |
virtual ConstHostPtr | get4 (const SubnetID &subnet_id, const asiolink::IOAddress &address) const |
Returns a host connected to the IPv4 subnet and having a reservation for a specified IPv4 address. | |
virtual HostPtr | get4 (const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) |
Returns a host connected to the IPv4 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 HostPtr | get6 (const asiolink::IOAddress &prefix, const uint8_t prefix_len) |
Returns a host using the specified IPv6 prefix. | |
virtual ConstHostPtr | get6 (const asiolink::IOAddress &prefix, const uint8_t prefix_len) const |
Returns a host using the specified IPv6 prefix. | |
virtual HostPtr | get6 (const SubnetID &subnet_id, const asiolink::IOAddress &address) |
Returns a host connected to the IPv6 subnet and having a reservation for a specified IPv6 address. | |
virtual ConstHostPtr | get6 (const SubnetID &subnet_id, const asiolink::IOAddress &address) const |
Returns a host connected to the IPv6 subnet and having a reservation for a specified IPv6 address. | |
virtual HostPtr | get6 (const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) |
Returns a host connected to the 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 HostCollection | getAll (const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) |
Non-const version of the getAll const method. | |
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 identifier. | |
virtual HostCollection | getAll4 (const asiolink::IOAddress &address) |
Returns a collection of hosts using the specified IPv4 address. | |
virtual ConstHostCollection | getAll4 (const asiolink::IOAddress &address) const |
Returns a collection of hosts using the specified IPv4 address. | |
virtual HostCollection | getAll4 (const SubnetID &subnet_id) |
Return all hosts in a DHCPv4 subnet. | |
virtual ConstHostCollection | getAll4 (const SubnetID &subnet_id) const |
Return all hosts in a DHCPv4 subnet. | |
virtual ConstHostCollection | getAll4 (const SubnetID &subnet_id, const asiolink::IOAddress &address) const |
Returns all hosts connected to the IPv4 subnet and having a reservation for a specified address. | |
virtual HostCollection | getAll6 (const asiolink::IOAddress &address) |
Returns a collection of hosts using the specified IPv6 address. | |
virtual ConstHostCollection | getAll6 (const asiolink::IOAddress &address) const |
Returns a collection of hosts using the specified IPv6 address. | |
virtual HostCollection | getAll6 (const SubnetID &subnet_id) |
Return all hosts in a DHCPv6 subnet. | |
virtual ConstHostCollection | getAll6 (const SubnetID &subnet_id) const |
Return all hosts in a DHCPv6 subnet. | |
virtual ConstHostCollection | getAll6 (const SubnetID &subnet_id, const asiolink::IOAddress &address) const |
Returns all hosts connected to the IPv6 subnet and having a reservation for a specified address or delegated prefix (lease). | |
virtual HostCollection | getAllbyHostname (const std::string &hostname) |
Return all hosts with a hostname. | |
virtual ConstHostCollection | getAllbyHostname (const std::string &hostname) const |
Return all hosts with a hostname. | |
virtual HostCollection | getAllbyHostname4 (const std::string &hostname, const SubnetID &subnet_id) |
Return all hosts with a hostname in a DHCPv4 subnet. | |
virtual ConstHostCollection | getAllbyHostname4 (const std::string &hostname, const SubnetID &subnet_id) const |
Return all hosts with a hostname in a DHCPv4 subnet. | |
virtual HostCollection | getAllbyHostname6 (const std::string &hostname, const SubnetID &subnet_id) |
Return all hosts with a hostname 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 HostCollection | getPage4 (const SubnetID &subnet_id, size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) |
Returns range of hosts in a DHCPv4 subnet. | |
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 HostCollection | getPage4 (size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) |
Returns range of hosts. | |
virtual ConstHostCollection | getPage4 (size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) const |
Returns range of hosts. | |
virtual HostCollection | getPage6 (const SubnetID &subnet_id, size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) |
Returns range of hosts in a DHCPv6 subnet. | |
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 HostCollection | getPage6 (size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) |
Returns range of hosts. | |
virtual ConstHostCollection | getPage6 (size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) const |
Returns range of hosts. | |
virtual std::string | getType () const |
Return backend type. | |
virtual bool | setIPReservationsUnique (const bool unique) |
Controls whether IP reservations are unique or non-unique. | |
isc::data::ElementPtr | toElement () const |
Unparse a configuration object. | |
virtual void | update (HostPtr const &host) |
Attempts to update an existing host entry. | |
Public Member Functions inherited from isc::dhcp::BaseHostDataSource | |
virtual | ~BaseHostDataSource () |
Default destructor implementation. | |
virtual void | commit () |
Commit Transactions. | |
virtual isc::db::DatabaseConnection::ParameterMap | getParameters () const |
Return backend parameters. | |
virtual bool | isUnusable () |
Flag which indicates if the host manager has at least one unusable connection. | |
virtual void | rollback () |
Rollback Transactions. | |
Public Member Functions inherited from isc::dhcp::WritableHostDataSource | |
virtual | ~WritableHostDataSource () |
Default destructor implementation. | |
Public Member Functions inherited from isc::data::CfgToElement | |
virtual | ~CfgToElement () |
Destructor. | |
Additional Inherited Members | |
Public Types inherited from isc::dhcp::BaseHostDataSource | |
enum | IdType { ID_HWADDR = 0 , ID_DUID = 1 } |
Specifies the type of an identifier. More... | |
Represents the host reservations specified in the configuration file.
This class holds a collection of the host reservations (Host
objects) which can be retrieved using different search criteria.
In the typical case the reservations are searched using the client's MAC address or DUID and a subnet that the client is connected to. The reservations can be also retrieved using other parameters, such as reserved IP address.
The reservations are added to this object by the configuration parsers, when the new configuration is applied for the server. The reservations are retrieved by the HostMgr
class when the server is allocating or renewing an address or prefix for the particular client.
Definition at line 40 of file cfg_hosts.h.
isc::dhcp::CfgHosts::CfgHosts | ( | ) |
Constructor.
Definition at line 30 of file cfg_hosts.cc.
|
inlinevirtual |
Destructor.
Definition at line 48 of file cfg_hosts.h.
|
virtual |
Adds a new host to the collection.
host | Pointer to the new Host object being added. |
DuplicateHost | If a host for a particular HW address or DUID has already been added to the IPv4 or IPv6 subnet. |
Implements isc::dhcp::BaseHostDataSource.
Definition at line 1006 of file cfg_hosts.cc.
References isc::dhcp::HOSTS_CFG_ADD_HOST, isc::dhcp::HOSTS_DBG_TRACE, isc::dhcp::hosts_logger, isc_throw, and LOG_DEBUG.
|
virtual |
Attempts to delete hosts by address.
This method supports both v4 and v6.
subnet_id | subnet identifier. |
addr | specified address. |
Implements isc::dhcp::BaseHostDataSource.
Definition at line 1145 of file cfg_hosts.cc.
References isc::dhcp::HOSTS_CFG_DEL, isc::dhcp::HOSTS_DBG_TRACE, isc::dhcp::hosts_logger, isc::asiolink::IOAddress::isV4(), LOG_DEBUG, and isc::asiolink::IOAddress::toText().
|
virtual |
Attempts to delete a host by (subnet4-id, identifier, identifier-type)
This method supports v4 only.
subnet_id | IPv4 Subnet identifier. |
identifier_type | Identifier type. |
identifier_begin | Pointer to a beginning of a buffer containing an identifier. |
identifier_len | Identifier length. |
Implements isc::dhcp::BaseHostDataSource.
Definition at line 1204 of file cfg_hosts.cc.
References isc::dhcp::Host::getIdentifierAsText(), isc::dhcp::HOSTS_CFG_DEL4, isc::dhcp::HOSTS_DBG_TRACE, isc::dhcp::hosts_logger, and LOG_DEBUG.
|
virtual |
Attempts to delete a host by (subnet6-id, identifier, identifier-type)
This method supports v6 only.
subnet_id | IPv6 Subnet identifier. |
identifier_type | Identifier type. |
identifier_begin | Pointer to a beginning of a buffer containing an identifier. |
identifier_len | Identifier length. |
Implements isc::dhcp::BaseHostDataSource.
Definition at line 1254 of file cfg_hosts.cc.
References isc::dhcp::Host::getIdentifierAsText(), isc::dhcp::HOSTS_CFG_DEL6, isc::dhcp::HOSTS_DBG_TRACE, isc::dhcp::hosts_logger, and LOG_DEBUG.
|
virtual |
Attempts to delete all hosts for a given IPv4 subnet.
subnet_id | Identifier of the subnet for which reservation should be deleted. |
Definition at line 1191 of file cfg_hosts.cc.
References isc::dhcp::HOSTS_CFG_DEL_ALL_SUBNET4, isc::dhcp::HOSTS_DBG_TRACE, isc::dhcp::hosts_logger, and LOG_DEBUG.
|
virtual |
Attempts to delete all hosts for a given IPv6 subnet.
subnet_id | Identifier of the subnet for which reservation should be deleted. |
Definition at line 1235 of file cfg_hosts.cc.
References isc::dhcp::HOSTS_CFG_DEL_ALL_SUBNET6, isc::dhcp::HOSTS_DBG_TRACE, isc::dhcp::hosts_logger, and LOG_DEBUG.
|
virtual |
Returns a host connected to the IPv4 subnet and having a reservation for a specified IPv4 address.
subnet_id | Subnet identifier. |
address | reserved IPv4 address. |
Host
object using a specified IPv4 address. Implements isc::dhcp::BaseHostDataSource.
Definition at line 749 of file cfg_hosts.cc.
References isc::dhcp::HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS4, isc::dhcp::HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS4_HOST, isc::dhcp::HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS4_NULL, isc::dhcp::HOSTS_DBG_RESULTS, isc::dhcp::HOSTS_DBG_TRACE, isc::dhcp::hosts_logger, and LOG_DEBUG.
|
virtual |
Returns a host connected to the IPv4 subnet.
subnet_id | Subnet identifier. |
identifier_type | Identifier type. |
identifier_begin | Pointer to a beginning of a buffer containing an identifier. |
identifier_len | Identifier length. |
Host
object for which reservation has been made using the specified identifier. Implements isc::dhcp::WritableHostDataSource.
Definition at line 739 of file cfg_hosts.cc.
|
virtual |
Returns a host connected to the IPv4 subnet.
subnet_id | Subnet identifier. |
identifier_type | Identifier type. |
identifier_begin | Pointer to a beginning of a buffer containing an identifier. |
identifier_len | Identifier length. |
Host
object for which reservation has been made using the specified identifier. Implements isc::dhcp::BaseHostDataSource.
Definition at line 729 of file cfg_hosts.cc.
|
virtual |
Returns a host using the specified IPv6 prefix.
prefix | IPv6 prefix for which the Host object is searched. |
prefix_len | IPv6 prefix length. |
Host
object for which specified prefix is reserved. Implements isc::dhcp::WritableHostDataSource.
Definition at line 805 of file cfg_hosts.cc.
|
virtual |
Returns a host using the specified IPv6 prefix.
prefix | IPv6 prefix for which the Host object is searched. |
prefix_len | IPv6 prefix length. |
Host
object for which specified prefix is reserved. Implements isc::dhcp::BaseHostDataSource.
Definition at line 799 of file cfg_hosts.cc.
|
virtual |
Returns a host connected to the IPv6 subnet and having a reservation for a specified IPv6 address.
subnet_id | Subnet identifier. |
address | reserved IPv6 address. |
Host
object using a specified IPv6 address. Implements isc::dhcp::WritableHostDataSource.
Definition at line 819 of file cfg_hosts.cc.
|
virtual |
Returns a host connected to the IPv6 subnet and having a reservation for a specified IPv6 address.
subnet_id | Subnet identifier. |
address | reserved IPv6 address. |
Host
object using a specified IPv6 address. Implements isc::dhcp::BaseHostDataSource.
Definition at line 811 of file cfg_hosts.cc.
|
virtual |
Returns a host connected to the IPv6 subnet.
subnet_id | Subnet identifier. |
identifier_type | Identifier type. |
identifier_begin | Pointer to a beginning of a buffer containing an identifier. |
identifier_len | Identifier length. |
Host
object for which reservation has been made using the specified identifier. Implements isc::dhcp::WritableHostDataSource.
Definition at line 789 of file cfg_hosts.cc.
|
virtual |
Returns a host connected to the IPv6 subnet.
subnet_id | Subnet identifier. |
identifier_type | Identifier type. |
identifier_begin | Pointer to a beginning of a buffer containing an identifier. |
identifier_len | Identifier length. |
Host
object for which reservation has been made using the specified identifier. Implements isc::dhcp::BaseHostDataSource.
Definition at line 779 of file cfg_hosts.cc.
|
virtual |
Non-const version of the getAll
const method.
This method returns all Host
objects which represent reservations for a specified identifier. This method may return multiple hosts because a particular client may have reservations in multiple subnets.
identifier_type | One of the supported identifier types. |
identifier_begin | Pointer to a beginning of a buffer containing an identifier. |
identifier_len | Identifier length. |
Host
objects. Implements isc::dhcp::WritableHostDataSource.
Definition at line 47 of file cfg_hosts.cc.
|
virtual |
Return all hosts connected to any subnet for which reservations have been made using a specified identifier.
This method returns all Host
objects which represent reservations for a specified identifier. This method may return multiple hosts because a particular client may have reservations in multiple subnets.
identifier_type | One of the supported identifier types. |
identifier_begin | Pointer to a beginning of a buffer containing an identifier. |
identifier_len | Identifier length. |
Host
objects. Implements isc::dhcp::BaseHostDataSource.
Definition at line 34 of file cfg_hosts.cc.
|
virtual |
Returns a collection of hosts using the specified IPv4 address.
This method may return multiple Host
objects if they are connected to different subnets.
address | IPv4 address for which the Host object is searched. |
Host
objects. Implements isc::dhcp::WritableHostDataSource.
Definition at line 293 of file cfg_hosts.cc.
|
virtual |
Returns a collection of hosts using the specified IPv4 address.
This method may return multiple Host
objects if they are connected to different subnets.
address | IPv4 address for which the Host object is searched. |
Host
objects. Implements isc::dhcp::BaseHostDataSource.
Definition at line 283 of file cfg_hosts.cc.
|
virtual |
Return all hosts in a DHCPv4 subnet.
This method returns all Host
objects which represent reservations in a specified subnet.
subnet_id | Subnet identifier. |
Host
objects. Implements isc::dhcp::WritableHostDataSource.
Definition at line 69 of file cfg_hosts.cc.
|
virtual |
Return all hosts in a DHCPv4 subnet.
This method returns all Host
objects which represent reservations in a specified subnet.
subnet_id | Subnet identifier. |
Host
objects. Implements isc::dhcp::BaseHostDataSource.
Definition at line 59 of file cfg_hosts.cc.
|
virtual |
Returns all hosts connected to the IPv4 subnet and having a reservation for a specified address.
In most cases it is desired that there is at most one reservation for a given IPv4 address within a subnet. In a default configuration, the backend does not allow for inserting more than one host with the same IPv4 reservation. In that case, the number of hosts returned by this function is 0 or 1.
If the backend is configured to allow multiple hosts with reservations for the same IPv4 address in the given subnet, this method can return more than one host.
The typical use case when a single IPv4 address is reserved for multiple hosts is when these hosts represent different interfaces of the same machine and each interface comes with a different MAC address. In that case, the same IPv4 address is assigned regardless of which interface is used by the DHCP client to communicate with the server.
subnet_id | Subnet identifier. |
address | reserved IPv4 address. |
Host
objects. Implements isc::dhcp::BaseHostDataSource.
Definition at line 772 of file cfg_hosts.cc.
|
virtual |
Returns a collection of hosts using the specified IPv6 address.
This method may return multiple Host
objects if they are connected to different subnets.
address | IPv6 address for which the Host object is searched. |
Host
objects. Definition at line 313 of file cfg_hosts.cc.
|
virtual |
Returns a collection of hosts using the specified IPv6 address.
This method may return multiple Host
objects if they are connected to different subnets.
address | IPv6 address for which the Host object is searched. |
Host
objects. Implements isc::dhcp::BaseHostDataSource.
Definition at line 303 of file cfg_hosts.cc.
|
virtual |
Return all hosts in a DHCPv6 subnet.
This method returns all Host
objects which represent reservations in a specified subnet.
subnet_id | Subnet identifier. |
Host
objects. Implements isc::dhcp::WritableHostDataSource.
Definition at line 89 of file cfg_hosts.cc.
|
virtual |
Return all hosts in a DHCPv6 subnet.
This method returns all Host
objects which represent reservations in a specified subnet.
subnet_id | Subnet identifier. |
Host
objects. Implements isc::dhcp::BaseHostDataSource.
Definition at line 79 of file cfg_hosts.cc.
|
virtual |
Returns all hosts connected to the IPv6 subnet and having a reservation for a specified address or delegated prefix (lease).
In most cases it is desired that there is at most one reservation for a given IPv6 lease within a subnet. In a default configuration, the backend does not allow for inserting more than one host with the same IPv6 address or prefix. In that case, the number of hosts returned by this function is 0 or 1.
If the backend is configured to allow multiple hosts with reservations for the same IPv6 lease in the given subnet, this method can return more than one host.
The typical use case when a single IPv6 lease is reserved for multiple hosts is when these hosts represent different interfaces of the same machine and each interface comes with a different MAC address. In that case, the same IPv6 lease is assigned regardless of which interface is used by the DHCP client to communicate with the server.
subnet_id | Subnet identifier. |
address | reserved IPv6 address/prefix. |
Host
objects. Implements isc::dhcp::BaseHostDataSource.
Definition at line 827 of file cfg_hosts.cc.
|
virtual |
Return all hosts with a hostname.
This method returns all Host
objects which represent reservations using a specified hostname.
hostname | The lower case hostname. |
Host
objects. Implements isc::dhcp::WritableHostDataSource.
Definition at line 109 of file cfg_hosts.cc.
|
virtual |
Return all hosts with a hostname.
This method returns all Host
objects which represent reservations using a specified hostname.
hostname | The lower case hostname. |
Host
objects. Implements isc::dhcp::BaseHostDataSource.
Definition at line 99 of file cfg_hosts.cc.
|
virtual |
Return all hosts with a hostname in a DHCPv4 subnet.
This method returns all Host
objects which represent reservations using a specified hostname in a specified subnet.
hostname | The lower case hostname. |
subnet_id | Subnet identifier. |
Host
objects. Implements isc::dhcp::WritableHostDataSource.
Definition at line 130 of file cfg_hosts.cc.
|
virtual |
Return all hosts with a hostname in a DHCPv4 subnet.
This method returns all Host
objects which represent reservations using a specified hostname in a specified subnet.
hostname | The lower case hostname. |
subnet_id | Subnet identifier. |
Host
objects. Implements isc::dhcp::BaseHostDataSource.
Definition at line 119 of file cfg_hosts.cc.
|
virtual |
Return all hosts with a hostname in a DHCPv6 subnet.
This method returns all Host
objects which represent reservations using a specified hostname in a specified subnet.
hostname | The lower case hostname. |
subnet_id | Subnet identifier. |
Host
objects. Implements isc::dhcp::WritableHostDataSource.
Definition at line 152 of file cfg_hosts.cc.
|
virtual |
Return all hosts with a hostname in a DHCPv6 subnet.
This method returns all Host
objects which represent reservations using a specified hostname in a specified subnet.
hostname | The lower case hostname. |
subnet_id | Subnet identifier. |
Host
objects. Implements isc::dhcp::BaseHostDataSource.
Definition at line 141 of file cfg_hosts.cc.
|
virtual |
Returns range of hosts in a DHCPv4 subnet.
This method returns a page of Host
objects which represent reservations in a specified subnet.
subnet_id | Subnet identifier. |
source_index | Index of the source (unused). |
lower_host_id | Host identifier used as lower bound for the returned range. |
page_size | maximum size of the page returned. |
Host
objects (may be empty). Implements isc::dhcp::WritableHostDataSource.
Definition at line 179 of file cfg_hosts.cc.
|
virtual |
Returns range of hosts in a DHCPv4 subnet.
This method returns a page of Host
objects which represent reservations in a specified subnet.
subnet_id | Subnet identifier. |
source_index | Index of the source (unused). |
lower_host_id | Host identifier used as lower bound for the returned range. |
page_size | maximum size of the page returned. |
Host
objects (may be empty). Implements isc::dhcp::BaseHostDataSource.
Definition at line 163 of file cfg_hosts.cc.
|
virtual |
Returns range of hosts.
This method returns a page of Host
objects which represent reservations.
source_index | Index of the source (unused). |
lower_host_id | Host identifier used as lower bound for the returned range. |
page_size | maximum size of the page returned. |
Host
objects (may be empty). Implements isc::dhcp::WritableHostDataSource.
Definition at line 241 of file cfg_hosts.cc.
|
virtual |
Returns range of hosts.
This method returns a page of Host
objects which represent reservations.
source_index | Index of the source (unused). |
lower_host_id | Host identifier used as lower bound for the returned range. |
page_size | maximum size of the page returned. |
Host
objects (may be empty). Implements isc::dhcp::BaseHostDataSource.
Definition at line 227 of file cfg_hosts.cc.
|
virtual |
Returns range of hosts in a DHCPv6 subnet.
This method returns a page of Host
objects which represent reservations in a specified subnet.
subnet_id | Subnet identifier. |
source_index | Index of the source (unused). |
lower_host_id | Host identifier used as lower bound for the returned range. |
page_size | maximum size of the page returned. |
Host
objects (may be empty). Implements isc::dhcp::WritableHostDataSource.
Definition at line 211 of file cfg_hosts.cc.
|
virtual |
Returns range of hosts in a DHCPv6 subnet.
This method returns a page of Host
objects which represent reservations in a specified subnet.
subnet_id | Subnet identifier. |
source_index | Index of the source (unused). |
lower_host_id | Host identifier used as lower bound for the returned range. |
page_size | maximum size of the page returned. |
Host
objects (may be empty). Implements isc::dhcp::BaseHostDataSource.
Definition at line 195 of file cfg_hosts.cc.
|
virtual |
Returns range of hosts.
This method returns a page of Host
objects which represent reservations.
source_index | Index of the source (unused). |
lower_host_id | Host identifier used as lower bound for the returned range. |
page_size | maximum size of the page returned. |
Host
objects (may be empty). Implements isc::dhcp::WritableHostDataSource.
Definition at line 269 of file cfg_hosts.cc.
|
virtual |
Returns range of hosts.
This method returns a page of Host
objects which represent reservations.
source_index | Index of the source (unused). |
lower_host_id | Host identifier used as lower bound for the returned range. |
page_size | maximum size of the page returned. |
Host
objects (may be empty). Implements isc::dhcp::BaseHostDataSource.
Definition at line 255 of file cfg_hosts.cc.
|
inlinevirtual |
Return backend type.
Returns the type of the backend (e.g. "mysql", "memfile" etc.)
Implements isc::dhcp::BaseHostDataSource.
Definition at line 610 of file cfg_hosts.h.
|
virtual |
Controls whether IP reservations are unique or non-unique.
In a typical case, the IP reservations are unique and backends verify prior to adding a host reservation to the database that the reservation for a given IP address/subnet does not exist. In some cases it may be required to allow non-unique IP reservations, e.g. in the case when a host has several interfaces and independently of which interface is used by this host to communicate with the DHCP server the same IP address should be assigned. In this case the unique
value should be set to false to disable the checks for uniqueness on the backend side.
unique | boolean flag indicating if the IP reservations must be unique or can be non-unique. |
Implements isc::dhcp::BaseHostDataSource.
Definition at line 1348 of file cfg_hosts.cc.
|
virtual |
Unparse a configuration object.
host reservation lists are not autonomous so they are not returned directly but with the subnet where they are declared as:
isc::dhcp::CfgHostsList can be used to handle this
Implements isc::data::CfgToElement.
Definition at line 1356 of file cfg_hosts.cc.
References isc::dhcp::CfgMgr::instance(), and isc_throw.
|
virtual |
Attempts to update an existing host entry.
The implementation is common to multiple host data sources, so let's provide it in the base host data source. In some instances, it may require synchronization e.g. with transactions in case of databases.
host | the host up to date with the requested changes |
Reimplemented from isc::dhcp::BaseHostDataSource.
Definition at line 1293 of file cfg_hosts.cc.
References isc::dhcp::HOSTS_CFG_UPDATE_ADD, isc::dhcp::HOSTS_CFG_UPDATE_DEL4, isc::dhcp::HOSTS_CFG_UPDATE_DEL6, isc::dhcp::HOSTS_DBG_TRACE, isc::dhcp::hosts_logger, isc_throw, and LOG_DEBUG.