]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5374] Checkpoint before regen
authorFrancis Dupont <fdupont@isc.org>
Thu, 5 Apr 2018 22:12:52 +0000 (00:12 +0200)
committerFrancis Dupont <fdupont@isc.org>
Thu, 5 Apr 2018 22:12:52 +0000 (00:12 +0200)
32 files changed:
doc/guide/classify.xml
doc/guide/dhcp4-srv.xml
doc/guide/dhcp6-srv.xml
src/bin/dhcp4/dhcp4_lexer.ll
src/bin/dhcp4/dhcp4_messages.mes
src/bin/dhcp4/dhcp4_parser.yy
src/bin/dhcp4/dhcp4_srv.cc
src/bin/dhcp4/dhcp4_srv.h
src/bin/dhcp4/tests/classify_unittest.cc
src/bin/dhcp6/dhcp6_lexer.ll
src/bin/dhcp6/dhcp6_messages.mes
src/bin/dhcp6/dhcp6_parser.yy
src/bin/dhcp6/dhcp6_srv.cc
src/bin/dhcp6/dhcp6_srv.h
src/bin/dhcp6/tests/classify_unittests.cc
src/lib/dhcp/pkt.cc
src/lib/dhcp/pkt.h
src/lib/dhcpsrv/client_class_def.cc
src/lib/dhcpsrv/client_class_def.h
src/lib/dhcpsrv/network.cc
src/lib/dhcpsrv/network.h
src/lib/dhcpsrv/parsers/client_class_def_parser.cc
src/lib/dhcpsrv/parsers/dhcp_parsers.cc
src/lib/dhcpsrv/parsers/shared_network_parser.cc
src/lib/dhcpsrv/pool.cc
src/lib/dhcpsrv/pool.h
src/lib/dhcpsrv/tests/cfg_subnets4_unittest.cc
src/lib/dhcpsrv/tests/cfg_subnets6_unittest.cc
src/lib/dhcpsrv/tests/client_class_def_unittest.cc
src/lib/dhcpsrv/tests/pool_unittest.cc
src/lib/dhcpsrv/tests/shared_network_parser_unittest.cc
src/lib/dhcpsrv/tests/shared_network_unittest.cc

index 1721853f0d5b5158c92375e187473fd6e703185e..0a1b2baf2a91c3f2bd06839eb921c5c43266ed5c 100644 (file)
@@ -759,9 +759,9 @@ concatenation of the strings</entry></row>
     <title>Configuring Classes</title>
       <para>
       A class contains five items: a name, a test expression, option data,
-      option definition and eval on-demand flag.
+      option definition and only-if-required flag.
       The name must exist and must be unique amongst all classes. The test
-      expression, option data and definition, and eval on-demand flag are
+      expression, option data and definition, and only-if-required flag are
       optional.
       </para>
 
@@ -786,21 +786,21 @@ concatenation of the strings</entry></row>
       Usually the test expression is evaluated before subnet selection
       but in some cases it is useful to evaluate it later when the
       subnet, shared-network or pools are known but output option
-      processing not yet done. The eval-on-demand flag, false by default,
-      allows to defer and make only on-demand the evaluation of the
-      test expression.
+      processing not yet done. The only-if-required flag, false by default,
+      allows to perform the evaluation of the test expression only
+      when it was required, i.e. in a required-client-classes list.
       </para>
 
       <para>
-      The eval-client-classes list which is valid for shared-network,
+      The required-client-classes list which is valid for shared-network,
       subnet and pool scope specifies the classes which are evaluated
       in the second pass before output option processing.
       The list is built in the reversed precedence order of option
       data, i.e. an option data in a subnet takes precedence on one
-      in a shared-network but an on-demand class in a subnet is added
+      in a shared-network but required class in a subnet is added
       after one in a shared-network.
-      The mechanism is related to the eval-on-demand flag but it is
-      not required that the flag was set to true.
+      The mechanism is related to the only-if-required flag but it is
+      not mandatory that the flag was set to true.
       </para>
 
       <para>
index f37f3a69f0f324e40bf6dac2e0e76134faabdb22..479580e11fcb62bf28489544dace52f4e5f2d445 100644 (file)
@@ -2095,8 +2095,8 @@ It is merely echoed by the server
       is to assess an incoming packet and assign it to zero or more classes.  The
       second step is to choose a subnet, possibly based on the class information.
       The third step is to assign classes from host reservations.
-      The forth step is to build the list of on-demand classes and perform
-      deferred evaluation for each class of the list.
+      The forth step is to build the list of required classes and perform
+      the evaluation for each class of the list.
       The last step is to assign options, again possibly based on the class
       information.
       </para>
@@ -2248,23 +2248,23 @@ It is merely echoed by the server
         </para>
       </section>
 
-      <section id="dhcp4-on-demand-class">
-        <title>On-demand classification</title>
+      <section id="dhcp4-required-class">
+        <title>Required classification</title>
         <para>
         In some cases it is useful to limit the scope of class.
         Two devices are available to perform evaluation of test
-        expressions so assignment when it returns true only on-demand.
+        expressions so assignment when it was required.
         </para>
 
         <para>
-        The first one is the per-class <command>eval-on-demand</command>
+        The first one is the per-class <command>only-if-required</command>
         flag which is false by default. When it is set to
         <command>true</command> the test expression of the class is not
         evaluated at the reception of a new incoming ticket.
         </para>
 
         <para>
-        The second is the <command>eval-client-classes</command> which
+        The second is the <command>required-client-classes</command> which
         takes a list of class names and is valid in shared-network,
         subnet and pool scope. Classes in these lists are evaluated
         after resource assignment and before output option processing.
@@ -2280,7 +2280,7 @@ It is merely echoed by the server
        {<userinput>
            "name": "Client_foo",
            "test": "'' == ''",
-           "eval-on-demand": true</userinput>
+           "only-if-required": true</userinput>
        },
        ...
     ],
@@ -2288,7 +2288,7 @@ It is merely echoed by the server
         {
             "subnet": "192.0.2.0/24",
             "pools": [ { "pool": "192.0.2.10 - 192.0.2.20" } ],
-            <userinput>"eval-client-classes": [ "Client_foo" ],</userinput>
+            <userinput>"required-client-classes": [ "Client_foo" ],</userinput>
             ...
         },
         ...
index a9b44ff2f27f9961d68dbbce7418d5851bd2d1a0..ed7e22fa5ef9dc26180b2d5682051c812187eeb4 100644 (file)
@@ -1955,8 +1955,8 @@ should include options from the isc option space:
       is to assess an incoming packet and assign it to zero or more classes.  The
       second step is to choose a subnet, possibly based on the class information.
       The third step is to assign classes from host reservations.
-      The forth step is to build the list of on-demand classes and perform
-      deferred evaluation for each class of the list.
+      The forth step is to build the list of required classes and perform
+      the evaluation for each class of the list.
       The last step is to assign options again possibly based on the class
       information.
       </para>
@@ -2041,23 +2041,23 @@ should include options from the isc option space:
         </para>
       </section>
 
-      <section id="dhcp6-on-demand-class">
-        <title>On-demand classification</title>
+      <section id="dhcp6-required-class">
+        <title>Required classification</title>
         <para>
         In some cases it is useful to limit the scope of class.
         Two devices are available to perform evaluation of test
-        expressions so assignment when it returns true only on-demand.
+        expressions so assignment when it was required.
         </para>
 
         <para>
-        The first one is the per-class <command>eval-on-demand</command>
+        The first one is the per-class <command>only-if-required</command>
         flag which is false by default. When it is set to
         <command>true</command> the test expression of the class is not
         evaluated at the reception of a new incoming ticket.
         </para>
 
         <para>
-        The second is the <command>eval-client-classes</command> which
+        The second is the <command>required-client-classes</command> which
         takes a list of class names and is valid in shared-network,
         subnet and pool scope. Classes in these lists are evaluated
         after resource assignment and before output option processing.
@@ -2073,7 +2073,7 @@ should include options from the isc option space:
        {<userinput>
            "name": "Client_foo",
            "test": "'' == ''",
-           "eval-on-demand": true</userinput>
+           "only-if-required": true</userinput>
        },
        ...
     ],
@@ -2085,7 +2085,7 @@ should include options from the isc option space:
                      "pool": "2001:db8:1::-2001:db8:1::ffff"
                  }
              ],
-            <userinput>"eval-client-classes": [ "Client_foo" ],</userinput>
+            <userinput>"required-client-classes": [ "Client_foo" ],</userinput>
             ...
         },
         ...
index 05405a39ff8ee13581da0395acb9f98d6b6c83ce..1e68cde4ce0df80f2b846b95179125be2987ca65 100644 (file)
@@ -795,14 +795,14 @@ ControlCharacterFill            [^"\\]|\\{JSONEscapeSequence}
     }
 }
 
-\"eval-client-classes\" {
+\"required-client-classes\" {
     switch(driver.ctx_) {
     case isc::dhcp::Parser4Context::SUBNET4:
     case isc::dhcp::Parser4Context::POOLS:
     case isc::dhcp::Parser4Context::SHARED_NETWORK:
-        return isc::dhcp::Dhcp4Parser::make_EVAL_CLIENT_CLASSES(driver.loc_);
+        return isc::dhcp::Dhcp4Parser::make_REQUIRED_CLIENT_CLASSES(driver.loc_);
     default:
-        return isc::dhcp::Dhcp4Parser::make_STRING("eval-client-classes", driver.loc_);
+        return isc::dhcp::Dhcp4Parser::make_STRING("required-client-classes", driver.loc_);
     }
 }
 
@@ -827,12 +827,12 @@ ControlCharacterFill            [^"\\]|\\{JSONEscapeSequence}
     }
 }
 
-\"eval-on-demand\" {
+\"only-if-required\" {
     switch(driver.ctx_) {
     case isc::dhcp::Parser4Context::CLIENT_CLASSES:
-        return isc::dhcp::Dhcp4Parser::make_EVAL_ON_DEMAND(driver.loc_);
+        return isc::dhcp::Dhcp4Parser::make_ONLY_IF_REQUIRED(driver.loc_);
     default:
-        return isc::dhcp::Dhcp4Parser::make_STRING("eval-on-demand", driver.loc_);
+        return isc::dhcp::Dhcp4Parser::make_STRING("only-if-required", driver.loc_);
     }
 }
 
index ca29b07ccca2b34baa29f3eb0a642396c880752e..3f19967084c3dc50a18cf8faf3e5095372bf5665 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2017 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2012-2018 Internet Systems Consortium, Inc. ("ISC")
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -59,12 +59,12 @@ which cannot be found in the configuration. Either a hook written
 before the classification was added to Kea is used, or class naming is
 inconsistent.
 
-% DHCP4_CLASS_UNKNOWN on-demand class %1 has no definition
-This debug message informs that a class is listed for late evaluation but
+% DHCP4_CLASS_UNDEFINED required class %1 has no definition
+This debug message informs that a class is listed for required evaluation but
 has no definition.
 
-% DHCP4_CLASS_UNTESTABLE on-demand class %1 has no test expression
-This debug message informs that a class was listed for late evaluation but
+% DHCP4_CLASS_UNTESTABLE required class %1 has no test expression
+This debug message informs that a class was listed for required evaluation but
 its definition does not include a test expression to evaluate.
 
 % DHCP4_CLIENTID_IGNORED_FOR_LEASES %1: not using client identifier for lease allocation for subnet %2
