Kea  1.9.9-git
isc::d2::DdnsDomainListMgr Class Reference

Provides storage for and management of a list of DNS domains. More...

#include <d2_config.h>

+ Inheritance diagram for isc::d2::DdnsDomainListMgr:

Public Member Functions

 DdnsDomainListMgr (const std::string &name)
 Constructor. More...
 
virtual ~DdnsDomainListMgr ()
 Destructor. More...
 
const DdnsDomainMapPtrgetDomains ()
 Fetches the domain list. More...
 
const std::string getName () const
 Fetches the manager's name. More...
 
const DdnsDomainPtrgetWildcardDomain ()
 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

isc::d2::DdnsDomainListMgr::DdnsDomainListMgr ( const std::string &  name)

Constructor.

Parameters
nameis an arbitrary label assigned to this manager.

Definition at line 293 of file d2_config.cc.

isc::d2::DdnsDomainListMgr::~DdnsDomainListMgr ( )
virtual

Destructor.

Definition at line 298 of file d2_config.cc.

Member Function Documentation

const DdnsDomainMapPtr& isc::d2::DdnsDomainListMgr::getDomains ( )
inline

Fetches the domain list.

Returns
returns a pointer reference to the list of domains.

Definition at line 671 of file d2_config.h.

const std::string isc::d2::DdnsDomainListMgr::getName ( ) const
inline

Fetches the manager's name.

Returns
returns a std::string containing the name of the manager.

Definition at line 649 of file d2_config.h.

const DdnsDomainPtr& isc::d2::DdnsDomainListMgr::getWildcardDomain ( )
inline

Fetches the wild card domain.

Returns
returns a pointer reference to the domain. The pointer will empty if the wild card domain is not present.

Definition at line 664 of file d2_config.h.

bool isc::d2::DdnsDomainListMgr::matchDomain ( const std::string &  fqdn,
DdnsDomainPtr domain 
)
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.

Parameters
fqdnis the name for which to look.
domainreceives the matching domain. If no match is found its contents will be unchanged.
Returns
returns true if a match is found, false otherwise.
Todo:
This is a very basic match method, which expects valid FQDNs both as input and for the DdnsDomain::getName(). Currently both are simple strings and there is no normalization (i.e. added trailing dots if missing).

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().

+ Here is the call graph for this function:

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_.

uint32_t isc::d2::DdnsDomainListMgr::size ( ) const
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().

ElementPtr isc::d2::DdnsDomainListMgr::toElement ( ) const
virtual

Unparse a configuration object.

Returns
a pointer to a configuration

Implements isc::data::CfgToElement.

Definition at line 385 of file d2_config.cc.

Member Data Documentation

const char * isc::d2::DdnsDomainListMgr::wildcard_domain_name_ = "*"
static

defines the domain name for denoting the wildcard domain.

Definition at line 616 of file d2_config.h.

Referenced by setDomains().


The documentation for this class was generated from the following files: