Kea 2.7.5
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.
 
virtual ~DdnsDomainListMgr ()
 Destructor.
 
const DdnsDomainMapPtrgetDomains ()
 Fetches the domain list.
 
const std::string getName () const
 Fetches the manager's name.
 
const DdnsDomainPtrgetWildcardDomain ()
 Fetches the wild card domain.
 
virtual bool matchDomain (const std::string &fqdn, DdnsDomainPtr &domain)
 Matches a given name to a domain based on a longest match scheme.
 
void setDomains (DdnsDomainMapPtr domains)
 Sets the manger's domain list to the given list of domains.
 
uint32_t size () const
 Returns the number of domains in the domain list.
 
virtual isc::data::ElementPtr toElement () const
 Unparse a configuration object.
 
- Public Member Functions inherited from isc::data::CfgToElement
virtual ~CfgToElement ()
 Destructor.
 

Static Public Attributes

static const char * wildcard_domain_name_ = "*"
 defines the domain name for denoting the wildcard domain.
 

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 646 of file d2_config.h.

Constructor & Destructor Documentation

◆ DdnsDomainListMgr()

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

Constructor.

Parameters
nameis an arbitrary label assigned to this manager.

Definition at line 298 of file d2_config.cc.

◆ ~DdnsDomainListMgr()

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

Destructor.

Definition at line 303 of file d2_config.cc.

Member Function Documentation

◆ getDomains()

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

Fetches the domain list.

Returns
returns a pointer reference to the list of domains.

Definition at line 704 of file d2_config.h.

◆ getName()

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 682 of file d2_config.h.

◆ getWildcardDomain()

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 697 of file d2_config.h.

◆ matchDomain()

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 325 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:

◆ setDomains()

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 307 of file d2_config.cc.

References isc_throw, and wildcard_domain_name_.

◆ size()

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 689 of file d2_config.h.

Referenced by matchDomain().

◆ toElement()

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

Unparse a configuration object.

Returns
a pointer to a configuration

Implements isc::data::CfgToElement.

Definition at line 389 of file d2_config.cc.

References isc::data::Element::createList().

+ Here is the call graph for this function:

Member Data Documentation

◆ wildcard_domain_name_

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

defines the domain name for denoting the wildcard domain.

Definition at line 649 of file d2_config.h.

Referenced by setDomains().


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