Kea
1.9.9-git
|
Represents a specific DNS Server. More...
#include <d2_config.h>
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::IOAddress & | getIpAddress () 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... | |
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.
isc::d2::DnsServerInfo::DnsServerInfo | ( | const std::string & | hostname, |
isc::asiolink::IOAddress | ip_address, | ||
uint32_t | port = STANDARD_DNS_PORT , |
||
bool | enabled = true |
||
) |
Constructor.
hostname | is the resolvable name of the server. If not blank, then the server address should be resolved at runtime. |
ip_address | is the static IP address of the server. If hostname is blank, then this address should be used to connect to the server. |
port | is 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.) |
enabled | is a flag that indicates whether this server is enabled for use. It defaults to true. |
Definition at line 203 of file d2_config.cc.
|
virtual |
Destructor.
Definition at line 210 of file d2_config.cc.
|
inline |
Sets the server's enabled flag to false.
Definition at line 480 of file d2_config.h.
|
inline |
Sets the server's enabled flag to true.
Definition at line 475 of file d2_config.h.
|
inline |
Getter which returns the server's hostname.
Definition at line 448 of file d2_config.h.
|
inline |
Getter which returns the server's ip_address.
Definition at line 462 of file d2_config.h.
Referenced by toText().
|
inline |
Getter which returns the server's port number.
Definition at line 455 of file d2_config.h.
Referenced by toText().
|
inline |
Convenience method which returns whether or not the server is enabled.
Definition at line 470 of file d2_config.h.
|
virtual |
Unparse a configuration object.
Implements isc::data::CfgToElement.
Definition at line 221 of file d2_config.cc.
References isc::data::UserContext::contextToElement(), and isc::asiolink::IOAddress::toText().
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<<().
|
static |
defines DNS standard port value
Definition at line 423 of file d2_config.h.