summaryrefslogtreecommitdiffstats
path: root/src/lib/dhcpsrv/host_container.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/dhcpsrv/host_container.h')
-rw-r--r--src/lib/dhcpsrv/host_container.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/dhcpsrv/host_container.h b/src/lib/dhcpsrv/host_container.h
index ae21449c4e..55692cf25d 100644
--- a/src/lib/dhcpsrv/host_container.h
+++ b/src/lib/dhcpsrv/host_container.h
@@ -88,6 +88,13 @@ typedef boost::multi_index_container<
// Index using values returned by the @c Host::getHostId
boost::multi_index::const_mem_fun<Host, uint64_t,
&Host::getHostId>
+ >,
+
+ // Sixth index is used to search for the host using hostname
+ boost::multi_index::ordered_non_unique<
+ // Index using values returned by the @c Host::getLowerHostname
+ boost::multi_index::const_mem_fun<Host, std::string,
+ &Host::getLowerHostname>
>
>
> HostContainer;
@@ -141,6 +148,11 @@ typedef HostContainer::nth_index<4>::type HostContainerIndex4;
typedef std::pair<HostContainerIndex4::iterator,
HostContainerIndex4::iterator> HostContainerIndex4Range;
+/// @brief Sixth index type in the @c HostContainer.
+///
+/// This index allows for searching for @c Host objects using a hostname.
+typedef HostContainer::nth_index<5>::type HostContainerIndex5;
+
/// @brief Defines one entry for the Host Container for v6 hosts
///
/// It's essentially a pair of (IPv6 reservation, Host pointer).