Kea 2.7.6
|
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, 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::IOAddress & | getIpAddress () 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 TSIGKeyInfoPtr & | getTSIGKeyInfo () |
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) | |
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 433 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, | ||
const TSIGKeyInfoPtr & | tsig_key_info = TSIGKeyInfoPtr(), | ||
bool | inherited_key = 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. |
tsig_key_info | pointer to the TSIGKeyInfo for the server's key It defaults to an empty pointer, signifying the server has no key. |
inherited_key | is 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.
|
virtual |
Destructor.
Definition at line 214 of file d2_config.cc.
|
inline |
Sets the server's enabled flag to false.
Definition at line 499 of file d2_config.h.
|
inline |
Sets the server's enabled flag to true.
Definition at line 494 of file d2_config.h.
|
inline |
Getter which returns the server's hostname.
Definition at line 467 of file d2_config.h.
|
inline |
Getter which returns the server's ip_address.
Definition at line 481 of file d2_config.h.
Referenced by toText().
const std::string isc::d2::DnsServerInfo::getKeyName | ( | ) | const |
Convenience method which returns the server's TSIG key name.
Definition at line 218 of file d2_config.cc.
|
inline |
Getter which returns the server's port number.
Definition at line 474 of file d2_config.h.
Referenced by toText().
|
inline |
Getter which returns the server's TSIGKey info.
Definition at line 513 of file d2_config.h.
|
inline |
Convenience method which returns whether or not the server is enabled.
Definition at line 489 of file d2_config.h.
|
virtual |
Unparse a configuration object.
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().
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().
|
static |
defines DNS standard port value
Definition at line 436 of file d2_config.h.