From bb4ce97e66f2dbaaea4ce02bae8f7126cff69286 Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Thu, 20 Feb 2020 08:31:58 +0200 Subject: [PATCH] [#1021] fixed doxygen --- src/bin/perfdhcp/command_options.h | 38 +++++++------- src/bin/perfdhcp/stats_mgr.h | 36 ++++++------- src/bin/perfdhcp/test_control.h | 83 ++++++++++++++++++++---------- 3 files changed, 92 insertions(+), 65 deletions(-) diff --git a/src/bin/perfdhcp/command_options.h b/src/bin/perfdhcp/command_options.h index 5bc4110177..93b4788def 100644 --- a/src/bin/perfdhcp/command_options.h +++ b/src/bin/perfdhcp/command_options.h @@ -119,7 +119,7 @@ public: DORA_SARR }; - /// \brief Reset to defaults + /// \brief Reset to defaults. /// /// Reset data members to default values. This is specifically /// useful when unit tests are performed using different @@ -195,7 +195,7 @@ public: /// \brief Returns address uniqueness value. /// - /// \return address uniqueness specified value + /// \return address uniqueness specified value. bool getAddrUnique() const { return addr_unique_; } /// \brief Returns maximum number of exchanges. @@ -208,7 +208,7 @@ public: /// \return test period before it is aborted. int getPeriod() const { return period_; } - /// \brief Returns drop time + /// \brief Returns drop time. /// /// The method returns maximum time elapsed from /// sending the packet before it is assumed dropped. @@ -352,7 +352,7 @@ public: /// @brief Returns extra options to be inserted. /// - /// @return container with options + /// @return container with options. const isc::dhcp::OptionCollection& getExtraOpts() const { return extra_opts_; } /// \brief Check if single-threaded mode is enabled. @@ -525,16 +525,16 @@ private: bool decodeMacString(const std::string& line); /// IP protocol version to be used, expected values are: - /// 4 for IPv4 and 6 for IPv6, default value 0 means "not set" + /// 4 for IPv4 and 6 for IPv6, default value 0 means "not set". uint8_t ipversion_; - /// Packet exchange mode (e.g. DORA/SARR) + /// Packet exchange mode (e.g. DORA/SARR). ExchangeMode exchange_mode_; /// Lease Type to be obtained: address only, IPv6 prefix only. LeaseType lease_type_; - /// Rate in exchange per second + /// Rate in exchange per second. unsigned int rate_; /// A rate at which DHCPv6 Renew messages are sent. @@ -543,7 +543,7 @@ private: /// A rate at which DHCPv6 Release messages are sent. unsigned int release_rate_; - /// Delay between generation of two consecutive performance reports + /// Delay between generation of two consecutive performance reports. int report_delay_; /// Number of simulated clients (aka randomization range). @@ -554,23 +554,23 @@ private: std::vector mac_template_; /// DUID template used to generate unique DUIDs for - /// simulated clients + /// simulated clients. std::vector duid_template_; - /// Check address uniqueness + /// Check address uniqueness. bool addr_unique_; /// Collection of base values specified with -b - /// options. Supported "bases" are mac= and duid= + /// options. Supported "bases" are mac= and duid=. std::vector base_; - /// Number of microseconds by which you should delay the exit + /// Number of microseconds by which you should delay the exit. int exit_wait_time_; /// Number of 2 or 4-way exchanges to perform. std::vector num_request_; - /// Test period in seconds + /// Test period in seconds. int period_; /// Indicates number of -d parameters specified by user. @@ -579,7 +579,7 @@ private: /// Time to elapse before request is lost. The first value of /// two-element vector refers to DO/SA exchanges, - /// second value refers to RA/RR. Default values are { 1, 1 } + /// second value refers to RA/RR. Default values are { 1, 1 }. std::vector drop_time_; /// Maximum number of drops request before aborting test. @@ -597,7 +597,7 @@ private: std::string localname_; /// Indicates that specified value with -l is - /// rather interface (not address) + /// rather interface (not address). bool is_interface_; /// Number of preload packets. Preload packets are used to @@ -605,10 +605,10 @@ private: /// measurements. int preload_; - /// Local port number (host endian) + /// Local port number (host endian). int local_port_; - /// Remote port number (host endian) + /// Remote port number (host endian). int remote_port_; /// Randomization seed. @@ -644,7 +644,7 @@ private: /// Offset of transaction id in template files. First vector /// element points to offset for DISCOVER/SOLICIT messages, /// second element points to transaction id offset for - /// REQUEST messages + /// REQUEST messages. std::vector xid_offset_; /// Random value offset in templates. Random value offset @@ -658,7 +658,7 @@ private: /// Offset of server id option in template packet. int sid_offset_; - /// Offset of requested ip data in template packet + /// Offset of requested ip data in template packet. int rip_offset_; /// String representing diagnostic selectors specified diff --git a/src/bin/perfdhcp/stats_mgr.h b/src/bin/perfdhcp/stats_mgr.h index f7ef8bbb1e..f3a93f3824 100644 --- a/src/bin/perfdhcp/stats_mgr.h +++ b/src/bin/perfdhcp/stats_mgr.h @@ -107,7 +107,7 @@ private: CustomCounter() { }; uint64_t counter_; ///< Counter's value. - std::string name_; ///< Counter's name. + std::string name_; ///< Counter's name. }; typedef typename boost::shared_ptr CustomCounterPtr; @@ -411,7 +411,7 @@ public: static_cast(unordered_lookups_)); } - /// \brief Return number of unordered sent packets lookups + /// \brief Return number of unordered sent packets lookups. /// /// Method returns number of unordered sent packet lookups. /// Unordered lookup is used when received packet was sent @@ -421,7 +421,7 @@ public: /// \return number of unordered lookups. uint64_t getUnorderedLookups() const { return(unordered_lookups_); } - /// \brief Return number of ordered sent packets lookups + /// \brief Return number of ordered sent packets lookups. /// /// Method returns number of ordered sent packet lookups. /// Ordered lookup is used when packets are received in the @@ -432,14 +432,14 @@ public: /// \return number of ordered lookups. uint64_t getOrderedLookups() const { return(ordered_lookups_); } - /// \brief Return total number of sent packets + /// \brief Return total number of sent packets. /// /// Method returns total number of sent packets. /// /// \return number of sent packets. uint64_t getSentPacketsNum() const { return(sent_packets_num_); } - /// \brief Return total number of received packets + /// \brief Return total number of received packets. /// /// Method returns total number of received packets. /// @@ -478,7 +478,7 @@ public: /// Method increases total number of rejected leases by one. void updateRejLeases() { ++rejected_leases_num_; } - /// \brief Increase number of non unique leases. + /// \brief Increase number of non unique addresses. /// /// Method increases total number of non unique addresses by one. void updateNonUniqueAddr() { ++non_unique_addr_num_; } @@ -659,7 +659,7 @@ typedef boost::shared_ptr ExchangeStatsPtr; /// Map containing all specified exchange types. typedef typename std::map ExchangesMap; -/// Iterator pointing to \ref ExchangesMap +/// Iterator pointing to \ref ExchangesMap. typedef typename ExchangesMap::const_iterator ExchangesMapIterator; @@ -908,7 +908,7 @@ public: return(xchg_stats->getAvgUnorderedLookupSetSize()); } - /// \brief Return number of unordered sent packets lookups + /// \brief Return number of unordered sent packets lookups. /// /// Method returns number of unordered sent packet lookups. /// Unordered lookup is used when received packet was sent @@ -923,7 +923,7 @@ public: return(xchg_stats->getUnorderedLookups()); } - /// \brief Return number of ordered sent packets lookups + /// \brief Return number of ordered sent packets lookups. /// /// Method returns number of ordered sent packet lookups. /// Ordered lookup is used when packets are received in the @@ -939,7 +939,7 @@ public: return(xchg_stats->getOrderedLookups()); } - /// \brief Return total number of sent packets + /// \brief Return total number of sent packets. /// /// Method returns total number of sent packets for specified /// exchange type. @@ -952,7 +952,7 @@ public: return(xchg_stats->getSentPacketsNum()); } - /// \brief Return total number of received packets + /// \brief Return total number of received packets. /// /// Method returns total number of received packets for specified /// exchange type. @@ -993,7 +993,7 @@ public: return(xchg_stats->getCollectedNum()); } - /// \brief Return total number of rejected leases + /// \brief Return total number of rejected leases. /// /// Method returns total number of rejected leases for specified /// exchange type. @@ -1006,7 +1006,7 @@ public: return(xchg_stats->getRejLeasesNum()); } - /// \brief Increase total number of rejected leases + /// \brief Increase total number of rejected leases. /// /// Method increases total number of rejected leases by one /// for specified exchange type @@ -1015,19 +1015,19 @@ public: xchg_stats->updateRejLeases(); } - /// \brief Increase total number of non unique addresses + /// \brief Increase total number of non unique addresses. /// /// Method increases total number of non unique addresses or - /// prefixes by one for specified exchange type + /// prefixes by one for specified exchange type. void updateNonUniqueAddrNum(const ExchangeType xchg_type) { ExchangeStatsPtr xchg_stats = getExchangeStats(xchg_type); xchg_stats->updateNonUniqueAddr(); } - /// \brief Return total number of non unique addresses + /// \brief Return total number of non unique addresses. /// /// Method returns total number of non unique addresses and/or - /// prefixes of specified exchange type. + /// prefixes for specified exchange type. /// /// \param xchg_type exchange type. /// \throw isc::BadValue if invalid exchange type specified. @@ -1166,7 +1166,7 @@ public: private: - /// \brief Return exchange stats object for given exchange type + /// \brief Return exchange stats object for given exchange type. /// /// Method returns exchange stats object for given exchange type. /// diff --git a/src/bin/perfdhcp/test_control.h b/src/bin/perfdhcp/test_control.h index 0a1fcfe072..8b3c181379 100644 --- a/src/bin/perfdhcp/test_control.h +++ b/src/bin/perfdhcp/test_control.h @@ -221,11 +221,16 @@ public: /// has been reached. void cleanCachedPackets(); + /// \brief Get interrupted flag. bool interrupted() const { return interrupted_; } + /// \brief Get stats manager. StatsMgr& getStatsMgr() { return stats_mgr_; }; + /// \brief Start receiver. void start() { receiver_.start(); } + + /// \brief Stop receiver. void stop() { receiver_.stop(); } /// \brief Run wrapped command. @@ -233,7 +238,10 @@ public: /// \param do_stop execute wrapped command with "stop" argument. void runWrapped(bool do_stop = false) const; + /// \brief Get received server id flag. bool serverIdReceived() const { return first_packet_serverid_.size() > 0; } + + /// \brief Get received server id. std::string getServerId() const { return vector2Hex(first_packet_serverid_); } /// \brief Send number of packets to initiate new exchanges. @@ -300,10 +308,12 @@ public: /// in packet templates and their contents. void printTemplates() const; + /// \brief Get set of unique replied addresses. std::set& getAllUniqueAddrReply() { return unique_reply_address_; } + /// \brief Get set of unique advertised addresses. std::set& getAllUniqueAddrAdvert() { return unique_address_; } @@ -553,29 +563,29 @@ protected: /// \return true if the message include correct IA, false otherwise. bool validateIA(const dhcp::Pkt6Ptr& pkt6); - /// \brief Process received v6 address uniqueness + /// \brief Process received v6 address uniqueness. /// - /// Generate list of addresses and check for uniqueness + /// Generate list of addresses and check for uniqueness. /// /// \param pkt6 object representing received DHCPv6 packet - /// \param ExhchangeType enum value + /// \param ExhchangeType enum value. void address6Uniqueness(const dhcp::Pkt6Ptr& pkt6, ExchangeType xchg_type); - /// \brief Process received v4 address uniqueness + /// \brief Process received v4 address uniqueness. /// - /// Generate list of addresses and check for uniqueness + /// Generate list of addresses and check for uniqueness. /// /// \param pkt4 object representing received DHCPv4 packet - /// \param ExchangeType enum value + /// \param ExchangeType enum value. void address4Uniqueness(const dhcp::Pkt4Ptr& pkt4, ExchangeType xchg_type); - /// \brief add unique address to already assigned list + /// \brief add unique address to already assigned list. /// /// Add address and/or prefix to unique set if it's not already there, /// otherwise increment the number of non unique addresses. /// /// \param std::set set of addresses that should be added to unique list - /// \param ExchangeType enum value + /// \param ExchangeType enum value. void addUniqeAddr(const std::set& current, ExchangeType xchg_type) { switch(xchg_type) { case ExchangeType::SA: { @@ -633,12 +643,12 @@ protected: } } - /// \brief remove unique address from list + /// \brief remove unique address from list. /// /// If address is released we should remove it from both /// advertised (offered) and assigned sets. /// - /// \param std::string holding value of unique address + /// \param std::string holding value of unique address. void removeUniqueAddr(const std::set& addr) { for (auto addr_it = addr.begin(); addr_it != addr.end(); ++addr_it) { @@ -666,7 +676,7 @@ protected: /// \throw isc::Unexpected if unexpected error occurred. void processReceivedPacket6(const dhcp::Pkt6Ptr& pkt6); - /// \brief Register option factory functions for DHCPv4 + /// \brief Register option factory functions for DHCPv4. /// /// Method registers option factory functions for DHCPv4. /// These functions are called to create instances of DHCPv4 @@ -675,7 +685,7 @@ protected: /// Use \ref registerOptionFactories instead. void registerOptionFactories4() const; - /// \brief Register option factory functions for DHCPv6 + /// \brief Register option factory functions for DHCPv6. /// /// Method registers option factory functions for DHCPv6. /// These functions are called to create instances of DHCPv6 @@ -906,7 +916,7 @@ protected: /// and that would create dependency between test_control.h and /// command_options.h. /// - /// @param pkt4 options will be added here + /// @param pkt4 options will be added here. void addExtraOpts(const dhcp::Pkt4Ptr& pkt4); /// @brief Inserts extra options specified by user. @@ -916,7 +926,7 @@ protected: /// and that would create dependency between test_control.h and /// command_options.h. /// - /// @param pkt6 options will be added here + /// @param pkt6 options will be added here. void addExtraOpts(const dhcp::Pkt6Ptr& pkt6); /// \brief Copies IA_NA or IA_PD option from one packet to another. @@ -1002,7 +1012,7 @@ protected: /// Function handles child signal by waiting for /// the process to complete. /// - /// \param sig signal (ignored) + /// \param sig signal (ignored). static void handleChild(int sig); /// \brief Handle interrupt signal. @@ -1010,7 +1020,7 @@ protected: /// Function sets flag indicating that program has been /// interrupted. /// - /// \param sig signal (ignored) + /// \param sig signal (ignored). static void handleInterrupt(int sig); /// \brief Print main diagnostics data. @@ -1018,7 +1028,7 @@ protected: /// Method prints main diagnostics data. void printDiagnostics() const; - /// \brief Print template information + /// \brief Print template information. /// /// \param packet_type packet type. void printTemplate(const uint8_t packet_type) const; @@ -1036,38 +1046,55 @@ protected: /// spaces or hexadecimal digits. void readPacketTemplate(const std::string& file_name); - /// Keep addresses and prefixes from advertise msg for uniqueness checks + /// \brief Keep addresses and prefixes from advertise msg for uniqueness checks. std::set unique_address_; - /// Keep addresses and prefixes from reply msg for uniqueness checks + /// \brief Keep addresses and prefixes from reply msg for uniqueness checks. std::set unique_reply_address_; + /// \brief Socket used for DHCP traffic. BasePerfSocket &socket_; + + /// \brief Receiver used to receive DHCP traffic. Receiver receiver_; - boost::posix_time::ptime last_report_; ///< Last intermediate report time. + /// \brief Last intermediate report time. + boost::posix_time::ptime last_report_; - StatsMgr stats_mgr_; ///< Statistics Manager. + /// \brief Statistics Manager. + StatsMgr stats_mgr_; - PacketStorage ack_storage_; ///< A storage for DHCPACK messages. - PacketStorage reply_storage_; ///< A storage for reply messages. + /// \brief Storage for DHCPACK messages. + PacketStorage ack_storage_; - NumberGeneratorPtr transid_gen_; ///< Transaction id generator. - NumberGeneratorPtr macaddr_gen_; ///< Numbers generator for MAC address. + /// \brief Storage for reply messages. + PacketStorage reply_storage_; - /// Buffer holding server id received in first packet + /// \brief Transaction id generator. + NumberGeneratorPtr transid_gen_; + + /// \brief Numbers generator for MAC address. + NumberGeneratorPtr macaddr_gen_; + + /// \brief Buffer holding server id received in first packet dhcp::OptionBuffer first_packet_serverid_; - /// Packet template buffers. + /// \brief Packet template buffers. TemplateBufferCollection template_buffers_; /// First packets send. They are used at the end of the test /// to print packet templates when diagnostics flag T is specified. + + /// \brief Template for v4. std::map template_packets_v4_; + + /// \brief Template for v6. std::map template_packets_v6_; - static bool interrupted_; ///< Is program interrupted. + /// \brief Program interrupted flag. + static bool interrupted_; + /// \brief Command options. CommandOptions& options_; };