Commit bc216c2c authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰

[3274] ClientClass added, Classes renamed to ClientClasses

parent 9c9ec6cd
......@@ -456,10 +456,10 @@ public:
}
boost::scoped_ptr<Dhcpv4Srv> srv_; // DHCP4 server under test
int rcode_; // Return code from element parsing
ConstElementPtr comment_; // Reason for parse fail
isc::dhcp::Classes classify_; // used in client classification
boost::scoped_ptr<Dhcpv4Srv> srv_; ///< DHCP4 server under test
int rcode_; ///< Return code from element parsing
ConstElementPtr comment_; ///< Reason for parse fail
isc::dhcp::ClientClasses classify_; ///< used in client classification
};
// Goal of this test is a verification if a very simple config update
......
......@@ -476,7 +476,7 @@ public:
ConstElementPtr comment_; ///< Comment (see @ref isc::config::parseAnswer)
string valid_iface_; ///< Valid network interface name (present in system)
string bogus_iface_; ///< invalid network interface name (not in system)
isc::dhcp::Classes classify_; ///< used in client classification
isc::dhcp::ClientClasses classify_; ///< used in client classification
};
// Goal of this test is a verification if a very simple config update
......
......@@ -34,8 +34,11 @@ namespace isc {
namespace dhcp {
/// Definition of a single class.
typedef std::string ClientClass;
/// Container for storing client classes
typedef std::set<std::string> Classes;
typedef std::set<ClientClass> ClientClasses;
};
......
......@@ -581,7 +581,7 @@ public:
/// existing classes. Having it public also solves the problem of returned
/// reference lifetime. It is preferred to use @ref inClass and @ref addClass
/// should be used to operate on this field.
Classes classes_;
ClientClasses classes_;
private:
......
......@@ -455,7 +455,7 @@ public:
///
/// This field is public, so code can iterate over existing classes.
/// Having it public also solves the problem of returned reference lifetime.
Classes classes_;
ClientClasses classes_;
protected:
/// Builds on wire packet for TCP transmission.
......
......@@ -123,7 +123,7 @@ CfgMgr::getOptionDef(const std::string& option_space,
Subnet6Ptr
CfgMgr::getSubnet6(const std::string& iface,
const isc::dhcp::Classes& /*classes*/) {
const isc::dhcp::ClientClasses& /*classes*/) {
if (!iface.length()) {
return (Subnet6Ptr());
......@@ -144,7 +144,7 @@ CfgMgr::getSubnet6(const std::string& iface,
Subnet6Ptr
CfgMgr::getSubnet6(const isc::asiolink::IOAddress& hint,
const isc::dhcp::Classes& /*classes*/) {
const isc::dhcp::ClientClasses& /*classes*/) {
// If there's only one subnet configured, let's just use it
// The idea is to keep small deployments easy. In a small network - one
......@@ -180,7 +180,7 @@ CfgMgr::getSubnet6(const isc::asiolink::IOAddress& hint,
}
Subnet6Ptr CfgMgr::getSubnet6(OptionPtr iface_id_option,
const isc::dhcp::Classes& /*classes*/) {
const isc::dhcp::ClientClasses& /*classes*/) {
if (!iface_id_option) {
return (Subnet6Ptr());
}
......@@ -211,7 +211,7 @@ void CfgMgr::addSubnet6(const Subnet6Ptr& subnet) {
Subnet4Ptr
CfgMgr::getSubnet4(const isc::asiolink::IOAddress& hint,
const isc::dhcp::Classes& /*classes*/) {
const isc::dhcp::ClientClasses& /*classes*/) {
// If there's only one subnet configured, let's just use it
// The idea is to keep small deployments easy. In a small network - one
......
......@@ -170,7 +170,7 @@ public:
///
/// @return a subnet object (or NULL if no suitable match was fount)
Subnet6Ptr getSubnet6(const isc::asiolink::IOAddress& hint,
const isc::dhcp::Classes& classes);
const isc::dhcp::ClientClasses& classes);
/// @brief get IPv6 subnet by interface name
///
......@@ -180,7 +180,7 @@ public:
/// @param iface_name interface name
/// @return a subnet object (or NULL if no suitable match was fount)
Subnet6Ptr getSubnet6(const std::string& iface_name,
const isc::dhcp::Classes& classes);
const isc::dhcp::ClientClasses& classes);
/// @brief get IPv6 subnet by interface-id
///
......@@ -190,7 +190,7 @@ public:
///
/// @return a subnet object
Subnet6Ptr getSubnet6(OptionPtr interface_id,
const isc::dhcp::Classes& classes);
const isc::dhcp::ClientClasses& classes);
/// @brief adds an IPv6 subnet
///
......@@ -249,7 +249,7 @@ public:
///
/// @return a subnet object
Subnet4Ptr getSubnet4(const isc::asiolink::IOAddress& hint,
const isc::dhcp::Classes& classes);
const isc::dhcp::ClientClasses& classes);
/// @brief adds a subnet4
void addSubnet4(const Subnet4Ptr& subnet);
......
......@@ -186,7 +186,7 @@ public:
}
/// used in client classification (or just empty container for other tests)
isc::dhcp::Classes classify_;
isc::dhcp::ClientClasses classify_;
};
// This test verifies that multiple option definitions can be added
......@@ -352,7 +352,7 @@ TEST_F(CfgMgrTest, addOptionDefNegative) {
}
// This test verifies if the configuration manager is able to hold and return
// valid leases
// valid subnets.
TEST_F(CfgMgrTest, subnet4) {
CfgMgr& cfg_mgr = CfgMgr::instance();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment