2007-01-25 07:40:21 +01:00
|
|
|
/*
|
|
|
|
* ircd-ratbox: A slightly useful ircd.
|
|
|
|
* m_info.c: Sends information about the server.
|
|
|
|
*
|
|
|
|
* Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
|
|
|
|
* Copyright (C) 1996-2002 Hybrid Development Team
|
|
|
|
* Copyright (C) 2002-2005 ircd-ratbox development team
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
* USA
|
|
|
|
*/
|
|
|
|
|
2016-08-13 05:05:54 +02:00
|
|
|
using namespace ircd;
|
|
|
|
|
2016-03-09 08:29:41 +01:00
|
|
|
static const char info_desc[] =
|
|
|
|
"Provides the INFO command for retrieving server copyright, credits, and other info";
|
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
static void send_conf_options(client::client &source);
|
|
|
|
static void send_birthdate_online_time(client::client &source);
|
|
|
|
static void send_info_text(client::client &source);
|
|
|
|
static void info_spy(client::client &);
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
static void m_info(struct MsgBuf *, client::client &, client::client &, int, const char **);
|
|
|
|
static void mo_info(struct MsgBuf *, client::client &, client::client &, int, const char **);
|
2007-01-25 07:40:21 +01:00
|
|
|
|
|
|
|
struct Message info_msgtab = {
|
2016-02-19 23:42:40 +01:00
|
|
|
"INFO", 0, 0, 0, 0,
|
2007-01-25 07:40:21 +01:00
|
|
|
{mg_unreg, {m_info, 0}, {mo_info, 0}, mg_ignore, mg_ignore, {mo_info, 0}}
|
|
|
|
};
|
|
|
|
|
|
|
|
int doing_info_hook;
|
|
|
|
|
|
|
|
mapi_clist_av1 info_clist[] = { &info_msgtab, NULL };
|
|
|
|
mapi_hlist_av1 info_hlist[] = {
|
|
|
|
{ "doing_info", &doing_info_hook },
|
|
|
|
{ NULL, NULL }
|
|
|
|
};
|
|
|
|
|
2016-03-07 09:11:50 +01:00
|
|
|
DECLARE_MODULE_AV2(info, NULL, NULL, info_clist, info_hlist, NULL, NULL, NULL, info_desc);
|
2007-01-25 07:40:21 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* jdc -- Structure for our configuration value table
|
|
|
|
*/
|
|
|
|
struct InfoStruct
|
|
|
|
{
|
|
|
|
const char *name; /* Displayed variable name */
|
|
|
|
unsigned int output_type; /* See below #defines */
|
|
|
|
void *option; /* Pointer reference to the value */
|
|
|
|
const char *desc; /* ASCII description of the variable */
|
|
|
|
};
|
|
|
|
/* Types for output_type in InfoStruct */
|
|
|
|
#define OUTPUT_STRING 0x0001 /* Output option as %s w/ dereference */
|
|
|
|
#define OUTPUT_STRING_PTR 0x0002 /* Output option as %s w/out deference */
|
|
|
|
#define OUTPUT_DECIMAL 0x0004 /* Output option as decimal (%d) */
|
|
|
|
#define OUTPUT_BOOLEAN 0x0008 /* Output option as "ON" or "OFF" */
|
|
|
|
#define OUTPUT_BOOLEAN_YN 0x0010 /* Output option as "YES" or "NO" */
|
|
|
|
#define OUTPUT_BOOLEAN2 0x0020 /* Output option as "YES/NO/MASKED" */
|
|
|
|
|
|
|
|
/* *INDENT-OFF* */
|
|
|
|
static struct InfoStruct info_table[] = {
|
|
|
|
/* --[ START OF TABLE ]-------------------------------------------- */
|
|
|
|
{
|
|
|
|
"opers_see_all_users",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&opers_see_all_users,
|
|
|
|
"Farconnect notices available or operspy accountability limited"
|
|
|
|
},
|
2008-04-13 17:54:23 +02:00
|
|
|
{
|
|
|
|
"max_connections",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&maxconnections,
|
|
|
|
"Max number connections"
|
2007-04-05 02:38:52 +02:00
|
|
|
},
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
|
|
|
"anti_nick_flood",
|
|
|
|
OUTPUT_BOOLEAN,
|
|
|
|
&ConfigFileEntry.anti_nick_flood,
|
|
|
|
"NICK flood protection"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"anti_spam_exit_message_time",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.anti_spam_exit_message_time,
|
|
|
|
"Duration a client must be connected for to have an exit message"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"caller_id_wait",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.caller_id_wait,
|
|
|
|
"Minimum delay between notifying UMODE +g users of messages"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"client_exit",
|
|
|
|
OUTPUT_BOOLEAN,
|
|
|
|
&ConfigFileEntry.client_exit,
|
2013-06-16 11:35:04 +02:00
|
|
|
"Prepend 'Quit:' to user QUIT messages"
|
2007-01-25 07:40:21 +01:00
|
|
|
},
|
|
|
|
{
|
2011-03-27 22:35:26 +02:00
|
|
|
"client_flood_max_lines",
|
2007-01-25 07:40:21 +01:00
|
|
|
OUTPUT_DECIMAL,
|
2011-03-27 22:35:26 +02:00
|
|
|
&ConfigFileEntry.client_flood_max_lines,
|
2007-01-25 07:40:21 +01:00
|
|
|
"Number of lines before a client Excess Flood's",
|
|
|
|
},
|
2011-03-27 22:35:26 +02:00
|
|
|
{
|
|
|
|
"client_flood_burst_rate",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.client_flood_burst_rate,
|
2011-10-04 00:57:49 +02:00
|
|
|
"Maximum lines per second during flood grace period",
|
2011-03-27 22:35:26 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"client_flood_burst_max",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.client_flood_burst_max,
|
2011-10-04 00:57:49 +02:00
|
|
|
"Number of lines to process at once before delaying",
|
2011-03-27 22:35:26 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"client_flood_message_num",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.client_flood_message_num,
|
|
|
|
"Number of messages to allow per client_flood_message_time outside of burst",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"client_flood_message_time",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.client_flood_message_time,
|
|
|
|
"Time to allow per client_flood_message_num outside of burst",
|
|
|
|
},
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
|
|
|
"connect_timeout",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.connect_timeout,
|
|
|
|
"Connect timeout for connections to servers"
|
|
|
|
},
|
2010-04-05 21:28:44 +02:00
|
|
|
{
|
2010-04-05 22:29:11 +02:00
|
|
|
"default_ident_timeout",
|
2010-04-05 21:28:44 +02:00
|
|
|
OUTPUT_DECIMAL,
|
2010-04-05 22:29:11 +02:00
|
|
|
&ConfigFileEntry.default_ident_timeout,
|
2010-04-05 21:28:44 +02:00
|
|
|
"Amount of time the server waits for ident responses from clients",
|
|
|
|
},
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
|
|
|
"default_floodcount",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.default_floodcount,
|
|
|
|
"Startup value of FLOODCOUNT",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"default_adminstring",
|
|
|
|
OUTPUT_STRING,
|
|
|
|
&ConfigFileEntry.default_adminstring,
|
|
|
|
"Default adminstring at startup.",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"default_operstring",
|
|
|
|
OUTPUT_STRING,
|
|
|
|
&ConfigFileEntry.default_operstring,
|
|
|
|
"Default operstring at startup.",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"servicestring",
|
|
|
|
OUTPUT_STRING,
|
|
|
|
&ConfigFileEntry.servicestring,
|
|
|
|
"String shown in whois for opered services.",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"disable_auth",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigFileEntry.disable_auth,
|
|
|
|
"Controls whether auth checking is disabled or not"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"disable_fake_channels",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigFileEntry.disable_fake_channels,
|
|
|
|
"Controls whether bold etc are disabled for JOIN"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"dots_in_ident",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.dots_in_ident,
|
|
|
|
"Number of permissable dots in an ident"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"failed_oper_notice",
|
|
|
|
OUTPUT_BOOLEAN,
|
|
|
|
&ConfigFileEntry.failed_oper_notice,
|
|
|
|
"Inform opers if someone /oper's with the wrong password"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"fname_userlog",
|
|
|
|
OUTPUT_STRING,
|
|
|
|
&ConfigFileEntry.fname_userlog,
|
|
|
|
"User log file"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"fname_fuserlog",
|
|
|
|
OUTPUT_STRING,
|
|
|
|
&ConfigFileEntry.fname_fuserlog,
|
|
|
|
"Failed user log file"
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
"fname_operlog",
|
|
|
|
OUTPUT_STRING,
|
|
|
|
&ConfigFileEntry.fname_operlog,
|
|
|
|
"Operator log file"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"fname_foperlog",
|
|
|
|
OUTPUT_STRING,
|
|
|
|
&ConfigFileEntry.fname_foperlog,
|
|
|
|
"Failed operator log file"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"fname_serverlog",
|
|
|
|
OUTPUT_STRING,
|
|
|
|
&ConfigFileEntry.fname_serverlog,
|
|
|
|
"Server connect/disconnect log file"
|
|
|
|
},
|
2014-03-03 05:12:07 +01:00
|
|
|
{
|
|
|
|
"fname_killlog",
|
|
|
|
OUTPUT_STRING,
|
|
|
|
&ConfigFileEntry.fname_killlog,
|
|
|
|
"KILL log file"
|
|
|
|
},
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
|
|
|
"fname_klinelog",
|
|
|
|
OUTPUT_STRING,
|
|
|
|
&ConfigFileEntry.fname_klinelog,
|
|
|
|
"KLINE etc log file"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"fname_operspylog",
|
|
|
|
OUTPUT_STRING,
|
|
|
|
&ConfigFileEntry.fname_operspylog,
|
|
|
|
"Oper spy log file"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"fname_ioerrorlog",
|
|
|
|
OUTPUT_STRING,
|
|
|
|
&ConfigFileEntry.fname_ioerrorlog,
|
|
|
|
"IO error log file"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"global_snotices",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigFileEntry.global_snotices,
|
|
|
|
"Send out certain server notices globally"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"hide_error_messages",
|
|
|
|
OUTPUT_BOOLEAN2,
|
|
|
|
&ConfigFileEntry.hide_error_messages,
|
|
|
|
"Hide ERROR messages coming from servers"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"hide_spoof_ips",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigFileEntry.hide_spoof_ips,
|
|
|
|
"Hide IPs of spoofed users"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"kline_delay",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.kline_delay,
|
|
|
|
"Duration of time to delay kline checking"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"kline_reason",
|
|
|
|
OUTPUT_STRING,
|
|
|
|
&ConfigFileEntry.kline_reason,
|
|
|
|
"K-lined clients sign off with this reason"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"dline_with_reason",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigFileEntry.dline_with_reason,
|
|
|
|
"Display D-line reason to client on disconnect"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"kline_with_reason",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigFileEntry.kline_with_reason,
|
|
|
|
"Display K-line reason to client on disconnect"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"max_accept",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.max_accept,
|
|
|
|
"Maximum nicknames on accept list",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"max_nick_changes",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.max_nick_changes,
|
|
|
|
"NICK change threshhold setting"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"max_nick_time",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.max_nick_time,
|
|
|
|
"NICK flood protection time interval"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"max_targets",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.max_targets,
|
|
|
|
"The maximum number of PRIVMSG/NOTICE targets"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"min_nonwildcard",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.min_nonwildcard,
|
2008-04-11 17:10:40 +02:00
|
|
|
"Minimum non-wildcard chars in K lines",
|
2007-01-25 07:40:21 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"min_nonwildcard_simple",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.min_nonwildcard_simple,
|
|
|
|
"Minimum non-wildcard chars in xlines/resvs",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"network_name",
|
|
|
|
OUTPUT_STRING,
|
|
|
|
&ServerInfo.network_name,
|
|
|
|
"Network name"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"nick_delay",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.nick_delay,
|
|
|
|
"Delay nicks are locked for on split",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"no_oper_flood",
|
|
|
|
OUTPUT_BOOLEAN,
|
|
|
|
&ConfigFileEntry.no_oper_flood,
|
|
|
|
"Disable flood control for operators",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"non_redundant_klines",
|
|
|
|
OUTPUT_BOOLEAN,
|
|
|
|
&ConfigFileEntry.non_redundant_klines,
|
|
|
|
"Check for and disallow redundant K-lines"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"operspy_admin_only",
|
|
|
|
OUTPUT_BOOLEAN,
|
|
|
|
&ConfigFileEntry.operspy_admin_only,
|
|
|
|
"Send +Z operspy notices to admins only"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"operspy_dont_care_user_info",
|
|
|
|
OUTPUT_BOOLEAN,
|
|
|
|
&ConfigFileEntry.operspy_dont_care_user_info,
|
|
|
|
"Remove accountability and some '!' requirement from non-channel operspy"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"pace_wait",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.pace_wait,
|
|
|
|
"Minimum delay between uses of certain commands"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"pace_wait_simple",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.pace_wait_simple,
|
|
|
|
"Minimum delay between less intensive commands"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"ping_cookie",
|
|
|
|
OUTPUT_BOOLEAN,
|
|
|
|
&ConfigFileEntry.ping_cookie,
|
|
|
|
"Require ping cookies to connect",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"reject_after_count",
|
|
|
|
OUTPUT_DECIMAL,
|
2014-03-03 05:25:47 +01:00
|
|
|
&ConfigFileEntry.reject_after_count,
|
2007-01-25 07:40:21 +01:00
|
|
|
"Client rejection threshold setting",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"reject_ban_time",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.reject_ban_time,
|
|
|
|
"Client rejection time interval",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"reject_duration",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.reject_duration,
|
|
|
|
"Client rejection cache duration",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"short_motd",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigFileEntry.short_motd,
|
|
|
|
"Do not show MOTD; only tell clients they should read it"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"stats_e_disabled",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigFileEntry.stats_e_disabled,
|
|
|
|
"STATS e output is disabled",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"stats_c_oper_only",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigFileEntry.stats_c_oper_only,
|
|
|
|
"STATS C output is only shown to operators",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"stats_h_oper_only",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigFileEntry.stats_h_oper_only,
|
|
|
|
"STATS H output is only shown to operators",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"stats_i_oper_only",
|
|
|
|
OUTPUT_BOOLEAN2,
|
|
|
|
&ConfigFileEntry.stats_i_oper_only,
|
|
|
|
"STATS I output is only shown to operators",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"stats_k_oper_only",
|
|
|
|
OUTPUT_BOOLEAN2,
|
|
|
|
&ConfigFileEntry.stats_k_oper_only,
|
|
|
|
"STATS K output is only shown to operators",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"stats_o_oper_only",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigFileEntry.stats_o_oper_only,
|
|
|
|
"STATS O output is only shown to operators",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"stats_P_oper_only",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigFileEntry.stats_P_oper_only,
|
|
|
|
"STATS P is only shown to operators",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"stats_y_oper_only",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigFileEntry.stats_y_oper_only,
|
|
|
|
"STATS Y is only shown to operators",
|
|
|
|
},
|
2008-08-01 01:59:08 +02:00
|
|
|
{
|
|
|
|
"throttle_count",
|
|
|
|
OUTPUT_DECIMAL,
|
2014-03-03 05:25:47 +01:00
|
|
|
&ConfigFileEntry.throttle_count,
|
2008-08-01 01:59:08 +02:00
|
|
|
"Connection throttle threshold",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"throttle_duration",
|
|
|
|
OUTPUT_DECIMAL,
|
2014-03-03 05:25:47 +01:00
|
|
|
&ConfigFileEntry.throttle_duration,
|
2008-08-01 01:59:08 +02:00
|
|
|
"Connection throttle duration",
|
|
|
|
},
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
|
|
|
"tkline_expire_notices",
|
|
|
|
OUTPUT_BOOLEAN,
|
|
|
|
&ConfigFileEntry.tkline_expire_notices,
|
|
|
|
"Notices given to opers when tklines expire"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"ts_max_delta",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.ts_max_delta,
|
|
|
|
"Maximum permitted TS delta from another server"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"ts_warn_delta",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.ts_warn_delta,
|
|
|
|
"Maximum permitted TS delta before displaying a warning"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"warn_no_nline",
|
|
|
|
OUTPUT_BOOLEAN,
|
|
|
|
&ConfigFileEntry.warn_no_nline,
|
2014-04-27 15:33:09 +02:00
|
|
|
"Display warning if connecting server lacks connect block"
|
2007-01-25 07:40:21 +01:00
|
|
|
},
|
2010-03-14 17:21:20 +01:00
|
|
|
{
|
|
|
|
"use_propagated_bans",
|
|
|
|
OUTPUT_BOOLEAN,
|
|
|
|
&ConfigFileEntry.use_propagated_bans,
|
|
|
|
"KLINE sets fully propagated bans"
|
|
|
|
},
|
2012-02-18 04:54:44 +01:00
|
|
|
{
|
|
|
|
"max_ratelimit_tokens",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.max_ratelimit_tokens,
|
|
|
|
"The maximum number of tokens that can be accumulated for executing rate-limited commands",
|
|
|
|
},
|
2012-02-18 16:32:57 +01:00
|
|
|
{
|
|
|
|
"away_interval",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigFileEntry.away_interval,
|
|
|
|
"The minimum time between aways",
|
|
|
|
},
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
|
|
|
"default_split_server_count",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigChannel.default_split_server_count,
|
|
|
|
"Startup value of SPLITNUM",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"default_split_user_count",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigChannel.default_split_user_count,
|
|
|
|
"Startup value of SPLITUSERS",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"knock_delay",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigChannel.knock_delay,
|
|
|
|
"Delay between a users KNOCK attempts"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"knock_delay_channel",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigChannel.knock_delay_channel,
|
|
|
|
"Delay between KNOCK attempts to a channel",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"kick_on_split_riding",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigChannel.kick_on_split_riding,
|
|
|
|
"Kick users riding splits to join +i or +k channels"
|
|
|
|
},
|
2010-12-21 21:38:04 +01:00
|
|
|
{
|
|
|
|
"disable_local_channels",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigChannel.disable_local_channels,
|
|
|
|
"Disable local channels (&channels)"
|
|
|
|
},
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
|
|
|
"max_bans",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigChannel.max_bans,
|
|
|
|
"Total +b/e/I/q modes allowed in a channel",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"max_bans_large",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigChannel.max_bans_large,
|
|
|
|
"Total +b/e/I/q modes allowed in a +L channel",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"max_chans_per_user",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigChannel.max_chans_per_user,
|
|
|
|
"Maximum number of channels a user can join",
|
|
|
|
},
|
2016-01-12 06:32:23 +01:00
|
|
|
{
|
|
|
|
"max_chans_per_user_large",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigChannel.max_chans_per_user_large,
|
|
|
|
"Maximum extended number of channels a user can join",
|
|
|
|
},
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
|
|
|
"no_create_on_split",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigChannel.no_create_on_split,
|
|
|
|
"Disallow creation of channels when split",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"no_join_on_split",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigChannel.no_join_on_split,
|
|
|
|
"Disallow joining channels when split",
|
|
|
|
},
|
2009-02-22 00:12:21 +01:00
|
|
|
{
|
|
|
|
"only_ascii_channels",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigChannel.only_ascii_channels,
|
|
|
|
"Controls whether non-ASCII is disabled for JOIN"
|
|
|
|
},
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
|
|
|
"use_except",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigChannel.use_except,
|
|
|
|
"Enable chanmode +e (ban exceptions)",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"use_invex",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigChannel.use_invex,
|
|
|
|
"Enable chanmode +I (invite exceptions)",
|
|
|
|
},
|
2011-09-25 16:22:29 +02:00
|
|
|
{
|
|
|
|
"use_forward",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigChannel.use_forward,
|
|
|
|
"Enable chanmode +f (channel forwarding)",
|
|
|
|
},
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
|
|
|
"use_knock",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigChannel.use_knock,
|
|
|
|
"Enable /KNOCK",
|
|
|
|
},
|
2009-09-19 21:24:35 +02:00
|
|
|
{
|
|
|
|
"resv_forcepart",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
2010-05-02 22:25:58 +02:00
|
|
|
&ConfigChannel.resv_forcepart,
|
2009-09-19 21:24:35 +02:00
|
|
|
"Force-part local users on channel RESV"
|
|
|
|
},
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
|
|
|
"disable_hidden",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigServerHide.disable_hidden,
|
|
|
|
"Prevent servers from hiding themselves from a flattened /links",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"flatten_links",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigServerHide.flatten_links,
|
|
|
|
"Flatten /links list",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"hidden",
|
|
|
|
OUTPUT_BOOLEAN_YN,
|
|
|
|
&ConfigServerHide.hidden,
|
|
|
|
"Hide this server from a flattened /links on remote servers",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"links_delay",
|
|
|
|
OUTPUT_DECIMAL,
|
|
|
|
&ConfigServerHide.links_delay,
|
|
|
|
"Links rehash delay"
|
|
|
|
},
|
|
|
|
/* --[ END OF TABLE ]---------------------------------------------- */
|
|
|
|
{ (char *) 0, (unsigned int) 0, (void *) 0, (char *) 0}
|
|
|
|
};
|
|
|
|
/* *INDENT-ON* */
|
|
|
|
|
|
|
|
/*
|
2011-03-27 22:35:26 +02:00
|
|
|
** m_info
|
|
|
|
** parv[1] = servername
|
|
|
|
*/
|
2016-03-09 08:37:03 +01:00
|
|
|
static void
|
2016-08-23 02:37:07 +02:00
|
|
|
m_info(struct MsgBuf *msgbuf_p, client::client &client, client::client &source, int parc, const char *parv[])
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
|
|
|
static time_t last_used = 0L;
|
|
|
|
|
2008-04-02 01:53:20 +02:00
|
|
|
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
|
|
|
/* safe enough to give this on a local connect only */
|
2016-08-23 02:37:07 +02:00
|
|
|
sendto_one(&source, form_str(RPL_LOAD2HI),
|
|
|
|
me.name, source.name, "INFO");
|
|
|
|
sendto_one_numeric(&source, RPL_ENDOFINFO, form_str(RPL_ENDOFINFO));
|
2016-03-09 08:37:03 +01:00
|
|
|
return;
|
2007-01-25 07:40:21 +01:00
|
|
|
}
|
|
|
|
else
|
2008-04-02 01:53:20 +02:00
|
|
|
last_used = rb_current_time();
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
if(hunt_server(&client, &source, ":%s INFO :%s", 1, parc, parv) != HUNTED_ISME)
|
2016-03-09 08:37:03 +01:00
|
|
|
return;
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
info_spy(source);
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
send_info_text(source);
|
|
|
|
send_birthdate_online_time(source);
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
sendto_one_numeric(&source, RPL_ENDOFINFO, form_str(RPL_ENDOFINFO));
|
2007-01-25 07:40:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2011-03-27 22:35:26 +02:00
|
|
|
** mo_info
|
|
|
|
** parv[1] = servername
|
|
|
|
*/
|
2016-03-09 08:37:03 +01:00
|
|
|
static void
|
2016-08-23 02:37:07 +02:00
|
|
|
mo_info(struct MsgBuf *msgbuf_p, client::client &client, client::client &source, int parc, const char *parv[])
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
2016-08-23 02:37:07 +02:00
|
|
|
if(hunt_server(&client, &source, ":%s INFO :%s", 1, parc, parv) == HUNTED_ISME)
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
2016-08-23 02:37:07 +02:00
|
|
|
info_spy(source);
|
|
|
|
send_info_text(source);
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
if(IsOper(&source))
|
2008-12-23 00:28:05 +01:00
|
|
|
{
|
2016-08-23 02:37:07 +02:00
|
|
|
send_conf_options(source);
|
|
|
|
sendto_one_numeric(&source, RPL_INFO, ":%s",
|
2008-12-23 00:28:05 +01:00
|
|
|
rb_lib_version());
|
|
|
|
}
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
send_birthdate_online_time(source);
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
sendto_one_numeric(&source, RPL_ENDOFINFO, form_str(RPL_ENDOFINFO));
|
2007-01-25 07:40:21 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* send_info_text
|
|
|
|
*
|
|
|
|
* inputs - client pointer to send info text to
|
|
|
|
* output - none
|
|
|
|
* side effects - info text is sent to client
|
|
|
|
*/
|
|
|
|
static void
|
2016-08-23 02:37:07 +02:00
|
|
|
send_info_text(client::client &source)
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
2016-08-16 01:21:01 +02:00
|
|
|
for (const auto &text : info::credits)
|
2016-08-23 02:37:07 +02:00
|
|
|
sendto_one_numeric(&source, RPL_INFO, form_str(RPL_INFO), text.c_str());
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
sendto_one_numeric(&source, RPL_INFO, form_str(RPL_INFO), "");
|
2007-01-25 07:40:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* send_birthdate_online_time
|
|
|
|
*
|
|
|
|
* inputs - client pointer to send to
|
|
|
|
* output - none
|
|
|
|
* side effects - birthdate and online time are sent
|
|
|
|
*/
|
|
|
|
static void
|
2016-08-23 02:37:07 +02:00
|
|
|
send_birthdate_online_time(client::client &source)
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
2008-04-20 07:03:39 +02:00
|
|
|
char tbuf[26]; /* this needs to be 26 - see ctime_r manpage */
|
2016-08-23 02:37:07 +02:00
|
|
|
sendto_one(&source, ":%s %d %s :Birth Date: %s (%ld)",
|
|
|
|
get_id(&me, &source), RPL_INFO,
|
|
|
|
get_id(&source, &source), info::compiled.c_str(), info::compiled_time);
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
sendto_one(&source, ":%s %d %s :On-line since %s",
|
|
|
|
get_id(&me, &source), RPL_INFO,
|
|
|
|
get_id(&source, &source), info::startup.c_str());
|
2007-01-25 07:40:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* send_conf_options
|
|
|
|
*
|
|
|
|
* inputs - client pointer to send to
|
|
|
|
* output - none
|
|
|
|
* side effects - send config options to client
|
|
|
|
*/
|
|
|
|
static void
|
2016-08-23 02:37:07 +02:00
|
|
|
send_conf_options(client::client &source)
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Now send them a list of all our configuration options
|
2016-03-20 01:14:26 +01:00
|
|
|
* (mostly from defaults.h)
|
2007-01-25 07:40:21 +01:00
|
|
|
*/
|
2016-08-16 01:21:01 +02:00
|
|
|
for (const auto &line : info::myinfo)
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
2016-08-16 01:21:01 +02:00
|
|
|
if (line.valnum)
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
2016-08-23 02:37:07 +02:00
|
|
|
sendto_one(&source, ":%s %d %s :%-30s %-16d [%s]",
|
|
|
|
get_id(&me, &source), RPL_INFO,
|
|
|
|
get_id(&source, &source),
|
2016-08-16 01:21:01 +02:00
|
|
|
line.key.c_str(), line.valnum,
|
|
|
|
line.desc.c_str());
|
2007-01-25 07:40:21 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-08-23 02:37:07 +02:00
|
|
|
sendto_one(&source, ":%s %d %s :%-30s %-16s [%s]",
|
|
|
|
get_id(&me, &source), RPL_INFO,
|
|
|
|
get_id(&source, &source),
|
2016-08-16 01:21:01 +02:00
|
|
|
line.key.c_str(), line.valstr.c_str(),
|
|
|
|
line.desc.c_str());
|
2007-01-25 07:40:21 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Parse the info_table[] and do the magic.
|
|
|
|
*/
|
2016-08-16 01:21:01 +02:00
|
|
|
for (int i(0); info_table[i].name; i++)
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
|
|
|
switch (info_table[i].output_type)
|
|
|
|
{
|
2014-07-13 02:00:00 +02:00
|
|
|
/*
|
|
|
|
* For "char *" references
|
|
|
|
*/
|
2011-03-27 22:35:26 +02:00
|
|
|
case OUTPUT_STRING:
|
|
|
|
{
|
|
|
|
char *option = *((char **) info_table[i].option);
|
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
sendto_one(&source, ":%s %d %s :%-30s %-16s [%s]",
|
|
|
|
get_id(&me, &source), RPL_INFO,
|
|
|
|
get_id(&source, &source),
|
2011-03-27 22:35:26 +02:00
|
|
|
info_table[i].name,
|
|
|
|
option ? option : "NONE",
|
|
|
|
info_table[i].desc ? info_table[i].desc : "<none>");
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
* For "char foo[]" references
|
|
|
|
*/
|
|
|
|
case OUTPUT_STRING_PTR:
|
|
|
|
{
|
|
|
|
char *option = (char *) info_table[i].option;
|
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
sendto_one(&source, ":%s %d %s :%-30s %-16s [%s]",
|
|
|
|
get_id(&me, &source), RPL_INFO,
|
|
|
|
get_id(&source, &source),
|
2011-03-27 22:35:26 +02:00
|
|
|
info_table[i].name,
|
|
|
|
EmptyString(option) ? "NONE" : option,
|
|
|
|
info_table[i].desc ? info_table[i].desc : "<none>");
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
* Output info_table[i].option as a decimal value.
|
|
|
|
*/
|
|
|
|
case OUTPUT_DECIMAL:
|
|
|
|
{
|
|
|
|
int option = *((int *) info_table[i].option);
|
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
sendto_one(&source, ":%s %d %s :%-30s %-16d [%s]",
|
|
|
|
get_id(&me, &source), RPL_INFO,
|
|
|
|
get_id(&source, &source),
|
2011-03-27 22:35:26 +02:00
|
|
|
info_table[i].name,
|
|
|
|
option,
|
|
|
|
info_table[i].desc ? info_table[i].desc : "<none>");
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Output info_table[i].option as "ON" or "OFF"
|
|
|
|
*/
|
|
|
|
case OUTPUT_BOOLEAN:
|
|
|
|
{
|
|
|
|
int option = *((int *) info_table[i].option);
|
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
sendto_one(&source, ":%s %d %s :%-30s %-16s [%s]",
|
|
|
|
get_id(&me, &source), RPL_INFO,
|
|
|
|
get_id(&source, &source),
|
2011-03-27 22:35:26 +02:00
|
|
|
info_table[i].name,
|
|
|
|
option ? "ON" : "OFF",
|
|
|
|
info_table[i].desc ? info_table[i].desc : "<none>");
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
* Output info_table[i].option as "YES" or "NO"
|
|
|
|
*/
|
|
|
|
case OUTPUT_BOOLEAN_YN:
|
|
|
|
{
|
|
|
|
int option = *((int *) info_table[i].option);
|
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
sendto_one(&source, ":%s %d %s :%-30s %-16s [%s]",
|
|
|
|
get_id(&me, &source), RPL_INFO,
|
|
|
|
get_id(&source, &source),
|
2011-03-27 22:35:26 +02:00
|
|
|
info_table[i].name,
|
|
|
|
option ? "YES" : "NO",
|
|
|
|
info_table[i].desc ? info_table[i].desc : "<none>");
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case OUTPUT_BOOLEAN2:
|
|
|
|
{
|
|
|
|
int option = *((int *) info_table[i].option);
|
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
sendto_one(&source, ":%s %d %s :%-30s %-16s [%s]",
|
|
|
|
me.name, RPL_INFO, source.name,
|
2011-03-27 22:35:26 +02:00
|
|
|
info_table[i].name,
|
|
|
|
option ? ((option == 1) ? "MASK" : "YES") : "NO",
|
|
|
|
info_table[i].desc ? info_table[i].desc : "<none>");
|
|
|
|
} /* switch (info_table[i].output_type) */
|
2007-01-25 07:40:21 +01:00
|
|
|
}
|
|
|
|
} /* forloop */
|
|
|
|
|
|
|
|
|
|
|
|
/* Don't send oper_only_umodes...it's a bit mask, we will have to decode it
|
|
|
|
** in order for it to show up properly to opers who issue INFO
|
|
|
|
*/
|
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
sendto_one_numeric(&source, RPL_INFO, form_str(RPL_INFO), "");
|
2007-01-25 07:40:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* info_spy()
|
2014-03-03 05:25:47 +01:00
|
|
|
*
|
2007-01-25 07:40:21 +01:00
|
|
|
* input - pointer to client
|
|
|
|
* output - none
|
|
|
|
* side effects - hook doing_info is called
|
|
|
|
*/
|
|
|
|
static void
|
2016-08-23 02:37:07 +02:00
|
|
|
info_spy(client::client &source)
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
|
|
|
hook_data hd;
|
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
hd.client = &source;
|
2007-01-25 07:40:21 +01:00
|
|
|
hd.arg1 = hd.arg2 = NULL;
|
|
|
|
|
|
|
|
call_hook(doing_info_hook, &hd);
|
|
|
|
}
|