]>
jfr.im git - solanum.git/blob - include/s_auth.h
2 * ircd-ratbox: A slightly useful ircd.
3 * s_auth.h: A header for the ident functions.
5 * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
6 * Copyright (C) 1996-2002 Hybrid Development Team
7 * Copyright (C) 2002-2004 ircd-ratbox development team
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24 * $Id: s_auth.h 6 2005-09-10 01:02:21Z nenolod $
27 #ifndef INCLUDED_s_auth_h
28 #define INCLUDED_s_auth_h
33 * How many auth allocations to allocate in a block. I'm guessing that
34 * a good number here is 64, because these are temporary and don't live
35 * as long as clients do.
38 #define AUTH_BLOCK_SIZE 64
45 struct Client
*client
; /* pointer to client struct for request */
46 struct DNSQuery dns_query
; /* DNS Query */
47 unsigned int flags
; /* current state of request */
48 rb_fde_t
*F
; /* file descriptor for auth queries */
49 time_t timeout
; /* time when query expires */
53 * flag values for AuthRequest
54 * NAMESPACE: AM_xxx - Authentication Module
56 #define AM_AUTH_CONNECTING (1 << 0)
57 #define AM_AUTH_PENDING (1 << 1)
58 #define AM_DNS_PENDING (1 << 2)
60 #define SetDNSPending(x) ((x)->flags |= AM_DNS_PENDING)
61 #define ClearDNSPending(x) ((x)->flags &= ~AM_DNS_PENDING)
62 #define IsDNSPending(x) ((x)->flags & AM_DNS_PENDING)
64 #define SetAuthConnect(x) ((x)->flags |= AM_AUTH_CONNECTING)
65 #define ClearAuthConnect(x) ((x)->flags &= ~AM_AUTH_CONNECTING)
66 #define IsAuthConnect(x) ((x)->flags & AM_AUTH_CONNECTING)
68 #define SetAuthPending(x) ((x)->flags |= AM_AUTH_PENDING)
69 #define ClearAuthPending(x) ((x)->flags &= AM_AUTH_PENDING)
70 #define IsAuthPending(x) ((x)->flags & AM_AUTH_PENDING)
72 #define ClearAuth(x) ((x)->flags &= ~(AM_AUTH_PENDING | AM_AUTH_CONNECTING))
73 #define IsDoingAuth(x) ((x)->flags & (AM_AUTH_PENDING | AM_AUTH_CONNECTING))
74 /* #define SetGotId(x) ((x)->flags |= FLAGS_GOTID) */
78 extern void start_auth(struct Client
*);
79 extern void send_auth_query(struct AuthRequest
*req
);
80 extern void remove_auth_request(struct AuthRequest
*req
);
81 extern void init_auth(void);
82 extern void delete_auth_queries(struct Client
*);
84 #endif /* INCLUDED_s_auth_h */