Kea  2.3.5-git
isc::d2::DnsServerInfo Class Reference

Represents a specific DNS Server. More...

#include <d2_config.h>

+ Inheritance diagram for isc::d2::DnsServerInfo:

Public Member Functions

 DnsServerInfo (const std::string &hostname, isc::asiolink::IOAddress ip_address, uint32_t port=STANDARD_DNS_PORT, bool enabled=true, const TSIGKeyInfoPtr &tsig_key_info=TSIGKeyInfoPtr(), bool inherited_key=true)
 Constructor. More...
 
virtual ~DnsServerInfo ()
 Destructor. More...
 
void disable ()
 Sets the server's enabled flag to false. More...
 
void enable ()
 Sets the server's enabled flag to true. More...
 
const std::string getHostname () const
 Getter which returns the server's hostname. More...
 
const isc::asiolink::IOAddressgetIpAddress () const
 Getter which returns the server's ip_address. More...
 
const std::string getKeyName () const
 Convenience method which returns the server's TSIG key name. More...
 
uint32_t getPort () const
 Getter which returns the server's port number. More...
 
const TSIGKeyInfoPtrgetTSIGKeyInfo ()
 Getter which returns the server's TSIGKey info. More...
 
bool isEnabled () const
 Convenience method which returns whether or not the server is enabled. More...
 
virtual isc::data::ElementPtr toElement () const
 Unparse a configuration object. More...
 
std::string toText () const
 Returns a text representation for the server. More...
 
- Public Member Functions inherited from isc::data::UserContext
void contextToElement (data::ElementPtr map) const
 Merge unparse a user_context object. More...
 
data::ConstElementPtr getContext () const
 Returns const pointer to the user context. More...
 
void setContext (const data::ConstElementPtr &ctx)
 Sets user context. More...
 
- Public Member Functions inherited from isc::data::CfgToElement
virtual ~CfgToElement ()
 Destructor. More...
 

Static Public Attributes

static const uint32_t STANDARD_DNS_PORT = 53
 defines DNS standard port value More...
 

Additional Inherited Members

- Static Public Member Functions inherited from isc::data::UserContext
static data::ElementPtr toElement (data::ConstElementPtr map)
 Copy an Element map. More...
 
- Protected Attributes inherited from isc::data::UserContext
data::ConstElementPtr user_context_
 Pointer to the user context (may be NULL) More...
 

Detailed Description

Represents a specific DNS Server.

It provides information about the server's network identity and typically belongs to a list of servers supporting DNS for a given domain. It will be used to establish communications with the server to carry out DNS updates.

Definition at line 421 of file d2_config.h.

Constructor & Destructor Documentation

◆ DnsServerInfo()

isc::d2::DnsServerInfo::DnsServerInfo ( const std::string &  hostname,
isc::asiolink::IOAddress  ip_address,
uint32_t  port = STANDARD_DNS_PORT,
bool  enabled = true,
const TSIGKeyInfoPtr tsig_key_info = TSIGKeyInfoPtr(),
bool  inherited_key = true 
)

Constructor.

Parameters
hostnameis the resolvable name of the server. If not blank, then the server address should be resolved at runtime.
ip_addressis the static IP address of the server. If hostname is blank, then this address should be used to connect to the server.
portis the port number on which the server listens. primarily meant for testing purposes. Normally, DNS traffic is on is port 53. (NOTE the constructing code is responsible for setting the default.)
enabledis a flag that indicates whether this server is enabled for use. It defaults to true.
tsig_key_infopointer to the TSIGKeyInfo for the server's key It defaults to an empty pointer, signifying the server has no key.
inherited_keyis a flag that indicates whether the key was inherited from the domain or not. It defaults to true i.e. inherited.

Definition at line 203 of file d2_config.cc.

◆ ~DnsServerInfo()

isc::d2::DnsServerInfo::~DnsServerInfo ( )
virtual

Destructor.

Definition at line 214 of file d2_config.cc.

Member Function Documentation

◆ disable()

void isc::d2::DnsServerInfo::disable ( )
inline

Sets the server's enabled flag to false.

Definition at line 487 of file d2_config.h.

◆ enable()

void isc::d2::DnsServerInfo::enable ( )
inline

Sets the server's enabled flag to true.

Definition at line 482 of file d2_config.h.

◆ getHostname()

const std::string isc::d2::DnsServerInfo::getHostname ( ) const
inline

Getter which returns the server's hostname.

Returns
the hostname as a std::string.

Definition at line 455 of file d2_config.h.

◆ getIpAddress()

const isc::asiolink::IOAddress& isc::d2::DnsServerInfo::getIpAddress ( ) const
inline

Getter which returns the server's ip_address.

Returns
the address as an IOAddress reference.

Definition at line 469 of file d2_config.h.

Referenced by toText().

◆ getKeyName()

const std::string isc::d2::DnsServerInfo::getKeyName ( ) const

Convenience method which returns the server's TSIG key name.

Returns
the key name in a std::string. If server has no TSIG key, the string will be empty.

Definition at line 218 of file d2_config.cc.

◆ getPort()

uint32_t isc::d2::DnsServerInfo::getPort ( ) const
inline

Getter which returns the server's port number.

Returns
the port number as a unsigned integer.

Definition at line 462 of file d2_config.h.

Referenced by toText().

◆ getTSIGKeyInfo()

const TSIGKeyInfoPtr& isc::d2::DnsServerInfo::getTSIGKeyInfo ( )
inline

Getter which returns the server's TSIGKey info.

Returns
the pointer to the server storage. If the server is not configured to use TSIG the pointer will be empty.

Definition at line 501 of file d2_config.h.

References isc::d2::operator<<().

+ Here is the call graph for this function:

◆ isEnabled()

bool isc::d2::DnsServerInfo::isEnabled ( ) const
inline

Convenience method which returns whether or not the server is enabled.

Returns
true if the server is enabled, false otherwise.

Definition at line 477 of file d2_config.h.

◆ toElement()

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

Unparse a configuration object.

Returns
a pointer to a configuration

Implements isc::data::CfgToElement.

Definition at line 234 of file d2_config.cc.

References isc::data::UserContext::contextToElement(), and isc::asiolink::IOAddress::toText().

+ Here is the call graph for this function:

◆ toText()

std::string isc::d2::DnsServerInfo::toText ( ) const

Returns a text representation for the server.

Definition at line 227 of file d2_config.cc.

References getIpAddress(), getPort(), and isc::asiolink::IOAddress::toText().

Referenced by isc::d2::operator<<().

+ Here is the call graph for this function:

Member Data Documentation

◆ STANDARD_DNS_PORT

const uint32_t isc::d2::DnsServerInfo::STANDARD_DNS_PORT = 53
static

defines DNS standard port value

Definition at line 424 of file d2_config.h.


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