Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / include / s_auth.h
index 0b03355e93d13d82f978c5a3ec631e4028e917c6..d9aee6d8821e131b5467b9b8150cd37fc75f234d 100644 (file)
@@ -23,6 +23,9 @@
 #include <sys/types.h>
 #define INCLUDED_sys_types_h
 #endif
+#ifndef INCLUDED_ircd_events_h
+#include "ircd_events.h"
+#endif
 
 struct Client;
 
@@ -32,8 +35,8 @@ struct AuthRequest {
   struct Client*      client;    /* pointer to client struct for request */
   unsigned int        flags;     /* current state of request */
   int                 fd;        /* file descriptor for auth queries */
-  int                 index;     /* select / poll index */
-  time_t              timeout;   /* time when query expires */
+  struct Socket       socket;    /* socket descriptor for auth queries */
+  struct Timer        timeout;   /* timeout timer for auth queries */
 };
 
 /*
@@ -44,6 +47,11 @@ struct AuthRequest {
 #define AM_AUTH_PENDING      0x02
 #define AM_DNS_PENDING       0x04
 
+#define AM_SOCKET            0x40 /* socket structure not destroyed */
+#define AM_TIMEOUT           0x80 /* timer structure not destroyed */
+
+#define AM_FREE_MASK         (AM_SOCKET | AM_TIMEOUT)
+
 #define SetDNSPending(x)     ((x)->flags |= AM_DNS_PENDING)
 #define ClearDNSPending(x)   ((x)->flags &= ~AM_DNS_PENDING)
 #define IsDNSPending(x)      ((x)->flags &  AM_DNS_PENDING)
@@ -63,10 +71,9 @@ struct AuthRequest {
 extern struct AuthRequest* AuthPollList; /* GLOBAL - auth queries pending io */
 
 extern void start_auth(struct Client *);
-extern void timeout_auth_queries(time_t now);
 extern void read_auth_reply(struct AuthRequest* req);
 extern void send_auth_query(struct AuthRequest* req);
-extern void remove_auth_request(struct AuthRequest *req);
+extern void destroy_auth_request(struct AuthRequest *req, int send_reports);
 
 #endif /* INCLUDED_s_auth_h */