Cname();
Cname(const std::string &host, const uint32_t ttl);
+ Cname(const std::string &host, const TimeToLive &ttl);
// serialization
friend class boost::serialization::access;
};
typedef std::map<std::string, Cname> cname_map_type;
+/// constant to give as cache_file arg to DnsCache constructor
+/// indicating that no cache file should be used
+const std::string DO_NOT_USE_CACHE_FILE = "do not use cache file!";
+
// -----------------------------------------------------------------------------
// DnsCache
~DnsCache();
// accessed from ResolverBase subclasses
- void update(const std::string &hostname, const HostAddressVec &new_data);
+ void update(const std::string &hostname, const HostAddressVec &new_ips);
void update(const std::string &hostname, const Cname &cname);
- void update(const std::string &hostname, const uint32_t ttl);
// retrieval
HostAddressVec get_ips(const std::string &hostname,
void schedule_save(const boost::system::error_code &error);
void save_to_cachefile();
void load_from_cachefile();
+ std::string key_for_hostname(const std::string &hostname) const;
};