![]() |
Kea 2.2.0
|
Maintains a list of ClientClassDef's. More...
#include <client_class_def.h>
Inheritance diagram for isc::dhcp::ClientClassDictionary:Public Member Functions | |
| ClientClassDictionary () | |
| Constructor. More... | |
| ClientClassDictionary (const ClientClassDictionary &rhs) | |
| ~ClientClassDictionary () | |
| Destructor. More... | |
| void | addClass (ClientClassDefPtr &class_def) |
| Adds a new class to the list. More... | |
| void | addClass (const std::string &name, const ExpressionPtr &match_expr, const std::string &test, bool required, bool depend_on_known, const CfgOptionPtr &options, CfgOptionDefPtr defs=CfgOptionDefPtr(), isc::data::ConstElementPtr user_context=isc::data::ConstElementPtr(), asiolink::IOAddress next_server=asiolink::IOAddress("0.0.0.0"), const std::string &sname=std::string(), const std::string &filename=std::string(), const util::Triplet< uint32_t > &valid=util::Triplet< uint32_t >(), const util::Triplet< uint32_t > &preferred=util::Triplet< uint32_t >()) |
| Adds a new class to the list. More... | |
| void | createOptions (const CfgOptionDefPtr &cfg_option_def) |
| Iterates over the classes in the dictionary and recreates the options. More... | |
| bool | dependOnClass (const std::string &name, std::string &dependent_class) const |
| Checks direct dependency. More... | |
| bool | empty () const |
| Checks if the class dictionary is empty. More... | |
| bool | equals (const ClientClassDictionary &other) const |
Compares two ClientClassDictionary objects for equality. More... | |
| ClientClassDefPtr | findClass (const std::string &name) const |
| Fetches the class definition for a given class name. More... | |
| const ClientClassDefListPtr & | getClasses () const |
| Fetches the dictionary's list of classes. More... | |
| void | initMatchExpr (uint16_t family) |
| Iterates over the classes in the dictionary and ensures that that match expressions are initialized. More... | |
| bool | operator!= (const ClientClassDictionary &other) const |
| Inequality operator. More... | |
| ClientClassDictionary & | operator= (const ClientClassDictionary &rhs) |
| Copy assignment operator. More... | |
| bool | operator== (const ClientClassDictionary &other) const |
| Equality operator. More... | |
| void | removeClass (const std::string &name) |
| Removes a given class definition from the dictionary. More... | |
| void | removeClass (const uint64_t id) |
| Removes a client class by id. More... | |
| virtual isc::data::ElementPtr | toElement () const |
| Unparse a configuration object. More... | |
Public Member Functions inherited from isc::data::CfgToElement | |
| virtual | ~CfgToElement () |
| Destructor. More... | |
| virtual isc::data::ElementPtr | toElement () const =0 |
| Unparse a configuration object. More... | |
Maintains a list of ClientClassDef's.
Definition at line 304 of file client_class_def.h.
| isc::dhcp::ClientClassDictionary::ClientClassDictionary | ( | ) |
Constructor.
Definition at line 240 of file client_class_def.cc.
| isc::dhcp::ClientClassDictionary::ClientClassDictionary | ( | const ClientClassDictionary & | rhs | ) |
Definition at line 244 of file client_class_def.cc.
References addClass(), and isc::data::copy().
Here is the call graph for this function:| isc::dhcp::ClientClassDictionary::~ClientClassDictionary | ( | ) |
Destructor.
Definition at line 252 of file client_class_def.cc.
| void isc::dhcp::ClientClassDictionary::addClass | ( | ClientClassDefPtr & | class_def | ) |
Adds a new class to the list.
| class_def | pointer to class definition to add |
| DuplicateClientClassDef | if class already exists within the dictionary, BadValue if the pointer is empty. |
Definition at line 284 of file client_class_def.cc.
References findClass(), and isc_throw.
Here is the call graph for this function:| void isc::dhcp::ClientClassDictionary::addClass | ( | const std::string & | name, |
| const ExpressionPtr & | match_expr, | ||
| const std::string & | test, | ||
| bool | required, | ||
| bool | depend_on_known, | ||
| const CfgOptionPtr & | options, | ||
| CfgOptionDefPtr | defs = CfgOptionDefPtr(), |
||
| isc::data::ConstElementPtr | user_context = isc::data::ConstElementPtr(), |
||
| asiolink::IOAddress | next_server = asiolink::IOAddress("0.0.0.0"), |
||
| const std::string & | sname = std::string(), |
||
| const std::string & | filename = std::string(), |
||
| const util::Triplet< uint32_t > & | valid = util::Triplet<uint32_t>(), |
||
| const util::Triplet< uint32_t > & | preferred = util::Triplet<uint32_t>() |
||
| ) |
Adds a new class to the list.
| name | Name to assign to this class |
| match_expr | Expression the class will use to determine membership |
| test | Original version of match_expr |
| required | Original value of the only if required flag |
| depend_on_known | Using host so will be evaluated later |
| options | Collection of options members should be given |
| defs | Option definitions (optional) |
| user_context | User context (optional) |
| next_server | next-server value for this class (optional) |
| sname | server-name value for this class (optional) |
| filename | boot-file-name value for this class (optional) |
| valid | valid-lifetime triplet (optional) |
| preferred | preferred-lifetime triplet (optional) |
| DuplicateClientClassDef | if class already exists within the dictionary. See dhcp::ClientClassDef::ClientClassDef() for others. |
Definition at line 256 of file client_class_def.cc.
References addClass().
Referenced by ClientClassDictionary(), addClass(), and operator=().
Here is the call graph for this function:| void isc::dhcp::ClientClassDictionary::createOptions | ( | const CfgOptionDefPtr & | cfg_option_def | ) |
Iterates over the classes in the dictionary and recreates the options.
| cfg_option_def | set of option definitions to use. |
Definition at line 412 of file client_class_def.cc.
Referenced by isc::dhcp::CBControlDHCPv4::databaseConfigApply(), and isc::dhcp::CBControlDHCPv6::databaseConfigApply().
| bool isc::dhcp::ClientClassDictionary::dependOnClass | ( | const std::string & | name, |
| std::string & | dependent_class | ||
| ) | const |
Checks direct dependency.
| name | The client class name. | |
| [out] | dependent_class | Reference to a variable where the name of the first class depending on the checked class is set. |
Definition at line 348 of file client_class_def.cc.
| bool isc::dhcp::ClientClassDictionary::empty | ( | ) | const |
Checks if the class dictionary is empty.
Definition at line 343 of file client_class_def.cc.
| bool isc::dhcp::ClientClassDictionary::equals | ( | const ClientClassDictionary & | other | ) | const |
Compares two ClientClassDictionary objects for equality.
| other | Other client class definition to compare to. |
Definition at line 369 of file client_class_def.cc.
Referenced by operator!=(), and operator==().
| ClientClassDefPtr isc::dhcp::ClientClassDictionary::findClass | ( | const std::string & | name | ) | const |
Fetches the class definition for a given class name.
| name | the name of the desired class |
Definition at line 300 of file client_class_def.cc.
Referenced by addClass().
| const ClientClassDefListPtr & isc::dhcp::ClientClassDictionary::getClasses | ( | ) | const |
Fetches the dictionary's list of classes.
Definition at line 338 of file client_class_def.cc.
| void isc::dhcp::ClientClassDictionary::initMatchExpr | ( | uint16_t | family | ) |
Iterates over the classes in the dictionary and ensures that that match expressions are initialized.
| family | Class universe, e.g. AF_INET or AF_INET6. |
Definition at line 391 of file client_class_def.cc.
References isc::data::Element::create(), and isc::dhcp::ExpressionParser::parse().
Referenced by isc::dhcp::CBControlDHCPv4::databaseConfigApply(), and isc::dhcp::CBControlDHCPv6::databaseConfigApply().
Here is the call graph for this function:
|
inline |
Inequality operator.
| other | Other client class dictionary to compare to. |
Definition at line 426 of file client_class_def.h.
References equals().
Here is the call graph for this function:| ClientClassDictionary & isc::dhcp::ClientClassDictionary::operator= | ( | const ClientClassDictionary & | rhs | ) |
Copy assignment operator.
| rhs | Client class dictionary to be copied from. |
Definition at line 463 of file client_class_def.cc.
References addClass(), and isc::data::copy().
Here is the call graph for this function:
|
inline |
Equality operator.
| other | Other client class dictionary to compare to. |
Definition at line 417 of file client_class_def.h.
References equals().
Here is the call graph for this function:| void isc::dhcp::ClientClassDictionary::removeClass | ( | const std::string & | name | ) |
Removes a given class definition from the dictionary.
Removes the class definition from the map if it exists, otherwise no harm, no foul.
| name | the name of the class to remove |
Definition at line 310 of file client_class_def.cc.
| void isc::dhcp::ClientClassDictionary::removeClass | ( | const uint64_t | id | ) |
Removes a client class by id.
| id | class id. |
Definition at line 322 of file client_class_def.cc.
|
virtual |
Unparse a configuration object.
Implements isc::data::CfgToElement.
Definition at line 452 of file client_class_def.cc.
References isc::data::Element::createList().
Here is the call graph for this function: