summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-02 19:59:06 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-02 19:59:06 +0000
commit4d941f1b7ab853c7cfb014fb1436aac8e9397c0a (patch)
tree1161a1033c4bd16b4d58b2bcffd204c792a2ed1f /include
parent4bc3065d05685e4413dcd9d9c99f3edf22385a57 (diff)
Move more stuff into class DNS
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4651 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r--include/dns.h48
-rw-r--r--include/inspircd.h2
2 files changed, 21 insertions, 29 deletions
diff --git a/include/dns.h b/include/dns.h
index 1f520de33..50febef59 100644
--- a/include/dns.h
+++ b/include/dns.h
@@ -38,21 +38,8 @@ enum ResolverError
RESOLVER_BADIP = 4
};
-
-/** DNS is a singleton class used by the core to dispatch dns
- * requests to the dns server, and route incoming dns replies
- * back to Resolver objects, based upon the request ID. You
- * should never use this class yourself.
- */
-class DNS : public Extensible
-{
- public:
- int GetIP(const char* name);
- int GetName(const insp_inaddr* ip);
- DNSResult GetResult();
- DNS();
- ~DNS();
-};
+class DNSRequest;
+class DNSHeader;
/**
* The Resolver class is a high-level abstraction for resolving DNS entries.
@@ -132,19 +119,24 @@ class Resolver : public Extensible
int GetId();
};
-/**
- * Clear the pointer table used for Resolver classes,
- * translate ServerConfig::DNSServer into an insp_inaddr,
- * establish binding on UDP socket for DNS requests.
- */
-void init_dns();
-/**
- * Deal with a Resolver class which has become readable
- */
-void dns_deal_with_classes(int fd);
-/**
- * Add a resolver class to our active table
+/** DNS is a singleton class used by the core to dispatch dns
+ * requests to the dns server, and route incoming dns replies
+ * back to Resolver objects, based upon the request ID. You
+ * should never use this class yourself.
*/
-bool dns_add_class(Resolver* r);
+class DNS : public Extensible
+{
+ private:
+ insp_inaddr myserver;
+ public:
+ int GetIP(const char* name);
+ int GetName(const insp_inaddr* ip);
+ DNSResult GetResult();
+ void MarshallReads(int fd);
+ bool AddResolverClass(Resolver* r);
+ DNSRequest* DNSAddQuery(DNSHeader *header, int &id);
+ DNS();
+ ~DNS();
+};
#endif
diff --git a/include/inspircd.h b/include/inspircd.h
index 8e75c256c..e698efe21 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -103,6 +103,7 @@ class InspIRCd : public classbase
CommandParser* Parser;
SocketEngine* SE;
serverstats* stats;
+ DNS* Res;
std::string GetRevision();
std::string GetVersionString();
@@ -113,7 +114,6 @@ class InspIRCd : public classbase
InspIRCd(int argc, char** argv);
void DoOneIteration(bool process_module_sockets);
int Run();
-
};
/* Miscellaneous stuff here, moved from inspircd_io.h */