![]() |
Kea 3.1.5
|
Classes | |
| class | BaseStampedElement |
| This class represents configuration element which is associated with database identifier and the modification timestamp. More... | |
| class | BigIntElement |
| Wrapper over int128_t. More... | |
| class | BoolElement |
| struct | CfgToElement |
| Abstract class for configuration Cfg_* classes. More... | |
| class | DefaultCredential |
| Exception thrown on attempt to use a default credential. More... | |
| struct | DefaultCredentials |
| Base class for default credentials. More... | |
| class | DoubleElement |
| class | Element |
The Element class represents a piece of data, used by the command channel and configuration parts. More... | |
| class | ElementValue |
Template class for converting a value encapsulated in the Element object into a simple type. More... | |
| class | ElementValue< asiolink::IOAddress > |
The ElementValue specialization for IOAddress. More... | |
| class | ElementValue< bool > |
The ElementValue specialization for boolean. More... | |
| class | ElementValue< double > |
The ElementValue specialization for double. More... | |
| class | ElementValue< std::string > |
The ElementValue specialization for string. More... | |
| struct | HierarchyTraversalTest |
| Structure holding the test functions used to traverse the element hierarchy. More... | |
| class | IntElement |
| Notes: IntElement type is changed to int64_t. More... | |
| class | JSONError |
| A standard Data module exception that is thrown if a parse error is encountered when constructing an Element from a string. More... | |
| class | ListElement |
| class | MapElement |
| class | NullElement |
| class | ServerTag |
| Represents a server tag. More... | |
| struct | SimpleDefault |
| This array defines a single entry of default values. More... | |
| class | SimpleParser |
| A simple parser. More... | |
| class | StampedElement |
| This class represents configuration element which is associated with database identifier, modification timestamp and servers. More... | |
| class | StampedValue |
| This class represents a named configuration parameter, e.g. More... | |
| struct | StampedValueModificationTimeIndexTag |
| Tag for the index for access by modification time. More... | |
| struct | StampedValueNameIndexTag |
| Tag for the index for access by value name. More... | |
| class | StringElement |
| class | TypeError |
| A standard Data module exception that is thrown if a function is called for an Element that has a wrong type (e.g. More... | |
| struct | UserContext |
| Base class for user context. More... | |
Typedefs | |
| typedef boost::shared_ptr< const Element > | ConstElementPtr |
| typedef boost::shared_ptr< Element > | ElementPtr |
| typedef std::map< std::string, HierarchyTraversalTest > | FunctionMap |
| Mapping between a container name and functions used to match elements inside the container. | |
| typedef std::vector< FunctionMap > | HierarchyDescriptor |
| Hierarchy descriptor of the containers in a specific Element hierarchy tree. | |
| typedef std::function< bool(const std::string &)> | IsKeyTestFunc |
| Function used to check if the key is used for identification. | |
| typedef std::function< bool(ElementPtr &, ElementPtr &)> | MatchTestFunc |
| Function used to check if two MapElements refer to the same configuration data. | |
| typedef std::function< bool(ElementPtr &)> | NoDataTestFunc |
| Function used to check if the data provided for the element contains only information used for identification, or it contains extra useful data. | |
| typedef std::vector< std::string > | ParamsList |
| This defines a list of all parameters that are derived (or inherited) between contexts. | |
| typedef std::vector< SimpleDefault > | SimpleDefaults |
| This specifies all default values in a given scope (e.g. a subnet). | |
| typedef std::map< std::string, isc::data::Element::types > | SimpleKeywords |
| This specifies all accepted keywords with their types. | |
| typedef std::vector< std::string > | SimpleRequiredKeywords |
| This specifies all required keywords. | |
| typedef boost::shared_ptr< StampedValue > | StampedValuePtr |
| Pointer to the stamped value. | |
Definition of the multi index container for @c StampedValue. | |
| typedef boost::multi_index_container< StampedValuePtr, boost::multi_index::indexed_by< boost::multi_index::hashed_non_unique< boost::multi_index::tag< StampedValueNameIndexTag >, boost::multi_index::const_mem_fun< StampedValue, std::string, &StampedValue::getName > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< StampedValueModificationTimeIndexTag >, boost::multi_index::const_mem_fun< BaseStampedElement, boost::posix_time::ptime, &BaseStampedElement::getModificationTime > > > > | StampedValueCollection |
Multi index container for StampedValue. | |
Functions | |
| ElementPtr | copy (ConstElementPtr from, unsigned level=Element::MAX_NESTING_LEVEL) |
| Copy the data up to a nesting level. | |
| void | extend (const std::string &container, const std::string &extension, ElementPtr &element, ElementPtr &other, HierarchyDescriptor &hierarchy, std::string key, size_t idx=0, bool alter=false, unsigned level=Element::MAX_NESTING_LEVEL) |
| Extends data by adding the specified 'extension' elements from 'other' inside the 'container' element (recursively). | |
| unsigned | getNestDepth (ConstElementPtr element, unsigned max_depth=Element::MAX_NESTING_LEVEL) |
| Compute the nesting depth. | |
| bool | IsCircular (ConstElementPtr element) |
| Check if the data is circular. | |
| bool | isEquivalent (ConstElementPtr a, ConstElementPtr b) |
| Compares the data with other using unordered lists. | |
| bool | isNull (ConstElementPtr p) |
| Checks whether the given ElementPtr is a null pointer. | |
| void | merge (ElementPtr element, ConstElementPtr other) |
| Merges the data from other into element. (on the first level). | |
| void | mergeDiffAdd (ElementPtr &element, ElementPtr &other, HierarchyDescriptor &hierarchy, std::string key, size_t idx=0, unsigned level=Element::MAX_NESTING_LEVEL) |
| Merges the diff data by adding the missing elements from 'other' to 'element' (recursively). | |
| void | mergeDiffDel (ElementPtr &element, ElementPtr &other, HierarchyDescriptor &hierarchy, std::string key, size_t idx=0, unsigned level=Element::MAX_NESTING_LEVEL) |
| Merges the diff data by removing the data present in 'other' from 'element' (recursively). | |
| bool | operator!= (const Element &a, const Element &b) |
| Test inequality. | |
| bool | operator< (const Element &a, const Element &b) |
| Test less than. | |
| std::ostream & | operator<< (std::ostream &os, const ServerTag &server_tag) |
Insert the ServerTag as a string into stream. | |
| std::ostream & | operator<< (std::ostream &out, const Element &e) |
| Insert the Element as a string into stream. | |
| std::ostream & | operator<< (std::ostream &out, const Element::Position &pos) |
| Insert Element::Position as a string into stream. | |
| bool | operator== (const Element &a, const Element &b) |
| Test equality. | |
| void | prettyPrint (ConstElementPtr element, std::ostream &out, unsigned indent=0, unsigned step=2) |
| Pretty prints the data into stream. | |
| std::string | prettyPrint (ConstElementPtr element, unsigned indent=0, unsigned step=2) |
| Pretty prints the data into string. | |
| ConstElementPtr | removeIdentical (ConstElementPtr a, ConstElementPtr b) |
| Create a new ElementPtr from the first ElementPtr, removing all values that are equal in the second. | |
| void | removeIdentical (ElementPtr a, ConstElementPtr b) |
| Remove all values from the first ElementPtr that are equal in the second. | |
| typedef boost::shared_ptr<const Element> isc::data::ConstElementPtr |
| typedef boost::shared_ptr<Element> isc::data::ElementPtr |
| typedef std::map<std::string, HierarchyTraversalTest> isc::data::FunctionMap |
| typedef std::vector<FunctionMap> isc::data::HierarchyDescriptor |
Hierarchy descriptor of the containers in a specific Element hierarchy tree.
The position inside the vector indicates the level at which the respective containers are located.
e.g. { { { "pools", { ... , ... } }, { "pd-pools", { ... , ... } }, { "option-data", { ... , ... } } }, { { "option-data", { ... , ... } } } } At first subnet level the 'pools', 'pd-pools' and 'option-data' containers can be found. At second subnet level the 'option-data' container can be found (obviously only inside 'pools' and 'pd-pools' containers).
| typedef std::function<bool (const std::string&)> isc::data::IsKeyTestFunc |
| typedef std::function<bool (ElementPtr&, ElementPtr&)> isc::data::MatchTestFunc |
Function used to check if two MapElements refer to the same configuration data.
It can check if the two MapElements have the same or have equivalent value for some members. e.g. ( left->get("prefix")->stringValue() == right->get("prefix")->stringValue() && left->get("prefix-len")->intValue() == right->get("prefix-len")->intValue() && left->get("delegated-len")->intValue() == right->get("delegated-len")->intValue() )
| typedef std::function<bool (ElementPtr&)> isc::data::NoDataTestFunc |
| typedef std::vector<std::string> isc::data::ParamsList |
This defines a list of all parameters that are derived (or inherited) between contexts.
Definition at line 43 of file lib/cc/simple_parser.h.
| typedef std::vector<SimpleDefault> isc::data::SimpleDefaults |
This specifies all default values in a given scope (e.g. a subnet).
Definition at line 39 of file lib/cc/simple_parser.h.
| typedef std::map<std::string, isc::data::Element::types> isc::data::SimpleKeywords |
This specifies all accepted keywords with their types.
Definition at line 36 of file lib/cc/simple_parser.h.
| typedef std::vector<std::string> isc::data::SimpleRequiredKeywords |
This specifies all required keywords.
Definition at line 33 of file lib/cc/simple_parser.h.
| typedef boost::multi_index_container< StampedValuePtr, boost::multi_index::indexed_by< boost::multi_index::hashed_non_unique< boost::multi_index::tag<StampedValueNameIndexTag>, boost::multi_index::const_mem_fun< StampedValue, std::string, &StampedValue::getName > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag<StampedValueModificationTimeIndexTag>, boost::multi_index::const_mem_fun< BaseStampedElement, boost::posix_time::ptime, &BaseStampedElement::getModificationTime > > >> isc::data::StampedValueCollection |
Multi index container for StampedValue.
Definition at line 230 of file stamped_value.h.
| typedef boost::shared_ptr<StampedValue> isc::data::StampedValuePtr |
Pointer to the stamped value.
Definition at line 26 of file stamped_value.h.
| ElementPtr isc::data::copy | ( | ConstElementPtr | from, |
| unsigned | level = Element::MAX_NESTING_LEVEL ) |
Copy the data up to a nesting level.
The copy is a deep copy so nothing is shared if it is not under the given nesting level.
| from | the pointer to the element to copy. |
| level | nesting level (default is 100, 0 means shallow copy). |
| raises | a BadValue is a null pointer occurs. |
Definition at line 1517 of file data.cc.
References isc::data::Element::boolean, copy(), isc::data::Element::integer, isc_throw, isc::data::Element::list, isc::data::Element::map, isc::data::Element::null, isc::data::Element::real, and isc::data::Element::string.
Referenced by addContext(), isc::config::HttpCommandMgrImpl::closeCommandSockets(), isc::config::UnixCommandMgrImpl::closeCommandSockets(), isc::agent::CtrlAgentProcess::configure(), copy(), isc::netconf::NetconfSimpleParser::deriveParameters(), isc::dhcp::Memfile_LeaseMgr::extractExtendedInfo4(), isc::yang::Adaptor::getContext(), isc::yang::TranslatorControlSocket::getControlSocketKea(), isc::dhcp::Option::getOptionsCopy(), isc::ha::HAConfig::getOtherServersConfig(), isc::yang::TranslatorConfig::getServerKeaDhcp4(), handleLease6Cmds(), isc::config::HttpCommandMgrImpl::openCommandSockets(), isc::config::UnixCommandMgrImpl::openCommandSockets(), isc::dhcp::ClientClassDictionary::operator=(), isc::dhcp::DHCPQueueControlParser::parse(), isc::lease_cmds::Lease4Parser::parse(), isc::lease_cmds::Lease6Parser::parse(), isc::netconf::NetconfCfgMgr::parse(), isc::yang::AdaptorConfig::preProcess4(), isc::yang::AdaptorConfig::preProcess6(), isc::yang::AdaptorConfig::sanitizeDatabase(), isc::netconf::NetconfSimpleParser::setAllDefaults(), isc::dhcp::Pkt4o6::setCopyRetrievedOptions(), isc::dhcp::Pkt::setCopyRetrievedOptions(), isc::netconf::NetconfSimpleParser::setServerDefaults(), isc::dhcp::LibDHCP::splitOptions4(), isc::data::UserContext::toElement(), isc::dhcp::Lease::updateUserContextISC(), isc::dhcp::LeaseMgr::upgradeLease4ExtendedInfo(), and isc::dhcp::LeaseMgr::upgradeLease6ExtendedInfo().
Here is the call graph for this function:| void isc::data::extend | ( | const std::string & | container, |
| const std::string & | extension, | ||
| ElementPtr & | element, | ||
| ElementPtr & | other, | ||
| HierarchyDescriptor & | hierarchy, | ||
| std::string | key, | ||
| size_t | idx = 0, | ||
| bool | alter = false, | ||
| unsigned | level = Element::MAX_NESTING_LEVEL ) |
Extends data by adding the specified 'extension' elements from 'other' inside the 'container' element (recursively).
Both elements must be the same Element type.
| container | The container holding the data that must be extended. |
| extension | The name of the element that contains the data that must be added (if not already present) in order to extend the initial data. |
| element | The element from which new data is added. |
| other | The element containing the data which needs to be added. |
| hierarchy | The hierarchy describing the elements relations and identification keys. |
| key | The container holding the current element. |
| idx | The level inside the hierarchy the current element is located. |
| alter | The flag which indicates if the current element should be updated. |
| level | The maximum level of recursion. |
Definition at line 1459 of file data.cc.
References extend(), isc_throw, isc::data::Element::list, isc::data::Element::map, and isc::data::Element::null.
Referenced by extend(), and isc::subnet_cmds::ConfigDiffManager< SubnetConfigParserType >::processDelta().
Here is the call graph for this function:| unsigned isc::data::getNestDepth | ( | ConstElementPtr | element, |
| unsigned | max_depth = Element::MAX_NESTING_LEVEL ) |
Compute the nesting depth.
| element | The ConstElementPtr object. |
| max_depth | Maximal nesting depth. |
Definition at line 1825 of file data.cc.
References getNestDepth(), isc::data::Element::list, and isc::data::Element::map.
Referenced by getNestDepth().
Here is the call graph for this function:| bool isc::data::IsCircular | ( | ConstElementPtr | element | ) |
Check if the data is circular.
| element | The ConstElementPtr object to check. |
| bool isc::data::isEquivalent | ( | ConstElementPtr | a, |
| ConstElementPtr | b ) |
Compares the data with other using unordered lists.
This comparison function handles lists (JSON arrays) as unordered multi sets (multi means an item can occurs more than once as soon as it occurs the same number of times).
| a | Pointer to the first element. |
| b | Pointer to the second element. |
Definition at line 1641 of file data.cc.
Referenced by isc::test::runToElementTest(), and isc::test::runToElementTest().
| bool isc::data::isNull | ( | ConstElementPtr | p | ) |
Checks whether the given ElementPtr is a null pointer.
| p | The ElementPtr to check |
Definition at line 1225 of file data.cc.
Referenced by isc::d2::D2CfgContext::toElement(), isc::dhcp::SrvConfig::toElement(), and isc::hooks::HooksConfig::toElement().
| void isc::data::merge | ( | ElementPtr | element, |
| ConstElementPtr | other ) |
Merges the data from other into element. (on the first level).
Both elements must be MapElements. Every string, value pair in other is copied into element (the ElementPtr of value is copied, this is not a new object) Unless the value is a NullElement, in which case the key is removed from element, rather than setting the value to the given NullElement. This way, we can remove values from for instance maps with configuration data (which would then result in reverting back to the default).
| TypeError | if either ElementPtr is not a MapElement |
Definition at line 1276 of file data.cc.
References isc_throw, isc::data::Element::map, and isc::data::Element::null.
Referenced by isc::agent::AgentParser::parse(), isc::d2::D2Parser::parse(), isc::dhcp::Dhcp4Parser::parse(), isc::dhcp::Dhcp6Parser::parse(), isc::netconf::NetconfParser::parse(), isc::dhcp::Subnet4::toElement(), and isc::dhcp::Subnet6::toElement().
| void isc::data::mergeDiffAdd | ( | ElementPtr & | element, |
| ElementPtr & | other, | ||
| HierarchyDescriptor & | hierarchy, | ||
| std::string | key, | ||
| size_t | idx = 0, | ||
| unsigned | level = Element::MAX_NESTING_LEVEL ) |
Merges the diff data by adding the missing elements from 'other' to 'element' (recursively).
Both elements must be the same Element type.
| element | The element to which new data is added. |
| other | The element containing the data which needs to be added. |
| hierarchy | The hierarchy describing the elements relations and identification keys. |
| key | The container holding the current element. |
| idx | The level inside the hierarchy the current element is located. |
| level | The maximum level of recursion. |
Definition at line 1294 of file data.cc.
References isc::data::Element::createList(), isc_throw, isc::data::Element::list, isc::data::Element::map, mergeDiffAdd(), and isc::data::Element::null.
Referenced by mergeDiffAdd(), and isc::subnet_cmds::ConfigDiffManager< SubnetConfigParserType >::processDelta().
Here is the call graph for this function:| void isc::data::mergeDiffDel | ( | ElementPtr & | element, |
| ElementPtr & | other, | ||
| HierarchyDescriptor & | hierarchy, | ||
| std::string | key, | ||
| size_t | idx = 0, | ||
| unsigned | level = Element::MAX_NESTING_LEVEL ) |
Merges the diff data by removing the data present in 'other' from 'element' (recursively).
Both elements must be the same Element type.
for non map and list elements the values are set to NullElement for maps:
| element | The element from which new data is removed. |
| other | The element containing the data which needs to be removed. |
| hierarchy | The hierarchy describing the elements relations and identification keys. |
| key | The container holding the current element. |
| idx | The level inside the hierarchy the current element is located. |
| level | The maximum level of recursion. |
Definition at line 1362 of file data.cc.
References isc::data::Element::createMap(), isc_throw, isc::data::Element::list, isc::data::Element::map, mergeDiffDel(), isc::data::Element::null, and isc::data::Element::size().
Referenced by mergeDiffDel(), and isc::subnet_cmds::ConfigDiffManager< SubnetConfigParserType >::processDelta().
Here is the call graph for this function:Test inequality.
| a | First element. |
| b | Second Element. |
Definition at line 272 of file data.cc.
References isc::data::Element::equals().
Here is the call graph for this function:Test less than.
| a | First element. |
| b | Second Element. |
| BadValue | when arguments have different type or the type is not supported. |
Definition at line 276 of file data.cc.
References isc::data::Element::boolean, isc::data::Element::boolValue(), isc::data::Element::doubleValue(), isc::data::Element::getType(), isc::data::Element::integer, isc::data::Element::intValue(), isc_throw, isc::data::Element::real, isc::data::Element::string, and isc::data::Element::stringValue().
Here is the call graph for this function:| std::ostream & isc::data::operator<< | ( | std::ostream & | os, |
| const ServerTag & | server_tag ) |
Insert the ServerTag as a string into stream.
| os | stream to insert server tag into. |
| server_tag | server tag to be converted to text and inserted into a stream. |
Definition at line 46 of file server_tag.cc.
References isc::data::ServerTag::get().
Here is the call graph for this function:| std::ostream & isc::data::operator<< | ( | std::ostream & | out, |
| const Element & | e ) |
Insert the Element as a string into stream.
This method converts the ElementPtr into a string with Element::str() and inserts it into the output stream out.
This function overloads the global operator<< to behave as described in ostream::operator<< but applied to ElementPtr objects.
| out | A std::ostream object on which the insertion operation is performed. |
| e | The ElementPtr object to insert. |
std::ostream object referenced by parameter out after the insertion operation. Definition at line 262 of file data.cc.
References isc::data::Element::str().
Here is the call graph for this function:| std::ostream & isc::data::operator<< | ( | std::ostream & | out, |
| const Element::Position & | pos ) |
Insert Element::Position as a string into stream.
This operator converts the Element::Position into a string and inserts it into the output stream out.
| out | A std::ostream object on which the insertion operation is performed. |
| pos | The Element::Position structure to insert. |
std::ostream object referenced by parameter out after the insertion operation. Definition at line 50 of file data.cc.
References isc::data::Element::Position::str().
Here is the call graph for this function:Test equality.
| a | First element. |
| b | Second Element. |
Definition at line 268 of file data.cc.
References isc::data::Element::equals().
Here is the call graph for this function:| void isc::data::prettyPrint | ( | ConstElementPtr | element, |
| std::ostream & | out, | ||
| unsigned | indent = 0, | ||
| unsigned | step = 2 ) |
Pretty prints the data into stream.
This operator converts the ConstElementPtr into a string and inserts it into the output stream out with an initial indentation indent and add at each level step spaces. For maps if there is a comment property it is printed first.
| element | A ConstElementPtr to pretty print. |
| out | A std::ostream on which the print operation is performed. |
| indent | An initial number of spaces to add each new line. |
| step | A number of spaces to add to indentation at a new level. |
Definition at line 1742 of file data.cc.
References isc::data::Element::MAX_NESTING_LEVEL.
Referenced by isc::test::assertEqWithDiff(), isc::test::assertEqWithDiff(), isc::host_cache::HostCache::cacheWriteHandler(), isc::netconf::NetconfAgent::change(), isc::dhcp::Memfile_LeaseMgr::checkLimits4(), isc::dhcp::Memfile_LeaseMgr::checkLimits6(), isc::netconf::StdoutControlSocket::configSet(), isc::netconf::NetconfAgent::done(), isc::test::expectEqWithDiff(), isc::test::expectEqWithDiff(), isc::dhcp::ClassLeaseCounter::getLeaseClientClasses(), isc::netconf::NetconfAgent::keaConfig(), prettyPrint(), isc::test::runToElementTest(), isc::test::runToElementTest(), isc::process::Daemon::writeConfigFile(), and isc::netconf::NetconfAgent::yangConfig().
| std::string isc::data::prettyPrint | ( | ConstElementPtr | element, |
| unsigned | indent = 0, | ||
| unsigned | step = 2 ) |
Pretty prints the data into string.
This operator converts the ConstElementPtr into a string with an initial indentation indent and add at each level step spaces. For maps if there is a comment property it is printed first.
| element | A ConstElementPtr to pretty print. |
| indent | An initial number of spaces to add each new line. |
| step | A number of spaces to add to indentation at a new level. |
Definition at line 1748 of file data.cc.
References prettyPrint().
Here is the call graph for this function:| ConstElementPtr isc::data::removeIdentical | ( | ConstElementPtr | a, |
| ConstElementPtr | b ) |
Create a new ElementPtr from the first ElementPtr, removing all values that are equal in the second.
Both ElementPtrs MUST be MapElements.
| a | Pointer to the first element. |
| b | Pointer to the second element. |
| TypeError | if a or b are not MapElements |
Definition at line 1253 of file data.cc.
References isc::data::Element::createMap(), isc_throw, and isc::data::Element::map.
Here is the call graph for this function:| void isc::data::removeIdentical | ( | ElementPtr | a, |
| ConstElementPtr | b ) |
Remove all values from the first ElementPtr that are equal in the second.
Both ElementPtrs MUST be MapElements
The use for this function is to end up with a MapElement that only contains new and changed values (for ModuleCCSession and configuration update handlers)
| a | Pointer to the first element. |
| b | Pointer to the second element. |
| TypeError | if a or b are not MapElements |
Definition at line 1230 of file data.cc.
References isc_throw, and isc::data::Element::map.