]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2121] documentation and doxygen updates
authorRazvan Becheriu <razvan@isc.org>
Wed, 13 Oct 2021 12:59:37 +0000 (15:59 +0300)
committerRazvan Becheriu <razvan@isc.org>
Thu, 4 Nov 2021 09:56:00 +0000 (11:56 +0200)
src/hooks/dhcp/bootp/tests/bootp_unittests.cc
src/hooks/dhcp/run_script/tests/run_script_unittests.cc
src/lib/d2srv/tests/nc_trans_unittests.cc
src/lib/d2srv/testutils/nc_test_utils.cc
src/lib/d2srv/testutils/nc_test_utils.h

index 70327ea5212bce7f5e87b4f1b631929d22016e41..f792d4ee054d9cef53ccfed236b3385eee49d809 100644 (file)
@@ -45,7 +45,7 @@ public:
 
     /// @brief Fetches the callout manager instance.
     boost::shared_ptr<CalloutManager>getCalloutManager() {
-        return(co_manager_);
+        return (co_manager_);
     }
 
     /// @brief Tests buffer4_receive callout.
index fafffd6c1e3f962b78831ea60788adfcea1fe04b..46d9c8d277d3c05a2d36d0c791f8decce0fa560e 100644 (file)
@@ -817,7 +817,7 @@ public:
 
     /// @brief Fetches the callout manager instance.
     boost::shared_ptr<CalloutManager>getCalloutManager() {
-        return(co_manager_);
+        return (co_manager_);
     }
 
 private:
index 16e02dcffff6d8edd2eadb32240b1a1b881795ac..e461a2aacf9f4cedf02b6efccbcf27a0eb98ba4a 100644 (file)
@@ -44,6 +44,8 @@ public:
     // NameChangeStub events
     static const int SEND_UPDATE_EVT = NCT_DERIVED_EVENT_MIN + 2;
 
+    /// @brief Flag which specifies if the NameChangeStub's callback should be
+    /// used instead of the NameChangeTransaction's callback.
     bool use_stub_callback_;
 
     /// @brief Constructor
