2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 21:45:37 +00:00

[#1021] fixed doxygen

This commit is contained in:
Razvan Becheriu
2020-02-20 08:31:58 +02:00
parent 49ed63138b
commit bb4ce97e66
3 changed files with 92 additions and 65 deletions

View File

@@ -119,7 +119,7 @@ public:
DORA_SARR DORA_SARR
}; };
/// \brief Reset to defaults /// \brief Reset to defaults.
/// ///
/// Reset data members to default values. This is specifically /// Reset data members to default values. This is specifically
/// useful when unit tests are performed using different /// useful when unit tests are performed using different
@@ -195,7 +195,7 @@ public:
/// \brief Returns address uniqueness value. /// \brief Returns address uniqueness value.
/// ///
/// \return address uniqueness specified value /// \return address uniqueness specified value.
bool getAddrUnique() const { return addr_unique_; } bool getAddrUnique() const { return addr_unique_; }
/// \brief Returns maximum number of exchanges. /// \brief Returns maximum number of exchanges.
@@ -208,7 +208,7 @@ public:
/// \return test period before it is aborted. /// \return test period before it is aborted.
int getPeriod() const { return period_; } int getPeriod() const { return period_; }
/// \brief Returns drop time /// \brief Returns drop time.
/// ///
/// The method returns maximum time elapsed from /// The method returns maximum time elapsed from
/// sending the packet before it is assumed dropped. /// sending the packet before it is assumed dropped.
@@ -352,7 +352,7 @@ public:
/// @brief Returns extra options to be inserted. /// @brief Returns extra options to be inserted.
/// ///
/// @return container with options /// @return container with options.
const isc::dhcp::OptionCollection& getExtraOpts() const { return extra_opts_; } const isc::dhcp::OptionCollection& getExtraOpts() const { return extra_opts_; }
/// \brief Check if single-threaded mode is enabled. /// \brief Check if single-threaded mode is enabled.
@@ -525,16 +525,16 @@ private:
bool decodeMacString(const std::string& line); bool decodeMacString(const std::string& line);
/// IP protocol version to be used, expected values are: /// 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_; uint8_t ipversion_;
/// Packet exchange mode (e.g. DORA/SARR) /// Packet exchange mode (e.g. DORA/SARR).
ExchangeMode exchange_mode_; ExchangeMode exchange_mode_;
/// Lease Type to be obtained: address only, IPv6 prefix only. /// Lease Type to be obtained: address only, IPv6 prefix only.
LeaseType lease_type_; LeaseType lease_type_;
/// Rate in exchange per second /// Rate in exchange per second.
unsigned int rate_; unsigned int rate_;
/// A rate at which DHCPv6 Renew messages are sent. /// A rate at which DHCPv6 Renew messages are sent.
@@ -543,7 +543,7 @@ private:
/// A rate at which DHCPv6 Release messages are sent. /// A rate at which DHCPv6 Release messages are sent.
unsigned int release_rate_; unsigned int release_rate_;
/// Delay between generation of two consecutive performance reports /// Delay between generation of two consecutive performance reports.
int report_delay_; int report_delay_;
/// Number of simulated clients (aka randomization range). /// Number of simulated clients (aka randomization range).
@@ -554,23 +554,23 @@ private:
std::vector<uint8_t> mac_template_; std::vector<uint8_t> mac_template_;
/// DUID template used to generate unique DUIDs for /// DUID template used to generate unique DUIDs for
/// simulated clients /// simulated clients.
std::vector<uint8_t> duid_template_; std::vector<uint8_t> duid_template_;
/// Check address uniqueness /// Check address uniqueness.
bool addr_unique_; bool addr_unique_;
/// Collection of base values specified with -b<value> /// Collection of base values specified with -b<value>
/// options. Supported "bases" are mac=<mac> and duid=<duid> /// options. Supported "bases" are mac=<mac> and duid=<duid>.
std::vector<std::string> base_; std::vector<std::string> 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_; int exit_wait_time_;
/// Number of 2 or 4-way exchanges to perform. /// Number of 2 or 4-way exchanges to perform.
std::vector<int> num_request_; std::vector<int> num_request_;
/// Test period in seconds /// Test period in seconds.
int period_; int period_;
/// Indicates number of -d<value> parameters specified by user. /// Indicates number of -d<value> parameters specified by user.
@@ -579,7 +579,7 @@ private:
/// Time to elapse before request is lost. The first value of /// Time to elapse before request is lost. The first value of
/// two-element vector refers to DO/SA exchanges, /// 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<double> drop_time_; std::vector<double> drop_time_;
/// Maximum number of drops request before aborting test. /// Maximum number of drops request before aborting test.
@@ -597,7 +597,7 @@ private:
std::string localname_; std::string localname_;
/// Indicates that specified value with -l<value> is /// Indicates that specified value with -l<value> is
/// rather interface (not address) /// rather interface (not address).
bool is_interface_; bool is_interface_;
/// Number of preload packets. Preload packets are used to /// Number of preload packets. Preload packets are used to
@@ -605,10 +605,10 @@ private:
/// measurements. /// measurements.
int preload_; int preload_;
/// Local port number (host endian) /// Local port number (host endian).
int local_port_; int local_port_;
/// Remote port number (host endian) /// Remote port number (host endian).
int remote_port_; int remote_port_;
/// Randomization seed. /// Randomization seed.
@@ -644,7 +644,7 @@ private:
/// Offset of transaction id in template files. First vector /// Offset of transaction id in template files. First vector
/// element points to offset for DISCOVER/SOLICIT messages, /// element points to offset for DISCOVER/SOLICIT messages,
/// second element points to transaction id offset for /// second element points to transaction id offset for
/// REQUEST messages /// REQUEST messages.
std::vector<int> xid_offset_; std::vector<int> xid_offset_;
/// Random value offset in templates. Random value offset /// Random value offset in templates. Random value offset
@@ -658,7 +658,7 @@ private:
/// Offset of server id option in template packet. /// Offset of server id option in template packet.
int sid_offset_; int sid_offset_;
/// Offset of requested ip data in template packet /// Offset of requested ip data in template packet.
int rip_offset_; int rip_offset_;
/// String representing diagnostic selectors specified /// String representing diagnostic selectors specified