index 81673e4d0903bf3fe6310e2fb8f95388975261b9..498bddf91e7e61b37462c6acb5f4e3777827feea 100644 (file)
@@ -123,9 +123,9 @@ using namespace std;
   HOST_RESERVATION_IDENTIFIERS "host-reservation-identifiers"
 
   CLIENT_CLASSES "client-classes"
-  EVAL_CLIENT_CLASSES "eval-client-classes"
+  REQUIRED_CLIENT_CLASSES "required-client-classes"
   TEST "test"
-  EVAL_ON_DEMAND "eval-on-demand"
+  ONLY_IF_REQUIRED "only-if-required"
   CLIENT_CLASS "client-class"
 
   RESERVATIONS "reservations"
@@ -911,7 +911,7 @@ subnet4_param: valid_lifetime
              | id
              | rapid_commit
              | client_class
-             | eval_client_classes
+             | required_client_classes
              | reservations
              | reservation_mode
              | relay
@@ -982,9 +982,9 @@ client_class: CLIENT_CLASS {
     ctx.leave();
 };
 
-eval_client_classes: EVAL_CLIENT_CLASSES {
+required_client_classes: REQUIRED_CLIENT_CLASSES {
     ElementPtr c(new ListElement(ctx.loc2pos(@1)));
-    ctx.stack_.back()->set("eval-client-classes", c);
+    ctx.stack_.back()->set("required-client-classes", c);
     ctx.stack_.push_back(c);
     ctx.enter(ctx.NO_KEYWORD);
 } COLON list_strings {
@@ -1061,7 +1061,7 @@ shared_network_param: name
                     | relay
                     | reservation_mode
                     | client_class
-                    | eval_client_classes
+                    | required_client_classes
                     | valid_lifetime
                     | unknown_map_entry
                     ;
@@ -1344,7 +1344,7 @@ pool_params: pool_param
 pool_param: pool_entry
           | option_data_list
           | client_class
-          | eval_client_classes
+          | required_client_classes
           | user_context
           | unknown_map_entry
           ;
@@ -1575,7 +1575,7 @@ not_empty_client_class_params: client_class_param
 
 client_class_param: client_class_name
                   | client_class_test
-                  | eval_on_demand
+                  | only_if_required
                   | option_def_list
                   | option_data_list
                   | next_server
@@ -1594,9 +1594,9 @@ client_class_test: TEST {
     ctx.leave();
 };
 
-eval_on_demand: EVAL_ON_DEMAND COLON BOOLEAN {
+only_if_required: ONLY_IF_REQUIRED COLON BOOLEAN {
     ElementPtr b(new BoolElement($3, ctx.loc2pos(@3)));
-    ctx.stack_.back()->set("eval-on-demand", b);
+    ctx.stack_.back()->set("only-if-required", b);
 };
 
 // --- end of client classes ---------------------------------
index 2e3f72bafadc3150a67f0bcac8a453aefb058390..58b547d36d777ea2dfb3d47ed9157e94c6221f38 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2018 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -2340,8 +2340,8 @@ Dhcpv4Srv::processDiscover(Pkt4Ptr& discover) {
     if (!ex.getResponse()->getYiaddr().isV4Zero()) {
         // Assign reserved classes.
         ex.setReservedClientClasses();
-        // Late classification
-        lateClassify(ex);
+        // Required classification
+        requiredClassify(ex);
 
         buildCfgOptionList(ex);
         appendRequestedOptions(ex);
@@ -2397,8 +2397,8 @@ Dhcpv4Srv::processRequest(Pkt4Ptr& request) {
     if (!ex.getResponse()->getYiaddr().isV4Zero()) {
         // Assign reserved classes.
         ex.setReservedClientClasses();
-        // Late classification
-        lateClassify(ex);
+        // Required classification
+        requiredClassify(ex);
 
         buildCfgOptionList(ex);
         appendRequestedOptions(ex);
@@ -2683,7 +2683,7 @@ Dhcpv4Srv::processInform(Pkt4Ptr& inform) {
     Pkt4Ptr ack = ex.getResponse();
 
     ex.setReservedClientClasses();
-    lateClassify(ex);
+    requiredClassify(ex);
 
     buildCfgOptionList(ex);
     appendRequestedOptions(ex);
@@ -2986,8 +2986,8 @@ void Dhcpv4Srv::classifyPacket(const Pkt4Ptr& pkt) {
         if (!expr_ptr) {
             continue;
         }
-        // Not the right time if on demand
-        if ((*it)->getOnDemand()) {
+        // Not the right time if only when required
+        if ((*it)->getRequired()) {
             continue;
         }
         // Evaluate the expression which can return false (no match),
@@ -3017,8 +3017,8 @@ void Dhcpv4Srv::classifyPacket(const Pkt4Ptr& pkt) {
     }
 }
 
-void Dhcpv4Srv::lateClassify(Dhcpv4Exchange& ex) {
-    // First collect on-demand classes
+void Dhcpv4Srv::requiredClassify(Dhcpv4Exchange& ex) {
+    // First collect required classes
     Pkt4Ptr query = ex.getQuery();
     ClientClasses classes = query->getClasses(true);
     Subnet4Ptr subnet = ex.getContext()->subnet_;
@@ -3028,7 +3028,7 @@ void Dhcpv4Srv::lateClassify(Dhcpv4Exchange& ex) {
         SharedNetwork4Ptr network;
         subnet->getSharedNetwork(network);
         if (network) {
-            const ClientClasses& to_add = network->getOnDemandClasses();
+            const ClientClasses& to_add = network->getRequiredClasses();
             for (ClientClasses::const_iterator cclass = to_add.cbegin();
                  cclass != to_add.cend(); ++cclass) {
                 classes.insert(*cclass);
@@ -3036,7 +3036,7 @@ void Dhcpv4Srv::lateClassify(Dhcpv4Exchange& ex) {
         }
 
         // Followed by the subnet
-        const ClientClasses& to_add = subnet->getOnDemandClasses();
+        const ClientClasses& to_add = subnet->getRequiredClasses();
         for(ClientClasses::const_iterator cclass = to_add.cbegin();
             cclass != to_add.cend(); ++cclass) {
             classes.insert(*cclass);
@@ -3051,7 +3051,7 @@ void Dhcpv4Srv::lateClassify(Dhcpv4Exchange& ex) {
         if (!addr.isV4Zero()) {
             PoolPtr pool = subnet->getPool(Lease::TYPE_V4, addr, false);
             if (pool) {
-                const ClientClasses& to_add = pool->getOnDemandClasses();
+                const ClientClasses& to_add = pool->getRequiredClasses();
                 for (ClientClasses::const_iterator cclass = to_add.cbegin();
                      cclass != to_add.cend(); ++cclass) {
                     classes.insert(*cclass);
@@ -3070,7 +3070,7 @@ void Dhcpv4Srv::lateClassify(Dhcpv4Exchange& ex) {
          cclass != classes.cend(); ++cclass) {
         const ClientClassDefPtr class_def = dict->findClass(*cclass);
         if (!class_def) {
-            LOG_DEBUG(dhcp4_logger, DBG_DHCP4_BASIC, DHCP4_CLASS_UNKNOWN)
+            LOG_DEBUG(dhcp4_logger, DBG_DHCP4_BASIC, DHCP4_CLASS_UNDEFINED)
                 .arg(*cclass);
             continue;
         }
index 536ef263daf5e44757c943c662c2c801ee25cbba..2569386d7993eb420a3140ebd59b35b80766917b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2018 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -803,17 +803,17 @@ protected:
     /// @param pkt packet to be classified
     void classifyPacket(const Pkt4Ptr& pkt);
 
-    /// @brief Assigns incoming packet to zero or more classes (late pass).
+    /// @brief Assigns incoming packet to zero or more classes (required pass).
     ///
-    /// @note This late classification evaluates all classes which
-    /// were marked for this deferred/on-demand pass. Classes are
-    /// collected in the reversed order than output option processing.
+    /// @note This required classification evaluates all classes which
+    /// were marked for required evaluation. Classes are collected so
+    /// evaluated in the reversed order than output option processing.
     ///
-    /// @note The eval-on-demand flag is related because it avoids
+    /// @note The only-if-required flag is related because it avoids
     /// double evaluation (which is not forbidden).
     ///
     /// @param ex The exchange holding needed informations.
-    void lateClassify(Dhcpv4Exchange& ex);
+    void requiredClassify(Dhcpv4Exchange& ex);
 
     /// @brief Perform deferred option unpacking.
     ///
index 18a223093743a2397169797590ca427f8ff210fe..504ed6a577b75d42ae15ea4bc70c6e72862be89f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2018 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -56,7 +56,7 @@ namespace {
 ///     or member(<last two>), set boot-file-name to pxelinux.0
 ///
 /// - Configuration 3:
-///   - Used for late/on-demand classification
+///   - Used for required classification
 ///   - 1 subnet: 10.0.0.0/24
 ///   - 1 pool: 10.0.0.10-10.0.0.100
 ///   - the following classes defined:
@@ -185,19 +185,19 @@ const char* CONFIGS[] = {
         "{"
         "   \"name\": \"pxe1\","
         "   \"test\": \"option[93].hex == 0x0009\","
-        "   \"eval-on-demand\": true,"
+        "   \"only-if-required\": true,"
         "   \"next-server\": \"1.2.3.4\""
         "},"
         "{"
         "   \"name\": \"pxe2\","
         "   \"test\": \"option[93].hex == 0x0007\","
-        "   \"eval-on-demand\": true,"
+        "   \"only-if-required\": true,"
         "   \"server-hostname\": \"deneb\""
         "},"
         "{"
         "   \"name\": \"pxe3\","
         "   \"test\": \"option[93].hex == 0x0006\","
-        "   \"eval-on-demand\": false,"
+        "   \"only-if-required\": false,"
         "   \"boot-file-name\": \"pxelinux.0\""
         "},"
         "{"
@@ -209,7 +209,7 @@ const char* CONFIGS[] = {
         "    \"subnet\": \"10.0.0.0/24\", "
         "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
-        "    \"eval-client-classes\": [ \"pxe2\" ]"
+        "    \"required-client-classes\": [ \"pxe2\" ]"
         " } ]"
     "}"
 
@@ -566,7 +566,7 @@ TEST_F(ClassifyTest, fixedFieldsInformNoClasses3) {
     testFixedFields(CONFIGS[3], DHCPINFORM, OptionPtr(), "0.0.0.0", "", "");
 }
 
-// Class 'pxe1' is on-demand and not subject to late evaluation
+// Class 'pxe1' is only-if-required and not subject to required evaluation
 TEST_F(ClassifyTest, fixedFieldsDiscoverNextServer3) {
     OptionPtr pxe(new OptionInt<uint16_t>(Option::V4, 93, 0x0009));
 
@@ -584,7 +584,7 @@ TEST_F(ClassifyTest, fixedFieldsInformNextServer3) {
 }
 
 
-// Class pxe2 is on-demand but the subnet requests its late evaluation
+// Class pxe2 is only-if-required but the subnet requires its evaluation
 TEST_F(ClassifyTest, fixedFieldsDiscoverHostname3) {
     OptionPtr pxe(new OptionInt<uint16_t>(Option::V4, 93, 0x0007));
 
@@ -633,7 +633,7 @@ TEST_F(ClassifyTest, fixedFieldsInformFile32) {
     testFixedFields(CONFIGS[3], DHCPINFORM, pxe, "0.0.0.0", "", "ipxe.efi");
 }
 
-// This test checks the precedence order in requested late evaluation.
+// This test checks the precedence order in required evaluation.
 // This order is: shared-network > subnet > pools
 TEST_F(ClassifyTest, precedenceNone) {
     std::string config =
@@ -650,7 +650,7 @@ TEST_F(ClassifyTest, precedenceNone) {
         "    {"
         "       \"name\": \"for-pool\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"domain-name-servers\","
         "           \"data\": \"10.0.0.1\""
@@ -659,7 +659,7 @@ TEST_F(ClassifyTest, precedenceNone) {
         "    {"
         "       \"name\": \"for-subnet\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"domain-name-servers\","
         "           \"data\": \"10.0.0.2\""
@@ -668,7 +668,7 @@ TEST_F(ClassifyTest, precedenceNone) {
         "    {"
         "       \"name\": \"for-network\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"domain-name-servers\","
         "           \"data\": \"10.0.0.3\""
@@ -705,7 +705,7 @@ TEST_F(ClassifyTest, precedenceNone) {
     EXPECT_FALSE(opt);
 }
 
-// This test checks the precedence order in requested late evaluation.
+// This test checks the precedence order in required evaluation.
 // This order is: shared-network > subnet > pools
 TEST_F(ClassifyTest, precedencePool) {
     std::string config =
@@ -722,7 +722,7 @@ TEST_F(ClassifyTest, precedencePool) {
         "    {"
         "       \"name\": \"for-pool\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"domain-name-servers\","
         "           \"data\": \"10.0.0.1\""
@@ -731,7 +731,7 @@ TEST_F(ClassifyTest, precedencePool) {
         "    {"
         "       \"name\": \"for-subnet\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"domain-name-servers\","
         "           \"data\": \"10.0.0.2\""
@@ -740,7 +740,7 @@ TEST_F(ClassifyTest, precedencePool) {
         "    {"
         "       \"name\": \"for-network\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"domain-name-servers\","
         "           \"data\": \"10.0.0.3\""
@@ -754,7 +754,7 @@ TEST_F(ClassifyTest, precedencePool) {
         "        \"id\": 1,"
         "        \"pools\": [ { "
         "            \"pool\": \"10.0.0.10-10.0.0.100\","
-        "            \"eval-client-classes\": [ \"for-pool\" ]"
+        "            \"required-client-classes\": [ \"for-pool\" ]"
         "         } ]"
         "    } ]"
         "} ]"
@@ -784,7 +784,7 @@ TEST_F(ClassifyTest, precedencePool) {
     EXPECT_EQ("10.0.0.1", addrs[0].toText());
 }
 
-// This test checks the precedence order in requested late evaluation.
+// This test checks the precedence order in required evaluation.
 // This order is: shared-network > subnet > pools
 TEST_F(ClassifyTest, precedenceSubnet) {
     std::string config =
@@ -801,7 +801,7 @@ TEST_F(ClassifyTest, precedenceSubnet) {
         "    {"
         "       \"name\": \"for-pool\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"domain-name-servers\","
         "           \"data\": \"10.0.0.1\""
@@ -810,7 +810,7 @@ TEST_F(ClassifyTest, precedenceSubnet) {
         "    {"
         "       \"name\": \"for-subnet\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"domain-name-servers\","
         "           \"data\": \"10.0.0.2\""
@@ -819,7 +819,7 @@ TEST_F(ClassifyTest, precedenceSubnet) {
         "    {"
         "       \"name\": \"for-network\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"domain-name-servers\","
         "           \"data\": \"10.0.0.3\""
@@ -831,10 +831,10 @@ TEST_F(ClassifyTest, precedenceSubnet) {
         "    \"subnet4\": [ { "
         "        \"subnet\": \"10.0.0.0/24\","
         "        \"id\": 1,"
-        "        \"eval-client-classes\": [ \"for-subnet\" ],"
+        "        \"required-client-classes\": [ \"for-subnet\" ],"
         "        \"pools\": [ { "
         "            \"pool\": \"10.0.0.10-10.0.0.100\","
-        "            \"eval-client-classes\": [ \"for-pool\" ]"
+        "            \"required-client-classes\": [ \"for-pool\" ]"
         "         } ]"
         "    } ]"
         "} ]"
@@ -864,7 +864,7 @@ TEST_F(ClassifyTest, precedenceSubnet) {
     EXPECT_EQ("10.0.0.2", addrs[0].toText());
 }
 
-// This test checks the precedence order in requested late evaluation.
+// This test checks the precedence order in required evaluation.
 // This order is: shared-network > subnet > pools
 TEST_F(ClassifyTest, precedenceNetwork) {
     std::string config =
@@ -881,7 +881,7 @@ TEST_F(ClassifyTest, precedenceNetwork) {
         "    {"
         "       \"name\": \"for-pool\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"domain-name-servers\","
         "           \"data\": \"10.0.0.1\""
@@ -890,7 +890,7 @@ TEST_F(ClassifyTest, precedenceNetwork) {
         "    {"
         "       \"name\": \"for-subnet\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"domain-name-servers\","
         "           \"data\": \"10.0.0.2\""
@@ -899,7 +899,7 @@ TEST_F(ClassifyTest, precedenceNetwork) {
         "    {"
         "       \"name\": \"for-network\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"domain-name-servers\","
         "           \"data\": \"10.0.0.3\""
@@ -908,14 +908,14 @@ TEST_F(ClassifyTest, precedenceNetwork) {
         "],"
         "\"shared-networks\": [ {"
         "    \"name\": \"frog\","
-        "    \"eval-client-classes\": [ \"for-network\" ],"
+        "    \"required-client-classes\": [ \"for-network\" ],"
         "    \"subnet4\": [ { "
         "        \"subnet\": \"10.0.0.0/24\","
         "        \"id\": 1,"
-        "        \"eval-client-classes\": [ \"for-subnet\" ],"
+        "        \"required-client-classes\": [ \"for-subnet\" ],"
         "        \"pools\": [ { "
         "            \"pool\": \"10.0.0.10-10.0.0.100\","
-        "            \"eval-client-classes\": [ \"for-pool\" ]"
+        "            \"required-client-classes\": [ \"for-pool\" ]"
         "         } ]"
         "    } ]"
         "} ]"
index a8ab21ed1ff3e944237036f470849212e7cbd089..d8c8afd79dbc77dcc4364b53146c490998c7625a 100644 (file)
@@ -1047,15 +1047,15 @@ ControlCharacterFill            [^"\\]|\\{JSONEscapeSequence}
     }
 }
 
-\"eval-client-classes\" {
+\"required-client-classes\" {
     switch(driver.ctx_) {
     case isc::dhcp::Parser6Context::SUBNET6:
     case isc::dhcp::Parser6Context::POOLS:
     case isc::dhcp::Parser6Context::PD_POOLS:
     case isc::dhcp::Parser6Context::SHARED_NETWORK:
-        return isc::dhcp::Dhcp6Parser::make_EVAL_CLIENT_CLASSES(driver.loc_);
+        return isc::dhcp::Dhcp6Parser::make_REQUIRED_CLIENT_CLASSES(driver.loc_);
     default:
-        return isc::dhcp::Dhcp6Parser::make_STRING("eval-client-classes", driver.loc_);
+        return isc::dhcp::Dhcp6Parser::make_STRING("required-client-classes", driver.loc_);
     }
 }
 
@@ -1081,12 +1081,12 @@ ControlCharacterFill            [^"\\]|\\{JSONEscapeSequence}
     }
 }
 
-\"eval-on-demand\" {
+\"only-if-required\" {
     switch(driver.ctx_) {
     case isc::dhcp::Parser6Context::CLIENT_CLASSES:
-        return isc::dhcp::Dhcp6Parser::make_EVAL_ON_DEMAND(driver.loc_);
+        return isc::dhcp::Dhcp6Parser::make_ONLY_IF_REQUIRED(driver.loc_);
     default:
-        return isc::dhcp::Dhcp6Parser::make_STRING("eval-on-demand", driver.loc_);
+        return isc::dhcp::Dhcp6Parser::make_STRING("only-if-required", driver.loc_);
     }
 }
 
index aececc9b71be72311e68b79a4d78d48802b8ca1e..d59ad58df5b329c4e7a2409a332921169f0d5914 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2017 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2012-2018 Internet Systems Consortium, Inc. ("ISC")
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -66,12 +66,12 @@ which cannot be found in the configuration. Either a hook written
 before the classification was added to Kea is used, or class naming is
 inconsistent.
 
-% DHCP6_CLASS_UNKNOWN on-demand class %1 has no definition
-This debug message informs that a class is listed for late evaluation but
+% DHCP6_CLASS_UNDEFINED required class %1 has no definition
+This debug message informs that a class is listed for required evaluation but
 has no definition.
 
-% DHCP6_CLASS_UNTESTABLE on-demand class %1 has no test expression
-This debug message informs that a class was listed for late evaluation but
+% DHCP6_CLASS_UNTESTABLE required class %1 has no test expression
+This debug message informs that a class was listed for required evaluation but
 its definition does not include a test expression to evaluate.
 
 % DHCP6_COMMAND_RECEIVED received command %1, arguments: %2
index 0720846ceba69cee4d745e07de97722a447407ae..9bfaa141d5dd10696400d0361e6c002327f43045 100644 (file)
@@ -116,9 +116,9 @@ using namespace std;
   HOST_RESERVATION_IDENTIFIERS "host-reservation-identifiers"
 
   CLIENT_CLASSES "client-classes"
-  EVAL_CLIENT_CLASSES "eval-client-classes"
+  REQUIRED_CLIENT_CLASSES "required-client-classes"
   TEST "test"
-  EVAL_ON_DEMAND "eval-on-demand"
+  ONLY_IF_REQUIRED "only-if-required"
   CLIENT_CLASS "client-class"
 
   RESERVATIONS "reservations"
@@ -906,7 +906,7 @@ subnet6_param: preferred_lifetime
              | id
              | rapid_commit
              | client_class
-             | eval_client_classes
+             | required_client_classes
              | reservations
              | reservation_mode
              | relay
@@ -946,9 +946,9 @@ client_class: CLIENT_CLASS {
     ctx.leave();
 };
 
-eval_client_classes: EVAL_CLIENT_CLASSES {
+required_client_classes: REQUIRED_CLIENT_CLASSES {
     ElementPtr c(new ListElement(ctx.loc2pos(@1)));
-    ctx.stack_.back()->set("eval-client-classes", c);
+    ctx.stack_.back()->set("required-client-classes", c);
     ctx.stack_.push_back(c);
     ctx.enter(ctx.NO_KEYWORD);
 } COLON list_strings {
@@ -1023,7 +1023,7 @@ shared_network_param: name
                     | relay
                     | reservation_mode
                     | client_class
-                    | eval_client_classes
+                    | required_client_classes
                     | preferred_lifetime
                     | rapid_commit
                     | valid_lifetime
@@ -1307,7 +1307,7 @@ pool_params: pool_param
 pool_param: pool_entry
           | option_data_list
           | client_class
-          | eval_client_classes
+          | required_client_classes
           | user_context
           | unknown_map_entry
           ;
@@ -1383,7 +1383,7 @@ pd_pool_param: pd_prefix
              | pd_delegated_len
              | option_data_list
              | client_class
-             | eval_client_classes
+             | required_client_classes
              | excluded_prefix
              | excluded_prefix_len
              | user_context
@@ -1600,7 +1600,7 @@ not_empty_client_class_params: client_class_param
 
 client_class_param: client_class_name
                   | client_class_test
-                  | eval_on_demand
+                  | only_if_required
                   | option_data_list
                   | unknown_map_entry
                   ;
@@ -1615,9 +1615,9 @@ client_class_test: TEST {
     ctx.leave();
 };
 
-eval_on_demand: EVAL_ON_DEMAND COLON BOOLEAN {
+only_if_required: ONLY_IF_REQUIRED COLON BOOLEAN {
     ElementPtr b(new BoolElement($3, ctx.loc2pos(@3)));
-    ctx.stack_.back()->set("eval-on-demand", b);
+    ctx.stack_.back()->set("only-if-required", b);
 };
 
 // --- end of client classes ---------------------------------
index cfdd44619566511e60e9b31ec003c2dcffdaf746..7c99b98b5046daaa191830ba3441316b6dc0c288 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2018 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -2487,7 +2487,7 @@ Dhcpv6Srv::processSolicit(const Pkt6Ptr& solicit) {
     assignLeases(solicit, response, ctx);
 
     setReservedClientClasses(solicit, ctx);
-    lateClassify(solicit, ctx);
+    requiredClassify(solicit, ctx);
 
     copyClientOptions(solicit, response);
     CfgOptionList co_list;
@@ -2522,7 +2522,7 @@ Dhcpv6Srv::processRequest(const Pkt6Ptr& request) {
     assignLeases(request, reply, ctx);
 
     setReservedClientClasses(request, ctx);
-    lateClassify(request, ctx);
+    requiredClassify(request, ctx);
 
     copyClientOptions(request, reply);
     CfgOptionList co_list;
@@ -2553,7 +2553,7 @@ Dhcpv6Srv::processRenew(const Pkt6Ptr& renew) {
     extendLeases(renew, reply, ctx);
 
     setReservedClientClasses(renew, ctx);
-    lateClassify(renew, ctx);
+    requiredClassify(renew, ctx);
 
     copyClientOptions(renew, reply);
     CfgOptionList co_list;
@@ -2584,7 +2584,7 @@ Dhcpv6Srv::processRebind(const Pkt6Ptr& rebind) {
     extendLeases(rebind, reply, ctx);
 
     setReservedClientClasses(rebind, ctx);
-    lateClassify(rebind, ctx);
+    requiredClassify(rebind, ctx);
 
     copyClientOptions(rebind, reply);
     CfgOptionList co_list;
@@ -2609,7 +2609,7 @@ Dhcpv6Srv::processConfirm(const Pkt6Ptr& confirm) {
     AllocEngine::ClientContext6 ctx;
     initContext(confirm, ctx);
     setReservedClientClasses(confirm, ctx);
-    lateClassify(confirm, ctx);
+    requiredClassify(confirm, ctx);
 
     // Get IA_NAs from the Confirm. If there are none, the message is
     // invalid and must be discarded. There is nothing more to do.
@@ -2703,7 +2703,7 @@ Dhcpv6Srv::processRelease(const Pkt6Ptr& release) {
     AllocEngine::ClientContext6 ctx;
     initContext(release, ctx);
     setReservedClientClasses(release, ctx);
-    lateClassify(release, ctx);
+    requiredClassify(release, ctx);
 
     Pkt6Ptr reply(new Pkt6(DHCPV6_REPLY, release->getTransid()));
 
@@ -2733,7 +2733,7 @@ Dhcpv6Srv::processDecline(const Pkt6Ptr& decline) {
     AllocEngine::ClientContext6 ctx;
     initContext(decline, ctx);
     setReservedClientClasses(decline, ctx);
-    lateClassify(decline, ctx);
+    requiredClassify(decline, ctx);
 
     // Copy client options (client-id, also relay information if present)
     copyClientOptions(decline, reply);
@@ -3015,7 +3015,7 @@ Dhcpv6Srv::processInfRequest(const Pkt6Ptr& inf_request) {
     AllocEngine::ClientContext6 ctx;
     initContext(inf_request, ctx);
     setReservedClientClasses(inf_request, ctx);
-    lateClassify(inf_request, ctx);
+    requiredClassify(inf_request, ctx);
 
     // Create a Reply packet, with the same trans-id as the client's.
     Pkt6Ptr reply(new Pkt6(DHCPV6_REPLY, inf_request->getTransid()));
@@ -3102,8 +3102,8 @@ void Dhcpv6Srv::classifyPacket(const Pkt6Ptr& pkt) {
         if (!expr_ptr) {
             continue;
         }
-        // Not the right time if on demand
-        if ((*it)->getOnDemand()) {
+        // Not the right time if only when required
+        if ((*it)->getRequired()) {
             continue;
         }
         // Evaluate the expression which can return false (no match),
@@ -3154,8 +3154,8 @@ Dhcpv6Srv::setReservedClientClasses(const Pkt6Ptr& pkt,
 }
 
 void
-Dhcpv6Srv::lateClassify(const Pkt6Ptr& pkt, AllocEngine::ClientContext6& ctx) {
-    // First collect on-demand classes
+Dhcpv6Srv::requiredClassify(const Pkt6Ptr& pkt, AllocEngine::ClientContext6& ctx) {
+    // First collect required classes
     ClientClasses classes = pkt->getClasses(true);
     Subnet6Ptr subnet = ctx.subnet_;
 
@@ -3164,7 +3164,7 @@ Dhcpv6Srv::lateClassify(const Pkt6Ptr& pkt, AllocEngine::ClientContext6& ctx) {
         SharedNetwork6Ptr network;
         subnet->getSharedNetwork(network);
         if (network) {
-            const ClientClasses& to_add = network->getOnDemandClasses();
+            const ClientClasses& to_add = network->getRequiredClasses();
             for (ClientClasses::const_iterator cclass = to_add.cbegin();
                  cclass != to_add.cend(); ++cclass) {
                 classes.insert(*cclass);
@@ -3172,7 +3172,7 @@ Dhcpv6Srv::lateClassify(const Pkt6Ptr& pkt, AllocEngine::ClientContext6& ctx) {
         }
 
         // Followed by the subnet
-        const ClientClasses& to_add = subnet->getOnDemandClasses();
+        const ClientClasses& to_add = subnet->getRequiredClasses();
         for(ClientClasses::const_iterator cclass = to_add.cbegin();
             cclass != to_add.cend(); ++cclass) {
             classes.insert(*cclass);
@@ -3187,7 +3187,7 @@ Dhcpv6Srv::lateClassify(const Pkt6Ptr& pkt, AllocEngine::ClientContext6& ctx) {
                                                 resource.first,
                                                 false);
             if (pool) {
-                const ClientClasses& to_add = pool->getOnDemandClasses();
+                const ClientClasses& to_add = pool->getRequiredClasses();
                 for (ClientClasses::const_iterator cclass = to_add.cbegin();
                      cclass != to_add.cend(); ++cclass) {
                     classes.insert(*cclass);
@@ -3206,7 +3206,7 @@ Dhcpv6Srv::lateClassify(const Pkt6Ptr& pkt, AllocEngine::ClientContext6& ctx) {
          cclass != classes.cend(); ++cclass) {
         const ClientClassDefPtr class_def = dict->findClass(*cclass);
         if (!class_def) {
-            LOG_DEBUG(dhcp6_logger, DBG_DHCP6_BASIC, DHCP6_CLASS_UNKNOWN)
+            LOG_DEBUG(dhcp6_logger, DBG_DHCP6_BASIC, DHCP6_CLASS_UNDEFINED)
                 .arg(*cclass);
             continue;
         }
index a63691f8ce5b7d0f189e6e9ce93571519f51cb9f..4f6a68a54edcb9ece55b784fe964ecf65264d83d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2018 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -649,18 +649,18 @@ protected:
     void setReservedClientClasses(const Pkt6Ptr& pkt,
                                   const AllocEngine::ClientContext6& ctx);
 
-    /// @brief Assigns incoming packet to zero or more classes (late pass).
+    /// @brief Assigns incoming packet to zero or more classes (required pass).
     ///
-    /// @note This late classification evaluates all classes which
-    /// were marked for this deferred/on-demand pass. Classes are
-    /// collected in the reversed order than output option processing.
+    /// @note This required classification evaluates all classes which
+    /// were marked for required evaluation. Classes are collected so
+    /// evaluated in the reversed order than output option processing.
     ///
-    /// @note The eval-on-demand flag is related because it avoids
+    /// @note The only-if-required flag is related because it avoids
     /// double evaluation (which is not forbidden).
     ///
     /// @param pkt packet to be classified
     /// @param ctx allocation context where to get informations
-    void lateClassify(const Pkt6Ptr& pkt, AllocEngine::ClientContext6& ctx);
+    void requiredClassify(const Pkt6Ptr& pkt, AllocEngine::ClientContext6& ctx);
 
     /// @brief Attempts to get a MAC/hardware address using configured sources
     ///
index 8fc19dcce04d722bbe6270bfc17705688438cce5..99611da61e1c9401f3aa54d32f798955f27e1721 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2018 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -302,8 +302,8 @@ TEST_F(ClassifyTest, matchClassification) {
     EXPECT_FALSE(opt3);
 }
 
-// Check that on-demand classes are not evaluated by classifyPacket
-TEST_F(ClassifyTest, onDemand) {
+// Check that only-if-required classes are not evaluated by classifyPacket
+TEST_F(ClassifyTest, required) {
     IfaceMgrTestConfig test_config(true);
 
     NakedDhcpv6Srv srv(0);
@@ -329,7 +329,7 @@ TEST_F(ClassifyTest, onDemand) {
         "    \"interface\": \"eth1\" } ],"
         "\"client-classes\": [ "
         "{   \"name\": \"router\", "
-        "    \"eval-on-demand\": true, "
+        "    \"only-if-required\": true, "
         "    \"option-data\": ["
         "        {    \"name\": \"ipv6-forwarding\", "
         "             \"data\": \"true\" } ], "
@@ -391,8 +391,8 @@ TEST_F(ClassifyTest, onDemand) {
     EXPECT_FALSE(opt3);
 }
 
-// Checks that when requested on-demand classes are still (but late) evaluated
-TEST_F(ClassifyTest, lateClassification) {
+// Checks that when only-if-required classes are still evaluated
+TEST_F(ClassifyTest, requiredClassification) {
     IfaceMgrTestConfig test_config(true);
 
     NakedDhcpv6Srv srv(0);
@@ -415,11 +415,11 @@ TEST_F(ClassifyTest, lateClassification) {
         "\"subnet6\": [ "
         "{   \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], "
         "    \"subnet\": \"2001:db8:1::/48\", "
-        "    \"eval-client-classes\": [ \"router\" ], "
+        "    \"require-client-classes\": [ \"router\" ], "
         "    \"interface\": \"eth1\" } ],"
         "\"client-classes\": [ "
         "{   \"name\": \"router\", "
-        "    \"eval-on-demand\": true, "
+        "    \"only-if-required\": true, "
         "    \"option-data\": ["
         "        {    \"name\": \"ipv6-forwarding\", "
         "             \"data\": \"true\" } ], "
@@ -1221,7 +1221,7 @@ TEST_F(ClassifyTest, member) {
     EXPECT_FALSE(ipf3->readBoolean());
 }
 
-// This test checks the precedence order in requested late evaluation.
+// This test checks the precedence order in required evaluation.
 // This order is: shared-network > subnet > pools
 TEST_F(ClassifyTest, precedenceNone) {
     std::string config =
@@ -1240,7 +1240,7 @@ TEST_F(ClassifyTest, precedenceNone) {
         "    {"
         "       \"name\": \"for-pool\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"dns-servers\","
         "           \"data\": \"2001:db8:1::1\""
@@ -1249,7 +1249,7 @@ TEST_F(ClassifyTest, precedenceNone) {
         "    {"
         "       \"name\": \"for-subnet\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"dns-servers\","
         "           \"data\": \"2001:db8:1::2\""
@@ -1258,7 +1258,7 @@ TEST_F(ClassifyTest, precedenceNone) {
         "    {"
         "       \"name\": \"for-network\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"dns-servers\","
         "           \"data\": \"2001:db8:1::3\""
@@ -1299,7 +1299,7 @@ TEST_F(ClassifyTest, precedenceNone) {
     EXPECT_FALSE(opt);
 }
 
-// This test checks the precedence order in requested late evaluation.
+// This test checks the precedence order in required evaluation.
 // This order is: shared-network > subnet > pools
 TEST_F(ClassifyTest, precedencePool) {
     std::string config =
@@ -1316,7 +1316,7 @@ TEST_F(ClassifyTest, precedencePool) {
         "    {"
         "       \"name\": \"for-pool\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"dns-servers\","
         "           \"data\": \"2001:db8:1::1\""
@@ -1325,7 +1325,7 @@ TEST_F(ClassifyTest, precedencePool) {
         "    {"
         "       \"name\": \"for-subnet\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"dns-servers\","
         "           \"data\": \"2001:db8:1::2\""
@@ -1334,7 +1334,7 @@ TEST_F(ClassifyTest, precedencePool) {
         "    {"
         "       \"name\": \"for-network\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"dns-servers\","
         "           \"data\": \"2001:db8:1::3\""
@@ -1349,7 +1349,7 @@ TEST_F(ClassifyTest, precedencePool) {
         "        \"id\": 1,"
         "        \"pools\": [ { "
         "            \"pool\": \"2001:db8:1::1 - 2001:db8:1::64\","
-        "            \"eval-client-classes\": [ \"for-pool\" ]"
+        "            \"require-client-classes\": [ \"for-pool\" ]"
         "        } ]"
         "    } ]"
         "} ],"
@@ -1382,7 +1382,7 @@ TEST_F(ClassifyTest, precedencePool) {
     EXPECT_EQ("2001:db8:1::1", addrs[0].toText());
 }
 
-// This test checks the precedence order in requested late evaluation.
+// This test checks the precedence order in required evaluation.
 // This order is: shared-network > subnet > pools
 TEST_F(ClassifyTest, precedenceSubnet) {
     std::string config =
@@ -1399,7 +1399,7 @@ TEST_F(ClassifyTest, precedenceSubnet) {
         "    {"
         "       \"name\": \"for-pool\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"dns-servers\","
         "           \"data\": \"2001:db8:1::1\""
@@ -1408,7 +1408,7 @@ TEST_F(ClassifyTest, precedenceSubnet) {
         "    {"
         "       \"name\": \"for-subnet\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"dns-servers\","
         "           \"data\": \"2001:db8:1::2\""
@@ -1417,7 +1417,7 @@ TEST_F(ClassifyTest, precedenceSubnet) {
         "    {"
         "       \"name\": \"for-network\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"dns-servers\","
         "           \"data\": \"2001:db8:1::3\""
@@ -1430,10 +1430,10 @@ TEST_F(ClassifyTest, precedenceSubnet) {
         "    \"subnet6\": [ { "
         "        \"subnet\": \"2001:db8:1::/64\","
         "        \"id\": 1,"
-        "        \"eval-client-classes\": [ \"for-subnet\" ],"
+        "        \"require-client-classes\": [ \"for-subnet\" ],"
         "        \"pools\": [ { "
         "            \"pool\": \"2001:db8:1::1 - 2001:db8:1::64\","
-        "            \"eval-client-classes\": [ \"for-pool\" ]"
+        "            \"require-client-classes\": [ \"for-pool\" ]"
         "        } ]"
         "    } ]"
         "} ],"
@@ -1466,7 +1466,7 @@ TEST_F(ClassifyTest, precedenceSubnet) {
     EXPECT_EQ("2001:db8:1::2", addrs[0].toText());
 }
 
-// This test checks the precedence order in requested late evaluation.
+// This test checks the precedence order in required evaluation.
 // This order is: shared-network > subnet > pools
 TEST_F(ClassifyTest, precedenceNetwork) {
     std::string config =
@@ -1483,7 +1483,7 @@ TEST_F(ClassifyTest, precedenceNetwork) {
         "    {"
         "       \"name\": \"for-pool\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"dns-servers\","
         "           \"data\": \"2001:db8:1::1\""
@@ -1492,7 +1492,7 @@ TEST_F(ClassifyTest, precedenceNetwork) {
         "    {"
         "       \"name\": \"for-subnet\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"dns-servers\","
         "           \"data\": \"2001:db8:1::2\""
@@ -1501,7 +1501,7 @@ TEST_F(ClassifyTest, precedenceNetwork) {
         "    {"
         "       \"name\": \"for-network\","
         "       \"test\": \"member('all')\","
-        "       \"eval-on-demand\": true,"
+        "       \"only-if-required\": true,"
         "       \"option-data\": [ {"
         "           \"name\": \"dns-servers\","
         "           \"data\": \"2001:db8:1::3\""
@@ -1511,14 +1511,14 @@ TEST_F(ClassifyTest, precedenceNetwork) {
         "\"shared-networks\": [ {"
         "    \"name\": \"frog\","
         "    \"interface\": \"eth1\","
-        "    \"eval-client-classes\": [ \"for-network\" ],"
+        "    \"require-client-classes\": [ \"for-network\" ],"
         "    \"subnet6\": [ { "
         "        \"subnet\": \"2001:db8:1::/64\","
         "        \"id\": 1,"
-        "        \"eval-client-classes\": [ \"for-subnet\" ],"
+        "        \"require-client-classes\": [ \"for-subnet\" ],"
         "        \"pools\": [ { "
         "            \"pool\": \"2001:db8:1::1 - 2001:db8:1::64\","
-        "            \"eval-client-classes\": [ \"for-pool\" ]"
+        "            \"require-client-classes\": [ \"for-pool\" ]"
         "        } ]"
         "    } ]"
         "} ],"
index a6261802d576c01d4525af260d6247541ec8e52a..cc7c2739ccb5933eee91a7be1465cbce4c1e7d8a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2018 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -97,8 +97,8 @@ Pkt::inClass(const std::string& client_class) {
 }
 
 void
-Pkt::addClass(const std::string& client_class, bool deferred) {
-    ClientClasses& classes = !deferred ? classes_ : on_demand_classes_;
+Pkt::addClass(const std::string& client_class, bool required) {
+    ClientClasses& classes = !required ? classes_ : required_classes_;
     if (!classes.contains(client_class)) {
         classes.insert(client_class);
     }
index bde7a8500eab980d6ce7597ff93266bca53e7418..f2efc14de8dd4122a98fb534eaf20338d275903c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2018 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -285,18 +285,19 @@ public:
     /// so I decided to stick with addClass().
     ///
     /// @param client_class name of the class to be added
-    /// @param deferred the class is marked for late evaluation
+    /// @param required the class is marked for required evaluation
     void addClass(const isc::dhcp::ClientClass& client_class,
-                  bool deferred = false);
+                  bool required = false);
 
     /// @brief Returns the class set
     ///
     /// @note This should be used only to iterate over the class set.
-    /// @param deferred return classes or to be evaluated classes.
-    /// @return if deferred is false (the default) the claases the
-    /// packet belongs to else the classes which will be evaluated later.
-    const ClientClasses& getClasses(bool deferred = false) const {
-        return (!deferred ? classes_ : on_demand_classes_);
+    /// @param required return classes or required to be evaluated classes.
+    /// @return if required is false (the default) the classes the
+    /// packet belongs to else the classes which are required to be
+    /// evaluated.
+    const ClientClasses& getClasses(bool required = false) const {
+        return (!required ? classes_ : required_classes_);
     }
 
     /// @brief Unparsed data (in received packets).
@@ -585,13 +586,13 @@ public:
     /// @ref addClass should be used to operate on this field.
     ClientClasses classes_;
 
-    /// @brief Classes which will be evaluated later.
+    /// @brief Classes which are required to be evaluated.
     ///
     /// The comment on @ref classes_ applies here.
     ///
     /// Before output option processing these classes will be evaluated
     /// and if evaluation status is true added to the previous collection.
-    ClientClasses on_demand_classes_;
+    ClientClasses required_classes_;
 
     /// @brief Collection of options present in this message.
     ///
index 0b85639bf2adb65692c62202d7aebf98a2107fb6..91c9635164164d6fc0a8ec4b575dc26e819d8949 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -18,7 +18,7 @@ namespace dhcp {
 ClientClassDef::ClientClassDef(const std::string& name,
                                const ExpressionPtr& match_expr,
                                const CfgOptionPtr& cfg_option)
-    : name_(name), match_expr_(match_expr), on_demand_(false),
+    : name_(name), match_expr_(match_expr), required_(false),
       cfg_option_(cfg_option),
       next_server_(asiolink::IOAddress::IPV4_ZERO_ADDRESS()) {
 
@@ -38,7 +38,7 @@ ClientClassDef::ClientClassDef(const std::string& name,
 
 ClientClassDef::ClientClassDef(const ClientClassDef& rhs)
     : name_(rhs.name_), match_expr_(ExpressionPtr()),
-      on_demand_(false), cfg_option_(new CfgOption()),
+      required_(false), cfg_option_(new CfgOption()),
       next_server_(asiolink::IOAddress::IPV4_ZERO_ADDRESS()) {
 
     if (rhs.match_expr_) {
@@ -54,7 +54,7 @@ ClientClassDef::ClientClassDef(const ClientClassDef& rhs)
         rhs.cfg_option_->copyTo(*cfg_option_);
     }
 
-    on_demand_ = rhs.on_demand_;
+    required_ = rhs.required_;
     next_server_ = rhs.next_server_;
     sname_ = rhs.sname_;
     filename_ = rhs.filename_;
@@ -94,13 +94,13 @@ ClientClassDef::setTest(const std::string& test) {
 }
 
 bool
-ClientClassDef::getOnDemand() const {
-    return (on_demand_);
+ClientClassDef::getRequired() const {
+    return (required_);
 }
 
 void
-ClientClassDef::setOnDemand(bool on_demand) {
-    on_demand_ = on_demand;
+ClientClassDef::setRequired(bool required) {
+    required_ = required;
 }
 
 const CfgOptionDefPtr&
@@ -135,7 +135,7 @@ ClientClassDef::equals(const ClientClassDef& other) const {
         ((!cfg_option_def_ && !other.cfg_option_def_) ||
         (cfg_option_def_ && other.cfg_option_def_ &&
          (*cfg_option_def_ == *other.cfg_option_def_))) &&
-            (on_demand_ == other.on_demand_) &&
+            (required_ == other.required_) &&
             (next_server_ == other.next_server_) &&
             (sname_ == other.sname_) &&
             (filename_ == other.filename_));
@@ -151,9 +151,9 @@ ClientClassDef:: toElement() const {
     if (!test_.empty()) {
         result->set("test", Element::create(test_));
     }
-    // Set eval-on-demand
-    if (on_demand_) {
-        result->set("eval-on-demand", Element::create(on_demand_));
+    // Set only-if-required
+    if (required_) {
+        result->set("only-if-required", Element::create(required_));
     }
     // Set option-def (used only by DHCPv4)
     if (cfg_option_def_ && (family == AF_INET)) {
@@ -200,7 +200,7 @@ void
 ClientClassDictionary::addClass(const std::string& name,
                                 const ExpressionPtr& match_expr,
                                 const std::string& test,
-                                bool on_demand,
+                                bool required,
                                 const CfgOptionPtr& cfg_option,
                                 CfgOptionDefPtr cfg_option_def,
                                 asiolink::IOAddress next_server,
@@ -208,7 +208,7 @@ ClientClassDictionary::addClass(const std::string& name,
                                 const std::string& filename) {
     ClientClassDefPtr cclass(new ClientClassDef(name, match_expr, cfg_option));
     cclass->setTest(test);
-    cclass->setOnDemand(on_demand);
+    cclass->setRequired(required);
     cclass->setCfgOptionDef(cfg_option_def);
     cclass->setNextServer(next_server);
     cclass->setSname(sname);
index b38263aba22c945fa83079b92f3366a14648134e..adcfe0e6643bfe61983dfdafac3a67fa1c054e49 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -82,11 +82,11 @@ public:
     /// @param test the original expression to assign the class
     void setTest(const std::string& test);
 
-    /// @brief Fetches the on demand flag
-    bool getOnDemand() const;
+    /// @brief Fetches the only if required flag
+    bool getRequired() const;
 
-    /// @brief Sets the on demand flag
-    void setOnDemand(bool on_demand);
+    /// @brief Sets the only if required flag
+    void setRequired(bool required);
 
     /// @brief Fetches the class's option definitions
     const CfgOptionDefPtr& getCfgOptionDef() const;
@@ -188,11 +188,11 @@ private:
     /// this class.
     std::string test_;
 
-    /// @brief The on demand flag: when false (the defaul) membership
+    /// @brief The only if required flag: when false (the defaul) membership
     /// is determined during classification so is for instance
     /// available for subnet selection, when true membership is evaluated
-    /// only if asked for and is usable only for option configuration.
-    bool on_demand_;
+    /// only when required for and is usable only for option configuration.
+    bool required_;
 
     /// @brief The option definition configuration for this class
     CfgOptionDefPtr cfg_option_def_;
@@ -251,7 +251,7 @@ public:
     /// @param name Name to assign to this class
     /// @param match_expr Expression the class will use to determine membership
     /// @param test Original version of match_expr
-    /// @param on_demand Original value of the on demand flag
+    /// @param required Original value of the only if required flag
     /// @param options Collection of options members should be given
     /// @param defs Option definitions (optional)
     /// @param next_server next-server value for this class (optional)
@@ -262,7 +262,7 @@ public:
     /// dictionary.  See @ref dhcp::ClientClassDef::ClientClassDef() for
     /// others.
     void addClass(const std::string& name, const ExpressionPtr& match_expr,
-                  const std::string& test, bool on_demand,
+                  const std::string& test, bool required,
                   const CfgOptionPtr& options,
                   CfgOptionDefPtr defs = CfgOptionDefPtr(),
                   asiolink::IOAddress next_server = asiolink::IOAddress("0.0.0.0"),
index 9ba52a8598f791123a60ddc2894951fd7390290d..0c48dba822cbf03eedcf93accd3086b90b9dd2dc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -37,15 +37,15 @@ Network::allowClientClass(const isc::dhcp::ClientClass& class_name) {
 }
 
 void
-Network::deferClientClass(const isc::dhcp::ClientClass& class_name) {
-    if (!on_demand_classes_.contains(class_name)) {
-        on_demand_classes_.insert(class_name);
+Network::requireClientClass(const isc::dhcp::ClientClass& class_name) {
+    if (!required_classes_.contains(class_name)) {
+        required_classes_.insert(class_name);
     }
 }
 
 const ClientClasses&
-Network::getOnDemandClasses() const {
-    return (on_demand_classes_);
+Network::getRequiredClasses() const {
+    return (required_classes_);
 }
 
 ElementPtr
@@ -70,15 +70,15 @@ Network::toElement() const {
         map->set("client-class", Element::create(cclass));
     }
 
-    // Set eval-client-classes
-    const ClientClasses& classes = getOnDemandClasses();
+    // Set required-client-classes
+    const ClientClasses& classes = getRequiredClasses();
     if (!classes.empty()) {
         ElementPtr class_list = Element::createList();
         for (ClientClasses::const_iterator it = classes.cbegin();
              it != classes.cend(); ++it) {
             class_list->add(Element::create(*it));
         }
-        map->set("eval-client-classes", class_list);
+        map->set("required-client-classes", class_list);
     }
 
     // Set renew-timer
index b34eb6e4246462ce9799dfec6c68f2c7b3824b1b..40ffe93010edd717085b6cbd5d22ba8e88d8f94c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -172,13 +172,13 @@ public:
     /// @param class_name client class to be supported by this network
     void allowClientClass(const isc::dhcp::ClientClass& class_name);
 
-    /// @brief Adds class class_name to classes to be evaluated later
+    /// @brief Adds class class_name to classes required to be evaluated.
     ///
-    /// @param class_name client class to be evaluated later
-    void deferClientClass(const isc::dhcp::ClientClass& class_name);
+    /// @param class_name client class required to be evaluated
+    void requireClientClass(const isc::dhcp::ClientClass& class_name);
 
-    /// @brief Returns classes which will be evaluated later
-    const isc::dhcp::ClientClasses& getOnDemandClasses() const;
+    /// @brief Returns classes which are required to be evaluated
+    const isc::dhcp::ClientClasses& getRequiredClasses() const;
 
     /// @brief returns the client class
     ///
@@ -281,11 +281,11 @@ protected:
     /// which means that any client is allowed, regardless of its class.
     ClientClass client_class_;
 
-    /// @brief On demand classes
+    /// @brief Required classes
     ///
     /// If the network is selected these classes will be added to the
-    /// incoming packet and evaluated later.
-    ClientClasses on_demand_classes_;
+    /// incoming packet and their evaluation will be required.
+    ClientClasses required_classes_;
 
     /// @brief a Triplet (min/default/max) holding allowed renew timer values
     Triplet<uint32_t> t1_;
index cf4b231bbe706326628a6742be4e6c7edc7cd395..1e4714203a0ad80962498c216772c4d23fb4ce4b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -132,10 +132,10 @@ ClientClassDefParser::parse(ClientClassDictionaryPtr& class_dictionary,
         opts_parser.parse(options, option_data);
     }
 
-    // Let's try to parse the eval-on-demand flag
-    bool on_demand = false;
-    if (class_def_cfg->contains("eval-on-demand")) {
-        on_demand = getBoolean(class_def_cfg, "eval-on-demand");
+    // Let's try to parse the only-if-required flag
+    bool required = false;
+    if (class_def_cfg->contains("only-if-required")) {
+        required = getBoolean(class_def_cfg, "only-if-required");
     }
 
     // Let's try to parse the next-server field
@@ -193,7 +193,7 @@ ClientClassDefParser::parse(ClientClassDictionaryPtr& class_dictionary,
 
     // Add the client class definition
     try {
-        class_dictionary->addClass(name, match_expr, test, on_demand, options,
+        class_dictionary->addClass(name, match_expr, test, required, options,
                                    defs, next_server, sname, filename);
     } catch (const std::exception& ex) {
         isc_throw(DhcpConfigError, "Can't add class: " << ex.what()
index 4c41cbf8486ebda5b5a7831444cb43382a701076..ce1879f97c6dd7664efd647f1440dbc5507df4c8 100644 (file)
@@ -388,8 +388,8 @@ PoolParser::parse(PoolStoragePtr pools,
         }
     }
 
-    // Try setting up on demand client classes.
-    ConstElementPtr class_list = pool_structure->get("eval-client-classes");
+    // Try setting up required client classes.
+    ConstElementPtr class_list = pool_structure->get("required-client-classes");
     if (class_list) {
         const std::vector<data::ElementPtr>& classes = class_list->listValue();
         for (auto cclass = classes.cbegin();
@@ -399,7 +399,7 @@ PoolParser::parse(PoolStoragePtr pools,
                 isc_throw(DhcpConfigError, "invalid class name ("
                           << (*cclass)->getPosition() << ")");
             }
-            pool->deferClientClass((*cclass)->stringValue());
+            pool->requireClientClass((*cclass)->stringValue());
         }
     }
 }
@@ -711,8 +711,8 @@ Subnet4ConfigParser::initSubnet(data::ConstElementPtr params,
         subnet4->allowClientClass(client_class);
     }
 
-    // Try setting up on demand client classes.
-    ConstElementPtr class_list = params->get("eval-client-classes");
+    // Try setting up required client classes.
+    ConstElementPtr class_list = params->get("required-client-classes");
     if (class_list) {
         const std::vector<data::ElementPtr>& classes = class_list->listValue();
         for (auto cclass = classes.cbegin();
@@ -722,7 +722,7 @@ Subnet4ConfigParser::initSubnet(data::ConstElementPtr params,
                 isc_throw(DhcpConfigError, "invalid class name ("
                           << (*cclass)->getPosition() << ")");
             }
-            subnet4->deferClientClass((*cclass)->stringValue());
+            subnet4->requireClientClass((*cclass)->stringValue());
         }
     }
 
@@ -891,7 +891,7 @@ PdPoolParser::parse(PoolStoragePtr pools, ConstElementPtr pd_pool_) {
         client_class_ = client_class;
     }
 
-    ConstElementPtr class_list = pd_pool_->get("eval-client-classes");
+    ConstElementPtr class_list = pd_pool_->get("required-client-classes");
 
     // Check the pool parameters. It will throw an exception if any
     // of the required parameters are invalid.
@@ -932,7 +932,7 @@ PdPoolParser::parse(PoolStoragePtr pools, ConstElementPtr pd_pool_) {
                 isc_throw(DhcpConfigError, "invalid class name ("
                           << (*cclass)->getPosition() << ")");
             }
-            pool_->deferClientClass((*cclass)->stringValue());
+            pool_->requireClientClass((*cclass)->stringValue());
         }
     }
 
@@ -1111,8 +1111,8 @@ Subnet6ConfigParser::initSubnet(data::ConstElementPtr params,
         subnet6->allowClientClass(client_class);
     }
 
-    // Try setting up on demand client classes.
-    ConstElementPtr class_list = params->get("eval-client-classes");
+    // Try setting up required client classes.
+    ConstElementPtr class_list = params->get("required-client-classes");
     if (class_list) {
         const std::vector<data::ElementPtr>& classes = class_list->listValue();
         for (auto cclass = classes.cbegin();
@@ -1122,7 +1122,7 @@ Subnet6ConfigParser::initSubnet(data::ConstElementPtr params,
                 isc_throw(DhcpConfigError, "invalid class name ("
                           << (*cclass)->getPosition() << ")");
             }
-            subnet6->deferClientClass((*cclass)->stringValue());
+            subnet6->requireClientClass((*cclass)->stringValue());
         }
     }
 
index 91c104fdef9110ca41688bab04b7f5245236152f..5a04e6cd207d4530fa49a5582b52f7c4ae3b331c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -70,9 +70,9 @@ SharedNetwork4Parser::parse(const data::ConstElementPtr& shared_network_data) {
             }
         }
 
-        if (shared_network_data->contains("eval-client-classes")) {
+        if (shared_network_data->contains("required-client-classes")) {
             const std::vector<data::ElementPtr>& class_list =
-                shared_network_data->get("eval-client-classes")->listValue();
+                shared_network_data->get("required-client-classes")->listValue();
             for (auto cclass = class_list.cbegin();
                  cclass != class_list.cend(); ++cclass) {
                 if (((*cclass)->getType() != Element::string) ||
@@ -80,7 +80,7 @@ SharedNetwork4Parser::parse(const data::ConstElementPtr& shared_network_data) {
                     isc_throw(DhcpConfigError, "invalid class name ("
                               << (*cclass)->getPosition() << ")");
                 }
-                shared_network->deferClientClass((*cclass)->stringValue());
+                shared_network->requireClientClass((*cclass)->stringValue());
             }
         }
 
@@ -125,9 +125,9 @@ SharedNetwork6Parser::parse(const data::ConstElementPtr& shared_network_data) {
             }
         }
 
-        if (shared_network_data->contains("eval-client-classes")) {
+        if (shared_network_data->contains("required-client-classes")) {
             const std::vector<data::ElementPtr>& class_list =
-                shared_network_data->get("eval-client-classes")->listValue();
+                shared_network_data->get("required-client-classes")->listValue();
             for (auto cclass = class_list.cbegin();
                  cclass != class_list.cend(); ++cclass) {
                 if (((*cclass)->getType() != Element::string) ||
@@ -135,7 +135,7 @@ SharedNetwork6Parser::parse(const data::ConstElementPtr& shared_network_data) {
                     isc_throw(DhcpConfigError, "invalid class name ("
                               << (*cclass)->getPosition() << ")");
                 }
-                shared_network->deferClientClass((*cclass)->stringValue());
+                shared_network->requireClientClass((*cclass)->stringValue());
             }
         }
 
index edc5db276ab5838dc08ec164cbb7cbd975370882..2e96ee1ded6f283660a2d7547e8bc212a82e8574 100644 (file)
@@ -112,15 +112,15 @@ Pool::toElement() const {
         map->set("client-class", Element::create(cclass));
     }
 
-    // Set eval-client-classes
-    const ClientClasses& classes = getOnDemandClasses();
+    // Set required-client-classes
+    const ClientClasses& classes = getRequiredClasses();
     if (!classes.empty()) {
         ElementPtr class_list =Element::createList();
         for (ClientClasses::const_iterator it = classes.cbegin();
              it != classes.cend(); ++it) {
             class_list->add(Element::create(*it));
         }
-        map->set("eval-client-classes", class_list);
+        map->set("required-client-classes", class_list);
     }
 
     return (map);
index a1ae604a8d449194706801581db2e9dd383587ab..30d1e2f7edf2ae846c4b2dc2a81d56dfda985309 100644 (file)
@@ -129,18 +129,18 @@ public:
         return (client_class_);
     }
 
-    /// @brief Adds class class_name to classes to be evaluated later
+    /// @brief Adds class class_name to classes required to be evaluated
     ///
-    /// @param class_name client class to be evaluated later
-    void deferClientClass(const ClientClass& class_name) {
-        if (!on_demand_classes_.contains(class_name)) {
-            on_demand_classes_.insert(class_name);
+    /// @param class_name client class required to be evaluated
+    void requireClientClass(const ClientClass& class_name) {
+        if (!required_classes_.contains(class_name)) {
+            required_classes_.insert(class_name);
         }
     }
 
-    /// @brief Returns classes which will be evaluated later
-    const ClientClasses& getOnDemandClasses() const {
-        return (on_demand_classes_);
+    /// @brief Returns classes which are required to be evaluated
+    const ClientClasses& getRequiredClasses() const {
+        return (required_classes_);
     }
 
     /// @brief returns the last address that was tried from this pool
@@ -232,10 +232,10 @@ protected:
     /// @ref Network::client_class_
     ClientClass client_class_;
 
-    /// @brief On demand classes
+    /// @brief Required classes
     ///
-    /// @ref isc::dhcp::Network::on_demand_classes
-    ClientClasses on_demand_classes_;
+    /// @ref isc::dhcp::Network::required_classes
+    ClientClasses required_classes_;
 
     /// @brief Pointer to the user context (may be NULL)
     data::ConstElementPtr user_context_;
index c142dfa520e4954866880b56d3329ccd2143195c..8f8c691d87abab0858da012d1a52b4220d25b1b2 100644 (file)
@@ -739,8 +739,8 @@ TEST(CfgSubnets4Test, unparseSubnet) {
     subnet2->setIface("lo");
     subnet2->setRelayInfo(IOAddress("10.0.0.1"));
     subnet3->setIface("eth1");
-    subnet3->deferClientClass("foo");
-    subnet3->deferClientClass("bar");
+    subnet3->requireClientClass("foo");
+    subnet3->requireClientClass("bar");
 
     cfg.add(subnet1);
     cfg.add(subnet2);
@@ -802,7 +802,7 @@ TEST(CfgSubnets4Test, unparseSubnet) {
         "    \"reservation-mode\": \"all\",\n"
         "    \"option-data\": [ ],\n"
         "    \"pools\": [ ]\n,"
-        "    \"eval-client-classes\": [ \"foo\", \"bar\" ]\n"
+        "    \"required-client-classes\": [ \"foo\", \"bar\" ]\n"
         "} ]\n";
     runToElementTest<CfgSubnets4>(expected, cfg);
 }
@@ -816,7 +816,7 @@ TEST(CfgSubnets4Test, unparsePool) {
     Pool4Ptr pool1(new Pool4(IOAddress("192.0.2.1"), IOAddress("192.0.2.10")));
     Pool4Ptr pool2(new Pool4(IOAddress("192.0.2.64"), 26));
     pool2->allowClientClass("bar");
-    pool2->deferClientClass("foo");
+    pool2->requireClientClass("foo");
 
     subnet->addPool(pool1);
     subnet->addPool(pool2);
@@ -848,7 +848,7 @@ TEST(CfgSubnets4Test, unparsePool) {
         "            \"option-data\": [ ],\n"
         "            \"pool\": \"192.0.2.64/26\",\n"
         "            \"client-class\": \"bar\",\n"
-        "            \"eval-client-classes\": [ \"foo\" ]\n"
+        "            \"required-client-classes\": [ \"foo\" ]\n"
         "        }\n"
         "    ]\n"
         "} ]\n";
index 63c3297247eae86450a3025b1d4e9963c850ab52..6d1f6baad4c48f5128c4d71cda197ba067314518 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2018 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -438,8 +438,8 @@ TEST(CfgSubnets6Test, unparseSubnet) {
     subnet2->setIface("lo");
     subnet2->setRelayInfo(IOAddress("2001:db8:ff::2"));
     subnet3->setIface("eth1");
-    subnet3->deferClientClass("foo");
-    subnet3->deferClientClass("bar");
+    subnet3->requireClientClass("foo");
+    subnet3->requireClientClass("bar");
 
     cfg.add(subnet1);
     cfg.add(subnet2);
@@ -490,7 +490,7 @@ TEST(CfgSubnets6Test, unparseSubnet) {
         "    \"pools\": [ ],\n"
         "    \"pd-pools\": [ ],\n"
         "    \"option-data\": [ ],\n"
-        "    \"eval-client-classes\": [ \"foo\", \"bar\" ]\n"
+        "    \"required-client-classes\": [ \"foo\", \"bar\" ]\n"
         "} ]\n";
     runToElementTest<CfgSubnets6>(expected, cfg);
 }
@@ -507,7 +507,7 @@ TEST(CfgSubnets6Test, unparsePool) {
                              IOAddress("2001:db8:1::199")));
     Pool6Ptr pool2(new Pool6(Lease::TYPE_NA, IOAddress("2001:db8:1:1::"), 64));
     pool2->allowClientClass("bar");
-    pool2->deferClientClass("foo");
+    pool2->requireClientClass("foo");
 
     subnet->addPool(pool1);
     subnet->addPool(pool2);
@@ -533,7 +533,7 @@ TEST(CfgSubnets6Test, unparsePool) {
         "            \"pool\": \"2001:db8:1:1::/64\",\n"
         "            \"option-data\": [ ],\n"
         "            \"client-class\": \"bar\",\n"
-        "            \"eval-client-classes\": [ \"foo\" ]\n"
+        "            \"required-client-classes\": [ \"foo\" ]\n"
         "        }\n"
         "    ],\n"
         "    \"pd-pools\": [ ],\n"
@@ -554,7 +554,7 @@ TEST(CfgSubnets6Test, unparsePdPool) {
                                IOAddress("2001:db8:2::"), 48, 64));
     Pool6Ptr pdpool2(new Pool6(IOAddress("2001:db8:3::"), 48, 56,
                                IOAddress("2001:db8:3::"), 64));
-    pdpool1->deferClientClass("bar");
+    pdpool1->requireClientClass("bar");
     pdpool2->allowClientClass("bar");
 
     subnet->addPool(pdpool1);
@@ -580,7 +580,7 @@ TEST(CfgSubnets6Test, unparsePdPool) {
         "            \"prefix-len\": 48,\n"
         "            \"delegated-len\": 64,\n"
         "            \"option-data\": [ ],\n"
-        "            \"eval-client-classes\": [ \"bar\" ]\n"
+        "            \"required-client-classes\": [ \"bar\" ]\n"
         "        },{\n"
         "            \"prefix\": \"2001:db8:3::\",\n"
         "            \"prefix-len\": 48,\n"
index 816d100c968ad33a9985b7873fc4c783b8e37ffd..9d8eabb27d32962ac3ff30b2e74454a2fdf0efe3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -142,10 +142,10 @@ TEST(ClientClassDef, copyAndEquality) {
     EXPECT_TRUE(*cclass == *cclass2);
     EXPECT_FALSE(*cclass != *cclass2);
 
-    // Verify the on_demand flag is enough to make classes not equal.
-    EXPECT_FALSE(cclass->getOnDemand());
-    cclass2->setOnDemand(true);
-    EXPECT_TRUE(cclass2->getOnDemand());
+    // Verify the required flag is enough to make classes not equal.
+    EXPECT_FALSE(cclass->getRequired());
+    cclass2->setRequired(true);
+    EXPECT_TRUE(cclass2->getRequired());
     EXPECT_FALSE(*cclass == *cclass2);
     EXPECT_TRUE(*cclass != *cclass2);
 
@@ -346,7 +346,7 @@ TEST(ClientClassDef, fixedFieldsDefaults) {
     ASSERT_NO_THROW(cclass.reset(new ClientClassDef(name, expr)));
 
     // Let's checks that it doesn't return any nonsense
-    EXPECT_FALSE(cclass->getOnDemand());
+    EXPECT_FALSE(cclass->getRequired());
     EXPECT_FALSE(cclass->getCfgOptionDef());
     string empty;
     ASSERT_EQ(IOAddress("0.0.0.0"), cclass->getNextServer());
@@ -369,7 +369,7 @@ TEST(ClientClassDef, fixedFieldsBasics) {
     // Verify we can create a class with a name, expression, and no cfg_option
     ASSERT_NO_THROW(cclass.reset(new ClientClassDef(name, expr)));
 
-    cclass->setOnDemand(true);
+    cclass->setRequired(true);
 
     string sname = "This is a very long string that can be a server name";
     string filename = "this-is-a-slightly-longish-name-of-a-file.txt";
@@ -379,7 +379,7 @@ TEST(ClientClassDef, fixedFieldsBasics) {
     cclass->setFilename(filename);
 
     // Let's checks that it doesn't return any nonsense
-    EXPECT_TRUE(cclass->getOnDemand());
+    EXPECT_TRUE(cclass->getRequired());
     EXPECT_EQ(IOAddress("1.2.3.4"), cclass->getNextServer());
     EXPECT_EQ(sname, cclass->getSname());
     EXPECT_EQ(filename, cclass->getFilename());
@@ -397,7 +397,7 @@ TEST(ClientClassDef, unparseDef) {
     ASSERT_NO_THROW(cclass.reset(new ClientClassDef(name, expr)));
     std::string test = "option[12].text == 'foo'";
     cclass->setTest(test);
-    cclass->setOnDemand(true);
+    cclass->setRequired(true);
     std::string next_server = "1.2.3.4";
     cclass->setNextServer(IOAddress(next_server));
     std::string sname = "my-server.example.com";
@@ -409,7 +409,7 @@ TEST(ClientClassDef, unparseDef) {
     std::string expected = "{\n"
         "\"name\": \"" + name + "\",\n"
         "\"test\": \"" + test + "\",\n"
-        "\"eval-on-demand\": true,\n"
+        "\"only-if-required\": true,\n"
         "\"next-server\": \"" + next_server + "\",\n"
         "\"server-hostname\": \"" + sname + "\",\n"
         "\"boot-file-name\": \"" + filename + "\",\n"
index 6f6b8192f5daf7e489f8ba32108bd644838164ed..a0e113668b19a5818d17cbdc633288f2edccb4c7 100644 (file)
@@ -230,33 +230,33 @@ TEST(Pool4Test, clientClass) {
     EXPECT_TRUE(pool->clientSupported(three_classes));
 }
 
-// This test checks that handling for eval-client-classes is valid.
-TEST(Pool4Test, onDemandClasses) {
+// This test checks that handling for required-client-classes is valid.
+TEST(Pool4Test, requiredClasses) {
     // Create a pool.
     Pool4Ptr pool(new Pool4(IOAddress("192.0.2.0"),
                             IOAddress("192.0.2.255")));
 
-    // This client starts with no deferred classes.
-    EXPECT_TRUE(pool->getOnDemandClasses().empty());
+    // This client starts with no required classes.
+    EXPECT_TRUE(pool->getRequiredClasses().empty());
 
     // Add the first class
-    pool->deferClientClass("router");
-    EXPECT_EQ(1, pool->getOnDemandClasses().size());
+    pool->requireClientClass("router");
+    EXPECT_EQ(1, pool->getRequiredClasses().size());
 
     // Add a second class
-    pool->deferClientClass("modem");
-    EXPECT_EQ(2, pool->getOnDemandClasses().size());
-    EXPECT_TRUE(pool->getOnDemandClasses().contains("router"));
-    EXPECT_TRUE(pool->getOnDemandClasses().contains("modem"));
-    EXPECT_FALSE(pool->getOnDemandClasses().contains("foo"));
+    pool->requireClientClass("modem");
+    EXPECT_EQ(2, pool->getRequiredClasses().size());
+    EXPECT_TRUE(pool->getRequiredClasses().contains("router"));
+    EXPECT_TRUE(pool->getRequiredClasses().contains("modem"));
+    EXPECT_FALSE(pool->getRequiredClasses().contains("foo"));
 
     // Check that it's ok to add the same class repeatedly
-    EXPECT_NO_THROW(pool->deferClientClass("foo"));
-    EXPECT_NO_THROW(pool->deferClientClass("foo"));
-    EXPECT_NO_THROW(pool->deferClientClass("foo"));
+    EXPECT_NO_THROW(pool->requireClientClass("foo"));
+    EXPECT_NO_THROW(pool->requireClientClass("foo"));
+    EXPECT_NO_THROW(pool->requireClientClass("foo"));
 
-    // Check that 'foo' is marked for late evaluation
-    EXPECT_TRUE(pool->getOnDemandClasses().contains("foo"));
+    // Check that 'foo' is marked for required evaluation
+    EXPECT_TRUE(pool->getRequiredClasses().contains("foo"));
 }
 
 // This test checks that handling for last allocated address/prefix is valid.
@@ -625,33 +625,33 @@ TEST(Pool6Test, clientClass) {
     EXPECT_TRUE(pool.clientSupported(three_classes));
 }
 
-// This test checks that handling for eval-client-classes is valid.
-TEST(Pool6Test, onDemandClasses) {
+// This test checks that handling for required-client-classes is valid.
+TEST(Pool6Test, requiredClasses) {
     // Create a pool.
     Pool6 pool(Lease::TYPE_NA, IOAddress("2001:db8::1"),
                IOAddress("2001:db8::2"));
 
-    // This client starts with no deferred classes.
-    EXPECT_TRUE(pool.getOnDemandClasses().empty());
+    // This client starts with no required classes.
+    EXPECT_TRUE(pool.getRequiredClasses().empty());
 
     // Add the first class
-    pool.deferClientClass("router");
-    EXPECT_EQ(1, pool.getOnDemandClasses().size());
+    pool.requireClientClass("router");
+    EXPECT_EQ(1, pool.getRequiredClasses().size());
 
     // Add a second class
-    pool.deferClientClass("modem");
-    EXPECT_EQ(2, pool.getOnDemandClasses().size());
-    EXPECT_TRUE(pool.getOnDemandClasses().contains("router"));
-    EXPECT_TRUE(pool.getOnDemandClasses().contains("modem"));
-    EXPECT_FALSE(pool.getOnDemandClasses().contains("foo"));
+    pool.requireClientClass("modem");
+    EXPECT_EQ(2, pool.getRequiredClasses().size());
+    EXPECT_TRUE(pool.getRequiredClasses().contains("router"));
+    EXPECT_TRUE(pool.getRequiredClasses().contains("modem"));
+    EXPECT_FALSE(pool.getRequiredClasses().contains("foo"));
 
     // Check that it's ok to add the same class repeatedly
-    EXPECT_NO_THROW(pool.deferClientClass("foo"));
-    EXPECT_NO_THROW(pool.deferClientClass("foo"));
-    EXPECT_NO_THROW(pool.deferClientClass("foo"));
+    EXPECT_NO_THROW(pool.requireClientClass("foo"));
+    EXPECT_NO_THROW(pool.requireClientClass("foo"));
+    EXPECT_NO_THROW(pool.requireClientClass("foo"));
 
-    // Check that 'foo' is marked for late evaluation
-    EXPECT_TRUE(pool.getOnDemandClasses().contains("foo"));
+    // Check that 'foo' is marked for required evaluation
+    EXPECT_TRUE(pool.getRequiredClasses().contains("foo"));
 }
 
 // This test checks that handling for last allocated address/prefix is valid.
index dee9300e6a97b9dae5d5518415fb3eb7bab0fbe3..dfb3a9db9cba381b0d2ae74c6723ca01841302eb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -52,7 +52,7 @@ public:
                 "            \"server-hostname\": \"\","
                 "            \"boot-file-name\": \"\","
                 "            \"client-class\": \"\","
-                "            \"eval-client-classes\": []\n,"
+                "            \"required-client-classes\": []\n,"
                 "            \"reservation-mode\": \"all\","
                 "            \"4o6-interface\": \"\","
                 "            \"4o6-interface-id\": \"\","
@@ -73,7 +73,7 @@ public:
                 "            \"server-hostname\": \"\","
                 "            \"boot-file-name\": \"\","
                 "            \"client-class\": \"\","
-                "            \"eval-client-classes\": []\n,"
+                "            \"required-client-classes\": []\n,"
                 "            \"reservation-mode\": \"all\","
                 "            \"4o6-interface\": \"\","
                 "            \"4o6-interface-id\": \"\","
@@ -194,7 +194,7 @@ public:
                 "            \"preferred-lifetime\": 300,"
                 "            \"valid-lifetime\": 400,"
                 "            \"client-class\": \"\","
-                "            \"eval-client-classes\": []\n,"
+                "            \"required-client-classes\": []\n,"
                 "            \"reservation-mode\": \"all\","
                 "            \"decline-probation-period\": 86400,"
                 "            \"dhcp4o6-port\": 0,"
@@ -210,7 +210,7 @@ public:
                 "            \"preferred-lifetime\": 30,"
                 "            \"valid-lifetime\": 40,"
                 "            \"client-class\": \"\","
-                "            \"eval-client-classes\": []\n,"
+                "            \"required-client-classes\": []\n,"
                 "            \"reservation-mode\": \"all\","
                 "            \"decline-probation-period\": 86400,"
                 "            \"dhcp4o6-port\": 0,"
@@ -283,7 +283,7 @@ TEST_F(SharedNetwork6ParserTest, clientClass) {
     EXPECT_EQ("alpha", network->getClientClass());
 }
 
-// This test verifies that it's possible to specify eval-client-classes
+// This test verifies that it's possible to specify required-client-classes
 // on shared-network level.
 TEST_F(SharedNetwork6ParserTest, evalClientClasses) {
     std::string config = getWorkingConfig();
@@ -292,7 +292,7 @@ TEST_F(SharedNetwork6ParserTest, evalClientClasses) {
     ElementPtr class_list = Element::createList();
     class_list->add(Element::create("alpha"));
     class_list->add(Element::create("beta"));
-    config_element->set("eval-client-classes", class_list);
+    config_element->set("required-client-classes", class_list);
 
     // Parse configuration specified above.
     SharedNetwork6Parser parser;
@@ -300,12 +300,12 @@ TEST_F(SharedNetwork6ParserTest, evalClientClasses) {
     network = parser.parse(config_element);
     ASSERT_TRUE(network);
 
-    const ClientClasses& classes = network->getOnDemandClasses();
+    const ClientClasses& classes = network->getRequiredClasses();
     EXPECT_EQ(2, classes.size());
     EXPECT_EQ("alpha, beta", classes.toText());
 }
 
-// This test verifies that bad eval-client-classes configs raise
+// This test verifies that bad required-client-classes configs raise
 // expected errors.
 TEST_F(SharedNetwork6ParserTest, badEvalClientClasses) {
     std::string config = getWorkingConfig();
@@ -315,7 +315,7 @@ TEST_F(SharedNetwork6ParserTest, badEvalClientClasses) {
     ElementPtr class_list = Element::createList();
     class_list->add(Element::create("alpha"));
     class_list->add(Element::create(1234));
-    config_element->set("eval-client-classes", class_list);
+    config_element->set("required-client-classes", class_list);
 
     // Parse configuration specified above.
     SharedNetwork6Parser parser;
index 58df64673ed4cb550ce1ccaa580adf87ce8b54e3..aefe3bc39899d90f2f10cf47388167a648bb172d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -195,7 +195,7 @@ TEST(SharedNetwork4Test, unparse) {
     network->setValid(200);
     network->setMatchClientId(false);
 
-    network->deferClientClass("foo");
+    network->requireClientClass("foo");
 
     // Add several subnets.
     Subnet4Ptr subnet1(new Subnet4(IOAddress("10.0.0.0"), 8, 10, 20, 30,
@@ -258,7 +258,7 @@ TEST(SharedNetwork4Test, unparse) {
         "        \"valid-lifetime\": 30\n"
         "      }\n"
         "    ],\n"
-        "    \"eval-client-classes\": [ \"foo\" ],\n"
+        "    \"required-client-classes\": [ \"foo\" ],\n"
         "    \"valid-lifetime\": 200\n"
         "}\n";
 
@@ -482,7 +482,7 @@ TEST(SharedNetwork6Test, unparse) {
     network->setPreferred(200);
     network->setValid(300);
     network->setRapidCommit(true);
-    network->deferClientClass("foo");
+    network->requireClientClass("foo");
 
     // Add several subnets.
     Subnet6Ptr subnet1(new Subnet6(IOAddress("2001:db8:1::"), 64, 10, 20, 30,
@@ -538,7 +538,7 @@ TEST(SharedNetwork6Test, unparse) {
         "        \"valid-lifetime\": 40\n"
         "      }\n"
         "    ],\n"
-        "    \"eval-client-classes\": [ \"foo\" ],\n"
+        "    \"required-client-classes\": [ \"foo\" ],\n"
         "    \"valid-lifetime\": 300\n"
         "}\n";