![]() |
Kea
1.5.0
|
Command Options. More...
#include <command_options.h>
Inheritance diagram for isc::perfdhcp::CommandOptions:Classes | |
| class | LeaseType |
| A class encapsulating the type of lease being requested from the server. More... | |
Public Types | |
| enum | ExchangeMode { DO_SA, DORA_SARR } |
| 2-way (cmd line param -i) or 4-way exchanges More... | |
| typedef std::vector< std::vector< uint8_t > > | MacAddrsVector |
| A vector holding MAC addresses. More... | |
Public Member Functions | |
| int | getAggressivity () const |
| Returns aggressivity value. More... | |
| std::vector< std::string > | getBase () const |
| Returns base values. More... | |
| uint32_t | getClientsNum () const |
| Returns number of simulated clients. More... | |
| std::string | getDiags () const |
| Returns diagnostic selectors. More... | |
| std::vector< double > | getDropTime () const |
| Returns drop time. More... | |
| std::vector< uint8_t > | getDuidTemplate () const |
| Returns DUID template. More... | |
| int | getElapsedTimeOffset () const |
| Returns template offset for elapsed time. More... | |
| ExchangeMode | getExchangeMode () const |
| Returns packet exchange mode. More... | |
| int | getExitWaitTime () const |
| Returns the time in microseconds to delay the program by. More... | |
| const isc::dhcp::OptionCollection & | getExtraOpts () const |
| Returns extra options to be inserted. More... | |
| uint8_t | getIpVersion () const |
| Returns IP version. More... | |
| LeaseType | getLeaseType () const |
| \ brief Returns the type of lease being requested. More... | |
| std::string | getLocalName () const |
| Returns local address or interface name. More... | |
| int | getLocalPort () const |
| Returns local port number. More... | |
| std::string | getMacListFile () const |
| Returns location of the file containing list of MAC addresses. More... | |
| const MacAddrsVector & | getMacsFromFile () const |
| Returns reference to a vector of MAC addresses read from a file. More... | |
| std::vector< uint8_t > | getMacTemplate () const |
| Returns MAC address template. More... | |
| std::vector< int > | getMaxDrop () const |
| Returns maximum drops number. More... | |
| std::vector< double > | getMaxDropPercentage () const |
| Returns maximal percentage of drops. More... | |
| std::vector< int > | getNumRequests () const |
| Returns maximum number of exchanges. More... | |
| int | getPeriod () const |
| Returns test period. More... | |
| int | getPreload () const |
| Returns number of preload exchanges. More... | |
| std::vector< int > | getRandomOffset () const |
| Returns template offsets for rnd. More... | |
| int | getRate () const |
| Returns exchange rate. More... | |
| int | getReleaseRate () const |
| Returns a rate at which DHCPv6 Release messages are sent. More... | |
| int | getRenewRate () const |
| Returns a rate at which DHCPv6 Renew messages are sent. More... | |
| int | getReportDelay () const |
| Returns delay between two performance reports. More... | |
| int | getRequestedIpOffset () const |
| Returns template offset for requested IP. More... | |
| uint32_t | getSeed () const |
| Returns random seed. More... | |
| int | getServerIdOffset () const |
| Returns template offset for server-ID. More... | |
| std::string | getServerName () const |
| Returns server name. More... | |
| std::vector< std::string > | getTemplateFiles () const |
| Returns template file names. More... | |
| std::vector< int > | getTransactionIdOffset () const |
| brief Returns template offsets for xid. More... | |
| std::string | getWrapped () const |
| Returns wrapped command. More... | |
| bool | isBroadcast () const |
| Checks if broadcast address is to be used. More... | |
| bool | isInterface () const |
| Checks if interface name was used. More... | |
| bool | isRapidCommit () const |
| Check if rapid commit option used. More... | |
| bool | isSeeded () const |
| Checks if seed provided. More... | |
| bool | isUseFirst () const |
| Check if server-ID to be taken from first package. More... | |
| bool | isUseRelayedV6 () const |
| Check if generated DHCPv6 messages should appear as relayed. More... | |
| bool | parse (int argc, char **const argv, bool print_cmd_line=false) |
| Parse command line. More... | |
| void | printCommandLine () const |
| Print command line arguments. More... | |
| void | reset () |
| Reset to defaults. More... | |
| void | usage () const |
| Print usage. More... | |
| void | version () const |
| Print program version. More... | |
Static Public Member Functions | |
| static CommandOptions & | instance () |
| CommandOptions is a singleton class. More... | |
Command Options.
This class is responsible for parsing the command-line and storing the specified options.
Definition at line 25 of file command_options.h.
| typedef std::vector<std::vector<uint8_t> > isc::perfdhcp::CommandOptions::MacAddrsVector |
A vector holding MAC addresses.
Definition at line 29 of file command_options.h.
2-way (cmd line param -i) or 4-way exchanges
| Enumerator | |
|---|---|
| DO_SA | |
| DORA_SARR | |
Definition at line 104 of file command_options.h.
|
inline |
Returns aggressivity value.
Definition at line 244 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::reset().
|
inline |
Returns base values.
Definition at line 187 of file command_options.h.
|
inline |
Returns number of simulated clients.
Definition at line 172 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::generateDuid(), isc::perfdhcp::TestControl::generateMacAddress(), and isc::perfdhcp::TestControl::run().
|
inline |
Returns diagnostic selectors.
Definition at line 334 of file command_options.h.
Referenced by main().
|
inline |
Returns drop time.
The method returns maximum time elapsed from sending the packet before it is assumed dropped.
Definition at line 205 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::initializeStatsMgr().
|
inline |
Returns DUID template.
Definition at line 182 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::generateDuid(), and isc::perfdhcp::TestControl::printDiagnostics().
|
inline |
Returns template offset for elapsed time.
Definition at line 319 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::getElapsedTimeOffset().
|
inline |
Returns packet exchange mode.
Definition at line 142 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::initializeStatsMgr(), isc::perfdhcp::TestControl::printRate(), isc::perfdhcp::TestControl::processReceivedPacket4(), and isc::perfdhcp::TestControl::processReceivedPacket6().
|
inline |
Returns the time in microseconds to delay the program by.
Definition at line 254 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::waitToExit().
|
inline |
Returns extra options to be inserted.
Definition at line 344 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::addExtraOpts().
|
inline |
Returns IP version.
Definition at line 137 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::checkExitConditions(), isc::perfdhcp::TestControl::checkLateMessages(), isc::perfdhcp::TestControl::getElapsedTimeOffset(), isc::perfdhcp::TestControl::getRandomOffset(), isc::perfdhcp::TestControl::getRcvdPacketsNum(), isc::perfdhcp::TestControl::getRequestedIpOffset(), isc::perfdhcp::TestControl::getSentPacketsNum(), isc::perfdhcp::TestControl::getServerIdOffset(), isc::perfdhcp::TestControl::getTransactionIdOffset(), isc::perfdhcp::TestControl::haveAllPacketsBeenReceived(), isc::perfdhcp::TestControl::initializeStatsMgr(), isc::perfdhcp::TestControl::openSocket(), isc::perfdhcp::TestControl::printIntermediateStats(), isc::perfdhcp::TestControl::printRate(), isc::perfdhcp::TestControl::printStats(), isc::perfdhcp::TestControl::printTemplates(), isc::perfdhcp::TestControl::registerOptionFactories(), isc::perfdhcp::TestControl::run(), and isc::perfdhcp::TestControl::sendPackets().
|
inline |
\ brief Returns the type of lease being requested.
Definition at line 147 of file command_options.h.
Referenced by printCommandLine().
|
inline |
Returns local address or interface name.
Definition at line 226 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::openSocket().
|
inline |
Returns local port number.
Definition at line 249 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::openSocket(), and printCommandLine().
|
inline |
Returns location of the file containing list of MAC addresses.
MAC addresses read from the file are used by the perfdhcp in message exchanges with the DHCP server.
Definition at line 297 of file command_options.h.
|
inline |
Returns reference to a vector of MAC addresses read from a file.
Every MAC address is represented as a vector.
Definition at line 304 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::generateDuid(), and isc::perfdhcp::TestControl::generateMacAddress().
|
inline |
Returns MAC address template.
Definition at line 177 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::generateMacAddress(), and isc::perfdhcp::TestControl::printDiagnostics().
|
inline |
Returns maximum drops number.
Returns maximum number of packet drops before aborting a test.
Definition at line 213 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::checkExitConditions().
|
inline |
Returns maximal percentage of drops.
Returns maximal percentage of packet drops before aborting a test.
Definition at line 221 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::checkExitConditions().
|
inline |
Returns maximum number of exchanges.
Definition at line 192 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::checkExitConditions(), and isc::perfdhcp::TestControl::haveAllPacketsBeenReceived().
|
inline |
Returns test period.
Definition at line 197 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::checkExitConditions().
|
inline |
Returns number of preload exchanges.
Definition at line 239 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::run().
|
inline |
Returns template offsets for rnd.
Definition at line 314 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::getRandomOffset().
|
inline |
Returns exchange rate.
Definition at line 152 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::printRate(), and isc::perfdhcp::TestControl::reset().
|
inline |
Returns a rate at which DHCPv6 Release messages are sent.
Definition at line 162 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::getCurrentTimeout(), isc::perfdhcp::TestControl::initializeStatsMgr(), printCommandLine(), isc::perfdhcp::TestControl::reset(), and isc::perfdhcp::TestControl::run().
|
inline |
Returns a rate at which DHCPv6 Renew messages are sent.
Definition at line 157 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::cleanCachedPackets(), isc::perfdhcp::TestControl::getCurrentTimeout(), isc::perfdhcp::TestControl::initializeStatsMgr(), printCommandLine(), isc::perfdhcp::TestControl::reset(), and isc::perfdhcp::TestControl::run().
|
inline |
Returns delay between two performance reports.
Definition at line 167 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::printIntermediateStats(), and isc::perfdhcp::TestControl::run().
|
inline |
Returns template offset for requested IP.
Definition at line 329 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::getRequestedIpOffset().
|
inline |
Returns random seed.
Definition at line 264 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::run().
|
inline |
Returns template offset for server-ID.
Definition at line 324 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::getServerIdOffset().
|
inline |
Returns server name.
Definition at line 349 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::openSocket().
|
inline |
Returns template file names.
Definition at line 289 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::initPacketTemplates().
|
inline |
brief Returns template offsets for xid.
Definition at line 309 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::getTransactionIdOffset().
|
inline |
Returns wrapped command.
Definition at line 339 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::run(), and isc::perfdhcp::TestControl::runWrapped().
|
static |
CommandOptions is a singleton class.
This method returns reference to its sole instance.
Definition at line 99 of file command_options.cc.
Referenced by isc::perfdhcp::TestControl::addExtraOpts(), isc::perfdhcp::TestControl::checkExitConditions(), isc::perfdhcp::TestControl::checkLateMessages(), isc::perfdhcp::TestControl::cleanCachedPackets(), isc::perfdhcp::TestControl::copyIaOptions(), isc::perfdhcp::TestControl::generateDuid(), isc::perfdhcp::TestControl::generateMacAddress(), isc::perfdhcp::TestControl::getCurrentTimeout(), isc::perfdhcp::TestControl::getElapsedTimeOffset(), isc::perfdhcp::TestControl::getRandomOffset(), isc::perfdhcp::TestControl::getRcvdPacketsNum(), isc::perfdhcp::TestControl::getRequestedIpOffset(), isc::perfdhcp::TestControl::getSentPacketsNum(), isc::perfdhcp::TestControl::getServerIdOffset(), isc::perfdhcp::TestControl::getTransactionIdOffset(), isc::perfdhcp::TestControl::initializeStatsMgr(), isc::perfdhcp::TestControl::initPacketTemplates(), main(), isc::perfdhcp::TestControl::openSocket(), isc::perfdhcp::TestControl::printDiagnostics(), isc::perfdhcp::TestControl::printIntermediateStats(), isc::perfdhcp::TestControl::printRate(), isc::perfdhcp::TestControl::printStats(), isc::perfdhcp::TestControl::printTemplate(), isc::perfdhcp::TestControl::printTemplates(), isc::perfdhcp::TestControl::processReceivedPacket4(), isc::perfdhcp::TestControl::processReceivedPacket6(), isc::perfdhcp::TestControl::receivePackets(), isc::perfdhcp::TestControl::registerOptionFactories(), isc::perfdhcp::TestControl::reset(), isc::perfdhcp::TestControl::run(), isc::perfdhcp::TestControl::runWrapped(), isc::perfdhcp::TestControl::sendPackets(), isc::perfdhcp::TestControl::sendRequest4(), isc::perfdhcp::TestControl::sendRequest6(), isc::perfdhcp::TestControl::sendSolicit6(), isc::perfdhcp::TestControl::setDefaults4(), isc::perfdhcp::TestControl::setDefaults6(), and isc::perfdhcp::TestControl::testDiags().
|
inline |
Checks if broadcast address is to be used.
Definition at line 269 of file command_options.h.
|
inline |
Checks if interface name was used.
The method checks if interface name was used rather than address.
Definition at line 234 of file command_options.h.
|
inline |
Check if rapid commit option used.
Definition at line 274 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::printRate().
|
inline |
Checks if seed provided.
Definition at line 259 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::run().
|
inline |
Check if server-ID to be taken from first package.
Definition at line 279 of file command_options.h.
|
inline |
Check if generated DHCPv6 messages should appear as relayed.
Definition at line 284 of file command_options.h.
| bool isc::perfdhcp::CommandOptions::parse | ( | int | argc, |
| char **const | argv, | ||
| bool | print_cmd_line = false |
||
| ) |
Parse command line.
Parses the command line and stores the selected options in class data members.
| argc | Argument count passed to main(). |
| argv | Argument value array passed to main(). |
| print_cmd_line | Print the command line being run to the console. |
| isc::InvalidParameter | if parse fails. |
Definition at line 161 of file command_options.cc.
References reset().
Referenced by main().
Here is the call graph for this function:| void isc::perfdhcp::CommandOptions::printCommandLine | ( | ) | const |
Print command line arguments.
Definition at line 920 of file command_options.cc.
References DO_SA, getLeaseType(), getLocalPort(), getReleaseRate(), getRenewRate(), and isc::perfdhcp::CommandOptions::LeaseType::toText().
Referenced by isc::perfdhcp::TestControl::printDiagnostics().
Here is the call graph for this function:| void isc::perfdhcp::CommandOptions::reset | ( | ) |
Reset to defaults.
Reset data members to default values. This is specifically useful when unit tests are performed using different command line options.
Definition at line 105 of file command_options.cc.
References isc::perfdhcp::CommandOptions::LeaseType::ADDRESS, DORA_SARR, and isc::perfdhcp::CommandOptions::LeaseType::set().
Referenced by parse().
Here is the call graph for this function:| void isc::perfdhcp::CommandOptions::usage | ( | ) | const |
Print usage.
Prints perfdhcp usage.
Definition at line 1022 of file command_options.cc.
Referenced by main().
| void isc::perfdhcp::CommandOptions::version | ( | ) | const |