ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/modules/m_info.c
Revision: 190
Committed: Sun Oct 23 22:06:17 2005 UTC (20 years, 9 months ago) by adx
Content type: text/x-csrc
File size: 20575 byte(s)
Log Message:
* prototypes are now prefixed with either nothing or EXTERN
  (meaning it's an ircd.dll API)
* dynamic modules now work on win32.

File Contents

# Content
1 /*
2 * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3 * m_info.c: Sends information about the server.
4 *
5 * Copyright (C) 2005 by the past and present ircd coders, and others.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 * USA
21 *
22 * $Id$
23 */
24
25 #include "stdinc.h"
26 #include "m_info.h"
27 #include "channel.h"
28 #include "client.h"
29 #include "common.h"
30 #include "ircd.h"
31 #include "numeric.h"
32 #include "s_serv.h"
33 #include "s_user.h"
34 #include "send.h"
35 #include "s_conf.h"
36 #include "handlers.h"
37 #include "msg.h"
38 #include "parse.h"
39 #include "modules.h"
40
41 static void send_conf_options(struct Client *);
42 static void send_birthdate_online_time(struct Client *);
43 static void send_info_text(struct Client *);
44
45 static void m_info(struct Client *, struct Client *, int, char *[]);
46 static void ms_info(struct Client *, struct Client *, int, char *[]);
47 static void mo_info(struct Client *, struct Client *, int, char *[]);
48
49 struct Message info_msgtab = {
50 "INFO", 0, 0, 0, 0, MFLG_SLOW, 0,
51 { m_unregistered, m_info, ms_info, m_ignore, mo_info, m_ignore }
52 };
53
54 #ifndef STATIC_MODULES
55 const char *_version = "$Revision$";
56 static struct Callback *info_cb;
57
58 static void *
59 va_send_info_text(va_list args)
60 {
61 send_info_text(va_arg(args, struct Client *));
62 return NULL;
63 }
64
65 void
66 #ifndef _WIN32
67 _modinit(void)
68 #else
69 info_modinit(void)
70 #endif
71 {
72 info_cb = register_callback("doing_info", va_send_info_text);
73 mod_add_cmd(&info_msgtab);
74 }
75
76 #ifndef _WIN32
77 void
78 _moddeinit(void)
79 {
80 mod_del_cmd(&info_msgtab);
81 uninstall_hook(info_cb, va_send_info_text);
82 }
83 #endif
84 #endif
85
86 /*
87 * jdc -- Structure for our configuration value table
88 */
89 struct InfoStruct
90 {
91 const char *name; /* Displayed variable name */
92 unsigned int output_type; /* See below #defines */
93 void *option; /* Pointer reference to the value */
94 const char *desc; /* ASCII description of the variable */
95 };
96
97 /* Types for output_type in InfoStruct */
98 #define OUTPUT_STRING 0x0001 /* Output option as %s w/ dereference */
99 #define OUTPUT_STRING_PTR 0x0002 /* Output option as %s w/out deference */
100 #define OUTPUT_DECIMAL 0x0004 /* Output option as decimal (%d) */
101 #define OUTPUT_BOOLEAN 0x0008 /* Output option as "ON" or "OFF" */
102 #define OUTPUT_BOOLEAN_YN 0x0010 /* Output option as "YES" or "NO" */
103 #define OUTPUT_BOOLEAN2 0x0020 /* Output option as "YES/NO/MASKED" */
104
105 static const struct InfoStruct info_table[] =
106 {
107 /* --[ START OF TABLE ]-------------------------------------------- */
108 {
109 "network_name",
110 OUTPUT_STRING,
111 &ServerInfo.network_name,
112 "Network name"
113 },
114 {
115 "network_desc",
116 OUTPUT_STRING,
117 &ServerInfo.network_desc,
118 "Network description"
119 },
120 {
121 "hub",
122 OUTPUT_BOOLEAN_YN,
123 &ServerInfo.hub,
124 "Server is a hub"
125 },
126 {
127 "use_logging",
128 OUTPUT_BOOLEAN_YN,
129 &ConfigLoggingEntry.use_logging,
130 "Enable logging"
131 },
132 {
133 "fuserlog",
134 OUTPUT_STRING_PTR,
135 &ConfigLoggingEntry.userlog,
136 "User log file"
137 },
138 {
139 "foperlog",
140 OUTPUT_STRING_PTR,
141 &ConfigLoggingEntry.operlog,
142 "Operator log file"
143 },
144 {
145 "fkilllog",
146 OUTPUT_STRING_PTR,
147 &ConfigLoggingEntry.killlog,
148 "Kill log file"
149 },
150 {
151 "fklinelog",
152 OUTPUT_STRING_PTR,
153 &ConfigLoggingEntry.klinelog,
154 "K-Line log file"
155 },
156 {
157 "fglinelog",
158 OUTPUT_STRING_PTR,
159 &ConfigLoggingEntry.glinelog,
160 "G-Line log file"
161 },
162 {
163 "restrict_channels",
164 OUTPUT_BOOLEAN_YN,
165 &ConfigChannel.restrict_channels,
166 "Only reserved channels are allowed"
167 },
168 {
169 "disable_local_channels",
170 OUTPUT_BOOLEAN_YN,
171 &ConfigChannel.disable_local_channels,
172 "Prevent users from joining &channels"
173 },
174 {
175 "use_invex",
176 OUTPUT_BOOLEAN_YN,
177 &ConfigChannel.use_invex,
178 "Enable chanmode +I (invite exceptions)"
179 },
180 {
181 "use_except",
182 OUTPUT_BOOLEAN_YN,
183 &ConfigChannel.use_except,
184 "Enable chanmode +e (ban exceptions)"
185 },
186 {
187 "use_knock",
188 OUTPUT_BOOLEAN_YN,
189 &ConfigChannel.use_knock,
190 "Enable /KNOCK"
191 },
192 {
193 "knock_delay",
194 OUTPUT_DECIMAL,
195 &ConfigChannel.knock_delay,
196 "Delay between a users KNOCK attempts"
197 },
198 {
199 "knock_delay_channel",
200 OUTPUT_DECIMAL,
201 &ConfigChannel.knock_delay_channel,
202 "Delay between KNOCK attempts to a channel"
203 },
204 {
205 "invite_ops_only",
206 OUTPUT_BOOLEAN_YN,
207 &ConfigChannel.invite_ops_only,
208 "Restrict invite to ops only"
209 },
210 {
211 "max_chans_per_user",
212 OUTPUT_DECIMAL,
213 &ConfigChannel.max_chans_per_user,
214 "Maximum number of channels a user can join"
215 },
216 {
217 "quiet_on_ban",
218 OUTPUT_BOOLEAN_YN,
219 &ConfigChannel.quiet_on_ban,
220 "Banned users may not send text to a channel"
221 },
222 {
223 "max_bans",
224 OUTPUT_DECIMAL,
225 &ConfigChannel.max_bans,
226 "Total +b/e/I modes allowed in a channel"
227 },
228 {
229 "default_split_user_count",
230 OUTPUT_DECIMAL,
231 &ConfigChannel.default_split_user_count,
232 "Startup value of SPLITUSERS"
233 },
234 {
235 "default_split_server_count",
236 OUTPUT_DECIMAL,
237 &ConfigChannel.default_split_server_count,
238 "Startup value of SPLITNUM"
239 },
240 {
241 "no_create_on_split",
242 OUTPUT_BOOLEAN_YN,
243 &ConfigChannel.no_create_on_split,
244 "Disallow creation of channels when split"
245 },
246 {
247 "no_join_on_split",
248 OUTPUT_BOOLEAN_YN,
249 &ConfigChannel.no_join_on_split,
250 "Disallow joining channels when split"
251 },
252 {
253 "burst_topicwho",
254 OUTPUT_BOOLEAN_YN,
255 &ConfigChannel.burst_topicwho,
256 "Enable sending of who set topic on topicburst"
257 },
258 {
259 "flatten_links",
260 OUTPUT_BOOLEAN_YN,
261 &ConfigServerHide.flatten_links,
262 "Flatten /links list"
263 },
264 {
265 "links_delay",
266 OUTPUT_DECIMAL,
267 &ConfigServerHide.links_delay,
268 "Links rehash delay"
269 },
270 {
271 "hidden",
272 OUTPUT_BOOLEAN_YN,
273 &ConfigServerHide.hidden,
274 "Hide this server from a flattened /links on remote servers"
275 },
276 {
277 "disable_hidden",
278 OUTPUT_BOOLEAN_YN,
279 &ConfigServerHide.disable_hidden,
280 "Prevent servers from hiding themselves from a flattened /links"
281 },
282 {
283 "hide_servers",
284 OUTPUT_BOOLEAN_YN,
285 &ConfigServerHide.hide_servers,
286 "Hide servernames from users"
287 },
288 {
289 "hidden_name",
290 OUTPUT_STRING,
291 &ConfigServerHide.hidden_name,
292 "Server name users see if hide_servers = yes"
293 },
294 {
295 "hide_server_ips",
296 OUTPUT_BOOLEAN_YN,
297 &ConfigServerHide.hide_server_ips,
298 "Prevent people from seeing server IPs"
299 },
300 {
301 "gline_min_cidr",
302 OUTPUT_DECIMAL,
303 &ConfigFileEntry.gline_min_cidr,
304 "Minimum required length of a CIDR bitmask for IPv4 G-Lines"
305 },
306 {
307 "gline_min_cidr6",
308 OUTPUT_DECIMAL,
309 &ConfigFileEntry.gline_min_cidr6,
310 "Minimum required length of a CIDR bitmask for IPv6 G-Lines"
311 },
312 {
313 "invisible_on_connect",
314 OUTPUT_BOOLEAN_YN,
315 &ConfigFileEntry.invisible_on_connect,
316 "Automatically set mode +i on connecting users"
317 },
318 {
319 "burst_away",
320 OUTPUT_BOOLEAN_YN,
321 &ConfigFileEntry.burst_away,
322 "Send /away string that users have set on the server burst"
323 },
324 {
325 "use_whois_actually",
326 OUTPUT_BOOLEAN_YN,
327 &ConfigFileEntry.use_whois_actually,
328 "Show IP address on /WHOIS when possible"
329 },
330 {
331 "kill_chase_time_limit",
332 OUTPUT_DECIMAL,
333 &ConfigFileEntry.kill_chase_time_limit,
334 "Nick Change Tracker for KILL"
335 },
336 {
337 "hide_spoof_ips",
338 OUTPUT_BOOLEAN_YN,
339 &ConfigFileEntry.hide_spoof_ips,
340 "Hide spoofed IP's"
341 },
342 {
343 "ignore_bogus_ts",
344 OUTPUT_BOOLEAN_YN,
345 &ConfigFileEntry.ignore_bogus_ts,
346 "Ignore bogus timestamps from other servers"
347 },
348 {
349 "disable_auth",
350 OUTPUT_BOOLEAN_YN,
351 &ConfigFileEntry.disable_auth,
352 "Completely disable ident lookups"
353 },
354 {
355 "disable_remote_commands",
356 OUTPUT_BOOLEAN_YN,
357 &ConfigFileEntry.disable_remote,
358 "Prevent users issuing commands on remote servers"
359 },
360 {
361 "tkline_expire_notices",
362 OUTPUT_BOOLEAN_YN,
363 &ConfigFileEntry.tkline_expire_notices,
364 "Show temporary kline/xline expire notices"
365 },
366 {
367 "default_floodcount",
368 OUTPUT_DECIMAL,
369 &ConfigFileEntry.default_floodcount,
370 "Startup value of FLOODCOUNT"
371 },
372 {
373 "failed_oper_notice",
374 OUTPUT_BOOLEAN,
375 &ConfigFileEntry.failed_oper_notice,
376 "Inform opers if someone /oper's with the wrong password"
377 },
378 {
379 "dots_in_ident",
380 OUTPUT_DECIMAL,
381 &ConfigFileEntry.dots_in_ident,
382 "Number of permissable dots in an ident"
383 },
384 {
385 "dot_in_ip6_addr",
386 OUTPUT_BOOLEAN,
387 &ConfigFileEntry.dot_in_ip6_addr,
388 "Suffix a . to ip6 addresses (for linked servers still running hybrid-6)"
389 },
390 {
391 "min_nonwildcard",
392 OUTPUT_DECIMAL,
393 &ConfigFileEntry.min_nonwildcard,
394 "Minimum non-wildcard chars in K/G lines"
395 },
396 {
397 "min_nonwildcard_simple",
398 OUTPUT_DECIMAL,
399 &ConfigFileEntry.min_nonwildcard_simple,
400 "Minimum non-wildcards in gecos bans"
401 },
402 {
403 "max_accept",
404 OUTPUT_DECIMAL,
405 &ConfigFileEntry.max_accept,
406 "Maximum nicknames on accept list"
407 },
408 {
409 "anti_nick_flood",
410 OUTPUT_BOOLEAN,
411 &ConfigFileEntry.anti_nick_flood,
412 "NICK flood protection"
413 },
414 {
415 "max_nick_time",
416 OUTPUT_DECIMAL,
417 &ConfigFileEntry.max_nick_time,
418 "NICK flood protection time interval"
419 },
420 {
421 "max_nick_changes",
422 OUTPUT_DECIMAL,
423 &ConfigFileEntry.max_nick_changes,
424 "NICK change threshhold setting"
425 },
426 {
427 "anti_spam_exit_message_time",
428 OUTPUT_DECIMAL,
429 &ConfigFileEntry.anti_spam_exit_message_time,
430 "Duration a client must be connected for to have an exit message"
431 },
432 {
433 "ts_warn_delta",
434 OUTPUT_DECIMAL,
435 &ConfigFileEntry.ts_warn_delta,
436 "Maximum permitted TS delta before displaying a warning"
437 },
438 {
439 "ts_max_delta",
440 OUTPUT_DECIMAL,
441 &ConfigFileEntry.ts_max_delta,
442 "Maximum permitted TS delta from another server"
443 },
444 {
445 "kline_with_reason",
446 OUTPUT_BOOLEAN_YN,
447 &ConfigFileEntry.kline_with_reason,
448 "Display K-line reason to client on disconnect"
449 },
450 {
451 "kline_reason",
452 OUTPUT_STRING,
453 &ConfigFileEntry.kline_reason,
454 "Reason given to K-lined clients on sign off"
455 },
456 {
457 "warn_no_nline",
458 OUTPUT_BOOLEAN,
459 &ConfigFileEntry.warn_no_nline,
460 "Display warning if connecting server lacks N-line"
461 },
462 {
463 "stats_o_oper_only",
464 OUTPUT_BOOLEAN_YN,
465 &ConfigFileEntry.stats_o_oper_only,
466 "STATS O output is only shown to operators"
467 },
468 {
469 "stats_P_oper_only",
470 OUTPUT_BOOLEAN_YN,
471 &ConfigFileEntry.stats_P_oper_only,
472 "STATS P is only shown to operators"
473 },
474 {
475 "stats_i_oper_only",
476 OUTPUT_BOOLEAN2,
477 &ConfigFileEntry.stats_i_oper_only,
478 "STATS I output is only shown to operators"
479 },
480 {
481 "stats_k_oper_only",
482 OUTPUT_BOOLEAN2,
483 &ConfigFileEntry.stats_k_oper_only,
484 "STATS K output is only shown to operators"
485 },
486 {
487 "caller_id_wait",
488 OUTPUT_DECIMAL,
489 &ConfigFileEntry.caller_id_wait,
490 "Minimum delay between notifying UMODE +g users of messages"
491 },
492 {
493 "opers_bypass_callerid",
494 OUTPUT_BOOLEAN_YN,
495 &ConfigFileEntry.opers_bypass_callerid,
496 "Allows IRC operators to message users who are +g (callerid)"
497 },
498 {
499 "pace_wait_simple",
500 OUTPUT_DECIMAL,
501 &ConfigFileEntry.pace_wait_simple,
502 "Minimum delay between less intensive commands"
503 },
504 {
505 "pace_wait",
506 OUTPUT_DECIMAL,
507 &ConfigFileEntry.pace_wait,
508 "Minimum delay between uses of certain commands"
509 },
510 {
511 "short_motd",
512 OUTPUT_BOOLEAN_YN,
513 &ConfigFileEntry.short_motd,
514 "Do not show MOTD; only tell clients they should read it"
515 },
516 {
517 "ping_cookie",
518 OUTPUT_BOOLEAN,
519 &ConfigFileEntry.ping_cookie,
520 "Require ping cookies to connect"
521 },
522 {
523 "no_oper_flood",
524 OUTPUT_BOOLEAN,
525 &ConfigFileEntry.no_oper_flood,
526 "Reduce flood control for operators"
527 },
528 {
529 "true_no_oper_flood",
530 OUTPUT_BOOLEAN,
531 &ConfigFileEntry.true_no_oper_flood,
532 "Completely disable flood control for operators"
533 },
534 {
535 "oper_pass_resv",
536 OUTPUT_BOOLEAN_YN,
537 &ConfigFileEntry.oper_pass_resv,
538 "Opers can over-ride RESVs"
539 },
540 {
541 "idletime",
542 OUTPUT_DECIMAL,
543 &ConfigFileEntry.idletime,
544 "Number of seconds before a client is considered idle"
545 },
546 {
547 "max_targets",
548 OUTPUT_DECIMAL,
549 &ConfigFileEntry.max_targets,
550 "The maximum number of PRIVMSG/NOTICE targets"
551 },
552 {
553 "client_flood",
554 OUTPUT_DECIMAL,
555 &ConfigFileEntry.client_flood,
556 "Maximum amount of data in a client's queue before they are disconnected"
557 },
558 {
559 "throttle_time",
560 OUTPUT_DECIMAL,
561 &ConfigFileEntry.throttle_time,
562 "Minimum time between client reconnects"
563 },
564 {
565 "glines",
566 OUTPUT_BOOLEAN,
567 &ConfigFileEntry.glines,
568 "G-line (network-wide K-line) support"
569 },
570 {
571 "duration",
572 OUTPUT_DECIMAL,
573 &ConfigFileEntry.gline_time,
574 "Expiry time for G-lines"
575 },
576 /* --[ END OF TABLE ]---------------------------------------------- */
577 {
578 NULL,
579 0,
580 NULL,
581 0
582 }
583 };
584
585 /*
586 ** m_info()
587 ** parv[0] = sender prefix
588 ** parv[1] = servername
589 */
590 static void
591 m_info(struct Client *client_p, struct Client *source_p,
592 int parc, char *parv[])
593 {
594 static time_t last_used = 0;
595
596 if ((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
597 {
598 /* safe enough to give this on a local connect only */
599 sendto_one(source_p, form_str(RPL_LOAD2HI),
600 me.name, source_p->name);
601 return;
602 }
603 else
604 last_used = CurrentTime;
605
606 if (!ConfigFileEntry.disable_remote)
607 {
608 if (hunt_server(client_p,source_p, ":%s INFO :%s",
609 1, parc, parv) != HUNTED_ISME)
610 {
611 return;
612 }
613 }
614
615 #ifdef STATIC_MODULES
616 send_info_text(source_p);
617 #else
618 execute_callback(info_cb, source_p, parc, parv);
619 #endif
620 }
621
622 /*
623 ** mo_info()
624 ** parv[0] = sender prefix
625 ** parv[1] = servername
626 */
627 static void
628 mo_info(struct Client *client_p, struct Client *source_p,
629 int parc, char *parv[])
630 {
631 if (hunt_server(client_p, source_p, ":%s INFO :%s", 1,
632 parc, parv) != HUNTED_ISME)
633 return;
634
635 #ifdef STATIC_MODULES
636 send_info_text(source_p);
637 #else
638 execute_callback(info_cb, source_p, parc, parv);
639 #endif
640 }
641
642 /*
643 ** ms_info()
644 ** parv[0] = sender prefix
645 ** parv[1] = servername
646 */
647 static void
648 ms_info(struct Client *client_p, struct Client *source_p,
649 int parc, char *parv[])
650 {
651 if (!IsClient(source_p))
652 return;
653
654 if (hunt_server(client_p, source_p, ":%s INFO :%s",
655 1, parc, parv) != HUNTED_ISME)
656 return;
657
658 #ifdef STATIC_MODULES
659 send_info_text(source_p);
660 #else
661 execute_callback(info_cb, source_p, parc, parv);
662 #endif
663 }
664
665 /* send_info_text()
666 *
667 * inputs - client pointer to send info text to
668 * output - NONE
669 * side effects - info text is sent to client
670 */
671 static void
672 send_info_text(struct Client *source_p)
673 {
674 const char **text = infotext;
675 char *source, *target;
676
677 if (!MyClient(source_p) && IsCapable(source_p->from, CAP_TS6) &&
678 HasID(source_p))
679 source = me.id, target = source_p->id;
680 else
681 source = me.name, target = source_p->name;
682
683 while (*text)
684 {
685 const char *line = *text++;
686
687 if (*line == '\0')
688 line = " ";
689
690 sendto_one(source_p, form_str(RPL_INFO),
691 source, target, line);
692 }
693
694 if (IsOper(source_p))
695 send_conf_options(source_p);
696
697 send_birthdate_online_time(source_p);
698
699 sendto_one(source_p, form_str(RPL_ENDOFINFO),
700 me.name, source_p->name);
701 }
702
703 /* send_birthdate_online_time()
704 *
705 * inputs - client pointer to send to
706 * output - NONE
707 * side effects - birthdate and online time are sent
708 */
709 static void
710 send_birthdate_online_time(struct Client *source_p)
711 {
712 if (!MyClient(source_p) && IsCapable(source_p->from, CAP_TS6) && HasID(source_p))
713 {
714 sendto_one(source_p, ":%s %d %s :On-line since %s",
715 me.id, RPL_INFO, source_p->id,
716 myctime(me.firsttime));
717 }
718 else
719 {
720 sendto_one(source_p, ":%s %d %s :On-line since %s",
721 me.name, RPL_INFO, source_p->name,
722 myctime(me.firsttime));
723 }
724 }
725
726 /* send_conf_options()
727 *
728 * inputs - client pointer to send to
729 * output - NONE
730 * side effects - send config options to client
731 */
732 static void
733 send_conf_options(struct Client *source_p)
734 {
735 Info *infoptr;
736 const char *from, *to;
737 const struct InfoStruct *iptr = NULL;
738
739 /* Now send them a list of all our configuration options
740 * (mostly from defaults.h and setup.h)
741 */
742 if (!MyClient(source_p) && IsCapable(source_p->from, CAP_TS6) && HasID(source_p))
743 {
744 from = me.id;
745 to = source_p->id;
746 }
747 else
748 {
749 from = me.name;
750 to = source_p->name;
751 }
752
753 for (infoptr = MyInformation; infoptr->name; infoptr++)
754 {
755 if (infoptr->intvalue)
756 {
757 sendto_one(source_p, ":%s %d %s :%-30s %-5d [%-30s]",
758 from, RPL_INFO, to, infoptr->name,
759 infoptr->intvalue, infoptr->desc);
760 }
761 else
762 {
763 sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
764 from, RPL_INFO, to, infoptr->name,
765 infoptr->strvalue, infoptr->desc);
766 }
767 }
768
769 /*
770 * Parse the info_table[] and do the magic.
771 */
772 for (iptr = info_table; iptr->name; ++iptr)
773 {
774 switch (iptr->output_type)
775 {
776 /* For "char *" references */
777 case OUTPUT_STRING:
778 {
779 const char *option = *((char **)iptr->option);
780
781 sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
782 from, RPL_INFO, to,
783 iptr->name, option ? option : "NONE",
784 iptr->desc ? iptr->desc : "<none>");
785 break;
786 }
787
788 /* For "char foo[]" references */
789 case OUTPUT_STRING_PTR:
790 {
791 const char *option = iptr->option;
792
793 sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
794 from, RPL_INFO, to,
795 iptr->name, option ? option : "NONE",
796 iptr->desc ? iptr->desc : "<none>");
797 break;
798 }
799
800 /* Output info_table[i].option as a decimal value. */
801 case OUTPUT_DECIMAL:
802 {
803 const int option = *((int *)iptr->option);
804
805 sendto_one(source_p, ":%s %d %s :%-30s %-5d [%-30s]",
806 from, RPL_INFO, to, iptr->name,
807 option, iptr->desc ? iptr->desc : "<none>");
808 break;
809 }
810
811 /* Output info_table[i].option as "ON" or "OFF" */
812 case OUTPUT_BOOLEAN:
813 {
814 const int option = *((int *)iptr->option);
815
816 sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
817 from, RPL_INFO, to,
818 iptr->name, option ? "ON" : "OFF",
819 iptr->desc ? iptr->desc : "<none>");
820
821 break;
822 }
823
824 /* Output info_table[i].option as "YES" or "NO" */
825 case OUTPUT_BOOLEAN_YN:
826 {
827 int option = *((int *)iptr->option);
828
829 sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
830 from, RPL_INFO, to,
831 iptr->name, option ? "YES" : "NO",
832 iptr->desc ? iptr->desc : "<none>");
833 break;
834 }
835
836 case OUTPUT_BOOLEAN2:
837 {
838 int option = *((int *)iptr->option);
839
840 sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
841 from, RPL_INFO, to,
842 iptr->name, option ? ((option == 1) ? "MASK" : "YES") : "NO",
843 iptr->desc ? iptr->desc : "<none>");
844 break;
845 }
846 }
847 }
848
849 /* Don't send oper_only_umodes...it's a bit mask, we will have to decode it
850 * in order for it to show up properly to opers who issue INFO
851 */
852 #ifndef EFNET
853 /* jdc -- Only send compile information to admins. */
854 if (IsAdmin(source_p))
855 sendto_one(source_p, ":%s %d %s :Running on [%s]",
856 from, RPL_INFO, to, ircd_platform);
857 #endif
858 sendto_one(source_p, form_str(RPL_INFO),
859 from, to, "");
860 }

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision