Kea
1.9.9-git
|
Command Options. More...
#include <command_options.h>
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 | |
CommandOptions () | |
Default Constructor. More... | |
bool | checkMultiSubnet () |
Check if multi subnet mode is enabled. More... | |
bool | getAddrUnique () const |
Returns address uniqueness value. More... | |
std::vector< std::string > | getBase () const |
Returns base values. More... | |
int | getCleanReport () const |
Returns clean report mode. More... | |
std::string | getCleanReportSeparator () const |
Returns clean report separator. 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... | |
int | getIncreaseElapsedTime () const |
Returns increased elapsed time. 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... | |
std::string | getRandRelayAddr () |
Returns random relay address. More... | |
int | getRate () const |
Returns exchange rate. More... | |
std::vector< std::string > | getRelayAddrList () const |
Returns list of relay addresses. More... | |
std::string | getRelayAddrListFile () const |
Returns file location with set of relay addresses. More... | |
int | getReleaseRate () const |
Returns a rate at which DHCPv6 Release messages are sent. More... | |
int | getRemotePort () const |
Returns remote port number. 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... | |
Scenario | getScenario () const |
Returns selected scenario. 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... | |
int | getWaitForElapsedTime () const |
Returns time to wait for elapsed time increase. 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 | isSingleThreaded () const |
Check if single-threaded mode is enabled. 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... | |
bool | testDiags (const char diag) |
Find if diagnostic flag has been set. More... | |
void | usage () const |
Print usage. More... | |
void | version () const |
Print program version. More... | |
Command Options.
This class is responsible for parsing the command-line and storing the specified options.
Definition at line 30 of file command_options.h.
typedef std::vector<std::vector<uint8_t> > isc::perfdhcp::CommandOptions::MacAddrsVector |
A vector holding MAC addresses.
Definition at line 42 of file command_options.h.
2-way (cmd line param -i) or 4-way exchanges
Enumerator | |
---|---|
DO_SA | |
DORA_SARR |
Definition at line 117 of file command_options.h.
|
inline |
Default Constructor.
Private constructor as this is a singleton class. Use CommandOptions::instance() to get instance of it.
Definition at line 37 of file command_options.h.
References reset().
|
inline |
Check if multi subnet mode is enabled.
Definition at line 413 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::setDefaults4(), and isc::perfdhcp::TestControl::setDefaults6().
|
inline |
Returns address uniqueness value.
Definition at line 209 of file command_options.h.
|
inline |
Returns base values.
Definition at line 204 of file command_options.h.
|
inline |
Returns clean report mode.
Definition at line 179 of file command_options.h.
|
inline |
Returns clean report separator.
Definition at line 184 of file command_options.h.
|
inline |
Returns number of simulated clients.
Definition at line 189 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::TestControl().
|
inline |
Returns diagnostic selectors.
Definition at line 368 of file command_options.h.
Referenced by main(), and testDiags().
|
inline |
Returns drop time.
The method returns maximum time elapsed from sending the packet before it is assumed dropped.
Definition at line 239 of file command_options.h.
Referenced by isc::perfdhcp::StatsMgr::StatsMgr().
|
inline |
Returns DUID template.
Definition at line 199 of file command_options.h.
|
inline |
Returns template offset for elapsed time.
Definition at line 353 of file command_options.h.
|
inline |
Returns packet exchange mode.
Definition at line 149 of file command_options.h.
Referenced by isc::perfdhcp::StatsMgr::StatsMgr().
|
inline |
Returns the time in microseconds to delay the program by.
Definition at line 288 of file command_options.h.
|
inline |
Returns extra options to be inserted.
Definition at line 378 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::addExtraOpts().
|
inline |
Returns increased elapsed time.
Definition at line 231 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::sendDiscover4(), and isc::perfdhcp::TestControl::sendSolicit6().
|
inline |
Returns IP version.
Definition at line 144 of file command_options.h.
Referenced by isc::perfdhcp::AbstractScen::AbstractScen(), isc::perfdhcp::PerfSocket::openSocket(), isc::perfdhcp::StatsMgr::StatsMgr(), and isc::perfdhcp::TestControl::TestControl().
|
inline |
\ brief Returns the type of lease being requested.
Definition at line 154 of file command_options.h.
Referenced by printCommandLine(), and isc::perfdhcp::TestControl::sendSolicit6().
|
inline |
Returns local address or interface name.
Definition at line 260 of file command_options.h.
Referenced by isc::perfdhcp::PerfSocket::openSocket().
|
inline |
Returns local port number.
Definition at line 278 of file command_options.h.
Referenced by isc::perfdhcp::PerfSocket::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 331 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 338 of file command_options.h.
|
inline |
Returns MAC address template.
Definition at line 194 of file command_options.h.
|
inline |
Returns maximum drops number.
Returns maximum number of packet drops before aborting a test.
Definition at line 247 of file command_options.h.
|
inline |
Returns maximal percentage of drops.
Returns maximal percentage of packet drops before aborting a test.
Definition at line 255 of file command_options.h.
|
inline |
Returns maximum number of exchanges.
Definition at line 214 of file command_options.h.
|
inline |
Returns test period.
Definition at line 219 of file command_options.h.
|
inline |
Returns number of preload exchanges.
Definition at line 273 of file command_options.h.
|
inline |
Returns template offsets for rnd.
Definition at line 348 of file command_options.h.
|
inline |
Returns random relay address.
Definition at line 408 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::setDefaults4(), and isc::perfdhcp::TestControl::setDefaults6().
|
inline |
Returns exchange rate.
Definition at line 159 of file command_options.h.
Referenced by isc::perfdhcp::BasicScen::BasicScen().
|
inline |
Returns list of relay addresses.
Definition at line 403 of file command_options.h.
|
inline |
Returns file location with set of relay addresses.
Definition at line 398 of file command_options.h.
|
inline |
Returns a rate at which DHCPv6 Release messages are sent.
Definition at line 169 of file command_options.h.
Referenced by isc::perfdhcp::BasicScen::BasicScen(), printCommandLine(), and isc::perfdhcp::StatsMgr::StatsMgr().
|
inline |
Returns remote port number.
Definition at line 283 of file command_options.h.
Referenced by printCommandLine(), isc::perfdhcp::TestControl::setDefaults4(), and isc::perfdhcp::TestControl::setDefaults6().
|
inline |
Returns a rate at which DHCPv6 Renew messages are sent.
Definition at line 164 of file command_options.h.
Referenced by isc::perfdhcp::BasicScen::BasicScen(), printCommandLine(), and isc::perfdhcp::StatsMgr::StatsMgr().
|
inline |
Returns delay between two performance reports.
Definition at line 174 of file command_options.h.
|
inline |
Returns template offset for requested IP.
Definition at line 363 of file command_options.h.
|
inline |
Returns selected scenario.
Definition at line 388 of file command_options.h.
Referenced by main().
|
inline |
Returns random seed.
Definition at line 298 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::TestControl().
|
inline |
Returns template offset for server-ID.
Definition at line 358 of file command_options.h.
|
inline |
Returns server name.
Definition at line 393 of file command_options.h.
Referenced by isc::perfdhcp::PerfSocket::openSocket(), isc::perfdhcp::TestControl::setDefaults4(), and isc::perfdhcp::TestControl::setDefaults6().
|
inline |
Returns template file names.
Definition at line 323 of file command_options.h.
|
inline |
brief Returns template offsets for xid.
Definition at line 343 of file command_options.h.
|
inline |
Returns time to wait for elapsed time increase.
Definition at line 225 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::sendDiscover4(), and isc::perfdhcp::TestControl::sendSolicit6().
|
inline |
Returns wrapped command.
Definition at line 373 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::runWrapped().
|
inline |
Checks if broadcast address is to be used.
Definition at line 303 of file command_options.h.
Referenced by isc::perfdhcp::PerfSocket::openSocket().
|
inline |
Checks if interface name was used.
The method checks if interface name was used rather than address.
Definition at line 268 of file command_options.h.
Referenced by isc::perfdhcp::PerfSocket::openSocket().
|
inline |
Check if rapid commit option used.
Definition at line 308 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::sendSolicit6().
|
inline |
Checks if seed provided.
Definition at line 293 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::TestControl().
|
inline |
Check if single-threaded mode is enabled.
Definition at line 383 of file command_options.h.
|
inline |
Check if server-ID to be taken from first package.
Definition at line 313 of file command_options.h.
Referenced by isc::perfdhcp::TestControl::sendRequest4(), and isc::perfdhcp::TestControl::sendRequest6().
|
inline |
Check if generated DHCPv6 messages should appear as relayed.
Definition at line 318 of file command_options.h.
Referenced by isc::perfdhcp::PerfSocket::openSocket(), and isc::perfdhcp::TestControl::setDefaults6().
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 172 of file command_options.cc.
References reset().
Referenced by main().
void isc::perfdhcp::CommandOptions::printCommandLine | ( | ) | const |
Print command line arguments.
Definition at line 1060 of file command_options.cc.
References base_, DO_SA, getLeaseType(), getLocalPort(), getReleaseRate(), getRemotePort(), getRenewRate(), and isc::perfdhcp::CommandOptions::LeaseType::toText().
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 102 of file command_options.cc.
References isc::perfdhcp::CommandOptions::LeaseType::ADDRESS, isc::perfdhcp::BASIC, DORA_SARR, and isc::perfdhcp::CommandOptions::LeaseType::set().
Referenced by CommandOptions(), and parse().
|
inline |
Find if diagnostic flag has been set.
diag | diagnostic flag (a,e,i,s,r,t,T). |
Definition at line 419 of file command_options.h.
References getDiags().
Referenced by isc::perfdhcp::TestControl::saveFirstPacket(), isc::perfdhcp::TestControl::sendRequest6(), and isc::perfdhcp::StatsMgr::StatsMgr().
void isc::perfdhcp::CommandOptions::usage | ( | ) | const |
Print usage.
Prints perfdhcp usage.
Definition at line 1169 of file command_options.cc.
Referenced by main().
void isc::perfdhcp::CommandOptions::version | ( | ) | const |