| 23 |
|
*/ |
| 24 |
|
|
| 25 |
|
#include "stdinc.h" |
| 26 |
< |
#include "tools.h" |
| 27 |
< |
#include "m_info.h" |
| 26 |
> |
#include "list.h" |
| 27 |
|
#include "channel.h" |
| 28 |
|
#include "client.h" |
| 30 |
– |
#include "common.h" |
| 29 |
|
#include "irc_string.h" |
| 30 |
|
#include "ircd.h" |
| 33 |
– |
#include "hook.h" |
| 31 |
|
#include "numeric.h" |
| 35 |
– |
#include "s_log.h" |
| 32 |
|
#include "s_serv.h" |
| 33 |
|
#include "s_user.h" |
| 34 |
|
#include "send.h" |
| 35 |
< |
#include "s_conf.h" |
| 40 |
< |
#include "handlers.h" |
| 41 |
< |
#include "msg.h" |
| 35 |
> |
#include "conf.h" |
| 36 |
|
#include "parse.h" |
| 37 |
|
#include "modules.h" |
| 38 |
|
|
| 45 |
– |
static void send_conf_options(struct Client *); |
| 46 |
– |
static void send_birthdate_online_time(struct Client *); |
| 47 |
– |
static void send_info_text(struct Client *); |
| 48 |
– |
|
| 49 |
– |
static void m_info(struct Client *, struct Client *, int, char *[]); |
| 50 |
– |
static void ms_info(struct Client *, struct Client *, int, char *[]); |
| 51 |
– |
static void mo_info(struct Client *, struct Client *, int, char *[]); |
| 52 |
– |
|
| 53 |
– |
struct Message info_msgtab = { |
| 54 |
– |
"INFO", 0, 0, 0, 0, MFLG_SLOW, 0, |
| 55 |
– |
{ m_unregistered, m_info, ms_info, m_ignore, mo_info, m_ignore } |
| 56 |
– |
}; |
| 57 |
– |
|
| 58 |
– |
#ifndef STATIC_MODULES |
| 59 |
– |
const char *_version = "$Revision$"; |
| 60 |
– |
static struct Callback *info_cb; |
| 61 |
– |
|
| 62 |
– |
static void * |
| 63 |
– |
va_send_info_text(va_list args) |
| 64 |
– |
{ |
| 65 |
– |
send_info_text(va_arg(args, struct Client *)); |
| 66 |
– |
return NULL; |
| 67 |
– |
} |
| 68 |
– |
|
| 69 |
– |
void |
| 70 |
– |
_modinit(void) |
| 71 |
– |
{ |
| 72 |
– |
info_cb = register_callback("doing_info", va_send_info_text); |
| 73 |
– |
mod_add_cmd(&info_msgtab); |
| 74 |
– |
} |
| 75 |
– |
|
| 76 |
– |
void |
| 77 |
– |
_moddeinit(void) |
| 78 |
– |
{ |
| 79 |
– |
mod_del_cmd(&info_msgtab); |
| 80 |
– |
uninstall_hook(info_cb, va_send_info_text); |
| 81 |
– |
} |
| 82 |
– |
#endif |
| 39 |
|
|
| 40 |
|
/* |
| 41 |
|
* jdc -- Structure for our configuration value table |
| 49 |
|
}; |
| 50 |
|
|
| 51 |
|
/* Types for output_type in InfoStruct */ |
| 52 |
< |
#define OUTPUT_STRING 0x0001 /* Output option as %s w/ dereference */ |
| 53 |
< |
#define OUTPUT_STRING_PTR 0x0002 /* Output option as %s w/out deference */ |
| 54 |
< |
#define OUTPUT_DECIMAL 0x0004 /* Output option as decimal (%d) */ |
| 55 |
< |
#define OUTPUT_BOOLEAN 0x0008 /* Output option as "ON" or "OFF" */ |
| 56 |
< |
#define OUTPUT_BOOLEAN_YN 0x0010 /* Output option as "YES" or "NO" */ |
| 57 |
< |
#define OUTPUT_BOOLEAN2 0x0020 /* Output option as "YES/NO/MASKED" */ |
| 52 |
> |
#define OUTPUT_STRING 0x0001 /* Output option as %s w/ dereference */ |
| 53 |
> |
#define OUTPUT_STRING_PTR 0x0002 /* Output option as %s w/out deference */ |
| 54 |
> |
#define OUTPUT_DECIMAL 0x0004 /* Output option as decimal (%d) */ |
| 55 |
> |
#define OUTPUT_BOOLEAN 0x0008 /* Output option as "ON" or "OFF" */ |
| 56 |
> |
#define OUTPUT_BOOLEAN_YN 0x0010 /* Output option as "YES" or "NO" */ |
| 57 |
> |
#define OUTPUT_BOOLEAN2 0x0020 /* Output option as "YES/NO/MASKED" */ |
| 58 |
|
|
| 59 |
|
static const struct InfoStruct info_table[] = |
| 60 |
|
{ |
| 61 |
|
/* --[ START OF TABLE ]-------------------------------------------- */ |
| 62 |
+ |
|
| 63 |
|
{ |
| 64 |
< |
"network_name", |
| 64 |
> |
"CPATH", |
| 65 |
|
OUTPUT_STRING, |
| 66 |
< |
&ServerInfo.network_name, |
| 67 |
< |
"Network name" |
| 66 |
> |
&ConfigFileEntry.configfile, |
| 67 |
> |
"Path to main configuration file" |
| 68 |
|
}, |
| 69 |
|
{ |
| 70 |
< |
"network_desc", |
| 70 |
> |
"DPATH", |
| 71 |
|
OUTPUT_STRING, |
| 72 |
< |
&ServerInfo.network_desc, |
| 73 |
< |
"Network description" |
| 72 |
> |
&ConfigFileEntry.dpath, |
| 73 |
> |
"Root directory of installation" |
| 74 |
|
}, |
| 75 |
|
{ |
| 76 |
< |
"hub", |
| 77 |
< |
OUTPUT_BOOLEAN_YN, |
| 78 |
< |
&ServerInfo.hub, |
| 79 |
< |
"Server is a hub" |
| 76 |
> |
"DLPATH", |
| 77 |
> |
OUTPUT_STRING, |
| 78 |
> |
&ConfigFileEntry.dlinefile, |
| 79 |
> |
"Path to D-line database file" |
| 80 |
|
}, |
| 81 |
|
{ |
| 82 |
< |
"use_logging", |
| 83 |
< |
OUTPUT_BOOLEAN_YN, |
| 84 |
< |
&ConfigLoggingEntry.use_logging, |
| 85 |
< |
"Enable logging" |
| 82 |
> |
"KPATH", |
| 83 |
> |
OUTPUT_STRING, |
| 84 |
> |
&ConfigFileEntry.klinefile, |
| 85 |
> |
"Path to K-line database file" |
| 86 |
|
}, |
| 87 |
|
{ |
| 88 |
< |
"fuserlog", |
| 89 |
< |
OUTPUT_STRING_PTR, |
| 90 |
< |
&ConfigLoggingEntry.userlog, |
| 91 |
< |
"User log file" |
| 88 |
> |
"GPATH", |
| 89 |
> |
OUTPUT_STRING, |
| 90 |
> |
&ConfigFileEntry.glinefile, |
| 91 |
> |
"Path to G-line database file" |
| 92 |
|
}, |
| 93 |
|
{ |
| 94 |
< |
"foperlog", |
| 95 |
< |
OUTPUT_STRING_PTR, |
| 96 |
< |
&ConfigLoggingEntry.operlog, |
| 97 |
< |
"Operator log file" |
| 94 |
> |
"XPATH", |
| 95 |
> |
OUTPUT_STRING, |
| 96 |
> |
&ConfigFileEntry.xlinefile, |
| 97 |
> |
"Path to X-line database file" |
| 98 |
|
}, |
| 99 |
|
{ |
| 100 |
< |
"fkilllog", |
| 101 |
< |
OUTPUT_STRING_PTR, |
| 102 |
< |
&ConfigLoggingEntry.killlog, |
| 103 |
< |
"Kill log file" |
| 100 |
> |
"RESVPATH", |
| 101 |
> |
OUTPUT_STRING, |
| 102 |
> |
&ConfigFileEntry.resvfile, |
| 103 |
> |
"Path to resv database file" |
| 104 |
|
}, |
| 105 |
|
{ |
| 106 |
< |
"fklinelog", |
| 107 |
< |
OUTPUT_STRING_PTR, |
| 108 |
< |
&ConfigLoggingEntry.klinelog, |
| 109 |
< |
"K-Line log file" |
| 106 |
> |
"network_name", |
| 107 |
> |
OUTPUT_STRING, |
| 108 |
> |
&ServerInfo.network_name, |
| 109 |
> |
"Network name" |
| 110 |
|
}, |
| 111 |
|
{ |
| 112 |
< |
"fglinelog", |
| 113 |
< |
OUTPUT_STRING_PTR, |
| 114 |
< |
&ConfigLoggingEntry.glinelog, |
| 115 |
< |
"G-Line log file" |
| 112 |
> |
"network_desc", |
| 113 |
> |
OUTPUT_STRING, |
| 114 |
> |
&ServerInfo.network_desc, |
| 115 |
> |
"Network description" |
| 116 |
|
}, |
| 117 |
|
{ |
| 118 |
< |
"restrict_channels", |
| 118 |
> |
"hub", |
| 119 |
|
OUTPUT_BOOLEAN_YN, |
| 120 |
< |
&ConfigChannel.restrict_channels, |
| 121 |
< |
"Only reserved channels are allowed" |
| 120 |
> |
&ServerInfo.hub, |
| 121 |
> |
"Server is a hub" |
| 122 |
|
}, |
| 123 |
|
{ |
| 124 |
< |
"disable_local_channels", |
| 125 |
< |
OUTPUT_BOOLEAN_YN, |
| 126 |
< |
&ConfigChannel.disable_local_channels, |
| 127 |
< |
"Prevent users from joining &channels" |
| 124 |
> |
"max_clients", |
| 125 |
> |
OUTPUT_DECIMAL, |
| 126 |
> |
&ServerInfo.max_clients, |
| 127 |
> |
"Maximum number of clients permitted simultaneously on this server" |
| 128 |
|
}, |
| 129 |
< |
{ |
| 130 |
< |
"use_invex", |
| 131 |
< |
OUTPUT_BOOLEAN_YN, |
| 132 |
< |
&ConfigChannel.use_invex, |
| 133 |
< |
"Enable chanmode +I (invite exceptions)" |
| 129 |
> |
{ |
| 130 |
> |
"max_nick_length", |
| 131 |
> |
OUTPUT_DECIMAL, |
| 132 |
> |
&ServerInfo.max_nick_length, |
| 133 |
> |
"Maximum nickname length" |
| 134 |
|
}, |
| 135 |
|
{ |
| 136 |
< |
"use_except", |
| 136 |
> |
"max_topic_length", |
| 137 |
> |
OUTPUT_DECIMAL, |
| 138 |
> |
&ServerInfo.max_topic_length, |
| 139 |
> |
"Maximum topic length" |
| 140 |
> |
}, |
| 141 |
> |
{ |
| 142 |
> |
"use_logging", |
| 143 |
|
OUTPUT_BOOLEAN_YN, |
| 144 |
< |
&ConfigChannel.use_except, |
| 145 |
< |
"Enable chanmode +e (ban exceptions)" |
| 144 |
> |
&ConfigLoggingEntry.use_logging, |
| 145 |
> |
"Enable logging" |
| 146 |
|
}, |
| 147 |
|
{ |
| 148 |
< |
"use_knock", |
| 148 |
> |
"disable_fake_channels", |
| 149 |
|
OUTPUT_BOOLEAN_YN, |
| 150 |
< |
&ConfigChannel.use_knock, |
| 151 |
< |
"Enable /KNOCK" |
| 150 |
> |
&ConfigChannel.disable_fake_channels, |
| 151 |
> |
"Forbids channels with special ASCII characters in their name" |
| 152 |
|
}, |
| 153 |
|
{ |
| 154 |
|
"knock_delay", |
| 163 |
|
"Delay between KNOCK attempts to a channel" |
| 164 |
|
}, |
| 165 |
|
{ |
| 203 |
– |
"invite_ops_only", |
| 204 |
– |
OUTPUT_BOOLEAN_YN, |
| 205 |
– |
&ConfigChannel.invite_ops_only, |
| 206 |
– |
"Restrict invite to ops only" |
| 207 |
– |
}, |
| 208 |
– |
{ |
| 166 |
|
"max_chans_per_user", |
| 167 |
|
OUTPUT_DECIMAL, |
| 168 |
|
&ConfigChannel.max_chans_per_user, |
| 169 |
|
"Maximum number of channels a user can join" |
| 170 |
|
}, |
| 171 |
|
{ |
| 172 |
< |
"quiet_on_ban", |
| 173 |
< |
OUTPUT_BOOLEAN_YN, |
| 174 |
< |
&ConfigChannel.quiet_on_ban, |
| 175 |
< |
"Banned users may not send text to a channel" |
| 172 |
> |
"max_chans_per_oper", |
| 173 |
> |
OUTPUT_DECIMAL, |
| 174 |
> |
&ConfigChannel.max_chans_per_oper, |
| 175 |
> |
"Maximum number of channels an oper can join" |
| 176 |
|
}, |
| 177 |
|
{ |
| 178 |
|
"max_bans", |
| 205 |
|
"Disallow joining channels when split" |
| 206 |
|
}, |
| 207 |
|
{ |
| 251 |
– |
"burst_topicwho", |
| 252 |
– |
OUTPUT_BOOLEAN_YN, |
| 253 |
– |
&ConfigChannel.burst_topicwho, |
| 254 |
– |
"Enable sending of who set topic on topicburst" |
| 255 |
– |
}, |
| 256 |
– |
{ |
| 208 |
|
"flatten_links", |
| 209 |
|
OUTPUT_BOOLEAN_YN, |
| 210 |
|
&ConfigServerHide.flatten_links, |
| 223 |
|
"Hide this server from a flattened /links on remote servers" |
| 224 |
|
}, |
| 225 |
|
{ |
| 275 |
– |
"disable_hidden", |
| 276 |
– |
OUTPUT_BOOLEAN_YN, |
| 277 |
– |
&ConfigServerHide.disable_hidden, |
| 278 |
– |
"Prevent servers from hiding themselves from a flattened /links" |
| 279 |
– |
}, |
| 280 |
– |
{ |
| 226 |
|
"hide_servers", |
| 227 |
|
OUTPUT_BOOLEAN_YN, |
| 228 |
|
&ConfigServerHide.hide_servers, |
| 229 |
|
"Hide servernames from users" |
| 230 |
|
}, |
| 231 |
|
{ |
| 232 |
+ |
"hide_services", |
| 233 |
+ |
OUTPUT_BOOLEAN_YN, |
| 234 |
+ |
&ConfigServerHide.hide_services, |
| 235 |
+ |
"Hides the location of services server" |
| 236 |
+ |
}, |
| 237 |
+ |
{ |
| 238 |
|
"hidden_name", |
| 239 |
|
OUTPUT_STRING, |
| 240 |
|
&ConfigServerHide.hidden_name, |
| 244 |
|
"hide_server_ips", |
| 245 |
|
OUTPUT_BOOLEAN_YN, |
| 246 |
|
&ConfigServerHide.hide_server_ips, |
| 247 |
< |
"Prevent people from seeing server IPs" |
| 247 |
> |
"Prevent people from seeing server IP addresses" |
| 248 |
|
}, |
| 249 |
|
{ |
| 250 |
|
"gline_min_cidr", |
| 265 |
|
"Automatically set mode +i on connecting users" |
| 266 |
|
}, |
| 267 |
|
{ |
| 317 |
– |
"burst_away", |
| 318 |
– |
OUTPUT_BOOLEAN_YN, |
| 319 |
– |
&ConfigFileEntry.burst_away, |
| 320 |
– |
"Send /away string that users have set on the server burst" |
| 321 |
– |
}, |
| 322 |
– |
{ |
| 323 |
– |
"use_whois_actually", |
| 324 |
– |
OUTPUT_BOOLEAN_YN, |
| 325 |
– |
&ConfigFileEntry.use_whois_actually, |
| 326 |
– |
"Show IP address on /WHOIS when possible" |
| 327 |
– |
}, |
| 328 |
– |
{ |
| 268 |
|
"kill_chase_time_limit", |
| 269 |
|
OUTPUT_DECIMAL, |
| 270 |
|
&ConfigFileEntry.kill_chase_time_limit, |
| 274 |
|
"hide_spoof_ips", |
| 275 |
|
OUTPUT_BOOLEAN_YN, |
| 276 |
|
&ConfigFileEntry.hide_spoof_ips, |
| 277 |
< |
"Hide spoofed IP's" |
| 277 |
> |
"Hide spoofed IP addresses" |
| 278 |
|
}, |
| 279 |
|
{ |
| 280 |
|
"ignore_bogus_ts", |
| 291 |
|
{ |
| 292 |
|
"disable_remote_commands", |
| 293 |
|
OUTPUT_BOOLEAN_YN, |
| 294 |
< |
&ConfigFileEntry.disable_remote, |
| 294 |
> |
&ConfigServerHide.disable_remote_commands, |
| 295 |
|
"Prevent users issuing commands on remote servers" |
| 296 |
|
}, |
| 297 |
|
{ |
| 310 |
|
"failed_oper_notice", |
| 311 |
|
OUTPUT_BOOLEAN, |
| 312 |
|
&ConfigFileEntry.failed_oper_notice, |
| 313 |
< |
"Inform opers if someone /oper's with the wrong password" |
| 313 |
> |
"Inform opers if someone tries to /oper with the wrong password" |
| 314 |
|
}, |
| 315 |
|
{ |
| 316 |
|
"dots_in_ident", |
| 319 |
|
"Number of permissable dots in an ident" |
| 320 |
|
}, |
| 321 |
|
{ |
| 383 |
– |
"dot_in_ip6_addr", |
| 384 |
– |
OUTPUT_BOOLEAN, |
| 385 |
– |
&ConfigFileEntry.dot_in_ip6_addr, |
| 386 |
– |
"Suffix a . to ip6 addresses (for linked servers still running hybrid-6)" |
| 387 |
– |
}, |
| 388 |
– |
{ |
| 322 |
|
"min_nonwildcard", |
| 323 |
|
OUTPUT_DECIMAL, |
| 324 |
|
&ConfigFileEntry.min_nonwildcard, |
| 373 |
|
"Maximum permitted TS delta from another server" |
| 374 |
|
}, |
| 375 |
|
{ |
| 443 |
– |
"kline_with_reason", |
| 444 |
– |
OUTPUT_BOOLEAN_YN, |
| 445 |
– |
&ConfigFileEntry.kline_with_reason, |
| 446 |
– |
"Display K-line reason to client on disconnect" |
| 447 |
– |
}, |
| 448 |
– |
{ |
| 449 |
– |
"kline_reason", |
| 450 |
– |
OUTPUT_STRING, |
| 451 |
– |
&ConfigFileEntry.kline_reason, |
| 452 |
– |
"Reason given to K-lined clients on sign off" |
| 453 |
– |
}, |
| 454 |
– |
{ |
| 376 |
|
"warn_no_nline", |
| 377 |
|
OUTPUT_BOOLEAN, |
| 378 |
|
&ConfigFileEntry.warn_no_nline, |
| 379 |
|
"Display warning if connecting server lacks N-line" |
| 380 |
|
}, |
| 381 |
|
{ |
| 382 |
+ |
"stats_e_disabled", |
| 383 |
+ |
OUTPUT_BOOLEAN_YN, |
| 384 |
+ |
&ConfigFileEntry.stats_e_disabled, |
| 385 |
+ |
"Whether or not STATS e is disabled" |
| 386 |
+ |
}, |
| 387 |
+ |
{ |
| 388 |
|
"stats_o_oper_only", |
| 389 |
|
OUTPUT_BOOLEAN_YN, |
| 390 |
|
&ConfigFileEntry.stats_o_oper_only, |
| 463 |
|
"Opers can over-ride RESVs" |
| 464 |
|
}, |
| 465 |
|
{ |
| 539 |
– |
"idletime", |
| 540 |
– |
OUTPUT_DECIMAL, |
| 541 |
– |
&ConfigFileEntry.idletime, |
| 542 |
– |
"Number of seconds before a client is considered idle" |
| 543 |
– |
}, |
| 544 |
– |
{ |
| 466 |
|
"max_targets", |
| 467 |
|
OUTPUT_DECIMAL, |
| 468 |
|
&ConfigFileEntry.max_targets, |
| 469 |
|
"The maximum number of PRIVMSG/NOTICE targets" |
| 470 |
|
}, |
| 471 |
|
{ |
| 551 |
– |
"client_flood", |
| 552 |
– |
OUTPUT_DECIMAL, |
| 553 |
– |
&ConfigFileEntry.client_flood, |
| 554 |
– |
"Maximum amount of data in a client's queue before they are disconnected" |
| 555 |
– |
}, |
| 556 |
– |
{ |
| 472 |
|
"throttle_time", |
| 473 |
|
OUTPUT_DECIMAL, |
| 474 |
|
&ConfigFileEntry.throttle_time, |
| 481 |
|
"G-line (network-wide K-line) support" |
| 482 |
|
}, |
| 483 |
|
{ |
| 484 |
< |
"duration", |
| 484 |
> |
"gline_duration", |
| 485 |
|
OUTPUT_DECIMAL, |
| 486 |
|
&ConfigFileEntry.gline_time, |
| 487 |
|
"Expiry time for G-lines" |
| 488 |
|
}, |
| 489 |
+ |
{ |
| 490 |
+ |
"gline_request_duration", |
| 491 |
+ |
OUTPUT_DECIMAL, |
| 492 |
+ |
&ConfigFileEntry.gline_request_time, |
| 493 |
+ |
"Expiry time for pending G-lines" |
| 494 |
+ |
}, |
| 495 |
+ |
|
| 496 |
|
/* --[ END OF TABLE ]---------------------------------------------- */ |
| 497 |
|
{ |
| 498 |
|
NULL, |
| 502 |
|
} |
| 503 |
|
}; |
| 504 |
|
|
| 583 |
– |
/* |
| 584 |
– |
** m_info() |
| 585 |
– |
** parv[0] = sender prefix |
| 586 |
– |
** parv[1] = servername |
| 587 |
– |
*/ |
| 588 |
– |
static void |
| 589 |
– |
m_info(struct Client *client_p, struct Client *source_p, |
| 590 |
– |
int parc, char *parv[]) |
| 591 |
– |
{ |
| 592 |
– |
static time_t last_used = 0; |
| 593 |
– |
|
| 594 |
– |
if ((last_used + ConfigFileEntry.pace_wait) > CurrentTime) |
| 595 |
– |
{ |
| 596 |
– |
/* safe enough to give this on a local connect only */ |
| 597 |
– |
sendto_one(source_p, form_str(RPL_LOAD2HI), |
| 598 |
– |
me.name, source_p->name); |
| 599 |
– |
return; |
| 600 |
– |
} |
| 601 |
– |
else |
| 602 |
– |
last_used = CurrentTime; |
| 603 |
– |
|
| 604 |
– |
if (!ConfigFileEntry.disable_remote) |
| 605 |
– |
{ |
| 606 |
– |
if (hunt_server(client_p,source_p, ":%s INFO :%s", |
| 607 |
– |
1, parc, parv) != HUNTED_ISME) |
| 608 |
– |
{ |
| 609 |
– |
return; |
| 610 |
– |
} |
| 611 |
– |
} |
| 612 |
– |
|
| 613 |
– |
#ifdef STATIC_MODULES |
| 614 |
– |
send_info_text(source_p); |
| 615 |
– |
#else |
| 616 |
– |
execute_callback(info_cb, source_p, parc, parv); |
| 617 |
– |
#endif |
| 618 |
– |
} |
| 619 |
– |
|
| 620 |
– |
/* |
| 621 |
– |
** mo_info() |
| 622 |
– |
** parv[0] = sender prefix |
| 623 |
– |
** parv[1] = servername |
| 624 |
– |
*/ |
| 625 |
– |
static void |
| 626 |
– |
mo_info(struct Client *client_p, struct Client *source_p, |
| 627 |
– |
int parc, char *parv[]) |
| 628 |
– |
{ |
| 629 |
– |
if (hunt_server(client_p, source_p, ":%s INFO :%s", 1, |
| 630 |
– |
parc, parv) != HUNTED_ISME) |
| 631 |
– |
return; |
| 632 |
– |
|
| 633 |
– |
#ifdef STATIC_MODULES |
| 634 |
– |
send_info_text(source_p); |
| 635 |
– |
#else |
| 636 |
– |
execute_callback(info_cb, source_p, parc, parv); |
| 637 |
– |
#endif |
| 638 |
– |
} |
| 639 |
– |
|
| 640 |
– |
/* |
| 641 |
– |
** ms_info() |
| 642 |
– |
** parv[0] = sender prefix |
| 643 |
– |
** parv[1] = servername |
| 644 |
– |
*/ |
| 645 |
– |
static void |
| 646 |
– |
ms_info(struct Client *client_p, struct Client *source_p, |
| 647 |
– |
int parc, char *parv[]) |
| 648 |
– |
{ |
| 649 |
– |
if (!IsClient(source_p)) |
| 650 |
– |
return; |
| 651 |
– |
|
| 652 |
– |
if (hunt_server(client_p, source_p, ":%s INFO :%s", |
| 653 |
– |
1, parc, parv) != HUNTED_ISME) |
| 654 |
– |
return; |
| 655 |
– |
|
| 656 |
– |
#ifdef STATIC_MODULES |
| 657 |
– |
send_info_text(source_p); |
| 658 |
– |
#else |
| 659 |
– |
execute_callback(info_cb, source_p, parc, parv); |
| 660 |
– |
#endif |
| 661 |
– |
} |
| 662 |
– |
|
| 663 |
– |
/* send_info_text() |
| 664 |
– |
* |
| 665 |
– |
* inputs - client pointer to send info text to |
| 666 |
– |
* output - NONE |
| 667 |
– |
* side effects - info text is sent to client |
| 668 |
– |
*/ |
| 669 |
– |
static void |
| 670 |
– |
send_info_text(struct Client *source_p) |
| 671 |
– |
{ |
| 672 |
– |
const char **text = infotext; |
| 673 |
– |
char *source, *target; |
| 674 |
– |
|
| 675 |
– |
if (!MyClient(source_p) && IsCapable(source_p->from, CAP_TS6) && |
| 676 |
– |
HasID(source_p)) |
| 677 |
– |
source = me.id, target = source_p->id; |
| 678 |
– |
else |
| 679 |
– |
source = me.name, target = source_p->name; |
| 680 |
– |
|
| 681 |
– |
while (*text) |
| 682 |
– |
{ |
| 683 |
– |
const char *line = *text++; |
| 684 |
– |
|
| 685 |
– |
if (*line == '\0') |
| 686 |
– |
line = " "; |
| 687 |
– |
|
| 688 |
– |
sendto_one(source_p, form_str(RPL_INFO), |
| 689 |
– |
source, target, line); |
| 690 |
– |
} |
| 691 |
– |
|
| 692 |
– |
if (IsOper(source_p)) |
| 693 |
– |
send_conf_options(source_p); |
| 694 |
– |
|
| 695 |
– |
send_birthdate_online_time(source_p); |
| 696 |
– |
|
| 697 |
– |
sendto_one(source_p, form_str(RPL_ENDOFINFO), |
| 698 |
– |
me.name, source_p->name); |
| 699 |
– |
} |
| 700 |
– |
|
| 505 |
|
/* send_birthdate_online_time() |
| 506 |
|
* |
| 507 |
|
* inputs - client pointer to send to |
| 512 |
|
send_birthdate_online_time(struct Client *source_p) |
| 513 |
|
{ |
| 514 |
|
if (!MyClient(source_p) && IsCapable(source_p->from, CAP_TS6) && HasID(source_p)) |
| 711 |
– |
{ |
| 515 |
|
sendto_one(source_p, ":%s %d %s :On-line since %s", |
| 516 |
|
me.id, RPL_INFO, source_p->id, |
| 517 |
< |
myctime(me.firsttime)); |
| 715 |
< |
} |
| 517 |
> |
myctime(me.localClient->firsttime)); |
| 518 |
|
else |
| 717 |
– |
{ |
| 519 |
|
sendto_one(source_p, ":%s %d %s :On-line since %s", |
| 520 |
|
me.name, RPL_INFO, source_p->name, |
| 521 |
< |
myctime(me.firsttime)); |
| 721 |
< |
} |
| 521 |
> |
myctime(me.localClient->firsttime)); |
| 522 |
|
} |
| 523 |
|
|
| 524 |
|
/* send_conf_options() |
| 530 |
|
static void |
| 531 |
|
send_conf_options(struct Client *source_p) |
| 532 |
|
{ |
| 733 |
– |
Info *infoptr; |
| 533 |
|
const char *from, *to; |
| 534 |
|
const struct InfoStruct *iptr = NULL; |
| 535 |
|
|
| 536 |
|
/* Now send them a list of all our configuration options |
| 537 |
< |
* (mostly from defaults.h and setup.h) |
| 537 |
> |
* (mostly from defaults.h and config.h) |
| 538 |
|
*/ |
| 539 |
|
if (!MyClient(source_p) && IsCapable(source_p->from, CAP_TS6) && HasID(source_p)) |
| 540 |
|
{ |
| 547 |
|
to = source_p->name; |
| 548 |
|
} |
| 549 |
|
|
| 751 |
– |
for (infoptr = MyInformation; infoptr->name; infoptr++) |
| 752 |
– |
{ |
| 753 |
– |
if (infoptr->intvalue) |
| 754 |
– |
{ |
| 755 |
– |
sendto_one(source_p, ":%s %d %s :%-30s %-5d [%-30s]", |
| 756 |
– |
from, RPL_INFO, to, infoptr->name, |
| 757 |
– |
infoptr->intvalue, infoptr->desc); |
| 758 |
– |
} |
| 759 |
– |
else |
| 760 |
– |
{ |
| 761 |
– |
sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]", |
| 762 |
– |
from, RPL_INFO, to, infoptr->name, |
| 763 |
– |
infoptr->strvalue, infoptr->desc); |
| 764 |
– |
} |
| 765 |
– |
} |
| 766 |
– |
|
| 550 |
|
/* |
| 551 |
|
* Parse the info_table[] and do the magic. |
| 552 |
|
*/ |
| 605 |
|
/* Output info_table[i].option as "YES" or "NO" */ |
| 606 |
|
case OUTPUT_BOOLEAN_YN: |
| 607 |
|
{ |
| 608 |
< |
int option = *((int *)iptr->option); |
| 608 |
> |
const int option = *((int *)iptr->option); |
| 609 |
|
|
| 610 |
|
sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]", |
| 611 |
|
from, RPL_INFO, to, |
| 616 |
|
|
| 617 |
|
case OUTPUT_BOOLEAN2: |
| 618 |
|
{ |
| 619 |
< |
int option = *((int *)iptr->option); |
| 619 |
> |
const int option = *((int *)iptr->option); |
| 620 |
|
|
| 621 |
|
sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]", |
| 622 |
|
from, RPL_INFO, to, |
| 627 |
|
} |
| 628 |
|
} |
| 629 |
|
|
| 847 |
– |
/* Don't send oper_only_umodes...it's a bit mask, we will have to decode it |
| 848 |
– |
* in order for it to show up properly to opers who issue INFO |
| 849 |
– |
*/ |
| 850 |
– |
#ifndef EFNET |
| 851 |
– |
/* jdc -- Only send compile information to admins. */ |
| 852 |
– |
if (IsAdmin(source_p)) |
| 853 |
– |
sendto_one(source_p, ":%s %d %s :Running on [%s]", |
| 854 |
– |
from, RPL_INFO, to, ircd_platform); |
| 855 |
– |
#endif |
| 630 |
|
sendto_one(source_p, form_str(RPL_INFO), |
| 631 |
|
from, to, ""); |
| 632 |
|
} |
| 633 |
+ |
|
| 634 |
+ |
/* send_info_text() |
| 635 |
+ |
* |
| 636 |
+ |
* inputs - client pointer to send info text to |
| 637 |
+ |
* output - NONE |
| 638 |
+ |
* side effects - info text is sent to client |
| 639 |
+ |
*/ |
| 640 |
+ |
static void |
| 641 |
+ |
send_info_text(struct Client *source_p) |
| 642 |
+ |
{ |
| 643 |
+ |
const char **text = infotext; |
| 644 |
+ |
char *source, *target; |
| 645 |
+ |
|
| 646 |
+ |
sendto_realops_flags(UMODE_SPY, L_ALL, SEND_NOTICE, |
| 647 |
+ |
"INFO requested by %s (%s@%s) [%s]", |
| 648 |
+ |
source_p->name, source_p->username, |
| 649 |
+ |
source_p->host, source_p->servptr->name); |
| 650 |
+ |
|
| 651 |
+ |
if (!MyClient(source_p) && IsCapable(source_p->from, CAP_TS6) && |
| 652 |
+ |
HasID(source_p)) |
| 653 |
+ |
source = me.id, target = source_p->id; |
| 654 |
+ |
else |
| 655 |
+ |
source = me.name, target = source_p->name; |
| 656 |
+ |
|
| 657 |
+ |
while (*text) |
| 658 |
+ |
{ |
| 659 |
+ |
const char *line = *text++; |
| 660 |
+ |
|
| 661 |
+ |
if (*line == '\0') |
| 662 |
+ |
line = " "; |
| 663 |
+ |
|
| 664 |
+ |
sendto_one(source_p, form_str(RPL_INFO), |
| 665 |
+ |
source, target, line); |
| 666 |
+ |
} |
| 667 |
+ |
|
| 668 |
+ |
if (HasUMode(source_p, UMODE_OPER)) |
| 669 |
+ |
send_conf_options(source_p); |
| 670 |
+ |
|
| 671 |
+ |
send_birthdate_online_time(source_p); |
| 672 |
+ |
|
| 673 |
+ |
sendto_one(source_p, form_str(RPL_ENDOFINFO), |
| 674 |
+ |
me.name, source_p->name); |
| 675 |
+ |
} |
| 676 |
+ |
|
| 677 |
+ |
/* |
| 678 |
+ |
** m_info() |
| 679 |
+ |
** parv[0] = sender prefix |
| 680 |
+ |
** parv[1] = servername |
| 681 |
+ |
*/ |
| 682 |
+ |
static void |
| 683 |
+ |
m_info(struct Client *client_p, struct Client *source_p, |
| 684 |
+ |
int parc, char *parv[]) |
| 685 |
+ |
{ |
| 686 |
+ |
static time_t last_used = 0; |
| 687 |
+ |
|
| 688 |
+ |
if ((last_used + ConfigFileEntry.pace_wait) > CurrentTime) |
| 689 |
+ |
{ |
| 690 |
+ |
/* safe enough to give this on a local connect only */ |
| 691 |
+ |
sendto_one(source_p, form_str(RPL_LOAD2HI), |
| 692 |
+ |
me.name, source_p->name); |
| 693 |
+ |
return; |
| 694 |
+ |
} |
| 695 |
+ |
|
| 696 |
+ |
last_used = CurrentTime; |
| 697 |
+ |
|
| 698 |
+ |
if (!ConfigServerHide.disable_remote_commands) |
| 699 |
+ |
if (hunt_server(client_p,source_p, ":%s INFO :%s", 1, |
| 700 |
+ |
parc, parv) != HUNTED_ISME) |
| 701 |
+ |
return; |
| 702 |
+ |
|
| 703 |
+ |
send_info_text(source_p); |
| 704 |
+ |
} |
| 705 |
+ |
|
| 706 |
+ |
/* |
| 707 |
+ |
** ms_info() |
| 708 |
+ |
** parv[0] = sender prefix |
| 709 |
+ |
** parv[1] = servername |
| 710 |
+ |
*/ |
| 711 |
+ |
static void |
| 712 |
+ |
ms_info(struct Client *client_p, struct Client *source_p, |
| 713 |
+ |
int parc, char *parv[]) |
| 714 |
+ |
{ |
| 715 |
+ |
if (!IsClient(source_p)) |
| 716 |
+ |
return; |
| 717 |
+ |
|
| 718 |
+ |
if (hunt_server(client_p, source_p, ":%s INFO :%s", 1, |
| 719 |
+ |
parc, parv) != HUNTED_ISME) |
| 720 |
+ |
return; |
| 721 |
+ |
|
| 722 |
+ |
send_info_text(source_p); |
| 723 |
+ |
} |
| 724 |
+ |
|
| 725 |
+ |
static struct Message info_msgtab = { |
| 726 |
+ |
"INFO", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, |
| 727 |
+ |
{ m_unregistered, m_info, ms_info, m_ignore, ms_info, m_ignore } |
| 728 |
+ |
}; |
| 729 |
+ |
|
| 730 |
+ |
static void |
| 731 |
+ |
module_init(void) |
| 732 |
+ |
{ |
| 733 |
+ |
mod_add_cmd(&info_msgtab); |
| 734 |
+ |
} |
| 735 |
+ |
|
| 736 |
+ |
static void |
| 737 |
+ |
module_exit(void) |
| 738 |
+ |
{ |
| 739 |
+ |
mod_del_cmd(&info_msgtab); |
| 740 |
+ |
} |
| 741 |
+ |
|
| 742 |
+ |
struct module module_entry = { |
| 743 |
+ |
.node = { NULL, NULL, NULL }, |
| 744 |
+ |
.name = NULL, |
| 745 |
+ |
.version = "$Revision$", |
| 746 |
+ |
.handle = NULL, |
| 747 |
+ |
.modinit = module_init, |
| 748 |
+ |
.modexit = module_exit, |
| 749 |
+ |
.flags = 0 |
| 750 |
+ |
}; |