![]() |
Kea
1.5.0
|
Represents option definitions used by the DHCP server. More...
#include <cfg_option_def.h>
Inheritance diagram for isc::dhcp::CfgOptionDef:Public Member Functions | |
| void | add (const OptionDefinitionPtr &def, const std::string &option_space) |
| Add new option definition. More... | |
| void | copyTo (CfgOptionDef &new_config) const |
| Copies this configuration to a new configuration. More... | |
| OptionDefinitionPtr | get (const std::string &option_space, const uint16_t option_code) const |
| Return option definition for a particular option space and code. More... | |
| OptionDefinitionPtr | get (const std::string &option_space, const std::string &option_name) const |
| Return option definition for the particular option space and name. More... | |
| OptionDefContainerPtr | getAll (const std::string &option_space) const |
| Return option definitions for particular option space. More... | |
| const OptionDefSpaceContainer & | getContainer () const |
| Returns reference to container holding option definitions. More... | |
| virtual isc::data::ElementPtr | toElement () const |
| Unparse a configuration object. More... | |
Methods and operators used for comparing objects. | |
| bool | equals (const CfgOptionDef &other) const |
| Check if configuration is equal to other configuration. More... | |
| bool | operator== (const CfgOptionDef &other) const |
| Equality operator. More... | |
| bool | operator!= (const CfgOptionDef &other) const |
| Inequality operator. More... | |
Public Member Functions inherited from isc::data::CfgToElement | |
| virtual | ~CfgToElement () |
| Destructor. More... | |
Represents option definitions used by the DHCP server.
This class provides methods to add and retrieve option definitions specified by the administrator for the DHCP server. Option definitions specify formats of the options. This class doesn't hold information about the data being carried by the options.
Option definitions are grouped by option spaces. The option space is identified by the unique name which is specified as a string. The following names: "dhcp4" and "dhcp6" are reserved, though. They are names of option spaces used for standard top-level DHCPv4 and DHCPv6 options respectively.
Definition at line 30 of file cfg_option_def.h.
| void isc::dhcp::CfgOptionDef::add | ( | const OptionDefinitionPtr & | def, |
| const std::string & | option_space | ||
| ) |
Add new option definition.
| def | option definition to be added. |
| option_space | name of the option space to add definition to. |
| isc::dhcp::DuplicateOptionDefinition | when the particular option definition already exists. |
| isc::dhcp::MalformedOptionDefinition | when the pointer to an option definition is NULL. |
| isc::BadValue | when the option space name is empty or when trying to override the standard option (in dhcp4 or dhcp6 option space). |
Definition at line 79 of file cfg_option_def.cc.
References isc_throw.
Referenced by copyTo().
| void isc::dhcp::CfgOptionDef::copyTo | ( | CfgOptionDef & | new_config | ) | const |
Copies this configuration to a new configuration.
This method copies the option definitions stores in the configuration to an object passed as parameter. There are no shared objects or pointers between the original object and a copy.
| [out] | new_config | An object to which the configuration will be copied. |
Definition at line 21 of file cfg_option_def.cc.
References add(), and isc::dhcp::OptionSpaceContainer< ContainerType, ItemType, Selector >::clearItems().
Here is the call graph for this function:| bool isc::dhcp::CfgOptionDef::equals | ( | const CfgOptionDef & | other | ) | const |
Check if configuration is equal to other configuration.
| other | An object holding configuration to compare to. |
Definition at line 39 of file cfg_option_def.cc.
References get(), getAll(), and isc::dhcp::OptionSpaceContainer< ContainerType, ItemType, Selector >::getOptionSpaceNames().
Referenced by operator!=(), and operator==().
Here is the call graph for this function:| OptionDefinitionPtr isc::dhcp::CfgOptionDef::get | ( | const std::string & | option_space, |
| const uint16_t | option_code | ||
| ) | const |
Return option definition for a particular option space and code.
| option_space | option space. |
| option_code | option code. |
Definition at line 112 of file cfg_option_def.cc.
Referenced by equals().
| OptionDefinitionPtr isc::dhcp::CfgOptionDef::get | ( | const std::string & | option_space, |
| const std::string & | option_name | ||
| ) | const |
Return option definition for the particular option space and name.
| option_space | option space. |
| option_name | option name. |
Definition at line 134 of file cfg_option_def.cc.
| OptionDefContainerPtr isc::dhcp::CfgOptionDef::getAll | ( | const std::string & | option_space | ) | const |
Return option definitions for particular option space.
| option_space | option space. |
Definition at line 106 of file cfg_option_def.cc.
Referenced by equals().
|
inline |
Returns reference to container holding option definitions.
Definition at line 117 of file cfg_option_def.h.
|
inline |
Inequality operator.
| other | An object holding configuration to compare to. |
Definition at line 67 of file cfg_option_def.h.
References equals().
Here is the call graph for this function:
|
inline |
Equality operator.
| other | An object holding configuration to compare to. |
Definition at line 58 of file cfg_option_def.h.
References equals().
Here is the call graph for this function:
|
virtual |
Unparse a configuration object.
Implements isc::data::CfgToElement.
Definition at line 156 of file cfg_option_def.cc.
References isc::data::Element::create(), isc::data::Element::createList(), and isc::data::Element::createMap().
Here is the call graph for this function: