 |
Kea
1.5.0
|
Go to the documentation of this file.
7 #ifndef COMMAND_OPTIONS_H
8 #define COMMAND_OPTIONS_H
10 #include <boost/noncopyable.hpp>
59 bool is(
const Type lease_type)
const;
81 void set(
const Type lease_type);
96 std::string
toText()
const;
132 bool parse(
int argc,
char**
const argv,
bool print_cmd_line =
false);
187 std::vector<std::string>
getBase()
const {
return base_; }
383 bool initialize(
int argc,
char** argv,
bool print_cmd_line);
388 void validate()
const;
398 inline void check(
bool condition,
const std::string& errmsg)
const;
404 int positiveInteger(
const std::string& errmsg)
const;
410 int nonNegativeInteger(
const std::string& errmsg)
const;
416 std::string nonEmptyString(
const std::string& errmsg)
const;
421 void initLeaseType();
429 void initClientsNum();
436 void initIsInterface();
453 void decodeBase(
const std::string& base);
464 void decodeMacBase(
const std::string& base);
475 void decodeDuid(
const std::string& base);
483 void generateDuidTemplate();
489 uint8_t convertHexString(
const std::string& hex_text)
const;
497 bool decodeMacString(
const std::string& line);
507 LeaseType lease_type_;
522 uint32_t clients_num_;
526 std::vector<uint8_t> mac_template_;
530 std::vector<uint8_t> duid_template_;
534 std::vector<std::string> base_;
540 std::vector<int> num_request_;
547 uint8_t drop_time_set_;
552 std::vector<double> drop_time_;
558 std::vector<int> max_drop_;
563 std::vector<double> max_pdrop_;
566 std::string localname_;
601 std::vector<std::string> template_file_;
608 std::string mac_list_file_;
611 std::vector<std::vector<uint8_t> > mac_list_;
617 std::vector<int> xid_offset_;
622 std::vector<int> rnd_offset_;
639 std::string wrapped_;
642 std::string server_name_;
645 uint8_t v6_relay_encapsulation_level_;
654 #endif // COMMAND_OPTIONS_H
bool is(const Type lease_type) const
Checks if lease type has the specified code.
void printCommandLine() const
Print command line arguments.
int getServerIdOffset() const
Returns template offset for server-ID.
static CommandOptions & instance()
CommandOptions is a singleton class.
void set(const Type lease_type)
Sets the lease type code.
ExchangeMode getExchangeMode() const
Returns packet exchange mode.
std::vector< std::vector< uint8_t > > MacAddrsVector
A vector holding MAC addresses.
void reset()
Reset to defaults.
std::vector< int > getRandomOffset() const
Returns template offsets for rnd.
bool isUseRelayedV6() const
Check if generated DHCPv6 messages should appear as relayed.
std::vector< std::string > getTemplateFiles() const
Returns template file names.
bool isInterface() const
Checks if interface name was used.
int getRequestedIpOffset() const
Returns template offset for requested IP.
int getRenewRate() const
Returns a rate at which DHCPv6 Renew messages are sent.
void fromCommandLine(const std::string &cmd_line_arg)
Sets the lease type from the command line argument.
std::vector< double > getMaxDropPercentage() const
Returns maximal percentage of drops.
std::multimap< unsigned int, OptionPtr > OptionCollection
A collection of DHCP (v4 or v6) options.
std::vector< std::string > getBase() const
Returns base values.
ExchangeMode
2-way (cmd line param -i) or 4-way exchanges
int getAggressivity() const
Returns aggressivity value.
void version() const
Print program version.
Defines the logger used by the top-level component of kea-dhcp-ddns.
bool parse(int argc, char **const argv, bool print_cmd_line=false)
Parse command line.
uint8_t getIpVersion() const
Returns IP version.
std::string getServerName() const
Returns server name.
int getPeriod() const
Returns test period.
std::string toText() const
Return textual representation of the lease type.
bool isBroadcast() const
Checks if broadcast address is to be used.
int getElapsedTimeOffset() const
Returns template offset for elapsed time.
std::vector< int > getTransactionIdOffset() const
brief Returns template offsets for xid.
std::vector< double > getDropTime() const
Returns drop time.
bool includes(const Type lease_type) const
Checks if lease type implies request for the address, prefix (or both) as specified by the function a...
LeaseType getLeaseType() const
\ brief Returns the type of lease being requested.
int getRate() const
Returns exchange rate.
const MacAddrsVector & getMacsFromFile() const
Returns reference to a vector of MAC addresses read from a file.
const isc::dhcp::OptionCollection & getExtraOpts() const
Returns extra options to be inserted.
bool isRapidCommit() const
Check if rapid commit option used.
uint32_t getSeed() const
Returns random seed.
bool isUseFirst() const
Check if server-ID to be taken from first package.
std::vector< int > getNumRequests() const
Returns maximum number of exchanges.
int getPreload() const
Returns number of preload exchanges.
int getReleaseRate() const
Returns a rate at which DHCPv6 Release messages are sent.
int getExitWaitTime() const
Returns the time in microseconds to delay the program by.
std::string getWrapped() const
Returns wrapped command.
uint32_t getClientsNum() const
Returns number of simulated clients.
std::vector< int > getMaxDrop() const
Returns maximum drops number.
std::vector< uint8_t > getDuidTemplate() const
Returns DUID template.
int getLocalPort() const
Returns local port number.
bool isSeeded() const
Checks if seed provided.
void usage() const
Print usage.
std::vector< uint8_t > getMacTemplate() const
Returns MAC address template.
int getReportDelay() const
Returns delay between two performance reports.
A class encapsulating the type of lease being requested from the server.
std::string getLocalName() const
Returns local address or interface name.
std::string getMacListFile() const
Returns location of the file containing list of MAC addresses.
std::string getDiags() const
Returns diagnostic selectors.