@@ -663,7 +665,7 @@ TEST_F(NameChangeTransactionTest, serverSelectionTest) {
 
     // The server selection process determines the current server,
     // instantiates a new DNSClient, and a DNS response message buffer.
-    //  We need to save the values before each selection, so we can verify
+    // We need to save the values before each selection, so we can verify
     // they are correct after each selection.
     DnsServerInfoPtr prev_server = name_change->getCurrentServer();
     DNSClientPtr prev_client = name_change->getDNSClient();
index abcbd0bd5b24ca05f5ab643aa72a998ee1adc583..39035352b3cace8e697bc6c61f89f7a419e369f5 100644 (file)
@@ -394,9 +394,9 @@ checkZone(const D2UpdateMessagePtr& request, const std::string& exp_zone_name) {
 
 void
 checkRR(dns::RRsetPtr rrset, const std::string& exp_name,
-              const dns::RRClass& exp_class, const dns::RRType& exp_type,
-              unsigned int exp_ttl, dhcp_ddns::NameChangeRequestPtr ncr,
-              bool has_rdata) {
+        const dns::RRClass& exp_class, const dns::RRType& exp_type,
+        unsigned int exp_ttl, dhcp_ddns::NameChangeRequestPtr ncr,
+        bool has_rdata) {
     // Verify the FQDN/DHCID RR fields.
     EXPECT_EQ(exp_name, rrset->getName().toText());
     EXPECT_EQ(exp_class.getCode(), rrset->getClass().getCode());
@@ -417,7 +417,7 @@ checkRR(dns::RRsetPtr rrset, const std::string& exp_name,
         (exp_type == dns::RRType::AAAA())) {
         // should have lease rdata
         EXPECT_EQ(ncr->getIpAddress(), rdata_it->getCurrent().toText());
-    } else if (exp_type == dns::RRType::PTR())  {
+    } else if (exp_type == dns::RRType::PTR()) {
         // should have PTR rdata
         EXPECT_EQ(ncr->getFqdn(), rdata_it->getCurrent().toText());
     } else if (exp_type == dns::RRType::DHCID()) {
@@ -447,19 +447,20 @@ getRRFromSection(const D2UpdateMessagePtr& request,
     return (*rrset_it);
 }
 
-dhcp_ddns::NameChangeRequestPtr makeNcrFromString(const std::string& ncr_str) {
+dhcp_ddns::NameChangeRequestPtr
+makeNcrFromString(const std::string& ncr_str) {
     return (dhcp_ddns::NameChangeRequest::fromJSON(ncr_str));
 }
 
-DdnsDomainPtr makeDomain(const std::string& zone_name,
-                         const std::string& key_name) {
+DdnsDomainPtr
+makeDomain(const std::string& zone_name, const std::string& key_name) {
     DnsServerInfoStoragePtr servers(new DnsServerInfoStorage());
     DdnsDomainPtr domain(new DdnsDomain(zone_name, servers, key_name));
     return (domain);
 }
 
-DdnsDomainPtr makeDomain(const std::string& zone_name,
-                         const TSIGKeyInfoPtr &tsig_key_info) {
+DdnsDomainPtr
+makeDomain(const std::string& zone_name, const TSIGKeyInfoPtr &tsig_key_info) {
     DdnsDomainPtr domain;
     DnsServerInfoStoragePtr servers(new DnsServerInfoStorage());
     std::string key_name;
@@ -470,9 +471,9 @@ DdnsDomainPtr makeDomain(const std::string& zone_name,
     return (domain);
 }
 
-TSIGKeyInfoPtr makeTSIGKeyInfo(const std::string& key_name,
-                           const std::string& secret,
-                           const std::string& algorithm) {
+TSIGKeyInfoPtr
+makeTSIGKeyInfo(const std::string& key_name, const std::string& secret,
+                const std::string& algorithm) {
     TSIGKeyInfoPtr key_info;
     if (!key_name.empty()) {
         if (!secret.empty()) {
@@ -493,20 +494,21 @@ TSIGKeyInfoPtr makeTSIGKeyInfo(const std::string& key_name,
     }
 
     return (key_info);
-
 }
 
-void addDomainServer(DdnsDomainPtr& domain, const std::string& name,
-                     const std::string& ip, const size_t port,
-                     const TSIGKeyInfoPtr &tsig_key_info) {
+void
+addDomainServer(DdnsDomainPtr& domain, const std::string& name,
+                const std::string& ip, const size_t port,
+                const TSIGKeyInfoPtr &tsig_key_info) {
     DnsServerInfoPtr server(new DnsServerInfo(name, asiolink::IOAddress(ip),
                                               port, true, tsig_key_info));
     domain->getServers()->push_back(server);
 }
 
-// Verifies that the contents of the given transaction's  DNS update request
+// Verifies that the contents of the given transaction's DNS update request
 // is correct for adding a forward DNS entry
-void checkAddFwdAddressRequest(NameChangeTransaction& tran) {
+void
+checkAddFwdAddressRequest(NameChangeTransaction& tran) {
     const D2UpdateMessagePtr& request = tran.getDnsUpdateRequest();
     ASSERT_TRUE(request);
 
@@ -555,9 +557,10 @@ void checkAddFwdAddressRequest(NameChangeTransaction& tran) {
     ASSERT_NO_THROW(request->toWire(renderer));
 }
 
-// Verifies that the contents of the given transaction's  DNS update request
+// Verifies that the contents of the given transaction's DNS update request
 // is correct for replacing a forward DNS entry
-void checkReplaceFwdAddressRequest(NameChangeTransaction& tran) {
+void
+checkReplaceFwdAddressRequest(NameChangeTransaction& tran) {
     const D2UpdateMessagePtr& request = tran.getDnsUpdateRequest();
     ASSERT_TRUE(request);
 
@@ -614,9 +617,10 @@ void checkReplaceFwdAddressRequest(NameChangeTransaction& tran) {
     ASSERT_NO_THROW(request->toWire(renderer));
 }
 
-// Verifies that the contents of the given transaction's  DNS update request
+// Verifies that the contents of the given transaction's DNS update request
 // is correct for replacing a reverse DNS entry
-void checkReplaceRevPtrsRequest(NameChangeTransaction& tran) {
+void
+checkReplaceRevPtrsRequest(NameChangeTransaction& tran) {
     const D2UpdateMessagePtr& request = tran.getDnsUpdateRequest();
     ASSERT_TRUE(request);
 
@@ -677,7 +681,8 @@ void checkReplaceRevPtrsRequest(NameChangeTransaction& tran) {
     ASSERT_NO_THROW(request->toWire(renderer));
 }
 
-void checkRemoveFwdAddressRequest(NameChangeTransaction& tran) {
+void
+checkRemoveFwdAddressRequest(NameChangeTransaction& tran) {
     const D2UpdateMessagePtr& request = tran.getDnsUpdateRequest();
     ASSERT_TRUE(request);
 
@@ -716,7 +721,8 @@ void checkRemoveFwdAddressRequest(NameChangeTransaction& tran) {
     ASSERT_NO_THROW(request->toWire(renderer));
 }
 
-void checkRemoveFwdRRsRequest(NameChangeTransaction& tran) {
+void
+checkRemoveFwdRRsRequest(NameChangeTransaction& tran) {
     const D2UpdateMessagePtr& request = tran.getDnsUpdateRequest();
     ASSERT_TRUE(request);
 
@@ -766,7 +772,8 @@ void checkRemoveFwdRRsRequest(NameChangeTransaction& tran) {
     ASSERT_NO_THROW(request->toWire(renderer));
 }
 
-void checkRemoveRevPtrsRequest(NameChangeTransaction& tran) {
+void
+checkRemoveRevPtrsRequest(NameChangeTransaction& tran) {
     const D2UpdateMessagePtr& request = tran.getDnsUpdateRequest();
     ASSERT_TRUE(request);
 
@@ -804,7 +811,8 @@ void checkRemoveRevPtrsRequest(NameChangeTransaction& tran) {
     ASSERT_NO_THROW(request->toWire(renderer));
 }
 
-std::string toHexText(const uint8_t* data, size_t len) {
+std::string
+toHexText(const uint8_t* data, size_t len) {
     std::ostringstream stream;
     stream << "Data length is: " << len << std::endl;
     for (int i = 0; i < len; ++i) {
@@ -819,10 +827,11 @@ std::string toHexText(const uint8_t* data, size_t len) {
     return (stream.str());
 }
 
-// Verifies that the contents of the given transaction's  DNS update request
+// Verifies that the contents of the given transaction's DNS update request
 // is correct for replacing a forward DNS entry when not using conflict
 // resolution.
-void checkSimpleReplaceFwdAddressRequest(NameChangeTransaction& tran) {
+void
+checkSimpleReplaceFwdAddressRequest(NameChangeTransaction& tran) {
     const D2UpdateMessagePtr& request = tran.getDnsUpdateRequest();
     ASSERT_TRUE(request);
 
@@ -883,7 +892,8 @@ void checkSimpleReplaceFwdAddressRequest(NameChangeTransaction& tran) {
     ASSERT_NO_THROW(request->toWire(renderer));
 }
 
-void checkSimpleRemoveFwdRRsRequest(NameChangeTransaction& tran) {
+void
+checkSimpleRemoveFwdRRsRequest(NameChangeTransaction& tran) {
     const D2UpdateMessagePtr& request = tran.getDnsUpdateRequest();
     ASSERT_TRUE(request);
 
@@ -921,10 +931,11 @@ void checkSimpleRemoveFwdRRsRequest(NameChangeTransaction& tran) {
     ASSERT_NO_THROW(request->toWire(renderer));
 }
 
-// Verifies that the contents of the given transaction's  DNS update request
+// Verifies that the contents of the given transaction's DNS update request
 // is correct for removing a reverse DNS entry when not using conflict
 // resolution.
-void checkSimpleRemoveRevPtrsRequest(NameChangeTransaction& tran) {
+void
+checkSimpleRemoveRevPtrsRequest(NameChangeTransaction& tran) {
     const D2UpdateMessagePtr& request = tran.getDnsUpdateRequest();
     ASSERT_TRUE(request);
 
@@ -961,8 +972,9 @@ void checkSimpleRemoveRevPtrsRequest(NameChangeTransaction& tran) {
 }
 
 // Verifies the current state and next event in a transaction
-void checkContext(NameChangeTransactionPtr trans, const int exp_state,
-                  const int exp_evt, const std::string& file, int line) {
+void
+checkContext(NameChangeTransactionPtr trans, const int exp_state,
+             const int exp_evt, const std::string& file, int line) {
     ASSERT_TRUE(trans);
     ASSERT_TRUE(exp_state == trans->getCurrState() && exp_evt == trans->getNextEvent())
             << "expected state: " << trans->getStateLabel(exp_state)
index e670a983822ca90f4fe1df0f0d94ef027bdf9e0a..73b6287624c1906c16f60c264ae2d286be58d75d 100644 (file)
@@ -35,33 +35,41 @@ typedef boost::shared_ptr<boost::asio::ip::udp::socket> SocketPtr;
 /// requests in a given manner.
 class FauxServer {
 public:
-    enum  ResponseMode {
+    /// @brief The types of response generated by the server.
+    enum ResponseMode {
         USE_RCODE,    // Generate a response with a given RCODE
         CORRUPT_RESP, // Generate a corrupt response
         INVALID_TSIG  // Generate a response with the wrong TSIG key
     };
 
-    // Reference to IOService to use for IO processing.
+    /// @brief Reference to IOService to use for IO processing.
     asiolink::IOService& io_service_;
-    // IP address at which to listen for requests.
+
+    /// @brief IP address at which to listen for requests.
     const asiolink::IOAddress& address_;
-    // Port on which to listen for requests.
+
+    /// @brief Port on which to listen for requests.
     size_t port_;
-    // Socket on which listening is done.
+
+    /// @brief Socket on which listening is done.
     SocketPtr server_socket_;
-    // Stores the end point of requesting client.
+
+    /// @brief Stores the end point of requesting client.
     boost::asio::ip::udp::endpoint remote_;
-    // Buffer in which received packets are stuffed.
+
+    /// @brief Buffer in which received packets are stuffed.
     uint8_t receive_buffer_[TEST_MSG_MAX];
-    // Flag which indicates if a receive has been initiated but
-    // not yet completed.
+
+    /// @brief Flag which indicates if a receive has been initiated but not yet
+    /// completed.
     bool receive_pending_;
-    // Indicates if server is in perpetual receive mode. If true once
-    // a receive has been completed, a new one will be automatically
-    // initiated.
+    /// @brief Flag which indicates if server is in perpetual receive mode.
+    /// If true once a receive has been completed, a new one will be
+    /// automatically initiated.
     bool perpetual_receive_;
-    // TSIG Key to use to verify requests and sign responses.  If its
-    // NULL TSIG is not used.
+
+    /// @brief TSIG Key to use to verify requests and sign responses. If it is
+    /// NULL TSIG is not used.
     D2TsigKeyPtr tsig_key_;
 
     /// @brief Constructor
@@ -138,10 +146,10 @@ public:
     asiolink::IntervalTimer timer_;
     int run_time_;
 
-    // Constructor
+    /// @brief Constructor
     TimedIO();
 
-    // Destructor
+    /// @brief Destructor
     virtual ~TimedIO();
 
     /// @brief IO Timer expiration handler
@@ -178,7 +186,7 @@ public:
     DdnsDomainPtr reverse_domain_;
     D2CfgMgrPtr cfg_mgr_;
 
-    /// #brief constants used to specify change directions for a transaction.
+    /// @brief constants used to specify change directions for a transaction.
     static const unsigned int FORWARD_CHG;      // Only forward change.
     static const unsigned int REVERSE_CHG;      // Only reverse change.
     static const unsigned int FWD_AND_REV_CHG;  // Both forward and reverse.
@@ -253,7 +261,6 @@ public:
     /// be used.
     void setupForIPv6Transaction(dhcp_ddns::NameChangeType change_type,
                                  int change_mask, const std::string& key_name);
-
 };
 
 
@@ -484,7 +491,6 @@ extern void checkContext(NameChangeTransactionPtr trans, const int exp_state,
 /// @brief Macro for calling checkContext() that supplies invocation location
 #define CHECK_CONTEXT(a,b,c) checkContext(a,b,c,__FILE__,__LINE__)
 
-
 } // namespace isc::d2
 } // namespace isc