]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_spanningtree/resolvers.h
dd7a9a21564daa16c1d7daa89d63017e6ce1a532
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / resolvers.h
1 #ifndef __RESOLVERS__H__
2 #define __RESOLVERS__H__
3
4 #include "configreader.h"
5 #include "users.h"
6 #include "channels.h"
7 #include "modules.h"
8 #include "commands/cmd_whois.h"
9 #include "commands/cmd_stats.h"
10 #include "socket.h"
11 #include "inspircd.h"
12 #include "wildcard.h"
13 #include "xline.h"
14 #include "transport.h"
15
16 #include "m_spanningtree/utils.h"
17
18 /** Handle resolving of server IPs for the cache
19  */
20 class SecurityIPResolver : public Resolver
21 {
22  private:
23         Link MyLink;
24         SpanningTreeUtilities* Utils;
25  public:
26         SecurityIPResolver(Module* me, SpanningTreeUtilities* U, InspIRCd* Instance, const std::string &hostname, Link x, bool &cached) : Resolver(Instance, hostname, DNS_QUERY_FORWARD, cached, me), 
27 MyLink(x),
28  Utils(U)
29         {
30         }
31
32         void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached)
33         {
34                 Utils->ValidIPs.push_back(result);
35         }
36
37         void OnError(ResolverError e, const std::string &errormessage)
38         {
39                 ServerInstance->Log(DEFAULT,"Could not resolve IP associated with Link '%s': %s",MyLink.Name.c_str(),errormessage.c_str());
40         }
41 };
42
43 #endif