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/trunk/modules/m_version.c (file contents), Revision 1592 by michael, Sat Oct 27 21:02:32 2012 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"
29 < #include "s_conf.h"
29 > #include "conf.h"
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
71 < _moddeinit(void)
72 < {
73 <  mod_del_cmd(&version_msgtab);
74 < }
64 >  *p++ = 'e'; /* excepts */
65  
66 < const char *_version = "$Revision$";
67 < #endif
66 >  if (ConfigFileEntry.glines)
67 >    *p++ = 'G';
68 >  *p++ = 'g';
69 >
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 >  *p++ = 'I'; /* invex */
78 >  *p++ = 'K'; /* knock */
79 >  *p++ = 'M';
80 >
81 >  if (ConfigFileEntry.ignore_bogus_ts)
82 >    *p++ = 'T';
83 >  *p++ = '6';
84 >
85 >  *p = '\0';
86 >
87 >  return result;
88 > }
89  
90   /*
91   * m_version - VERSION command handler
# Line 87 | Line 98 | m_version(struct Client *client_p, struc
98   {
99    static time_t last_used = 0;
100  
101 <  if ((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
101 >  if ((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime)
102    {
103      /* safe enough to give this on a local connect only */
104      sendto_one(source_p, form_str(RPL_LOAD2HI),
105                 me.name, source_p->name);
106      return;
107    }
108 <  else
109 <    last_used = CurrentTime;
108 >
109 >  last_used = CurrentTime;
110  
111    if (!ConfigFileEntry.disable_remote)
101 –  {
112      if (hunt_server(client_p, source_p, ":%s VERSION :%s",
113                      1, parc, parv) != HUNTED_ISME)
114        return;
105 –  }
115  
116    sendto_one(source_p, form_str(RPL_VERSION),
117               me.name, source_p->name, ircd_version, serno,
# Line 124 | Line 133 | mo_version(struct Client *client_p, stru
133                    1, parc, parv) != HUNTED_ISME)
134      return;
135  
136 <  sendto_one(source_p, form_str(RPL_VERSION), me.name, parv[0], ircd_version,
136 >  sendto_one(source_p, form_str(RPL_VERSION), me.name,
137 >             source_p->name, ircd_version,
138               serno, me.name, confopts(source_p), serveropts);
139  
140    show_isupport(source_p);
# Line 151 | Line 161 | ms_version(struct Client *client_p, stru
161    }
162   }
163  
164 < /* confopts()
165 < *
166 < * input  - client pointer
167 < * 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';
164 > static struct Message version_msgtab = {
165 >  "VERSION", 0, 0, 0, MAXPARA, MFLG_SLOW, 0,
166 >  { m_unregistered, m_version, ms_version, m_ignore, mo_version, m_ignore }
167 > };
168  
169 <  *p = '\0';
169 > static void
170 > module_init(void)
171 > {
172 >  mod_add_cmd(&version_msgtab);
173 > }
174  
175 <  return result;
175 > static void
176 > module_exit(void)
177 > {
178 >  mod_del_cmd(&version_msgtab);
179   }
180 +
181 + struct module module_entry = {
182 +  .node    = { NULL, NULL, NULL },
183 +  .name    = NULL,
184 +  .version = "$Revision$",
185 +  .handle  = NULL,
186 +  .modinit = module_init,
187 +  .modexit = module_exit,
188 +  .flags   = 0
189 + };

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/trunk/modules/m_version.c (property svn:keywords), Revision 1592 by michael, Sat Oct 27 21:02:32 2012 UTC

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

Diff Legend

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