summaryrefslogtreecommitdiffstats
path: root/src/lib/dhcpsrv/writable_host_data_source.h
diff options
context:
space:
mode:
authorMarcin Siodelski <marcin@isc.org>2016-03-10 14:13:07 +0100
committerMarcin Siodelski <marcin@isc.org>2016-03-24 14:56:36 +0100
commitf551e0e480259c9ac4c748599664a28e9ccca6f6 (patch)
tree06283906e30e48b7f8d95b692b3cf8f449d18fac /src/lib/dhcpsrv/writable_host_data_source.h
parent[master] Eliminate doxygen warnings after #4212 and #3696. (diff)
downloadkea-f551e0e480259c9ac4c748599664a28e9ccca6f6.tar.xz
kea-f551e0e480259c9ac4c748599664a28e9ccca6f6.zip
[4302] Refactored host data source classes.
The updated API exposes functions which retrieve hosts by any identifier and identifier type, rather than DUID or HW address.
Diffstat (limited to 'src/lib/dhcpsrv/writable_host_data_source.h')
-rw-r--r--src/lib/dhcpsrv/writable_host_data_source.h46
1 files changed, 45 insertions, 1 deletions
diff --git a/src/lib/dhcpsrv/writable_host_data_source.h b/src/lib/dhcpsrv/writable_host_data_source.h
index f5d938c5ae..0dbee11629 100644
--- a/src/lib/dhcpsrv/writable_host_data_source.h
+++ b/src/lib/dhcpsrv/writable_host_data_source.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -40,6 +40,22 @@ public:
virtual HostCollection
getAll(const HWAddrPtr& hwaddr, const DuidPtr& duid = DuidPtr()) = 0;
+ /// @brief Non-const version of the @c getAll const method.
+ ///
+ /// This method returns all @c 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.
+ ///
+ /// @param identifier_begin Pointer to a begining of a buffer containing
+ /// an identifier.
+ /// @param identifier_len Identifier length.
+ ///
+ /// @return Collection of non-const @c Host objects.
+ virtual HostCollection
+ getAll(const Host::IdentifierType& identifier_type,
+ const uint8_t* identifier_begin,
+ const size_t identifier_len) = 0;
+
/// @brief Returns a collection of hosts using the specified IPv4 address.
///
/// This method may return multiple @c Host objects if they are connected
@@ -69,6 +85,20 @@ public:
get4(const SubnetID& subnet_id, const HWAddrPtr& hwaddr,
const DuidPtr& duid = DuidPtr()) = 0;
+ /// @brief Returns a host connected to the IPv4 subnet.
+ ///
+ /// @param subnet_id Subnet identifier.
+ /// @param identifier_type Identifier type.
+ /// @param identifier_begin Pointer to a begining of a buffer containing
+ /// an identifier.
+ /// @param identifier_len Identifier length.
+ ///
+ /// @return Non-const @c Host object for which reservation has been made
+ /// using the specified identifier.
+ virtual HostPtr
+ get4(const SubnetID& subnet_id, const Host::IdentifierType& identifier_type,
+ const uint8_t* identifier_begin, const size_t identifier_len) = 0;
+
/// @brief Returns a host connected to the IPv6 subnet.
///
/// Implementations of this method should guard against the case when
@@ -87,6 +117,20 @@ public:
get6(const SubnetID& subnet_id, const DuidPtr& duid,
const HWAddrPtr& hwaddr = HWAddrPtr()) = 0;
+ /// @brief Returns a host connected to the IPv6 subnet.
+ ///
+ /// @param subnet_id Subnet identifier.
+ /// @param identifier_type Identifier type.
+ /// @param identifier_begin Pointer to a begining of a buffer containing
+ /// an identifier.
+ /// @param identifier_len Identifier length.
+ ///
+ /// @return Non-const @c Host object for which reservation has been made
+ /// using the specified identifier.
+ virtual HostPtr
+ get6(const SubnetID& subnet_id, const Host::IdentifierType& identifier_type,
+ const uint8_t* identifier_begin, const size_t identifier_len) = 0;
+
/// @brief Returns a host using the specified IPv6 prefix.
///
/// @param prefix IPv6 prefix for which the @c Host object is searched.