| 1 |
adx |
724 |
/* |
| 2 |
|
|
* ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). |
| 3 |
|
|
* access.h: Common code for user@host access control blocks. |
| 4 |
|
|
* |
| 5 |
|
|
* Copyright (C) 2006 by the Hybrid Development Team. |
| 6 |
|
|
* |
| 7 |
|
|
* This program is free software; you can redistribute it and/or modify |
| 8 |
|
|
* it under the terms of the GNU General Public License as published by |
| 9 |
|
|
* the Free Software Foundation; either version 2 of the License, or |
| 10 |
|
|
* (at your option) any later version. |
| 11 |
|
|
* |
| 12 |
|
|
* This program is distributed in the hope that it will be useful, |
| 13 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
|
|
* GNU General Public License for more details. |
| 16 |
|
|
* |
| 17 |
|
|
* You should have received a copy of the GNU General Public License |
| 18 |
|
|
* along with this program; if not, write to the Free Software |
| 19 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
| 20 |
|
|
* USA |
| 21 |
|
|
* |
| 22 |
|
|
* $Id$ |
| 23 |
|
|
*/ |
| 24 |
|
|
|
| 25 |
|
|
struct AccessConf |
| 26 |
|
|
{ |
| 27 |
adx |
728 |
int type; |
| 28 |
adx |
724 |
char *user; |
| 29 |
|
|
char *host; |
| 30 |
adx |
729 |
uint64_t precedence; |
| 31 |
adx |
724 |
struct irc_ssaddr ip; |
| 32 |
|
|
struct AccessConf *hnext; |
| 33 |
|
|
time_t expires; |
| 34 |
|
|
}; |
| 35 |
|
|
|
| 36 |
|
|
#define ATABLE_SIZE 4096 |
| 37 |
|
|
#define EXPIRE_FREQUENCY 60 |
| 38 |
|
|
#define MAX_ACB_TYPES 20 |
| 39 |
|
|
|
| 40 |
|
|
EXTERN struct AccessConf *atable[]; |
| 41 |
|
|
EXTERN struct Callback *cb_expire_confs; |
| 42 |
adx |
730 |
EXTERN uint64_t curprec; |
| 43 |
adx |
724 |
|
| 44 |
|
|
typedef void ACB_FREE_HANDLER(struct AccessConf *); |
| 45 |
adx |
729 |
typedef int ACB_EXAMINE_HANDLER(struct AccessConf *, void *); |
| 46 |
adx |
724 |
|
| 47 |
|
|
EXTERN void add_access_conf(struct AccessConf *); |
| 48 |
|
|
EXTERN void destroy_access_conf(struct AccessConf *); |
| 49 |
|
|
EXTERN void acb_generic_free(struct AccessConf *); |
| 50 |
adx |
729 |
EXTERN void enum_access_confs(ACB_EXAMINE_HANDLER *, void *); |
| 51 |
adx |
730 |
EXTERN int register_acb_type(const char *, void *); |
| 52 |
adx |
724 |
EXTERN void unregister_acb_type(int); |
| 53 |
adx |
728 |
EXTERN struct AccessConf *find_access_conf(int, const char *, const char *, |
| 54 |
adx |
729 |
const struct irc_ssaddr *, ACB_EXAMINE_HANDLER *, void *); |
| 55 |
adx |
724 |
|
| 56 |
|
|
#ifdef IN_CONF_C |
| 57 |
|
|
void init_access(void); |
| 58 |
|
|
#endif |