28 #include <boost/shared_ptr.hpp> 55 template<
typename ValueType>
69 void setParam(
const std::string& name,
const ValueType& value,
71 values_[name] = value;
72 positions_[name] = position;
83 ValueType
getParam(
const std::string& name)
const {
84 typename std::map<std::string, ValueType>::const_iterator param
87 if (param == values_.end()) {
92 return (param->second);
111 typename std::map<std::string, data::Element::Position>::const_iterator
112 pos = positions_.find(name);
113 if (pos == positions_.end()) {
114 return (parent ? parent->getPosition() :
118 return (pos->second);
132 const ValueType& default_value)
const {
133 typename std::map<std::string, ValueType>::const_iterator param
134 = values_.find(name);
136 if (param == values_.end()) {
137 return (default_value);
140 return (param->second);
151 positions_.erase(name);
163 std::map<std::string, ValueType> values_;
170 std::map<std::string, data::Element::Position> positions_;
175 typedef std::pair<std::string, isc::data::ConstElementPtr>
ConfigPair;
245 uint16_t address_family_;
273 uint16_t address_family_;
306 virtual void parse(PoolStoragePtr pools,
308 const uint16_t address_family);
318 int32_t ptype = 0) = 0;
328 int32_t ptype = 0) = 0;
339 virtual boost::shared_ptr<OptionDataListParser>
340 createOptionDataListParser(
const uint16_t address_family)
const;
393 virtual void parse(PoolStoragePtr pools,
405 virtual boost::shared_ptr<PoolParser> createPoolConfigParser()
const = 0;
430 virtual boost::shared_ptr<PoolParser> createPoolConfigParser()
const;
474 void addAddress(
const std::string& name,
const std::string& address_str,
553 virtual boost::shared_ptr<OptionDataListParser> createOptionDataListParser()
const;
562 virtual boost::shared_ptr<PoolsListParser>
563 createPoolsListParser()
const = 0;
632 virtual boost::shared_ptr<PoolsListParser>
633 createPoolsListParser()
const;
682 virtual boost::shared_ptr<Subnet4ConfigParser> createSubnetConfigParser()
const;
742 virtual boost::shared_ptr<PoolParser> createPoolConfigParser()
const;
794 virtual boost::shared_ptr<OptionDataListParser>
795 createOptionDataListParser()
const;
847 virtual boost::shared_ptr<PdPoolParser>
848 createPdPoolConfigParser()
const;
883 virtual void duplicateOptionWarning(uint32_t code,
909 virtual boost::shared_ptr<PoolsListParser>
910 createPoolsListParser()
const;
919 virtual boost::shared_ptr<PdPoolsListParser>
920 createPdPoolsListParser()
const;
970 virtual boost::shared_ptr<Subnet6ConfigParser> createSubnetConfigParser()
const;
1051 #endif // DHCP_PARSERS_H
std::pair< std::string, isc::data::ConstElementPtr > ConfigPair
Combination of parameter name and configuration contents.
Defines the D2ClientConfig class.
virtual ~PdPoolsListParser()
Virtual destructor.
void setParam(const std::string &name, const ValueType &value, const data::Element::Position &position)
Stores the parameter, its value and the position in the store.
boost::shared_ptr< CfgOption > CfgOptionPtr
Non-const pointer.
isc::dhcp::Pool6Ptr pool_
Pointer to the created pool object.
OptionSpaceContainer< OptionContainer, OptionDescriptor, std::string > OptionStorage
Collection of containers holding option spaces.
this class parses a list of DHCP6 subnets
static const Position & ZERO_POSITION()
Returns Position object with line_ and pos_ set to 0, and with an empty file name.
boost::shared_ptr< OptionStorage > OptionStoragePtr
Shared pointer to option storage.
this class parses a single subnet
Parser for IPv4 pool definitions.
virtual ~PoolsListParser()
destructor.
boost::shared_ptr< StringStorage > StringStoragePtr
boost::shared_ptr< Pool6 > Pool6Ptr
a pointer an IPv6 Pool
Specialization of the pool list parser for DHCPv6.
static const isc::data::SimpleDefaults D2_CLIENT_CONFIG_DEFAULTS
Defaults for the D2 client configuration.
std::vector< SimpleDefault > SimpleDefaults
This specifies all default values in a given scope (e.g. a subnet).
Common configuration parser for shared networks and subnets.
boost::shared_ptr< Network::RelayInfo > RelayInfoPtr
Pointer to the RelayInfo structure.
boost::shared_ptr< Uint32Storage > Uint32StoragePtr
boost::shared_ptr< SrvConfig > SrvConfigPtr
Non-const pointer to the SrvConfig.
boost::shared_ptr< Subnet4 > Subnet4Ptr
A pointer to a Subnet4 object.
This class parses a single IPv4 subnet.
Universe
defines option universe DHCPv4 or DHCPv6
CfgOptionPtr options_
Pointer to the options configuration.
NameChangeFormat
Defines the list of data wire formats supported.
void clear()
Deletes all of the entries from the store.
const data::Element::Position & getPosition(const std::string &name, const data::ConstElementPtr parent=data::ConstElementPtr()) const
Returns position of the data element in the configuration string.
this class parses list of DHCP4 subnets
boost::shared_ptr< CfgOptionDef > CfgOptionDefPtr
Non-const pointer.
virtual ~SubnetConfigParser()
virtual destructor (does nothing)
boost::shared_ptr< Pool > PoolPtr
a pointer to either IPv4 or IPv6 Pool
Parser for D2ClientConfig.
ValueStorage< bool > BooleanStorage
Storage for parsed boolean values.
Specialization of the pool list parser for DHCPv4.
PoolStoragePtr pools_
Storage for pools belonging to this subnet.
Parser for IPv6 prefix delegation definitions.
parser for MAC/hardware acquisition sources
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
boost::multi_index_container< Subnet4Ptr, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetSubnetIdIndexTag >, boost::multi_index::const_mem_fun< Subnet, SubnetID, &Subnet::getID > >, boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetPrefixIndexTag >, boost::multi_index::const_mem_fun< Subnet, std::string, &Subnet::toText > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SubnetServerIdIndexTag >, boost::multi_index::const_mem_fun< Network4, asiolink::IOAddress, &Network4::getServerId > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SubnetModificationTimeIndexTag >, boost::multi_index::const_mem_fun< data::BaseStampedElement, boost::posix_time::ptime, &data::BaseStampedElement::getModificationTime > > >> Subnet4Collection
A collection of Subnet4 objects.
Wrapper class that holds MAC/hardware address sources.
parser for additional relay information
To be removed. Please use ConfigError instead.
Parser for a single option definition.
parser for a single pool definition
boost::shared_ptr< const Element > ConstElementPtr
boost::shared_ptr< const Host > ConstHostPtr
Const pointer to the Host object.
Parser for a list of option definitions.
A template class that stores named elements of a given data type.
isc::data::ConstElementPtr client_class_
Client class (a client has to belong to to use this pd-pool)
Represents the position of the data element within a configuration string.
boost::multi_index_container< Subnet6Ptr, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetSubnetIdIndexTag >, boost::multi_index::const_mem_fun< Subnet, SubnetID, &Subnet::getID > >, boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetPrefixIndexTag >, boost::multi_index::const_mem_fun< Subnet, std::string, &Subnet::toText > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SubnetModificationTimeIndexTag >, boost::multi_index::const_mem_fun< data::BaseStampedElement, boost::posix_time::ptime, &data::BaseStampedElement::getModificationTime > > >> Subnet6Collection
A collection of Subnet6 objects.
Specifies current DHCP configuration.
CfgOptionPtr options_
A storage for pool specific option values.
Defines the logger used by the top-level component of kea-lfc.
virtual ~Subnets4ListConfigParser()
Virtual destructor.
bool check_iface_
Check if the specified interface exists in the system.
Parser for a list of prefix delegation pools.
Parser for IPv6 pool definitions.
ReplaceClientNameMode
Defines the client name replacement modes.
uint16_t address_family_
Address family: AF_INET or AF_INET6.
Parser for a list of pools.
ValueType getOptionalParam(const std::string &name, const ValueType &default_value) const
Returns the data value for an optional parameter.
void delParam(const std::string &name)
Remove the parameter from the store.
bool check_iface_
Check if the specified interface exists in the system.
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_ > >, boost::multi_index::ordered_non_unique< boost::multi_index::const_mem_fun< data::BaseStampedElement, boost::posix_time::ptime, &data::BaseStampedElement::getModificationTime > >, boost::multi_index::hashed_non_unique< boost::multi_index::tag< OptionIdIndexTag >, boost::multi_index::const_mem_fun< data::BaseStampedElement, uint64_t, &data::BaseStampedElement::getId > > >> OptionContainer
Multi index container for DHCP option descriptors.
isc::dhcp::SubnetPtr subnet_
Pointer to the created subnet object.
ValueStorage< std::string > StringStorage
a collection of elements that store string values
isc::dhcp::Network::RelayInfoPtr relay_info_
Pointer to relay information.
virtual ~PoolParser()
destructor.
NameChangeProtocol
Defines the list of socket protocols supported.
This class parses a single IPv6 subnet.
boost::shared_ptr< PoolStorage > PoolStoragePtr
ValueStorage< uint32_t > Uint32Storage
a collection of elements that store uint32 values
boost::shared_ptr< OptionDefinition > OptionDefinitionPtr
Pointer to option definition object.
isc::data::ConstElementPtr user_context_
User context (optional, may be null)
virtual ~PdPoolParser()
Virtual destructor.
boost::shared_ptr< Subnet6 > Subnet6Ptr
A pointer to a Subnet6 object.
Parser for the control-socket structure.
ValueType getParam(const std::string &name) const
Returns the data value for the given parameter.
The IOAddress class represents an IP addresses (version agnostic)
boost::shared_ptr< D2ClientConfig > D2ClientConfigPtr
Defines a pointer for D2ClientConfig instances.
bool check_iface_
Check if the specified interface exists in the system.
boost::shared_ptr< BooleanStorage > BooleanStoragePtr
std::vector< PoolPtr > PoolStorage
a collection of pools
boost::shared_ptr< Subnet > SubnetPtr
A generic pointer to either Subnet4 or Subnet6 object.
virtual ~Subnets6ListConfigParser()
Virtual destructor.