Browse Source

[3587] Hooked up the CfgSubnet4 class to the SrvConfig class.

Marcin Siodelski 10 years ago
parent
commit
3e0307cc94
3 changed files with 33 additions and 2 deletions
  1. 11 0
      src/lib/dhcpsrv/cfg_subnets4.h
  2. 2 2
      src/lib/dhcpsrv/srv_config.cc
  3. 20 0
      src/lib/dhcpsrv/srv_config.h

+ 11 - 0
src/lib/dhcpsrv/cfg_subnets4.h

@@ -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;
+
+//@}
+
 }
 }
 

+ 2 - 2
src/lib/dhcpsrv/srv_config.cc

@@ -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

+ 20 - 0
src/lib/dhcpsrv/srv_config.h

@@ -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.