Kea  1.9.9-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)
 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...
 
uint32_t getPort () const
 Getter which returns the server's port number. 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 420 of file d2_config.h.

Constructor & Destructor Documentation

isc::d2::DnsServerInfo::DnsServerInfo ( const std::string &  hostname,
isc::asiolink::IOAddress  ip_address,
uint32_t  port = STANDARD_DNS_PORT,
bool  enabled = 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.

Definition at line 203 of file d2_config.cc.

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

Destructor.

Definition at line 210 of file d2_config.cc.

Member Function Documentation

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

Sets the server's enabled flag to false.

Definition at line 480 of file d2_config.h.

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

Sets the server's enabled flag to true.

Definition at line 475 of file d2_config.h.

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

Getter which returns the server's hostname.

Returns
returns the hostname as as std::string.

Definition at line 448 of file d2_config.h.

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

Getter which returns the server's ip_address.

Returns
returns the address as an IOAddress reference.

Definition at line 462 of file d2_config.h.

Referenced by toText().

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

Getter which returns the server's port number.

Returns
returns the port number as a unsigned integer.

Definition at line 455 of file d2_config.h.

Referenced by toText().

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

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

Returns
returns true if the server is enabled, false otherwise.

Definition at line 470 of file d2_config.h.

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

Unparse a configuration object.

Returns
a pointer to a configuration

Implements isc::data::CfgToElement.

Definition at line 221 of file d2_config.cc.

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

+ Here is the call graph for this function:

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

Returns a text representation for the server.

Definition at line 214 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

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

defines DNS standard port value

Definition at line 423 of file d2_config.h.


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