]>
jfr.im git - solanum.git/blob - include/class.h
2 * ircd-ratbox: A slightly useful ircd.
3 * class.h: The ircd class management header.
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
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.
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.
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
24 * $Id: class.h 6 2005-09-10 01:02:21Z nenolod $
27 #ifndef INCLUDED_class_h
28 #define INCLUDED_class_h
32 struct _patricia_tree_t
;
47 rb_patricia_tree_t
*ip_limits
;
54 extern rb_dlink_list class_list
;
55 extern struct Class
*default_class
;
57 #define ClassName(x) ((x)->class_name)
58 #define ConFreq(x) ((x)->con_freq)
59 #define MaxLocal(x) ((x)->max_local)
60 #define MaxGlobal(x) ((x)->max_global)
61 #define MaxIdent(x) ((x)->max_ident)
62 #define MaxUsers(x) ((x)->max_total)
63 #define PingFreq(x) ((x)->ping_freq)
64 #define MaxSendq(x) ((x)->max_sendq)
65 #define MaxSendqHard(x) ((x)->max_sendq_hard)
66 #define CurrUsers(x) ((x)->total)
67 #define IpLimits(x) ((x)->ip_limits)
68 #define CidrIpv4Bitlen(x) ((x)->cidr_ipv4_bitlen)
69 #define CidrIpv6Bitlen(x) ((x)->cidr_ipv6_bitlen)
70 #define CidrAmount(x) ((x)->cidr_amount)
71 #define ClassPtr(x) ((x)->c_class)
73 #define ConfClassName(x) (ClassPtr(x)->class_name)
74 #define ConfConFreq(x) (ClassPtr(x)->con_freq)
75 #define ConfMaxLocal(x) (ClassPtr(x)->max_local)
76 #define ConfMaxGlobal(x) (ClassPtr(x)->max_global)
77 #define ConfMaxIdent(x) (ClassPtr(x)->max_ident)
78 #define ConfMaxUsers(x) (ClassPtr(x)->max_total)
79 #define ConfPingFreq(x) (ClassPtr(x)->ping_freq)
80 #define ConfMaxSendq(x) (ClassPtr(x)->max_sendq)
81 #define ConfCurrUsers(x) (ClassPtr(x)->total)
82 #define ConfIpLimits(x) (ClassPtr(x)->ip_limits)
83 #define ConfCidrAmount(x) (ClassPtr(x)->cidr_amount)
84 #define ConfCidrIpv4Bitlen(x) (ClassPtr(x)->cidr_ipv4_bitlen)
85 #define ConfCidrIpv6Bitlen(x) (ClassPtr(x)->cidr_ipv6_bitlen)
86 #define ConfMaxSendqHard(x) (ClassPtr(x)->max_sendq_hard)
88 void add_class(struct Class
*);
90 struct Class
*make_class(void);
92 extern long get_sendq(struct Client
*);
93 extern long get_sendq_hard(struct Client
*);
94 extern int get_con_freq(struct Class
*);
95 extern struct Class
*find_class(const char *);
96 extern const char *get_client_class(struct Client
*);
97 extern int get_client_ping(struct Client
*);
98 extern void check_class(void);
99 extern void initclass(void);
100 extern void free_class(struct Class
*);
101 extern void fix_class(struct ConfItem
*, struct ConfItem
*);
102 extern void report_classes(struct Client
*);
104 #endif /* INCLUDED_class_h */