1 |
michael |
1633 |
/* |
2 |
michael |
2865 |
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) |
3 |
michael |
1633 |
* |
4 |
michael |
2865 |
* Copyright (c) 1997-2014 ircd-hybrid development team |
5 |
michael |
1633 |
* |
6 |
|
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
|
* it under the terms of the GNU General Public License as published by |
8 |
|
|
* the Free Software Foundation; either version 2 of the License, or |
9 |
|
|
* (at your option) any later version. |
10 |
|
|
* |
11 |
|
|
* This program is distributed in the hope that it will be useful, |
12 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
|
|
* GNU General Public License for more details. |
15 |
|
|
* |
16 |
|
|
* You should have received a copy of the GNU General Public License |
17 |
|
|
* along with this program; if not, write to the Free Software |
18 |
michael |
4565 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 |
19 |
michael |
1633 |
* USA |
20 |
|
|
*/ |
21 |
|
|
|
22 |
|
|
/*! \file |
23 |
|
|
* \brief Configuration managment for class{} blocks |
24 |
michael |
1635 |
* \version $Id$ |
25 |
michael |
1633 |
*/ |
26 |
|
|
|
27 |
|
|
|
28 |
|
|
#ifndef INCLUDED_conf_class_h |
29 |
|
|
#define INCLUDED_conf_class_h |
30 |
|
|
|
31 |
michael |
3087 |
enum |
32 |
|
|
{ |
33 |
|
|
CLASS_FLAGS_FAKE_IDLE = 1 << 0, |
34 |
|
|
CLASS_FLAGS_RANDOM_IDLE = 1 << 1, |
35 |
|
|
CLASS_FLAGS_HIDE_IDLE_FROM_OPERS = 1 << 2 |
36 |
|
|
}; |
37 |
michael |
1783 |
|
38 |
michael |
1633 |
struct ClassItem |
39 |
|
|
{ |
40 |
|
|
char *name; |
41 |
|
|
dlink_node node; |
42 |
|
|
dlink_list list_ipv4; /* base of per cidr ipv4 client link list */ |
43 |
|
|
dlink_list list_ipv6; /* base of per cidr ipv6 client link list */ |
44 |
michael |
1644 |
unsigned int ref_count; |
45 |
michael |
1633 |
unsigned int max_sendq; |
46 |
|
|
unsigned int max_recvq; |
47 |
michael |
1644 |
unsigned int con_freq; |
48 |
|
|
unsigned int ping_freq; |
49 |
|
|
unsigned int max_total; |
50 |
|
|
unsigned int max_local; |
51 |
|
|
unsigned int max_global; |
52 |
|
|
unsigned int max_ident; |
53 |
|
|
unsigned int max_perip; |
54 |
michael |
1783 |
unsigned int min_idle; |
55 |
|
|
unsigned int max_idle; |
56 |
michael |
3933 |
unsigned int max_channels; |
57 |
michael |
1644 |
unsigned int cidr_bitlen_ipv4; |
58 |
|
|
unsigned int cidr_bitlen_ipv6; |
59 |
|
|
unsigned int number_per_cidr; |
60 |
michael |
1783 |
unsigned int flags; |
61 |
michael |
1644 |
unsigned int active; |
62 |
michael |
1633 |
}; |
63 |
|
|
|
64 |
|
|
/* address of default class conf */ |
65 |
|
|
extern struct ClassItem *class_default; |
66 |
|
|
|
67 |
|
|
extern struct ClassItem *class_make(void); |
68 |
michael |
1783 |
extern struct ClassItem *get_class_ptr(const dlink_list *const); |
69 |
michael |
1633 |
extern const dlink_list *class_get_list(void); |
70 |
michael |
4874 |
extern void class_free(struct ClassItem *const); |
71 |
michael |
1633 |
extern void class_init(void); |
72 |
|
|
extern const char *get_client_class(const dlink_list *const); |
73 |
michael |
1644 |
extern unsigned int get_client_ping(const dlink_list *const); |
74 |
michael |
1633 |
extern unsigned int get_sendq(const dlink_list *const); |
75 |
|
|
extern unsigned int get_recvq(const dlink_list *const); |
76 |
|
|
extern struct ClassItem *class_find(const char *, int); |
77 |
|
|
extern void class_mark_for_deletion(void); |
78 |
|
|
extern void class_delete_marked(void); |
79 |
|
|
extern void destroy_cidr_class(struct ClassItem *); |
80 |
|
|
extern int cidr_limit_reached(int, struct irc_ssaddr *, struct ClassItem *); |
81 |
|
|
extern void remove_from_cidr_check(struct irc_ssaddr *, struct ClassItem *); |
82 |
michael |
1647 |
extern void rebuild_cidr_list(struct ClassItem *); |
83 |
michael |
1633 |
#endif |