20 #include <boost/foreach.hpp>
161 const size_t dns_server_timeout,
184 return(dns_server_timeout_);
189 return(ncr_protocol_);
213 std::string
toText()
const;
237 size_t dns_server_timeout_;
253 operator<<(std::ostream& os,
const D2Params& config);
308 TSIGKeyInfo(
const std::string& name,
const std::string& algorithm,
309 const std::string& secret, uint32_t digestbits = 0);
332 return (digestbits_);
389 std::string algorithm_;
396 uint32_t digestbits_;
439 uint32_t port = STANDARD_DNS_PORT,
463 return (ip_address_);
485 std::string
toText()
const;
496 std::string hostname_;
511 operator<<(std::ostream& os,
const DnsServerInfo& server);
539 DnsServerInfoStoragePtr servers,
570 return (tsig_key_info_);
583 DnsServerInfoStoragePtr servers_;
587 TSIGKeyInfoPtr tsig_key_info_;
644 virtual bool matchDomain(
const std::string& fqdn, DdnsDomainPtr& domain);
657 return (domains_->size());
665 return (wildcard_domain_);
690 DdnsDomainMapPtr domains_;
693 DdnsDomainPtr wildcard_domain_;
846 const TSIGKeyInfoMapPtr keys);
868 const TSIGKeyInfoMapPtr keys);
890 const std::string& mgr_name,
891 const TSIGKeyInfoMapPtr keys);
898 #endif // D2_CONFIG_H
static const char * HMAC_SHA256_STR
The Name class encapsulates DNS names.
static const char * wildcard_domain_name_
defines the domain name for denoting the wildcard domain.
boost::shared_ptr< TSIGKeyInfo > TSIGKeyInfoPtr
Defines a pointer for TSIGKeyInfo instances.
std::ostream & operator<<(std::ostream &os, const D2Params &config)
Dumps the contents of a D2Params as text to an output stream.
virtual process::ConfigPtr clone()
Creates a clone of a DStubContext.
boost::shared_ptr< D2Params > D2ParamsPtr
Defines a pointer for D2Params instances.
boost::shared_ptr< TSIGKeyInfoMap > TSIGKeyInfoMapPtr
Defines a pointer to map of TSIGkeyInfos.
const isc::asiolink::IOAddress & getIpAddress() const
Return the IP address D2 listens on.
const dhcp_ddns::NameChangeFormat & getNcrFormat() const
Return the expected format of inbound requests (NCRs).
uint32_t size() const
Returns the number of domains in the domain list.
const TSIGKeyInfoPtr & getTSIGKeyInfo()
Getter which returns the domain's TSIGKey info.
A generic exception that is thrown when a function is not implemented.
uint32_t getPort() const
Getter which returns the server's port number.
const std::string getName() const
Getter which returns the domain's name.
DdnsDomainListMgrPtr parse(data::ConstElementPtr mgr_config, const std::string &mgr_name, const TSIGKeyInfoMapPtr keys)
Performs the actual parsing of the given manager element.
boost::shared_ptr< DdnsDomainListMgr > DdnsDomainListMgrPtr
Defines a pointer for DdnsDomain instances.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
const dhcp_ddns::NameChangeProtocol & getNcrProtocol() const
Return the socket protocol in use.
Parser for a list of DdnsDomains.
boost::shared_ptr< DdnsDomain > DdnsDomainPtr
Defines a pointer for DdnsDomain instances.
const std::string getHostname() const
Getter which returns the server's hostname.
virtual ~DScalarContext()
Destructor.
Storage container for scalar configuration parameters.
Base class for user context.
Parser for DdnsDomainListMgr.
DnsServerInfoPtr parse(data::ConstElementPtr server_config)
Performs the actual parsing of the given "dns-server" element.
Base class for all configurations.
static const char * HMAC_SHA224_STR
Exception thrown when the error during configuration handling occurs.
bool operator==(const D2Params &other) const
Compares two D2Params's for equality.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
boost::shared_ptr< Element > ElementPtr
boost::shared_ptr< DScalarContext > DScalarContextPtr
Defines a pointer for DScalarContext instances.
void setDomains(DdnsDomainMapPtr domains)
Sets the manger's domain list to the given list of domains.
std::map< std::string, TSIGKeyInfoPtr > TSIGKeyInfoMap
Defines a map of TSIGKeyInfos, keyed by the name.
NameChangeFormat
Defines the list of data wire formats supported.
TSIGKeyInfoMapPtr parse(data::ConstElementPtr key_list_config)
Performs the parsing of the given list "tsig-key" elements.
std::vector< DnsServerInfoPtr > DnsServerInfoStorage
Defines a storage container for DnsServerInfo pointers.
DdnsDomainPtr parse(data::ConstElementPtr domain_config, const TSIGKeyInfoMapPtr keys)
Performs the actual parsing of the given "ddns-domain" element.
static const char * HMAC_SHA384_STR
virtual ~TSIGKeyInfo()
Destructor.
std::pair< std::string, DdnsDomainPtr > DdnsDomainMapPair
Defines a iterator pairing domain name and DdnsDomain.
void disable()
Sets the server's enabled flag to false.
const std::string getSecret() const
Getter which returns the key's secret.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
size_t getPort() const
Return the TCP/UPD port D2 listens on.
Represents a DNS domain that is may be updated dynamically.
static const uint32_t STANDARD_DNS_PORT
defines DNS standard port value
const DnsServerInfoStoragePtr & getServers()
Getter which returns the domain's list of servers.
const std::string getAlgorithm() const
Getter which returns the key's algorithm string ID.
D2Params()
Default constructor The default constructor creates an instance that has updates disabled.
Abstract class for configuration Cfg_* classes.
Parser for a list of DnsServerInfos.
static const dns::Name & stringToAlgorithmName(const std::string &algorithm_id)
Converts algorithm id to dns::TSIGKey algorithm dns::Name.
virtual bool matchDomain(const std::string &fqdn, DdnsDomainPtr &domain)
Matches a given name to a domain based on a longest match scheme.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
boost::shared_ptr< const Element > ConstElementPtr
bool operator!=(const D2Params &other) const
Compares two D2Params's for inequality.
std::map< std::string, DdnsDomainPtr > DdnsDomainMap
Defines a map of DdnsDomains, keyed by the domain name.
Provides storage for and management of a list of DNS domains.
boost::shared_ptr< TSIGKey > TSIGKeyPtr
const std::string getName() const
Getter which returns the key's name.
bool isEnabled() const
Convenience method which returns whether or not the server is enabled.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
std::string toText() const
Generates a string representation of the class contents.
virtual void validateContents()
Validates member values.
DdnsDomain(const std::string &name, DnsServerInfoStoragePtr servers, const TSIGKeyInfoPtr &tsig_key_info=TSIGKeyInfoPtr())
Constructor.
DdnsDomainMapPtr parse(data::ConstElementPtr domain_list_config, const TSIGKeyInfoMapPtr keys)
Performs the actual parsing of the given list "ddns-domain" elements.
const isc::asiolink::IOAddress & getIpAddress() const
Getter which returns the server's ip_address.
const DdnsDomainPtr & getWildcardDomain()
Fetches the wild card domain.
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-dhcp-ddns.
DdnsDomainListMgr(const std::string &name)
Constructor.
TSIGKeyInfo(const std::string &name, const std::string &algorithm, const std::string &secret, uint32_t digestbits=0)
Constructor.
Represents a specific DNS Server.
static const char * HMAC_SHA1_STR
std::string getConfigSummary() const
Return summary of the configuration used by D2.
const std::string getName() const
Fetches the manager's name.
virtual ~DdnsDomain()
Destructor.
DnsServerInfo(const std::string &hostname, isc::asiolink::IOAddress ip_address, uint32_t port=STANDARD_DNS_PORT, bool enabled=true)
Constructor.
virtual ~DnsServerInfo()
Destructor.
std::string toText() const
Returns a text representation for the server.
const DdnsDomainMapPtr & getDomains()
Fetches the domain list.
size_t getDnsServerTimeout() const
Return the DNS server timeout value.
const std::string getKeyName() const
Convenience method which returns the domain's TSIG key name.
std::pair< std::string, TSIGKeyInfoPtr > TSIGKeyInfoMapPair
Defines a iterator pairing of name and TSIGKeyInfo.
static const char * HMAC_MD5_STR
Defines string values for the supported TSIG algorithms.
virtual ~D2Params()
Destructor.
uint32_t getDigestbits() const
Getter which returns the key's minimum truncated length.
NameChangeProtocol
Defines the list of socket protocols supported.
D2CfgError(const char *file, size_t line, const char *what)
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
DScalarContext(const DScalarContext &rhs)
Copy constructor.
const dns::TSIGKeyPtr & getTSIGKey() const
Getter which returns the TSIG key used to sign and verify messages.
Parser for a list of TSIGKeyInfos.
boost::shared_ptr< DnsServerInfoStorage > DnsServerInfoStoragePtr
Defines a pointer to DnsServerInfo storage containers.
The IOAddress class represents an IP addresses (version agnostic)
DnsServerInfoStoragePtr parse(data::ConstElementPtr server_list_config)
Performs the actual parsing of the given list "dns-server" elements.
void enable()
Sets the server's enabled flag to true.
boost::shared_ptr< DdnsDomainMap > DdnsDomainMapPtr
Defines a pointer to DdnsDomain storage containers.
Parser for DnsServerInfo.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
boost::shared_ptr< DnsServerInfo > DnsServerInfoPtr
Defines a pointer for DnsServerInfo instances.
Acts as a storage vault for D2 global scalar parameters.
static const char * HMAC_SHA512_STR
virtual ~DdnsDomainListMgr()
Destructor.
boost::shared_ptr< ConfigBase > ConfigPtr
Non-const pointer to the ConfigBase.
DScalarContext()
Constructor.
TSIGKeyInfoPtr parse(data::ConstElementPtr key_config)
Performs the actual parsing of the given "tsig-key" element.