]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5110] Minor corrections during review.
authorTomek Mrugalski <tomasz@isc.org>
Wed, 8 Feb 2017 15:00:01 +0000 (16:00 +0100)
committerTomek Mrugalski <tomasz@isc.org>
Wed, 8 Feb 2017 15:00:01 +0000 (16:00 +0100)
13 files changed:
src/bin/d2/d2_cfg_mgr.cc
src/bin/d2/d2_cfg_mgr.h
src/bin/d2/d2_config.h
src/bin/d2/d2_controller.cc
src/bin/d2/d2_controller.h
src/bin/d2/d2_parser.yy
src/bin/d2/d2_simple_parser.cc
src/bin/d2/tests/d2_cfg_mgr_unittests.cc
src/bin/d2/tests/d2_controller_unittests.cc
src/bin/d2/tests/d2_process_unittests.cc
src/bin/d2/tests/d2_simple_parser_unittest.cc
src/bin/d2/tests/parser_unittest.h
src/bin/d2/tests/testdata/d2_cfg_tests.json

index 22d331eded4651aa7a12ef876ecb2ed7ded433de..a7e49a3df563cc09595998275210adc5dfe0e89a 100644 (file)
@@ -284,7 +284,7 @@ D2CfgMgr::parseElement(const std::string& element_id,
                       << element_id << element->getPosition());
         }
     } catch (const D2CfgError& ex) {
-        // Should already have a specific error and postion info
+        // Should already have a specific error and position info
         throw ex;
     } catch (const std::exception& ex) {
         isc_throw(D2CfgError, "element: " << element_id << " : "  << ex.what()
index a557161fe17a2ec18afe115eb4286d4a8f7d825b..004dd450044f5db79531c9a6afb834736eabde50 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2017 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
@@ -83,7 +83,7 @@ public:
         return (keys_);
     }
 
-    /// @brief Sets the mapy of TSIG keys
+    /// @brief Sets the map of TSIG keys
     ///
     /// @param pointer to the new TSIG key map
     void setKeys(const TSIGKeyInfoMapPtr& keys) {
index e2a6b2d0902f31c35de64c0a610e54355251b7a2..c8a6d79bb9a0fc74241d48bef5bbb7abd0de01d1 100644 (file)
@@ -729,19 +729,13 @@ private:
 /// @brief Defines a pointer for DScalarContext instances.
 typedef boost::shared_ptr<DScalarContext> DScalarContextPtr;
 
-/// @brief Parser for  TSIGKeyInfo
+/// @brief Parser for TSIGKeyInfo
 ///
 /// This class parses the configuration element "tsig-key" defined in
 /// src/bin/d2/dhcp-ddns.spec and creates an instance of a TSIGKeyInfo.
 class TSIGKeyInfoParser : public  data::SimpleParser { 
 public:
-    /// @brief Constructor
-    TSIGKeyInfoParser(){};    
-    
-    /// @brief Destructor
-    virtual ~TSIGKeyInfoParser(){};
-
-    /// @brief Performs the actual parsing of the given  "tsig-key" element.
+    /// @brief Performs the actual parsing of the given "tsig-key" element.
     ///
     /// Parses a configuration for the elements needed to instantiate a
     /// TSIGKeyInfo, validates those entries, creates a TSIGKeyInfo instance
@@ -751,7 +745,6 @@ public:
     /// @return pointer to the new TSIGKeyInfo instance
     TSIGKeyInfoPtr parse(data::ConstElementPtr key_config);
 
-private:
 };
 
 /// @brief Parser for a list of TSIGKeyInfos
@@ -761,15 +754,9 @@ private:
 /// to the given storage upon commit.
 class TSIGKeyInfoListParser : public data::SimpleParser {
 public:
-    /// @brief Constructor
-    TSIGKeyInfoListParser(){};
-
-    /// @brief Destructor
-    virtual ~TSIGKeyInfoListParser(){};
-
     /// @brief Performs the parsing of the given list "tsig-key" elements.
     ///
-    /// Creates an emtpy TSIGKeyInfoMap
+    /// Creates an empty TSIGKeyInfoMap
     ///
     /// It iterates over each key entry in the list:
     ///   1. Instantiate a TSIGKeyInfoParser for the entry
@@ -788,12 +775,6 @@ public:
 /// src/bin/d2/dhcp-ddns.spec and creates an instance of a DnsServerInfo.
 class DnsServerInfoParser : public  data::SimpleParser {
 public:
-    /// @brief Constructor
-    DnsServerInfoParser(){};
-
-    /// @brief Destructor
-    virtual ~DnsServerInfoParser(){};
-
     /// @brief Performs the actual parsing of the given  "dns-server" element.
     ///
     /// Parses a configuration for the elements needed to instantiate a
@@ -818,12 +799,6 @@ public:
 /// to the given storage upon commit.
 class DnsServerInfoListParser : public data::SimpleParser{
 public:
-    /// @brief Constructor
-    DnsServerInfoListParser(){};
-
-    /// @brief Destructor
-    virtual ~DnsServerInfoListParser(){};
-
     /// @brief Performs the actual parsing of the given list "dns-server"
     /// elements.
     ///
@@ -844,12 +819,6 @@ public:
 /// src/bin/d2/dhcp-ddns.spec and creates an instance of a DdnsDomain.
 class DdnsDomainParser : public data::SimpleParser {
 public:
-    /// @brief Constructor
-    DdnsDomainParser(){};
-
-    /// @brief Destructor
-    virtual ~DdnsDomainParser(){};
-
     /// @brief Performs the actual parsing of the given  "ddns-domain" element.
     ///
     /// Parses a configuration for the elements needed to instantiate a
@@ -869,13 +838,6 @@ public:
 /// (see src/bin/d2/dhcp-ddns.spec) into a map of DdnsDomains.  
 class DdnsDomainListParser : public data::SimpleParser {
 public:
-
-    /// @brief Constructor
-    DdnsDomainListParser(){};
-
-    /// @brief Destructor
-    virtual ~DdnsDomainListParser(){};
-
     /// @brief Performs the actual parsing of the given list "ddns-domain"
     /// elements.
     /// Creates a new DdnsDomain map
@@ -899,12 +861,6 @@ public:
 /// given DdnsDomainListMgr with parsed information.  
 class DdnsDomainListMgrParser : public data::SimpleParser {
 public:
-    /// @brief Constructor
-    DdnsDomainListMgrParser(){};
-
-    /// @brief Destructor
-    virtual ~DdnsDomainListMgrParser(){};
-
     /// @brief Performs the actual parsing of the given manager element.
     ///
     /// Parses a configuration for the elements needed to instantiate a
index 9e12c808d565413a98e5d9247f0511318fe26f95..9b601223d27b25cb32951ed0c38e25c30a11723c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2017 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
index 4bb81ab7de56b583dba51c5fb87e14e0e38ce734..be00bde52f147ef6182a5f52f412a57d3b77b197 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2017 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
@@ -55,12 +55,13 @@ private:
 
     ///@brief Parse a given file into Elements
     ///
-    /// Uses bison parsing to parse a JSON configruation file into an
+    /// Uses bison parsing to parse a JSON configuration file into an
     /// a element map.
     ///
     /// @param file_name pathname of the file to parse
     ///
     /// @return pointer to the map of elements created
+    /// @throw BadValue if the file is empty
     virtual isc::data::ConstElementPtr parseFile(const std::string& file_name);
 
     /// @brief Constructor is declared private to maintain the integrity of
index d5e85faee71cb69e64c586a7fbb376783abf1e96..facfce7b26439577aaad4a60602e8154b6576b5b 100644 (file)
@@ -248,20 +248,21 @@ sub_dhcpddns: LCURLY_BRACKET {
 };
 
 dhcpddns_params: dhcpddns_param
-                | dhcpddns_params COMMA dhcpddns_param
-                ;
-// These are teh top-level parameters allowed for DhcpDdns
-dhcpddns_param: ip_address
-               | port
-               | dns_server_timeout
-               | ncr_protocol
-               | ncr_format
-               | forward_ddns
-               | reverse_ddns
-               | tsig_keys
-               | unknown_map_entry
+               | dhcpddns_params COMMA dhcpddns_param
                ;
 
+// These are the top-level parameters allowed for DhcpDdns
+dhcpddns_param: ip_address
+              | port
+              | dns_server_timeout
+              | ncr_protocol
+              | ncr_format
+              | forward_ddns
+              | reverse_ddns
+              | tsig_keys
+              | unknown_map_entry
+              ;
+
 ip_address: IP_ADDRESS {
     ctx.enter(ctx.NO_KEYWORD);
 } COLON STRING {
index 09ce3d27bd519ca32384ede95260ba6b9120e8b7..69ae6ed0df7e53c97cd24342cd4d44bfb8c01e66 100644 (file)
@@ -8,7 +8,6 @@
 #include <d2/d2_simple_parser.h>
 #include <cc/data.h>
 #include <boost/foreach.hpp>
-#include <boost/lexical_cast.hpp>
 
 using namespace isc::data;
 
index 921c56bcdfb624cadf7aa05e005489d9fdf8aaa9..b90e381efc038ba5c70a1e05e79b28bb19d0a6d3 100644 (file)
@@ -142,7 +142,7 @@ public:
                              << "\njson: [" << json << " ]";
             }
 
-            // JSON parsed ok, so the defaults to the element tree it produced.
+            // JSON parsed ok, so add the defaults to the element tree it produced.
             D2SimpleParser::setAllDefaults(elem);
             config_set_ = elem;
         } catch (const std::exception& ex) {
@@ -150,7 +150,7 @@ public:
             if (exp_error.empty()) {
                 // We did not expect an error, so fail.
                 return ::testing::AssertionFailure()
-                          << "Unexpected sytnax error:" << ex.what()
+                          << "Unexpected syntax error:" << ex.what()
                           << "\njson: [" << json << " ]";
             }
 
index 6795e71f29d3f8f3038781e9c6f87793f2405ebc..4e5fcc4f037393ed36a38b0c020f00e75372882f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2017 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
index c6b134115694d4a923a162e84dc82ec751026b47..8ab84bf240cd514b6edb8592cfe330e00fc8d18e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2017 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
index 25f34bc0dc47a33bf8ec784776441768e58f561a..868147f44064fdc31c5c54dcc3eba222983e09bc 100644 (file)
@@ -97,7 +97,7 @@ bool checkKey(TSIGKeyInfoPtr key, const std::string& name,
 /// DnsServerInfo against the given set of values.
 ///
 /// It is structured in such a way that each value is checked, and output
-/// is generate for all that do not match.
+/// is generated for all that do not match.
 ///
 /// @param server is a pointer to the server to check against.
 /// @param hostname is the value to compare against server's hostname_.
@@ -592,6 +592,7 @@ public:
 /// 2. Algorithm cannot be blank.
 /// 3. Secret cannot be blank.
 TEST_F(TSIGKeyInfoParserTest, invalidEntry) {
+
     // Name cannot be blank.
     std::string config = "{"
                          " \"name\": \"\" , "
index 8db80ad173d045a6947d395a477d362df511c8ee..15ef2a4d9d8cfd3a2cd2487e81064e19e4560939 100644 (file)
@@ -10,7 +10,6 @@
 #include <gtest/gtest.h>
 #include <cc/data.h>
 #include <d2/parser_context.h>
-#include <testutils/io_utils.h>
 
 using namespace isc::data;
 using namespace std;
index 9b65489a6667f426e4f41022de03c8cb5c95a4c7..6250ba91a4048d564255eeb23c32190aad8cd7b9 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2014-2015,2017 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