ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/modules/m_info.c
Revision: 1072
Committed: Wed Feb 17 22:58:23 2010 UTC (15 years, 6 months ago) by michael
Content type: text/x-csrc
Original Path: ircd-hybrid-7.3/modules/m_info.c
File size: 20293 byte(s)
Log Message:
- remove old dot_in_ip6_addr configuration option. this is now obsolete.

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 michael 1011 #include "list.h"
27 adx 30 #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     "max_chans_per_user",
204     OUTPUT_DECIMAL,
205     &ConfigChannel.max_chans_per_user,
206     "Maximum number of channels a user can join"
207     },
208     {
209     "quiet_on_ban",
210     OUTPUT_BOOLEAN_YN,
211     &ConfigChannel.quiet_on_ban,
212     "Banned users may not send text to a channel"
213     },
214     {
215     "max_bans",
216     OUTPUT_DECIMAL,
217     &ConfigChannel.max_bans,
218     "Total +b/e/I modes allowed in a channel"
219     },
220     {
221     "default_split_user_count",
222     OUTPUT_DECIMAL,
223     &ConfigChannel.default_split_user_count,
224     "Startup value of SPLITUSERS"
225     },
226     {
227     "default_split_server_count",
228     OUTPUT_DECIMAL,
229     &ConfigChannel.default_split_server_count,
230     "Startup value of SPLITNUM"
231     },
232     {
233     "no_create_on_split",
234     OUTPUT_BOOLEAN_YN,
235     &ConfigChannel.no_create_on_split,
236     "Disallow creation of channels when split"
237     },
238     {
239     "no_join_on_split",
240     OUTPUT_BOOLEAN_YN,
241     &ConfigChannel.no_join_on_split,
242     "Disallow joining channels when split"
243     },
244     {
245     "burst_topicwho",
246     OUTPUT_BOOLEAN_YN,
247     &ConfigChannel.burst_topicwho,
248     "Enable sending of who set topic on topicburst"
249     },
250     {
251     "flatten_links",
252     OUTPUT_BOOLEAN_YN,
253     &ConfigServerHide.flatten_links,
254     "Flatten /links list"
255     },
256     {
257     "links_delay",
258     OUTPUT_DECIMAL,
259     &ConfigServerHide.links_delay,
260     "Links rehash delay"
261     },
262     {
263     "hidden",
264     OUTPUT_BOOLEAN_YN,
265     &ConfigServerHide.hidden,
266     "Hide this server from a flattened /links on remote servers"
267     },
268     {
269     "disable_hidden",
270     OUTPUT_BOOLEAN_YN,
271     &ConfigServerHide.disable_hidden,
272     "Prevent servers from hiding themselves from a flattened /links"
273     },
274     {
275     "hide_servers",
276     OUTPUT_BOOLEAN_YN,
277     &ConfigServerHide.hide_servers,
278     "Hide servernames from users"
279     },
280     {
281     "hidden_name",
282     OUTPUT_STRING,
283     &ConfigServerHide.hidden_name,
284     "Server name users see if hide_servers = yes"
285     },
286     {
287     "hide_server_ips",
288     OUTPUT_BOOLEAN_YN,
289     &ConfigServerHide.hide_server_ips,
290     "Prevent people from seeing server IPs"
291     },
292     {
293     "gline_min_cidr",
294     OUTPUT_DECIMAL,
295     &ConfigFileEntry.gline_min_cidr,
296     "Minimum required length of a CIDR bitmask for IPv4 G-Lines"
297     },
298     {
299     "gline_min_cidr6",
300     OUTPUT_DECIMAL,
301     &ConfigFileEntry.gline_min_cidr6,
302     "Minimum required length of a CIDR bitmask for IPv6 G-Lines"
303     },
304     {
305     "invisible_on_connect",
306     OUTPUT_BOOLEAN_YN,
307     &ConfigFileEntry.invisible_on_connect,
308     "Automatically set mode +i on connecting users"
309     },
310     {
311     "burst_away",
312     OUTPUT_BOOLEAN_YN,
313     &ConfigFileEntry.burst_away,
314     "Send /away string that users have set on the server burst"
315     },
316     {
317     "use_whois_actually",
318     OUTPUT_BOOLEAN_YN,
319     &ConfigFileEntry.use_whois_actually,
320     "Show IP address on /WHOIS when possible"
321     },
322     {
323     "kill_chase_time_limit",
324     OUTPUT_DECIMAL,
325     &ConfigFileEntry.kill_chase_time_limit,
326     "Nick Change Tracker for KILL"
327     },
328     {
329     "hide_spoof_ips",
330     OUTPUT_BOOLEAN_YN,
331     &ConfigFileEntry.hide_spoof_ips,
332     "Hide spoofed IP's"
333     },
334     {
335     "ignore_bogus_ts",
336     OUTPUT_BOOLEAN_YN,
337     &ConfigFileEntry.ignore_bogus_ts,
338     "Ignore bogus timestamps from other servers"
339     },
340     {
341     "disable_auth",
342     OUTPUT_BOOLEAN_YN,
343     &ConfigFileEntry.disable_auth,
344     "Completely disable ident lookups"
345     },
346     {
347     "disable_remote_commands",
348     OUTPUT_BOOLEAN_YN,
349     &ConfigFileEntry.disable_remote,
350     "Prevent users issuing commands on remote servers"
351     },
352     {
353     "tkline_expire_notices",
354     OUTPUT_BOOLEAN_YN,
355     &ConfigFileEntry.tkline_expire_notices,
356     "Show temporary kline/xline expire notices"
357     },
358     {
359     "default_floodcount",
360     OUTPUT_DECIMAL,
361     &ConfigFileEntry.default_floodcount,
362     "Startup value of FLOODCOUNT"
363     },
364     {
365     "failed_oper_notice",
366     OUTPUT_BOOLEAN,
367     &ConfigFileEntry.failed_oper_notice,
368     "Inform opers if someone /oper's with the wrong password"
369     },
370     {
371     "dots_in_ident",
372     OUTPUT_DECIMAL,
373     &ConfigFileEntry.dots_in_ident,
374     "Number of permissable dots in an ident"
375     },
376     {
377     "min_nonwildcard",
378     OUTPUT_DECIMAL,
379     &ConfigFileEntry.min_nonwildcard,
380     "Minimum non-wildcard chars in K/G lines"
381     },
382     {
383     "min_nonwildcard_simple",
384     OUTPUT_DECIMAL,
385     &ConfigFileEntry.min_nonwildcard_simple,
386     "Minimum non-wildcards in gecos bans"
387     },
388     {
389     "max_accept",
390     OUTPUT_DECIMAL,
391     &ConfigFileEntry.max_accept,
392     "Maximum nicknames on accept list"
393     },
394     {
395     "anti_nick_flood",
396     OUTPUT_BOOLEAN,
397     &ConfigFileEntry.anti_nick_flood,
398     "NICK flood protection"
399     },
400     {
401     "max_nick_time",
402     OUTPUT_DECIMAL,
403     &ConfigFileEntry.max_nick_time,
404     "NICK flood protection time interval"
405     },
406     {
407     "max_nick_changes",
408     OUTPUT_DECIMAL,
409     &ConfigFileEntry.max_nick_changes,
410     "NICK change threshhold setting"
411     },
412     {
413     "anti_spam_exit_message_time",
414     OUTPUT_DECIMAL,
415     &ConfigFileEntry.anti_spam_exit_message_time,
416     "Duration a client must be connected for to have an exit message"
417     },
418     {
419     "ts_warn_delta",
420     OUTPUT_DECIMAL,
421     &ConfigFileEntry.ts_warn_delta,
422     "Maximum permitted TS delta before displaying a warning"
423     },
424     {
425     "ts_max_delta",
426     OUTPUT_DECIMAL,
427     &ConfigFileEntry.ts_max_delta,
428     "Maximum permitted TS delta from another server"
429     },
430     {
431     "kline_with_reason",
432     OUTPUT_BOOLEAN_YN,
433     &ConfigFileEntry.kline_with_reason,
434     "Display K-line reason to client on disconnect"
435     },
436     {
437     "kline_reason",
438     OUTPUT_STRING,
439     &ConfigFileEntry.kline_reason,
440     "Reason given to K-lined clients on sign off"
441     },
442     {
443     "warn_no_nline",
444     OUTPUT_BOOLEAN,
445     &ConfigFileEntry.warn_no_nline,
446     "Display warning if connecting server lacks N-line"
447     },
448     {
449     "stats_o_oper_only",
450     OUTPUT_BOOLEAN_YN,
451     &ConfigFileEntry.stats_o_oper_only,
452     "STATS O output is only shown to operators"
453     },
454     {
455     "stats_P_oper_only",
456     OUTPUT_BOOLEAN_YN,
457     &ConfigFileEntry.stats_P_oper_only,
458     "STATS P is only shown to operators"
459     },
460     {
461     "stats_i_oper_only",
462     OUTPUT_BOOLEAN2,
463     &ConfigFileEntry.stats_i_oper_only,
464     "STATS I output is only shown to operators"
465     },
466     {
467     "stats_k_oper_only",
468     OUTPUT_BOOLEAN2,
469     &ConfigFileEntry.stats_k_oper_only,
470     "STATS K output is only shown to operators"
471     },
472     {
473     "caller_id_wait",
474     OUTPUT_DECIMAL,
475     &ConfigFileEntry.caller_id_wait,
476     "Minimum delay between notifying UMODE +g users of messages"
477     },
478     {
479     "opers_bypass_callerid",
480     OUTPUT_BOOLEAN_YN,
481     &ConfigFileEntry.opers_bypass_callerid,
482     "Allows IRC operators to message users who are +g (callerid)"
483     },
484     {
485     "pace_wait_simple",
486     OUTPUT_DECIMAL,
487     &ConfigFileEntry.pace_wait_simple,
488     "Minimum delay between less intensive commands"
489     },
490     {
491     "pace_wait",
492     OUTPUT_DECIMAL,
493     &ConfigFileEntry.pace_wait,
494     "Minimum delay between uses of certain commands"
495     },
496     {
497     "short_motd",
498     OUTPUT_BOOLEAN_YN,
499     &ConfigFileEntry.short_motd,
500     "Do not show MOTD; only tell clients they should read it"
501     },
502     {
503     "ping_cookie",
504     OUTPUT_BOOLEAN,
505     &ConfigFileEntry.ping_cookie,
506     "Require ping cookies to connect"
507     },
508     {
509     "no_oper_flood",
510     OUTPUT_BOOLEAN,
511     &ConfigFileEntry.no_oper_flood,
512     "Reduce flood control for operators"
513     },
514     {
515     "true_no_oper_flood",
516     OUTPUT_BOOLEAN,
517     &ConfigFileEntry.true_no_oper_flood,
518     "Completely disable flood control for operators"
519     },
520     {
521     "oper_pass_resv",
522     OUTPUT_BOOLEAN_YN,
523     &ConfigFileEntry.oper_pass_resv,
524     "Opers can over-ride RESVs"
525     },
526     {
527     "idletime",
528     OUTPUT_DECIMAL,
529     &ConfigFileEntry.idletime,
530     "Number of seconds before a client is considered idle"
531     },
532     {
533     "max_targets",
534     OUTPUT_DECIMAL,
535     &ConfigFileEntry.max_targets,
536     "The maximum number of PRIVMSG/NOTICE targets"
537     },
538     {
539     "client_flood",
540     OUTPUT_DECIMAL,
541     &ConfigFileEntry.client_flood,
542     "Maximum amount of data in a client's queue before they are disconnected"
543     },
544     {
545     "throttle_time",
546     OUTPUT_DECIMAL,
547     &ConfigFileEntry.throttle_time,
548     "Minimum time between client reconnects"
549     },
550     {
551     "glines",
552     OUTPUT_BOOLEAN,
553     &ConfigFileEntry.glines,
554     "G-line (network-wide K-line) support"
555     },
556     {
557     "duration",
558     OUTPUT_DECIMAL,
559     &ConfigFileEntry.gline_time,
560     "Expiry time for G-lines"
561     },
562     /* --[ END OF TABLE ]---------------------------------------------- */
563     {
564     NULL,
565     0,
566     NULL,
567     0
568     }
569     };
570    
571     /*
572     ** m_info()
573     ** parv[0] = sender prefix
574     ** parv[1] = servername
575     */
576     static void
577     m_info(struct Client *client_p, struct Client *source_p,
578     int parc, char *parv[])
579     {
580     static time_t last_used = 0;
581    
582     if ((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
583     {
584     /* safe enough to give this on a local connect only */
585     sendto_one(source_p, form_str(RPL_LOAD2HI),
586     me.name, source_p->name);
587     return;
588     }
589     else
590     last_used = CurrentTime;
591    
592     if (!ConfigFileEntry.disable_remote)
593     {
594     if (hunt_server(client_p,source_p, ":%s INFO :%s",
595     1, parc, parv) != HUNTED_ISME)
596     {
597     return;
598     }
599     }
600    
601     #ifdef STATIC_MODULES
602     send_info_text(source_p);
603     #else
604     execute_callback(info_cb, source_p, parc, parv);
605     #endif
606     }
607    
608     /*
609     ** mo_info()
610     ** parv[0] = sender prefix
611     ** parv[1] = servername
612     */
613     static void
614     mo_info(struct Client *client_p, struct Client *source_p,
615     int parc, char *parv[])
616     {
617     if (hunt_server(client_p, source_p, ":%s INFO :%s", 1,
618     parc, parv) != HUNTED_ISME)
619     return;
620    
621     #ifdef STATIC_MODULES
622     send_info_text(source_p);
623     #else
624     execute_callback(info_cb, source_p, parc, parv);
625     #endif
626     }
627    
628     /*
629     ** ms_info()
630     ** parv[0] = sender prefix
631     ** parv[1] = servername
632     */
633     static void
634     ms_info(struct Client *client_p, struct Client *source_p,
635     int parc, char *parv[])
636     {
637     if (!IsClient(source_p))
638     return;
639    
640     if (hunt_server(client_p, source_p, ":%s INFO :%s",
641     1, parc, parv) != HUNTED_ISME)
642     return;
643    
644     #ifdef STATIC_MODULES
645     send_info_text(source_p);
646     #else
647     execute_callback(info_cb, source_p, parc, parv);
648     #endif
649     }
650    
651     /* send_info_text()
652     *
653     * inputs - client pointer to send info text to
654     * output - NONE
655     * side effects - info text is sent to client
656     */
657     static void
658     send_info_text(struct Client *source_p)
659     {
660     const char **text = infotext;
661     char *source, *target;
662    
663     if (!MyClient(source_p) && IsCapable(source_p->from, CAP_TS6) &&
664     HasID(source_p))
665     source = me.id, target = source_p->id;
666     else
667     source = me.name, target = source_p->name;
668    
669     while (*text)
670     {
671     const char *line = *text++;
672    
673     if (*line == '\0')
674     line = " ";
675    
676     sendto_one(source_p, form_str(RPL_INFO),
677     source, target, line);
678     }
679    
680     if (IsOper(source_p))
681     send_conf_options(source_p);
682    
683     send_birthdate_online_time(source_p);
684    
685     sendto_one(source_p, form_str(RPL_ENDOFINFO),
686     me.name, source_p->name);
687     }
688    
689     /* send_birthdate_online_time()
690     *
691     * inputs - client pointer to send to
692     * output - NONE
693     * side effects - birthdate and online time are sent
694     */
695     static void
696     send_birthdate_online_time(struct Client *source_p)
697     {
698     if (!MyClient(source_p) && IsCapable(source_p->from, CAP_TS6) && HasID(source_p))
699     {
700     sendto_one(source_p, ":%s %d %s :On-line since %s",
701     me.id, RPL_INFO, source_p->id,
702     myctime(me.firsttime));
703     }
704     else
705     {
706     sendto_one(source_p, ":%s %d %s :On-line since %s",
707     me.name, RPL_INFO, source_p->name,
708     myctime(me.firsttime));
709     }
710     }
711    
712     /* send_conf_options()
713     *
714     * inputs - client pointer to send to
715     * output - NONE
716     * side effects - send config options to client
717     */
718     static void
719     send_conf_options(struct Client *source_p)
720     {
721     Info *infoptr;
722     const char *from, *to;
723     const struct InfoStruct *iptr = NULL;
724    
725     /* Now send them a list of all our configuration options
726 michael 912 * (mostly from defaults.h and config.h)
727 adx 30 */
728     if (!MyClient(source_p) && IsCapable(source_p->from, CAP_TS6) && HasID(source_p))
729     {
730     from = me.id;
731     to = source_p->id;
732     }
733     else
734     {
735     from = me.name;
736     to = source_p->name;
737     }
738    
739     for (infoptr = MyInformation; infoptr->name; infoptr++)
740     {
741     if (infoptr->intvalue)
742     {
743     sendto_one(source_p, ":%s %d %s :%-30s %-5d [%-30s]",
744     from, RPL_INFO, to, infoptr->name,
745     infoptr->intvalue, infoptr->desc);
746     }
747     else
748     {
749     sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
750     from, RPL_INFO, to, infoptr->name,
751     infoptr->strvalue, infoptr->desc);
752     }
753     }
754    
755     /*
756     * Parse the info_table[] and do the magic.
757     */
758     for (iptr = info_table; iptr->name; ++iptr)
759     {
760     switch (iptr->output_type)
761     {
762     /* For "char *" references */
763     case OUTPUT_STRING:
764     {
765     const char *option = *((char **)iptr->option);
766    
767     sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
768     from, RPL_INFO, to,
769     iptr->name, option ? option : "NONE",
770     iptr->desc ? iptr->desc : "<none>");
771     break;
772     }
773    
774     /* For "char foo[]" references */
775     case OUTPUT_STRING_PTR:
776     {
777     const char *option = 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     /* Output info_table[i].option as a decimal value. */
787     case OUTPUT_DECIMAL:
788     {
789     const int option = *((int *)iptr->option);
790    
791     sendto_one(source_p, ":%s %d %s :%-30s %-5d [%-30s]",
792     from, RPL_INFO, to, iptr->name,
793     option, iptr->desc ? iptr->desc : "<none>");
794     break;
795     }
796    
797     /* Output info_table[i].option as "ON" or "OFF" */
798     case OUTPUT_BOOLEAN:
799     {
800     const int option = *((int *)iptr->option);
801    
802     sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
803     from, RPL_INFO, to,
804     iptr->name, option ? "ON" : "OFF",
805     iptr->desc ? iptr->desc : "<none>");
806    
807     break;
808     }
809    
810     /* Output info_table[i].option as "YES" or "NO" */
811     case OUTPUT_BOOLEAN_YN:
812     {
813     int option = *((int *)iptr->option);
814    
815     sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
816     from, RPL_INFO, to,
817     iptr->name, option ? "YES" : "NO",
818     iptr->desc ? iptr->desc : "<none>");
819     break;
820     }
821    
822     case OUTPUT_BOOLEAN2:
823     {
824     int option = *((int *)iptr->option);
825    
826     sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
827     from, RPL_INFO, to,
828     iptr->name, option ? ((option == 1) ? "MASK" : "YES") : "NO",
829     iptr->desc ? iptr->desc : "<none>");
830     break;
831     }
832     }
833     }
834    
835     /* Don't send oper_only_umodes...it's a bit mask, we will have to decode it
836     * in order for it to show up properly to opers who issue INFO
837     */
838     #ifndef EFNET
839     /* jdc -- Only send compile information to admins. */
840     if (IsAdmin(source_p))
841     sendto_one(source_p, ":%s %d %s :Running on [%s]",
842     from, RPL_INFO, to, ircd_platform);
843     #endif
844     sendto_one(source_p, form_str(RPL_INFO),
845     from, to, "");
846     }

Properties

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