27 |
|
#include "stdinc.h" |
28 |
|
#include "list.h" |
29 |
|
#include "ircd_defs.h" |
30 |
– |
#include "balloc.h" |
30 |
|
#include "conf.h" |
31 |
|
#include "s_serv.h" |
32 |
|
#include "resv.h" |
71 |
|
{ |
72 |
|
struct ClassItem *class = MyMalloc(sizeof(*class)); |
73 |
|
|
74 |
+ |
class->active = 1; |
75 |
+ |
class->con_freq = DEFAULT_CONNECTFREQUENCY; |
76 |
+ |
class->ping_freq = DEFAULT_PINGFREQUENCY; |
77 |
+ |
class->max_total = MAXIMUM_LINKS_DEFAULT; |
78 |
+ |
class->max_sendq = DEFAULT_SENDQ; |
79 |
+ |
class->max_recvq = DEFAULT_RECVQ; |
80 |
+ |
|
81 |
|
dlinkAdd(class, &class->node, &class_list); |
82 |
|
|
83 |
|
return class; |
98 |
|
void |
99 |
|
class_init(void) |
100 |
|
{ |
101 |
< |
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; |
101 |
> |
(class_default = class_make())->name = xstrdup("default"); |
102 |
|
} |
103 |
|
|
104 |
|
const char * |
110 |
|
const struct MaskItem *conf = ptr->data; |
111 |
|
|
112 |
|
assert(conf->class); |
113 |
< |
assert(conf->type & (CONF_OPERATOR | CONF_CLIENT | CONF_SERVER)); |
113 |
> |
assert(conf->type & (CONF_OPER | CONF_CLIENT | CONF_SERVER)); |
114 |
|
|
115 |
|
return conf->class->name; |
116 |
|
} |
126 |
|
if ((ptr = list->head)) { |
127 |
|
const struct MaskItem *conf = ptr->data; |
128 |
|
|
129 |
< |
assert(aconf->class); |
130 |
< |
assert(aconf->type & (CONF_OPERATOR | CONF_CLIENT | CONF_SERVER)); |
129 |
> |
assert(conf->class); |
130 |
> |
assert(conf->type & (CONF_OPER | CONF_CLIENT | CONF_SERVER)); |
131 |
|
|
132 |
|
return conf->class->ping_freq; |
133 |
|
} |
144 |
|
const struct MaskItem *conf = ptr->data; |
145 |
|
|
146 |
|
assert(conf->class); |
147 |
< |
assert(conf->type & (CONF_OPERATOR | CONF_CLIENT | CONF_SERVER)); |
147 |
> |
assert(conf->type & (CONF_OPER | CONF_CLIENT | CONF_SERVER)); |
148 |
|
|
149 |
|
return conf->class->max_sendq; |
150 |
|
} |
161 |
|
const struct MaskItem *conf = ptr->data; |
162 |
|
|
163 |
|
assert(conf->class); |
164 |
< |
assert(conf->type & (CONF_OPERATOR | CONF_CLIENT | CONF_SERVER)); |
164 |
> |
assert(conf->type & (CONF_OPER | CONF_CLIENT | CONF_SERVER)); |
165 |
|
|
166 |
|
return conf->class->max_recvq; |
167 |
|
} |
198 |
|
{ |
199 |
|
dlink_node *ptr = NULL; |
200 |
|
|
201 |
< |
DLINK_FOREACH(ptr, class_list.head) |
202 |
< |
{ |
205 |
< |
struct ClassItem *class = ptr->data; |
206 |
< |
|
207 |
< |
if (class != class_default) |
208 |
< |
class->active = 0; |
209 |
< |
} |
201 |
> |
DLINK_FOREACH_PREV(ptr, class_list.tail->prev) |
202 |
> |
((struct ClassItem *)ptr->data)->active = 0; |
203 |
|
} |
204 |
|
|
205 |
|
void |