16 #include <boost/multi_index_container.hpp> 17 #include <boost/multi_index/hashed_index.hpp> 18 #include <boost/multi_index/sequenced_index.hpp> 19 #include <boost/multi_index/mem_fun.hpp> 20 #include <boost/multi_index/member.hpp> 21 #include <boost/shared_ptr.hpp> 80 const std::string& formatted_value =
"",
161 typedef boost::multi_index_container<
165 boost::multi_index::indexed_by<
169 boost::multi_index::sequenced<>,
171 boost::multi_index::hashed_non_unique<
179 boost::multi_index::const_mem_fun<
186 boost::multi_index::member<
195 boost::multi_index::hashed_non_unique<
196 boost::multi_index::member<
212 typedef std::pair<OptionContainerTypeIndex::const_iterator,
219 typedef std::pair<OptionContainerPersistIndex::const_iterator,
311 void add(
const OptionPtr& option,
const bool persistent,
312 const std::string& option_space);
387 template<
typename Selector>
389 const uint16_t option_code)
const {
393 if (!options || options->empty()) {
399 OptionContainerTypeIndex::const_iterator od_itr = idx.find(option_code);
400 if (od_itr == idx.end()) {
450 void encapsulateInternal(
const std::string& option_space);
460 void encapsulateInternal(
const OptionPtr& option);
475 template <
typename Selector>
489 uint32_t> VendorOptionSpaceCollection;
491 VendorOptionSpaceCollection vendor_options_;
510 #endif // CFG_OPTION_H bool equals(const OptionDescriptor &other) const
Checks if the one descriptor is equal to another.
Simple container for option spaces holding various items.
OptionDescriptor(const OptionDescriptor &desc)
Constructor.
void setContext(const data::ConstElementPtr &ctx)
Sets user context.
OptionContainer::nth_index< 1 >::type OptionContainerTypeIndex
Type of the index #1 - option type.
This class represents configuration element which is associated with the modification timestamp.
void copyTo(CfgOption &other) const
Copies this configuration to another configuration.
boost::shared_ptr< CfgOption > CfgOptionPtr
Non-const pointer.
void add(const OptionPtr &option, const bool persistent, const std::string &option_space)
Adds instance of the option to the configuration.
data::ConstElementPtr getContext() const
Returns const pointer to the user context.
boost::shared_ptr< OptionDescriptor > OptionDescriptorPtr
A pointer to option descriptor.
uint16_t getType() const
Returns option type (0-255 for DHCPv4, 0-65535 for DHCPv6)
OptionDescriptor(const OptionPtr &opt, bool persist, const std::string &formatted_value="", data::ConstElementPtr user_context=data::ConstElementPtr())
Constructor.
Base class for user context.
boost::shared_ptr< const CfgOption > ConstCfgOptionPtr
Const pointer.
void mergeTo(CfgOption &other) const
Merges this configuration to another configuration.
std::list< Selector > getOptionSpaceNames() const
Get a list of existing option spaces.
boost::shared_ptr< Option > OptionPtr
OptionContainerPtr getAll(const std::string &option_space) const
Returns all options for the specified option space.
boost::shared_ptr< Element > ElementPtr
std::list< uint32_t > getVendorIds() const
Returns a list of all configured vendor identifiers.
bool operator==(const CfgOption &other) const
Equality operator.
boost::multi_index_container< OptionDescriptor, boost::multi_index::indexed_by< boost::multi_index::sequenced<>, boost::multi_index::hashed_non_unique< KeyFromKeyExtractor< boost::multi_index::const_mem_fun< Option, uint16_t, &Option::getType >, boost::multi_index::member< OptionDescriptor, OptionPtr, &OptionDescriptor::option_ > > >, boost::multi_index::hashed_non_unique< boost::multi_index::member< OptionDescriptor, bool, &OptionDescriptor::persistent_ > > >> OptionContainer
Multi index container for DHCP option descriptors.
std::pair< OptionContainerTypeIndex::const_iterator, OptionContainerTypeIndex::const_iterator > OptionContainerTypeRange
Pair of iterators to represent the range of options having the same option type value.
std::string formatted_value_
Option value in textual (CSV) format.
CfgOption()
default constructor
Represents option data configuration for the DHCP server.
std::list< ConstCfgOptionPtr > CfgOptionList
Const pointer list.
bool operator!=(const CfgOption &other) const
Inequality operator.
bool persistent_
Persistence flag.
Abstract class for configuration Cfg_* classes.
std::pair< OptionContainerPersistIndex::const_iterator, OptionContainerPersistIndex::const_iterator > OptionContainerPersistRange
Pair of iterators to represent the range of options having the same persistency flag.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
std::list< std::string > getVendorIdsSpaceNames() const
Returns a list of option space names for configured vendor ids.
boost::shared_ptr< const Element > ConstElementPtr
std::list< std::string > getOptionSpaceNames() const
Returns a list of configured option space names.
std::string space_name_
Option space name.
OptionPtr option_
Option instance.
Defines the logger used by the top-level component of kea-dhcp-ddns.
OptionDescriptor(bool persist)
Constructor.
bool operator!=(const OptionDescriptor &other) const
Inequality operator.
bool empty() const
Indicates the object is empty.
void encapsulate()
Appends encapsulated options to top-level options.
bool operator==(const OptionDescriptor &other) const
Equality operator.
boost::shared_ptr< OptionContainer > OptionContainerPtr
Pointer to the OptionContainer object.
bool equals(const CfgOption &other) const
Check if configuration is equal to other configuration.
std::map< std::string, OptionSpacePtr > OptionSpaceCollection
A collection of option spaces.
OptionDescriptor get(const Selector &key, const uint16_t option_code) const
Returns option for the specified key and option code.
OptionContainer::nth_index< 2 >::type OptionContainerPersistIndex
Type of the index #2 - option persistency flag.