![]() |
Kea 3.1.1
|
Host backend for Radius. More...
#include <radius_backend.h>
Public Member Functions | |
RadiusBackend () | |
Constructor. | |
virtual | ~RadiusBackend () |
Destructor. | |
virtual void | add (const isc::dhcp::HostPtr &host) override |
Adds a new host to the collection. | |
virtual bool | del (const isc::dhcp::SubnetID &subnet_id, const isc::asiolink::IOAddress &addr) override |
Attempts to delete a host by (subnet-id, address) | |
virtual bool | del4 (const isc::dhcp::SubnetID &subnet_id, const isc::dhcp::Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) override |
Attempts to delete a host by (subnet-id4, identifier, identifier-type) | |
virtual bool | del6 (const isc::dhcp::SubnetID &subnet_id, const isc::dhcp::Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) override |
Attempts to delete a host by (subnet-id6, identifier, identifier-type) | |
virtual isc::dhcp::ConstHostPtr | get4 (const isc::dhcp::SubnetID &subnet_id, const isc::asiolink::IOAddress &address) const override |
Returns a host connected to the IPv4 subnet and having a reservation for a specified IPv4 address. | |
virtual isc::dhcp::ConstHostPtr | get4 (const isc::dhcp::SubnetID &subnet_id, const isc::dhcp::Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const override |
Returns a host connected to the IPv4 subnet. | |
virtual isc::dhcp::ConstHostPtr | get6 (const isc::asiolink::IOAddress &prefix, const uint8_t prefix_len) const override |
Returns a host using the specified IPv6 prefix. | |
virtual isc::dhcp::ConstHostPtr | get6 (const isc::dhcp::SubnetID &subnet_id, const isc::asiolink::IOAddress &address) const override |
Returns a host connected to the IPv6 subnet and having a reservation for a specified IPv6 address or prefix. | |
virtual isc::dhcp::ConstHostPtr | get6 (const isc::dhcp::SubnetID &subnet_id, const isc::dhcp::Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const override |
Returns a host connected to the IPv6 subnet. | |
virtual isc::dhcp::ConstHostCollection | getAll (const isc::dhcp::Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const override |
From base class. | |
virtual isc::dhcp::ConstHostCollection | getAll4 (const isc::asiolink::IOAddress &address) const override |
Returns a collection of hosts using the specified IPv4 address. | |
virtual isc::dhcp::ConstHostCollection | getAll4 (const isc::dhcp::SubnetID &subnet_id) const override |
Return all hosts in a specified DHCPv4 subnet. | |
virtual isc::dhcp::ConstHostCollection | getAll4 (const isc::dhcp::SubnetID &subnet_id, const isc::asiolink::IOAddress &address) const override |
Returns all hosts connected to the IPv4 subnet and having a reservation for a specified address. | |
virtual dhcp::ConstHostCollection | getAll6 (const isc::asiolink::IOAddress &address) const override |
Returns a collection of hosts using the specified IPv6 address/prefix. | |
virtual isc::dhcp::ConstHostCollection | getAll6 (const isc::dhcp::SubnetID &subnet_id) const override |
Return all hosts in a specified DHCPv6 subnet. | |
virtual isc::dhcp::ConstHostCollection | getAll6 (const isc::dhcp::SubnetID &subnet_id, const isc::asiolink::IOAddress &address) const override |
Returns all hosts connected to the IPv6 subnet and having a reservation for a specified address or delegated prefix (lease). | |
virtual isc::dhcp::ConstHostCollection | getAllbyHostname (const std::string &hostname) const override |
Return all hosts with a hostname. | |
virtual isc::dhcp::ConstHostCollection | getAllbyHostname4 (const std::string &hostname, const isc::dhcp::SubnetID &subnet_id) const override |
Return all hosts with a hostname in a DHCPv4 subnet. | |
virtual isc::dhcp::ConstHostCollection | getAllbyHostname6 (const std::string &hostname, const isc::dhcp::SubnetID &subnet_id) const override |
Return all hosts with a hostname in a DHCPv6 subnet. | |
virtual isc::dhcp::ConstHostCollection | getPage4 (const isc::dhcp::SubnetID &subnet_id, size_t &source_index, uint64_t lower_host_id, const dhcp::HostPageSize &page_size) const override |
Return range of hosts in a specified DHCPv4 subnet. | |
virtual isc::dhcp::ConstHostCollection | getPage4 (size_t &source_index, uint64_t lower_host_id, const dhcp::HostPageSize &page_size) const override |
Return range of hosts. | |
virtual isc::dhcp::ConstHostCollection | getPage6 (const isc::dhcp::SubnetID &subnet_id, size_t &source_index, uint64_t lower_host_id, const dhcp::HostPageSize &page_size) const override |
Return range of hosts in a specified DHCPv6 subnet. | |
virtual isc::dhcp::ConstHostCollection | getPage6 (size_t &source_index, uint64_t lower_host_id, const dhcp::HostPageSize &page_size) const override |
Return range of hosts. | |
virtual std::string | getType () const override |
Return backend type. | |
size_t | getUnexpected4 () const |
Return unexpected calls for IPv4. | |
size_t | getUnexpected6 () const |
Return unexpected calls for IPv6. | |
virtual bool | setIPReservationsUnique (const bool unique) override |
Controls whether IP reservations are unique or non-unique. | |
![]() | |
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. | |
virtual void | update (HostPtr const &host) |
Attempts to update an existing host entry. | |
Protected Attributes | |
boost::shared_ptr< RadiusBackendImpl > | impl_ |
Implementation. | |
Additional Inherited Members | |
![]() | |
enum | IdType { ID_HWADDR = 0 , ID_DUID = 1 } |
Specifies the type of an identifier. More... | |
Host backend for Radius.
This backend handles no data. It can be called when:
Definition at line 23 of file radius_backend.h.
isc::radius::RadiusBackend::RadiusBackend | ( | ) |
|
virtual |
Destructor.
Definition at line 26 of file radius_backend.cc.
|
overridevirtual |
Adds a new host to the collection.
The implementations of this method should guard against duplicate reservations for the same host, where possible. For example, when the reservation for the same HW address and subnet id is added twice, the implementation should throw an exception. Note, that usually it is impossible to guard against adding duplicated host, where one instance is identified by HW address, another one by DUID.
Not implemented.
host | Pointer to the new Host object being added. |
Implements isc::dhcp::BaseHostDataSource.
Definition at line 152 of file radius_backend.cc.
|
overridevirtual |
Attempts to delete a host by (subnet-id, address)
Not implemented for Radius.
subnet_id | subnet identifier. |
addr | specified address. |
Implements isc::dhcp::BaseHostDataSource.
Definition at line 156 of file radius_backend.cc.
|
overridevirtual |
Attempts to delete a host by (subnet-id4, identifier, identifier-type)
Not implemented for Radius.
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 162 of file radius_backend.cc.
|
overridevirtual |
Attempts to delete a host by (subnet-id6, identifier, identifier-type)
Not implemented for Radius.
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 170 of file radius_backend.cc.
|
overridevirtual |
Returns a host connected to the IPv4 subnet and having a reservation for a specified IPv4 address.
Not implemented.
subnet_id | Subnet identifier. |
address | reserved IPv4 address. |
Implements isc::dhcp::BaseHostDataSource.
Definition at line 108 of file radius_backend.cc.
|
overridevirtual |
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 99 of file radius_backend.cc.
References impl_.
|
overridevirtual |
Returns a host using the specified IPv6 prefix.
Not implemented.
prefix | IPv6 prefix for which the Host object is searched. |
prefix_len | IPv6 prefix length. |
Implements isc::dhcp::BaseHostDataSource.
Definition at line 129 of file radius_backend.cc.
|
overridevirtual |
Returns a host connected to the IPv6 subnet and having a reservation for a specified IPv6 address or prefix.
Not implemented.
subnet_id | Subnet identifier. |
address | reserved IPv6 address/prefix. |
Implements isc::dhcp::BaseHostDataSource.
Definition at line 135 of file radius_backend.cc.
|
overridevirtual |
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 120 of file radius_backend.cc.
References impl_.
|
overridevirtual |
From base class.
Return all hosts connected to any subnet for which reservations have been made using a specified identifier.
Not supported.
Implements isc::dhcp::BaseHostDataSource.
Definition at line 30 of file radius_backend.cc.
|
overridevirtual |
Returns a collection of hosts using the specified IPv4 address.
Not supported.
address | IPv4 address for which the Host object is searched. |
Host
objects. Implements isc::dhcp::BaseHostDataSource.
Definition at line 94 of file radius_backend.cc.
|
overridevirtual |
Return all hosts in a specified DHCPv4 subnet.
Not supported.
Host
objects. Implements isc::dhcp::BaseHostDataSource.
Definition at line 37 of file radius_backend.cc.
|
overridevirtual |
Returns all hosts connected to the IPv4 subnet and having a reservation for a specified address.
subnet_id | Subnet identifier. |
address | reserved IPv4 address. |
Host
objects. Implements isc::dhcp::BaseHostDataSource.
Definition at line 114 of file radius_backend.cc.
|
overridevirtual |
Returns a collection of hosts using the specified IPv6 address/prefix.
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 147 of file radius_backend.cc.
|
overridevirtual |
Return all hosts in a specified DHCPv6 subnet.
Not supported.
Host
objects. Implements isc::dhcp::BaseHostDataSource.
Definition at line 42 of file radius_backend.cc.
|
overridevirtual |
Returns all hosts connected to the IPv6 subnet and having a reservation for a specified address or delegated prefix (lease).
subnet_id | Subnet identifier. |
address | reserved IPv6 address/prefix. |
Host
objects. Implements isc::dhcp::BaseHostDataSource.
Definition at line 141 of file radius_backend.cc.
|
overridevirtual |
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 47 of file radius_backend.cc.
|
overridevirtual |
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 52 of file radius_backend.cc.
|
overridevirtual |
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 58 of file radius_backend.cc.
|
overridevirtual |
Return range of hosts in a specified DHCPv4 subnet.
Not supported.
Host
objects. Implements isc::dhcp::BaseHostDataSource.
Definition at line 64 of file radius_backend.cc.
|
overridevirtual |
Return range of hosts.
Not supported.
Host
objects. Implements isc::dhcp::BaseHostDataSource.
Definition at line 80 of file radius_backend.cc.
|
overridevirtual |
Return range of hosts in a specified DHCPv6 subnet.
Not supported.
Host
objects. Implements isc::dhcp::BaseHostDataSource.
Definition at line 72 of file radius_backend.cc.
|
overridevirtual |
Return range of hosts.
Not supported.
Host
objects. Implements isc::dhcp::BaseHostDataSource.
Definition at line 87 of file radius_backend.cc.
|
inlineoverridevirtual |
Return backend type.
Returns the type of the backend (e.g. "mysql", "memfile" etc.)
Implements isc::dhcp::BaseHostDataSource.
Definition at line 315 of file radius_backend.h.
size_t isc::radius::RadiusBackend::getUnexpected4 | ( | ) | const |
Return unexpected calls for IPv4.
Definition at line 187 of file radius_backend.cc.
References impl_.
size_t isc::radius::RadiusBackend::getUnexpected6 | ( | ) | const |
Return unexpected calls for IPv6.
Definition at line 192 of file radius_backend.cc.
References impl_.
|
overridevirtual |
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 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 within the subnet or can be non-unique. |
Implements isc::dhcp::BaseHostDataSource.
Definition at line 178 of file radius_backend.cc.
|
protected |
Implementation.
Definition at line 345 of file radius_backend.h.
Referenced by RadiusBackend(), get4(), get6(), getUnexpected4(), and getUnexpected6().