ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/modules/m_info.c
Revision: 3573
Committed: Fri May 16 17:09:50 2014 UTC (12 years, 2 months ago) by michael
Content type: text/x-csrc
File size: 18598 byte(s)
Log Message:
- Replaced remaining sendto_one() with sendto_one_numeric().
  SND_EXPLICIT idea derived from ircu.

File Contents

# User Rev Content
1 adx 30 /*
2 michael 2820 * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3 adx 30 *
4 michael 2820 * Copyright (c) 1997-2014 ircd-hybrid development team
5 adx 30 *
6     * This program is free software; you can redistribute it and/or modify
7     * it under the terms of the GNU General Public License as published by
8     * the Free Software Foundation; either version 2 of the License, or
9     * (at your option) any later version.
10     *
11     * This program is distributed in the hope that it will be useful,
12     * but WITHOUT ANY WARRANTY; without even the implied warranty of
13     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14     * GNU General Public License for more details.
15     *
16     * You should have received a copy of the GNU General Public License
17     * along with this program; if not, write to the Free Software
18     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19     * USA
20     */
21    
22 michael 2820 /*! \file m_info.c
23     * \brief Includes required functions for processing the INFO command.
24     * \version $Id$
25     */
26    
27 adx 30 #include "stdinc.h"
28 michael 1011 #include "list.h"
29 adx 30 #include "client.h"
30     #include "ircd.h"
31     #include "numeric.h"
32 michael 3347 #include "misc.h"
33     #include "server.h"
34 adx 30 #include "send.h"
35 michael 1309 #include "conf.h"
36 adx 30 #include "parse.h"
37     #include "modules.h"
38    
39 michael 1230
40 adx 30 /*
41     * jdc -- Structure for our configuration value table
42     */
43     struct InfoStruct
44     {
45     const char *name; /* Displayed variable name */
46 michael 3343 const unsigned int output_type; /* See below #defines */
47     const void *option; /* Pointer reference to the value */
48 adx 30 const char *desc; /* ASCII description of the variable */
49     };
50    
51     /* Types for output_type in InfoStruct */
52 michael 1827 #define OUTPUT_STRING 0x0001 /* Output option as %s w/ dereference */
53     #define OUTPUT_STRING_PTR 0x0002 /* Output option as %s w/out deference */
54     #define OUTPUT_DECIMAL 0x0004 /* Output option as decimal (%d) */
55     #define OUTPUT_BOOLEAN 0x0008 /* Output option as "ON" or "OFF" */
56     #define OUTPUT_BOOLEAN_YN 0x0010 /* Output option as "YES" or "NO" */
57     #define OUTPUT_BOOLEAN2 0x0020 /* Output option as "YES/NO/MASKED" */
58 adx 30
59     static const struct InfoStruct info_table[] =
60     {
61     /* --[ START OF TABLE ]-------------------------------------------- */
62 michael 1318
63 adx 30 {
64 michael 3236 "DPATH",
65     OUTPUT_STRING,
66     &ConfigFileEntry.dpath,
67     "Root directory of installation"
68     },
69     {
70 michael 3239 "SPATH",
71     OUTPUT_STRING,
72     &ConfigFileEntry.spath,
73     "Path to server executable"
74     },
75     {
76     "MPATH",
77     OUTPUT_STRING,
78     &ConfigFileEntry.mpath,
79     "Path to main motd (Message of the Day) file"
80     },
81     {
82 michael 1318 "CPATH",
83     OUTPUT_STRING,
84     &ConfigFileEntry.configfile,
85 michael 1702 "Path to main configuration file"
86 michael 1318 },
87     {
88     "DLPATH",
89     OUTPUT_STRING,
90     &ConfigFileEntry.dlinefile,
91 michael 1702 "Path to D-line database file"
92 michael 1318 },
93     {
94     "KPATH",
95     OUTPUT_STRING,
96     &ConfigFileEntry.klinefile,
97 michael 1702 "Path to K-line database file"
98 michael 1318 },
99     {
100 michael 1702 "GPATH",
101     OUTPUT_STRING,
102     &ConfigFileEntry.glinefile,
103     "Path to G-line database file"
104     },
105     {
106     "XPATH",
107     OUTPUT_STRING,
108     &ConfigFileEntry.xlinefile,
109     "Path to X-line database file"
110     },
111     {
112     "RESVPATH",
113     OUTPUT_STRING,
114 michael 1841 &ConfigFileEntry.resvfile,
115 michael 1702 "Path to resv database file"
116     },
117     {
118 adx 30 "network_name",
119     OUTPUT_STRING,
120     &ServerInfo.network_name,
121     "Network name"
122     },
123     {
124     "network_desc",
125     OUTPUT_STRING,
126     &ServerInfo.network_desc,
127     "Network description"
128     },
129     {
130     "hub",
131     OUTPUT_BOOLEAN_YN,
132     &ServerInfo.hub,
133     "Server is a hub"
134     },
135     {
136 michael 1754 "max_clients",
137     OUTPUT_DECIMAL,
138     &ServerInfo.max_clients,
139     "Maximum number of clients permitted simultaneously on this server"
140     },
141     {
142     "max_nick_length",
143     OUTPUT_DECIMAL,
144     &ServerInfo.max_nick_length,
145     "Maximum nickname length"
146     },
147     {
148     "max_topic_length",
149     OUTPUT_DECIMAL,
150     &ServerInfo.max_topic_length,
151     "Maximum topic length"
152     },
153     {
154 adx 30 "use_logging",
155     OUTPUT_BOOLEAN_YN,
156     &ConfigLoggingEntry.use_logging,
157     "Enable logging"
158     },
159     {
160 michael 1767 "disable_fake_channels",
161     OUTPUT_BOOLEAN_YN,
162     &ConfigChannel.disable_fake_channels,
163     "Forbids channels with special ASCII characters in their name"
164     },
165     {
166 adx 30 "knock_delay",
167     OUTPUT_DECIMAL,
168     &ConfigChannel.knock_delay,
169     "Delay between a users KNOCK attempts"
170     },
171     {
172     "knock_delay_channel",
173     OUTPUT_DECIMAL,
174     &ConfigChannel.knock_delay_channel,
175     "Delay between KNOCK attempts to a channel"
176     },
177     {
178     "max_chans_per_user",
179     OUTPUT_DECIMAL,
180     &ConfigChannel.max_chans_per_user,
181     "Maximum number of channels a user can join"
182     },
183     {
184 michael 1432 "max_chans_per_oper",
185     OUTPUT_DECIMAL,
186     &ConfigChannel.max_chans_per_oper,
187     "Maximum number of channels an oper can join"
188     },
189     {
190 adx 30 "max_bans",
191     OUTPUT_DECIMAL,
192     &ConfigChannel.max_bans,
193     "Total +b/e/I modes allowed in a channel"
194     },
195     {
196     "default_split_user_count",
197     OUTPUT_DECIMAL,
198     &ConfigChannel.default_split_user_count,
199     "Startup value of SPLITUSERS"
200     },
201     {
202     "default_split_server_count",
203     OUTPUT_DECIMAL,
204     &ConfigChannel.default_split_server_count,
205     "Startup value of SPLITNUM"
206     },
207     {
208     "no_create_on_split",
209     OUTPUT_BOOLEAN_YN,
210     &ConfigChannel.no_create_on_split,
211     "Disallow creation of channels when split"
212     },
213     {
214     "no_join_on_split",
215     OUTPUT_BOOLEAN_YN,
216     &ConfigChannel.no_join_on_split,
217     "Disallow joining channels when split"
218     },
219     {
220     "flatten_links",
221     OUTPUT_BOOLEAN_YN,
222     &ConfigServerHide.flatten_links,
223     "Flatten /links list"
224     },
225     {
226     "links_delay",
227     OUTPUT_DECIMAL,
228     &ConfigServerHide.links_delay,
229     "Links rehash delay"
230     },
231     {
232     "hidden",
233     OUTPUT_BOOLEAN_YN,
234     &ConfigServerHide.hidden,
235     "Hide this server from a flattened /links on remote servers"
236     },
237     {
238     "hide_servers",
239     OUTPUT_BOOLEAN_YN,
240     &ConfigServerHide.hide_servers,
241     "Hide servernames from users"
242     },
243     {
244 michael 1854 "hide_services",
245     OUTPUT_BOOLEAN_YN,
246     &ConfigServerHide.hide_services,
247     "Hides the location of services server"
248     },
249     {
250 adx 30 "hidden_name",
251     OUTPUT_STRING,
252     &ConfigServerHide.hidden_name,
253     "Server name users see if hide_servers = yes"
254     },
255     {
256     "hide_server_ips",
257     OUTPUT_BOOLEAN_YN,
258     &ConfigServerHide.hide_server_ips,
259 michael 1936 "Prevent people from seeing server IP addresses"
260 adx 30 },
261     {
262     "gline_min_cidr",
263     OUTPUT_DECIMAL,
264     &ConfigFileEntry.gline_min_cidr,
265     "Minimum required length of a CIDR bitmask for IPv4 G-Lines"
266     },
267     {
268     "gline_min_cidr6",
269     OUTPUT_DECIMAL,
270     &ConfigFileEntry.gline_min_cidr6,
271     "Minimum required length of a CIDR bitmask for IPv6 G-Lines"
272     },
273     {
274     "invisible_on_connect",
275     OUTPUT_BOOLEAN_YN,
276     &ConfigFileEntry.invisible_on_connect,
277     "Automatically set mode +i on connecting users"
278     },
279     {
280     "kill_chase_time_limit",
281     OUTPUT_DECIMAL,
282     &ConfigFileEntry.kill_chase_time_limit,
283     "Nick Change Tracker for KILL"
284     },
285     {
286     "hide_spoof_ips",
287     OUTPUT_BOOLEAN_YN,
288     &ConfigFileEntry.hide_spoof_ips,
289 michael 1936 "Hide spoofed IP addresses"
290 adx 30 },
291     {
292     "ignore_bogus_ts",
293     OUTPUT_BOOLEAN_YN,
294     &ConfigFileEntry.ignore_bogus_ts,
295     "Ignore bogus timestamps from other servers"
296     },
297     {
298 michael 2283 "cycle_on_host_change",
299     OUTPUT_BOOLEAN_YN,
300     &ConfigFileEntry.cycle_on_host_change,
301     "Send a fake QUIT/JOIN combination on host change"
302     },
303     {
304 adx 30 "disable_auth",
305     OUTPUT_BOOLEAN_YN,
306     &ConfigFileEntry.disable_auth,
307     "Completely disable ident lookups"
308     },
309     {
310     "disable_remote_commands",
311     OUTPUT_BOOLEAN_YN,
312 michael 2196 &ConfigServerHide.disable_remote_commands,
313 adx 30 "Prevent users issuing commands on remote servers"
314     },
315     {
316     "tkline_expire_notices",
317     OUTPUT_BOOLEAN_YN,
318     &ConfigFileEntry.tkline_expire_notices,
319     "Show temporary kline/xline expire notices"
320     },
321     {
322     "default_floodcount",
323     OUTPUT_DECIMAL,
324     &ConfigFileEntry.default_floodcount,
325     "Startup value of FLOODCOUNT"
326     },
327     {
328     "failed_oper_notice",
329 michael 3545 OUTPUT_BOOLEAN_YN,
330 adx 30 &ConfigFileEntry.failed_oper_notice,
331 michael 1702 "Inform opers if someone tries to /oper with the wrong password"
332 adx 30 },
333     {
334     "dots_in_ident",
335     OUTPUT_DECIMAL,
336     &ConfigFileEntry.dots_in_ident,
337     "Number of permissable dots in an ident"
338     },
339     {
340     "min_nonwildcard",
341     OUTPUT_DECIMAL,
342     &ConfigFileEntry.min_nonwildcard,
343     "Minimum non-wildcard chars in K/G lines"
344     },
345     {
346     "min_nonwildcard_simple",
347     OUTPUT_DECIMAL,
348     &ConfigFileEntry.min_nonwildcard_simple,
349     "Minimum non-wildcards in gecos bans"
350     },
351     {
352     "max_accept",
353     OUTPUT_DECIMAL,
354     &ConfigFileEntry.max_accept,
355     "Maximum nicknames on accept list"
356     },
357     {
358     "anti_nick_flood",
359 michael 3545 OUTPUT_BOOLEAN_YN,
360 adx 30 &ConfigFileEntry.anti_nick_flood,
361     "NICK flood protection"
362     },
363     {
364     "max_nick_time",
365     OUTPUT_DECIMAL,
366     &ConfigFileEntry.max_nick_time,
367     "NICK flood protection time interval"
368     },
369     {
370     "max_nick_changes",
371     OUTPUT_DECIMAL,
372     &ConfigFileEntry.max_nick_changes,
373     "NICK change threshhold setting"
374     },
375     {
376     "anti_spam_exit_message_time",
377     OUTPUT_DECIMAL,
378     &ConfigFileEntry.anti_spam_exit_message_time,
379     "Duration a client must be connected for to have an exit message"
380     },
381     {
382     "ts_warn_delta",
383     OUTPUT_DECIMAL,
384     &ConfigFileEntry.ts_warn_delta,
385     "Maximum permitted TS delta before displaying a warning"
386     },
387     {
388     "ts_max_delta",
389     OUTPUT_DECIMAL,
390     &ConfigFileEntry.ts_max_delta,
391     "Maximum permitted TS delta from another server"
392     },
393     {
394 michael 3473 "warn_no_connect_block",
395 michael 3545 OUTPUT_BOOLEAN_YN,
396 michael 3473 &ConfigFileEntry.warn_no_connect_block,
397     "Display warning if connecting server lacks a connect{} block"
398 adx 30 },
399     {
400 michael 1767 "stats_e_disabled",
401     OUTPUT_BOOLEAN_YN,
402     &ConfigFileEntry.stats_e_disabled,
403     "Whether or not STATS e is disabled"
404     },
405     {
406 adx 30 "stats_o_oper_only",
407     OUTPUT_BOOLEAN_YN,
408     &ConfigFileEntry.stats_o_oper_only,
409     "STATS O output is only shown to operators"
410     },
411     {
412     "stats_P_oper_only",
413     OUTPUT_BOOLEAN_YN,
414     &ConfigFileEntry.stats_P_oper_only,
415     "STATS P is only shown to operators"
416     },
417     {
418 michael 2269 "stats_u_oper_only",
419     OUTPUT_BOOLEAN_YN,
420     &ConfigFileEntry.stats_u_oper_only,
421     "STATS u is only shown to operators"
422     },
423     {
424 adx 30 "stats_i_oper_only",
425     OUTPUT_BOOLEAN2,
426     &ConfigFileEntry.stats_i_oper_only,
427     "STATS I output is only shown to operators"
428     },
429     {
430     "stats_k_oper_only",
431     OUTPUT_BOOLEAN2,
432     &ConfigFileEntry.stats_k_oper_only,
433     "STATS K output is only shown to operators"
434     },
435     {
436     "caller_id_wait",
437     OUTPUT_DECIMAL,
438     &ConfigFileEntry.caller_id_wait,
439     "Minimum delay between notifying UMODE +g users of messages"
440     },
441     {
442     "opers_bypass_callerid",
443     OUTPUT_BOOLEAN_YN,
444     &ConfigFileEntry.opers_bypass_callerid,
445     "Allows IRC operators to message users who are +g (callerid)"
446     },
447     {
448     "pace_wait_simple",
449     OUTPUT_DECIMAL,
450     &ConfigFileEntry.pace_wait_simple,
451     "Minimum delay between less intensive commands"
452     },
453     {
454     "pace_wait",
455     OUTPUT_DECIMAL,
456     &ConfigFileEntry.pace_wait,
457     "Minimum delay between uses of certain commands"
458     },
459     {
460     "short_motd",
461     OUTPUT_BOOLEAN_YN,
462     &ConfigFileEntry.short_motd,
463     "Do not show MOTD; only tell clients they should read it"
464     },
465     {
466     "ping_cookie",
467 michael 3545 OUTPUT_BOOLEAN_YN,
468 adx 30 &ConfigFileEntry.ping_cookie,
469     "Require ping cookies to connect"
470     },
471     {
472     "no_oper_flood",
473 michael 3545 OUTPUT_BOOLEAN_YN,
474 adx 30 &ConfigFileEntry.no_oper_flood,
475     "Reduce flood control for operators"
476     },
477     {
478     "true_no_oper_flood",
479 michael 3545 OUTPUT_BOOLEAN_YN,
480 adx 30 &ConfigFileEntry.true_no_oper_flood,
481     "Completely disable flood control for operators"
482     },
483     {
484     "oper_pass_resv",
485     OUTPUT_BOOLEAN_YN,
486     &ConfigFileEntry.oper_pass_resv,
487     "Opers can over-ride RESVs"
488     },
489     {
490     "max_targets",
491     OUTPUT_DECIMAL,
492     &ConfigFileEntry.max_targets,
493     "The maximum number of PRIVMSG/NOTICE targets"
494     },
495     {
496     "throttle_time",
497     OUTPUT_DECIMAL,
498     &ConfigFileEntry.throttle_time,
499     "Minimum time between client reconnects"
500     },
501     {
502 michael 3545 "gline_enable",
503     OUTPUT_BOOLEAN_YN,
504 adx 30 &ConfigFileEntry.glines,
505     "G-line (network-wide K-line) support"
506     },
507     {
508 michael 1459 "gline_duration",
509 adx 30 OUTPUT_DECIMAL,
510     &ConfigFileEntry.gline_time,
511     "Expiry time for G-lines"
512     },
513 michael 1459 {
514     "gline_request_duration",
515     OUTPUT_DECIMAL,
516     &ConfigFileEntry.gline_request_time,
517     "Expiry time for pending G-lines"
518     },
519    
520 adx 30 /* --[ END OF TABLE ]---------------------------------------------- */
521     {
522     NULL,
523     0,
524     NULL,
525     0
526     }
527     };
528    
529     /* send_birthdate_online_time()
530     *
531     * inputs - client pointer to send to
532     * output - NONE
533     * side effects - birthdate and online time are sent
534     */
535     static void
536     send_birthdate_online_time(struct Client *source_p)
537     {
538 michael 3573 sendto_one_numeric(source_p, &me, RPL_INFO|SND_EXPLICIT,
539     ":On-line since %s",
540     myctime(me.localClient->firsttime));
541 adx 30 }
542    
543     /* send_conf_options()
544     *
545     * inputs - client pointer to send to
546     * output - NONE
547     * side effects - send config options to client
548     */
549     static void
550     send_conf_options(struct Client *source_p)
551     {
552     /*
553     * Parse the info_table[] and do the magic.
554     */
555 michael 3459 for (const struct InfoStruct *iptr = info_table; iptr->name; ++iptr)
556 adx 30 {
557     switch (iptr->output_type)
558     {
559     /* For "char *" references */
560     case OUTPUT_STRING:
561     {
562 michael 3343 const char *option = *((const char *const *)iptr->option);
563 adx 30
564 michael 3573 sendto_one_numeric(source_p, &me, RPL_INFO|SND_EXPLICIT,
565     ":%-30s %-5s [%-30s]",
566     iptr->name, option ? option : "NONE",
567     iptr->desc ? iptr->desc : "<none>");
568 adx 30 break;
569     }
570    
571     /* For "char foo[]" references */
572     case OUTPUT_STRING_PTR:
573     {
574     const char *option = iptr->option;
575    
576 michael 3573 sendto_one_numeric(source_p, &me, RPL_INFO|SND_EXPLICIT,
577     ":%-30s %-5s [%-30s]",
578     iptr->name, option ? option : "NONE",
579     iptr->desc ? iptr->desc : "<none>");
580 adx 30 break;
581     }
582    
583     /* Output info_table[i].option as a decimal value. */
584     case OUTPUT_DECIMAL:
585     {
586 michael 3343 const int option = *((const int *const)iptr->option);
587 adx 30
588 michael 3573 sendto_one_numeric(source_p, &me, RPL_INFO|SND_EXPLICIT,
589     ":%-30s %-5d [%-30s]",
590     iptr->name, option, iptr->desc ? iptr->desc : "<none>");
591 adx 30 break;
592     }
593    
594     /* Output info_table[i].option as "ON" or "OFF" */
595     case OUTPUT_BOOLEAN:
596     {
597 michael 3343 const int option = *((const int *const)iptr->option);
598 adx 30
599 michael 3573 sendto_one_numeric(source_p, &me, RPL_INFO|SND_EXPLICIT,
600     ":%-30s %-5s [%-30s]",
601     iptr->name, option ? "ON" : "OFF",
602     iptr->desc ? iptr->desc : "<none>");
603 adx 30
604     break;
605     }
606    
607     /* Output info_table[i].option as "YES" or "NO" */
608     case OUTPUT_BOOLEAN_YN:
609     {
610 michael 3343 const int option = *((const int *const)iptr->option);
611 adx 30
612 michael 3573 sendto_one_numeric(source_p, &me, RPL_INFO|SND_EXPLICIT,
613     ":%-30s %-5s [%-30s]",
614     iptr->name, option ? "YES" : "NO",
615     iptr->desc ? iptr->desc : "<none>");
616 adx 30 break;
617     }
618    
619     case OUTPUT_BOOLEAN2:
620     {
621 michael 3343 const int option = *((const int *const)iptr->option);
622 adx 30
623 michael 3573 sendto_one_numeric(source_p, &me, RPL_INFO|SND_EXPLICIT,
624     ":%-30s %-5s [%-30s]",
625     iptr->name, option ? ((option == 1) ? "MASK" : "YES") : "NO",
626     iptr->desc ? iptr->desc : "<none>");
627 adx 30 break;
628     }
629     }
630     }
631    
632 michael 3109 sendto_one_numeric(source_p, &me, RPL_INFO, "");
633 adx 30 }
634 michael 1230
635 michael 1827 /* send_info_text()
636     *
637     * inputs - client pointer to send info text to
638     * output - NONE
639     * side effects - info text is sent to client
640     */
641 michael 3156 static void
642 michael 1827 send_info_text(struct Client *source_p)
643     {
644     const char **text = infotext;
645    
646     sendto_realops_flags(UMODE_SPY, L_ALL, SEND_NOTICE,
647     "INFO requested by %s (%s@%s) [%s]",
648     source_p->name, source_p->username,
649     source_p->host, source_p->servptr->name);
650    
651     while (*text)
652     {
653     const char *line = *text++;
654    
655     if (*line == '\0')
656     line = " ";
657    
658 michael 3109 sendto_one_numeric(source_p, &me, RPL_INFO, line);
659 michael 1827 }
660    
661     if (HasUMode(source_p, UMODE_OPER))
662     send_conf_options(source_p);
663    
664     send_birthdate_online_time(source_p);
665    
666 michael 3109 sendto_one_numeric(source_p, &me, RPL_ENDOFINFO);
667 michael 1827 }
668    
669 michael 3275 /*! \brief INFO command handler
670     *
671     * \param source_p Pointer to allocated Client struct from which the message
672     * originally comes from. This can be a local or remote client.
673     * \param parc Integer holding the number of supplied arguments.
674     * \param parv Argument vector where parv[0] .. parv[parc-1] are non-NULL
675     * pointers.
676     * \note Valid arguments for this command are:
677     * - parv[0] = command
678 michael 3300 * - parv[1] = nickname/servername
679 michael 3275 */
680 michael 2820 static int
681 michael 3156 m_info(struct Client *source_p, int parc, char *parv[])
682 michael 1827 {
683     static time_t last_used = 0;
684    
685     if ((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
686     {
687 michael 3109 sendto_one_numeric(source_p, &me, RPL_LOAD2HI);
688 michael 2820 return 0;
689 michael 1827 }
690    
691     last_used = CurrentTime;
692    
693 michael 2196 if (!ConfigServerHide.disable_remote_commands)
694 michael 3156 if (hunt_server(source_p, ":%s INFO :%s", 1,
695 michael 1827 parc, parv) != HUNTED_ISME)
696 michael 2820 return 0;
697 michael 1827
698 michael 3156 send_info_text(source_p);
699     return 0;
700 michael 1827 }
701    
702 michael 3275 /*! \brief INFO command handler
703     *
704     * \param source_p Pointer to allocated Client struct from which the message
705     * originally comes from. This can be a local or remote client.
706     * \param parc Integer holding the number of supplied arguments.
707     * \param parv Argument vector where parv[0] .. parv[parc-1] are non-NULL
708     * pointers.
709     * \note Valid arguments for this command are:
710     * - parv[0] = command
711 michael 3300 * - parv[1] = nickname/servername
712 michael 3275 */
713 michael 2820 static int
714 michael 3156 ms_info(struct Client *source_p, int parc, char *parv[])
715 michael 1827 {
716 michael 3156 if (hunt_server(source_p, ":%s INFO :%s", 1,
717 michael 1827 parc, parv) != HUNTED_ISME)
718 michael 2820 return 0;
719 michael 1827
720 michael 3156 send_info_text(source_p);
721     return 0;
722 michael 1827 }
723    
724 michael 2820 static struct Message info_msgtab =
725     {
726 michael 1230 "INFO", 0, 0, 0, MAXPARA, MFLG_SLOW, 0,
727 michael 1827 { m_unregistered, m_info, ms_info, m_ignore, ms_info, m_ignore }
728 michael 1230 };
729    
730     static void
731     module_init(void)
732     {
733     mod_add_cmd(&info_msgtab);
734     }
735    
736     static void
737     module_exit(void)
738     {
739     mod_del_cmd(&info_msgtab);
740     }
741    
742 michael 2820 struct module module_entry =
743     {
744 michael 1230 .node = { NULL, NULL, NULL },
745     .name = NULL,
746     .version = "$Revision$",
747     .handle = NULL,
748     .modinit = module_init,
749     .modexit = module_exit,
750     .flags = 0
751     };

Properties

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