Kea 2.7.6
|
DHCP option space. More...
#include <option_space.h>
Public Member Functions | |
OptionSpace (const std::string &name, const bool vendor_space=false) | |
Constructor. | |
void | clearVendorSpace () |
Mark option space as non-vendor space. | |
const std::string & | getName () const |
Return option space name. | |
bool | isVendorSpace () const |
Check if option space is vendor specific. | |
void | setVendorSpace () |
Mark option space as vendor specific. | |
Static Public Member Functions | |
static bool | validateName (const std::string &name) |
Checks that the provided option space name is valid. | |
DHCP option space.
This class represents single option space. The option spaces are used to group DHCP options having unique option codes. The special type of the option space is so called "vendor specific option space". It groups sub-options being sent within Vendor Encapsulated Options. For DHCPv4 it is the option with code 43. The option spaces are assigned to option instances represented by isc::dhcp::Option and other classes derived from it. Each particular option may belong to multiple option spaces. This class may be used to represent any DHCPv4 option space. If the option space is to group DHCPv4 Vendor Encapsulated Options then "vendor space" flag must be set using OptionSpace::setVendorSpace or the argument passed to the constructor. In theory, this class can be also used to represent non-vendor specific DHCPv6 option space but this is discouraged. For DHCPv6 option spaces the OptionSpace6 class should be used instead.
Definition at line 66 of file option_space.h.
isc::dhcp::OptionSpace::OptionSpace | ( | const std::string & | name, |
const bool | vendor_space = false ) |
Constructor.
name | option space name. |
vendor_space | boolean value that indicates that the object describes the vendor specific option space. |
isc::dhcp::InvalidOptionSpace | if given option space name contains invalid characters or is empty. This constructor uses validateName function to check that the specified name is correct. |
Definition at line 16 of file option_space.cc.
References isc_throw, and validateName().
|
inline |
Mark option space as non-vendor space.
Definition at line 87 of file option_space.h.
|
inline |
|
inline |
Check if option space is vendor specific.
Definition at line 95 of file option_space.h.
|
inline |
Mark option space as vendor specific.
Definition at line 98 of file option_space.h.
Referenced by isc::dhcp::OptionSpace6::setVendorSpace().
|
static |
Checks that the provided option space name is valid.
It is expected that option space name consists of upper or lower case letters or digits. Also, it may contain underscores or dashes. Other characters are prohibited. The empty option space names are invalid.
name | option space name to be validated. |
Definition at line 26 of file option_space.cc.
Referenced by OptionSpace(), isc::dhcp::CfgOption::add(), isc::dhcp::OptionDataParser::extractSpace(), isc::dhcp::OptionDefParser::parse(), and isc::dhcp::OptionDefinition::validate().