]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
Added mysql_execute_script
authorAndrei Pavel <andrei.pavel@qualitance.com>
Tue, 10 Jan 2017 07:59:53 +0000 (09:59 +0200)
committerAndrei Pavel <andrei.pavel@qualitance.com>
Wed, 11 Jan 2017 12:50:47 +0000 (14:50 +0200)
Doxygen documentation
other minor changes

24 files changed:
src/bin/admin/admin-utils.sh
src/bin/d2/tests/d2_update_message_unittests.cc
src/bin/d2/tests/dns_client_unittests.cc
src/bin/dhcp4/dhcp4_messages.mes
src/bin/dhcp4/dhcp4_srv.h
src/bin/dhcp4/dhcp4to6_ipc.cc
src/bin/dhcp6/json_config_parser.cc
src/lib/asiolink/io_address.h
src/lib/cryptolink/tests/run_unittests.cc
src/lib/dhcp/option6_pdexclude.cc
src/lib/dhcp/option_definition.cc
src/lib/dhcp/tests/option_definition_unittest.cc
src/lib/dhcp_ddns/tests/ncr_udp_unittests.cc
src/lib/dhcpsrv/alloc_engine.h
src/lib/dhcpsrv/base_host_data_source.h
src/lib/dhcpsrv/dhcp4o6_ipc.cc
src/lib/dhcpsrv/host_mgr.h
src/lib/dhcpsrv/parsers/dhcp_parsers.cc
src/lib/dhcpsrv/pgsql_connection.h
src/lib/dhcpsrv/subnet.h
src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.h
src/lib/eval/eval_context.h
src/lib/process/testutils/d_test_stubs.h
src/lib/stats/stats_mgr.h

