ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.2.x/modules/m_info.c
(Generate patch)

Comparing:
ircd-hybrid-8/modules/m_info.c (file contents), Revision 1549 by michael, Mon Oct 1 18:11:11 2012 UTC vs.
ircd-hybrid/branches/8.2.x/modules/m_info.c (file contents), Revision 8918 by michael, Mon Apr 22 09:51:16 2019 UTC

# Line 1 | Line 1
1   /*
2 < *  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3 < *  m_info.c: Sends information about the server.
2 > *  ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3   *
4 < *  Copyright (C) 2005 by the past and present ircd coders, and others.
4 > *  Copyright (c) 1997-2019 ircd-hybrid development team
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 16 | Line 15
15   *
16   *  You should have received a copy of the GNU General Public License
17   *  along with this program; if not, write to the Free Software
18 < *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
18 > *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
19   *  USA
20 < *
21 < *  $Id$
20 > */
21 >
22 > /*! \file m_info.c
23 > * \brief Includes required functions for processing the INFO command.
24 > * \version $Id$
25   */
26  
27   #include "stdinc.h"
28   #include "list.h"
27 #include "channel.h"
29   #include "client.h"
29 #include "irc_string.h"
30   #include "ircd.h"
31   #include "numeric.h"
32 < #include "s_serv.h"
33 < #include "s_user.h"
32 > #include "misc.h"
33 > #include "server.h"
34   #include "send.h"
35   #include "conf.h"
36   #include "parse.h"
37   #include "modules.h"
38 + #include "tls.h"
39  
40  
40 static void send_conf_options(struct Client *);
41 static void send_birthdate_online_time(struct Client *);
42 static void send_info_text(struct Client *);
43
41   /*
42   * jdc -- Structure for our configuration value table
43   */
44   struct InfoStruct
45   {
46 <  const char *name;         /* Displayed variable name           */
47 <  unsigned int output_type; /* See below #defines                */
48 <  void *option;             /* Pointer reference to the value    */
49 <  const char *desc;         /* ASCII description of the variable */
50 < };
46 >  const char *name;  /* Displayed variable name */
47 >  enum
48 >  {
49 >    OUTPUT_STRING = 1,  /* Output option as %s w/ dereference  */
50 >    OUTPUT_STRING_PTR,  /* Output option as %s w/out deference */
51 >    OUTPUT_DECIMAL,  /* Output option as decimal (%d) */
52 >    OUTPUT_BOOLEAN,  /* Output option as "ON" or "OFF" */
53 >    OUTPUT_BOOLEAN_YN,  /* Output option as "YES" or "NO" */
54 >    OUTPUT_BOOLEAN2  /* Output option as "YES/NO/MASKED" */
55 >  } output_type;  /* Type of output. See enum above */
56  
57 < /* Types for output_type in InfoStruct */
58 < #define OUTPUT_STRING     0x0001 /* Output option as %s w/ dereference  */
59 < #define OUTPUT_STRING_PTR 0x0002 /* Output option as %s w/out deference */
58 < #define OUTPUT_DECIMAL    0x0004 /* Output option as decimal (%d)       */
59 < #define OUTPUT_BOOLEAN    0x0008 /* Output option as "ON" or "OFF"      */
60 < #define OUTPUT_BOOLEAN_YN 0x0010 /* Output option as "YES" or "NO"      */
61 < #define OUTPUT_BOOLEAN2   0x0020 /* Output option as "YES/NO/MASKED"    */
57 >  const void *option;  /* Pointer reference to the value */
58 >  const char *desc;  /* ASCII description of the variable */
59 > };
60  
61   static const struct InfoStruct info_table[] =
62   {
63    /* --[  START OF TABLE  ]-------------------------------------------- */
64  
65    {
66 <    "CPATH",
66 >    "DPATH",
67      OUTPUT_STRING,
68 <    &ConfigFileEntry.configfile,
69 <    "Path to Main Configuration File"
68 >    &ConfigGeneral.dpath,
69 >    "Root directory of installation"
70    },
71    {
72 <    "DPATH",
72 >    "SPATH",
73      OUTPUT_STRING,
74 <    &ConfigFileEntry.dpath,
75 <    "Directory Containing Configuration Files"
74 >    &ConfigGeneral.spath,
75 >    "Path to server executable"
76 >  },
77 >  {
78 >    "MPATH",
79 >    OUTPUT_STRING,
80 >    &ConfigGeneral.mpath,
81 >    "Path to main motd (Message of the Day) file"
82 >  },
83 >  {
84 >    "CPATH",
85 >    OUTPUT_STRING,
86 >    &ConfigGeneral.configfile,
87 >    "Path to main configuration file"
88    },
89    {
90      "DLPATH",
91      OUTPUT_STRING,
92 <    &ConfigFileEntry.dlinefile,
93 <    "Path to D-line File"
92 >    &ConfigGeneral.dlinefile,
93 >    "Path to D-line database file"
94    },
95    {
96      "KPATH",
97      OUTPUT_STRING,
98 <    &ConfigFileEntry.klinefile,
99 <    "Path to K-line File"
98 >    &ConfigGeneral.klinefile,
99 >    "Path to K-line database file"
100 >  },
101 >  {
102 >    "XPATH",
103 >    OUTPUT_STRING,
104 >    &ConfigGeneral.xlinefile,
105 >    "Path to X-line database file"
106 >  },
107 >  {
108 >    "RESVPATH",
109 >    OUTPUT_STRING,
110 >    &ConfigGeneral.resvfile,
111 >    "Path to resv database file"
112    },
113    {
114      "network_name",
115      OUTPUT_STRING,
116 <    &ServerInfo.network_name,
116 >    &ConfigServerInfo.network_name,
117      "Network name"
118    },
119    {
120      "network_desc",
121      OUTPUT_STRING,
122 <    &ServerInfo.network_desc,
122 >    &ConfigServerInfo.network_desc,
123      "Network description"
124    },
125    {
126      "hub",
127      OUTPUT_BOOLEAN_YN,
128 <    &ServerInfo.hub,
128 >    &ConfigServerInfo.hub,
129      "Server is a hub"
130    },
131    {
132 +    "default_max_clients",
133 +    OUTPUT_DECIMAL,
134 +    &ConfigServerInfo.default_max_clients,
135 +    "The default maximum number of clients permitted simultaneously on this server"
136 +  },
137 +  {
138 +    "max_nick_length",
139 +    OUTPUT_DECIMAL,
140 +    &ConfigServerInfo.max_nick_length,
141 +    "Maximum nickname length"
142 +  },
143 +  {
144 +    "max_topic_length",
145 +    OUTPUT_DECIMAL,
146 +    &ConfigServerInfo.max_topic_length,
147 +    "Maximum topic length"
148 +  },
149 +  {
150      "use_logging",
151      OUTPUT_BOOLEAN_YN,
152 <    &ConfigLoggingEntry.use_logging,
152 >    &ConfigLog.use_logging,
153      "Enable logging"
154    },
155    {
156 <    "restrict_channels",
156 >    "disable_fake_channels",
157      OUTPUT_BOOLEAN_YN,
158 <    &ConfigChannel.restrict_channels,
159 <    "Only reserved channels are allowed"
158 >    &ConfigChannel.disable_fake_channels,
159 >    "Forbids channels with special ASCII characters in their name"
160    },
161    {
162 <    "knock_delay",
162 >    "invite_client_count",
163      OUTPUT_DECIMAL,
164 <    &ConfigChannel.knock_delay,
165 <    "Delay between a users KNOCK attempts"
164 >    &ConfigChannel.invite_client_count,
165 >    "How many INVITE attempts are permitted in invite_client_time"
166    },
167    {
168 <    "knock_delay_channel",
168 >    "invite_client_time",
169      OUTPUT_DECIMAL,
170 <    &ConfigChannel.knock_delay_channel,
171 <    "Delay between KNOCK attempts to a channel"
170 >    &ConfigChannel.invite_client_time,
171 >    "How many invite_client_count invites are allowed in this time"
172    },
173    {
174 <    "max_chans_per_user",
174 >    "invite_delay_channel",
175      OUTPUT_DECIMAL,
176 <    &ConfigChannel.max_chans_per_user,
177 <    "Maximum number of channels a user can join"
176 >    &ConfigChannel.invite_delay_channel,
177 >    "Delay between INVITE attempts to a channel"
178    },
179    {
180 <    "max_chans_per_oper",
180 >    "invite_expire_time",
181      OUTPUT_DECIMAL,
182 <    &ConfigChannel.max_chans_per_oper,
183 <    "Maximum number of channels an oper can join"
182 >    &ConfigChannel.invite_expire_time,
183 >    "Amount of time an INVITE will be active until it expires"
184    },
185    {
186 <    "quiet_on_ban",
187 <    OUTPUT_BOOLEAN_YN,
188 <    &ConfigChannel.quiet_on_ban,
189 <    "Banned users may not send text to a channel"
186 >    "knock_client_count",
187 >    OUTPUT_DECIMAL,
188 >    &ConfigChannel.knock_client_count,
189 >    "How many KNOCK attempts are permitted in knock_client_time"
190    },
191    {
192 <    "max_bans",
192 >    "knock_client_time",
193      OUTPUT_DECIMAL,
194 <    &ConfigChannel.max_bans,
195 <    "Total +b/e/I modes allowed in a channel"
194 >    &ConfigChannel.knock_client_time,
195 >    "How many knock_client_count knocks are allowed in this time"
196 >  },
197 >  {
198 >    "knock_delay_channel",
199 >    OUTPUT_DECIMAL,
200 >    &ConfigChannel.knock_delay_channel,
201 >    "Delay between KNOCK attempts to a channel"
202    },
203    {
204 <    "default_split_user_count",
204 >    "max_channels",
205      OUTPUT_DECIMAL,
206 <    &ConfigChannel.default_split_user_count,
207 <    "Startup value of SPLITUSERS"
206 >    &ConfigChannel.max_channels,
207 >    "Maximum number of channels a user can join"
208    },
209    {
210 <    "default_split_server_count",
210 >    "max_invites",
211      OUTPUT_DECIMAL,
212 <    &ConfigChannel.default_split_server_count,
213 <    "Startup value of SPLITNUM"
212 >    &ConfigChannel.max_invites,
213 >    "Maximum number of channels a user can be invited to"
214    },
215    {
216 <    "no_create_on_split",
217 <    OUTPUT_BOOLEAN_YN,
218 <    &ConfigChannel.no_create_on_split,
219 <    "Disallow creation of channels when split"
216 >    "max_bans",
217 >    OUTPUT_DECIMAL,
218 >    &ConfigChannel.max_bans,
219 >    "Total +b/e/I modes allowed in a channel"
220    },
221    {
222 <    "no_join_on_split",
223 <    OUTPUT_BOOLEAN_YN,
224 <    &ConfigChannel.no_join_on_split,
225 <    "Disallow joining channels when split"
222 >    "max_bans_large",
223 >    OUTPUT_DECIMAL,
224 >    &ConfigChannel.max_bans_large,
225 >    "Total +b/e/I modes allowed in a +L channel"
226    },
227    {
228      "flatten_links",
# Line 185 | Line 231 | static const struct InfoStruct info_tabl
231      "Flatten /links list"
232    },
233    {
234 <    "links_delay",
234 >    "flatten_links_delay",
235      OUTPUT_DECIMAL,
236 <    &ConfigServerHide.links_delay,
236 >    &ConfigServerHide.flatten_links_delay,
237      "Links rehash delay"
238    },
239    {
240 +    "flatten_links_file",
241 +    OUTPUT_STRING,
242 +    &ConfigServerHide.flatten_links_file,
243 +    "Path to the flatten links cache file"
244 +  },
245 +  {
246      "hidden",
247      OUTPUT_BOOLEAN_YN,
248      &ConfigServerHide.hidden,
# Line 203 | Line 255 | static const struct InfoStruct info_tabl
255      "Hide servernames from users"
256    },
257    {
258 +    "hide_services",
259 +    OUTPUT_BOOLEAN_YN,
260 +    &ConfigServerHide.hide_services,
261 +    "Hides the location of services server"
262 +  },
263 +  {
264      "hidden_name",
265      OUTPUT_STRING,
266      &ConfigServerHide.hidden_name,
# Line 212 | Line 270 | static const struct InfoStruct info_tabl
270      "hide_server_ips",
271      OUTPUT_BOOLEAN_YN,
272      &ConfigServerHide.hide_server_ips,
273 <    "Prevent people from seeing server IPs"
273 >    "Prevent people from seeing server IP addresses"
274 >  },
275 >  {
276 >    "away_count",
277 >    OUTPUT_DECIMAL,
278 >    &ConfigGeneral.away_count,
279 >    "How many AWAY attempts are permitted in away_time"
280 >  },
281 >  {
282 >    "away_time",
283 >    OUTPUT_DECIMAL,
284 >    &ConfigGeneral.away_time,
285 >    "How many away_count aways are allowed in this time"
286 >  },
287 >  {
288 >    "dline_min_cidr",
289 >    OUTPUT_DECIMAL,
290 >    &ConfigGeneral.dline_min_cidr,
291 >    "Minimum required length of a CIDR bitmask for IPv4 D-Lines"
292 >  },
293 >  {
294 >    "dline_min_cidr6",
295 >    OUTPUT_DECIMAL,
296 >    &ConfigGeneral.dline_min_cidr6,
297 >    "Minimum required length of a CIDR bitmask for IPv6 D-Lines"
298    },
299    {
300 <    "gline_min_cidr",
300 >    "kline_min_cidr",
301      OUTPUT_DECIMAL,
302 <    &ConfigFileEntry.gline_min_cidr,
303 <    "Minimum required length of a CIDR bitmask for IPv4 G-Lines"
302 >    &ConfigGeneral.kline_min_cidr,
303 >    "Minimum required length of a CIDR bitmask for IPv4 K-Lines"
304    },
305    {
306 <    "gline_min_cidr6",
306 >    "kline_min_cidr6",
307      OUTPUT_DECIMAL,
308 <    &ConfigFileEntry.gline_min_cidr6,
309 <    "Minimum required length of a CIDR bitmask for IPv6 G-Lines"
308 >    &ConfigGeneral.kline_min_cidr6,
309 >    "Minimum required length of a CIDR bitmask for IPv6 K-Lines"
310    },
311    {
312      "invisible_on_connect",
313      OUTPUT_BOOLEAN_YN,
314 <    &ConfigFileEntry.invisible_on_connect,
314 >    &ConfigGeneral.invisible_on_connect,
315      "Automatically set mode +i on connecting users"
316    },
317    {
318      "kill_chase_time_limit",
319      OUTPUT_DECIMAL,
320 <    &ConfigFileEntry.kill_chase_time_limit,
320 >    &ConfigGeneral.kill_chase_time_limit,
321      "Nick Change Tracker for KILL"
322    },
323    {
324 <    "hide_spoof_ips",
324 >    "cycle_on_host_change",
325      OUTPUT_BOOLEAN_YN,
326 <    &ConfigFileEntry.hide_spoof_ips,
327 <    "Hide spoofed IP's"
246 <  },
247 <  {
248 <    "ignore_bogus_ts",
249 <    OUTPUT_BOOLEAN_YN,
250 <    &ConfigFileEntry.ignore_bogus_ts,
251 <    "Ignore bogus timestamps from other servers"
326 >    &ConfigGeneral.cycle_on_host_change,
327 >    "Send a fake QUIT/JOIN combination on host change"
328    },
329    {
330      "disable_auth",
331      OUTPUT_BOOLEAN_YN,
332 <    &ConfigFileEntry.disable_auth,
332 >    &ConfigGeneral.disable_auth,
333      "Completely disable ident lookups"
334    },
335    {
336      "disable_remote_commands",
337      OUTPUT_BOOLEAN_YN,
338 <    &ConfigFileEntry.disable_remote,
338 >    &ConfigServerHide.disable_remote_commands,
339      "Prevent users issuing commands on remote servers"
340    },
341    {
342      "tkline_expire_notices",
343      OUTPUT_BOOLEAN_YN,
344 <    &ConfigFileEntry.tkline_expire_notices,
344 >    &ConfigGeneral.tkline_expire_notices,
345      "Show temporary kline/xline expire notices"
346    },
347    {
348      "default_floodcount",
349      OUTPUT_DECIMAL,
350 <    &ConfigFileEntry.default_floodcount,
350 >    &ConfigGeneral.default_floodcount,
351      "Startup value of FLOODCOUNT"
352    },
353    {
354 +    "default_floodtime",
355 +    OUTPUT_DECIMAL,
356 +    &ConfigGeneral.default_floodtime,
357 +    "Startup value of FLOODTIME"
358 +  },
359 +  {
360      "failed_oper_notice",
361 <    OUTPUT_BOOLEAN,
362 <    &ConfigFileEntry.failed_oper_notice,
363 <    "Inform opers if someone /oper's with the wrong password"
361 >    OUTPUT_BOOLEAN_YN,
362 >    &ConfigGeneral.failed_oper_notice,
363 >    "Inform opers if someone tries to /oper with the wrong credentials"
364    },
365    {
366      "dots_in_ident",
367      OUTPUT_DECIMAL,
368 <    &ConfigFileEntry.dots_in_ident,
368 >    &ConfigGeneral.dots_in_ident,
369      "Number of permissable dots in an ident"
370    },
371    {
372      "min_nonwildcard",
373      OUTPUT_DECIMAL,
374 <    &ConfigFileEntry.min_nonwildcard,
375 <    "Minimum non-wildcard chars in K/G lines"
374 >    &ConfigGeneral.min_nonwildcard,
375 >    "Minimum non-wildcard chars in K/D lines"
376    },
377    {
378      "min_nonwildcard_simple",
379      OUTPUT_DECIMAL,
380 <    &ConfigFileEntry.min_nonwildcard_simple,
380 >    &ConfigGeneral.min_nonwildcard_simple,
381      "Minimum non-wildcards in gecos bans"
382    },
383    {
384 +    "max_watch",
385 +    OUTPUT_DECIMAL,
386 +    &ConfigGeneral.max_watch,
387 +    "Maximum nicknames on watch list"
388 +  },
389 +  {
390      "max_accept",
391      OUTPUT_DECIMAL,
392 <    &ConfigFileEntry.max_accept,
392 >    &ConfigGeneral.max_accept,
393      "Maximum nicknames on accept list"
394    },
395    {
396 +    "whowas_history_length",
397 +    OUTPUT_DECIMAL,
398 +    &ConfigGeneral.whowas_history_length,
399 +    "Length of the WHOWAS nick name history list"
400 +  },
401 +  {
402      "anti_nick_flood",
403 <    OUTPUT_BOOLEAN,
404 <    &ConfigFileEntry.anti_nick_flood,
403 >    OUTPUT_BOOLEAN_YN,
404 >    &ConfigGeneral.anti_nick_flood,
405      "NICK flood protection"
406    },
407    {
408      "max_nick_time",
409      OUTPUT_DECIMAL,
410 <    &ConfigFileEntry.max_nick_time,
410 >    &ConfigGeneral.max_nick_time,
411      "NICK flood protection time interval"
412    },
413    {
414      "max_nick_changes",
415      OUTPUT_DECIMAL,
416 <    &ConfigFileEntry.max_nick_changes,
416 >    &ConfigGeneral.max_nick_changes,
417      "NICK change threshhold setting"
418    },
419    {
420      "anti_spam_exit_message_time",
421      OUTPUT_DECIMAL,
422 <    &ConfigFileEntry.anti_spam_exit_message_time,
422 >    &ConfigGeneral.anti_spam_exit_message_time,
423      "Duration a client must be connected for to have an exit message"
424    },
425    {
426      "ts_warn_delta",
427      OUTPUT_DECIMAL,
428 <    &ConfigFileEntry.ts_warn_delta,
428 >    &ConfigGeneral.ts_warn_delta,
429      "Maximum permitted TS delta before displaying a warning"
430    },
431    {
432      "ts_max_delta",
433      OUTPUT_DECIMAL,
434 <    &ConfigFileEntry.ts_max_delta,
434 >    &ConfigGeneral.ts_max_delta,
435      "Maximum permitted TS delta from another server"
436    },
437    {
438 <    "warn_no_nline",
439 <    OUTPUT_BOOLEAN,
440 <    &ConfigFileEntry.warn_no_nline,
441 <    "Display warning if connecting server lacks N-line"
438 >    "warn_no_connect_block",
439 >    OUTPUT_BOOLEAN_YN,
440 >    &ConfigGeneral.warn_no_connect_block,
441 >    "Display warning if connecting server lacks a connect{} block"
442 >  },
443 >  {
444 >    "stats_e_disabled",
445 >    OUTPUT_BOOLEAN_YN,
446 >    &ConfigGeneral.stats_e_disabled,
447 >    "Whether or not STATS e is disabled"
448 >  },
449 >  {
450 >    "stats_m_oper_only",
451 >    OUTPUT_BOOLEAN_YN,
452 >    &ConfigGeneral.stats_m_oper_only,
453 >    "STATS m output is only shown to operators"
454    },
455    {
456      "stats_o_oper_only",
457      OUTPUT_BOOLEAN_YN,
458 <    &ConfigFileEntry.stats_o_oper_only,
458 >    &ConfigGeneral.stats_o_oper_only,
459      "STATS O output is only shown to operators"
460    },
461    {
462      "stats_P_oper_only",
463      OUTPUT_BOOLEAN_YN,
464 <    &ConfigFileEntry.stats_P_oper_only,
465 <    "STATS P is only shown to operators"
464 >    &ConfigGeneral.stats_P_oper_only,
465 >    "STATS P output is only shown to operators"
466 >  },
467 >  {
468 >    "stats_u_oper_only",
469 >    OUTPUT_BOOLEAN_YN,
470 >    &ConfigGeneral.stats_u_oper_only,
471 >    "STATS u output is only shown to operators"
472    },
473    {
474      "stats_i_oper_only",
475      OUTPUT_BOOLEAN2,
476 <    &ConfigFileEntry.stats_i_oper_only,
476 >    &ConfigGeneral.stats_i_oper_only,
477      "STATS I output is only shown to operators"
478    },
479    {
480      "stats_k_oper_only",
481      OUTPUT_BOOLEAN2,
482 <    &ConfigFileEntry.stats_k_oper_only,
482 >    &ConfigGeneral.stats_k_oper_only,
483      "STATS K output is only shown to operators"
484    },
485    {
486      "caller_id_wait",
487      OUTPUT_DECIMAL,
488 <    &ConfigFileEntry.caller_id_wait,
488 >    &ConfigGeneral.caller_id_wait,
489      "Minimum delay between notifying UMODE +g users of messages"
490    },
491    {
492      "opers_bypass_callerid",
493      OUTPUT_BOOLEAN_YN,
494 <    &ConfigFileEntry.opers_bypass_callerid,
494 >    &ConfigGeneral.opers_bypass_callerid,
495      "Allows IRC operators to message users who are +g (callerid)"
496    },
497    {
498      "pace_wait_simple",
499      OUTPUT_DECIMAL,
500 <    &ConfigFileEntry.pace_wait_simple,
500 >    &ConfigGeneral.pace_wait_simple,
501      "Minimum delay between less intensive commands"
502    },
503    {
504      "pace_wait",
505      OUTPUT_DECIMAL,
506 <    &ConfigFileEntry.pace_wait,
506 >    &ConfigGeneral.pace_wait,
507      "Minimum delay between uses of certain commands"
508    },
509    {
510      "short_motd",
511      OUTPUT_BOOLEAN_YN,
512 <    &ConfigFileEntry.short_motd,
512 >    &ConfigGeneral.short_motd,
513      "Do not show MOTD; only tell clients they should read it"
514    },
515    {
516      "ping_cookie",
517 <    OUTPUT_BOOLEAN,
518 <    &ConfigFileEntry.ping_cookie,
517 >    OUTPUT_BOOLEAN_YN,
518 >    &ConfigGeneral.ping_cookie,
519      "Require ping cookies to connect"
520    },
521    {
522      "no_oper_flood",
411    OUTPUT_BOOLEAN,
412    &ConfigFileEntry.no_oper_flood,
413    "Reduce flood control for operators"
414  },
415  {
416    "true_no_oper_flood",
417    OUTPUT_BOOLEAN,
418    &ConfigFileEntry.true_no_oper_flood,
419    "Completely disable flood control for operators"
420  },
421  {
422    "oper_pass_resv",
523      OUTPUT_BOOLEAN_YN,
524 <    &ConfigFileEntry.oper_pass_resv,
525 <    "Opers can over-ride RESVs"
524 >    &ConfigGeneral.no_oper_flood,
525 >    "Reduce flood control for operators"
526    },
527    {
528      "max_targets",
529      OUTPUT_DECIMAL,
530 <    &ConfigFileEntry.max_targets,
530 >    &ConfigGeneral.max_targets,
531      "The maximum number of PRIVMSG/NOTICE targets"
532    },
533    {
534 <    "throttle_time",
435 <    OUTPUT_DECIMAL,
436 <    &ConfigFileEntry.throttle_time,
437 <    "Minimum time between client reconnects"
438 <  },
439 <  {
440 <    "glines",
441 <    OUTPUT_BOOLEAN,
442 <    &ConfigFileEntry.glines,
443 <    "G-line (network-wide K-line) support"
444 <  },
445 <  {
446 <    "gline_duration",
534 >    "throttle_count",
535      OUTPUT_DECIMAL,
536 <    &ConfigFileEntry.gline_time,
537 <    "Expiry time for G-lines"
536 >    &ConfigGeneral.throttle_count,
537 >    "Number of connects in throttle_time before connections are blocked"
538    },
451
539    {
540 <    "gline_request_duration",
540 >    "throttle_time",
541      OUTPUT_DECIMAL,
542 <    &ConfigFileEntry.gline_request_time,
543 <    "Expiry time for pending G-lines"
542 >    &ConfigGeneral.throttle_time,
543 >    "Minimum time between client reconnects"
544    },
545  
546    /* --[  END OF TABLE  ]---------------------------------------------- */
# Line 461 | Line 548 | static const struct InfoStruct info_tabl
548      NULL,
549      0,
550      NULL,
551 <    0
551 >    NULL
552    }
553   };
554  
555 < /*
469 < ** m_info()
470 < **  parv[0] = sender prefix
471 < **  parv[1] = servername
472 < */
473 < static void
474 < m_info(struct Client *client_p, struct Client *source_p,
475 <       int parc, char *parv[])
476 < {
477 <  static time_t last_used = 0;
478 <
479 <  if ((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
480 <  {
481 <    /* safe enough to give this on a local connect only */
482 <    sendto_one(source_p, form_str(RPL_LOAD2HI),
483 <               me.name, source_p->name);
484 <    return;
485 <  }
486 <
487 <  last_used = CurrentTime;
488 <
489 <  if (!ConfigFileEntry.disable_remote)
490 <    if (hunt_server(client_p,source_p, ":%s INFO :%s", 1,
491 <                    parc, parv) != HUNTED_ISME)
492 <      return;
493 <
494 <  send_info_text(source_p);
495 < }
496 <
497 < /*
498 < ** mo_info()
499 < **  parv[0] = sender prefix
500 < **  parv[1] = servername
501 < */
502 < static void
503 < mo_info(struct Client *client_p, struct Client *source_p,
504 <        int parc, char *parv[])
555 > static const char *infotext[] =
556   {
557 <  if (hunt_server(client_p, source_p, ":%s INFO :%s", 1,
558 <                  parc, parv) != HUNTED_ISME)
559 <    return;
560 <
561 <  send_info_text(source_p);
562 < }
563 <
564 < /*
565 < ** ms_info()
566 < **  parv[0] = sender prefix
567 < **  parv[1] = servername
568 < */
569 < static void
570 < ms_info(struct Client *client_p, struct Client *source_p,
571 <        int parc, char *parv[])
572 < {
573 <  if (!IsClient(source_p))
574 <      return;
575 <
576 <  if (hunt_server(client_p, source_p, ":%s INFO :%s", 1,
577 <                  parc, parv) != HUNTED_ISME)
578 <    return;
579 <
580 <  send_info_text(source_p);
581 < }
582 <
583 < /* send_info_text()
584 < *
585 < * inputs       - client pointer to send info text to
586 < * output       - NONE
587 < * side effects - info text is sent to client
588 < */
589 < static void
590 < send_info_text(struct Client *source_p)
591 < {
592 <  const char **text = infotext;
593 <  char *source, *target;
594 <
595 <  sendto_realops_flags(UMODE_SPY, L_ALL,
596 <                       "INFO requested by %s (%s@%s) [%s]",
597 <                       source_p->name, source_p->username,
598 <                       source_p->host, source_p->servptr->name);
599 <
600 <  if (!MyClient(source_p) && IsCapable(source_p->from, CAP_TS6) &&
601 <      HasID(source_p))
602 <    source = me.id, target = source_p->id;
603 <  else
604 <    source = me.name, target = source_p->name;
605 <
606 <  while (*text)
607 <  {
608 <    const char *line = *text++;
609 <
610 <    if (*line == '\0')
611 <      line = " ";
612 <
613 <    sendto_one(source_p, form_str(RPL_INFO),
614 <               source, target, line);
615 <  }
616 <
617 <  if (HasUMode(source_p, UMODE_OPER))
567 <    send_conf_options(source_p);
568 <
569 <  send_birthdate_online_time(source_p);
570 <
571 <  sendto_one(source_p, form_str(RPL_ENDOFINFO),
572 <             me.name, source_p->name);
573 < }
557 >  "ircd-hybrid --",
558 >  "Based on the original code written by Jarkko Oikarinen",
559 >  "Copyright (c) 1988-1991 University of Oulu, Computing Center",
560 >  "Copyright (c) 1997-2019 ircd-hybrid development team",
561 >  "",
562 >  "This program is free software; you can redistribute it and/or",
563 >  "modify it under the terms of the GNU General Public License as",
564 >  "published by the Free Software Foundation; either version 2, or",
565 >  "(at your option) any later version.",
566 >  "",
567 >  "",
568 >  "The core team as of this major release:",
569 >  "",
570 >  "Dianora, Diane Bruce <db@db.net>",
571 >  "Michael, Michael Wobst <michael@wobst.fr>",
572 >  "Rodder, Jon Lusky <lusky@blown.net>",
573 >  "Wohali, Joan Touzet <joant@ieee.org>",
574 >  "",
575 >  "The following people have contributed blood, sweat, and/or code to",
576 >  "recent releases of ircd-hybrid, in nick alphabetical order:",
577 >  "",
578 >  "A1kmm, Andrew Miller <a1kmm@mware.virtualave.net>",
579 >  "Adam, Adam <Adam@anope.org>",
580 >  "Adrian Chadd <adrian@creative.net.au>",
581 >  "adx, Piotr Nizynski <nizynski@sysplex.pl>",
582 >  "AndroSyn, Aaron Sethman <androsyn@ratbox.org>",
583 >  "bane, Dragan Dosen <bane@idolnet.org>",
584 >  "billy-jon, William Bierman III <bill@thebiermans.org>",
585 >  "bysin, Ben Kittridge <bkittridge@cfl.rr.com>",
586 >  "cosine, Patrick Alken <wnder@uwns.underworld.net>",
587 >  "cryogen, Stuart Walsh <stu@ipng.org.uk>",
588 >  "David-T, David Taylor <davidt@yadt.co.uk>",
589 >  "Dom, Dominic Hargreaves <dom@earth.li>",
590 >  "Fawkes, Christoph Ostermeier <fawkes@phat-net.de>",
591 >  "fgeek, Henri Salo <henri@nerv.fi>",
592 >  "fl, Lee Hardy <lee@leeh.co.uk>",
593 >  "Garion, Joost Vunderink <garion@efnet.nl>",
594 >  "Habeeb, David Supuran <habeeb@cfl.rr.com>",
595 >  "Hwy101, W. Campbell <wcampbel@botbay.net>",
596 >  "jmallett, Juli Mallett <jmallett@FreeBSD.org>",
597 >  "joshk, Joshua Kwan <joshk@triplehelix.org>",
598 >  "jv, Jakub Vlasek <jv@pilsedu.cz>",
599 >  "k9, Jeremy Chadwick <ircd@jdc.parodius.com>",
600 >  "kire, Erik Small <smalle@hawaii.edu>",
601 >  "knight, Alan LeVee <alan.levee@prometheus-designs.net>",
602 >  "kre, Dinko Korunic <kreator@fly.srk.fer.hr>",
603 >  "madmax, Paul Lomax <madmax@efnet.org>",
604 >  "metalrock, Jack Low <xxjack12xx@gmail.com>",
605 >  "r0d3nt, Andrew Strutt <andrew.strutt@gmail.com>",
606 >  "Riedel, Dennis Vink <dennis@drvink.com>",
607 >  "scuzzy, David Todd <scuzzy@aniverse.net>",
608 >  "spookey, David Colburn <spookey@spookey.org>",
609 >  "TimeMr14C, Yusuf Iskenderoglu <uhc0@stud.uni-karlsruhe.de>",
610 >  "toot, Toby Verrall <to7@antipope.fsnet.co.uk>",
611 >  "vx0, Mark Miller <mark@oc768.net>",
612 >  "wiz, Jason Dambrosio <jason@wiz.cx>",
613 >  "Xride, S\xC3\xB8ren Straarup <xride@x12.dk>",
614 >  "zb^3, Alfred Perlstein <alfred@freebsd.org>",
615 >  "",
616 >  NULL
617 > };
618  
619   /* send_birthdate_online_time()
620   *
# Line 581 | Line 625 | send_info_text(struct Client *source_p)
625   static void
626   send_birthdate_online_time(struct Client *source_p)
627   {
628 <  if (!MyClient(source_p) && IsCapable(source_p->from, CAP_TS6) && HasID(source_p))
629 <  {
630 <    sendto_one(source_p, ":%s %d %s :On-line since %s",
587 <               me.id, RPL_INFO, source_p->id,
588 <               myctime(me.localClient->firsttime));
589 <  }
590 <  else
591 <  {
592 <    sendto_one(source_p, ":%s %d %s :On-line since %s",
593 <               me.name, RPL_INFO, source_p->name,
594 <               myctime(me.localClient->firsttime));
595 <  }
628 >  sendto_one_numeric(source_p, &me, RPL_INFO | SND_EXPLICIT,
629 >                     ":On-line since %s",
630 >                     date(me.connection->created_real));
631   }
632  
633   /* send_conf_options()
# Line 604 | Line 639 | send_birthdate_online_time(struct Client
639   static void
640   send_conf_options(struct Client *source_p)
641   {
607  const char *from, *to;
608  const struct InfoStruct *iptr = NULL;
609
610  /* Now send them a list of all our configuration options
611   * (mostly from defaults.h and config.h)
612   */
613  if (!MyClient(source_p) && IsCapable(source_p->from, CAP_TS6) && HasID(source_p))
614  {
615    from = me.id;
616    to = source_p->id;
617  }
618  else
619  {
620    from = me.name;
621    to = source_p->name;
622  }
623
642    /*
643     * Parse the info_table[] and do the magic.
644     */
645 <  for (iptr = info_table; iptr->name; ++iptr)
645 >  for (const struct InfoStruct *iptr = info_table; iptr->name; ++iptr)
646    {
647      switch (iptr->output_type)
648      {
649        /* For "char *" references */
650        case OUTPUT_STRING:
651        {
652 <        const char *option = *((char **)iptr->option);
652 >        const char *option = *((const char *const *)iptr->option);
653  
654 <        sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
655 <                   from, RPL_INFO, to,
656 <                   iptr->name, option ? option : "NONE",
657 <                   iptr->desc ? iptr->desc : "<none>");
654 >        sendto_one_numeric(source_p, &me, RPL_INFO | SND_EXPLICIT,
655 >                           ":%-30s %-5s [%s]",
656 >                           iptr->name, option ? option : "NONE",
657 >                           iptr->desc ? iptr->desc : "<none>");
658          break;
659        }
660  
# Line 645 | Line 663 | send_conf_options(struct Client *source_
663        {
664          const char *option = iptr->option;
665  
666 <        sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
667 <                   from, RPL_INFO, to,
668 <                   iptr->name, option ? option : "NONE",
669 <                   iptr->desc ? iptr->desc : "<none>");
666 >        sendto_one_numeric(source_p, &me, RPL_INFO | SND_EXPLICIT,
667 >                           ":%-30s %-5s [%s]",
668 >                           iptr->name, option ? option : "NONE",
669 >                           iptr->desc ? iptr->desc : "<none>");
670          break;
671        }
672  
673        /* Output info_table[i].option as a decimal value. */
674        case OUTPUT_DECIMAL:
675        {
676 <        const int option = *((int *)iptr->option);
676 >        const unsigned int option = *((const unsigned int *const)iptr->option);
677  
678 <        sendto_one(source_p, ":%s %d %s :%-30s %-5d [%-30s]",
679 <                   from, RPL_INFO, to, iptr->name,
680 <                   option, iptr->desc ? iptr->desc : "<none>");
678 >        sendto_one_numeric(source_p, &me, RPL_INFO | SND_EXPLICIT,
679 >                           ":%-30s %-5u [%s]",
680 >                           iptr->name, option, iptr->desc ? iptr->desc : "<none>");
681          break;
682        }
683  
684        /* Output info_table[i].option as "ON" or "OFF" */
685        case OUTPUT_BOOLEAN:
686        {
687 <        const int option = *((int *)iptr->option);
687 >        const unsigned int option = *((const unsigned int *const)iptr->option);
688  
689 <        sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
690 <                   from, RPL_INFO, to,
691 <                   iptr->name, option ? "ON" : "OFF",
692 <                   iptr->desc ? iptr->desc : "<none>");
689 >        sendto_one_numeric(source_p, &me, RPL_INFO | SND_EXPLICIT,
690 >                           ":%-30s %-5s [%s]",
691 >                           iptr->name, option ? "ON" : "OFF",
692 >                           iptr->desc ? iptr->desc : "<none>");
693  
694          break;
695        }
# Line 679 | Line 697 | send_conf_options(struct Client *source_
697        /* Output info_table[i].option as "YES" or "NO" */
698        case OUTPUT_BOOLEAN_YN:
699        {
700 <        int option = *((int *)iptr->option);
700 >        const unsigned int option = *((const unsigned int *const)iptr->option);
701  
702 <        sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
703 <                   from, RPL_INFO, to,
704 <                   iptr->name, option ? "YES" : "NO",
705 <                   iptr->desc ? iptr->desc : "<none>");
702 >        sendto_one_numeric(source_p, &me, RPL_INFO | SND_EXPLICIT,
703 >                           ":%-30s %-5s [%s]",
704 >                           iptr->name, option ? "YES" : "NO",
705 >                           iptr->desc ? iptr->desc : "<none>");
706          break;
707        }
708  
709        case OUTPUT_BOOLEAN2:
710        {
711 <        int option = *((int *)iptr->option);
711 >        const unsigned int option = *((const unsigned int *const)iptr->option);
712  
713 <        sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
714 <                   from, RPL_INFO, to,
715 <                   iptr->name, option ? ((option == 1) ? "MASK" : "YES") : "NO",
716 <                   iptr->desc ? iptr->desc : "<none>");
713 >        sendto_one_numeric(source_p, &me, RPL_INFO | SND_EXPLICIT,
714 >                           ":%-30s %-5s [%s]",
715 >                           iptr->name, option ? ((option == 1) ? "MASK" : "YES") : "NO",
716 >                           iptr->desc ? iptr->desc : "<none>");
717          break;
718        }
719      }
720    }
721  
722 <  sendto_one(source_p, form_str(RPL_INFO),
723 <             from, to, "");
722 >  sendto_one_numeric(source_p, &me, RPL_INFO, "");
723 > }
724 >
725 > /* send_info_text()
726 > *
727 > * inputs       - client pointer to send info text to
728 > * output       - NONE
729 > * side effects - info text is sent to client
730 > */
731 > static void
732 > send_info_text(struct Client *source_p)
733 > {
734 >  sendto_realops_flags(UMODE_SPY, L_ALL, SEND_NOTICE,
735 >                       "INFO requested by %s (%s@%s) [%s]",
736 >                       source_p->name, source_p->username,
737 >                       source_p->host, source_p->servptr->name);
738 >
739 >  for (const char **text = infotext; *text; ++text)
740 >  {
741 >    const char *line = *text;
742 >
743 >    if (*line == '\0')
744 >      line = " ";
745 >
746 >    sendto_one_numeric(source_p, &me, RPL_INFO, line);
747 >  }
748 >
749 >  if (HasUMode(source_p, UMODE_OPER))
750 >  {
751 >    send_conf_options(source_p);
752 >
753 >    if (tls_is_initialized())
754 >      sendto_one_numeric(source_p, &me, RPL_INFO, tls_get_version());
755 >  }
756 >
757 >  send_birthdate_online_time(source_p);
758 >
759 >  sendto_one_numeric(source_p, &me, RPL_ENDOFINFO);
760 > }
761 >
762 > /*! \brief INFO command handler
763 > *
764 > * \param source_p Pointer to allocated Client struct from which the message
765 > *                 originally comes from.  This can be a local or remote client.
766 > * \param parc     Integer holding the number of supplied arguments.
767 > * \param parv     Argument vector where parv[0] .. parv[parc-1] are non-NULL
768 > *                 pointers.
769 > * \note Valid arguments for this command are:
770 > *      - parv[0] = command
771 > *      - parv[1] = nickname/servername
772 > */
773 > static int
774 > m_info(struct Client *source_p, int parc, char *parv[])
775 > {
776 >  static uintmax_t last_used = 0;
777 >
778 >  if ((last_used + ConfigGeneral.pace_wait) > event_base->time.sec_monotonic)
779 >  {
780 >    sendto_one_numeric(source_p, &me, RPL_LOAD2HI, "INFO");
781 >    return 0;
782 >  }
783 >
784 >  last_used = event_base->time.sec_monotonic;
785 >
786 >  if (ConfigServerHide.disable_remote_commands == 0)
787 >    if (server_hunt(source_p, ":%s INFO :%s", 1, parc, parv)->ret != HUNTED_ISME)
788 >      return 0;
789 >
790 >  send_info_text(source_p);
791 >  return 0;
792 > }
793 >
794 > /*! \brief INFO command handler
795 > *
796 > * \param source_p Pointer to allocated Client struct from which the message
797 > *                 originally comes from.  This can be a local or remote client.
798 > * \param parc     Integer holding the number of supplied arguments.
799 > * \param parv     Argument vector where parv[0] .. parv[parc-1] are non-NULL
800 > *                 pointers.
801 > * \note Valid arguments for this command are:
802 > *      - parv[0] = command
803 > *      - parv[1] = nickname/servername
804 > */
805 > static int
806 > ms_info(struct Client *source_p, int parc, char *parv[])
807 > {
808 >  if (server_hunt(source_p, ":%s INFO :%s", 1, parc, parv)->ret != HUNTED_ISME)
809 >    return 0;
810 >
811 >  send_info_text(source_p);
812 >  return 0;
813   }
814  
815 < static struct Message info_msgtab = {
816 <  "INFO", 0, 0, 0, MAXPARA, MFLG_SLOW, 0,
817 <  { m_unregistered, m_info, ms_info, m_ignore, mo_info, m_ignore }
815 > static struct Message info_msgtab =
816 > {
817 >  .cmd = "INFO",
818 >  .args_max = MAXPARA,
819 >  .handlers[UNREGISTERED_HANDLER] = m_unregistered,
820 >  .handlers[CLIENT_HANDLER] = m_info,
821 >  .handlers[SERVER_HANDLER] = ms_info,
822 >  .handlers[ENCAP_HANDLER] = m_ignore,
823 >  .handlers[OPER_HANDLER] = ms_info
824   };
825  
826   static void
# Line 722 | Line 835 | module_exit(void)
835    mod_del_cmd(&info_msgtab);
836   }
837  
838 < struct module module_entry = {
839 <  .node    = { NULL, NULL, NULL },
727 <  .name    = NULL,
838 > struct module module_entry =
839 > {
840    .version = "$Revision$",
729  .handle  = NULL,
841    .modinit = module_init,
842    .modexit = module_exit,
732  .flags   = 0
843   };

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)