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

Static Public Attributes

static const uint32_t STANDARD_DNS_PORT = 53
 defines DNS standard port value
 

Additional Inherited Members

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

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

◆ enable()

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

Sets the server's enabled flag to true.

Definition at line 492 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 465 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 479 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 472 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 511 of file d2_config.h.

◆ 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 487 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(), isc::data::Element::create(), isc::data::Element::createMap(), 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(), and getPort().

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


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