ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/modules/m_version.c
(Generate patch)

Comparing:
ircd-hybrid/modules/m_version.c (file contents), Revision 31 by knight, Sun Oct 2 20:34:05 2005 UTC vs.
ircd-hybrid-8/modules/m_version.c (file contents), Revision 1243 by michael, Fri Sep 30 10:47:53 2011 UTC

# Line 23 | Line 23
23   */
24  
25   #include "stdinc.h"
26 – #include "handlers.h"
26   #include "client.h"
27   #include "ircd.h"
28   #include "numeric.h"
# Line 31 | Line 30
30   #include "s_serv.h"
31   #include "s_user.h"
32   #include "send.h"
34 – #include "msg.h"
33   #include "parse.h"
34   #include "modules.h"
35  
38 – static char *confopts(struct Client *);
39 – static void m_version(struct Client *, struct Client *, int, char *[]);
40 – static void ms_version(struct Client *, struct Client *, int, char *[]);
41 – static void mo_version(struct Client *, struct Client *, int, char *[]);
36  
37   /* Option string. */
38   static const char serveropts[] = {
# Line 55 | Line 49 | static const char serveropts[] = {
49    '\0'
50   };
51  
52 < struct Message version_msgtab = {
53 <  "VERSION", 0, 0, 0, 0, MFLG_SLOW, 0,
54 <  { m_unregistered, m_version, ms_version, m_ignore, mo_version, m_ignore }
55 < };
56 <
57 < #ifndef STATIC_MODULES
58 < void
59 < _modinit(void)
52 > /* confopts()
53 > *
54 > * input  - client pointer
55 > * output - ircd.conf option string
56 > * side effects - none
57 > */
58 > static char *
59 > confopts(struct Client *source_p)
60   {
61 <  mod_add_cmd(&version_msgtab);
62 < }
61 >  static char result[12];
62 >  char *p = result;
63  
64 < void
65 < _moddeinit(void)
66 < {
67 <  mod_del_cmd(&version_msgtab);
68 < }
64 >  if (ConfigChannel.use_except)
65 >    *p++ = 'e';
66 >  if (ConfigFileEntry.glines)
67 >    *p++ = 'G';
68 >  *p++ = 'g';
69  
70 < const char *_version = "$Revision$";
70 >  /* might wanna hide this :P */
71 >  if (ServerInfo.hub &&
72 >      (!ConfigFileEntry.disable_remote || HasUMode(source_p, UMODE_OPER)))
73 >  {
74 >    *p++ = 'H';
75 >  }
76 >
77 >  if (ConfigChannel.use_invex)
78 >    *p++ = 'I';
79 >  if (ConfigChannel.use_knock)
80 >    *p++ = 'K';
81 >  *p++ = 'M';
82 >
83 >  if (ConfigFileEntry.ignore_bogus_ts)
84 >    *p++ = 'T';
85 > #ifdef USE_SYSLOG
86 >  *p++ = 'Y';
87   #endif
88 + #ifdef HAVE_LIBZ
89 +  *p++ = 'Z';
90 + #endif
91 +  *p++ = '6';
92 +
93 +  *p = '\0';
94 +
95 +  return result;
96 + }
97  
98   /*
99   * m_version - VERSION command handler
# Line 87 | Line 106 | m_version(struct Client *client_p, struc
106   {
107    static time_t last_used = 0;
108  
109 <  if ((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
109 >  if ((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime)
110    {
111      /* safe enough to give this on a local connect only */
112      sendto_one(source_p, form_str(RPL_LOAD2HI),
113                 me.name, source_p->name);
114      return;
115    }
116 <  else
117 <    last_used = CurrentTime;
116 >
117 >  last_used = CurrentTime;
118  
119    if (!ConfigFileEntry.disable_remote)
101 –  {
120      if (hunt_server(client_p, source_p, ":%s VERSION :%s",
121                      1, parc, parv) != HUNTED_ISME)
122        return;
105 –  }
123  
124    sendto_one(source_p, form_str(RPL_VERSION),
125               me.name, source_p->name, ircd_version, serno,
# Line 124 | Line 141 | mo_version(struct Client *client_p, stru
141                    1, parc, parv) != HUNTED_ISME)
142      return;
143  
144 <  sendto_one(source_p, form_str(RPL_VERSION), me.name, parv[0], ircd_version,
144 >  sendto_one(source_p, form_str(RPL_VERSION), me.name,
145 >             source_p->name, ircd_version,
146               serno, me.name, confopts(source_p), serveropts);
147  
148    show_isupport(source_p);
# Line 151 | Line 169 | ms_version(struct Client *client_p, stru
169    }
170   }
171  
172 < /* confopts()
173 < *
174 < * input  - client pointer
175 < * output - ircd.conf option string
158 < * side effects - none
159 < */
160 < static char *
161 < confopts(struct Client *source_p)
162 < {
163 <  static char result[12];
164 <  char *p = result;
165 <
166 <  if (ConfigChannel.use_except)
167 <    *p++ = 'e';
168 <  if (ConfigFileEntry.glines)
169 <    *p++ = 'G';
170 <  *p++ = 'g';
171 <
172 <  /* might wanna hide this :P */
173 <  if (ServerInfo.hub &&
174 <      (!ConfigFileEntry.disable_remote || IsOper(source_p)))
175 <  {
176 <    *p++ = 'H';
177 <  }
178 <
179 <  if (ConfigChannel.use_invex)
180 <    *p++ = 'I';
181 <  if (ConfigChannel.use_knock)
182 <    *p++ = 'K';
183 <  *p++ = 'M';
184 <
185 <  if (ConfigFileEntry.ignore_bogus_ts)
186 <    *p++ = 'T';
187 < #ifdef USE_SYSLOG
188 <  *p++ = 'Y';
189 < #endif
190 < #ifdef HAVE_LIBZ
191 <  *p++ = 'Z';
192 < #endif
193 <  *p++ = '6';
172 > static struct Message version_msgtab = {
173 >  "VERSION", 0, 0, 0, MAXPARA, MFLG_SLOW, 0,
174 >  { m_unregistered, m_version, ms_version, m_ignore, mo_version, m_ignore }
175 > };
176  
177 <  *p = '\0';
177 > static void
178 > module_init(void)
179 > {
180 >  mod_add_cmd(&version_msgtab);
181 > }
182  
183 <  return result;
183 > static void
184 > module_exit(void)
185 > {
186 >  mod_del_cmd(&version_msgtab);
187   }
188 +
189 + struct module module_entry = {
190 +  .node    = { NULL, NULL, NULL },
191 +  .name    = NULL,
192 +  .version = "$Revision$",
193 +  .handle  = NULL,
194 +  .modinit = module_init,
195 +  .modexit = module_exit,
196 +  .flags   = 0
197 + };

Comparing:
ircd-hybrid/modules/m_version.c (property svn:keywords), Revision 31 by knight, Sun Oct 2 20:34:05 2005 UTC vs.
ircd-hybrid-8/modules/m_version.c (property svn:keywords), Revision 1243 by michael, Fri Sep 30 10:47:53 2011 UTC

# Line 1 | Line 1
1 < "Id Revision"
1 > Id Revision

Diff Legend

– Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)