]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_testcommand.cpp
kick_channel -> chanrec::KickUser(), server_kick_channel -> chanrec::ServerKickUser()
[user/henk/code/inspircd.git] / src / modules / m_testcommand.cpp
index 3b27d01d9dc78aa70337e105af6bc36fd57d63b7..6f517e8ced9c8582ae8a3a48b0ae57495c293a9e 100644 (file)
@@ -25,19 +25,23 @@ using namespace std;
 
 /* $ModDesc: Povides a proof-of-concept test /WOOT command */
 
-class MyResolver : public Resolver
+class MyV6Resolver : public Resolver
 {
+       bool fw;
  public:
-       MyResolver(const std::string &source, bool forward) : Resolver(source, forward) { }
+       MyV6Resolver(const std::string &source, bool forward) : Resolver(source, forward ? DNS_QUERY_AAAA : DNS_QUERY_PTR6)
+       {
+               fw = forward;
+       }
 
        virtual void OnLookupComplete(const std::string &result)
        {
-               log(DEBUG,"*** RESOLVER COMPLETED LOOKUP, IP IS: '%s'",result.c_str());
+               log(DEBUG,"*** RESOLVER COMPLETED %s LOOKUP, IP IS: '%s'",fw ? "FORWARD" : "REVERSE", result.c_str());
        }
 
-       virtual void OnError(ResolverError e)
+       virtual void OnError(ResolverError e, const std::string &errormessage)
        {
-               log(DEBUG,"*** RESOLVER GOT ERROR: %d",e);
+               log(DEBUG,"*** RESOLVER GOT ERROR: %d: %s",e,errormessage.c_str());
        }
 };
 
@@ -58,7 +62,9 @@ class cmd_woot : public command_t
 
                try
                {
-                       MyResolver* r = new MyResolver("brainbox.ath.cx", true);
+                       MyV6Resolver* r = new MyV6Resolver("shake.stacken.kth.se", true);
+                       Srv->AddResolver(r);
+                       r = new MyV6Resolver("2001:6b0:1:ea:202:a5ff:fecd:13a6", false);
                        Srv->AddResolver(r);
                }
                catch (ModuleException& e)