]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * ircd-ratbox: A slightly useful ircd. | |
3 | * class.h: The ircd class management header. | |
4 | * | |
5 | * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center | |
6 | * Copyright (C) 1996-2002 Hybrid Development Team | |
7 | * Copyright (C) 2002-2004 ircd-ratbox development team | |
8 | * | |
9 | * This program is free software; you can redistribute it and/or modify | |
10 | * it under the terms of the GNU General Public License as published by | |
11 | * the Free Software Foundation; either version 2 of the License, or | |
12 | * (at your option) any later version. | |
13 | * | |
14 | * This program is distributed in the hope that it will be useful, | |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | * GNU General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with this program; if not, write to the Free Software | |
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | |
22 | * USA | |
23 | */ | |
24 | ||
25 | #ifndef INCLUDED_class_h | |
26 | #define INCLUDED_class_h | |
27 | ||
28 | struct ConfItem; | |
29 | struct Client; | |
30 | struct _patricia_tree_t; | |
31 | ||
32 | struct Class | |
33 | { | |
34 | struct Class *next; | |
35 | char *class_name; | |
36 | int max_total; | |
37 | int max_autoconn; | |
38 | int max_local; | |
39 | int max_global; | |
40 | int max_ident; | |
41 | int max_sendq; | |
42 | int con_freq; | |
43 | int ping_freq; | |
44 | int total; | |
45 | rb_patricia_tree_t *ip_limits; | |
46 | int cidr_ipv4_bitlen; | |
47 | int cidr_ipv6_bitlen; | |
48 | int cidr_amount; | |
49 | ||
50 | }; | |
51 | ||
52 | extern rb_dlink_list class_list; | |
53 | extern struct Class *default_class; | |
54 | ||
55 | #define ClassName(x) ((x)->class_name) | |
56 | #define ConFreq(x) ((x)->con_freq) | |
57 | #define MaxLocal(x) ((x)->max_local) | |
58 | #define MaxGlobal(x) ((x)->max_global) | |
59 | #define MaxIdent(x) ((x)->max_ident) | |
60 | #define MaxUsers(x) ((x)->max_total) | |
61 | #define MaxAutoconn(x) ((x)->max_autoconn) | |
62 | #define PingFreq(x) ((x)->ping_freq) | |
63 | #define MaxSendq(x) ((x)->max_sendq) | |
64 | #define CurrUsers(x) ((x)->total) | |
65 | #define IpLimits(x) ((x)->ip_limits) | |
66 | #define CidrIpv4Bitlen(x) ((x)->cidr_ipv4_bitlen) | |
67 | #define CidrIpv6Bitlen(x) ((x)->cidr_ipv6_bitlen) | |
68 | #define CidrAmount(x) ((x)->cidr_amount) | |
69 | #define ClassPtr(x) ((x)->c_class) | |
70 | ||
71 | #define ConfClassName(x) (ClassPtr(x)->class_name) | |
72 | #define ConfConFreq(x) (ClassPtr(x)->con_freq) | |
73 | #define ConfMaxLocal(x) (ClassPtr(x)->max_local) | |
74 | #define ConfMaxGlobal(x) (ClassPtr(x)->max_global) | |
75 | #define ConfMaxIdent(x) (ClassPtr(x)->max_ident) | |
76 | #define ConfMaxUsers(x) (ClassPtr(x)->max_total) | |
77 | #define ConfPingFreq(x) (ClassPtr(x)->ping_freq) | |
78 | #define ConfMaxSendq(x) (ClassPtr(x)->max_sendq) | |
79 | #define ConfCurrUsers(x) (ClassPtr(x)->total) | |
80 | #define ConfIpLimits(x) (ClassPtr(x)->ip_limits) | |
81 | #define ConfCidrAmount(x) (ClassPtr(x)->cidr_amount) | |
82 | #define ConfCidrIpv4Bitlen(x) (ClassPtr(x)->cidr_ipv4_bitlen) | |
83 | #define ConfCidrIpv6Bitlen(x) (ClassPtr(x)->cidr_ipv6_bitlen) | |
84 | ||
85 | void add_class(struct Class *); | |
86 | ||
87 | struct Class *make_class(void); | |
88 | ||
89 | extern long get_sendq(struct Client *); | |
90 | extern int get_con_freq(struct Class *); | |
91 | extern struct Class *find_class(const char *); | |
92 | extern const char *get_client_class(struct Client *); | |
93 | extern int get_client_ping(struct Client *); | |
94 | extern void check_class(void); | |
95 | extern void initclass(void); | |
96 | extern void free_class(struct Class *); | |
97 | extern void fix_class(struct ConfItem *, struct ConfItem *); | |
98 | extern void report_classes(struct Client *); | |
99 | ||
100 | #endif /* INCLUDED_class_h */ |