dns_utils: factor the fetching code for different DNS record types

This commit is contained in:
moneromooo-monero
2015-08-29 12:53:01 +01:00
parent 4ef0da184d
commit f928468b9b
2 changed files with 34 additions and 59 deletions
+13
View File
@@ -130,6 +130,19 @@ public:
private:
/**
* @brief gets all records of a given type from a DNS query for the supplied URL;
* if no such record is present returns an empty vector.
*
* @param url A string containing a URL to query for
* @param record_type the record type to retrieve (DNS_TYPE_A, etc)
* @param reader a function that converts a record data to a string
*
* @return A vector of strings containing the requested record; or an empty vector
*/
// TODO: modify this to accomodate DNSSEC
std::vector<std::string> get_record(const std::string& url, int record_type, std::string (*reader)(const char *,size_t), bool& dnssec_available, bool& dnssec_valid);
/**
* @brief Checks a string to see if it looks like a URL
*