| Kea 3.0.2-git

dhcp_parsers.h
Go to the documentation of this file.
1// Copyright (C) 2013-2024 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef DHCP_PARSERS_H
8#define DHCP_PARSERS_H
9
10#include <asiolink/io_address.h>
11#include <cc/data.h>
12#include <dhcp/option_definition.h>
13#include <dhcp/option_space_container.h>
14#include <dhcpsrv/d2_client_cfg.h>
15#include <dhcpsrv/cfg_iface.h>
16#include <dhcpsrv/cfg_option.h>
17#include <dhcpsrv/network.h>
18#include <dhcpsrv/subnet.h>
19#include <dhcpsrv/cfg_option_def.h>
20#include <dhcpsrv/cfg_mac_source.h>
21#include <dhcpsrv/srv_config.h>
22#include <dhcpsrv/parsers/base_network_parser.h>
23#include <dhcpsrv/parsers/option_data_parser.h>
24#include <cc/simple_parser.h>
25#include <exceptions/exceptions.h>
26#include <util/optional.h>
27
28#include <boost/shared_ptr.hpp>
29
30#include <stdint.h>
31#include <string>
32#include <vector>
33
34 namespace isc {
35 namespace dhcp {
36
39 typedef OptionSpaceContainer<OptionContainer, OptionDescriptor,
40 std::string> OptionStorage;
42 typedef boost::shared_ptr<OptionStorage> OptionStoragePtr;
43
55 template<typename ValueType>
56 class ValueStorage {
57 public:
69 void setParam(const std::string& name, const ValueType& value,
70 const data::Element::Position& position) {
71 values_[name] = value;
72 positions_[name] = position;
73 }
74
83 ValueType getParam(const std::string& name) const {
84 typename std::map<std::string, ValueType>::const_iterator param
85 = values_.find(name);
86
87 if (param == values_.end()) {
88 isc_throw(DhcpConfigError, "Missing parameter '"
89 << name << "'");
90 }
91
92 return (param->second);
93 }
94
108 const data::Element::Position&
109 getPosition(const std::string& name, const data::ConstElementPtr parent =
110 data::ConstElementPtr()) const {
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() :
115 data::Element::ZERO_POSITION());
116 }
117
118 return (pos->second);
119 }
120
131 ValueType getOptionalParam(const std::string& name,
132 const ValueType& default_value) const {
133 typename std::map<std::string, ValueType>::const_iterator param
134 = values_.find(name);
135
136 if (param == values_.end()) {
137 return (default_value);
138 }
139
140 return (param->second);
141 }
142
149 void delParam(const std::string& name) {
150 values_.erase(name);
151 positions_.erase(name);
152 }
153
156 void clear() {
157 values_.clear();
158 positions_.clear();
159 }
160
161 private:
163 std::map<std::string, ValueType> values_;
164
170 std::map<std::string, data::Element::Position> positions_;
171
172};
173
175 typedef std::pair<std::string, isc::data::ConstElementPtr> ConfigPair;
176
178 typedef ValueStorage<uint32_t> Uint32Storage;
179 typedef boost::shared_ptr<Uint32Storage> Uint32StoragePtr;
180
182 typedef ValueStorage<std::string> StringStorage;
183 typedef boost::shared_ptr<StringStorage> StringStoragePtr;
184
186 typedef ValueStorage<bool> BooleanStorage;
187 typedef boost::shared_ptr<BooleanStorage> BooleanStoragePtr;
188
195 class MACSourcesListConfigParser : public isc::data::SimpleParser {
196 public:
204 void parse(CfgMACSource& mac_sources, isc::data::ConstElementPtr value);
205};
206
211 class ControlSocketsParser : public isc::data::SimpleParser {
212 public:
222 void parse(SrvConfig& srv_cfg, isc::data::ConstElementPtr value);
223};
224
228 class OptionDefParser : public isc::data::SimpleParser {
229 public:
233 OptionDefParser(const uint16_t address_family);
234
241 OptionDefinitionPtr parse(isc::data::ConstElementPtr option_def);
242
243 private:
245 uint16_t address_family_;
246};
247
254 class OptionDefListParser : public isc::data::SimpleParser {
255 public:
259 OptionDefListParser(const uint16_t address_family);
260
269 void parse(CfgOptionDefPtr cfg, isc::data::ConstElementPtr def_list);
270
271 private:
273 uint16_t address_family_;
274};
275
280 typedef std::vector<PoolPtr> PoolStorage;
281 typedef boost::shared_ptr<PoolStorage> PoolStoragePtr;
282
290 class PoolParser : public isc::data::SimpleParser {
291 public:
292
294 virtual ~PoolParser() {
295 }
296
308 virtual void parse(PoolStoragePtr pools,
309 isc::data::ConstElementPtr pool_structure,
310 const uint16_t address_family,
311 bool encapsulate_options = true);
312
313 protected:
320 virtual PoolPtr poolMaker(isc::asiolink::IOAddress &addr, uint32_t len,
321 int32_t ptype = 0) = 0;
322
329 virtual PoolPtr poolMaker(isc::asiolink::IOAddress &min,
330 isc::asiolink::IOAddress &max,
331 int32_t ptype = 0) = 0;
332
342 virtual boost::shared_ptr<OptionDataListParser>
343 createOptionDataListParser(const uint16_t address_family) const;
344};
345
354 class Pool4Parser : public PoolParser {
355 protected:
363 PoolPtr poolMaker (asiolink::IOAddress &addr, uint32_t len,
364 int32_t ignored);
365
373 PoolPtr poolMaker (asiolink::IOAddress &min, asiolink::IOAddress &max,
374 int32_t ignored);
375};
376
382 class PoolsListParser : public isc::data::SimpleParser {
383 public:
384
386 virtual ~PoolsListParser() {
387 }
388
398 virtual void parse(PoolStoragePtr pools,
399 isc::data::ConstElementPtr pools_list,
400 bool encapsulate_options) = 0;
401
402 protected:
403
411 virtual boost::shared_ptr<PoolParser> createPoolConfigParser() const = 0;
412};
413
415 class Pools4ListParser : public PoolsListParser {
416 public:
417
427 void parse(PoolStoragePtr pools, data::ConstElementPtr pools_list,
428 bool encapsulate_options = true);
429
430 protected:
431
439 virtual boost::shared_ptr<PoolParser> createPoolConfigParser() const;
440};
441
449 class RelayInfoParser : public isc::data::SimpleParser {
450 public:
451
454 explicit RelayInfoParser(const isc::dhcp::Option::Universe& family);
455
470 void parse(const isc::dhcp::Network::RelayInfoPtr& relay_info,
471 isc::data::ConstElementPtr relay_elem);
472
483 void addAddress(const std::string& name, const std::string& address_str,
484 isc::data::ConstElementPtr relay_elem,
485 const isc::dhcp::Network::RelayInfoPtr& relay_info);
486 private:
487
489 Option::Universe family_;
490};
491
512 class SubnetConfigParser : public BaseNetworkParser {
513 public:
514
520 explicit SubnetConfigParser(uint16_t family, bool check_iface = true);
521
523 virtual ~SubnetConfigParser() { }
524
525 protected:
537 SubnetPtr parse(isc::data::ConstElementPtr subnet,
538 bool encapsulate_options);
539
546 virtual void initSubnet(isc::data::ConstElementPtr params,
547 isc::asiolink::IOAddress addr, uint8_t len) = 0;
548
549 protected:
550
556 void createSubnet(isc::data::ConstElementPtr data);
557
565 virtual boost::shared_ptr<OptionDataListParser> createOptionDataListParser() const;
566
574 virtual boost::shared_ptr<PoolsListParser>
575 createPoolsListParser() const = 0;
576
578 PoolStoragePtr pools_;
579
581 isc::dhcp::SubnetPtr subnet_;
582
584 uint16_t address_family_;
585
587 isc::dhcp::Network::RelayInfoPtr relay_info_;
588
590 bool check_iface_;
591};
592
599 class Subnet4ConfigParser : public SubnetConfigParser {
600 public:
607 Subnet4ConfigParser(bool check_iface = true);
608
616 Subnet4Ptr parse(data::ConstElementPtr subnet,
617 bool encapsulate_options = true);
618
619 protected:
620
627 void initSubnet(data::ConstElementPtr params,
628 asiolink::IOAddress addr, uint8_t len);
629
635 void validateResv(const Subnet4Ptr& subnet, ConstHostPtr host);
636
644 virtual boost::shared_ptr<PoolsListParser>
645 createPoolsListParser() const;
646};
647
653 class Subnets4ListConfigParser : public isc::data::SimpleParser {
654 public:
655
660 Subnets4ListConfigParser(bool check_iface = true);
661
663 virtual ~Subnets4ListConfigParser() {
664 }
665
677 size_t parse(SrvConfigPtr cfg, data::ConstElementPtr subnets_list,
678 bool encapsulate_options = true);
679
687 size_t parse(Subnet4Collection& subnets,
688 data::ConstElementPtr subnets_list,
689 bool encapsulate_options = true);
690
691 protected:
692
700 virtual boost::shared_ptr<Subnet4ConfigParser> createSubnetConfigParser() const;
701
703 bool check_iface_;
704};
705
714 class Pool6Parser : public PoolParser {
715 protected:
724 PoolPtr poolMaker (asiolink::IOAddress &addr, uint32_t len, int32_t ptype);
725
734 PoolPtr poolMaker (asiolink::IOAddress &min, asiolink::IOAddress &max,
735 int32_t ptype);
736};
737
739 class Pools6ListParser : public PoolsListParser {
740 public:
741
751 void parse(PoolStoragePtr pools, data::ConstElementPtr pools_list,
752 bool encapsulate_options = true);
753
754 protected:
755
763 virtual boost::shared_ptr<PoolParser> createPoolConfigParser() const;
764};
765
783 class PdPoolParser : public isc::data::SimpleParser {
784 public:
785
788 PdPoolParser();
789
791 virtual ~PdPoolParser() {
792 }
793
806 void parse(PoolStoragePtr pools, data::ConstElementPtr pd_pool_,
807 bool encapsulate_options = true);
808
809 protected:
810
818 virtual boost::shared_ptr<OptionDataListParser>
819 createOptionDataListParser() const;
820
822 isc::dhcp::Pool6Ptr pool_;
823
827 isc::data::ConstElementPtr user_context_;
828
832 isc::data::ConstElementPtr client_class_;
833};
834
840 class PdPoolsListParser : public isc::data::SimpleParser {
841 public:
842
844 virtual ~PdPoolsListParser() {
845 }
846
857 void parse(PoolStoragePtr pools, data::ConstElementPtr pd_pool_list);
858
859 protected:
860
868 virtual boost::shared_ptr<PdPoolParser>
869 createPdPoolConfigParser() const;
870};
871
878 class Subnet6ConfigParser : public SubnetConfigParser {
879 public:
880
887 Subnet6ConfigParser(bool check_iface = true);
888
896 Subnet6Ptr parse(data::ConstElementPtr subnet,
897 bool encapsulate_options = true);
898
899 protected:
907 virtual void duplicateOptionWarning(uint32_t code,
908 asiolink::IOAddress& addr);
909
916 void initSubnet(isc::data::ConstElementPtr params,
917 isc::asiolink::IOAddress addr, uint8_t len);
918
924 void validateResvs(const Subnet6Ptr& subnet, ConstHostPtr host);
925
933 virtual boost::shared_ptr<PoolsListParser>
934 createPoolsListParser() const;
935
943 virtual boost::shared_ptr<PdPoolsListParser>
944 createPdPoolsListParser() const;
945};
946
947
953 class Subnets6ListConfigParser : public isc::data::SimpleParser {
954 public:
955
960 Subnets6ListConfigParser(bool check_iface = true);
961
963 virtual ~Subnets6ListConfigParser() {
964 }
965
978 size_t parse(SrvConfigPtr cfg, data::ConstElementPtr subnets_list,
979 bool encapsulate_options = true);
980
989 size_t parse(Subnet6Collection& subnets,
990 data::ConstElementPtr subnets_list,
991 bool encapsulate_options = true);
992
993 protected:
994
1002 virtual boost::shared_ptr<Subnet6ConfigParser> createSubnetConfigParser() const;
1003
1005 bool check_iface_;
1006};
1007
1013 class D2ClientConfigParser : public isc::data::SimpleParser {
1014 public:
1015
1032 D2ClientConfigPtr parse(isc::data::ConstElementPtr d2_client_cfg);
1033
1035 static const isc::data::SimpleDefaults D2_CLIENT_CONFIG_DEFAULTS;
1036
1043 // to ElementPtr)
1045 static size_t setAllDefaults(isc::data::ConstElementPtr d2_config);
1046
1047 private:
1048
1056 dhcp_ddns::NameChangeProtocol
1057 getProtocol(isc::data::ConstElementPtr scope, const std::string& name);
1058
1066 dhcp_ddns::NameChangeFormat
1067 getFormat(isc::data::ConstElementPtr scope, const std::string& name);
1068
1076 D2ClientConfig::ReplaceClientNameMode
1077 getMode(isc::data::ConstElementPtr scope, const std::string& name);
1078};
1079
1080 class CompatibilityParser : public isc::data::SimpleParser {
1081 public:
1086 void parse(isc::data::ConstElementPtr cfg, isc::dhcp::SrvConfig& srv_cfg);
1087};
1088
1089} // end of isc::dhcp namespace
1090} // end of isc namespace
1091
1092#endif // DHCP_PARSERS_H
base_network_parser.h
cfg_iface.h
cfg_mac_source.h
cfg_option.h
cfg_option_def.h
isc::asiolink::IOAddress
The IOAddress class represents an IP addresses (version agnostic).
Definition io_address.h:45
isc::data::Element::ZERO_POSITION
static const Position & ZERO_POSITION()
Returns Position object with line_ and pos_ set to 0, and with an empty file name.
Definition data.h:126
isc::data::SimpleParser
A simple parser.
Definition lib/cc/simple_parser.h:68
isc::dhcp::BaseNetworkParser
Common configuration parser for shared networks and subnets.
Definition base_network_parser.h:20
isc::dhcp::CfgMACSource
Wrapper class that holds MAC/hardware address sources.
Definition cfg_mac_source.h:25
isc::dhcp::CompatibilityParser
Definition dhcp_parsers.h:1080
isc::dhcp::CompatibilityParser::parse
void parse(isc::data::ConstElementPtr cfg, isc::dhcp::SrvConfig &srv_cfg)
Parse compatibility flags.
Definition dhcp_parsers.cc:1674
isc::dhcp::ControlSocketsParser
Parser for the control-sockets structure.
Definition dhcp_parsers.h:211
isc::dhcp::ControlSocketsParser::parse
void parse(SrvConfig &srv_cfg, isc::data::ConstElementPtr value)
"Parses" control-sockets structure
Definition dhcp_parsers.cc:82
isc::dhcp::D2ClientConfigParser
Parser for D2ClientConfig.
Definition dhcp_parsers.h:1013
isc::dhcp::D2ClientConfigParser::parse
D2ClientConfigPtr parse(isc::data::ConstElementPtr d2_client_cfg)
Parses a given dhcp-ddns element into D2ClientConfig.
Definition dhcp_parsers.cc:1557
isc::dhcp::D2ClientConfigParser::D2_CLIENT_CONFIG_DEFAULTS
static const isc::data::SimpleDefaults D2_CLIENT_CONFIG_DEFAULTS
Defaults for the D2 client configuration.
Definition dhcp_parsers.h:1035
isc::dhcp::D2ClientConfigParser::setAllDefaults
static size_t setAllDefaults(isc::data::ConstElementPtr d2_config)
Sets all defaults for D2 client configuration.
Definition dhcp_parsers.cc:1668
isc::dhcp::D2ClientConfig::ReplaceClientNameMode
ReplaceClientNameMode
Defines the client name replacement modes.
Definition d2_client_cfg.h:76
isc::dhcp::DhcpConfigError
To be removed. Please use ConfigError instead.
Definition dhcp_config_error.h:58
isc::dhcp::MACSourcesListConfigParser
parser for MAC/hardware acquisition sources
Definition dhcp_parsers.h:195
isc::dhcp::MACSourcesListConfigParser::parse
void parse(CfgMACSource &mac_sources, isc::data::ConstElementPtr value)
parses parameters value
Definition dhcp_parsers.cc:52
isc::dhcp::Network::RelayInfoPtr
boost::shared_ptr< Network::RelayInfo > RelayInfoPtr
Pointer to the RelayInfo structure.
Definition network.h:210
isc::dhcp::OptionDefListParser::OptionDefListParser
OptionDefListParser(const uint16_t address_family)
Constructor.
Definition dhcp_parsers.cc:278
isc::dhcp::OptionDefListParser::parse
void parse(CfgOptionDefPtr cfg, isc::data::ConstElementPtr def_list)
Parses a list of option definitions, create them and store in cfg.
Definition dhcp_parsers.cc:283
isc::dhcp::OptionDefParser::parse
OptionDefinitionPtr parse(isc::data::ConstElementPtr option_def)
Parses an entry that describes single option definition.
Definition dhcp_parsers.cc:141
isc::dhcp::OptionDefParser::OptionDefParser
OptionDefParser(const uint16_t address_family)
Constructor.
Definition dhcp_parsers.cc:136
isc::dhcp::OptionDescriptor
Option descriptor.
Definition cfg_option.h:48
isc::dhcp::OptionSpaceContainer
Simple container for option spaces holding various items.
Definition option_space_container.h:32
isc::dhcp::Option::Universe
Universe
defines option universe DHCPv4 or DHCPv6
Definition option.h:90
isc::dhcp::PdPoolParser::PdPoolParser
PdPoolParser()
Constructor.
Definition dhcp_parsers.cc:1100
isc::dhcp::PdPoolParser::createOptionDataListParser
virtual boost::shared_ptr< OptionDataListParser > createOptionDataListParser() const
Returns an instance of the OptionDataListParser to be used in parsing the option-data structure.
Definition dhcp_parsers.cc:1203
isc::dhcp::PdPoolParser::user_context_
isc::data::ConstElementPtr user_context_
User context (optional, may be null).
Definition dhcp_parsers.h:827
isc::dhcp::PdPoolParser::parse
void parse(PoolStoragePtr pools, data::ConstElementPtr pd_pool_, bool encapsulate_options=true)
Builds a prefix delegation pool from the given configuration.
Definition dhcp_parsers.cc:1104
isc::dhcp::PdPoolParser::~PdPoolParser
virtual ~PdPoolParser()
Virtual destructor.
Definition dhcp_parsers.h:791
isc::dhcp::PdPoolParser::pool_
isc::dhcp::Pool6Ptr pool_
Pointer to the created pool object.
Definition dhcp_parsers.h:822
isc::dhcp::PdPoolParser::client_class_
isc::data::ConstElementPtr client_class_
Client class (a client has to belong to to use this pd-pool).
Definition dhcp_parsers.h:832
isc::dhcp::PdPoolsListParser
Parser for a list of prefix delegation pools.
Definition dhcp_parsers.h:840
isc::dhcp::PdPoolsListParser::createPdPoolConfigParser
virtual boost::shared_ptr< PdPoolParser > createPdPoolConfigParser() const
Returns an instance of the PdPoolParser to be used in parsing the prefix delegation pools.
Definition dhcp_parsers.cc:1219
isc::dhcp::PdPoolsListParser::~PdPoolsListParser
virtual ~PdPoolsListParser()
Virtual destructor.
Definition dhcp_parsers.h:844
isc::dhcp::PdPoolsListParser::parse
void parse(PoolStoragePtr pools, data::ConstElementPtr pd_pool_list)
Parse configuration entries.
Definition dhcp_parsers.cc:1210
isc::dhcp::Pool4Parser
Parser for IPv4 pool definitions.
Definition dhcp_parsers.h:354
isc::dhcp::Pool4Parser::poolMaker
PoolPtr poolMaker(asiolink::IOAddress &addr, uint32_t len, int32_t ignored)
Creates a Pool4 object given a IPv4 prefix and the prefix length.
Definition dhcp_parsers.cc:554
isc::dhcp::Pool6Parser
Parser for IPv6 pool definitions.
Definition dhcp_parsers.h:714
isc::dhcp::Pool6Parser::poolMaker
PoolPtr poolMaker(asiolink::IOAddress &addr, uint32_t len, int32_t ptype)
Creates a Pool6 object given a IPv6 prefix and the prefix length.
Definition dhcp_parsers.cc:1068
isc::dhcp::PoolParser
parser for a single pool definition
Definition dhcp_parsers.h:290
isc::dhcp::PoolParser::poolMaker
virtual PoolPtr poolMaker(isc::asiolink::IOAddress &min, isc::asiolink::IOAddress &max, int32_t ptype=0)=0
Creates a Pool object given starting and ending IP addresses.
isc::dhcp::PoolParser::poolMaker
virtual PoolPtr poolMaker(isc::asiolink::IOAddress &addr, uint32_t len, int32_t ptype=0)=0
Creates a Pool object given a IPv4 prefix and the prefix length.
isc::dhcp::PoolParser::parse
virtual void parse(PoolStoragePtr pools, isc::data::ConstElementPtr pool_structure, const uint16_t address_family, bool encapsulate_options=true)
parses the actual structure
Definition dhcp_parsers.cc:378
isc::dhcp::PoolParser::createOptionDataListParser
virtual boost::shared_ptr< OptionDataListParser > createOptionDataListParser(const uint16_t address_family) const
Returns an instance of the OptionDataListParser to be used in parsing the option-data structure.
Definition dhcp_parsers.cc:547
isc::dhcp::PoolParser::~PoolParser
virtual ~PoolParser()
destructor.
Definition dhcp_parsers.h:294
isc::dhcp::Pools4ListParser
Specialization of the pool list parser for DHCPv4.
Definition dhcp_parsers.h:415
isc::dhcp::Pools4ListParser::parse
void parse(PoolStoragePtr pools, data::ConstElementPtr pools_list, bool encapsulate_options=true)
parses the actual structure
Definition dhcp_parsers.cc:566
isc::dhcp::Pools4ListParser::createPoolConfigParser
virtual boost::shared_ptr< PoolParser > createPoolConfigParser() const
Returns an instance of the Pool4Parser to be used in parsing the address pools.
Definition dhcp_parsers.cc:575
isc::dhcp::Pools6ListParser
Specialization of the pool list parser for DHCPv6.
Definition dhcp_parsers.h:739
isc::dhcp::Pools6ListParser::parse
void parse(PoolStoragePtr pools, data::ConstElementPtr pools_list, bool encapsulate_options=true)
parses the actual structure
Definition dhcp_parsers.cc:1085
isc::dhcp::Pools6ListParser::createPoolConfigParser
virtual boost::shared_ptr< PoolParser > createPoolConfigParser() const
Returns an instance of the Pool6Parser to be used in parsing the address pools.
Definition dhcp_parsers.cc:1094
isc::dhcp::PoolsListParser
Parser for a list of pools.
Definition dhcp_parsers.h:382
isc::dhcp::PoolsListParser::createPoolConfigParser
virtual boost::shared_ptr< PoolParser > createPoolConfigParser() const =0
Returns an instance of the PoolParser to be used in parsing the address pools.
isc::dhcp::PoolsListParser::~PoolsListParser
virtual ~PoolsListParser()
destructor.
Definition dhcp_parsers.h:386
isc::dhcp::PoolsListParser::parse
virtual void parse(PoolStoragePtr pools, isc::data::ConstElementPtr pools_list, bool encapsulate_options)=0
parses the actual structure
isc::dhcp::RelayInfoParser::RelayInfoParser
RelayInfoParser(const isc::dhcp::Option::Universe &family)
constructor
Definition dhcp_parsers.cc:309
isc::dhcp::RelayInfoParser::addAddress
void addAddress(const std::string &name, const std::string &address_str, isc::data::ConstElementPtr relay_elem, const isc::dhcp::Network::RelayInfoPtr &relay_info)
Attempts to add an IP address to list of relay addresses.
Definition dhcp_parsers.cc:341
isc::dhcp::RelayInfoParser::parse
void parse(const isc::dhcp::Network::RelayInfoPtr &relay_info, isc::data::ConstElementPtr relay_elem)
parses the actual relay parameters
Definition dhcp_parsers.cc:314
isc::dhcp::SrvConfig
Specifies current DHCP configuration.
Definition srv_config.h:50
isc::dhcp::Subnet4ConfigParser::Subnet4ConfigParser
Subnet4ConfigParser(bool check_iface=true)
Constructor.
Definition dhcp_parsers.cc:714
isc::dhcp::Subnet4ConfigParser::createPoolsListParser
virtual boost::shared_ptr< PoolsListParser > createPoolsListParser() const
Returns an instance of the Pools4ListParser to be used in parsing the address pools.
Definition dhcp_parsers.cc:998
isc::dhcp::Subnet4ConfigParser::validateResv
void validateResv(const Subnet4Ptr &subnet, ConstHostPtr host)
Verifies the host reservation address is in the subnet range.
Definition dhcp_parsers.cc:988
isc::dhcp::Subnet4ConfigParser::initSubnet
void initSubnet(data::ConstElementPtr params, asiolink::IOAddress addr, uint8_t len)
Instantiates the IPv4 Subnet based on a given IPv4 address and prefix length.
Definition dhcp_parsers.cc:774
isc::dhcp::Subnet4ConfigParser::parse
Subnet4Ptr parse(data::ConstElementPtr subnet, bool encapsulate_options=true)
Parses a single IPv4 subnet configuration and adds to the Configuration Manager.
Definition dhcp_parsers.cc:719
isc::dhcp::Subnet6ConfigParser::createPoolsListParser
virtual boost::shared_ptr< PoolsListParser > createPoolsListParser() const
Returns an instance of the Pools6ListParser to be used in parsing the address pools.
Definition dhcp_parsers.cc:1460
isc::dhcp::Subnet6ConfigParser::createPdPoolsListParser
virtual boost::shared_ptr< PdPoolsListParser > createPdPoolsListParser() const
Returns an instance of the PdPools6ListParser to be used in parsing the prefix delegation pools.
Definition dhcp_parsers.cc:1465
isc::dhcp::Subnet6ConfigParser::parse
Subnet6Ptr parse(data::ConstElementPtr subnet, bool encapsulate_options=true)
Parses a single IPv6 subnet configuration and adds to the Configuration Manager.
Definition dhcp_parsers.cc:1230
isc::dhcp::Subnet6ConfigParser::initSubnet
void initSubnet(isc::data::ConstElementPtr params, isc::asiolink::IOAddress addr, uint8_t len)
Instantiates the IPv6 Subnet based on a given IPv6 address and prefix length.
Definition dhcp_parsers.cc:1302
isc::dhcp::Subnet6ConfigParser::duplicateOptionWarning
virtual void duplicateOptionWarning(uint32_t code, asiolink::IOAddress &addr)
Issues a DHCP6 server specific warning regarding duplicate subnet options.
Definition dhcp_parsers.cc:1295
isc::dhcp::Subnet6ConfigParser::validateResvs
void validateResvs(const Subnet6Ptr &subnet, ConstHostPtr host)
Verifies host reservation addresses are in the subnet range.
Definition dhcp_parsers.cc:1447
isc::dhcp::Subnet6ConfigParser::Subnet6ConfigParser
Subnet6ConfigParser(bool check_iface=true)
Constructor.
Definition dhcp_parsers.cc:1225
isc::dhcp::SubnetConfigParser::createPoolsListParser
virtual boost::shared_ptr< PoolsListParser > createPoolsListParser() const =0
Returns an instance of the PoolsListParser to be used in parsing the address pools.
isc::dhcp::SubnetConfigParser::SubnetConfigParser
SubnetConfigParser(uint16_t family, bool check_iface=true)
constructor
Definition dhcp_parsers.cc:581
isc::dhcp::SubnetConfigParser::subnet_
isc::dhcp::SubnetPtr subnet_
Pointer to the created subnet object.
Definition dhcp_parsers.h:581
isc::dhcp::SubnetConfigParser::createSubnet
void createSubnet(isc::data::ConstElementPtr data)
Create a new subnet using a data from child parsers.
Definition dhcp_parsers.cc:622
isc::dhcp::SubnetConfigParser::initSubnet
virtual void initSubnet(isc::data::ConstElementPtr params, isc::asiolink::IOAddress addr, uint8_t len)=0
Instantiates the subnet based on a given IP prefix and prefix length.
isc::dhcp::SubnetConfigParser::relay_info_
isc::dhcp::Network::RelayInfoPtr relay_info_
Pointer to relay information.
Definition dhcp_parsers.h:587
isc::dhcp::SubnetConfigParser::~SubnetConfigParser
virtual ~SubnetConfigParser()
virtual destructor (does nothing)
Definition dhcp_parsers.h:523
isc::dhcp::SubnetConfigParser::address_family_
uint16_t address_family_
Address family: AF_INET or AF_INET6.
Definition dhcp_parsers.h:584
isc::dhcp::SubnetConfigParser::parse
SubnetPtr parse(isc::data::ConstElementPtr subnet, bool encapsulate_options)
parses a subnet description and returns Subnet{4,6} structure
Definition dhcp_parsers.cc:589
isc::dhcp::SubnetConfigParser::check_iface_
bool check_iface_
Check if the specified interface exists in the system.
Definition dhcp_parsers.h:590
isc::dhcp::SubnetConfigParser::createOptionDataListParser
virtual boost::shared_ptr< OptionDataListParser > createOptionDataListParser() const
Returns an instance of the OptionDataListParser to be used in parsing the option-data structure.
Definition dhcp_parsers.cc:708
isc::dhcp::SubnetConfigParser::pools_
PoolStoragePtr pools_
Storage for pools belonging to this subnet.
Definition dhcp_parsers.h:578
isc::dhcp::Subnets4ListConfigParser::check_iface_
bool check_iface_
Check if the specified interface exists in the system.
Definition dhcp_parsers.h:703
isc::dhcp::Subnets4ListConfigParser::~Subnets4ListConfigParser
virtual ~Subnets4ListConfigParser()
Virtual destructor.
Definition dhcp_parsers.h:663
isc::dhcp::Subnets4ListConfigParser::parse
size_t parse(SrvConfigPtr cfg, data::ConstElementPtr subnets_list, bool encapsulate_options=true)
parses contents of the list
Definition dhcp_parsers.cc:1009
isc::dhcp::Subnets4ListConfigParser::Subnets4ListConfigParser
Subnets4ListConfigParser(bool check_iface=true)
constructor
Definition dhcp_parsers.cc:1004
isc::dhcp::Subnets4ListConfigParser::createSubnetConfigParser
virtual boost::shared_ptr< Subnet4ConfigParser > createSubnetConfigParser() const
Returns an instance of the Subnet4ConfigParser to be used in parsing the subnets.
Definition dhcp_parsers.cc:1061
isc::dhcp::Subnets6ListConfigParser::createSubnetConfigParser
virtual boost::shared_ptr< Subnet6ConfigParser > createSubnetConfigParser() const
Returns an instance of the Subnet6ConfigParser to be used in parsing the subnets.
Definition dhcp_parsers.cc:1526
isc::dhcp::Subnets6ListConfigParser::Subnets6ListConfigParser
Subnets6ListConfigParser(bool check_iface=true)
constructor
Definition dhcp_parsers.cc:1471
isc::dhcp::Subnets6ListConfigParser::~Subnets6ListConfigParser
virtual ~Subnets6ListConfigParser()
Virtual destructor.
Definition dhcp_parsers.h:963
isc::dhcp::Subnets6ListConfigParser::check_iface_
bool check_iface_
Check if the specified interface exists in the system.
Definition dhcp_parsers.h:1005
isc::dhcp::Subnets6ListConfigParser::parse
size_t parse(SrvConfigPtr cfg, data::ConstElementPtr subnets_list, bool encapsulate_options=true)
parses contents of the list
Definition dhcp_parsers.cc:1476
isc::dhcp::ValueStorage
A template class that stores named elements of a given data type.
Definition dhcp_parsers.h:56
isc::dhcp::ValueStorage::getPosition
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.
Definition dhcp_parsers.h:109
isc::dhcp::ValueStorage::getParam
ValueType getParam(const std::string &name) const
Returns the data value for the given parameter.
Definition dhcp_parsers.h:83
isc::dhcp::ValueStorage::setParam
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.
Definition dhcp_parsers.h:69
isc::dhcp::ValueStorage::getOptionalParam
ValueType getOptionalParam(const std::string &name, const ValueType &default_value) const
Returns the data value for an optional parameter.
Definition dhcp_parsers.h:131
isc::dhcp::ValueStorage::delParam
void delParam(const std::string &name)
Remove the parameter from the store.
Definition dhcp_parsers.h:149
isc::dhcp::ValueStorage::clear
void clear()
Deletes all of the entries from the store.
Definition dhcp_parsers.h:156
d2_client_cfg.h
Defines the D2ClientConfig class.
data.h
exceptions.h
isc_throw
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
Definition exceptions/exceptions.h:210
io_address.h
simple_parser.h
isc::data
Definition base_stamped_element.cc:12
isc::data::ConstElementPtr
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:29
isc::data::SimpleDefaults
std::vector< SimpleDefault > SimpleDefaults
This specifies all default values in a given scope (e.g. a subnet).
Definition lib/cc/simple_parser.h:39
isc::dhcp_ddns::NameChangeFormat
NameChangeFormat
Defines the list of data wire formats supported.
Definition ncr_msg.h:59
isc::dhcp_ddns::NameChangeProtocol
NameChangeProtocol
Defines the list of socket protocols supported.
Definition ncr_io.h:69
isc::dhcp
Definition dhcp4/client_handler.cc:20
isc::dhcp::ConfigPair
std::pair< std::string, isc::data::ConstElementPtr > ConfigPair
Combination of parameter name and configuration contents.
Definition dhcp_parsers.h:175
isc::dhcp::SubnetPtr
boost::shared_ptr< Subnet > SubnetPtr
A generic pointer to either Subnet4 or Subnet6 object.
Definition subnet.h:449
isc::dhcp::Subnet4Ptr
boost::shared_ptr< Subnet4 > Subnet4Ptr
A pointer to a Subnet4 object.
Definition subnet.h:461
isc::dhcp::PoolStorage
std::vector< PoolPtr > PoolStorage
a collection of pools
Definition dhcp_parsers.h:280
isc::dhcp::StringStoragePtr
boost::shared_ptr< StringStorage > StringStoragePtr
Definition dhcp_parsers.h:183
isc::dhcp::D2ClientConfigPtr
boost::shared_ptr< D2ClientConfig > D2ClientConfigPtr
Defines a pointer for D2ClientConfig instances.
Definition d2_client_cfg.h:236
isc::dhcp::CfgOptionDefPtr
boost::shared_ptr< CfgOptionDef > CfgOptionDefPtr
Non-const pointer.
Definition cfg_option_def.h:186
isc::dhcp::Subnet6Ptr
boost::shared_ptr< Subnet6 > Subnet6Ptr
A pointer to a Subnet6 object.
Definition subnet.h:626
isc::dhcp::Subnet6Collection
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.
Definition subnet.h:937
isc::dhcp::BooleanStoragePtr
boost::shared_ptr< BooleanStorage > BooleanStoragePtr
Definition dhcp_parsers.h:187
isc::dhcp::SrvConfigPtr
boost::shared_ptr< SrvConfig > SrvConfigPtr
Non-const pointer to the SrvConfig.
Definition srv_config.h:1136
isc::dhcp::Uint32StoragePtr
boost::shared_ptr< Uint32Storage > Uint32StoragePtr
Definition dhcp_parsers.h:179
isc::dhcp::Uint32Storage
ValueStorage< uint32_t > Uint32Storage
a collection of elements that store uint32 values
Definition dhcp_parsers.h:178
isc::dhcp::OptionDefinitionPtr
boost::shared_ptr< OptionDefinition > OptionDefinitionPtr
Pointer to option definition object.
Definition option_definition.h:55
isc::dhcp::PoolStoragePtr
boost::shared_ptr< PoolStorage > PoolStoragePtr
Definition dhcp_parsers.h:281
isc::dhcp::PoolPtr
boost::shared_ptr< Pool > PoolPtr
a pointer to either IPv4 or IPv6 Pool
Definition pool.h:726
isc::dhcp::Subnet4Collection
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.
Definition subnet.h:866
isc::dhcp::ConstHostPtr
boost::shared_ptr< const Host > ConstHostPtr
Const pointer to the Host object.
Definition host.h:840
isc::dhcp::BooleanStorage
ValueStorage< bool > BooleanStorage
Storage for parsed boolean values.
Definition dhcp_parsers.h:186
isc::dhcp::StringStorage
ValueStorage< std::string > StringStorage
a collection of elements that store string values
Definition dhcp_parsers.h:182
isc::dhcp::OptionContainer
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 > >, boost::multi_index::hashed_non_unique< boost::multi_index::member< OptionDescriptor, bool, &OptionDescriptor::cancelled_ > > > > OptionContainer
Multi index container for DHCP option descriptors.
Definition cfg_option.h:320
isc::dhcp::OptionStorage
OptionSpaceContainer< OptionContainer, OptionDescriptor, std::string > OptionStorage
Collection of containers holding option spaces.
Definition dhcp_parsers.h:40
isc::dhcp::OptionStoragePtr
boost::shared_ptr< OptionStorage > OptionStoragePtr
Shared pointer to option storage.
Definition dhcp_parsers.h:42
isc::dhcp::Pool6Ptr
boost::shared_ptr< Pool6 > Pool6Ptr
a pointer an IPv6 Pool
Definition pool.h:536
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148
network.h
option_data_parser.h
option_definition.h
option_space_container.h
optional.h
srv_config.h
isc::data::Element::Position
Represents the position of the data element within a configuration string.
Definition data.h:94
subnet.h