index 5c8be36f9bde8b8ec4bd5d6c7ac901f0910a1be8..ffb6a02e85efeaec0442e44745f46ca4cbe73cb1 100755 (executable)
@@ -22,8 +22,22 @@ mysql_execute() {
         mysql -N -B "$@" -e "${QUERY}"
         retcode=$?
     else
-        mysql -N -B --database=${db_name} --user=${db_user} --password=${db_password} -e "${QUERY}"
-        retcode="$?"
+        mysql -N -B --database="${db_name}" --user="${db_user}" --password="${db_password}" -e "${QUERY}"
+        retcode=$?
+    fi
+
+    return $retcode
+}
+
+mysql_execute_script() {
+    file=$1
+    shift
+    if [ $# -ge 1 ]; then
+        mysql -N -B "$@" < "${file}"
+        retcode=$?
+    else
+        mysql -N -B --database="${db_name}" --user="${db_user}" --password="${db_password}" < "${file}"
+        retcode=$?
     fi
 
     return $retcode
@@ -48,7 +62,7 @@ pgsql_execute() {
     QUERY=$1
     shift
     if [ $# -gt 0 ]; then
-        echo "${QUERY}" | psql --set ON_ERROR_STOP=1 -A -t -h localhost -q "#@"
+        echo "${QUERY}" | psql --set ON_ERROR_STOP=1 -A -t -h localhost -q "$@"
         retcode=$?
     else
         export PGPASSWORD=$db_password
index e8955bbb5372c414b584d7037eaba6960256d67e..bdfef9e1e3ea4de6511c114b87b3e04da95e722f 100644 (file)
@@ -25,21 +25,20 @@ using namespace isc::dns::rdata;
 using namespace isc::util;
 
 namespace {
-
-// @brief Test fixture class for testing D2UpdateMessage object.
+ /// @brief Test fixture class for testing D2UpdateMessage object.
 class D2UpdateMessageTest : public ::testing::Test {
 public:
-    // @brief Constructor.
+    /// @brief Constructor.
     //
     // Does nothing.
     D2UpdateMessageTest() { }
 
-    // @brief Destructor.
+    /// @brief Destructor.
     //
     // Does nothing.
     ~D2UpdateMessageTest() { };
 
-    // @brief Return string representation of the name encoded in wire format.
+    /// @brief Return string representation of the name encoded in wire format.
     //
     // This function reads the number of bytes specified in the second
     // argument from the buffer. It doesn't check if buffer has sufficient
@@ -282,7 +281,7 @@ TEST_F(D2UpdateMessageTest, fromWireInvalidOpcode) {
     };
     // The 'true' argument passed to the constructor turns the
     // message into the parse mode in which the fromWire function
-    // can be used to decode the binary mesasage data.
+    // can be used to decode the binary message data.
     D2UpdateMessage msg(D2UpdateMessage::INBOUND);
     // When using invalid Opcode, the fromWire function should
     // throw NotUpdateMessage exception.
@@ -306,7 +305,7 @@ TEST_F(D2UpdateMessageTest, fromWireInvalidQRFlag) {
     };
     // The 'true' argument passed to the constructor turns the
     // message into the parse mode in which the fromWire function
-    // can be used to decode the binary mesasage data.
+    // can be used to decode the binary message data.
     D2UpdateMessage msg(D2UpdateMessage::INBOUND);
     // When using invalid QR flag, the fromWire function should
     // throw InvalidQRFlag exception.
@@ -345,7 +344,7 @@ TEST_F(D2UpdateMessageTest, fromWireTooManyZones) {
 
     // The 'true' argument passed to the constructor turns the
     // message into the parse mode in which the fromWire function
-    // can be used to decode the binary mesasage data.
+    // can be used to decode the binary message data.
     D2UpdateMessage msg(D2UpdateMessage::INBOUND);
     // When parsing a message with more than one Zone record,
     // exception should be thrown.
@@ -366,7 +365,7 @@ TEST_F(D2UpdateMessageTest, toWire) {
     // one Zone. toWire function would fail if Zone is not set.
     msg.setZone(Name("example.com"), RRClass::IN());
 
-    // Set prerequisities.
+    // Set prerequisites.
 
     // 'Name Is Not In Use' prerequisite (RFC 2136, section 2.4.5)
     RRsetPtr prereq1(new RRset(Name("foo.example.com"), RRClass::NONE(),
@@ -433,7 +432,7 @@ TEST_F(D2UpdateMessageTest, toWire) {
     EXPECT_EQ(1, buf.readUint16());
 
     // PRCOUNT - holds the number of prerequisites. Earlier we have added
-    // two prerequisites. Thus, expect that this conter is 2.
+    // two prerequisites. Thus, expect that this counter is 2.
     EXPECT_EQ(2, buf.readUint16());
 
     // UPCOUNT - holds the number of RRs in the Update Section. We have
@@ -484,7 +483,7 @@ TEST_F(D2UpdateMessageTest, toWire) {
 
     // Check the name first. Message renderer is using compression for domain
     // names as described in RFC 1035, section 4.1.4. The name in this RR is
-    // foo.example.com. The name of the zone is example.com and it has occured
+    // foo.example.com. The name of the zone is example.com and it has occurred
     // in this message already at offset 12 (the size of the header is 12).
     // Therefore, name of this RR is encoded as 'foo', followed by a pointer
     // to offset in this message where the remainder of this name was used.
@@ -566,7 +565,7 @@ TEST_F(D2UpdateMessageTest, toWireInvalidQRFlag) {
 
     // The 'true' argument passed to the constructor turns the
     // message into the parse mode in which the fromWire function
-    // can be used to decode the binary mesasage data.
+    // can be used to decode the binary message data.
     D2UpdateMessage msg(D2UpdateMessage::INBOUND);
     ASSERT_NO_THROW(msg.fromWire(bin_msg, sizeof(bin_msg)));
 
index 0e784b49f33efef79b79f48d9aeee9b47b796691..d9206a0f0410d9824720a057df7954461f28955a 100644 (file)
@@ -36,8 +36,7 @@ const char* TEST_ADDRESS = "127.0.0.1";
 const uint16_t TEST_PORT = 5301;
 const size_t MAX_SIZE = 1024;
 const long TEST_TIMEOUT = 5 * 1000;
-
-// @brief Test Fixture class.
+/// @brief Test Fixture class.
 //
 // This test fixture class implements DNSClient::Callback so as it can be
 // installed as a completion callback for tests it implements. This callback
@@ -64,7 +63,7 @@ public:
     int received_;
     int expected_;
 
-    // @brief Constructor.
+    /// @brief Constructor.
     //
     // This constructor overrides the default logging level of asiodns logger to
     // prevent it from emitting debug messages from IOFetch class. Such an error
@@ -88,14 +87,14 @@ public:
                           TEST_TIMEOUT);
     }
 
-    // @brief Destructor.
+    /// @brief Destructor.
     //
     // Sets the asiodns logging level back to DEBUG.
     virtual ~DNSClientTest() {
         asiodns::logger.setSeverity(isc::log::DEBUG);
     };
 
-    // @brief Exchange completion callback.
+    /// @brief Exchange completion callback.
     //
     // This callback is called when the exchange with the DNS server is
     // complete or an error occurred. This includes the occurrence of a timeout.
@@ -133,7 +132,7 @@ public:
         }
     }
 
-    // @brief Handler invoked when test timeout is hit.
+    /// @brief Handler invoked when test timeout is hit.
     //
     // This callback stops all running (hanging) tasks on IO service.
     void testTimeoutHandler() {
@@ -141,7 +140,7 @@ public:
         FAIL() << "Test timeout hit.";
     }
 
-    // @brief Handler invoked when test request is received.
+    /// @brief Handler invoked when test request is received.
     //
     // This callback handler is installed when performing async read on a
     // socket to emulate reception of the DNS Update request by a server.
@@ -180,7 +179,7 @@ public:
                         *remote);
     }
 
-    // @brief Request handler for testing clients using TSIG
+    /// @brief Request handler for testing clients using TSIG
     //
     // This callback handler is installed when performing async read on a
     // socket to emulate reception of the DNS Update request with TSIG by a
@@ -219,7 +218,7 @@ public:
         dns::Message request(Message::PARSE);
         request.fromWire(received_data_buffer);
 
-        // If contex is not NULL, then we need to verify the message.
+        // If context is not NULL, then we need to verify the message.
         if (context) {
             TSIGError error = context->verify(request.getTSIGRecord(),
                                               receive_buffer_, receive_length);
@@ -502,7 +501,7 @@ TEST_F(DNSClientTest, runTSIGTest) {
     // Neither client nor server will attempt to sign or verify.
     runTSIGTest(nokey, nokey);
 
-    // Client signs the request, server verfies but doesn't sign.
+    // Client signs the request, server verifies but doesn't sign.
     runTSIGTest(key_one, nokey, false);
 
     // Client and server use the same key to sign and verify.
index 293fac72d329368a932fba9c936b0961ea31288e..61c98821967a4db94a95c4965f6a80a875bcea70 100644 (file)
@@ -201,6 +201,10 @@ a client's error or a server's purged database.
 % DHCP4_DHCP4O6_BAD_PACKET received malformed DHCPv4o6 packet: %1
 A malformed DHCPv4o6 packet was received.
 
+% DHCP4_DHCP4O6_PACKET_RECEIVED received DHCPv4o6 packet from DHCPv4 server (type %1) for %2 on interface %3
+This debug message is printed when the server is receiving a DHCPv4o6
+from the DHCPv4 server over inter-process communication.
+
 % DHCP4_DHCP4O6_PACKET_SEND %1: trying to send packet %2 (type %3) to %4 on interface %5 encapsulating %6: %7 (type %8)
 The arguments specify the client identification information (HW address
 and client identifier), DHCPv6 message name and type, source IPv6
@@ -219,7 +223,7 @@ the message.
 
 % DHCP4_DHCP4O6_RECEIVING receiving DHCPv4o6 packet from DHCPv6 server
 This debug message is printed when the server is receiving a DHCPv4o6
-from the DHCPv6 server over inter-process communication socket.
+from the DHCPv4 server over inter-process communication socket.
 
 % DHCP4_DHCP4O6_RESPONSE_DATA %1: responding with packet %2 (type %3), packet details: %4
 A debug message including the detailed data about the packet being
@@ -703,7 +707,3 @@ will drop its message if the received message was DHCPDISCOVER,
 and will send DHCPNAK if the received message was DHCPREQUEST.
 The argument includes the client and the transaction identification
 information.
-
-% DHCP6_DHCP4O6_PACKET_RECEIVED received DHCPv4o6 packet from DHCPv6 server (type %1) for %2 on interface %3
-This debug message is printed when the server is receiving a DHCPv4o6
-from the DHCPv6 server over inter-process communication.
index 013eaaed6f2b2c408f0484611f90372ceeadc478..6cf6643c17bedec8e6a526e4578c757554cb1a3c 100644 (file)
@@ -225,7 +225,7 @@ public:
     /// @brief returns Kea version on stdout and exit.
     /// redeclaration/redefinition. @ref Daemon::getVersion()
     static std::string getVersion(bool extended);
+
     /// @brief Main server processing loop.
     ///
     /// Main server processing loop. Call the processing step routine
index 573078cb3e58c36e347ae0c5ba59cac38217ffd0..c8725b7ea528973466c0e805fd0067d2d1a4b22e 100644 (file)
@@ -64,7 +64,7 @@ void Dhcp4to6Ipc::handler() {
 
         // from Dhcpv4Srv::run_one() after receivePacket()
         if (pkt) {
-            LOG_DEBUG(packet4_logger, DBG_DHCP4_BASIC, DHCP6_DHCP4O6_PACKET_RECEIVED)
+            LOG_DEBUG(packet4_logger, DBG_DHCP4_BASIC, DHCP4_DHCP4O6_PACKET_RECEIVED)
                 .arg(static_cast<int>(pkt->getType()))
                 .arg(pkt->getRemoteAddr().toText())
                 .arg(pkt->getIface());
@@ -90,7 +90,7 @@ void Dhcp4to6Ipc::handler() {
         return;
     }
 
-    // Get the DHCPv4 message 
+    // Get the DHCPv4 message
     OptionPtr msg = msgs.begin()->second;
     if (!msg) {
         LOG_DEBUG(packet4_logger, DBG_DHCP4_DETAIL, DHCP4_DHCP4O6_BAD_PACKET)
index 995390f4ccbc1675ec021fbf6d6c2bf0314065e8..68701170e00629040aaebd6b4e10d6f098d16470 100644 (file)
@@ -230,7 +230,7 @@ public:
         }
     }
 
-    // @brief Commits the constructed local pool to the pool storage.
+    /// @brief Commits the constructed local pool to the pool storage.
     virtual void commit() {
         // Add the local pool to the external storage ptr.
         pools_->push_back(pool_);
index 6a085751735f9ace0340dc2fd5edc19facad3dae..1d9326a586650a29ee0df18f312fe7269964fc7e 100644 (file)
@@ -136,7 +136,7 @@ public:
 
     /// \brief Creates an address from over wire data.
     ///
-    /// \param family AF_NET for IPv4 or AF_NET6 for IPv6.
+    /// \param family AF_INET for IPv4 or AF_INET6 for IPv6.
     /// \param data pointer to first char of data
     ///
     /// \return Created IOAddress object
index 59c202c718ea359e249cc6fc51b4049c2562b1db..6c92b190ca70a52682f1d0f1ab22954cf96918c4 100644 (file)
@@ -4,11 +4,11 @@
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+#include <gtest/gtest.h>
+
 #include <log/logger_support.h>
 #include <util/unittests/run_all.h>
 
-#include <gtest/gtest.h>
-
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
index d8b78d4a2039eb0ec01777eeab62fc90cf679d2f..951b3f117feb1467be522fe3b3c5ed114e4e4cf4 100644 (file)
@@ -7,7 +7,6 @@
 #include <config.h>
 
 #include <asiolink/io_address.h>
-#include <exceptions/exceptions.h>
 #include <dhcp/dhcp6.h>
 #include <dhcp/option6_pdexclude.h>
 #include <exceptions/exceptions.h>
index aa2d949f2cc4838117b474fbe8d7d42cdfc59d6e..a651a3d247cdc14dfc59dafd1186e36771e337bd 100644 (file)
@@ -5,6 +5,7 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
+
 #include <dhcp/dhcp4.h>
 #include <dhcp/dhcp6.h>
 #include <dhcp/option4_addrlst.h>
@@ -36,7 +37,6 @@ using namespace isc::util;
 namespace isc {
 namespace dhcp {
 
-
 OptionDefinition::OptionDefinition(const std::string& name,
                                  const uint16_t code,
                                  const std::string& type,
@@ -602,7 +602,6 @@ OptionDefinition::writeToBuffer(const std::string& value,
                           << " is not valid.");
             }
 
-
             // Write a prefix.
             OptionDataTypeUtil::writePrefix(PrefixLen(len), address, buf);
 
index fbb67a9a3e9950285efda9556ee10df8c60c140d..03ce31f61d066c5c8600fb6d832d6d63df422ef2 100644 (file)
@@ -37,7 +37,7 @@ namespace {
 /// it around for the future.
 class OptionDefinitionTest : public ::testing::Test {
 public:
-    // @brief Constructor.
+    /// @brief Constructor.
     OptionDefinitionTest() { }
 
 };
index b5f2c583796de317e4aec1dbf2b01a490aae25e6..eda0abcf2184d3ab370d418fd24d28eec64021bc 100644 (file)
@@ -217,9 +217,10 @@ public:
         result_ = result;
         received_ncr_ = ncr;
     }
-    // @brief Handler invoked when test timeout is hit.
-    //
-    // This callback stops all running (hanging) tasks on IO service.
+
+    /// @brief Handler invoked when test timeout is hit.
+    ///
+    /// This callback stops all running (hanging) tasks on IO service.
     void testTimeoutHandler() {
         io_service_.stop();
         FAIL() << "Test timeout hit.";
@@ -656,9 +657,9 @@ public:
         sent_ncrs_.push_back(ncr);
     }
 
-    // @brief Handler invoked when test timeout is hit.
-    //
-    // This callback stops all running (hanging) tasks on IO service.
+    /// @brief Handler invoked when test timeout is hit.
+    ///
+    /// This callback stops all running (hanging) tasks on IO service.
     void testTimeoutHandler() {
         io_service_.stop();
         FAIL() << "Test timeout hit.";
index c28775666cb3ad399b25dc0723da329be073a5ca..c92ccfb8ff161dac2d817f03ecd1023d24bf31fa 100644 (file)
@@ -1473,13 +1473,12 @@ private:
     /// @brief Number of consecutive DHCPv6 leases' reclamations after
     /// which there are still expired leases in the database.
     uint16_t incomplete_v6_reclamations_;
-
 };
 
 /// @brief A pointer to the @c AllocEngine object.
 typedef boost::shared_ptr<AllocEngine> AllocEnginePtr;
 
-}; // namespace isc::dhcp
-}; // namespace isc
+}  // namespace dhcp
+}  // namespace isc
 
 #endif // ALLOC_ENGINE_H
index 2fbd1aec847d9a7b01a27347475da43a5ce13d5b..5decdb3c1e4960b8e8fee3169cb84193a3d3eadf 100644 (file)
@@ -7,11 +7,14 @@
 #ifndef BASE_HOST_DATA_SOURCE_H
 #define BASE_HOST_DATA_SOURCE_H
 
-#include <asiolink/io_address.h>
 #include <dhcp/duid.h>
 #include <dhcp/hwaddr.h>
 #include <dhcpsrv/host.h>
+
+#include <asiolink/io_address.h>
 #include <exceptions/exceptions.h>
+#include <stdint.h>
+
 #include <boost/shared_ptr.hpp>
 
 namespace isc {
@@ -60,7 +63,7 @@ public:
     /// @brief Specifies the type of an identifier.
     ///
     /// This is currently used only by MySQL host data source for now, but
-    /// it is envisagad that it will be used by other host data sources
+    /// it is envisaged that it will be used by other host data sources
     /// in the future. Also, this list will grow over time. It is likely
     /// that we'll implement other identifiers in the future, e.g. remote-id.
     ///
@@ -95,8 +98,8 @@ public:
     /// @param duid client id or NULL if not available, e.g. DHCPv4 client case.
     ///
     /// @return Collection of const @c Host objects.
-    virtual ConstHostCollection
-    getAll(const HWAddrPtr& hwaddr, const DuidPtr& duid = DuidPtr()) const = 0;
+    virtual ConstHostCollection getAll(const HWAddrPtr& hwaddr,
+                                       const DuidPtr& duid = DuidPtr()) const = 0;
 
     /// @brief Return all hosts connected to any subnet for which reservations
     /// have been made using a specified identifier.
@@ -106,15 +109,14 @@ public:
     /// because a particular client may have reservations in multiple subnets.
     ///
     /// @param identifier_type Identifier type.
-    /// @param identifier_begin Pointer to a begining of a buffer containing
+    /// @param identifier_begin Pointer to a beginning of a buffer containing
     /// an identifier.
     /// @param identifier_len Identifier length.
     ///
     /// @return Collection of const @c Host objects.
-    virtual ConstHostCollection
-    getAll(const Host::IdentifierType& identifier_type,
-           const uint8_t* identifier_begin,
-           const size_t identifier_len) const = 0;
+    virtual ConstHostCollection getAll(const Host::IdentifierType& identifier_type,
+                                       const uint8_t* identifier_begin,
+                                       const size_t identifier_len) const = 0;
 
     /// @brief Returns a collection of hosts using the specified IPv4 address.
     ///
@@ -124,13 +126,12 @@ public:
     /// @param address IPv4 address for which the @c Host object is searched.
     ///
     /// @return Collection of const @c Host objects.
-    virtual ConstHostCollection
-    getAll4(const asiolink::IOAddress& address) const = 0;
+    virtual ConstHostCollection getAll4(const asiolink::IOAddress& address) const = 0;
 
     /// @brief Returns a host connected to the IPv4 subnet.
     ///
     /// Implementations of this method should guard against the case when
-    /// mutliple instances of the @c Host are present, e.g. when two
+    /// multiple instances of the @c Host are present, e.g. when two
     /// @c Host objects are found, one for the DUID, another one for the
     /// HW address. In such case, an implementation of this method
     /// should throw an exception.
@@ -141,26 +142,24 @@ public:
     /// @param duid client id or NULL if not available.
     ///
     /// @return Const @c Host object using a specified HW address or DUID.
-    virtual ConstHostPtr
-    get4(const SubnetID& subnet_id, const HWAddrPtr& hwaddr,
-         const DuidPtr& duid = DuidPtr()) const = 0;
+    virtual ConstHostPtr get4(const SubnetID& subnet_id, const HWAddrPtr& hwaddr,
+                              const DuidPtr& duid = DuidPtr()) const = 0;
 
 
     /// @brief Returns a host connected to the IPv4 subnet.
     ///
     /// @param subnet_id Subnet identifier.
     /// @param identifier_type Identifier type.
-    /// @param identifier_begin Pointer to a begining of a buffer containing
+    /// @param identifier_begin Pointer to a beginning of a buffer containing
     /// an identifier.
     /// @param identifier_len Identifier length.
     ///
     /// @return Const @c Host object for which reservation has been made using
     /// the specified identifier.
-    virtual ConstHostPtr
-    get4(const SubnetID& subnet_id,
-         const Host::IdentifierType& identifier_type,
-         const uint8_t* identifier_begin,
-         const size_t identifier_len) const = 0;
+    virtual ConstHostPtr get4(const SubnetID& subnet_id,
+                              const Host::IdentifierType& identifier_type,
+                              const uint8_t* identifier_begin,
+                              const size_t identifier_len) const = 0;
 
     /// @brief Returns a host connected to the IPv4 subnet and having
     /// a reservation for a specified IPv4 address.
@@ -178,14 +177,13 @@ public:
     /// @param address reserved IPv4 address.
     ///
     /// @return Const @c Host object using a specified IPv4 address.
-    virtual ConstHostPtr
-    get4(const SubnetID& subnet_id,
-         const asiolink::IOAddress& address) const = 0;
+    virtual ConstHostPtr get4(const SubnetID& subnet_id,
+                              const asiolink::IOAddress& address) const = 0;
 
     /// @brief Returns a host connected to the IPv6 subnet.
     ///
     /// Implementations of this method should guard against the case when
-    /// mutliple instances of the @c Host are present, e.g. when two
+    /// multiple instances of the @c Host are present, e.g. when two
     /// @c Host objects are found, one for the DUID, another one for the
     /// HW address. In such case, an implementation of this method
     /// should throw an exception.
@@ -196,25 +194,24 @@ public:
     /// @param duid DUID or NULL if not available.
     ///
     /// @return Const @c Host object using a specified HW address or DUID.
-    virtual ConstHostPtr
-    get6(const SubnetID& subnet_id, const DuidPtr& duid,
-         const HWAddrPtr& hwaddr = HWAddrPtr()) const = 0;
+    virtual ConstHostPtr get6(const SubnetID& subnet_id,
+                              const DuidPtr& duid,
+                              const HWAddrPtr& hwaddr = HWAddrPtr()) const = 0;
 
     /// @brief Returns a host connected to the IPv6 subnet.
     ///
     /// @param subnet_id Subnet identifier.
     /// @param identifier_type Identifier type.
-    /// @param identifier_begin Pointer to a begining of a buffer containing
+    /// @param identifier_begin Pointer to a beginning of a buffer containing
     /// an identifier.
     /// @param identifier_len Identifier length.
     ///
     /// @return Const @c Host object for which reservation has been made using
     /// the specified identifier.
-    virtual ConstHostPtr
-    get6(const SubnetID& subnet_id,
-         const Host::IdentifierType& identifier_type,
-         const uint8_t* identifier_begin,
-         const size_t identifier_len) const = 0;
+    virtual ConstHostPtr get6(const SubnetID& subnet_id,
+                              const Host::IdentifierType& identifier_type,
+                              const uint8_t* identifier_begin,
+                              const size_t identifier_len) const = 0;
 
     /// @brief Returns a host using the specified IPv6 prefix.
     ///
@@ -222,8 +219,8 @@ public:
     /// @param prefix_len IPv6 prefix length.
     ///
     /// @return Const @c Host object using a specified HW address or DUID.
-    virtual ConstHostPtr
-    get6(const asiolink::IOAddress& prefix, const uint8_t prefix_len) const = 0;
+    virtual ConstHostPtr get6(const asiolink::IOAddress& prefix,
+                              const uint8_t prefix_len) const = 0;
 
     /// @brief Returns a host connected to the IPv6 subnet and having
     /// a reservation for a specified IPv6 address or prefix.
@@ -270,7 +267,7 @@ public:
 /// @brief HostDataSource pointer
 typedef boost::shared_ptr<BaseHostDataSource> HostDataSourcePtr;
 
-}
-}
+}  // namespace dhcp
+}  // namespace isc
 
 #endif // BASE_HOST_DATA_SOURCE_H
index 86dfafc378dfb3eb61c83f6d4da6b4f947ad8f48..ac58fd11a520697981b0bac5a9a04ff8d5b57c27 100644 (file)
@@ -151,7 +151,7 @@ Pkt6Ptr Dhcp4o6IpcBase::receive() {
             option_vendor.reset();
         }
     }
-         
+
     // Vendor option must exist.
     if (!option_vendor) {
         LOG_WARN(dhcpsrv_logger, DHCPSRV_DHCP4O6_RECEIVED_BAD_PACKET)
index f7483fe07416c6a4ecde5cdc756b57abe40d12fd..128b311f4bea1a0eb88875a76dc492037db49119 100644 (file)
@@ -284,7 +284,8 @@ private:
     static boost::scoped_ptr<HostMgr>& getHostMgrPtr();
 
 };
-}
-}
+
+}  // namespace dhcp
+}  // namespace isc
 
 #endif // HOST_MGR_H
index 12f1590e188b424b4fb32db1445e585ecd11e242..f6aa0f7639069f3c2a19778a3db90206caa430fc 100644 (file)
@@ -1233,8 +1233,7 @@ SubnetConfigParser::build(ConstElementPtr subnet) {
 
 Subnet::HRMode
 SubnetConfigParser::hrModeFromText(const std::string& txt) {
-    if ( (txt.compare("disabled") == 0) ||
-         (txt.compare("off") == 0) )  {
+    if ( (txt.compare("disabled") == 0) || (txt.compare("off") == 0) )  {
         return (Subnet::HR_DISABLED);
     } else if (txt.compare("out-of-pool") == 0) {
         return (Subnet::HR_OUT_OF_POOL);
index b0d793b6111604e16ffe82633e32b8a77f49c55c..8e7fe884c896b48897d0d75fa1600a45a9876ee2 100644 (file)
@@ -23,7 +23,7 @@ namespace dhcp {
 // statement.
 const size_t PGSQL_MAX_PARAMETERS_IN_QUERY = 32;
 
-/// @brief  Defines a Postgresql SQL statement
+/// @brief Define a PostgreSQL statement
 ///
 /// Each statement is associated with an index, which is used to reference the
 /// associated prepared statement.
@@ -45,8 +45,9 @@ struct PgSqlTaggedStatement {
     const char* text;
 };
 
+/// @{
 /// @brief Constants for PostgreSQL data types
-/// This are defined by PostreSQL in <catalog/pg_type.h>, but including
+/// This are defined by PostgreSQL in <catalog/pg_type.h>, but including
 /// this file is extraordinarily convoluted, so we'll use these to fill-in.
 const size_t OID_NONE = 0;   // PostgreSQL infers proper type
 const size_t OID_BOOL = 16;
@@ -57,8 +58,7 @@ const size_t OID_INT4 = 23;  // 4 byte int
 const size_t OID_TEXT = 25;
 const size_t OID_VARCHAR = 1043;
 const size_t OID_TIMESTAMP = 1114;
-
-//@}
+/// @}
 
 /// @brief RAII wrapper for Posgtresql Result sets
 ///
@@ -289,7 +289,7 @@ private:
 /// that use instances of PgSqlConnection.
 class PgSqlConnection : public DatabaseConnection {
 public:
-    /// @brief Defines the PgSql error state for a duplicate key error
+    /// @brief Define the PgSql error state for a duplicate key error.
     static const char DUPLICATE_KEY[];
 
     /// @brief Constructor
index 484905688e05c8da9fe73d406ddd6474d63a33c0..f4c083bf755d9b1f8b6591401eb9c3513d7531ad 100644 (file)
@@ -299,16 +299,14 @@ public:
     ///
     /// @param client_classes list of all classes the client belongs to
     /// @return true if client can be supported, false otherwise
-    bool
-    clientSupported(const isc::dhcp::ClientClasses& client_classes) const;
+    bool clientSupported(const isc::dhcp::ClientClasses& client_classes) const;
 
     /// @brief adds class class_name to the list of supported classes
     ///
     /// Also see explanation note in @ref white_list_.
     ///
     /// @param class_name client class to be supported by this subnet
-    void
-    allowClientClass(const isc::dhcp::ClientClass& class_name);
+    void allowClientClass(const isc::dhcp::ClientClass& class_name);
 
     /// @brief Specifies what type of Host Reservations are supported.
     ///
@@ -318,8 +316,7 @@ public:
     /// performance reasons.
     ///
     /// @return whether in-pool host reservations are allowed.
-    HRMode
-    getHostReservationMode() const {
+    HRMode getHostReservationMode() const {
         return (host_reservation_mode_);
     }
 
@@ -496,8 +493,8 @@ protected:
     ///
     /// See @ref HRMode type for details.
     HRMode host_reservation_mode_;
-private:
 
+private:
     /// @brief Pointer to the option data configuration for this subnet.
     CfgOptionPtr cfg_option_;
 };
index f42678783328049ead23793e5a334a558b93847d..a5dd8ce365bb0efb7c49ca956e5d493b032b7719 100644 (file)
@@ -165,10 +165,10 @@ public:
     /// @brief Test lease retrieval using client id, HW address and subnet id.
     void testGetLease4ClientIdHWAddrSubnetId();
 
-    // @brief Get lease4 by hardware address (2)
-    //
-    // Check that the system can cope with getting a hardware address of
-    // any size.
+    /// @brief Get lease4 by hardware address (2)
+    ///
+    /// Check that the system can cope with getting a hardware address of
+    /// any size.
     void testGetLease4HWAddrSize();
 
     /// @brief Check GetLease4 methods - access by Hardware Address & Subnet ID
@@ -393,8 +393,8 @@ public:
     LeaseMgr* lmptr_;
 };
 
-}; // namespace test
-}; // namespace dhcp
-}; // namespace isc
+}  // namespace test
+}  // namespace dhcp
+}  // namespace isc
 
 #endif
index 5ced06cb1dd3671cdb4bbce77239b7291ead8a64..e0a938bfafe1e3252b671fab7d12039b6b51019c 100644 (file)
@@ -149,7 +149,7 @@ public:
         return (option_universe_);
     }
 
- private:
+private:
     /// @brief Flag determining scanner debugging.
     bool trace_scanning_;
 
index 83953d410332f1846e12f893207fa86c4852d3ab..99c68a3d893a89db9339c4427e5172b1f7489413 100644 (file)
@@ -181,7 +181,7 @@ public:
         return ("");
     }
 
-    // @brief Destructor
+    /// @brief Destructor
     virtual ~DStubProcess();
 };
 
index 86ce9bd2ba9c5daf806ca757484cb86f82065ea1..c5e5c7abc0bfd41b9e7c4f1085b1aab645610706 100644 (file)
@@ -327,7 +327,7 @@ class StatsMgr : public boost::noncopyable {
 
     /// @}
 
- private:
+private:
 
     /// @brief Private constructor.
     /// StatsMgr is a singleton. It should be accessed using @ref instance