2 * IRC - Internet Relay Chat, include/class.h
3 * Copyright (C) 1990 Darren Reed
4 * Copyright (C) 1996 - 1997 Carlo Wood
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, or (at your option)
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.
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 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef INCLUDED_class_h
23 #define INCLUDED_class_h
24 #ifndef INCLUDED_sys_types_h
25 #include <sys/types.h>
26 #define INCLUDED_sys_types_h
35 struct ConnectionClass {
36 struct ConnectionClass* next;
38 unsigned int max_sendq;
50 #define ConClass(x) ((x)->cc_class)
51 #define PingFreq(x) ((x)->ping_freq)
52 #define ConFreq(x) ((x)->conn_freq)
53 #define MaxLinks(x) ((x)->max_links)
54 #define MaxSendq(x) ((x)->max_sendq)
55 #define Links(x) ((x)->ref_count)
57 #define ConfClass(x) ((x)->conn_class->cc_class)
58 #define ConfPingFreq(x) ((x)->conn_class->ping_freq)
59 #define ConfConFreq(x) ((x)->conn_class->conn_freq)
60 #define ConfMaxLinks(x) ((x)->conn_class->max_links)
61 #define ConfSendq(x) ((x)->conn_class->max_sendq)
62 #define ConfLinks(x) ((x)->conn_class->ref_count)
68 extern void init_class(void);
70 extern const struct ConnectionClass* get_class_list(void);
71 extern void class_mark_delete(void);
72 extern void class_delete_marked(void);
74 extern struct ConnectionClass *find_class(unsigned int cclass);
75 extern struct ConnectionClass *make_class(void);
76 extern void free_class(struct ConnectionClass * tmp);
77 extern unsigned int get_con_freq(struct ConnectionClass * clptr);
78 extern unsigned int get_client_ping(struct Client *acptr);
79 extern unsigned int get_conf_class(const struct ConfItem *aconf);
80 extern int get_conf_ping(const struct ConfItem *aconf);
81 extern unsigned int get_client_class(struct Client *acptr);
82 extern void add_class(unsigned int conclass, unsigned int ping,
83 unsigned int confreq, unsigned int maxli, unsigned int sendq);
84 extern void check_class(void);
85 extern void report_classes(struct Client *sptr);
86 extern unsigned int get_sendq(struct Client* cptr);
88 extern void class_send_meminfo(struct Client* cptr);
89 #endif /* INCLUDED_class_h */