ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/modules/m_version.c
Revision: 3333
Committed: Wed Apr 16 16:19:02 2014 UTC (12 years, 3 months ago) by michael
Content type: text/x-csrc
File size: 3792 byte(s)
Log Message:
- Removed pointless comments

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_version.c
23     * \brief Includes required functions for processing the VERSION command.
24     * \version $Id$
25     */
26    
27 adx 30 #include "stdinc.h"
28     #include "client.h"
29     #include "ircd.h"
30     #include "numeric.h"
31 michael 1309 #include "conf.h"
32 adx 30 #include "s_serv.h"
33     #include "s_user.h"
34     #include "send.h"
35     #include "parse.h"
36     #include "modules.h"
37    
38 michael 1243
39 adx 30 /* Option string. */
40 michael 2820 static const char serveropts[] =
41     {
42 adx 30 'T',
43     'S',
44     #ifdef TS_CURRENT
45     '0' + TS_CURRENT,
46     #endif
47     /* ONLY do TS */
48     /* ALWAYS do TS_WARNINGS */
49     'o',
50     'w',
51     '\0'
52     };
53    
54 michael 3275 /*! \brief VERSION command handler
55     *
56     * \param source_p Pointer to allocated Client struct from which the message
57     * originally comes from. This can be a local or remote client.
58     * \param parc Integer holding the number of supplied arguments.
59     * \param parv Argument vector where parv[0] .. parv[parc-1] are non-NULL
60     * pointers.
61     * \note Valid arguments for this command are:
62     * - parv[0] = command
63 michael 3300 * - parv[1] = nickname/servername
64 adx 30 */
65 michael 2820 static int
66 michael 3156 m_version(struct Client *source_p, int parc, char *parv[])
67 adx 30 {
68     static time_t last_used = 0;
69    
70 adx 269 if ((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime)
71 adx 30 {
72 michael 3109 sendto_one_numeric(source_p, &me, RPL_LOAD2HI);
73 michael 2820 return 0;
74 adx 30 }
75    
76 michael 1121 last_used = CurrentTime;
77    
78 michael 2196 if (!ConfigServerHide.disable_remote_commands)
79 michael 3156 if (hunt_server(source_p, ":%s VERSION :%s",
80 adx 30 1, parc, parv) != HUNTED_ISME)
81 michael 2820 return 0;
82 adx 30
83 michael 3109 sendto_one_numeric(source_p, &me, RPL_VERSION, ircd_version, serno,
84     me.name, serveropts);
85 adx 30 show_isupport(source_p);
86 michael 2820 return 0;
87 adx 30 }
88    
89 michael 3275 /*! \brief VERSION command handler
90     *
91     * \param source_p Pointer to allocated Client struct from which the message
92     * originally comes from. This can be a local or remote client.
93     * \param parc Integer holding the number of supplied arguments.
94     * \param parv Argument vector where parv[0] .. parv[parc-1] are non-NULL
95     * pointers.
96     * \note Valid arguments for this command are:
97     * - parv[0] = command
98 michael 3300 * - parv[1] = nickname/servername
99 adx 30 */
100 michael 2820 static int
101 michael 3156 ms_version(struct Client *source_p, int parc, char *parv[])
102 adx 30 {
103 michael 3156 if (hunt_server(source_p, ":%s VERSION :%s",
104 michael 1997 1, parc, parv) != HUNTED_ISME)
105 michael 2820 return 0;
106 michael 1997
107 michael 3109 sendto_one_numeric(source_p, &me, RPL_VERSION, ircd_version, serno,
108     me.name, serveropts);
109 michael 1997 show_isupport(source_p);
110 michael 2820 return 0;
111 adx 30 }
112    
113 michael 2820 static struct Message version_msgtab =
114     {
115 michael 1230 "VERSION", 0, 0, 0, MAXPARA, MFLG_SLOW, 0,
116 michael 3203 { m_unregistered, m_version, ms_version, m_ignore, ms_version, m_ignore }
117 michael 1230 };
118    
119     static void
120     module_init(void)
121 adx 30 {
122 michael 1230 mod_add_cmd(&version_msgtab);
123     }
124 adx 30
125 michael 1230 static void
126     module_exit(void)
127     {
128     mod_del_cmd(&version_msgtab);
129     }
130 adx 30
131 michael 2820 struct module module_entry =
132     {
133 michael 1230 .node = { NULL, NULL, NULL },
134     .name = NULL,
135     .version = "$Revision$",
136     .handle = NULL,
137     .modinit = module_init,
138     .modexit = module_exit,
139     .flags = 0
140     };

Properties

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