ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/modules/m_info.c
Revision: 69
Committed: Tue Oct 4 16:09:51 2005 UTC (20 years, 10 months ago) by adx
Content type: text/x-csrc
File size: 20506 byte(s)
Log Message:
- splitted ircd/libio, all headers connected with libio sources have been
  moved for internal use only. To use libio interface, include "libio.h"
  (which is already done in "stdinc.h")


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

Properties

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