#include "dns/hostaddress.h"
typedef std::vector<HostAddress> HostAddressVec;
-typedef std::map<std::string, HostAddressVec> cache_map_type;
+typedef std::map<std::string, HostAddressVec> ip_map_type;
+typedef std::map<std::string, std::string> cname_map_type;
class DnsCache
{
~DnsCache();
// accessed from ResolverBase subclasses
- void update(const std::string &host_name, const HostAddressVec &new_data);
- HostAddressVec& get_data(const std::string &hostname);
+ void update(const std::string &hostname, const HostAddressVec &new_data);
+ void update(const std::string &hostname, const std::string &cname);
+ void update_ttl(const std::string &hostname, const uint32_t ttl);
+ HostAddressVec& get_ips(const std::string &hostname);
+ std::string& get_cname(const std::string &hostname);
// variables
private:
- cache_map_type DataCache;
+ ip_map_type IpCache;
+ cname_map_type CnameCache;
boost::asio::deadline_timer SaveTimer;
std::string CacheFile;
bool HasChanged;