]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/dns.h
Typo in declaration
[user/henk/code/inspircd.git] / include / dns.h
index d0cb97804c2a8dd659593a59a44739410fa1a4cd..33b5f8c7ae7f21744294f89b901a27aac8ad573e 100644 (file)
@@ -37,9 +37,10 @@ class DNS
 private:
        in_addr *binip;
        char* result;
+       char localbuf[1024];
        int t;
        void dns_init();
-       int fd;
+       int myfd;
        void dns_init_2(const char* dnsserver);
        in_addr *dns_aton4(const char * const ipstring);
        char *dns_ntoa4(const in_addr * const ip);
@@ -81,10 +82,14 @@ public:
         * to determine the status of the socket.
         */
        bool HasResult();
+       /** This method will return true if the lookup's fd matches the one provided
+        */
+       bool HasResult(int fd);
        /** This method returns the result of your query as a string, depending upon wether you
         * called DNS::ReverseLookup() or DNS::ForwardLookup.
         */
        std::string GetResult();
+       std::string GetResultIP();
        /** This method returns the file handle used by the dns query socket or zero if the
         * query is invalid for some reason, e.g. the dns server not responding.
         */
@@ -92,4 +97,11 @@ public:
        void SetNS(std::string dnsserver);
 };
 
+/** This is the handler function for multi-threaded DNS.
+ * It cannot be a class member as pthread will not let us
+ * create a thread whos handler function is a member of
+ * a class (ugh).
+ */
+void* dns_task(void* arg);
+
 #endif