| 27 |
|
#ifndef INCLUDED_s_auth_h |
| 28 |
|
#define INCLUDED_s_auth_h |
| 29 |
|
|
| 30 |
< |
enum |
| 31 |
< |
{ |
| 32 |
< |
AM_IN_AUTH = 1 << 0, |
| 33 |
< |
AM_DOING_AUTH = 1 << 1, |
| 34 |
< |
AM_DNS_PENDING = 1 << 2 |
| 35 |
< |
}; |
| 30 |
> |
#define RFC1413_BUFSIZ 512 /*!< rfc1413 says we MUST accept 512 bytes */ |
| 31 |
> |
#define RFC1413_PORT 113 /*!< As defined per rfc1413, IDENT server listens on TCP port 113 */ |
| 32 |
> |
|
| 33 |
> |
#define AM_IN_AUTH 0x00000001U |
| 34 |
> |
#define AM_DOING_AUTH 0x00000002U |
| 35 |
> |
#define AM_DNS_PENDING 0x00000004U |
| 36 |
|
|
| 37 |
|
#define SetInAuth(x) ((x)->flags |= AM_IN_AUTH) |
| 38 |
|
#define ClearInAuth(x) ((x)->flags &= ~AM_IN_AUTH) |
| 48 |
|
|
| 49 |
|
struct Client; |
| 50 |
|
|
| 51 |
+ |
/** Stores state of the DNS and RFC 1413 ident lookups for a client. */ |
| 52 |
|
struct AuthRequest |
| 53 |
|
{ |
| 54 |
< |
dlink_node node; /* auth_doing_list */ |
| 55 |
< |
unsigned int flags; |
| 56 |
< |
struct Client *client; /* pointer to client struct for request */ |
| 57 |
< |
fde_t fd; /* file descriptor for auth queries */ |
| 58 |
< |
time_t timeout; /* time when query expires */ |
| 54 |
> |
dlink_node node; /*!< auth_doing_list */ |
| 55 |
> |
unsigned int flags; /*!< Current state of request */ |
| 56 |
> |
struct Client *client; /*!< Pointer to Client structure for request */ |
| 57 |
> |
fde_t fd; /*!< File descriptor for auth queries */ |
| 58 |
> |
time_t timeout; /*!< Time when query expires */ |
| 59 |
|
}; |
| 60 |
|
|
| 61 |
|
extern void auth_init(void); |
| 62 |
|
extern void start_auth(struct Client *); |
| 63 |
|
extern void delete_auth(struct AuthRequest *); |
| 64 |
|
extern void release_auth_client(struct AuthRequest *); |
| 65 |
< |
#endif /* INCLUDED_s_auth_h */ |
| 65 |
> |
#endif |