From: Andrei Pavel Date: Tue, 10 Jan 2017 07:59:53 +0000 (+0200) Subject: Added mysql_execute_script X-Git-Tag: trac5524_base~16^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4d6c5f5799e20c7e6e7fa3af653b01f795e6658;p=thirdparty%2Fkea.git Added mysql_execute_script Doxygen documentation other minor changes --- diff --git a/src/bin/admin/admin-utils.sh b/src/bin/admin/admin-utils.sh index 5c8be36f9b..ffb6a02e85 100755 --- a/src/bin/admin/admin-utils.sh +++ b/src/bin/admin/admin-utils.sh @@ -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 diff --git a/src/bin/d2/tests/d2_update_message_unittests.cc b/src/bin/d2/tests/d2_update_message_unittests.cc index e8955bbb53..bdfef9e1e3 100644 --- a/src/bin/d2/tests/d2_update_message_unittests.cc +++ b/src/bin/d2/tests/d2_update_message_unittests.cc @@ -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))); diff --git a/src/bin/d2/tests/dns_client_unittests.cc b/src/bin/d2/tests/dns_client_unittests.cc index 0e784b49f3..d9206a0f04 100644 --- a/src/bin/d2/tests/dns_client_unittests.cc +++ b/src/bin/d2/tests/dns_client_unittests.cc @@ -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. diff --git a/src/bin/dhcp4/dhcp4_messages.mes b/src/bin/dhcp4/dhcp4_messages.mes index 293fac72d3..61c9882196 100644 --- a/src/bin/dhcp4/dhcp4_messages.mes +++ b/src/bin/dhcp4/dhcp4_messages.mes @@ -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. diff --git a/src/bin/dhcp4/dhcp4_srv.h b/src/bin/dhcp4/dhcp4_srv.h index 013eaaed6f..6cf6643c17 100644 --- a/src/bin/dhcp4/dhcp4_srv.h +++ b/src/bin/dhcp4/dhcp4_srv.h @@ -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 diff --git a/src/bin/dhcp4/dhcp4to6_ipc.cc b/src/bin/dhcp4/dhcp4to6_ipc.cc index 573078cb3e..c8725b7ea5 100644 --- a/src/bin/dhcp4/dhcp4to6_ipc.cc +++ b/src/bin/dhcp4/dhcp4to6_ipc.cc @@ -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(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) diff --git a/src/bin/dhcp6/json_config_parser.cc b/src/bin/dhcp6/json_config_parser.cc index 995390f4cc..68701170e0 100644 --- a/src/bin/dhcp6/json_config_parser.cc +++ b/src/bin/dhcp6/json_config_parser.cc @@ -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_); diff --git a/src/lib/asiolink/io_address.h b/src/lib/asiolink/io_address.h index 6a08575173..1d9326a586 100644 --- a/src/lib/asiolink/io_address.h +++ b/src/lib/asiolink/io_address.h @@ -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 diff --git a/src/lib/cryptolink/tests/run_unittests.cc b/src/lib/cryptolink/tests/run_unittests.cc index 59c202c718..6c92b190ca 100644 --- a/src/lib/cryptolink/tests/run_unittests.cc +++ b/src/lib/cryptolink/tests/run_unittests.cc @@ -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 + #include #include -#include - int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); diff --git a/src/lib/dhcp/option6_pdexclude.cc b/src/lib/dhcp/option6_pdexclude.cc index d8b78d4a20..951b3f117f 100644 --- a/src/lib/dhcp/option6_pdexclude.cc +++ b/src/lib/dhcp/option6_pdexclude.cc @@ -7,7 +7,6 @@ #include #include -#include #include #include #include diff --git a/src/lib/dhcp/option_definition.cc b/src/lib/dhcp/option_definition.cc index aa2d949f2c..a651a3d247 100644 --- a/src/lib/dhcp/option_definition.cc +++ b/src/lib/dhcp/option_definition.cc @@ -5,6 +5,7 @@ // file, You can obtain one at http://mozilla.org/MPL/2.0/. #include + #include #include #include @@ -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); diff --git a/src/lib/dhcp/tests/option_definition_unittest.cc b/src/lib/dhcp/tests/option_definition_unittest.cc index fbb67a9a3e..03ce31f61d 100644 --- a/src/lib/dhcp/tests/option_definition_unittest.cc +++ b/src/lib/dhcp/tests/option_definition_unittest.cc @@ -37,7 +37,7 @@ namespace { /// it around for the future. class OptionDefinitionTest : public ::testing::Test { public: - // @brief Constructor. + /// @brief Constructor. OptionDefinitionTest() { } }; diff --git a/src/lib/dhcp_ddns/tests/ncr_udp_unittests.cc b/src/lib/dhcp_ddns/tests/ncr_udp_unittests.cc index b5f2c58379..eda0abcf21 100644 --- a/src/lib/dhcp_ddns/tests/ncr_udp_unittests.cc +++ b/src/lib/dhcp_ddns/tests/ncr_udp_unittests.cc @@ -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."; diff --git a/src/lib/dhcpsrv/alloc_engine.h b/src/lib/dhcpsrv/alloc_engine.h index c28775666c..c92ccfb8ff 100644 --- a/src/lib/dhcpsrv/alloc_engine.h +++ b/src/lib/dhcpsrv/alloc_engine.h @@ -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 AllocEnginePtr; -}; // namespace isc::dhcp -}; // namespace isc +} // namespace dhcp +} // namespace isc #endif // ALLOC_ENGINE_H diff --git a/src/lib/dhcpsrv/base_host_data_source.h b/src/lib/dhcpsrv/base_host_data_source.h index 2fbd1aec84..5decdb3c1e 100644 --- a/src/lib/dhcpsrv/base_host_data_source.h +++ b/src/lib/dhcpsrv/base_host_data_source.h @@ -7,11 +7,14 @@ #ifndef BASE_HOST_DATA_SOURCE_H #define BASE_HOST_DATA_SOURCE_H -#include #include #include #include + +#include #include +#include + #include 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 HostDataSourcePtr; -} -} +} // namespace dhcp +} // namespace isc #endif // BASE_HOST_DATA_SOURCE_H diff --git a/src/lib/dhcpsrv/dhcp4o6_ipc.cc b/src/lib/dhcpsrv/dhcp4o6_ipc.cc index 86dfafc378..ac58fd11a5 100644 --- a/src/lib/dhcpsrv/dhcp4o6_ipc.cc +++ b/src/lib/dhcpsrv/dhcp4o6_ipc.cc @@ -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) diff --git a/src/lib/dhcpsrv/host_mgr.h b/src/lib/dhcpsrv/host_mgr.h index f7483fe074..128b311f4b 100644 --- a/src/lib/dhcpsrv/host_mgr.h +++ b/src/lib/dhcpsrv/host_mgr.h @@ -284,7 +284,8 @@ private: static boost::scoped_ptr& getHostMgrPtr(); }; -} -} + +} // namespace dhcp +} // namespace isc #endif // HOST_MGR_H diff --git a/src/lib/dhcpsrv/parsers/dhcp_parsers.cc b/src/lib/dhcpsrv/parsers/dhcp_parsers.cc index 12f1590e18..f6aa0f7639 100644 --- a/src/lib/dhcpsrv/parsers/dhcp_parsers.cc +++ b/src/lib/dhcpsrv/parsers/dhcp_parsers.cc @@ -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); diff --git a/src/lib/dhcpsrv/pgsql_connection.h b/src/lib/dhcpsrv/pgsql_connection.h index b0d793b611..8e7fe884c8 100644 --- a/src/lib/dhcpsrv/pgsql_connection.h +++ b/src/lib/dhcpsrv/pgsql_connection.h @@ -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 , but including +/// This are defined by PostgreSQL in , 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 diff --git a/src/lib/dhcpsrv/subnet.h b/src/lib/dhcpsrv/subnet.h index 484905688e..f4c083bf75 100644 --- a/src/lib/dhcpsrv/subnet.h +++ b/src/lib/dhcpsrv/subnet.h @@ -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_; }; diff --git a/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.h b/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.h index f426787833..a5dd8ce365 100644 --- a/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.h +++ b/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.h @@ -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 diff --git a/src/lib/eval/eval_context.h b/src/lib/eval/eval_context.h index 5ced06cb1d..e0a938bfaf 100644 --- a/src/lib/eval/eval_context.h +++ b/src/lib/eval/eval_context.h @@ -149,7 +149,7 @@ public: return (option_universe_); } - private: +private: /// @brief Flag determining scanner debugging. bool trace_scanning_; diff --git a/src/lib/process/testutils/d_test_stubs.h b/src/lib/process/testutils/d_test_stubs.h index 83953d4103..99c68a3d89 100644 --- a/src/lib/process/testutils/d_test_stubs.h +++ b/src/lib/process/testutils/d_test_stubs.h @@ -181,7 +181,7 @@ public: return (""); } - // @brief Destructor + /// @brief Destructor virtual ~DStubProcess(); }; diff --git a/src/lib/stats/stats_mgr.h b/src/lib/stats/stats_mgr.h index 86ce9bd2ba..c5e5c7abc0 100644 --- a/src/lib/stats/stats_mgr.h +++ b/src/lib/stats/stats_mgr.h @@ -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