From a4b78330738ac8fdc3d4ac0f0a5791082677eb6a Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 2 Aug 2006 20:34:23 +0000 Subject: Move more stuff into private members of class DNS git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4654 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/dns.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/dns.h b/include/dns.h index 5ef3f60e5..4b5d5df37 100644 --- a/include/dns.h +++ b/include/dns.h @@ -57,6 +57,13 @@ enum ResolverError class DNSRequest; class DNSHeader; +class ResourceRecord; + +/* A set of requests keyed by request id */ +typedef std::map requestlist; + +/* An iterator into a set of requests */ +typedef requestlist::iterator requestlist_iter; /** * The Resolver class is a high-level abstraction for resolving DNS entries. @@ -144,17 +151,26 @@ class Resolver : public Extensible class DNS : public Extensible { private: + + requestlist requests; insp_inaddr myserver; static int MasterSocket; Resolver* Classes[65536]; + int MakePayload(const char * const name, const unsigned short rr, const unsigned short rr_class, unsigned char * const payload); + public: + + static void FillResourceRecord(ResourceRecord* rr, const unsigned char *input); + static void FillHeader(DNSHeader *header, const unsigned char *input, const int length); + static void EmptyHeader(unsigned char *output, const DNSHeader *header, const int length); static int GetMasterSocket(); + 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); + DNSRequest* AddQuery(DNSHeader *header, int &id); DNS(); ~DNS(); }; -- cgit v1.2.3