ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/modules/m_info.c
Revision: 32
Committed: Sun Oct 2 20:41:23 2005 UTC (19 years, 10 months ago) by knight
Content type: text/x-csrc
Original Path: ircd-hybrid/modules/m_info.c
File size: 20586 byte(s)
Log Message:
- svn:keywords

File Contents

# User Rev Content
1 adx 30 /*
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 knight 31 * $Id$
23 adx 30 */
24    
25     #include "stdinc.h"
26     #include "tools.h"
27     #include "m_info.h"
28     #include "channel.h"
29     #include "client.h"
30     #include "common.h"
31     #include "irc_string.h"
32     #include "ircd.h"
33     #include "hook.h"
34     #include "numeric.h"
35     #include "s_log.h"
36     #include "s_serv.h"
37     #include "s_user.h"
38     #include "send.h"
39     #include "s_conf.h"
40     #include "handlers.h"
41     #include "msg.h"
42     #include "parse.h"
43     #include "modules.h"
44    
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 knight 31 const char *_version = "$Revision$";
60 adx 30 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
83    
84     /*
85     * jdc -- Structure for our configuration value table
86     */
87     struct InfoStruct
88     {
89     const char *name; /* Displayed variable name */
90     unsigned int output_type; /* See below #defines */
91     void *option; /* Pointer reference to the value */
92     const char *desc; /* ASCII description of the variable */
93     };
94    
95     /* Types for output_type in InfoStruct */
96     #define OUTPUT_STRING 0x0001 /* Output option as %s w/ dereference */
97     #define OUTPUT_STRING_PTR 0x0002 /* Output option as %s w/out deference */
98     #define OUTPUT_DECIMAL 0x0004 /* Output option as decimal (%d) */
99     #define OUTPUT_BOOLEAN 0x0008 /* Output option as "ON" or "OFF" */
100     #define OUTPUT_BOOLEAN_YN 0x0010 /* Output option as "YES" or "NO" */
101     #define OUTPUT_BOOLEAN2 0x0020 /* Output option as "YES/NO/MASKED" */
102    
103     static const struct InfoStruct info_table[] =
104     {
105     /* --[ START OF TABLE ]-------------------------------------------- */
106     {
107     "network_name",
108     OUTPUT_STRING,
109     &ServerInfo.network_name,
110     "Network name"
111     },
112     {
113     "network_desc",
114     OUTPUT_STRING,
115     &ServerInfo.network_desc,
116     "Network description"
117     },
118     {
119     "hub",
120     OUTPUT_BOOLEAN_YN,
121     &ServerInfo.hub,
122     "Server is a hub"
123     },
124     {
125     "use_logging",
126     OUTPUT_BOOLEAN_YN,
127     &ConfigLoggingEntry.use_logging,
128     "Enable logging"
129     },
130     {
131     "fuserlog",
132     OUTPUT_STRING_PTR,
133     &ConfigLoggingEntry.userlog,
134     "User log file"
135     },
136     {
137     "foperlog",
138     OUTPUT_STRING_PTR,
139     &ConfigLoggingEntry.operlog,
140     "Operator log file"
141     },
142     {
143     "fkilllog",
144     OUTPUT_STRING_PTR,
145     &ConfigLoggingEntry.killlog,
146     "Kill log file"
147     },
148     {
149     "fklinelog",
150     OUTPUT_STRING_PTR,
151     &ConfigLoggingEntry.klinelog,
152     "K-Line log file"
153     },
154     {
155     "fglinelog",
156     OUTPUT_STRING_PTR,
157     &ConfigLoggingEntry.glinelog,
158     "G-Line log file"
159     },
160     {
161     "restrict_channels",
162     OUTPUT_BOOLEAN_YN,
163     &ConfigChannel.restrict_channels,
164     "Only reserved channels are allowed"
165     },
166     {
167     "disable_local_channels",
168     OUTPUT_BOOLEAN_YN,
169     &ConfigChannel.disable_local_channels,
170     "Prevent users from joining &channels"
171     },
172     {
173     "use_invex",
174     OUTPUT_BOOLEAN_YN,
175     &ConfigChannel.use_invex,
176     "Enable chanmode +I (invite exceptions)"
177     },
178     {
179     "use_except",
180     OUTPUT_BOOLEAN_YN,
181     &ConfigChannel.use_except,
182     "Enable chanmode +e (ban exceptions)"
183     },
184     {
185     "use_knock",
186     OUTPUT_BOOLEAN_YN,
187     &ConfigChannel.use_knock,
188     "Enable /KNOCK"
189     },
190     {
191     "knock_delay",
192     OUTPUT_DECIMAL,
193     &ConfigChannel.knock_delay,
194     "Delay between a users KNOCK attempts"
195     },
196     {
197     "knock_delay_channel",
198     OUTPUT_DECIMAL,
199     &ConfigChannel.knock_delay_channel,
200     "Delay between KNOCK attempts to a channel"
201     },
202     {
203     "invite_ops_only",
204     OUTPUT_BOOLEAN_YN,
205     &ConfigChannel.invite_ops_only,
206     "Restrict invite to ops only"
207     },
208     {
209     "max_chans_per_user",
210     OUTPUT_DECIMAL,
211     &ConfigChannel.max_chans_per_user,
212     "Maximum number of channels a user can join"
213     },
214     {
215     "quiet_on_ban",
216     OUTPUT_BOOLEAN_YN,
217     &ConfigChannel.quiet_on_ban,
218     "Banned users may not send text to a channel"
219     },
220     {
221     "max_bans",
222     OUTPUT_DECIMAL,
223     &ConfigChannel.max_bans,
224     "Total +b/e/I modes allowed in a channel"
225     },
226     {
227     "default_split_user_count",
228     OUTPUT_DECIMAL,
229     &ConfigChannel.default_split_user_count,
230     "Startup value of SPLITUSERS"
231     },
232     {
233     "default_split_server_count",
234     OUTPUT_DECIMAL,
235     &ConfigChannel.default_split_server_count,
236     "Startup value of SPLITNUM"
237     },
238     {
239     "no_create_on_split",
240     OUTPUT_BOOLEAN_YN,
241     &ConfigChannel.no_create_on_split,
242     "Disallow creation of channels when split"
243     },
244     {
245     "no_join_on_split",
246     OUTPUT_BOOLEAN_YN,
247     &ConfigChannel.no_join_on_split,
248     "Disallow joining channels when split"
249     },
250     {
251     "burst_topicwho",
252     OUTPUT_BOOLEAN_YN,
253     &ConfigChannel.burst_topicwho,
254     "Enable sending of who set topic on topicburst"
255     },
256     {
257     "flatten_links",
258     OUTPUT_BOOLEAN_YN,
259     &ConfigServerHide.flatten_links,
260     "Flatten /links list"
261     },
262     {
263     "links_delay",
264     OUTPUT_DECIMAL,
265     &ConfigServerHide.links_delay,
266     "Links rehash delay"
267     },
268     {
269     "hidden",
270     OUTPUT_BOOLEAN_YN,
271     &ConfigServerHide.hidden,
272     "Hide this server from a flattened /links on remote servers"
273     },
274     {
275     "disable_hidden",
276     OUTPUT_BOOLEAN_YN,
277     &ConfigServerHide.disable_hidden,
278     "Prevent servers from hiding themselves from a flattened /links"
279     },
280     {
281     "hide_servers",
282     OUTPUT_BOOLEAN_YN,
283     &ConfigServerHide.hide_servers,
284     "Hide servernames from users"
285     },
286     {
287     "hidden_name",
288     OUTPUT_STRING,
289     &ConfigServerHide.hidden_name,
290     "Server name users see if hide_servers = yes"
291     },
292     {
293     "hide_server_ips",
294     OUTPUT_BOOLEAN_YN,
295     &ConfigServerHide.hide_server_ips,
296     "Prevent people from seeing server IPs"
297     },
298     {
299     "gline_min_cidr",
300     OUTPUT_DECIMAL,
301     &ConfigFileEntry.gline_min_cidr,
302     "Minimum required length of a CIDR bitmask for IPv4 G-Lines"
303     },
304     {
305     "gline_min_cidr6",
306     OUTPUT_DECIMAL,
307     &ConfigFileEntry.gline_min_cidr6,
308     "Minimum required length of a CIDR bitmask for IPv6 G-Lines"
309     },
310     {
311     "invisible_on_connect",
312     OUTPUT_BOOLEAN_YN,
313     &ConfigFileEntry.invisible_on_connect,
314     "Automatically set mode +i on connecting users"
315     },
316     {
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     {
329     "kill_chase_time_limit",
330     OUTPUT_DECIMAL,
331     &ConfigFileEntry.kill_chase_time_limit,
332     "Nick Change Tracker for KILL"
333     },
334     {
335     "hide_spoof_ips",
336     OUTPUT_BOOLEAN_YN,
337     &ConfigFileEntry.hide_spoof_ips,
338     "Hide spoofed IP's"
339     },
340     {
341     "ignore_bogus_ts",
342     OUTPUT_BOOLEAN_YN,
343     &ConfigFileEntry.ignore_bogus_ts,
344     "Ignore bogus timestamps from other servers"
345     },
346     {
347     "disable_auth",
348     OUTPUT_BOOLEAN_YN,
349     &ConfigFileEntry.disable_auth,
350     "Completely disable ident lookups"
351     },
352     {
353     "disable_remote_commands",
354     OUTPUT_BOOLEAN_YN,
355     &ConfigFileEntry.disable_remote,
356     "Prevent users issuing commands on remote servers"
357     },
358     {
359     "tkline_expire_notices",
360     OUTPUT_BOOLEAN_YN,
361     &ConfigFileEntry.tkline_expire_notices,
362     "Show temporary kline/xline expire notices"
363     },
364     {
365     "default_floodcount",
366     OUTPUT_DECIMAL,
367     &ConfigFileEntry.default_floodcount,
368     "Startup value of FLOODCOUNT"
369     },
370     {
371     "failed_oper_notice",
372     OUTPUT_BOOLEAN,
373     &ConfigFileEntry.failed_oper_notice,
374     "Inform opers if someone /oper's with the wrong password"
375     },
376     {
377     "dots_in_ident",
378     OUTPUT_DECIMAL,
379     &ConfigFileEntry.dots_in_ident,
380     "Number of permissable dots in an ident"
381     },
382     {
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     {
389     "min_nonwildcard",
390     OUTPUT_DECIMAL,
391     &ConfigFileEntry.min_nonwildcard,
392     "Minimum non-wildcard chars in K/G lines"
393     },
394     {
395     "min_nonwildcard_simple",
396     OUTPUT_DECIMAL,
397     &ConfigFileEntry.min_nonwildcard_simple,
398     "Minimum non-wildcards in gecos bans"
399     },
400     {
401     "max_accept",
402     OUTPUT_DECIMAL,
403     &ConfigFileEntry.max_accept,
404     "Maximum nicknames on accept list"
405     },
406     {
407     "anti_nick_flood",
408     OUTPUT_BOOLEAN,
409     &ConfigFileEntry.anti_nick_flood,
410     "NICK flood protection"
411     },
412     {
413     "max_nick_time",
414     OUTPUT_DECIMAL,
415     &ConfigFileEntry.max_nick_time,
416     "NICK flood protection time interval"
417     },
418     {
419     "max_nick_changes",
420     OUTPUT_DECIMAL,
421     &ConfigFileEntry.max_nick_changes,
422     "NICK change threshhold setting"
423     },
424     {
425     "anti_spam_exit_message_time",
426     OUTPUT_DECIMAL,
427     &ConfigFileEntry.anti_spam_exit_message_time,
428     "Duration a client must be connected for to have an exit message"
429     },
430     {
431     "ts_warn_delta",
432     OUTPUT_DECIMAL,
433     &ConfigFileEntry.ts_warn_delta,
434     "Maximum permitted TS delta before displaying a warning"
435     },
436     {
437     "ts_max_delta",
438     OUTPUT_DECIMAL,
439     &ConfigFileEntry.ts_max_delta,
440     "Maximum permitted TS delta from another server"
441     },
442     {
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     {
455     "warn_no_nline",
456     OUTPUT_BOOLEAN,
457     &ConfigFileEntry.warn_no_nline,
458     "Display warning if connecting server lacks N-line"
459     },
460     {
461     "stats_o_oper_only",
462     OUTPUT_BOOLEAN_YN,
463     &ConfigFileEntry.stats_o_oper_only,
464     "STATS O output is only shown to operators"
465     },
466     {
467     "stats_P_oper_only",
468     OUTPUT_BOOLEAN_YN,
469     &ConfigFileEntry.stats_P_oper_only,
470     "STATS P is only shown to operators"
471     },
472     {
473     "stats_i_oper_only",
474     OUTPUT_BOOLEAN2,
475     &ConfigFileEntry.stats_i_oper_only,
476     "STATS I output is only shown to operators"
477     },
478     {
479     "stats_k_oper_only",
480     OUTPUT_BOOLEAN2,
481     &ConfigFileEntry.stats_k_oper_only,
482     "STATS K output is only shown to operators"
483     },
484     {
485     "caller_id_wait",
486     OUTPUT_DECIMAL,
487     &ConfigFileEntry.caller_id_wait,
488     "Minimum delay between notifying UMODE +g users of messages"
489     },
490     {
491     "opers_bypass_callerid",
492     OUTPUT_BOOLEAN_YN,
493     &ConfigFileEntry.opers_bypass_callerid,
494     "Allows IRC operators to message users who are +g (callerid)"
495     },
496     {
497     "pace_wait_simple",
498     OUTPUT_DECIMAL,
499     &ConfigFileEntry.pace_wait_simple,
500     "Minimum delay between less intensive commands"
501     },
502     {
503     "pace_wait",
504     OUTPUT_DECIMAL,
505     &ConfigFileEntry.pace_wait,
506     "Minimum delay between uses of certain commands"
507     },
508     {
509     "short_motd",
510     OUTPUT_BOOLEAN_YN,
511     &ConfigFileEntry.short_motd,
512     "Do not show MOTD; only tell clients they should read it"
513     },
514     {
515     "ping_cookie",
516     OUTPUT_BOOLEAN,
517     &ConfigFileEntry.ping_cookie,
518     "Require ping cookies to connect"
519     },
520     {
521     "no_oper_flood",
522     OUTPUT_BOOLEAN,
523     &ConfigFileEntry.no_oper_flood,
524     "Reduce flood control for operators"
525     },
526     {
527     "true_no_oper_flood",
528     OUTPUT_BOOLEAN,
529     &ConfigFileEntry.true_no_oper_flood,
530     "Completely disable flood control for operators"
531     },
532     {
533     "oper_pass_resv",
534     OUTPUT_BOOLEAN_YN,
535     &ConfigFileEntry.oper_pass_resv,
536     "Opers can over-ride RESVs"
537     },
538     {
539     "idletime",
540     OUTPUT_DECIMAL,
541     &ConfigFileEntry.idletime,
542     "Number of seconds before a client is considered idle"
543     },
544     {
545     "max_targets",
546     OUTPUT_DECIMAL,
547     &ConfigFileEntry.max_targets,
548     "The maximum number of PRIVMSG/NOTICE targets"
549     },
550     {
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     {
557     "throttle_time",
558     OUTPUT_DECIMAL,
559     &ConfigFileEntry.throttle_time,
560     "Minimum time between client reconnects"
561     },
562     {
563     "glines",
564     OUTPUT_BOOLEAN,
565     &ConfigFileEntry.glines,
566     "G-line (network-wide K-line) support"
567     },
568     {
569     "duration",
570     OUTPUT_DECIMAL,
571     &ConfigFileEntry.gline_time,
572     "Expiry time for G-lines"
573     },
574     /* --[ END OF TABLE ]---------------------------------------------- */
575     {
576     NULL,
577     0,
578     NULL,
579     0
580     }
581     };
582    
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    
701     /* send_birthdate_online_time()
702     *
703     * inputs - client pointer to send to
704     * output - NONE
705     * side effects - birthdate and online time are sent
706     */
707     static void
708     send_birthdate_online_time(struct Client *source_p)
709     {
710     if (!MyClient(source_p) && IsCapable(source_p->from, CAP_TS6) && HasID(source_p))
711     {
712     sendto_one(source_p, ":%s %d %s :On-line since %s",
713     me.id, RPL_INFO, source_p->id,
714     myctime(me.firsttime));
715     }
716     else
717     {
718     sendto_one(source_p, ":%s %d %s :On-line since %s",
719     me.name, RPL_INFO, source_p->name,
720     myctime(me.firsttime));
721     }
722     }
723    
724     /* send_conf_options()
725     *
726     * inputs - client pointer to send to
727     * output - NONE
728     * side effects - send config options to client
729     */
730     static void
731     send_conf_options(struct Client *source_p)
732     {
733     Info *infoptr;
734     const char *from, *to;
735     const struct InfoStruct *iptr = NULL;
736    
737     /* Now send them a list of all our configuration options
738     * (mostly from defaults.h and setup.h)
739     */
740     if (!MyClient(source_p) && IsCapable(source_p->from, CAP_TS6) && HasID(source_p))
741     {
742     from = me.id;
743     to = source_p->id;
744     }
745     else
746     {
747     from = me.name;
748     to = source_p->name;
749     }
750    
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    
767     /*
768     * Parse the info_table[] and do the magic.
769     */
770     for (iptr = info_table; iptr->name; ++iptr)
771     {
772     switch (iptr->output_type)
773     {
774     /* For "char *" references */
775     case OUTPUT_STRING:
776     {
777     const char *option = *((char **)iptr->option);
778    
779     sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
780     from, RPL_INFO, to,
781     iptr->name, option ? option : "NONE",
782     iptr->desc ? iptr->desc : "<none>");
783     break;
784     }
785    
786     /* For "char foo[]" references */
787     case OUTPUT_STRING_PTR:
788     {
789     const char *option = iptr->option;
790    
791     sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
792     from, RPL_INFO, to,
793     iptr->name, option ? option : "NONE",
794     iptr->desc ? iptr->desc : "<none>");
795     break;
796     }
797    
798     /* Output info_table[i].option as a decimal value. */
799     case OUTPUT_DECIMAL:
800     {
801     const int option = *((int *)iptr->option);
802    
803     sendto_one(source_p, ":%s %d %s :%-30s %-5d [%-30s]",
804     from, RPL_INFO, to, iptr->name,
805     option, iptr->desc ? iptr->desc : "<none>");
806     break;
807     }
808    
809     /* Output info_table[i].option as "ON" or "OFF" */
810     case OUTPUT_BOOLEAN:
811     {
812     const int option = *((int *)iptr->option);
813    
814     sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
815     from, RPL_INFO, to,
816     iptr->name, option ? "ON" : "OFF",
817     iptr->desc ? iptr->desc : "<none>");
818    
819     break;
820     }
821    
822     /* Output info_table[i].option as "YES" or "NO" */
823     case OUTPUT_BOOLEAN_YN:
824     {
825     int option = *((int *)iptr->option);
826    
827     sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
828     from, RPL_INFO, to,
829     iptr->name, option ? "YES" : "NO",
830     iptr->desc ? iptr->desc : "<none>");
831     break;
832     }
833    
834     case OUTPUT_BOOLEAN2:
835     {
836     int option = *((int *)iptr->option);
837    
838     sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
839     from, RPL_INFO, to,
840     iptr->name, option ? ((option == 1) ? "MASK" : "YES") : "NO",
841     iptr->desc ? iptr->desc : "<none>");
842     break;
843     }
844     }
845     }
846    
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
856     sendto_one(source_p, form_str(RPL_INFO),
857     from, to, "");
858     }

Properties

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