diff options
author | Marcin Siodelski <marcin@isc.org> | 2020-09-25 14:12:14 +0200 |
---|---|---|
committer | Marcin Siodelski <marcin@isc.org> | 2020-10-05 15:14:57 +0200 |
commit | 99c44ffd314947a20aca781e1a5cc7b58ade0ff4 (patch) | |
tree | d53aad88d4f284222a2ba6437da2552d8a1acd40 /src/lib/dhcpsrv/mysql_host_data_source.h | |
parent | [#1418] Fixed ChangeLog number (diff) | |
download | kea-99c44ffd314947a20aca781e1a5cc7b58ade0ff4.tar.xz kea-99c44ffd314947a20aca781e1a5cc7b58ade0ff4.zip |
[#1428] Allow non-unique IPs in MySQL and PgSQL
Introduced new host API function which allows for configuring selected
backends to accept non-unique IP reservations for multiple hosts. Support
for it was added in MySQL, Postgres and Kea config file. It is not
supported in Cassandra. New migrations for MySQL and Postgres have been
created.
Diffstat (limited to 'src/lib/dhcpsrv/mysql_host_data_source.h')
-rw-r--r-- | src/lib/dhcpsrv/mysql_host_data_source.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/dhcpsrv/mysql_host_data_source.h b/src/lib/dhcpsrv/mysql_host_data_source.h index 7790e6525c..f6266d4c67 100644 --- a/src/lib/dhcpsrv/mysql_host_data_source.h +++ b/src/lib/dhcpsrv/mysql_host_data_source.h @@ -384,6 +384,23 @@ public: /// Rolls back all pending database operations. virtual void rollback(); + /// @brief 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 @c unique value should be set to + /// false to disable the checks for uniqueness on the backend side. + /// + /// @param unique boolean flag indicating if the IP reservations must be + /// unique within the subnet or can be non-unique. + /// @return always true because this backend supports both the case when + /// the addresses must be unique and when they may be non-unique. + virtual bool setIPReservationUnique(const bool unique); + /// @brief Context RAII Allocator. class MySqlHostContextAlloc { public: |