]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[4321] Cosmetics changes (no real code change)
authorFrancis Dupont <fdupont@isc.org>
Mon, 4 Jul 2016 11:13:59 +0000 (13:13 +0200)
committerFrancis Dupont <fdupont@isc.org>
Mon, 4 Jul 2016 11:13:59 +0000 (13:13 +0200)
src/bin/dhcp6/tests/dhcp6_client.cc
src/bin/dhcp6/tests/dhcp6_client.h
src/bin/dhcp6/tests/dhcp6_test_utils.h
src/bin/dhcp6/tests/host_unittest.cc
src/lib/dhcpsrv/alloc_engine.cc
src/lib/dhcpsrv/lease.h

index fb8be12f49c1524bd48858c64b69db8488638422..43d4a7a47fa08d9f375271f29eeb08962461ee39 100644 (file)
@@ -55,7 +55,7 @@ struct getLeasesByPropertyFun {
         for (typename std::vector<Lease6>::const_iterator lease =
                  config.leases_.begin(); lease != config.leases_.end();
              ++lease) {
-            // Check if fulfils the condition.
+            // Check if fulfills the condition.
             if ((equals && ((*lease).*MemberPointer) == property) ||
                 (!equals && ((*lease).*MemberPointer) != property)) {
                 // Found the matching lease.
@@ -252,15 +252,18 @@ Dhcp6Client::appendFQDN() {
 void
 Dhcp6Client::appendRequestedIAs(const Pkt6Ptr& query) const {
     BOOST_FOREACH(const ClientIA& ia, client_ias_) {
-        OptionCollection options = query->getOptions(ia.type_ == Lease::TYPE_NA ?
-                                                     D6O_IA_NA : D6O_IA_PD);
+        OptionCollection options =
+            query->getOptions(ia.type_ == Lease::TYPE_NA ?
+                              D6O_IA_NA : D6O_IA_PD);
         std::pair<unsigned int, OptionPtr> option_pair;
         Option6IAPtr existing_ia;
         BOOST_FOREACH(option_pair, options) {
-            Option6IAPtr ia_opt = boost::dynamic_pointer_cast<Option6IA>(option_pair.second);
+            Option6IAPtr ia_opt =
+                boost::dynamic_pointer_cast<Option6IA>(option_pair.second);
             // This shouldn't happen.
             if (!ia_opt) {
-                isc_throw(Unexpected, "Dhcp6Client: IA option has an invalid C++ type;"
+                isc_throw(Unexpected,
+                          "Dhcp6Client: IA option has an invalid C++ type;"
                           " this is a programming issue");
             }
             if (ia_opt->getIAID() == ia.iaid_) {
@@ -280,7 +283,8 @@ Dhcp6Client::appendRequestedIAs(const Pkt6Ptr& query) const {
             BOOST_FOREACH(option_pair, existing_ia->getOptions()) {
                 Option6IAAddrPtr existing_addr = boost::dynamic_pointer_cast<
                     Option6IAAddr>(option_pair.second);
-                if (existing_addr && (existing_addr->getAddress() == ia.prefix_)) {
+                if (existing_addr &&
+                    (existing_addr->getAddress() == ia.prefix_)) {
                     option_exists = true;
                 }
             }
@@ -289,15 +293,17 @@ Dhcp6Client::appendRequestedIAs(const Pkt6Ptr& query) const {
                 existing_ia->addOption(ia_addr);
             }
 
-        } else if ((ia.type_ == Lease::TYPE_PD) && (!ia.prefix_.isV6Zero() ||
-            (ia.prefix_len_ > 0))) {
-            Option6IAPrefixPtr ia_prefix(new Option6IAPrefix(D6O_IAPREFIX, ia.prefix_,
+        } else if ((ia.type_ == Lease::TYPE_PD) &&
+                   (!ia.prefix_.isV6Zero() || (ia.prefix_len_ > 0))) {
+            Option6IAPrefixPtr ia_prefix(new Option6IAPrefix(D6O_IAPREFIX,
+                                                             ia.prefix_,
                                                              ia.prefix_len_,
                                                              0, 0));
             BOOST_FOREACH(option_pair, existing_ia->getOptions()) {
-                Option6IAPrefixPtr existing_prefix = boost::dynamic_pointer_cast<
-                    Option6IAPrefix>(option_pair.second);
-                if (existing_prefix && (existing_prefix->getAddress() == ia.prefix_) &&
+                Option6IAPrefixPtr existing_prefix =
+                    boost::dynamic_pointer_cast<Option6IAPrefix>(option_pair.second);
+                if (existing_prefix &&
+                    (existing_prefix->getAddress() == ia.prefix_) &&
                     existing_prefix->getLength()) {
                     option_exists = true;
                 }
@@ -435,8 +441,10 @@ Dhcp6Client::doSolicit(const bool always_apply_config) {
     // If using Rapid Commit and the server has responded with Reply,
     // let's apply received configuration. We also apply the configuration
     // for the Advertise if instructed to do so.
-    if (context_.response_ && (always_apply_config || (use_rapid_commit_ &&
-        context_.response_->getType() == DHCPV6_REPLY))) {
+    if (context_.response_ &&
+        (always_apply_config ||
+         (use_rapid_commit_ &&
+          context_.response_->getType() == DHCPV6_REPLY))) {
         config_.clear();
         applyRcvdConfiguration(context_.response_);
     }
index 7cb615480d6406b9f65110fd98c9f12eb19efa1b..1c526e4b604bf62dff19d7a78a9c77b7bf6af131 100644 (file)
@@ -298,7 +298,7 @@ public:
     ///
     /// This function generates Information-request message, sends it
     /// to the server and then receives the reply. Contents of the Inf-Request
-    /// are controlled by use_na_, use_pd_, use_client_id_ and use_oro_
+    /// are controlled by client_ias_, use_client_id_ and use_oro_
     /// fields. This method does not process the response in any specific
     /// way, just stores it.
     void doInfRequest();
@@ -367,7 +367,8 @@ public:
     /// @param address Leased address.
     ///
     /// @return Vector containing leases for the specified address.
-    std::vector<Lease6> getLeasesByAddress(const asiolink::IOAddress& address) const;
+    std::vector<Lease6>
+        getLeasesByAddress(const asiolink::IOAddress& address) const;
 
     /// @brief Returns leases belonging to specified address range.
     ///
@@ -375,8 +376,9 @@ public:
     /// @param second Upper bound of the address range.
     ///
     /// @return Vector containing leases belonging to specified address range.
-    std::vector<Lease6> getLeasesByAddressRange(const asiolink::IOAddress& first,
-                                                const asiolink::IOAddress& second) const;
+    std::vector<Lease6>
+        getLeasesByAddressRange(const asiolink::IOAddress& first,
+                                const asiolink::IOAddress& second) const;
 
     /// @brief Returns leases belonging to prefix pool.
     ///
@@ -385,9 +387,10 @@ public:
     /// @param delegated_len Delegated prefix length.
     ///
     /// @return Vector containing leases belonging to specified prefix pool.
-    std::vector<Lease6> getLeasesByPrefixPool(const asiolink::IOAddress& prefix,
-                                              const uint8_t prefix_len,
-                                              const uint8_t delegated_len) const;
+    std::vector<Lease6>
+        getLeasesByPrefixPool(const asiolink::IOAddress& prefix,
+                              const uint8_t prefix_len,
+                              const uint8_t delegated_len) const;
 
     /// @brief Checks if client has lease for the specified address.
     ///
@@ -644,6 +647,9 @@ public:
     void useFQDN(const uint8_t flags, const std::string& fqdn_name,
                  Option6ClientFqdn::DomainNameType fqdn_type);
 
+    /// @brief Controls whether the client should send an addres in IA_NA
+    ///
+    /// @param send should the address be included?
     void includeAddress(const bool send) {
         include_address_ = send;
     }
@@ -733,7 +739,7 @@ private:
 
     /// @brief Includes IAs to be requested.
     ///
-    /// This method includes IAs explicitly requested using 
+    /// This method includes IAs explicitly requested using client_ias_
     ///
     /// @param query Pointer to the client's message to which IAs should be
     /// added.
@@ -854,6 +860,10 @@ private:
     /// @brief FQDN requested by the client.
     Option6ClientFqdnPtr fqdn_;
 
+    /// @brief Determines if the client will include address in the messages
+    ///        it sends.
+    ///
+    /// @todo this flag is currently supported in Decline only.
     bool include_address_;
 };
 
index f36ba41b42c49c08cd825a8c55338ab59ff57559..42d6816e51ca25786a38d092b22de36b9c08c3d3 100644 (file)
@@ -37,14 +37,14 @@ namespace test {
 /// @brief Generic wrapper to provide strongly typed values.
 ///
 /// In many cases, the test fixture class methods require providing many
-/// paramaters, of which some ore optional. Some of the parameters may also
+/// parameters, of which some are optional. Some of the parameters may also
 /// be implicitly converted to other types. Non-careful test implementer
 /// may often "shift by one" or swap two values on the arguments list, which
 /// will be accepted by the compiler but will result in troubles running the
 /// function. Sometimes it takes non trivial amount of debugging to find out
 /// why the particular function fails until we find that the arguments were
 /// swapped or shifted. In addition, the use of classes wrapping simple types
-/// results in better readbility of the test code.
+/// results in better readability of the test code.
 ///
 /// @tparam ValueType Type of the wrapped value.
 template<typename ValueType>
index 563b1baf30adc820a1ea0dd339a6f97033d9c953..80cfea767c4b8cf1dd3abbf7523784f2e746f9cc 100644 (file)
@@ -116,7 +116,7 @@ const char* CONFIGS[] = {
     "}"
 };
 
-/// @brief Base class representing leases and hints coveyed within IAs.
+/// @brief Base class representing leases and hints conveyed within IAs.
 ///
 /// This is a base class for @ref Reservation and @ref Hint classes.
 class IAResource {
@@ -353,7 +353,7 @@ public:
     /// number of reservations it checks that for the remaining IAs the
     /// leases from dynamic pools are assigned.
     ///
-    /// The strict_iaid_check flag controlls whether the test should verify
+    /// The strict_iaid_check flag controls whether the test should verify
     /// that the address or prefix specified as a hint is assigned by the
     /// server to the IA in which the hint was placed by the client.
     ///
@@ -412,7 +412,7 @@ public:
     /// "01:02:03:04".
     ///
     /// @param r1 Reservation 1. Default value is "unspecified" in which case
-    /// the reservation will not be included in the configruation.
+    /// the reservation will not be included in the configuration.
     /// @param r2 Reservation 2.
     /// @param r3 Reservation 3.
     /// @param r4 Reservation 4.
@@ -841,7 +841,7 @@ TEST_F(HostTest, sarrAndRebind) {
     EXPECT_EQ("alice", lease_server2->hostname_);
 }
 
-// This test verfies that the host reservation by DUID is found by the
+// This test verifies that the host reservation by DUID is found by the
 // server.
 TEST_F(HostTest, reservationByDUID) {
     Dhcp6Client client;
@@ -851,7 +851,7 @@ TEST_F(HostTest, reservationByDUID) {
     testReservationByIdentifier(client, 1, "2001:db8:1::2");
 }
 
-// This test verfies that the host reservation by HW address is found
+// This test verifies that the host reservation by HW address is found
 // by the server.
 TEST_F(HostTest, reservationByHWAddress) {
     Dhcp6Client client;
index 2d0cf660627da6372d88099267aee475d882caf3..596d81df5a644049f1a81ed0c01608c4d6296714 100644 (file)
@@ -589,8 +589,8 @@ AllocEngine::allocateUnreservedLeases6(ClientContext6& ctx) {
     if (pool) {
 
         /// @todo: We support only one hint for now
-        Lease6Ptr lease = LeaseMgrFactory::instance().getLease6(ctx.currentIA().type_,
-                                                                hint);
+        Lease6Ptr lease =
+            LeaseMgrFactory::instance().getLease6(ctx.currentIA().type_, hint);
         if (!lease) {
 
             // In-pool reservations: Check if this address is reserved for someone
index d318eac93124ce40cfcd1e6dd03a0b78666a1d36..d1ab300f1135aa71b9f4e6477cc5fb0dcb602805 100644 (file)
@@ -479,7 +479,7 @@ struct Lease6 : public Lease {
     /// @param fqdn_rev If true, reverse DNS update is performed for a lease.
     /// @param hostname FQDN of the client which gets the lease.
     /// @param hwaddr hardware address (MAC), may be NULL
-    /// @param prefixlen An address prefix length.
+    /// @param prefixlen An address prefix length (optional, defaults to 128)
     Lease6(Lease::Type type, const isc::asiolink::IOAddress& addr, DuidPtr duid,
            uint32_t iaid, uint32_t preferred, uint32_t valid, uint32_t t1,
            uint32_t t2, SubnetID subnet_id, const bool fqdn_fwd,