]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3587] Hooked up the CfgSubnet4 class to the SrvConfig class.
authorMarcin Siodelski <marcin@isc.org>
Mon, 20 Oct 2014 16:30:54 +0000 (18:30 +0200)
committerMarcin Siodelski <marcin@isc.org>
Tue, 21 Oct 2014 09:16:46 +0000 (11:16 +0200)
src/lib/dhcpsrv/cfg_subnets4.h
src/lib/dhcpsrv/srv_config.cc
src/lib/dhcpsrv/srv_config.h

index 8857fa7369940b1d69715dc5de4a32679a64e427..bfcb879690f29415527d820ddfbbcb3306fd93a0 100644 (file)
@@ -19,6 +19,7 @@
 #include <exceptions/exceptions.h>
 #include <dhcpsrv/subnet.h>
 #include <util/optional_value.h>
+#include <boost/shared_ptr.hpp>
 
 namespace isc {
 namespace dhcp {
@@ -143,6 +144,16 @@ private:
 
 };
 
+/// @name Pointer to the @c CfgSubnets4 objects.
+//@{
+/// @brief Non-const pointer.
+typedef boost::shared_ptr<CfgSubnets4> CfgSubnets4Ptr;
+
+/// @brief Const pointer.
+typedef boost::shared_ptr<const CfgSubnets4> ConstCfgSubnets4Ptr;
+
+//@}
+
 }
 }
 
index f3f99129303c14c3dd033296e554368ae59cc3f7..8ba98514c54f50b657ade70445ff07417726acf2 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_subnets4_(new CfgSubnets4()) {
 }
 
 SrvConfig::SrvConfig(const uint32_t sequence)
     : sequence_(sequence), cfg_option_def_(new CfgOptionDef()),
-      cfg_option_(new CfgOption()) {
+      cfg_option_(new CfgOption()), cfg_subnets4_(new CfgSubnets4()) {
 }
 
 std::string
index 0cd7b37e2f7cb3e53134cecdbf412ec171d4c628..6ffca74b9cac24a8620b0553677a162b5d0d60b1 100644 (file)
@@ -18,6 +18,7 @@
 #include <dhcpsrv/cfg_iface.h>
 #include <dhcpsrv/cfg_option.h>
 #include <dhcpsrv/cfg_option_def.h>
+#include <dhcpsrv/cfg_subnets4.h>
 #include <dhcpsrv/logging_info.h>
 #include <boost/shared_ptr.hpp>
 #include <vector>
@@ -184,6 +185,22 @@ public:
         return (cfg_option_);
     }
 
+    /// @brief Returns pointer to non-const object holding subnets configuration
+    /// for DHCPv4.
+    ///
+    /// @return Pointer to the object holding subnets configuration for DHCPv4.
+    CfgSubnets4Ptr getCfgSubnets4() {
+        return (cfg_subnets4_);
+    }
+
+    /// @brief Returns pointer to const object holding subnets configuration for
+    /// DHCPv4.
+    ///
+    /// @return Pointer to the object holding subnets configuration for DHCPv4.
+    ConstCfgSubnets4Ptr getCfgSubnets4() const {
+        return (cfg_subnets4_);
+    }
+
     //@}
 
     /// @brief Copies the currnet configuration to a new configuration.
@@ -277,6 +294,9 @@ private:
     /// connected to any subnet.
     CfgOptionPtr cfg_option_;
 
+    /// @brief Pointer to subnets configuration for IPv4.
+    CfgSubnets4Ptr cfg_subnets4_;
+
 };
 
 /// @name Pointers to the @c SrvConfig object.