]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/users.h
Changes
[user/henk/code/inspircd.git] / include / users.h
index f1184ea24b6250d180214de89a2e965a56c27bdf..743ea6c8ad63acc51840e8703561e150035169b7 100644 (file)
 #define __USERS_H__ 
 
 #include <string>
-
-#ifdef THREADED_DNS
-#include <pthread.h>
-#endif
-
 #include "inspircd_config.h" 
 #include "socket.h"
 #include "channels.h"
@@ -69,16 +64,23 @@ class Invited : public classbase
         irc::string channel;
 };
 
+
+
+/** Derived from Resolver, and performs user forward/reverse lookups.
+ */
 class UserResolver : public Resolver
 {
  private:
+       /** User this class is 'attached' to.
+        */
        userrec* bound_user;
        int bound_fd;
+       bool fwd;
  public:
-       UserResolver(userrec* user, std::string to_resolve, bool forward) : Resolver(to_resolve, forward), bound_user(user) { };
+       UserResolver(userrec* user, std::string to_resolve, bool forward);
 
        void OnLookupComplete(const std::string &result);
-       void OnError(ResolverError e);
+       void OnError(ResolverError e, const std::string &errormessage);
 };
 
 
@@ -266,7 +268,23 @@ class userrec : public connection
 
        /** IPV4 ip address
         */
-       insp_inaddr ip4;
+       sockaddr* ip;
+
+       /** Initialize the clients sockaddr
+        */
+       void SetSockAddr(int protocol_family, const char* ip, int port);
+
+       /** Get port number from sockaddr
+        */
+       int GetPort();
+
+       /** Get protocol family from sockaddr
+        */
+       int GetProtocolFamily();
+
+       /** Get IP string from sockaddr
+        */
+       const char* GetIPString();
 
        /* Write error string
         */
@@ -416,12 +434,6 @@ class userrec : public connection
        /** Default destructor
         */
        virtual ~userrec();
-
-#ifdef THREADED_DNS
-       /** Thread used for threaded lookups
-        */
-       pthread_t dnsthread;
-#endif
 };
 
 /** Used to hold WHOWAS information