From: Marcin Siodelski Date: Mon, 27 Oct 2014 11:49:38 +0000 (+0100) Subject: [3562] Use CfgHosts object in the SrvConfig. X-Git-Tag: kea-eng-20141219~28^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cd1db81f9c907d5760d97f83e44c35e237f33235;p=thirdparty%2Fkea.git [3562] Use CfgHosts object in the SrvConfig. --- diff --git a/src/lib/dhcpsrv/cfg_hosts.h b/src/lib/dhcpsrv/cfg_hosts.h index 95a7cb4e71..9164aeeee8 100644 --- a/src/lib/dhcpsrv/cfg_hosts.h +++ b/src/lib/dhcpsrv/cfg_hosts.h @@ -22,6 +22,7 @@ #include #include #include +#include #include namespace isc { @@ -235,6 +236,16 @@ private: }; +/// @name Pointers to the @c CfgHosts objects. +//@{ +/// @brief Non-const pointer. +typedef boost::shared_ptr CfgHostsPtr; + +/// @brief Const pointer. +typedef boost::shared_ptr ConstCfgHostsPtr; + +//@} + } } diff --git a/src/lib/dhcpsrv/srv_config.cc b/src/lib/dhcpsrv/srv_config.cc index f3f9912930..2c42a1de07 100644 --- a/src/lib/dhcpsrv/srv_config.cc +++ b/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_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 diff --git a/src/lib/dhcpsrv/srv_config.h b/src/lib/dhcpsrv/srv_config.h index 0cd7b37e2f..1fd91892c6 100644 --- a/src/lib/dhcpsrv/srv_config.h +++ b/src/lib/dhcpsrv/srv_config.h @@ -15,6 +15,7 @@ #ifndef DHCPSRV_CONFIG_H #define DHCPSRV_CONFIG_H +#include #include #include #include @@ -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.