![]() |
Kea 3.1.5
|
Attribute data configuration. More...
#include <cfg_attribute.h>
Inheritance diagram for isc::radius::CfgAttributes:Classes | |
| class | AttributeValue |
| Container value class. More... | |
Public Member Functions | |
| CfgAttributes () | |
| Constructor. | |
| virtual | ~CfgAttributes () |
| void | add (const AttrDefPtr &def, const ConstAttributePtr &attr) |
| Adds instance of the attribute to the configuration. | |
| void | add (const AttrDefPtr &def, const ConstAttributePtr &attr, const dhcp::ExpressionPtr &expr, const std::string &test) |
| Adds instance of the attribute to the configuration. | |
| void | clear () |
| Clear the container. | |
| size_t | count (const uint8_t type, const uint32_t vendor=0) const |
| Counts instance of the attribute in the configuration. | |
| bool | del (const uint8_t type, const uint32_t vendor=0) |
| Deletes an attribute from the configuration. | |
| bool | empty () const |
| Checks if the object is empty. | |
| ConstAttributePtr | get (const uint8_t type, const uint32_t vendor=0) const |
| Get instance of the attribute in the configuration. | |
| Attributes | getAll () const |
| Get all attributes in the configuration. | |
| AttrDefPtr | getDef (const uint8_t type, const uint32_t vendor=0) const |
| Returns the definition of an attribute. | |
| Attributes | getEvalAll (dhcp::Pkt &pkt) |
| Get all evaluated attributes in the configuration. | |
| dhcp::ExpressionPtr | getExpr (const uint8_t type, const uint32_t vendor=0) const |
| Returns the expression of an attribute. | |
| std::string | getTest (const uint8_t type, const uint32_t vendor=0) const |
| Returns the text expression of an attribute. | |
| size_t | size () const |
| Returns the number of elements. | |
| data::ElementPtr | toElement () const override |
| Unparse configuration. | |
Public Member Functions inherited from isc::data::CfgToElement | |
| virtual | ~CfgToElement () |
| Destructor. | |
Protected Attributes | |
| boost::multi_index_container< AttributeValue, boost::multi_index::indexed_by< boost::multi_index::hashed_non_unique< boost::multi_index::composite_key< AttributeValue, boost::multi_index::const_mem_fun< AttributeValue, uint32_t, &AttributeValue::getVendor >, boost::multi_index::const_mem_fun< AttributeValue, uint8_t, &AttributeValue::getType > > > > > | container_ |
| The container. | |
Attribute data configuration.
It is used to store attribute types and values.
For example, it is able to store the following structure: { "name": "User-Name", "type": 1, "expr": "'foobar'" }
Definition at line 38 of file cfg_attribute.h.
|
inline |
|
inlinevirtual |
Definition at line 46 of file cfg_attribute.h.
References clear().
Here is the call graph for this function:
|
inline |
Adds instance of the attribute to the configuration.
| def | Pointer to the attribute definition. |
| attr | Pointer to the attribute being added. |
Definition at line 79 of file cfg_attribute.h.
References add().
Here is the call graph for this function:| void isc::radius::CfgAttributes::add | ( | const AttrDefPtr & | def, |
| const ConstAttributePtr & | attr, | ||
| const dhcp::ExpressionPtr & | expr, | ||
| const std::string & | test ) |
Adds instance of the attribute to the configuration.
| def | Pointer to the attribute definition. |
| attr | Pointer to the attribute being added. |
| expr | Expression to compute the value. |
| test | Original expression. |
Definition at line 24 of file cfg_attribute.cc.
References container_, and isc_throw.
Referenced by add().
|
inline |
Clear the container.
Definition at line 93 of file cfg_attribute.h.
References container_.
Referenced by ~CfgAttributes().
|
inline |
Counts instance of the attribute in the configuration.
| type | type of the attribute to count. |
| vendor | vendor id (default 0). |
Definition at line 103 of file cfg_attribute.h.
References container_.
| bool isc::radius::CfgAttributes::del | ( | const uint8_t | type, |
| const uint32_t | vendor = 0 ) |
Deletes an attribute from the configuration.
Deletes only the first occurrence.
| type | type of the attribute to delete. |
| vendor | vendor id (default 0). |
Definition at line 35 of file cfg_attribute.cc.
References container_.
|
inline |
Checks if the object is empty.
Definition at line 53 of file cfg_attribute.h.
References container_.
| ConstAttributePtr isc::radius::CfgAttributes::get | ( | const uint8_t | type, |
| const uint32_t | vendor = 0 ) const |
Get instance of the attribute in the configuration.
| type | type of the attribute to retrieve. |
| vendor | vendor id (default 0). |
Definition at line 54 of file cfg_attribute.cc.
References container_.
| Attributes isc::radius::CfgAttributes::getAll | ( | ) | const |
Get all attributes in the configuration.
Definition at line 81 of file cfg_attribute.cc.
References isc::radius::Attributes::add(), and container_.
Referenced by isc::radius::RadiusServiceParser::checkAttributes().
Here is the call graph for this function:| AttrDefPtr isc::radius::CfgAttributes::getDef | ( | const uint8_t | type, |
| const uint32_t | vendor = 0 ) const |
Returns the definition of an attribute.
| type | type of the attribute. |
| vendor | vendor id (default 0). |
Definition at line 45 of file cfg_attribute.cc.
References container_.
| Attributes isc::radius::CfgAttributes::getEvalAll | ( | dhcp::Pkt & | pkt | ) |
Get all evaluated attributes in the configuration.
When an attribute has an expression, evaluate the expression into a copy of the attribute. The attribute is skipped if the evaluation returns an empty string.
| pkt | The v4 or v6 packet. |
Definition at line 90 of file cfg_attribute.cc.
References isc::radius::Attributes::add(), container_, isc::dhcp::evaluateString(), and isc::radius::Attribute::fromBytes().
Here is the call graph for this function:| ExpressionPtr isc::radius::CfgAttributes::getExpr | ( | const uint8_t | type, |
| const uint32_t | vendor = 0 ) const |
Returns the expression of an attribute.
| type | type of the attribute. |
| vendor | vendor id (default 0). |
Definition at line 63 of file cfg_attribute.cc.
References container_.
| string isc::radius::CfgAttributes::getTest | ( | const uint8_t | type, |
| const uint32_t | vendor = 0 ) const |
Returns the text expression of an attribute.
| type | type of the attribute. |
| vendor | vendor id (default 0). |
Definition at line 72 of file cfg_attribute.cc.
References container_.
|
inline |
Returns the number of elements.
Definition at line 60 of file cfg_attribute.h.
References container_.
Referenced by isc::radius::RadiusServiceParser::checkAttributes().
|
overridevirtual |
Unparse configuration.
Implements isc::data::CfgToElement.
Definition at line 116 of file cfg_attribute.cc.
References container_, Element::create(), Element::createList(), and Element::createMap().
Here is the call graph for this function:
|
protected |
The container.
Definition at line 234 of file cfg_attribute.h.
Referenced by CfgAttributes(), add(), clear(), count(), del(), empty(), get(), getAll(), getDef(), getEvalAll(), getExpr(), getTest(), size(), and toElement().