25 |
|
#ifndef INCLUDED_s_auth_h |
26 |
|
#define INCLUDED_s_auth_h |
27 |
|
|
28 |
– |
#include "irc_res.h" |
28 |
|
#include "hook.h" |
29 |
|
|
31 |
– |
/* How many auth allocations to allocate in a block. I'm guessing that |
32 |
– |
* a good number here is 64, because these are temporary and don't live |
33 |
– |
* as long as clients do. |
34 |
– |
* -- adrian |
35 |
– |
*/ |
36 |
– |
#define AUTH_BLOCK_SIZE 64 |
37 |
– |
|
38 |
– |
struct Client; |
39 |
– |
|
40 |
– |
struct AuthRequest |
41 |
– |
{ |
42 |
– |
dlink_node dns_node; /* auth_doing_dns_list */ |
43 |
– |
dlink_node ident_node; /* auth_doing_ident_list */ |
44 |
– |
int flags; |
45 |
– |
struct Client* client; /* pointer to client struct for request */ |
46 |
– |
fde_t fd; /* file descriptor for auth queries */ |
47 |
– |
time_t timeout; /* time when query expires */ |
48 |
– |
unsigned int ip6_int; |
49 |
– |
}; |
50 |
– |
|
30 |
|
/* |
31 |
|
* flag values for AuthRequest |
32 |
|
* NAMESPACE: AM_xxx - Authentication Module |
33 |
|
*/ |
34 |
< |
#define AM_DOING_AUTH 1 |
35 |
< |
#define AM_DNS_PENDING 2 |
57 |
< |
#define CRIT_REGION 4 |
34 |
> |
#define AM_DOING_AUTH 0x1 |
35 |
> |
#define AM_DNS_PENDING 0x2 |
36 |
|
|
37 |
|
#define SetDNSPending(x) ((x)->flags |= AM_DNS_PENDING) |
38 |
|
#define ClearDNSPending(x) ((x)->flags &= ~AM_DNS_PENDING) |
42 |
|
#define ClearAuth(x) ((x)->flags &= ~AM_DOING_AUTH) |
43 |
|
#define IsDoingAuth(x) ((x)->flags & AM_DOING_AUTH) |
44 |
|
|
45 |
< |
#define IsCrit(x) ((x)->flags & CRIT_REGION) |
46 |
< |
#define SetCrit(x) ((x)->flags |= CRIT_REGION) |
47 |
< |
#define ClearCrit(x) ((x)->flags &= ~CRIT_REGION) |
45 |
> |
struct Client; |
46 |
> |
|
47 |
> |
struct AuthRequest |
48 |
> |
{ |
49 |
> |
dlink_node node; /* auth_doing_list */ |
50 |
> |
int flags; |
51 |
> |
struct Client* client; /* pointer to client struct for request */ |
52 |
> |
fde_t fd; /* file descriptor for auth queries */ |
53 |
> |
time_t timeout; /* time when query expires */ |
54 |
> |
}; |
55 |
|
|
56 |
|
extern struct Callback *auth_cb; |
57 |
|
|
58 |
+ |
extern void auth_init(void); |
59 |
|
extern void send_auth_query(struct AuthRequest *); |
60 |
|
extern void remove_auth_request(struct AuthRequest *); |
61 |
< |
extern struct AuthRequest *FindAuthClient(long); |
62 |
< |
extern void init_auth(void); |
77 |
< |
extern void delete_auth(struct Client *); |
78 |
< |
extern void release_auth_client(struct Client *); |
61 |
> |
extern void delete_auth(struct AuthRequest *); |
62 |
> |
extern void release_auth_client(struct AuthRequest *); |
63 |
|
|
64 |
|
#endif /* INCLUDED_s_auth_h */ |