: sequence_(0), cfg_iface_(new CfgIface()),
cfg_option_def_(new CfgOptionDef()), cfg_option_(new CfgOption()),
cfg_subnets4_(new CfgSubnets4()), cfg_subnets6_(new CfgSubnets6()),
+ cfg_shared_networks4_(new CfgSharedNetworks4()),
+ cfg_shared_networks6_(new CfgSharedNetworks6()),
cfg_hosts_(new CfgHosts()), cfg_rsoo_(new CfgRSOO()),
cfg_expiration_(new CfgExpiration()), cfg_duid_(new CfgDUID()),
cfg_db_access_(new CfgDbAccess()),
: sequence_(sequence), cfg_iface_(new CfgIface()),
cfg_option_def_(new CfgOptionDef()), cfg_option_(new CfgOption()),
cfg_subnets4_(new CfgSubnets4()), cfg_subnets6_(new CfgSubnets6()),
+ cfg_shared_networks4_(new CfgSharedNetworks4()),
+ cfg_shared_networks6_(new CfgSharedNetworks6()),
cfg_hosts_(new CfgHosts()), cfg_rsoo_(new CfgRSOO()),
cfg_expiration_(new CfgExpiration()), cfg_duid_(new CfgDUID()),
cfg_db_access_(new CfgDbAccess()),
dhcp->set("option-def", cfg_option_def_->toElement());
// Set option-data
dhcp->set("option-data", cfg_option_->toElement());
- // Set subnets
+
+ // Set subnets and shared networks.
ConstElementPtr subnets;
if (family == AF_INET) {
subnets = cfg_subnets4_->toElement();
dhcp->set("subnet4", subnets);
+
+ ConstElementPtr shared_networks = cfg_shared_networks4_->toElement();
+ dhcp->set("shared-networks", shared_networks);
+
} else {
subnets = cfg_subnets6_->toElement();
dhcp->set("subnet6", subnets);
+
+ ConstElementPtr shared_networks = cfg_shared_networks6_->toElement();
+ dhcp->set("shared-networks", shared_networks);
}
// Insert reservations
CfgHostsList resv_list;
#include <dhcpsrv/cfg_option.h>
#include <dhcpsrv/cfg_option_def.h>
#include <dhcpsrv/cfg_rsoo.h>
+#include <dhcpsrv/cfg_shared_networks.h>
#include <dhcpsrv/cfg_subnets4.h>
#include <dhcpsrv/cfg_subnets6.h>
#include <dhcpsrv/cfg_mac_source.h>
return (cfg_subnets4_);
}
+ /// @brief Returns pointer to non-const object holding configuration of
+ /// shared networks in DHCPv4;
+ ///
+ /// @return Pointer to the object holding shared networks configuration
+ /// for DHCPv4.
+ CfgSharedNetworks4Ptr getCfgSharedNetworks4() const {
+ return (cfg_shared_networks4_);
+ }
+
+ /// @brief Returns pointer to non-const object holding configuration of
+ /// shared networks in DHCPv6.
+ ///
+ /// @return Pointer to the object holding shared networks configuration
+ /// for DHCPv6.
+ CfgSharedNetworks6Ptr getCfgSharedNetworks6() const {
+ return (cfg_shared_networks6_);
+ }
+
/// @brief Returns pointer to const object holding subnets configuration for
/// DHCPv4.
///
/// @brief Pointer to subnets configuration for IPv6.
CfgSubnets6Ptr cfg_subnets6_;
+ /// @brief Pointer to IPv4 shared networks configuration.
+ CfgSharedNetworks4Ptr cfg_shared_networks4_;
+
+ /// @brief Pointer to IPv4 shared networks configuration.
+ CfgSharedNetworks6Ptr cfg_shared_networks6_;
+
/// @brief Pointer to the configuration for hosts reservation.
///
/// This object holds a list of @c Host objects representing host
defaults += conf.getD2ClientConfig()->toElement()->str() + ",\n";
std::string defaults4 = "\"echo-client-id\": true,\n";
+ defaults4 += "\"shared-networks\": [ ],\n";
defaults4 += "\"subnet4\": [ ],\n";
defaults4 += "\"host-reservation-identifiers\": ";
defaults4 += "[ \"hw-address\", \"duid\", \"circuit-id\", \"client-id\" ],\n";
std::string defaults6 = "\"relay-supplied-options\": [ \"65\" ],\n";
+ defaults6 += "\"shared-networks\": [ ],\n";
defaults6 += "\"subnet6\": [ ],\n";
defaults6 += "\"server-id\": ";
defaults6 += conf.getCfgDUID()->toElement()->str() + ",\n";