]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_spanningtree/resolvers.h
1998511a179fd6284ad059f9900458d1be06bb59
[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)
27                 : Resolver(Instance, hostname, DNS_QUERY_FORWARD, cached, me), MyLink(x), Utils(U)
28         {
29         }
30
31         void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached)
32         {
33                 Utils->ValidIPs.push_back(result);
34         }
35
36         void OnError(ResolverError e, const std::string &errormessage)
37         {
38                 ServerInstance->Log(DEFAULT,"Could not resolve IP associated with Link '%s': %s",MyLink.Name.c_str(),errormessage.c_str());
39         }
40 };
41
42 #endif