diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/dns.h | 48 | ||||
-rw-r--r-- | include/inspircd.h | 2 |
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 */ |