diff --git a/doc/conf/examples/example.conf b/doc/conf/examples/example.conf index 39f88f81a..251aa19dd 100644 --- a/doc/conf/examples/example.conf +++ b/doc/conf/examples/example.conf @@ -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. diff --git a/doc/conf/examples/example.fr.conf b/doc/conf/examples/example.fr.conf index b67b7938a..79ea26c82 100644 --- a/doc/conf/examples/example.fr.conf +++ b/doc/conf/examples/example.fr.conf @@ -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 diff --git a/doc/conf/examples/example.tr.conf b/doc/conf/examples/example.tr.conf index 6d7004c4d..5f0b7a90e 100644 --- a/doc/conf/examples/example.tr.conf +++ b/doc/conf/examples/example.tr.conf @@ -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ı. diff --git a/include/dynconf.h b/include/dynconf.h index dbf4c4d74..5266b5cd1 100644 --- a/include/dynconf.h +++ b/include/dynconf.h @@ -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 diff --git a/src/api-isupport.c b/src/api-isupport.c index 66e46b097..c8bd5ee5c 100644 --- a/src/api-isupport.c +++ b/src/api-isupport.c @@ -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); diff --git a/src/conf.c b/src/conf.c index 5ecdad544..364f756e4 100644 --- a/src/conf.c +++ b/src/conf.c @@ -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; diff --git a/src/modules/cloak.c b/src/modules/cloak.c index f51612d66..ac9d4e61f 100644 --- a/src/modules/cloak.c +++ b/src/modules/cloak.c @@ -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; } diff --git a/src/modules/help.c b/src/modules/help.c index 65f29760c..2ee5cfe38 100644 --- a/src/modules/help.c +++ b/src/modules/help.c @@ -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; } diff --git a/src/modules/netinfo.c b/src/modules/netinfo.c index cb0d3afb1..a368fe07f 100644 --- a/src/modules/netinfo.c +++ b/src/modules/netinfo.c @@ -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)) diff --git a/src/modules/nick.c b/src/modules/nick.c index 36312614f..16de7e5e4 100644 --- a/src/modules/nick.c +++ b/src/modules/nick.c @@ -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; } diff --git a/src/modules/server.c b/src/modules/server.c index f971ff647..6fff5e9e1 100644 --- a/src/modules/server.c +++ b/src/modules/server.c @@ -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); diff --git a/src/modules/staff.c b/src/modules/staff.c index fb3a8865b..5517a27d3 100644 --- a/src/modules/staff.c +++ b/src/modules/staff.c @@ -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; diff --git a/src/modules/stats.c b/src/modules/stats.c index 6e4a20a14..e731a4944 100644 --- a/src/modules/stats.c +++ b/src/modules/stats.c @@ -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) diff --git a/src/modules/usermodes/bot.c b/src/modules/usermodes/bot.c index 01a08e3fd..d608381ba 100644 --- a/src/modules/usermodes/bot.c +++ b/src/modules/usermodes/bot.c @@ -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; }