}
- 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
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
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;
};
/// 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:
///
/// 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.
Subnet6Ptr
CfgMgr::getSubnet6(const std::string& iface,
- const isc::dhcp::Classes& /*classes*/) {
+ const isc::dhcp::ClientClasses& /*classes*/) {
if (!iface.length()) {
return (Subnet6Ptr());
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
}
Subnet6Ptr CfgMgr::getSubnet6(OptionPtr iface_id_option,
- const isc::dhcp::Classes& /*classes*/) {
+ const isc::dhcp::ClientClasses& /*classes*/) {
if (!iface_id_option) {
return (Subnet6Ptr());
}
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
///
/// @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
///
/// @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
///
///
/// @return a subnet object
Subnet6Ptr getSubnet6(OptionPtr interface_id,
- const isc::dhcp::Classes& classes);
+ const isc::dhcp::ClientClasses& classes);
/// @brief adds an IPv6 subnet
///
///
/// @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);
}
/// 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
}
// 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();