26 |
|
|
27 |
|
#include "stdinc.h" |
28 |
|
#include "list.h" |
29 |
< |
#include "ircd_defs.h" |
30 |
< |
#include "balloc.h" |
29 |
> |
#include "ircd.h" |
30 |
|
#include "conf.h" |
32 |
– |
#include "s_serv.h" |
33 |
– |
#include "resv.h" |
34 |
– |
#include "channel.h" |
31 |
|
#include "client.h" |
36 |
– |
#include "event.h" |
37 |
– |
#include "hook.h" |
38 |
– |
#include "irc_string.h" |
39 |
– |
#include "s_bsd.h" |
40 |
– |
#include "ircd.h" |
41 |
– |
#include "listener.h" |
32 |
|
#include "hostmask.h" |
33 |
< |
#include "modules.h" |
44 |
< |
#include "numeric.h" |
45 |
< |
#include "fdlist.h" |
46 |
< |
#include "log.h" |
47 |
< |
#include "send.h" |
48 |
< |
#include "s_gline.h" |
33 |
> |
#include "irc_string.h" |
34 |
|
#include "memory.h" |
50 |
– |
#include "irc_res.h" |
51 |
– |
#include "userhost.h" |
52 |
– |
#include "s_user.h" |
53 |
– |
#include "channel_mode.h" |
54 |
– |
#include "parse.h" |
55 |
– |
#include "s_misc.h" |
56 |
– |
#include "conf_db.h" |
35 |
|
|
36 |
|
|
37 |
|
struct ClassItem *class_default; |
50 |
|
{ |
51 |
|
struct ClassItem *class = MyMalloc(sizeof(*class)); |
52 |
|
|
53 |
+ |
class->active = 1; |
54 |
+ |
class->con_freq = DEFAULT_CONNECTFREQUENCY; |
55 |
+ |
class->ping_freq = DEFAULT_PINGFREQUENCY; |
56 |
+ |
class->max_total = MAXIMUM_LINKS_DEFAULT; |
57 |
+ |
class->max_sendq = DEFAULT_SENDQ; |
58 |
+ |
class->max_recvq = DEFAULT_RECVQ; |
59 |
+ |
|
60 |
|
dlinkAdd(class, &class->node, &class_list); |
61 |
|
|
62 |
|
return class; |
77 |
|
void |
78 |
|
class_init(void) |
79 |
|
{ |
80 |
< |
class_default = class_make(); |
96 |
< |
|
97 |
< |
class_default->name = xstrdup("default"); |
98 |
< |
class_default->active = 1; |
99 |
< |
class_default->con_freq = DEFAULT_CONNECTFREQUENCY; |
100 |
< |
class_default->ping_freq = DEFAULT_PINGFREQUENCY; |
101 |
< |
class_default->max_total = MAXIMUM_LINKS_DEFAULT; |
102 |
< |
class_default->max_sendq = DEFAULT_SENDQ; |
103 |
< |
class_default->max_recvq = DEFAULT_RECVQ; |
80 |
> |
(class_default = class_make())->name = xstrdup("default"); |
81 |
|
} |
82 |
|
|
83 |
|
const char * |
89 |
|
const struct MaskItem *conf = ptr->data; |
90 |
|
|
91 |
|
assert(conf->class); |
92 |
< |
assert(conf->type & (CONF_OPERATOR | CONF_CLIENT | CONF_SERVER)); |
92 |
> |
assert(conf->type & (CONF_OPER | CONF_CLIENT | CONF_SERVER)); |
93 |
|
|
94 |
|
return conf->class->name; |
95 |
|
} |
105 |
|
if ((ptr = list->head)) { |
106 |
|
const struct MaskItem *conf = ptr->data; |
107 |
|
|
108 |
< |
assert(aconf->class); |
109 |
< |
assert(aconf->type & (CONF_OPERATOR | CONF_CLIENT | CONF_SERVER)); |
108 |
> |
assert(conf->class); |
109 |
> |
assert(conf->type & (CONF_OPER | CONF_CLIENT | CONF_SERVER)); |
110 |
|
|
111 |
|
return conf->class->ping_freq; |
112 |
|
} |
123 |
|
const struct MaskItem *conf = ptr->data; |
124 |
|
|
125 |
|
assert(conf->class); |
126 |
< |
assert(conf->type & (CONF_OPERATOR | CONF_CLIENT | CONF_SERVER)); |
126 |
> |
assert(conf->type & (CONF_OPER | CONF_CLIENT | CONF_SERVER)); |
127 |
|
|
128 |
|
return conf->class->max_sendq; |
129 |
|
} |
140 |
|
const struct MaskItem *conf = ptr->data; |
141 |
|
|
142 |
|
assert(conf->class); |
143 |
< |
assert(conf->type & (CONF_OPERATOR | CONF_CLIENT | CONF_SERVER)); |
143 |
> |
assert(conf->type & (CONF_OPER | CONF_CLIENT | CONF_SERVER)); |
144 |
|
|
145 |
|
return conf->class->max_recvq; |
146 |
|
} |
177 |
|
{ |
178 |
|
dlink_node *ptr = NULL; |
179 |
|
|
180 |
< |
DLINK_FOREACH(ptr, class_list.head) |
181 |
< |
{ |
205 |
< |
struct ClassItem *class = ptr->data; |
206 |
< |
|
207 |
< |
if (class != class_default) |
208 |
< |
class->active = 0; |
209 |
< |
} |
180 |
> |
DLINK_FOREACH_PREV(ptr, class_list.tail->prev) |
181 |
> |
((struct ClassItem *)ptr->data)->active = 0; |
182 |
|
} |
183 |
|
|
184 |
|
void |