00001 /* 00002 * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). 00003 * s_auth.h: A header for the ident functions. 00004 * 00005 * Copyright (C) 2002 by the past and present ircd coders, and others. 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00020 * USA 00021 * 00022 * $Id: s_auth.h 33 2005-10-02 20:50:00Z knight $ 00023 */ 00024 00025 #ifndef INCLUDED_s_auth_h 00026 #define INCLUDED_s_auth_h 00027 00028 #include "irc_res.h" 00029 #include "hook.h" 00030 00031 /* How many auth allocations to allocate in a block. I'm guessing that 00032 * a good number here is 64, because these are temporary and don't live 00033 * as long as clients do. 00034 * -- adrian 00035 */ 00036 #define AUTH_BLOCK_SIZE 64 00037 00038 struct Client; 00039 00040 struct AuthRequest 00041 { 00042 dlink_node dns_node; /* auth_doing_dns_list */ 00043 dlink_node ident_node; /* auth_doing_ident_list */ 00044 int flags; 00045 struct Client* client; /* pointer to client struct for request */ 00046 fde_t fd; /* file descriptor for auth queries */ 00047 time_t timeout; /* time when query expires */ 00048 unsigned int ip6_int; 00049 }; 00050 00051 /* 00052 * flag values for AuthRequest 00053 * NAMESPACE: AM_xxx - Authentication Module 00054 */ 00055 #define AM_DOING_AUTH 1 00056 #define AM_DNS_PENDING 2 00057 #define CRIT_REGION 4 00058 00059 #define SetDNSPending(x) ((x)->flags |= AM_DNS_PENDING) 00060 #define ClearDNSPending(x) ((x)->flags &= ~AM_DNS_PENDING) 00061 #define IsDNSPending(x) ((x)->flags & AM_DNS_PENDING) 00062 00063 #define SetDoingAuth(x) ((x)->flags |= AM_DOING_AUTH) 00064 #define ClearAuth(x) ((x)->flags &= ~AM_DOING_AUTH) 00065 #define IsDoingAuth(x) ((x)->flags & AM_DOING_AUTH) 00066 00067 #define IsCrit(x) ((x)->flags & CRIT_REGION) 00068 #define SetCrit(x) ((x)->flags |= CRIT_REGION) 00069 #define ClearCrit(x) ((x)->flags &= ~CRIT_REGION) 00070 00071 extern struct Callback *auth_cb; 00072 00073 extern void send_auth_query(struct AuthRequest *); 00074 extern void remove_auth_request(struct AuthRequest *); 00075 extern struct AuthRequest *FindAuthClient(long); 00076 extern void init_auth(void); 00077 extern void delete_auth(struct Client *); 00078 extern void release_auth_client(struct Client *); 00079 00080 #endif /* INCLUDED_s_auth_h */