diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-08-29 12:53:01 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-08-30 15:04:09 +0100 |
commit | f928468b9b9fa584c2da252f2263f0bc7d7485fc (patch) | |
tree | 70f99572d9b5172520ea029f9ff8af2ac41b50ed /src/common/dns_utils.h | |
parent | dns_utils: simplify string handling and fix leak (diff) | |
download | monero-f928468b9b9fa584c2da252f2263f0bc7d7485fc.tar.xz |
dns_utils: factor the fetching code for different DNS record types
Diffstat (limited to '')
-rw-r--r-- | src/common/dns_utils.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/common/dns_utils.h b/src/common/dns_utils.h index 332bceafe..63bf25445 100644 --- a/src/common/dns_utils.h +++ b/src/common/dns_utils.h @@ -131,6 +131,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 * * @param addr the string to be checked |