View File

@@ -411,7 +411,7 @@ public:
static_cast<double>(unordered_lookups_)); static_cast<double>(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. /// Method returns number of unordered sent packet lookups.
/// Unordered lookup is used when received packet was sent /// Unordered lookup is used when received packet was sent
@@ -421,7 +421,7 @@ public:
/// \return number of unordered lookups. /// \return number of unordered lookups.
uint64_t getUnorderedLookups() const { return(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. /// Method returns number of ordered sent packet lookups.
/// Ordered lookup is used when packets are received in the /// Ordered lookup is used when packets are received in the
@@ -432,14 +432,14 @@ public:
/// \return number of ordered lookups. /// \return number of ordered lookups.
uint64_t getOrderedLookups() const { return(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. /// Method returns total number of sent packets.
/// ///
/// \return number of sent packets. /// \return number of sent packets.
uint64_t getSentPacketsNum() const { return(sent_packets_num_); } 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. /// Method returns total number of received packets.
/// ///
@@ -478,7 +478,7 @@ public:
/// Method increases total number of rejected leases by one. /// Method increases total number of rejected leases by one.
void updateRejLeases() { ++rejected_leases_num_; } 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. /// Method increases total number of non unique addresses by one.
void updateNonUniqueAddr() { ++non_unique_addr_num_; } void updateNonUniqueAddr() { ++non_unique_addr_num_; }
@@ -659,7 +659,7 @@ typedef boost::shared_ptr<ExchangeStats> ExchangeStatsPtr;
/// Map containing all specified exchange types. /// Map containing all specified exchange types.
typedef typename std::map<ExchangeType, ExchangeStatsPtr> ExchangesMap; typedef typename std::map<ExchangeType, ExchangeStatsPtr> ExchangesMap;
/// Iterator pointing to \ref ExchangesMap /// Iterator pointing to \ref ExchangesMap.
typedef typename ExchangesMap::const_iterator ExchangesMapIterator; typedef typename ExchangesMap::const_iterator ExchangesMapIterator;
@@ -908,7 +908,7 @@ public:
return(xchg_stats->getAvgUnorderedLookupSetSize()); 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. /// Method returns number of unordered sent packet lookups.
/// Unordered lookup is used when received packet was sent /// Unordered lookup is used when received packet was sent
@@ -923,7 +923,7 @@ public:
return(xchg_stats->getUnorderedLookups()); 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. /// Method returns number of ordered sent packet lookups.
/// Ordered lookup is used when packets are received in the /// Ordered lookup is used when packets are received in the
@@ -939,7 +939,7 @@ public:
return(xchg_stats->getOrderedLookups()); 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 /// Method returns total number of sent packets for specified
/// exchange type. /// exchange type.
@@ -952,7 +952,7 @@ public:
return(xchg_stats->getSentPacketsNum()); 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 /// Method returns total number of received packets for specified
/// exchange type. /// exchange type.
@@ -993,7 +993,7 @@ public:
return(xchg_stats->getCollectedNum()); 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 /// Method returns total number of rejected leases for specified
/// exchange type. /// exchange type.
@@ -1006,7 +1006,7 @@ public:
return(xchg_stats->getRejLeasesNum()); 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 /// Method increases total number of rejected leases by one
/// for specified exchange type /// for specified exchange type
@@ -1015,19 +1015,19 @@ public:
xchg_stats->updateRejLeases(); 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 /// 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) { void updateNonUniqueAddrNum(const ExchangeType xchg_type) {
ExchangeStatsPtr xchg_stats = getExchangeStats(xchg_type); ExchangeStatsPtr xchg_stats = getExchangeStats(xchg_type);
xchg_stats->updateNonUniqueAddr(); 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 /// 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. /// \param xchg_type exchange type.
/// \throw isc::BadValue if invalid exchange type specified. /// \throw isc::BadValue if invalid exchange type specified.
@@ -1166,7 +1166,7 @@ public:
private: 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. /// Method returns exchange stats object for given exchange type.
/// ///

View File

@@ -221,11 +221,16 @@ public:
/// has been reached. /// has been reached.
void cleanCachedPackets(); void cleanCachedPackets();
/// \brief Get interrupted flag.
bool interrupted() const { return interrupted_; } bool interrupted() const { return interrupted_; }
/// \brief Get stats manager.
StatsMgr& getStatsMgr() { return stats_mgr_; }; StatsMgr& getStatsMgr() { return stats_mgr_; };
/// \brief Start receiver.
void start() { receiver_.start(); } void start() { receiver_.start(); }
/// \brief Stop receiver.
void stop() { receiver_.stop(); } void stop() { receiver_.stop(); }
/// \brief Run wrapped command. /// \brief Run wrapped command.
@@ -233,7 +238,10 @@ public:
/// \param do_stop execute wrapped command with "stop" argument. /// \param do_stop execute wrapped command with "stop" argument.
void runWrapped(bool do_stop = false) const; void runWrapped(bool do_stop = false) const;
/// \brief Get received server id flag.
bool serverIdReceived() const { return first_packet_serverid_.size() > 0; } bool serverIdReceived() const { return first_packet_serverid_.size() > 0; }
/// \brief Get received server id.
std::string getServerId() const { return vector2Hex(first_packet_serverid_); } std::string getServerId() const { return vector2Hex(first_packet_serverid_); }
/// \brief Send number of packets to initiate new exchanges. /// \brief Send number of packets to initiate new exchanges.
@@ -300,10 +308,12 @@ public:
/// in packet templates and their contents. /// in packet templates and their contents.
void printTemplates() const; void printTemplates() const;
/// \brief Get set of unique replied addresses.
std::set<std::string>& getAllUniqueAddrReply() { std::set<std::string>& getAllUniqueAddrReply() {
return unique_reply_address_; return unique_reply_address_;
} }
/// \brief Get set of unique advertised addresses.
std::set<std::string>& getAllUniqueAddrAdvert() { std::set<std::string>& getAllUniqueAddrAdvert() {
return unique_address_; return unique_address_;
} }
@@ -553,29 +563,29 @@ protected:
/// \return true if the message include correct IA, false otherwise. /// \return true if the message include correct IA, false otherwise.
bool validateIA(const dhcp::Pkt6Ptr& pkt6); 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 pkt6 object representing received DHCPv6 packet
/// \param ExhchangeType enum value /// \param ExhchangeType enum value.
void address6Uniqueness(const dhcp::Pkt6Ptr& pkt6, ExchangeType xchg_type); 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 pkt4 object representing received DHCPv4 packet
/// \param ExchangeType enum value /// \param ExchangeType enum value.
void address4Uniqueness(const dhcp::Pkt4Ptr& pkt4, ExchangeType xchg_type); 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, /// Add address and/or prefix to unique set if it's not already there,
/// otherwise increment the number of non unique addresses. /// otherwise increment the number of non unique addresses.
/// ///
/// \param std::set set of addresses that should be added to unique list /// \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<std::string>& current, ExchangeType xchg_type) { void addUniqeAddr(const std::set<std::string>& current, ExchangeType xchg_type) {
switch(xchg_type) { switch(xchg_type) {
case ExchangeType::SA: { 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 /// If address is released we should remove it from both
/// advertised (offered) and assigned sets. /// 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<std::string>& addr) { void removeUniqueAddr(const std::set<std::string>& addr) {
for (auto addr_it = addr.begin(); addr_it != addr.end(); ++addr_it) { for (auto addr_it = addr.begin(); addr_it != addr.end(); ++addr_it) {
@@ -666,7 +676,7 @@ protected:
/// \throw isc::Unexpected if unexpected error occurred. /// \throw isc::Unexpected if unexpected error occurred.
void processReceivedPacket6(const dhcp::Pkt6Ptr& pkt6); 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. /// Method registers option factory functions for DHCPv4.
/// These functions are called to create instances of DHCPv4 /// These functions are called to create instances of DHCPv4
@@ -675,7 +685,7 @@ protected:
/// Use \ref registerOptionFactories instead. /// Use \ref registerOptionFactories instead.
void registerOptionFactories4() const; void registerOptionFactories4() const;
/// \brief Register option factory functions for DHCPv6 /// \brief Register option factory functions for DHCPv6.
/// ///
/// Method registers option factory functions for DHCPv6. /// Method registers option factory functions for DHCPv6.
/// These functions are called to create instances of 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 /// and that would create dependency between test_control.h and
/// command_options.h. /// command_options.h.
/// ///
/// @param pkt4 options will be added here /// @param pkt4 options will be added here.
void addExtraOpts(const dhcp::Pkt4Ptr& pkt4); void addExtraOpts(const dhcp::Pkt4Ptr& pkt4);
/// @brief Inserts extra options specified by user. /// @brief Inserts extra options specified by user.
@@ -916,7 +926,7 @@ protected:
/// and that would create dependency between test_control.h and /// and that would create dependency between test_control.h and
/// command_options.h. /// command_options.h.
/// ///
/// @param pkt6 options will be added here /// @param pkt6 options will be added here.
void addExtraOpts(const dhcp::Pkt6Ptr& pkt6); void addExtraOpts(const dhcp::Pkt6Ptr& pkt6);
/// \brief Copies IA_NA or IA_PD option from one packet to another. /// \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 /// Function handles child signal by waiting for
/// the process to complete. /// the process to complete.
/// ///
/// \param sig signal (ignored) /// \param sig signal (ignored).
static void handleChild(int sig); static void handleChild(int sig);
/// \brief Handle interrupt signal. /// \brief Handle interrupt signal.
@@ -1010,7 +1020,7 @@ protected:
/// Function sets flag indicating that program has been /// Function sets flag indicating that program has been
/// interrupted. /// interrupted.
/// ///
/// \param sig signal (ignored) /// \param sig signal (ignored).
static void handleInterrupt(int sig); static void handleInterrupt(int sig);
/// \brief Print main diagnostics data. /// \brief Print main diagnostics data.
@@ -1018,7 +1028,7 @@ protected:
/// Method prints main diagnostics data. /// Method prints main diagnostics data.
void printDiagnostics() const; void printDiagnostics() const;
/// \brief Print template information /// \brief Print template information.
/// ///
/// \param packet_type packet type. /// \param packet_type packet type.
void printTemplate(const uint8_t packet_type) const; void printTemplate(const uint8_t packet_type) const;
@@ -1036,38 +1046,55 @@ protected:
/// spaces or hexadecimal digits. /// spaces or hexadecimal digits.
void readPacketTemplate(const std::string& file_name); 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<std::string> unique_address_; std::set<std::string> 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<std::string> unique_reply_address_; std::set<std::string> unique_reply_address_;
/// \brief Socket used for DHCP traffic.
BasePerfSocket &socket_; BasePerfSocket &socket_;
/// \brief Receiver used to receive DHCP traffic.
Receiver receiver_; 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<dhcp::Pkt4> ack_storage_; ///< A storage for DHCPACK messages. /// \brief Storage for DHCPACK messages.
PacketStorage<dhcp::Pkt6> reply_storage_; ///< A storage for reply messages. PacketStorage<dhcp::Pkt4> ack_storage_;
NumberGeneratorPtr transid_gen_; ///< Transaction id generator. /// \brief Storage for reply messages.
NumberGeneratorPtr macaddr_gen_; ///< Numbers generator for MAC address. PacketStorage<dhcp::Pkt6> 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_; dhcp::OptionBuffer first_packet_serverid_;
/// Packet template buffers. /// \brief Packet template buffers.
TemplateBufferCollection template_buffers_; TemplateBufferCollection template_buffers_;
/// First packets send. They are used at the end of the test /// First packets send. They are used at the end of the test
/// to print packet templates when diagnostics flag T is specified. /// to print packet templates when diagnostics flag T is specified.
/// \brief Template for v4.
std::map<uint8_t, dhcp::Pkt4Ptr> template_packets_v4_; std::map<uint8_t, dhcp::Pkt4Ptr> template_packets_v4_;
/// \brief Template for v6.
std::map<uint8_t, dhcp::Pkt6Ptr> template_packets_v6_; std::map<uint8_t, dhcp::Pkt6Ptr> template_packets_v6_;
static bool interrupted_; ///< Is program interrupted. /// \brief Program interrupted flag.
static bool interrupted_;
/// \brief Command options.
CommandOptions& options_; CommandOptions& options_;
}; };