![]() |
Kea
1.5.0
|
DHCP-DDNS Configuration Manager. More...
#include <d2_cfg_mgr.h>
Inheritance diagram for isc::d2::D2CfgMgr:Public Member Functions | |
| D2CfgMgr () | |
| Constructor. More... | |
| virtual | ~D2CfgMgr () |
| Destructor. More... | |
| bool | forwardUpdatesEnabled () |
| Returns whether or not forward updates are enabled. More... | |
| virtual std::string | getConfigSummary (const uint32_t selection) |
| Returns configuration summary in the textual format. More... | |
| D2CfgContextPtr | getD2CfgContext () |
| Convenience method that returns the D2 configuration context. More... | |
| const D2ParamsPtr & | getD2Params () |
| Convenience method fetches the D2Params from context. More... | |
| bool | matchForward (const std::string &fqdn, DdnsDomainPtr &domain) |
| Matches a given FQDN to a forward domain. More... | |
| bool | matchReverse (const std::string &ip_address, DdnsDomainPtr &domain) |
| Matches a given IP address to a reverse domain. More... | |
| bool | reverseUpdatesEnabled () |
| Returns whether or not reverse updates are enabled. More... | |
Public Member Functions inherited from isc::process::DCfgMgrBase | |
| DCfgMgrBase (ConfigPtr context) | |
| Constructor. More... | |
| virtual | ~DCfgMgrBase () |
| Destructor. More... | |
| ConfigPtr & | getContext () |
| Fetches the configuration context. More... | |
| isc::data::ConstElementPtr | simpleParseConfig (isc::data::ConstElementPtr config, bool check_only=false, const std::function< void()> &post_config_cb=nullptr) |
| Acts as the receiver of new configurations. More... | |
Static Public Member Functions | |
| static std::string | reverseIpAddress (const std::string &address) |
| Generate a reverse order string for the given IP address. More... | |
| static std::string | reverseV4Address (const isc::asiolink::IOAddress &ioaddr) |
| Generate a reverse order string for the given IP address. More... | |
| static std::string | reverseV6Address (const isc::asiolink::IOAddress &ioaddr) |
| Generate a reverse order string for the given IP address. More... | |
Static Public Attributes | |
| static const char * | IPV4_REV_ZONE_SUFFIX = "in-addr.arpa." |
| Reverse zone suffix added to IPv4 addresses for reverse lookups. More... | |
| static const char * | IPV6_REV_ZONE_SUFFIX = "ip6.arpa." |
| Reverse zone suffix added to IPv6 addresses for reverse lookups. More... | |
Protected Member Functions | |
| virtual process::ConfigPtr | createNewContext () |
| Creates an new, blank D2CfgContext context. More... | |
| virtual isc::data::ConstElementPtr | parse (isc::data::ConstElementPtr config, bool check_only) |
| Parses configuration of the D2. More... | |
| virtual void | setCfgDefaults (isc::data::ElementPtr mutable_config) |
| Adds default values to the given config. More... | |
Protected Member Functions inherited from isc::process::DCfgMgrBase | |
| void | resetContext () |
| Replaces existing context with a new, empty context. More... | |
| void | setContext (ConfigPtr &context) |
| Update the current context. More... | |
DHCP-DDNS Configuration Manager.
Provides the mechanisms for managing the DHCP-DDNS application's configuration. This includes services for parsing sets of configuration values, storing the parsed information in its converted form, and retrieving the information on demand.
Definition at line 130 of file d2_cfg_mgr.h.
| isc::d2::D2CfgMgr::D2CfgMgr | ( | ) |
Constructor.
Definition at line 110 of file d2_cfg_mgr.cc.
|
virtual |
Destructor.
Definition at line 113 of file d2_cfg_mgr.cc.
|
protectedvirtual |
Creates an new, blank D2CfgContext context.
This method is used at the beginning of configuration process to create a fresh, empty copy of a D2CfgContext. This new context will be populated during the configuration process and will replace the existing context provided the configuration process completes without error.
Implements isc::process::DCfgMgrBase.
Definition at line 117 of file d2_cfg_mgr.cc.
| bool isc::d2::D2CfgMgr::forwardUpdatesEnabled | ( | ) |
Returns whether or not forward updates are enabled.
This method currently uses the presence or absence of Forward DDNS Domains to determine if forward updates are enabled or disabled.
Definition at line 122 of file d2_cfg_mgr.cc.
References getD2CfgContext().
Here is the call graph for this function:
|
virtual |
Returns configuration summary in the textual format.
| selection | Bitfield which describes the parts of the configuration to be returned. This parameter is ignored for the D2. |
Implements isc::process::DCfgMgrBase.
Definition at line 242 of file d2_cfg_mgr.cc.
References getD2Params().
Here is the call graph for this function:
|
inline |
Convenience method that returns the D2 configuration context.
Definition at line 149 of file d2_cfg_mgr.h.
References isc::process::DCfgMgrBase::getContext().
Referenced by forwardUpdatesEnabled(), getD2Params(), matchForward(), matchReverse(), parse(), and reverseUpdatesEnabled().
Here is the call graph for this function:| const D2ParamsPtr & isc::d2::D2CfgMgr::getD2Params | ( | ) |
Convenience method fetches the D2Params from context.
Definition at line 237 of file d2_cfg_mgr.cc.
References getD2CfgContext().
Referenced by getConfigSummary().
Here is the call graph for this function:| bool isc::d2::D2CfgMgr::matchForward | ( | const std::string & | fqdn, |
| DdnsDomainPtr & | domain | ||
| ) |
Matches a given FQDN to a forward domain.
This calls the matchDomain method of the forward domain manager to match the given FQDN to a forward domain.
| fqdn | is the name for which to look. |
| domain | receives the matching domain. Note that it will be reset upon entry and only set if a match is subsequently found. |
| throws | D2CfgError if given an invalid fqdn. |
Definition at line 134 of file d2_cfg_mgr.cc.
References getD2CfgContext(), and isc_throw.
Here is the call graph for this function:| bool isc::d2::D2CfgMgr::matchReverse | ( | const std::string & | ip_address, |
| DdnsDomainPtr & | domain | ||
| ) |
Matches a given IP address to a reverse domain.
This calls the matchDomain method of the reverse domain manager to match the given IPv4 or IPv6 address to a reverse domain.
| ip_address | is the name for which to look. |
| domain | receives the matching domain. Note that it will be reset upon entry and only set if a match is subsequently found. |
| throws | D2CfgError if given an invalid fqdn. |
Definition at line 148 of file d2_cfg_mgr.cc.
References getD2CfgContext(), and reverseIpAddress().
Here is the call graph for this function:
|
protectedvirtual |
Parses configuration of the D2.
| config | Pointer to a configuration specified for D2. |
| check_only | Boolean flag indicating if this method should only verify correctness of the provided configuration. |
Reimplemented from isc::process::DCfgMgrBase.
Definition at line 252 of file d2_cfg_mgr.cc.
References isc::config::CONTROL_RESULT_ERROR, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), isc::d2::d2_logger, getD2CfgContext(), isc_throw, LOG_ERROR, isc::d2::D2SimpleParser::parse(), isc::d2::D2SimpleParser::setAllDefaults(), and isc::Exception::what().
Here is the call graph for this function:
|
static |
Generate a reverse order string for the given IP address.
This method creates a string containing the given IP address contents in reverse order. This format is used for matching against reverse DDNS domains in DHCP_DDNS configuration. After reversing the syllables of the address, it appends the appropriate suffix.
| address | string containing a valid IPv4 or IPv6 address. |
| D2CfgError | if given an invalid address. |
Definition at line 159 of file d2_cfg_mgr.cc.
References isc_throw, isc::asiolink::IOAddress::isV4(), reverseV4Address(), reverseV6Address(), and isc::Exception::what().
Referenced by isc::d2::NameRemoveTransaction::buildRemoveRevPtrsRequest(), isc::d2::NameAddTransaction::buildReplaceRevPtrsRequest(), and matchReverse().
Here is the call graph for this function:| bool isc::d2::D2CfgMgr::reverseUpdatesEnabled | ( | ) |
Returns whether or not reverse updates are enabled.
This method currently uses the presence or absence of Reverse DDNS Domains to determine if reverse updates are enabled or disabled.
Definition at line 128 of file d2_cfg_mgr.cc.
References getD2CfgContext().
Here is the call graph for this function:
|
static |
Generate a reverse order string for the given IP address.
This method creates a string containing the given IP address contents in reverse order. This format is used for matching against reverse DDNS domains in DHCP_DDNS configuration. After reversing the syllables of the address, it appends the appropriate suffix.
Example: input: 192.168.1.15 output: 15.1.168.192.in-addr.arpa.
| ioaddr | is the IPv4 IOaddress to convert |
| D2CfgError | if not given an IPv4 address. |
Definition at line 177 of file d2_cfg_mgr.cc.
References IPV4_REV_ZONE_SUFFIX, isc_throw, isc::asiolink::IOAddress::isV4(), and isc::asiolink::IOAddress::toBytes().
Referenced by reverseIpAddress().
Here is the call graph for this function:
|
static |
Generate a reverse order string for the given IP address.
This method creates a string containing the given IPv6 address contents in reverse order. This format is used for matching against reverse DDNS domains in DHCP_DDNS configuration. After reversing the syllables of the address, it appends the appropriate suffix.
IPv6 example: input: 2001:db8:302:99:: output: 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.9.0.0.2.0.3.0.8.B.D.0.1.0.0.2.ip6.arpa.
| ioaddr | string containing a valid IPv6 address. |
| D2CfgError | if not given an IPv6 address. |
Definition at line 207 of file d2_cfg_mgr.cc.
References isc::util::encode::encodeHex(), IPV6_REV_ZONE_SUFFIX, isc_throw, isc::asiolink::IOAddress::isV6(), and isc::asiolink::IOAddress::toBytes().
Referenced by reverseIpAddress().
Here is the call graph for this function:
|
protectedvirtual |
Adds default values to the given config.
Adds the D2 default values to the configuration Element map. This method is invoked by DCfgMgrBase::parseConfig().
| mutable_config | - configuration to which defaults should be added |
Reimplemented from isc::process::DCfgMgrBase.
Definition at line 247 of file d2_cfg_mgr.cc.
References isc::d2::D2SimpleParser::setAllDefaults().
Here is the call graph for this function:
|
static |
Reverse zone suffix added to IPv4 addresses for reverse lookups.
Definition at line 134 of file d2_cfg_mgr.h.
Referenced by reverseV4Address().
|
static |
Reverse zone suffix added to IPv6 addresses for reverse lookups.
Definition at line 138 of file d2_cfg_mgr.h.
Referenced by reverseV6Address().