| 1 |
|
/* |
| 2 |
|
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) |
| 3 |
|
* |
| 4 |
< |
* Copyright (c) 2000-2018 ircd-hybrid development team |
| 4 |
> |
* Copyright (c) 2000-2019 ircd-hybrid development team |
| 5 |
|
* |
| 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 |
| 93 |
|
port, |
| 94 |
|
aftype, |
| 95 |
|
ping_freq, |
| 96 |
< |
max_perip, |
| 96 |
> |
max_perip_local, |
| 97 |
> |
max_perip_global, |
| 98 |
|
con_freq, |
| 99 |
|
min_idle, |
| 100 |
|
max_idle, |
| 101 |
|
max_total, |
| 101 |
– |
max_global, |
| 102 |
– |
max_local, |
| 102 |
|
max_sendq, |
| 103 |
|
max_recvq, |
| 104 |
|
max_channels, |
| 197 |
|
%token HOST |
| 198 |
|
%token HUB |
| 199 |
|
%token HUB_MASK |
| 201 |
– |
%token IGNORE_BOGUS_TS |
| 200 |
|
%token INVISIBLE_ON_CONNECT |
| 201 |
|
%token INVITE_CLIENT_COUNT |
| 202 |
|
%token INVITE_CLIENT_TIME |
| 223 |
|
%token MAX_BANS |
| 224 |
|
%token MAX_BANS_LARGE |
| 225 |
|
%token MAX_CHANNELS |
| 228 |
– |
%token MAX_GLOBAL |
| 226 |
|
%token MAX_IDLE |
| 227 |
|
%token MAX_INVITES |
| 231 |
– |
%token MAX_LOCAL |
| 228 |
|
%token MAX_NICK_CHANGES |
| 229 |
|
%token MAX_NICK_LENGTH |
| 230 |
|
%token MAX_NICK_TIME |
| 248 |
|
%token NO_TILDE |
| 249 |
|
%token NUMBER |
| 250 |
|
%token NUMBER_PER_CIDR |
| 251 |
< |
%token NUMBER_PER_IP |
| 251 |
> |
%token NUMBER_PER_IP_GLOBAL |
| 252 |
> |
%token NUMBER_PER_IP_LOCAL |
| 253 |
|
%token OPER_ONLY_UMODES |
| 254 |
|
%token OPER_UMODES |
| 255 |
|
%token OPERATOR |
| 526 |
|
/* This isn't rehashable */ |
| 527 |
|
if (conf_parser_ctx.pass == 2 && !ConfigServerInfo.name) |
| 528 |
|
{ |
| 529 |
< |
if (server_valid_name(yylval.string)) |
| 529 |
> |
if (server_valid_name(yylval.string) == true) |
| 530 |
|
ConfigServerInfo.name = xstrdup(yylval.string); |
| 531 |
|
else |
| 532 |
|
{ |
| 645 |
|
if (conf_parser_ctx.pass != 2) |
| 646 |
|
break; |
| 647 |
|
|
| 648 |
< |
if ($3 < MAXCLIENTS_MIN) |
| 648 |
> |
if ($3 < 1) |
| 649 |
|
{ |
| 650 |
< |
char buf[IRCD_BUFSIZE] = ""; |
| 651 |
< |
|
| 655 |
< |
snprintf(buf, sizeof(buf), "MAXCLIENTS too low, setting to %d", MAXCLIENTS_MIN); |
| 656 |
< |
conf_error_report(buf); |
| 657 |
< |
ConfigServerInfo.default_max_clients = MAXCLIENTS_MIN; |
| 650 |
> |
conf_error_report("default_max_clients too low, setting to 1"); |
| 651 |
> |
ConfigServerInfo.default_max_clients = 1; |
| 652 |
|
} |
| 653 |
|
else if ($3 > MAXCLIENTS_MAX) |
| 654 |
|
{ |
| 655 |
|
char buf[IRCD_BUFSIZE] = ""; |
| 656 |
|
|
| 657 |
< |
snprintf(buf, sizeof(buf), "MAXCLIENTS too high, setting to %d", MAXCLIENTS_MAX); |
| 657 |
> |
snprintf(buf, sizeof(buf), "default_max_clients too high, setting to %d", MAXCLIENTS_MAX); |
| 658 |
|
conf_error_report(buf); |
| 659 |
|
ConfigServerInfo.default_max_clients = MAXCLIENTS_MAX; |
| 660 |
|
} |
| 1327 |
|
if (!block_state.class.buf[0]) |
| 1328 |
|
break; |
| 1329 |
|
|
| 1330 |
< |
if (!(class = class_find(block_state.class.buf, 0))) |
| 1330 |
> |
if (!(class = class_find(block_state.class.buf, false))) |
| 1331 |
|
class = class_make(); |
| 1332 |
|
|
| 1333 |
|
class->active = 1; |
| 1334 |
|
xfree(class->name); |
| 1335 |
|
class->name = xstrdup(block_state.class.buf); |
| 1336 |
|
class->ping_freq = block_state.ping_freq.value; |
| 1337 |
< |
class->max_perip = block_state.max_perip.value; |
| 1337 |
> |
class->max_perip_local = block_state.max_perip_local.value; |
| 1338 |
> |
class->max_perip_global = block_state.max_perip_global.value; |
| 1339 |
|
class->con_freq = block_state.con_freq.value; |
| 1340 |
|
class->max_total = block_state.max_total.value; |
| 1346 |
– |
class->max_global = block_state.max_global.value; |
| 1347 |
– |
class->max_local = block_state.max_local.value; |
| 1341 |
|
class->max_sendq = block_state.max_sendq.value; |
| 1342 |
|
class->max_recvq = block_state.max_recvq.value; |
| 1343 |
|
class->max_channels = block_state.max_channels.value; |
| 1353 |
|
class->min_idle = block_state.min_idle.value; |
| 1354 |
|
class->max_idle = block_state.max_idle.value; |
| 1355 |
|
|
| 1356 |
< |
rebuild_cidr_list(class); |
| 1357 |
< |
|
| 1356 |
> |
int diff = (class->cidr_bitlen_ipv4 != block_state.cidr_bitlen_ipv4.value || |
| 1357 |
> |
class->cidr_bitlen_ipv6 != block_state.cidr_bitlen_ipv6.value); |
| 1358 |
|
class->cidr_bitlen_ipv4 = block_state.cidr_bitlen_ipv4.value; |
| 1359 |
|
class->cidr_bitlen_ipv6 = block_state.cidr_bitlen_ipv6.value; |
| 1360 |
|
class->number_per_cidr = block_state.number_per_cidr.value; |
| 1361 |
+ |
|
| 1362 |
+ |
if (diff) |
| 1363 |
+ |
class_ip_limit_rebuild(class); |
| 1364 |
|
}; |
| 1365 |
|
|
| 1366 |
|
class_items: class_items class_item | class_item; |
| 1369 |
|
class_cidr_bitlen_ipv6 | |
| 1370 |
|
class_ping_time | |
| 1371 |
|
class_number_per_cidr | |
| 1372 |
< |
class_number_per_ip | |
| 1372 |
> |
class_number_per_ip_local | |
| 1373 |
> |
class_number_per_ip_global | |
| 1374 |
|
class_connectfreq | |
| 1375 |
|
class_max_channels | |
| 1376 |
|
class_max_number | |
| 1380 |
– |
class_max_global | |
| 1381 |
– |
class_max_local | |
| 1377 |
|
class_sendq | |
| 1378 |
|
class_recvq | |
| 1379 |
|
class_min_idle | |
| 1393 |
|
block_state.ping_freq.value = $3; |
| 1394 |
|
}; |
| 1395 |
|
|
| 1396 |
< |
class_number_per_ip: NUMBER_PER_IP '=' NUMBER ';' |
| 1396 |
> |
class_number_per_ip_local: NUMBER_PER_IP_LOCAL '=' NUMBER ';' |
| 1397 |
|
{ |
| 1398 |
|
if (conf_parser_ctx.pass == 1) |
| 1399 |
< |
block_state.max_perip.value = $3; |
| 1399 |
> |
block_state.max_perip_local.value = $3; |
| 1400 |
> |
}; |
| 1401 |
> |
|
| 1402 |
> |
class_number_per_ip_global: NUMBER_PER_IP_GLOBAL '=' NUMBER ';' |
| 1403 |
> |
{ |
| 1404 |
> |
if (conf_parser_ctx.pass == 1) |
| 1405 |
> |
block_state.max_perip_global.value = $3; |
| 1406 |
|
}; |
| 1407 |
|
|
| 1408 |
|
class_connectfreq: CONNECTFREQ '=' timespec ';' |
| 1423 |
|
block_state.max_total.value = $3; |
| 1424 |
|
}; |
| 1425 |
|
|
| 1425 |
– |
class_max_global: MAX_GLOBAL '=' NUMBER ';' |
| 1426 |
– |
{ |
| 1427 |
– |
if (conf_parser_ctx.pass == 1) |
| 1428 |
– |
block_state.max_global.value = $3; |
| 1429 |
– |
}; |
| 1430 |
– |
|
| 1431 |
– |
class_max_local: MAX_LOCAL '=' NUMBER ';' |
| 1432 |
– |
{ |
| 1433 |
– |
if (conf_parser_ctx.pass == 1) |
| 1434 |
– |
block_state.max_local.value = $3; |
| 1435 |
– |
}; |
| 1436 |
– |
|
| 1426 |
|
class_sendq: SENDQ '=' sizespec ';' |
| 1427 |
|
{ |
| 1428 |
|
if (conf_parser_ctx.pass == 1) |
| 1793 |
|
if (conf_parser_ctx.pass != 2) |
| 1794 |
|
break; |
| 1795 |
|
|
| 1796 |
< |
if (server_valid_name(yylval.string)) |
| 1796 |
> |
if (server_valid_name(yylval.string) == true) |
| 1797 |
|
{ |
| 1798 |
|
struct ServiceItem *service = service_make(); |
| 1799 |
|
service->name = xstrdup(yylval.string); |
| 2376 |
|
general_items: general_items general_item | general_item; |
| 2377 |
|
general_item: general_away_count | |
| 2378 |
|
general_away_time | |
| 2390 |
– |
general_ignore_bogus_ts | |
| 2379 |
|
general_failed_oper_notice | |
| 2380 |
|
general_anti_nick_flood | |
| 2381 |
|
general_max_nick_time | |
| 2479 |
|
ConfigGeneral.kill_chase_time_limit = $3; |
| 2480 |
|
}; |
| 2481 |
|
|
| 2494 |
– |
general_ignore_bogus_ts: IGNORE_BOGUS_TS '=' TBOOL ';' |
| 2495 |
– |
{ |
| 2496 |
– |
ConfigGeneral.ignore_bogus_ts = yylval.number; |
| 2497 |
– |
}; |
| 2498 |
– |
|
| 2482 |
|
general_failed_oper_notice: FAILED_OPER_NOTICE '=' TBOOL ';' |
| 2483 |
|
{ |
| 2484 |
|
ConfigGeneral.failed_oper_notice = yylval.number; |