Kea 2.7.5
|
A class encapsulating the type of lease being requested from the server. More...
#include <command_options.h>
Public Types | |
enum | Type { ADDRESS , PREFIX , ADDRESS_AND_PREFIX } |
The lease type code. More... | |
Public Member Functions | |
LeaseType () | |
LeaseType (const Type lease_type) | |
Constructor from lease type code. | |
void | fromCommandLine (const std::string &cmd_line_arg) |
Sets the lease type from the command line argument. | |
bool | includes (const Type lease_type) const |
Checks if lease type implies request for the address, prefix (or both) as specified by the function argument. | |
bool | is (const Type lease_type) const |
Checks if lease type has the specified code. | |
void | set (const Type lease_type) |
Sets the lease type code. | |
std::string | toText () const |
Return textual representation of the lease type. | |
A class encapsulating the type of lease being requested from the server.
This class comprises convenience functions to convert the lease type to the textual format and to match the appropriate lease type with the value of the -e<lease-type> parameter specified from the command line.
Definition at line 53 of file command_options.h.
The lease type code.
Enumerator | |
---|---|
ADDRESS | |
PREFIX | |
ADDRESS_AND_PREFIX |
Definition at line 57 of file command_options.h.
isc::perfdhcp::CommandOptions::LeaseType::LeaseType | ( | ) |
Definition at line 42 of file command_options.cc.
isc::perfdhcp::CommandOptions::LeaseType::LeaseType | ( | const Type | lease_type | ) |
Constructor from lease type code.
lease_type | A lease type code. |
Definition at line 46 of file command_options.cc.
void isc::perfdhcp::CommandOptions::LeaseType::fromCommandLine | ( | const std::string & | cmd_line_arg | ) |
Sets the lease type from the command line argument.
cmd_line_arg | An argument specified in the command line as -e<lease-type>:
|
isc::InvalidParameter | if the specified argument is invalid. |
Definition at line 66 of file command_options.cc.
References isc_throw.
bool isc::perfdhcp::CommandOptions::LeaseType::includes | ( | const Type | lease_type | ) | const |
Checks if lease type implies request for the address, prefix (or both) as specified by the function argument.
This is a convenience function to check that, for the lease type specified from the command line, the address or prefix (IA_NA or IA_PD) option should be sent to the server. For example, if user specified '-e address-and-prefix' in the command line this function will return true for both ADDRESS and PREFIX, because both address and prefix is requested from the server.
lease_type | A lease type. |
Definition at line 56 of file command_options.cc.
Referenced by isc::perfdhcp::TestControl::copyIaOptions(), isc::perfdhcp::TestControl::sendSolicit6(), and isc::perfdhcp::TestControl::validateIA().
bool isc::perfdhcp::CommandOptions::LeaseType::is | ( | const Type | lease_type | ) | const |
Checks if lease type has the specified code.
lease_type | A lease type code to be checked. |
Definition at line 51 of file command_options.cc.
void isc::perfdhcp::CommandOptions::LeaseType::set | ( | const Type | lease_type | ) |
Sets the lease type code.
lease_type | A lease type code. |
Definition at line 61 of file command_options.cc.
Referenced by isc::perfdhcp::CommandOptions::reset().
std::string isc::perfdhcp::CommandOptions::LeaseType::toText | ( | ) | const |
Return textual representation of the lease type.
Definition at line 84 of file command_options.cc.
References isc_throw.
Referenced by isc::perfdhcp::CommandOptions::printCommandLine().