| 1 |
/* |
| 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 |
int type; |
| 28 |
unsigned int flags; |
| 29 |
uint64_t precedence; |
| 30 |
char *user; |
| 31 |
char *host; |
| 32 |
struct irc_ssaddr ip; |
| 33 |
struct AccessConf *hnext; |
| 34 |
time_t expires; |
| 35 |
char *text; |
| 36 |
}; |
| 37 |
|
| 38 |
#define ATABLE_SIZE 4096 |
| 39 |
#define EXPIRE_FREQUENCY 60 |
| 40 |
#define MAX_ACB_TYPES 20 |
| 41 |
|
| 42 |
EXTERN struct AccessConf *atable[]; |
| 43 |
EXTERN struct Callback *cb_expire_confs; |
| 44 |
|
| 45 |
typedef void ACB_FREE_HANDLER(struct AccessConf *); |
| 46 |
typedef int ACB_EXAMINE_HANDLER(struct AccessConf *); |
| 47 |
|
| 48 |
EXTERN void add_access_conf(struct AccessConf *); |
| 49 |
EXTERN void destroy_access_conf(struct AccessConf *); |
| 50 |
EXTERN void acb_generic_free(struct AccessConf *); |
| 51 |
EXTERN void del_matching_access_confs(ACB_EXAMINE_HANDLER *); |
| 52 |
EXTERN int register_acb_type(void *); |
| 53 |
EXTERN void unregister_acb_type(int); |
| 54 |
EXTERN struct AccessConf *find_access_conf(int, const char *, const char *, |
| 55 |
const struct irc_ssaddr *, ACB_EXAMINE_HANDLER *); |
| 56 |
|
| 57 |
#ifdef IN_CONF_C |
| 58 |
void init_access(void); |
| 59 |
#endif |