summaryrefslogtreecommitdiff
path: root/src/modules/m_testcommand.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-03 16:47:40 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-03 16:47:40 +0000
commitf16930668a928471847cd327e1edc69b6d27b979 (patch)
treeb3863886e1bf6479858fbc564c1ba5273fcf9dc5 /src/modules/m_testcommand.cpp
parent73fda5d362f0dd7b9550badf364330b2fd4810db (diff)
Added test framework, so that i can work on improving MakeIP6Int
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4677 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_testcommand.cpp')
-rw-r--r--src/modules/m_testcommand.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/modules/m_testcommand.cpp b/src/modules/m_testcommand.cpp
index ebb09a19d..cca30de5d 100644
--- a/src/modules/m_testcommand.cpp
+++ b/src/modules/m_testcommand.cpp
@@ -33,6 +33,18 @@ class MyV6Resolver : public Resolver
virtual void OnLookupComplete(const std::string &result)
{
log(DEBUG,"*** RESOLVER COMPLETED LOOKUP, IP IS: '%s'",result.c_str());
+
+ char query[128];
+ in6_addr n;
+ if (inet_pton(AF_INET6, result.c_str(), &n) > 0)
+ {
+ DNS::MakeIP6Int(query, &n);
+ log(DEBUG,"Translation: %s",query);
+ }
+ else
+ {
+ log(DEBUG,"Bad IPV6 IP: %s",result.c_str());
+ }
}
virtual void OnError(ResolverError e, const std::string &errormessage)