// DnsResolver
//-----------------------------------------------------------------------------
+/**
+ * @brief Constructor.
+ *
+ * @param dns_address The DNS address to resolve.
+ * @param nameserver The server to consult about name resolution.
+ */
DnsResolver::DnsResolver(
const string &dns_address,
const string &nameserver
{
}
+/**
+ * @brief Destructor.
+ */
DnsResolver::~DnsResolver()
{
}
/**
- * @brief Check if hostname is already an IPv4 address.
- * Will insert it into #ResolvedHostAddressList.
+ * @brief Check if hostname is already an IPv4 address. Will insert it into
+ * #ResolvedHostAddressList.
*
* @param host_dns_address
* @return bool True if already an ip, false if not
}
/**
- * @return the amount of IPs resolved for the DNS.
+ * @brief Obtain the amount of IP addresses resolved for the host name provided
+ * to this object.
+ *
+ * @return The amount of IPs resolved for the DNS.
*/
int DnsResolver::get_resolved_ip_count() const
{
}
/**
+ * @brief Obtain the next IP address resolved for the host name provided to
+ * this object.
+ *
* @return the next IP string in the list of resolved IPs. When reach the last
* IP, it goes back to first, like a circular buffer.
*/
}
/**
- * @return true if the last IPs resolved for the host have expired, thus
+ * @brief Check if the resolved IPs are still valid.
+ *
+ * @return @c true if the last IPs resolved for the host have expired, thus
* requiring another query for up-to-date IPs.
*/
bool DnsResolver::expired_resolved_ip()
// DnsResolver
//-----------------------------------------------------------------------------
+/**
+ * @brief The class which provides Domain Name resolution to IP addresses.
+ */
class DnsResolver
{
public:
bool handle_ip_address();
private:
- /// the list of IPs available to the host DNS
+ /// The list of IPs available to the host DNS.
std::list<HostAddress> ResolvedHostAddressList;
- /// the DNS of the host
+ /// The DNS of the host.
const std::string HostDnsAddress;
- /// the address of the server which can resolve the host address
+ /// The address of the server which can resolve the host address.
const std::string NameServer;
};