Kea
1.9.9-git
|
Provides storage for and management of a list of DNS domains. More...
#include <d2_config.h>
Public Member Functions | |
DdnsDomainListMgr (const std::string &name) | |
Constructor. More... | |
virtual | ~DdnsDomainListMgr () |
Destructor. More... | |
const DdnsDomainMapPtr & | getDomains () |
Fetches the domain list. More... | |
const std::string | getName () const |
Fetches the manager's name. More... | |
const DdnsDomainPtr & | getWildcardDomain () |
Fetches the wild card domain. More... | |
virtual bool | matchDomain (const std::string &fqdn, DdnsDomainPtr &domain) |
Matches a given name to a domain based on a longest match scheme. More... | |
void | setDomains (DdnsDomainMapPtr domains) |
Sets the manger's domain list to the given list of domains. More... | |
uint32_t | size () const |
Returns the number of domains in the domain list. More... | |
virtual isc::data::ElementPtr | toElement () const |
Unparse a configuration object. More... | |
Public Member Functions inherited from isc::data::CfgToElement | |
virtual | ~CfgToElement () |
Destructor. More... | |
Static Public Attributes | |
static const char * | wildcard_domain_name_ = "*" |
defines the domain name for denoting the wildcard domain. More... | |
Provides storage for and management of a list of DNS domains.
In addition to housing the domain list storage, it provides domain matching services. These services are used to match a FQDN to a domain. Currently it supports a single matching service, which will return the matching domain or a wild card domain if one is specified. The wild card domain is specified as a domain whose name is "*". The wild card domain will match any entry and is provided for flexibility in FQDNs If for instance, all forward requests are handled by the same servers, the configuration could specify the wild card domain as the only forward domain. All forward DNS updates would be sent to that one list of servers, regardless of the FQDN. As matching capabilities evolve this class is expected to expand.
Definition at line 613 of file d2_config.h.
isc::d2::DdnsDomainListMgr::DdnsDomainListMgr | ( | const std::string & | name | ) |
Constructor.
name | is an arbitrary label assigned to this manager. |
Definition at line 293 of file d2_config.cc.
|
virtual |
Destructor.
Definition at line 298 of file d2_config.cc.
|
inline |
Fetches the domain list.
Definition at line 671 of file d2_config.h.
|
inline |
Fetches the manager's name.
Definition at line 649 of file d2_config.h.
|
inline |
Fetches the wild card domain.
Definition at line 664 of file d2_config.h.
|
virtual |
Matches a given name to a domain based on a longest match scheme.
Given a FQDN, search the list of domains, successively removing a sub-domain from the FQDN until a match is found. If no match is found and the wild card domain is present in the list, then return it as the match. If the wild card domain is the only domain in the list, then it will be returned immediately for any FQDN.
fqdn | is the name for which to look. |
domain | receives the matching domain. If no match is found its contents will be unchanged. |
Definition at line 320 of file d2_config.cc.
References isc::d2::DHCP_DDNS_NO_MATCH, isc::d2::dhcp_to_d2_logger, LOG_WARN, and size().
void isc::d2::DdnsDomainListMgr::setDomains | ( | DdnsDomainMapPtr | domains | ) |
Sets the manger's domain list to the given list of domains.
This method will scan the inbound list for the wild card domain and set the internal wild card domain pointer accordingly.
Definition at line 302 of file d2_config.cc.
References isc_throw, and wildcard_domain_name_.
|
inline |
Returns the number of domains in the domain list.
returns an unsigned int containing the domain count.
Definition at line 656 of file d2_config.h.
Referenced by matchDomain().
|
virtual |
Unparse a configuration object.
Implements isc::data::CfgToElement.
Definition at line 385 of file d2_config.cc.
|
static |
defines the domain name for denoting the wildcard domain.
Definition at line 616 of file d2_config.h.
Referenced by setDomains().