Kea 2.7.5
|
#include <d2_simple_parser.h>
Public Member Functions | |
void | parse (const D2CfgContextPtr &ctx, const isc::data::ConstElementPtr &config, bool check_only) |
Parses the whole D2 configuration. | |
Public Member Functions inherited from isc::data::SimpleParser | |
uint16_t | getUint16 (isc::data::ConstElementPtr scope, const std::string &name) |
Returns a value converted to uint16_t. | |
uint32_t | getUint32 (isc::data::ConstElementPtr scope, const std::string &name) |
Returns a value converted to uint32_t. | |
uint8_t | getUint8 (ConstElementPtr scope, const std::string &name) |
Get an uint8_t value. | |
const isc::util::Triplet< uint32_t > | parseIntTriplet (const data::ConstElementPtr &scope, const std::string &name) |
Parses an integer triplet. | |
Static Public Member Functions | |
static size_t | setAllDefaults (data::ElementPtr global) |
Sets all defaults for D2 configuration. | |
static size_t | setDdnsDomainDefaults (data::ElementPtr domain, const data::SimpleDefaults &domain_defaults) |
Adds default values to a DDNS Domain element. | |
static size_t | setManagerDefaults (data::ElementPtr global, const std::string &mgr_name, const data::SimpleDefaults &mgr_defaults) |
Adds default values to a DDNS Domain List Manager. | |
Static Public Member Functions inherited from isc::data::SimpleParser | |
static void | checkKeywords (const SimpleKeywords &keywords, isc::data::ConstElementPtr scope) |
Checks acceptable keywords with their expected type. | |
static void | checkRequired (const SimpleRequiredKeywords &required, isc::data::ConstElementPtr scope) |
Checks that all required keywords are present. | |
static size_t | deriveParams (isc::data::ConstElementPtr parent, isc::data::ElementPtr child, const ParamsList ¶ms) |
Derives (inherits) parameters from parent scope to a child. | |
static isc::asiolink::IOAddress | getAddress (const ConstElementPtr &scope, const std::string &name) |
Returns a IOAddress parameter from a scope. | |
static bool | getBoolean (isc::data::ConstElementPtr scope, const std::string &name) |
Returns a boolean parameter from a scope. | |
static double | getDouble (const ConstElementPtr &scope, const std::string &name) |
Returns a floating point parameter from a scope. | |
static int64_t | getInteger (isc::data::ConstElementPtr scope, const std::string &name) |
Returns an integer parameter from a scope. | |
static int64_t | getInteger (isc::data::ConstElementPtr scope, const std::string &name, int64_t min, int64_t max) |
Returns an integer parameter from a scope and checks its range. | |
static const data::Element::Position & | getPosition (const std::string &name, const data::ConstElementPtr parent) |
Utility method that returns position of an element. | |
static std::string | getString (isc::data::ConstElementPtr scope, const std::string &name) |
Returns a string parameter from a scope. | |
static size_t | setDefaults (isc::data::ElementPtr scope, const SimpleDefaults &default_values) |
Sets the default values. | |
static size_t | setListDefaults (isc::data::ConstElementPtr list, const SimpleDefaults &default_values) |
Sets the default values for all entries in a list. | |
Static Public Attributes | |
static const data::SimpleDefaults | D2_GLOBAL_DEFAULTS |
This table defines default global values for D2. | |
static const data::SimpleDefaults | TSIG_KEY_DEFAULTS |
Supplies defaults for ddns-domains list elements (i.e. DdnsDomains) | |
static const data::SimpleDefaults | DDNS_DOMAIN_MGR_DEFAULTS |
Supplies defaults for optional values in DDNS domain managers (e.g. | |
static const data::SimpleDefaults | DDNS_DOMAIN_DEFAULTS |
Supplies defaults for ddns-domains list elements (i.e. DdnsDomains) | |
static const data::SimpleDefaults | DNS_SERVER_DEFAULTS |
Supplies defaults for optional values DdnsDomain entries. | |
Additional Inherited Members | |
Protected Member Functions inherited from isc::data::SimpleParser | |
template<typename target_type , target_type convert> | |
target_type | getAndConvert (isc::data::ConstElementPtr scope, const std::string &name, const std::string &type_name) |
Returns a converted value from a scope. | |
template<typename int_type > | |
int_type | getIntType (isc::data::ConstElementPtr scope, const std::string &name) |
Returns an integer value with range checking from a scope. | |
Definition at line 22 of file d2_simple_parser.h.
void isc::d2::D2SimpleParser::parse | ( | const D2CfgContextPtr & | ctx, |
const isc::data::ConstElementPtr & | config, | ||
bool | check_only ) |
Parses the whole D2 configuration.
ctx | - parsed information will be stored here |
config | - Element tree structure that holds configuration |
check_only | - if true the configuration is verified only, not applied |
ConfigError | if any issues are encountered. |
Definition at line 201 of file d2_simple_parser.cc.
References isc::data::Element::createList(), isc::dhcp_ddns::FMT_JSON, isc::hooks::HooksConfig::get(), isc::data::SimpleParser::getAddress(), isc::data::SimpleParser::getUint32(), isc::asiolink::IOServiceMgr::instance(), isc_throw, isc::data::Element::list, isc::data::Element::map, isc::dhcp_ddns::NCR_UDP, isc::dhcp_ddns::ncrFormatToString(), isc::dhcp_ddns::ncrProtocolToString(), isc::d2::TSIGKeyInfoListParser::parse(), isc::d2::DdnsDomainListMgrParser::parse(), isc::hooks::HooksLibrariesParser::parse(), isc::data::Element::string, and isc::data::UserContext::toElement().
Referenced by isc::d2::D2CfgMgr::parse().
|
static |
Sets all defaults for D2 configuration.
This method sets global and element defaults.
global | scope to be filled in with defaults. |
Definition at line 124 of file d2_simple_parser.cc.
References D2_GLOBAL_DEFAULTS, DDNS_DOMAIN_MGR_DEFAULTS, isc::data::SimpleParser::setDefaults(), isc::data::SimpleParser::setListDefaults(), setManagerDefaults(), and TSIG_KEY_DEFAULTS.
Referenced by isc::d2::D2CfgMgr::parse(), and isc::d2::D2CfgMgr::setCfgDefaults().
|
static |
Adds default values to a DDNS Domain element.
Adds the scalar default values to the given DDNS domain element, and then adds the DNS Server defaults to the domain's server list, "dns-servers".
domain | DDNS domain element to which defaults should be added |
domain_defaults | list of default values from which to add |
Definition at line 149 of file d2_simple_parser.cc.
References DNS_SERVER_DEFAULTS, isc::data::SimpleParser::setDefaults(), and isc::data::SimpleParser::setListDefaults().
Referenced by setManagerDefaults().
|
static |
Adds default values to a DDNS Domain List Manager.
This function looks for the named DDNS domain manager element within the given element tree. If it is found, it adds the scalar default values to the manager element and then adds the DDNS Domain defaults to its domain list, "ddns-domains". If the manager element is not found, then an empty map entry is added for it, thus defaulting the manager to "disabled".
global | element tree containing the DDNS domain manager element to which defaults should be added |
mgr_name | name of the manager element within the element tree (e.g. "forward-ddns", "reverse-ddns") |
mgr_defaults | list of default values from which to add |
Definition at line 166 of file d2_simple_parser.cc.
References DDNS_DOMAIN_DEFAULTS, setDdnsDomainDefaults(), and isc::data::SimpleParser::setDefaults().
Referenced by setAllDefaults().
|
static |
This table defines default global values for D2.
Some of the global parameters defined in the global scope (i.e. directly in DhcpDdns) are optional. If not defined, the following values will be used.
Definition at line 34 of file d2_simple_parser.h.
Referenced by setAllDefaults().
|
static |
Supplies defaults for ddns-domains list elements (i.e. DdnsDomains)
Definition at line 43 of file d2_simple_parser.h.
Referenced by setManagerDefaults().
|
static |
Supplies defaults for optional values in DDNS domain managers (e.g.
"forward-ddns" and "reverse-ddns").
Definition at line 40 of file d2_simple_parser.h.
Referenced by setAllDefaults().
|
static |
Supplies defaults for optional values DdnsDomain entries.
Definition at line 46 of file d2_simple_parser.h.
Referenced by setDdnsDomainDefaults().
|
static |
Supplies defaults for ddns-domains list elements (i.e. DdnsDomains)
Definition at line 37 of file d2_simple_parser.h.
Referenced by setAllDefaults().