ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.0.x/modules/m_info.c
Revision: 1155
Committed: Tue Aug 9 20:27:45 2011 UTC (12 years, 7 months ago) by michael
Content type: text/x-csrc
Original Path: ircd-hybrid/modules/m_info.c
File size: 19943 byte(s)
Log Message:
- recreate "trunk"

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

Properties

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