+/** Cached item stored in the query cache.
+ */
+class CoreExport CachedQuery
+{
+ public:
+ /** The cached result data, an IP or hostname
+ */
+ std::string data;
+ /** The time when the item is due to expire
+ */
+ time_t expires;
+
+ /** Build a cached query
+ * @param res The result data, an IP or hostname
+ * @param ttl The time-to-live value of the query result
+ */
+ CachedQuery(const std::string &res, unsigned int ttl);
+
+ /** Returns the number of seconds remaining before this
+ * cache item has expired and should be removed.
+ */
+ int CalcTTLRemaining();
+};
+
+/** DNS cache information. Holds IPs mapped to hostnames, and hostnames mapped to IPs.
+ */
+typedef std::tr1::unordered_map<irc::string, CachedQuery, irc::hash> dnscache;
+