]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3274] ClientClass added, Classes renamed to ClientClasses
authorTomek Mrugalski <tomasz@isc.org>
Mon, 3 Feb 2014 18:53:14 +0000 (19:53 +0100)
committerTomek Mrugalski <tomasz@isc.org>
Mon, 3 Feb 2014 18:53:14 +0000 (19:53 +0100)
src/bin/dhcp4/tests/config_parser_unittest.cc
src/bin/dhcp6/tests/config_parser_unittest.cc
src/lib/dhcp/classify.h
src/lib/dhcp/pkt4.h
src/lib/dhcp/pkt6.h
src/lib/dhcpsrv/cfgmgr.cc
src/lib/dhcpsrv/cfgmgr.h
src/lib/dhcpsrv/tests/cfgmgr_unittest.cc

index 671deae75a8c02f757488a0a8e4d42ae0b103d20..6df9d21914ec09e45c361f954ae066206feeb94d 100644 (file)
@@ -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
index b7c8e999179a2729043cc2201bdb2ff6271855e9..147a85e9c58d345d29a5e62189f4b45369ff0ac7 100644 (file)
@@ -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
index 73b34ad819d003a085221b9918bf1c15d7f1f29a..eed8202daf346b319b8acd5ce611dd3b4dd0a5cb 100644 (file)
@@ -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;
 
 };
 
index 37027df0e502637b0d94f0374f5bae9c7ac6dd92..510ee8e2214fe8fd1728e1b5bbfd77b39120f29c 100644 (file)
@@ -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:
 
index 44e9114ba704e391da3d0fdfbb7a0be7f025b084..8e5147466f6dc05f7b82d01c69751aab5d7f617c 100644 (file)
@@ -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.
index 926e66b73f6fe79e6821e83312807897345cb994..4c5fb2a32d62ff76302bca308d479bdd14dd86b5 100644 (file)
@@ -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
index d4c33f677166b7a9e2eb435ff29bd71298eccf39..1f548dc786519b1ef0c9d607815399b9644ee2fc 100644 (file)
@@ -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);
index e60fbcc52ba196244959d761cb06a1d3e3f0b9d9..29e826af3033f36911c2bad92b5987f9db940315 100644 (file)
@@ -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();