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 1230 by michael, Thu Sep 22 19:41:19 2011 UTC

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

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 1230 by michael, Thu Sep 22 19:41:19 2011 UTC

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

Diff Legend

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