1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-05 01:13:13 +02:00

Integrate iConf.network in iConf itself as the distinction between

these "network settings" and other settings has been lost in time.

Rename some of these variables and macro's.
ircnetwork -> NETWORK_NAME
ircnet005 -> NETWORK_NAME_005
defserv ->? DEFAULT_SERVER
hidden_host -> CLOAK_PREFIX
helpchan -> HELP_CHANNEL

Also one config change (visible to admins):
set::hiddenhost-prefix is now set::cloak-prefix
We still accept the old name, though.
The example conf has been updated as well, but not the wiki yet.
This commit is contained in:
Bram Matthys
2021-08-10 14:22:42 +02:00
parent a4d9ef3947
commit 2c011202a4
14 changed files with 64 additions and 64 deletions
+1 -1
View File
@@ -431,7 +431,7 @@ set {
services-server "services.example.org";
stats-server "stats.example.org";
help-channel "#Help";
hiddenhost-prefix "Clk";
cloak-prefix "Clk";
prefix-quit "Quit";
/* Cloak keys should be the same at all servers on the network.
+1 -1
View File
@@ -384,7 +384,7 @@ set {
services-server "services.example.org";
stats-server "stats.example.org";
help-channel "#Help";
hiddenhost-prefix "Clk";
cloak-prefix "Clk";
prefix-quit "Quit";
/* Les clés de cloaking doivent être identiques sur tous les serveurs
+1 -1
View File
@@ -431,7 +431,7 @@ set {
services-server "services.example.org";
stats-server "stats.example.org";
help-channel "#Help";
hiddenhost-prefix "Clk";
cloak-prefix "Clk";
prefix-quit "Quit";
/* Gizleme anahtarları ağ üzerindeki bütün sunucularda aynı olmalı.
+20 -20
View File
@@ -34,16 +34,6 @@ struct FloodSettings {
typedef struct NetworkConfiguration NetworkConfiguration;
struct NetworkConfiguration {
unsigned x_inah:1;
char *x_ircnetwork;
char *x_ircnet005;
char *x_defserv;
char *x_services_name;
char *x_hidden_host;
char *x_prefix_quit;
char *x_helpchan;
char *x_stats_server;
char *x_sasl_server;
};
enum UHAllowed { UHALLOW_ALWAYS, UHALLOW_NOCHANS, UHALLOW_REJOIN, UHALLOW_NEVER };
@@ -176,6 +166,16 @@ struct Configuration {
BroadcastChannelMessagesOption broadcast_channel_messages;
AllowedChannelChars allowed_channelchars;
HideIdleTimePolicy hide_idle_time;
unsigned inah:1;
char *network_name;
char *network_name_005;
char *default_server;
char *services_name;
char *cloak_prefix;
char *prefix_quit;
char *helpchan;
char *stats_server;
char *sasl_server;
};
extern MODVAR Configuration iConf;
@@ -212,16 +212,16 @@ extern MODVAR int ipv6_disabled;
#endif
#define EGD_PATH iConf.egd_path
#define ircnetwork iConf.network.x_ircnetwork
#define ircnet005 iConf.network.x_ircnet005
#define defserv iConf.network.x_defserv
#define SERVICES_NAME iConf.network.x_services_name
#define hidden_host iConf.network.x_hidden_host
#define helpchan iConf.network.x_helpchan
#define STATS_SERVER iConf.network.x_stats_server
#define SASL_SERVER iConf.network.x_sasl_server
#define iNAH iConf.network.x_inah
#define PREFIX_QUIT iConf.network.x_prefix_quit
#define NETWORK_NAME iConf.network_name
#define NETWORK_NAME_005 iConf.network_name_005
#define DEFAULT_SERVER iConf.default_server
#define SERVICES_NAME iConf.services_name
#define CLOAK_PREFIX iConf.cloak_prefix
#define HELP_CHANNEL iConf.helpchan
#define STATS_SERVER iConf.stats_server
#define SASL_SERVER iConf.sasl_server
#define iNAH iConf.inah
#define PREFIX_QUIT iConf.prefix_quit
#define STATIC_QUIT iConf.static_quit
#define STATIC_PART iConf.static_part
+1 -1
View File
@@ -93,7 +93,7 @@ void isupport_init(void)
#endif
ISupportSet(NULL, "ELIST", "MNUCT");
ISupportSet(NULL, "CASEMAPPING", "ascii");
ISupportSet(NULL, "NETWORK", ircnet005);
ISupportSet(NULL, "NETWORK", NETWORK_NAME_005);
ISupportSetFmt(NULL, "CHANMODES",
CHPAR1 "%s," CHPAR2 "%s," CHPAR3 "%s," CHPAR4 "%s",
EXPAR1, EXPAR2, EXPAR3, EXPAR4);
+25 -25
View File
@@ -1712,15 +1712,15 @@ void free_iConf(Configuration *i)
safe_free(i->reject_message_kline);
safe_free(i->reject_message_gline);
// network struct:
safe_free(i->network.x_ircnetwork);
safe_free(i->network.x_ircnet005);
safe_free(i->network.x_defserv);
safe_free(i->network.x_services_name);
safe_free(i->network.x_hidden_host);
safe_free(i->network.x_prefix_quit);
safe_free(i->network.x_helpchan);
safe_free(i->network.x_stats_server);
safe_free(i->network.x_sasl_server);
safe_free(i->network_name);
safe_free(i->network_name_005);
safe_free(i->default_server);
safe_free(i->services_name);
safe_free(i->cloak_prefix);
safe_free(i->prefix_quit);
safe_free(i->helpchan);
safe_free(i->stats_server);
safe_free(i->sasl_server);
// anti-flood:
for (f = i->floodsettings; f; f = f_next)
{
@@ -1767,10 +1767,10 @@ void config_setdefaultsettings(Configuration *i)
i->kick_length = 307;
i->quit_length = 307;
safe_strdup(i->link_bindip, "*");
safe_strdup(i->network.x_hidden_host, "Clk");
safe_strdup(i->cloak_prefix, "Clk");
if (!ipv6_capable())
DISABLE_IPV6 = 1;
safe_strdup(i->network.x_prefix_quit, "Quit");
safe_strdup(i->prefix_quit, "Quit");
i->max_unknown_connections_per_ip = 3;
i->handshake_timeout = 30;
i->sasl_timeout = 15;
@@ -7447,40 +7447,40 @@ int _conf_set(ConfigFile *conf, ConfigEntry *ce)
}
else if (!strcmp(cep->name, "network-name")) {
char *tmp;
safe_strdup(tempiConf.network.x_ircnetwork, cep->value);
safe_strdup(tempiConf.network_name, cep->value);
for (tmp = cep->value; *cep->value; cep->value++) {
if (*cep->value == ' ')
*cep->value='-';
}
safe_strdup(tempiConf.network.x_ircnet005, tmp);
safe_strdup(tempiConf.network_name_005, tmp);
cep->value = tmp;
}
else if (!strcmp(cep->name, "default-server")) {
safe_strdup(tempiConf.network.x_defserv, cep->value);
safe_strdup(tempiConf.default_server, cep->value);
}
else if (!strcmp(cep->name, "services-server")) {
safe_strdup(tempiConf.network.x_services_name, cep->value);
safe_strdup(tempiConf.services_name, cep->value);
}
else if (!strcmp(cep->name, "sasl-server")) {
safe_strdup(tempiConf.network.x_sasl_server, cep->value);
safe_strdup(tempiConf.sasl_server, cep->value);
}
else if (!strcmp(cep->name, "stats-server")) {
safe_strdup(tempiConf.network.x_stats_server, cep->value);
safe_strdup(tempiConf.stats_server, cep->value);
}
else if (!strcmp(cep->name, "help-channel")) {
safe_strdup(tempiConf.network.x_helpchan, cep->value);
safe_strdup(tempiConf.helpchan, cep->value);
}
else if (!strcmp(cep->name, "hiddenhost-prefix")) {
safe_strdup(tempiConf.network.x_hidden_host, cep->value);
else if (!strcmp(cep->name, "cloak-prefix") || !strcmp(cep->name, "hiddenhost-prefix")) {
safe_strdup(tempiConf.cloak_prefix, cep->value);
}
else if (!strcmp(cep->name, "hide-ban-reason")) {
tempiConf.hide_ban_reason = config_checkval(cep->value, CFG_YESNO);
}
else if (!strcmp(cep->name, "prefix-quit")) {
if (!strcmp(cep->value, "0") || !strcmp(cep->value, "no"))
safe_free(tempiConf.network.x_prefix_quit);
safe_free(tempiConf.prefix_quit);
else
safe_strdup(tempiConf.network.x_prefix_quit, cep->value);
safe_strdup(tempiConf.prefix_quit, cep->value);
}
else if (!strcmp(cep->name, "link")) {
for (cepp = cep->items; cepp; cepp = cepp->next) {
@@ -8217,12 +8217,12 @@ int _test_set(ConfigFile *conf, ConfigEntry *ce)
CheckNull(cep);
CheckDuplicate(cep, help_channel, "help-channel");
}
else if (!strcmp(cep->name, "hiddenhost-prefix")) {
else if (!strcmp(cep->name, "cloak-prefix") || !strcmp(cep->name, "hiddenhost-prefix")) {
CheckNull(cep);
CheckDuplicate(cep, hiddenhost_prefix, "hiddenhost-prefix");
CheckDuplicate(cep, hiddenhost_prefix, "cloak-prefix");
if (strchr(cep->value, ' ') || (*cep->value == ':'))
{
config_error("%s:%i: set::hiddenhost-prefix must not contain spaces or be prefixed with ':'",
config_error("%s:%i: set::cloak-prefix must not contain spaces or be prefixed with ':'",
cep->file->filename, cep->line_number);
errors++;
continue;
+2 -2
View File
@@ -412,14 +412,14 @@ unsigned int alpha, n;
{
unsigned int len;
p++;
ircsnprintf(result, sizeof(result), "%s-%X.", hidden_host, alpha);
ircsnprintf(result, sizeof(result), "%s-%X.", CLOAK_PREFIX, alpha);
len = strlen(result) + strlen(p);
if (len <= HOSTLEN)
strlcat(result, p, sizeof(result));
else
strlcat(result, p + (len - HOSTLEN), sizeof(result));
} else
ircsnprintf(result, sizeof(result), "%s-%X", hidden_host, alpha);
ircsnprintf(result, sizeof(result), "%s-%X", CLOAK_PREFIX, alpha);
return result;
}
+1 -1
View File
@@ -109,7 +109,7 @@ void parse_help(Client *client, char *name, char *help)
SND(" We're sorry, we don't have help available for the command you requested.");
SND(" -");
sendto_one(client, NULL, ":%s 292 %s : ***** Go to %s if you have any further questions *****",
me.name, client->name, helpchan);
me.name, client->name, HELP_CHANNEL);
SND(" -");
return;
}
+2 -2
View File
@@ -118,11 +118,11 @@ CMD_FUNC(cmd_netinfo)
client->local->traffic.bytes_received,
client->local->traffic.bytes_sent);
if (!(strcmp(ircnetwork, parv[8]) == 0))
if (!(strcmp(NETWORK_NAME, parv[8]) == 0))
{
sendto_umode_global(UMODE_OPER,
"Network name mismatch from link %s (%s != %s)",
client->name, parv[8], ircnetwork);
client->name, parv[8], NETWORK_NAME);
}
if ((protocol != UnrealProtocol) && (protocol != 0))
+2 -2
View File
@@ -962,7 +962,7 @@ int _register_user(Client *client, char *nick, char *username, char *umode, char
log_data_string("extended_client_info", get_connect_extinfo(client)));
RunHook2(HOOKTYPE_WELCOME, client, 0);
sendnumeric(client, RPL_WELCOME, ircnetwork, nick, client->user->username, client->user->realhost);
sendnumeric(client, RPL_WELCOME, NETWORK_NAME, nick, client->user->username, client->user->realhost);
RunHook2(HOOKTYPE_WELCOME, client, 1);
sendnumeric(client, RPL_YOURHOST, me.name, version);
@@ -1398,7 +1398,7 @@ int AllowClient(Client *client, char *username)
else
{
/* Class is full */
sendnumeric(client, RPL_REDIR, aconf->server ? aconf->server : defserv, aconf->port ? aconf->port : 6667);
sendnumeric(client, RPL_REDIR, aconf->server ? aconf->server : DEFAULT_SERVER, aconf->port ? aconf->port : 6667);
exit_client(client, NULL, iConf.reject_message_server_full);
return 0;
}
+1 -1
View File
@@ -1483,7 +1483,7 @@ int server_sync(Client *client, ConfigItem_link *aconf, int incoming)
sendto_one(client, NULL, "NETINFO %i %lld %i %s 0 0 0 :%s",
irccounts.global_max, (long long)TStime(), UnrealProtocol,
CLOAK_KEYCRC,
ircnetwork);
NETWORK_NAME);
/* Send EOS (End Of Sync) to the just linked server... */
sendto_one(client, NULL, ":%s EOS", me.id);
+1 -1
View File
@@ -378,7 +378,7 @@ CMD_FUNC(cmd_staff)
return;
}
sendto_one(client, NULL, RPL_STAFFSTART, me.name, client->name, ircnetwork);
sendto_one(client, NULL, RPL_STAFFSTART, me.name, client->name, NETWORK_NAME);
temp = &staff;
+5 -5
View File
@@ -504,7 +504,7 @@ int stats_allow(Client *client, char *para)
allows->maxperip,
allows->global_maxperip,
allows->class->name,
allows->server ? allows->server : defserv,
allows->server ? allows->server : DEFAULT_SERVER,
allows->port ? allows->port : 6667);
}
}
@@ -798,8 +798,8 @@ int stats_set(Client *client, char *para)
}
sendtxtnumeric(client, "*** Configuration Report ***");
sendtxtnumeric(client, "network-name: %s", ircnetwork);
sendtxtnumeric(client, "default-server: %s", defserv);
sendtxtnumeric(client, "network-name: %s", NETWORK_NAME);
sendtxtnumeric(client, "default-server: %s", DEFAULT_SERVER);
if (SERVICES_NAME)
{
sendtxtnumeric(client, "services-server: %s", SERVICES_NAME);
@@ -812,8 +812,8 @@ int stats_set(Client *client, char *para)
{
sendtxtnumeric(client, "sasl-server: %s", SASL_SERVER);
}
sendtxtnumeric(client, "hiddenhost-prefix: %s", hidden_host);
sendtxtnumeric(client, "help-channel: %s", helpchan);
sendtxtnumeric(client, "cloak-prefix: %s", CLOAK_PREFIX);
sendtxtnumeric(client, "help-channel: %s", HELP_CHANNEL);
sendtxtnumeric(client, "cloak-keys: %s", CLOAK_KEYCRC);
sendtxtnumeric(client, "kline-address: %s", KLINE_ADDRESS);
if (GLINE_ADDRESS)
+1 -1
View File
@@ -70,7 +70,7 @@ MOD_UNLOAD()
int bot_whois(Client *requester, Client *acptr)
{
if (IsBot(acptr))
sendnumeric(requester, RPL_WHOISBOT, acptr->name, ircnetwork);
sendnumeric(requester, RPL_WHOISBOT, acptr->name, NETWORK_NAME);
return 0;
}