diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-07 20:01:11 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-07 20:01:11 +0000 |
commit | 9db7f13b0c1b5cc310d4fd0021f9288fbdade97b (patch) | |
tree | ef05889d28e43405c0f15cd06e5addbc41dd6050 /include | |
parent | 2458d30566c36b23a204327872961645634ef57b (diff) |
Add TTL stuff to dns system (pass it to inherited objects)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6247 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r-- | include/dns.h | 12 | ||||
-rw-r--r-- | include/users.h | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/include/dns.h b/include/dns.h index 92f3fe8f7..cb7e0549a 100644 --- a/include/dns.h +++ b/include/dns.h @@ -50,7 +50,15 @@ class Module; /** * Result status, used internally */ -typedef std::pair<int,std::string> DNSResult; +class DNSResult : public classbase +{ + public: + int id; + std::string result; + unsigned long ttl; + + DNSResult(int i, const std::string &res, unsigned long timetolive) : id(i), result(res), ttl(timetolive) { } +}; /** * Information on a completed lookup, used internally @@ -203,7 +211,7 @@ class Resolver : public Extensible * When your lookup completes, this method will be called. * @param result The resulting DNS lookup, either an IP address or a hostname. */ - virtual void OnLookupComplete(const std::string &result) = 0; + virtual void OnLookupComplete(const std::string &result, unsigned int ttl) = 0; /** * If an error occurs (such as NXDOMAIN, no domain name found) then this method * will be called. diff --git a/include/users.h b/include/users.h index 6e79cf285..c34b60693 100644 --- a/include/users.h +++ b/include/users.h @@ -69,7 +69,7 @@ class UserResolver : public Resolver public: UserResolver(InspIRCd* Instance, userrec* user, std::string to_resolve, QueryType qt); - void OnLookupComplete(const std::string &result); + void OnLookupComplete(const std::string &result, unsigned int ttl); void OnError(ResolverError e, const std::string &errormessage); }; |