2007-01-25 06:40:21 +00: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
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "stdinc.h"
|
|
|
|
#include "m_info.h"
|
|
|
|
#include "channel.h"
|
|
|
|
#include "client.h"
|
2008-04-20 05:47:38 +00:00
|
|
|
#include "match.h"
|
2007-01-25 06:40:21 +00:00
|
|
|
#include "ircd.h"
|
|
|
|
#include "hook.h"
|
|
|
|
#include "numeric.h"
|
|
|
|
#include "s_serv.h"
|
|
|
|
#include "s_user.h"
|
|
|
|
#include "send.h"
|
|
|
|
#include "s_conf.h"
|
|
|
|
#include "msg.h"
|
|
|
|
#include "parse.h"
|
|
|
|
#include "modules.h"
|
2019-07-07 04:34:28 +00:00
|
|
|
#include "s_newconf.h"
|
2007-01-25 06:40:21 +00:00
|
|
|
|
2016-03-09 07:29:41 +00:00
|
|
|
static const char info_desc[] =
|
|
|
|
"Provides the INFO command for retrieving server copyright, credits, and other info";
|
|
|
|
|
2007-01-25 06:40:21 +00:00
|
|
|
static void send_conf_options(struct Client *source_p);
|
|
|
|
static void send_birthdate_online_time(struct Client *source_p);
|
|
|
|
static void send_info_text(struct Client *source_p);
|
|
|
|
static void info_spy(struct Client *);
|
|
|
|
|
2016-03-09 07:37:03 +00:00
|
|
|
static void m_info(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
|
|
|
static void mo_info(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
2007-01-25 06:40:21 +00:00
|
|
|
|
|
|
|
struct Message info_msgtab = {
|
2016-02-19 22:42:40 +00:00
|
|
|
"INFO", 0, 0, 0, 0,
|
2007-01-25 06:40:21 +00: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 08:11:50 +00:00
|
|
|
DECLARE_MODULE_AV2(info, NULL, NULL, info_clist, info_hlist, NULL, NULL, NULL, info_desc);
|
2007-01-25 06:40:21 +00:00
|
|
|
|
2020-11-08 21:09:15 +00:00
|
|
|
enum info_output_type {
|
|
|
|
OUTPUT_STRING, /* Output option as %s w/ dereference */
|
|
|
|
OUTPUT_STRING_PTR, /* Output option as %s w/out deference */
|
|
|
|
OUTPUT_DECIMAL, /* Output option as decimal (%d) */
|
|
|
|
OUTPUT_BOOLEAN, /* Output option as "ON" or "OFF" */
|
|
|
|
OUTPUT_BOOLEAN_YN, /* Output option as "YES" or "NO" */
|
|
|
|
OUTPUT_INTBOOL, /* BOOLEAN encoded as an int */
|
|
|
|
OUTPUT_INTBOOL_YN, /* BOOLEAN_YN encoded as an int */
|
|
|
|
OUTPUT_YESNOMASK, /* Output option as "YES/NO/MASKED" */
|
2020-11-09 14:50:08 +00:00
|
|
|
OUTPUT_STATSL, /* Output as "YES/NO/SELF" */
|
2020-11-08 21:09:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define INFO_STRING(ptr) OUTPUT_STRING, .option.string_p = (ptr)
|
|
|
|
#define INFO_STRING_PTR(ptr) OUTPUT_STRING_PTR, .option.string = (ptr)
|
|
|
|
#define INFO_BOOLEAN(ptr) OUTPUT_BOOLEAN, .option.bool_ = (ptr)
|
|
|
|
#define INFO_BOOLEAN_YN(ptr) OUTPUT_BOOLEAN_YN, .option.bool_ = (ptr)
|
|
|
|
#define INFO_INTBOOL(ptr) OUTPUT_INTBOOL, .option.int_ = (ptr)
|
|
|
|
#define INFO_INTBOOL_YN(ptr) OUTPUT_INTBOOL_YN, .option.int_ = (ptr)
|
|
|
|
#define INFO_YESNOMASK(ptr) OUTPUT_YESNOMASK, .option.int_ = (ptr)
|
|
|
|
#define INFO_DECIMAL(ptr) OUTPUT_DECIMAL, .option.int_ = (ptr)
|
2020-11-09 14:50:08 +00:00
|
|
|
#define INFO_STATSL(ptr) OUTPUT_STATSL, .option.statsl = (ptr)
|
2020-11-08 21:09:15 +00:00
|
|
|
|
2007-01-25 06:40:21 +00:00
|
|
|
struct InfoStruct
|
|
|
|
{
|
2020-11-08 19:11:54 +00:00
|
|
|
const char *name;
|
|
|
|
const char *desc;
|
2020-11-08 21:09:15 +00:00
|
|
|
enum info_output_type output_type;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
const int *int_;
|
|
|
|
const bool *bool_;
|
2020-11-09 00:55:26 +00:00
|
|
|
char *const *string_p;
|
|
|
|
const char *string;
|
2020-11-09 14:50:08 +00:00
|
|
|
const enum stats_l_oper_only *statsl;
|
2020-11-08 21:09:15 +00:00
|
|
|
} option;
|
2007-01-25 06:40:21 +00:00
|
|
|
};
|
2020-11-08 19:11:54 +00:00
|
|
|
|
2007-01-25 06:40:21 +00:00
|
|
|
/* *INDENT-OFF* */
|
|
|
|
static struct InfoStruct info_table[] = {
|
2020-11-08 19:11:54 +00:00
|
|
|
|
2007-01-25 06:40:21 +00:00
|
|
|
{
|
|
|
|
"opers_see_all_users",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Farconnect notices available or operspy accountability limited",
|
|
|
|
INFO_BOOLEAN(&opers_see_all_users)
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
2008-04-13 15:54:23 +00:00
|
|
|
{
|
|
|
|
"max_connections",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Max number connections",
|
|
|
|
INFO_DECIMAL(&maxconnections),
|
2007-04-05 00:38:52 +00:00
|
|
|
},
|
2007-01-25 06:40:21 +00:00
|
|
|
{
|
|
|
|
"anti_nick_flood",
|
2020-11-08 21:09:15 +00:00
|
|
|
"NICK flood protection",
|
|
|
|
INFO_INTBOOL(&ConfigFileEntry.anti_nick_flood),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"anti_spam_exit_message_time",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Duration a client must be connected for to have an exit message",
|
|
|
|
INFO_DECIMAL(&ConfigFileEntry.anti_spam_exit_message_time),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"caller_id_wait",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Minimum delay between notifying UMODE +g users of messages",
|
|
|
|
INFO_DECIMAL(&ConfigFileEntry.caller_id_wait),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"client_exit",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Prepend 'Quit:' to user QUIT messages",
|
|
|
|
INFO_INTBOOL(&ConfigFileEntry.client_exit),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
2011-03-27 20:35:26 +00:00
|
|
|
"client_flood_max_lines",
|
2007-01-25 06:40:21 +00:00
|
|
|
"Number of lines before a client Excess Flood's",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigFileEntry.client_flood_max_lines),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
2011-03-27 20:35:26 +00:00
|
|
|
{
|
|
|
|
"client_flood_burst_rate",
|
2011-10-03 22:57:49 +00:00
|
|
|
"Maximum lines per second during flood grace period",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigFileEntry.client_flood_burst_rate),
|
2011-03-27 20:35:26 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"client_flood_burst_max",
|
2011-10-03 22:57:49 +00:00
|
|
|
"Number of lines to process at once before delaying",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigFileEntry.client_flood_burst_max),
|
2011-03-27 20:35:26 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"client_flood_message_num",
|
|
|
|
"Number of messages to allow per client_flood_message_time outside of burst",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigFileEntry.client_flood_message_num),
|
2011-03-27 20:35:26 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"client_flood_message_time",
|
|
|
|
"Time to allow per client_flood_message_num outside of burst",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigFileEntry.client_flood_message_time),
|
2011-03-27 20:35:26 +00:00
|
|
|
},
|
2010-01-12 21:32:18 +00:00
|
|
|
{
|
2010-01-13 23:54:49 +00:00
|
|
|
"post_registration_delay",
|
2010-01-12 21:32:18 +00:00
|
|
|
"Time to wait before processing commands from a new client",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigFileEntry.post_registration_delay),
|
2010-01-12 21:32:18 +00:00
|
|
|
},
|
2007-01-25 06:40:21 +00:00
|
|
|
{
|
|
|
|
"connect_timeout",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Connect timeout for connections to servers",
|
|
|
|
INFO_DECIMAL(&ConfigFileEntry.connect_timeout),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
2010-04-05 19:28:44 +00:00
|
|
|
{
|
2010-04-05 20:29:11 +00:00
|
|
|
"default_ident_timeout",
|
2010-04-05 19:28:44 +00:00
|
|
|
"Amount of time the server waits for ident responses from clients",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigFileEntry.default_ident_timeout),
|
2010-04-05 19:28:44 +00:00
|
|
|
},
|
2007-01-25 06:40:21 +00:00
|
|
|
{
|
|
|
|
"default_floodcount",
|
|
|
|
"Startup value of FLOODCOUNT",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigFileEntry.default_floodcount),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"default_adminstring",
|
|
|
|
"Default adminstring at startup.",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_STRING(&ConfigFileEntry.default_adminstring),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"default_operstring",
|
|
|
|
"Default operstring at startup.",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_STRING(&ConfigFileEntry.default_operstring),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"servicestring",
|
|
|
|
"String shown in whois for opered services.",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_STRING(&ConfigFileEntry.servicestring),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
2020-11-09 14:50:08 +00:00
|
|
|
{
|
|
|
|
"drain_reason",
|
|
|
|
"Message to quit users with if this server is draining.",
|
|
|
|
INFO_STRING(&ConfigFileEntry.drain_reason),
|
|
|
|
},
|
2007-01-25 06:40:21 +00:00
|
|
|
{
|
|
|
|
"disable_auth",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Controls whether auth checking is disabled or not",
|
|
|
|
INFO_INTBOOL_YN(&ConfigFileEntry.disable_auth),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"disable_fake_channels",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Controls whether bold etc are disabled for JOIN",
|
|
|
|
INFO_INTBOOL_YN(&ConfigFileEntry.disable_fake_channels),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"dots_in_ident",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Number of permissible dots in an ident",
|
|
|
|
INFO_DECIMAL(&ConfigFileEntry.dots_in_ident),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"failed_oper_notice",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Inform opers if someone /oper's with the wrong password",
|
|
|
|
INFO_INTBOOL(&ConfigFileEntry.failed_oper_notice),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"fname_userlog",
|
2020-11-08 21:09:15 +00:00
|
|
|
"User log file",
|
|
|
|
INFO_STRING(&ConfigFileEntry.fname_userlog),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"fname_fuserlog",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Failed user log file",
|
|
|
|
INFO_STRING(&ConfigFileEntry.fname_fuserlog),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
"fname_operlog",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Operator log file",
|
|
|
|
INFO_STRING(&ConfigFileEntry.fname_operlog),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"fname_foperlog",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Failed operator log file",
|
|
|
|
INFO_STRING(&ConfigFileEntry.fname_foperlog),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"fname_serverlog",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Server connect/disconnect log file",
|
|
|
|
INFO_STRING(&ConfigFileEntry.fname_serverlog),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
2014-03-03 04:12:07 +00:00
|
|
|
{
|
|
|
|
"fname_killlog",
|
2020-11-08 21:09:15 +00:00
|
|
|
"KILL log file",
|
|
|
|
INFO_STRING(&ConfigFileEntry.fname_killlog),
|
2014-03-03 04:12:07 +00:00
|
|
|
},
|
2007-01-25 06:40:21 +00:00
|
|
|
{
|
|
|
|
"fname_klinelog",
|
2020-11-08 21:09:15 +00:00
|
|
|
"KLINE etc log file",
|
|
|
|
INFO_STRING(&ConfigFileEntry.fname_klinelog),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"fname_operspylog",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Oper spy log file",
|
|
|
|
INFO_STRING(&ConfigFileEntry.fname_operspylog),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"fname_ioerrorlog",
|
2020-11-08 21:09:15 +00:00
|
|
|
"IO error log file",
|
|
|
|
INFO_STRING(&ConfigFileEntry.fname_ioerrorlog),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"global_snotices",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Send out certain server notices globally",
|
|
|
|
INFO_INTBOOL_YN(&ConfigFileEntry.global_snotices),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"hide_error_messages",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Hide ERROR messages coming from servers",
|
|
|
|
INFO_YESNOMASK(&ConfigFileEntry.hide_error_messages),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"hide_spoof_ips",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Hide IPs of spoofed users",
|
|
|
|
INFO_INTBOOL_YN(&ConfigFileEntry.hide_spoof_ips),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"kline_reason",
|
2020-11-08 21:09:15 +00:00
|
|
|
"K-lined clients sign off with this reason",
|
|
|
|
INFO_STRING(&ConfigFileEntry.kline_reason),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"dline_with_reason",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Display D-line reason to client on disconnect",
|
|
|
|
INFO_INTBOOL_YN(&ConfigFileEntry.dline_with_reason),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"kline_with_reason",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Display K-line reason to client on disconnect",
|
|
|
|
INFO_INTBOOL_YN(&ConfigFileEntry.kline_with_reason),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
2020-11-09 14:50:08 +00:00
|
|
|
{
|
|
|
|
"hide_tkdline_duration",
|
|
|
|
"Hide \"Temporary K-line 123 min.\" from user K/D-lline reasons",
|
|
|
|
INFO_INTBOOL_YN(&ConfigFileEntry.hide_tkdline_duration),
|
|
|
|
},
|
2007-01-25 06:40:21 +00:00
|
|
|
{
|
|
|
|
"max_accept",
|
|
|
|
"Maximum nicknames on accept list",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigFileEntry.max_accept),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"max_nick_changes",
|
2020-11-08 21:09:15 +00:00
|
|
|
"NICK change threshold setting",
|
|
|
|
INFO_DECIMAL(&ConfigFileEntry.max_nick_changes),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"max_nick_time",
|
2020-11-08 21:09:15 +00:00
|
|
|
"NICK flood protection time interval",
|
|
|
|
INFO_DECIMAL(&ConfigFileEntry.max_nick_time),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"max_targets",
|
2020-11-08 21:09:15 +00:00
|
|
|
"The maximum number of PRIVMSG/NOTICE targets",
|
|
|
|
INFO_DECIMAL(&ConfigFileEntry.max_targets),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"min_nonwildcard",
|
2008-04-11 15:10:40 +00:00
|
|
|
"Minimum non-wildcard chars in K lines",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigFileEntry.min_nonwildcard),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"min_nonwildcard_simple",
|
|
|
|
"Minimum non-wildcard chars in xlines/resvs",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigFileEntry.min_nonwildcard_simple),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"network_name",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Network name",
|
|
|
|
INFO_STRING(&ServerInfo.network_name),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"nick_delay",
|
|
|
|
"Delay nicks are locked for on split",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigFileEntry.nick_delay),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"no_oper_flood",
|
|
|
|
"Disable flood control for operators",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_INTBOOL(&ConfigFileEntry.no_oper_flood),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"non_redundant_klines",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Check for and disallow redundant K-lines",
|
|
|
|
INFO_INTBOOL(&ConfigFileEntry.non_redundant_klines),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"operspy_admin_only",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Send +Z operspy notices to admins only",
|
|
|
|
INFO_INTBOOL(&ConfigFileEntry.operspy_admin_only),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"operspy_dont_care_user_info",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Remove accountability and some '!' requirement from non-channel operspy",
|
|
|
|
INFO_INTBOOL(&ConfigFileEntry.operspy_dont_care_user_info),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"pace_wait",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Minimum delay between uses of certain commands",
|
|
|
|
INFO_DECIMAL(&ConfigFileEntry.pace_wait),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"pace_wait_simple",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Minimum delay between less intensive commands",
|
|
|
|
INFO_DECIMAL(&ConfigFileEntry.pace_wait_simple),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"ping_cookie",
|
|
|
|
"Require ping cookies to connect",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_INTBOOL(&ConfigFileEntry.ping_cookie),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"reject_after_count",
|
|
|
|
"Client rejection threshold setting",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigFileEntry.reject_after_count),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"reject_ban_time",
|
|
|
|
"Client rejection time interval",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigFileEntry.reject_ban_time),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"reject_duration",
|
|
|
|
"Client rejection cache duration",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigFileEntry.reject_duration),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"short_motd",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Do not show MOTD; only tell clients they should read it",
|
|
|
|
INFO_INTBOOL_YN(&ConfigFileEntry.short_motd),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"stats_e_disabled",
|
|
|
|
"STATS e output is disabled",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_INTBOOL_YN(&ConfigFileEntry.stats_e_disabled),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"stats_c_oper_only",
|
|
|
|
"STATS C output is only shown to operators",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_INTBOOL_YN(&ConfigFileEntry.stats_c_oper_only),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"stats_h_oper_only",
|
|
|
|
"STATS H output is only shown to operators",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_INTBOOL_YN(&ConfigFileEntry.stats_h_oper_only),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"stats_i_oper_only",
|
|
|
|
"STATS I output is only shown to operators",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_YESNOMASK(&ConfigFileEntry.stats_i_oper_only),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"stats_k_oper_only",
|
|
|
|
"STATS K output is only shown to operators",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_YESNOMASK(&ConfigFileEntry.stats_k_oper_only),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
2020-11-09 14:50:08 +00:00
|
|
|
{
|
|
|
|
"stats_l_oper_only",
|
|
|
|
"STATS l/L output is only shown to operators",
|
|
|
|
INFO_STATSL(&ConfigFileEntry.stats_l_oper_only),
|
|
|
|
},
|
2007-01-25 06:40:21 +00:00
|
|
|
{
|
|
|
|
"stats_o_oper_only",
|
|
|
|
"STATS O output is only shown to operators",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_INTBOOL_YN(&ConfigFileEntry.stats_o_oper_only),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"stats_P_oper_only",
|
|
|
|
"STATS P is only shown to operators",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_INTBOOL_YN(&ConfigFileEntry.stats_P_oper_only),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"stats_y_oper_only",
|
|
|
|
"STATS Y is only shown to operators",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_INTBOOL_YN(&ConfigFileEntry.stats_y_oper_only),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
2008-07-31 23:59:08 +00:00
|
|
|
{
|
|
|
|
"throttle_count",
|
|
|
|
"Connection throttle threshold",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigFileEntry.throttle_count),
|
2008-07-31 23:59:08 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"throttle_duration",
|
|
|
|
"Connection throttle duration",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigFileEntry.throttle_duration),
|
2008-07-31 23:59:08 +00:00
|
|
|
},
|
2007-01-25 06:40:21 +00:00
|
|
|
{
|
|
|
|
"tkline_expire_notices",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Notices given to opers when tklines expire",
|
|
|
|
INFO_INTBOOL(&ConfigFileEntry.tkline_expire_notices),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"ts_max_delta",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Maximum permitted TS delta from another server",
|
|
|
|
INFO_DECIMAL(&ConfigFileEntry.ts_max_delta),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"ts_warn_delta",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Maximum permitted TS delta before displaying a warning",
|
|
|
|
INFO_DECIMAL(&ConfigFileEntry.ts_warn_delta),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"warn_no_nline",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Display warning if connecting server lacks connect block",
|
|
|
|
INFO_INTBOOL(&ConfigFileEntry.warn_no_nline),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
2010-03-14 16:21:20 +00:00
|
|
|
{
|
|
|
|
"use_propagated_bans",
|
2020-11-08 21:09:15 +00:00
|
|
|
"KLINE sets fully propagated bans",
|
|
|
|
INFO_INTBOOL(&ConfigFileEntry.use_propagated_bans),
|
2010-03-14 16:21:20 +00:00
|
|
|
},
|
2012-02-18 03:54:44 +00:00
|
|
|
{
|
|
|
|
"max_ratelimit_tokens",
|
|
|
|
"The maximum number of tokens that can be accumulated for executing rate-limited commands",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigFileEntry.max_ratelimit_tokens),
|
2012-02-18 03:54:44 +00:00
|
|
|
},
|
2012-02-18 15:32:57 +00:00
|
|
|
{
|
|
|
|
"away_interval",
|
|
|
|
"The minimum time between aways",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigFileEntry.away_interval),
|
2012-02-18 15:32:57 +00:00
|
|
|
},
|
2020-07-05 20:05:18 +00:00
|
|
|
{
|
|
|
|
"tls_ciphers_oper_only",
|
|
|
|
"TLS cipher strings are hidden in whois for non-opers",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_INTBOOL_YN(&ConfigFileEntry.tls_ciphers_oper_only),
|
2020-07-05 20:05:18 +00:00
|
|
|
},
|
2007-01-25 06:40:21 +00:00
|
|
|
{
|
|
|
|
"default_split_server_count",
|
|
|
|
"Startup value of SPLITNUM",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigChannel.default_split_server_count),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"default_split_user_count",
|
|
|
|
"Startup value of SPLITUSERS",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigChannel.default_split_user_count),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"knock_delay",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Delay between a users KNOCK attempts",
|
|
|
|
INFO_DECIMAL(&ConfigChannel.knock_delay),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"knock_delay_channel",
|
|
|
|
"Delay between KNOCK attempts to a channel",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigChannel.knock_delay_channel),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"kick_on_split_riding",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Kick users riding splits to join +i or +k channels",
|
|
|
|
INFO_INTBOOL_YN(&ConfigChannel.kick_on_split_riding),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
2010-12-21 20:38:04 +00:00
|
|
|
{
|
|
|
|
"disable_local_channels",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Disable local channels (&channels)",
|
|
|
|
INFO_INTBOOL_YN(&ConfigChannel.disable_local_channels),
|
2010-12-21 20:38:04 +00:00
|
|
|
},
|
2007-01-25 06:40:21 +00:00
|
|
|
{
|
|
|
|
"max_bans",
|
|
|
|
"Total +b/e/I/q modes allowed in a channel",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigChannel.max_bans),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"max_bans_large",
|
|
|
|
"Total +b/e/I/q modes allowed in a +L channel",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigChannel.max_bans_large),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"max_chans_per_user",
|
|
|
|
"Maximum number of channels a user can join",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigChannel.max_chans_per_user),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
2016-01-12 05:32:23 +00:00
|
|
|
{
|
|
|
|
"max_chans_per_user_large",
|
|
|
|
"Maximum extended number of channels a user can join",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_DECIMAL(&ConfigChannel.max_chans_per_user_large),
|
2016-01-12 05:32:23 +00:00
|
|
|
},
|
2007-01-25 06:40:21 +00:00
|
|
|
{
|
|
|
|
"no_create_on_split",
|
|
|
|
"Disallow creation of channels when split",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_INTBOOL_YN(&ConfigChannel.no_create_on_split),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"no_join_on_split",
|
|
|
|
"Disallow joining channels when split",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_INTBOOL_YN(&ConfigChannel.no_join_on_split),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
2009-02-21 23:12:21 +00:00
|
|
|
{
|
|
|
|
"only_ascii_channels",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Controls whether non-ASCII is disabled for JOIN",
|
|
|
|
INFO_INTBOOL_YN(&ConfigChannel.only_ascii_channels),
|
2009-02-21 23:12:21 +00:00
|
|
|
},
|
2007-01-25 06:40:21 +00:00
|
|
|
{
|
|
|
|
"use_except",
|
|
|
|
"Enable chanmode +e (ban exceptions)",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_INTBOOL_YN(&ConfigChannel.use_except),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"use_invex",
|
|
|
|
"Enable chanmode +I (invite exceptions)",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_INTBOOL_YN(&ConfigChannel.use_invex),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
2011-09-25 14:22:29 +00:00
|
|
|
{
|
|
|
|
"use_forward",
|
|
|
|
"Enable chanmode +f (channel forwarding)",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_INTBOOL_YN(&ConfigChannel.use_forward),
|
2011-09-25 14:22:29 +00:00
|
|
|
},
|
2007-01-25 06:40:21 +00:00
|
|
|
{
|
|
|
|
"use_knock",
|
|
|
|
"Enable /KNOCK",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_INTBOOL_YN(&ConfigChannel.use_knock),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
2009-09-19 19:24:35 +00:00
|
|
|
{
|
|
|
|
"resv_forcepart",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Force-part local users on channel RESV",
|
|
|
|
INFO_INTBOOL_YN(&ConfigChannel.resv_forcepart),
|
2009-09-19 19:24:35 +00:00
|
|
|
},
|
2018-02-27 22:49:13 +00:00
|
|
|
{
|
|
|
|
"opmod_send_statusmsg",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Send messages to @#channel if affected by +z",
|
|
|
|
INFO_INTBOOL_YN(&ConfigChannel.opmod_send_statusmsg),
|
2018-02-27 22:49:13 +00:00
|
|
|
},
|
2020-11-09 14:50:08 +00:00
|
|
|
{
|
|
|
|
"hide_opers",
|
|
|
|
"Hide all opers from unprivileged users",
|
|
|
|
INFO_INTBOOL_YN(&ConfigFileEntry.hide_opers),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"hide_opers_in_whois",
|
|
|
|
"Don't send RPL_WHOISOPERATOR to non-opers",
|
|
|
|
INFO_INTBOOL_YN(&ConfigFileEntry.hide_opers_in_whois),
|
|
|
|
},
|
2007-01-25 06:40:21 +00:00
|
|
|
{
|
|
|
|
"disable_hidden",
|
|
|
|
"Prevent servers from hiding themselves from a flattened /links",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_INTBOOL_YN(&ConfigServerHide.disable_hidden),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"flatten_links",
|
|
|
|
"Flatten /links list",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_INTBOOL_YN(&ConfigServerHide.flatten_links),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"hidden",
|
|
|
|
"Hide this server from a flattened /links on remote servers",
|
2020-11-08 21:09:15 +00:00
|
|
|
INFO_INTBOOL_YN(&ConfigServerHide.hidden),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"links_delay",
|
2020-11-08 21:09:15 +00:00
|
|
|
"Links rehash delay",
|
|
|
|
INFO_DECIMAL(&ConfigServerHide.links_delay),
|
2007-01-25 06:40:21 +00:00
|
|
|
},
|
2020-11-08 19:11:54 +00:00
|
|
|
|
2020-11-08 21:09:15 +00:00
|
|
|
{ NULL, NULL, 0, { NULL } },
|
2007-01-25 06:40:21 +00:00
|
|
|
};
|
|
|
|
/* *INDENT-ON* */
|
|
|
|
|
|
|
|
/*
|
2011-03-27 20:35:26 +00:00
|
|
|
** m_info
|
|
|
|
** parv[1] = servername
|
|
|
|
*/
|
2016-03-09 07:37:03 +00:00
|
|
|
static void
|
2016-02-11 02:54:17 +00:00
|
|
|
m_info(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
2007-01-25 06:40:21 +00:00
|
|
|
{
|
|
|
|
static time_t last_used = 0L;
|
|
|
|
|
2008-04-01 23:53:20 +00:00
|
|
|
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
|
2007-01-25 06:40:21 +00:00
|
|
|
{
|
|
|
|
/* safe enough to give this on a local connect only */
|
|
|
|
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
2011-03-27 20:35:26 +00:00
|
|
|
me.name, source_p->name, "INFO");
|
2007-01-25 06:40:21 +00:00
|
|
|
sendto_one_numeric(source_p, RPL_ENDOFINFO, form_str(RPL_ENDOFINFO));
|
2016-03-09 07:37:03 +00:00
|
|
|
return;
|
2007-01-25 06:40:21 +00:00
|
|
|
}
|
|
|
|
else
|
2008-04-01 23:53:20 +00:00
|
|
|
last_used = rb_current_time();
|
2007-01-25 06:40:21 +00:00
|
|
|
|
|
|
|
if(hunt_server(client_p, source_p, ":%s INFO :%s", 1, parc, parv) != HUNTED_ISME)
|
2016-03-09 07:37:03 +00:00
|
|
|
return;
|
2007-01-25 06:40:21 +00:00
|
|
|
|
|
|
|
info_spy(source_p);
|
|
|
|
|
|
|
|
send_info_text(source_p);
|
|
|
|
send_birthdate_online_time(source_p);
|
|
|
|
|
|
|
|
sendto_one_numeric(source_p, RPL_ENDOFINFO, form_str(RPL_ENDOFINFO));
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2011-03-27 20:35:26 +00:00
|
|
|
** mo_info
|
|
|
|
** parv[1] = servername
|
|
|
|
*/
|
2016-03-09 07:37:03 +00:00
|
|
|
static void
|
2016-02-11 02:54:17 +00:00
|
|
|
mo_info(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
2007-01-25 06:40:21 +00:00
|
|
|
{
|
|
|
|
if(hunt_server(client_p, source_p, ":%s INFO :%s", 1, parc, parv) == HUNTED_ISME)
|
|
|
|
{
|
|
|
|
info_spy(source_p);
|
|
|
|
send_info_text(source_p);
|
|
|
|
|
2019-07-07 04:34:28 +00:00
|
|
|
if(IsOperGeneral(source_p))
|
2008-12-22 23:28:05 +00:00
|
|
|
{
|
2007-01-25 06:40:21 +00:00
|
|
|
send_conf_options(source_p);
|
2008-12-22 23:28:05 +00:00
|
|
|
sendto_one_numeric(source_p, RPL_INFO, ":%s",
|
|
|
|
rb_lib_version());
|
|
|
|
}
|
2007-01-25 06:40:21 +00:00
|
|
|
|
|
|
|
send_birthdate_online_time(source_p);
|
|
|
|
|
|
|
|
sendto_one_numeric(source_p, RPL_ENDOFINFO, form_str(RPL_ENDOFINFO));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* send_info_text
|
|
|
|
*
|
|
|
|
* inputs - client pointer to send info text to
|
|
|
|
* output - none
|
|
|
|
* side effects - info text is sent to client
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
send_info_text(struct Client *source_p)
|
|
|
|
{
|
|
|
|
const char **text = infotext;
|
|
|
|
|
|
|
|
while (*text)
|
|
|
|
{
|
|
|
|
sendto_one_numeric(source_p, RPL_INFO, form_str(RPL_INFO), *text++);
|
|
|
|
}
|
|
|
|
|
|
|
|
sendto_one_numeric(source_p, RPL_INFO, form_str(RPL_INFO), "");
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* send_birthdate_online_time
|
|
|
|
*
|
|
|
|
* inputs - client pointer to send to
|
|
|
|
* output - none
|
|
|
|
* side effects - birthdate and online time are sent
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
send_birthdate_online_time(struct Client *source_p)
|
|
|
|
{
|
2008-04-20 05:03:39 +00:00
|
|
|
char tbuf[26]; /* this needs to be 26 - see ctime_r manpage */
|
2007-01-25 06:40:21 +00:00
|
|
|
sendto_one(source_p, ":%s %d %s :Birth Date: %s, compile # %s",
|
2014-03-03 04:25:47 +00:00
|
|
|
get_id(&me, source_p), RPL_INFO,
|
2011-03-27 20:35:26 +00:00
|
|
|
get_id(source_p, source_p), creation, generation);
|
2007-01-25 06:40:21 +00:00
|
|
|
|
|
|
|
sendto_one(source_p, ":%s %d %s :On-line since %s",
|
2014-03-03 04:25:47 +00:00
|
|
|
get_id(&me, source_p), RPL_INFO,
|
2011-03-27 20:35:26 +00:00
|
|
|
get_id(source_p, source_p), rb_ctime(startup_time, tbuf, sizeof(tbuf)));
|
2007-01-25 06:40:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* send_conf_options
|
|
|
|
*
|
|
|
|
* inputs - client pointer to send to
|
|
|
|
* output - none
|
|
|
|
* side effects - send config options to client
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
send_conf_options(struct Client *source_p)
|
|
|
|
{
|
|
|
|
Info *infoptr;
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Now send them a list of all our configuration options
|
2016-03-20 00:14:26 +00:00
|
|
|
* (mostly from defaults.h)
|
2007-01-25 06:40:21 +00:00
|
|
|
*/
|
|
|
|
for (infoptr = MyInformation; infoptr->name; infoptr++)
|
|
|
|
{
|
|
|
|
if(infoptr->intvalue)
|
|
|
|
{
|
2014-07-13 00:00:00 +00:00
|
|
|
sendto_one(source_p, ":%s %d %s :%-30s %-16d [%s]",
|
2011-03-27 20:35:26 +00:00
|
|
|
get_id(&me, source_p), RPL_INFO,
|
|
|
|
get_id(source_p, source_p),
|
2014-03-03 04:25:47 +00:00
|
|
|
infoptr->name, infoptr->intvalue,
|
2011-03-27 20:35:26 +00:00
|
|
|
infoptr->desc);
|
2007-01-25 06:40:21 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-07-13 00:00:00 +00:00
|
|
|
sendto_one(source_p, ":%s %d %s :%-30s %-16s [%s]",
|
2011-03-27 20:35:26 +00:00
|
|
|
get_id(&me, source_p), RPL_INFO,
|
|
|
|
get_id(source_p, source_p),
|
2014-03-03 04:25:47 +00:00
|
|
|
infoptr->name, infoptr->strvalue,
|
2011-03-27 20:35:26 +00:00
|
|
|
infoptr->desc);
|
2007-01-25 06:40:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Parse the info_table[] and do the magic.
|
|
|
|
*/
|
|
|
|
for (i = 0; info_table[i].name; i++)
|
|
|
|
{
|
2020-11-08 21:15:20 +00:00
|
|
|
static char opt_buf[BUFSIZE];
|
2020-11-09 00:55:26 +00:00
|
|
|
const char *opt_value = opt_buf;
|
2020-11-08 21:15:20 +00:00
|
|
|
|
|
|
|
|
2007-01-25 06:40:21 +00:00
|
|
|
switch (info_table[i].output_type)
|
|
|
|
{
|
2020-11-08 21:09:15 +00:00
|
|
|
case OUTPUT_STRING:
|
|
|
|
{
|
2020-11-09 00:55:26 +00:00
|
|
|
const char *option = *info_table[i].option.string_p;
|
2020-11-08 21:15:20 +00:00
|
|
|
opt_value = option != NULL ? option : "NONE";
|
2020-11-08 21:09:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case OUTPUT_STRING_PTR:
|
|
|
|
{
|
2020-11-09 00:55:26 +00:00
|
|
|
const char *option = info_table[i].option.string;
|
2020-11-08 21:15:20 +00:00
|
|
|
opt_value = option != NULL ? option : "NONE";
|
2020-11-08 21:09:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case OUTPUT_DECIMAL:
|
|
|
|
{
|
|
|
|
int option = *info_table[i].option.int_;
|
2020-11-08 21:15:20 +00:00
|
|
|
snprintf(opt_buf, sizeof opt_buf, "%d", option);
|
2020-11-08 21:09:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case OUTPUT_BOOLEAN:
|
|
|
|
{
|
|
|
|
bool option = *info_table[i].option.bool_;
|
2020-11-08 21:15:20 +00:00
|
|
|
opt_value = option ? "ON" : "OFF";
|
2020-11-08 21:09:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case OUTPUT_BOOLEAN_YN:
|
|
|
|
{
|
|
|
|
bool option = *info_table[i].option.bool_;
|
2020-11-08 21:15:20 +00:00
|
|
|
opt_value = option ? "YES" : "NO";
|
2020-11-08 21:09:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case OUTPUT_YESNOMASK:
|
|
|
|
{
|
|
|
|
int option = *info_table[i].option.int_;
|
2020-11-08 21:15:20 +00:00
|
|
|
opt_value = option == 0 ? "NO" :
|
|
|
|
option == 1 ? "MASK" :
|
|
|
|
"YES";
|
|
|
|
break;
|
2020-11-08 21:09:15 +00:00
|
|
|
}
|
|
|
|
case OUTPUT_INTBOOL:
|
|
|
|
{
|
|
|
|
bool option = *info_table[i].option.int_;
|
2020-11-08 21:15:20 +00:00
|
|
|
opt_value = option ? "ON" : "OFF";
|
2020-11-08 21:09:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case OUTPUT_INTBOOL_YN:
|
|
|
|
{
|
|
|
|
bool option = *info_table[i].option.int_;
|
2020-11-08 21:15:20 +00:00
|
|
|
opt_value = option ? "YES" : "NO";
|
2020-11-08 21:09:15 +00:00
|
|
|
break;
|
|
|
|
}
|
2020-11-09 14:50:08 +00:00
|
|
|
case OUTPUT_STATSL:
|
|
|
|
{
|
|
|
|
enum stats_l_oper_only option = *info_table[i].option.statsl;
|
|
|
|
opt_value = option == STATS_L_OPER_ONLY_NO ? "NO" :
|
|
|
|
option == STATS_L_OPER_ONLY_SELF ? "SELF" :
|
|
|
|
"YES";
|
|
|
|
break;
|
|
|
|
}
|
2007-01-25 06:40:21 +00:00
|
|
|
}
|
2020-11-08 21:15:20 +00:00
|
|
|
|
|
|
|
sendto_one(source_p, ":%s %d %s :%-30s %-16s [%s]",
|
|
|
|
get_id(&me, source_p), RPL_INFO,
|
|
|
|
get_id(source_p, source_p),
|
|
|
|
info_table[i].name,
|
|
|
|
opt_value,
|
|
|
|
info_table[i].desc ? info_table[i].desc : "<none>");
|
2020-11-08 19:11:54 +00:00
|
|
|
}
|
2007-01-25 06:40:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* 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
|
|
|
|
*/
|
|
|
|
|
|
|
|
sendto_one_numeric(source_p, RPL_INFO, form_str(RPL_INFO), "");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* info_spy()
|
2014-03-03 04:25:47 +00:00
|
|
|
*
|
2007-01-25 06:40:21 +00:00
|
|
|
* input - pointer to client
|
|
|
|
* output - none
|
|
|
|
* side effects - hook doing_info is called
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
info_spy(struct Client *source_p)
|
|
|
|
{
|
|
|
|
hook_data hd;
|
|
|
|
|
|
|
|
hd.client = source_p;
|
|
|
|
hd.arg1 = hd.arg2 = NULL;
|
|
|
|
|
|
|
|
call_hook(doing_info_hook, &hd);
|
|
|
|
}
|