]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3562] Use CfgHosts object in the SrvConfig.
authorMarcin Siodelski <marcin@isc.org>
Mon, 27 Oct 2014 11:49:38 +0000 (12:49 +0100)
committerMarcin Siodelski <marcin@isc.org>
Mon, 27 Oct 2014 11:49:38 +0000 (12:49 +0100)
src/lib/dhcpsrv/cfg_hosts.h
src/lib/dhcpsrv/srv_config.cc
src/lib/dhcpsrv/srv_config.h

index 95a7cb4e71bc3235b4d400b46ebf05a30a50fde5..9164aeeee8ebcb380deeb8402224f84e8e515ab1 100644 (file)
@@ -22,6 +22,7 @@
 #include <dhcpsrv/host.h>
 #include <dhcpsrv/host_container.h>
 #include <dhcpsrv/subnet_id.h>
+#include <boost/shared_ptr.hpp>
 #include <vector>
 
 namespace isc {
@@ -235,6 +236,16 @@ private:
 
 };
 
+/// @name Pointers to the @c CfgHosts objects.
+//@{
+/// @brief Non-const pointer.
+typedef boost::shared_ptr<CfgHosts> CfgHostsPtr;
+
+/// @brief Const pointer.
+typedef boost::shared_ptr<const CfgHosts> ConstCfgHostsPtr;
+
+//@}
+
 }
 }
 
index f3f99129303c14c3dd033296e554368ae59cc3f7..2c42a1de0773f2ec6325e47548088ade5e34ea88 100644 (file)
@@ -26,12 +26,12 @@ namespace dhcp {
 
 SrvConfig::SrvConfig()
     : sequence_(0), cfg_option_def_(new CfgOptionDef()),
-      cfg_option_(new CfgOption()) {
+      cfg_option_(new CfgOption()), cfg_hosts_(new CfgHosts()) {
 }
 
 SrvConfig::SrvConfig(const uint32_t sequence)
     : sequence_(sequence), cfg_option_def_(new CfgOptionDef()),
-      cfg_option_(new CfgOption()) {
+      cfg_option_(new CfgOption()), cfg_hosts_(new CfgHosts()) {
 }
 
 std::string
index 0cd7b37e2f7cb3e53134cecdbf412ec171d4c628..1fd91892c656071fc23cea2dd57c41069939665a 100644 (file)
@@ -15,6 +15,7 @@
 #ifndef DHCPSRV_CONFIG_H
 #define DHCPSRV_CONFIG_H
 
+#include <dhcpsrv/cfg_hosts.h>
 #include <dhcpsrv/cfg_iface.h>
 #include <dhcpsrv/cfg_option.h>
 #include <dhcpsrv/cfg_option_def.h>
@@ -184,6 +185,22 @@ public:
         return (cfg_option_);
     }
 
+    /// @brief Returns pointer to the non-const objects representing host
+    /// reservations for different IPv4 and IPv6 subnets.
+    ///
+    /// @return Pointer to the non-const object holding host reservations.
+    CfgHostsPtr getCfgHosts() {
+        return (cfg_hosts_);
+    }
+
+    /// @brief Returns pointer to the const objects representing host
+    /// reservations for different IPv4 and IPv6 subnets.
+    ///
+    /// @return Pointer to the const object holding host reservations.
+    ConstCfgHostsPtr getCfgHosts() const {
+        return (cfg_hosts_);
+    }
+
     //@}
 
     /// @brief Copies the currnet configuration to a new configuration.
@@ -277,6 +294,12 @@ private:
     /// connected to any subnet.
     CfgOptionPtr cfg_option_;
 
+    /// @brief Pointer to the configuration for hosts reservation.
+    ///
+    /// This object holds a list of @c Host objects representing host
+    /// reservations for different IPv4 and IPv6 subnets.
+    CfgHostsPtr cfg_hosts_;
+
 };
 
 /// @name Pointers to the @c SrvConfig object.