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

Comparing:
ircd-hybrid-7.2/modules/m_connect.c (file contents), Revision 971 by michael, Sun Aug 2 23:27:42 2009 UTC vs.
ircd-hybrid-8/modules/m_connect.c (file contents), Revision 1474 by michael, Sun Jul 22 14:44:07 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 "irc_string.h"
29   #include "numeric.h"
30   #include "fdlist.h"
31   #include "s_bsd.h"
32 < #include "s_conf.h"
33 < #include "s_log.h"
32 > #include "conf.h"
33 > #include "log.h"
34   #include "s_serv.h"
35   #include "send.h"
37 – #include "msg.h"
36   #include "parse.h"
37   #include "hash.h"
38   #include "modules.h"
39  
42 – static void mo_connect(struct Client *, struct Client *, int, char *[]);
43 – static void ms_connect(struct Client *, struct Client *, int, char *[]);
44 –
45 – struct Message connect_msgtab = {
46 –  "CONNECT", 0, 0, 2, 0, MFLG_SLOW, 0,
47 –  { m_unregistered, m_not_oper, ms_connect, m_ignore, mo_connect, m_ignore }
48 – };
49 –
50 – #ifndef STATIC_MODULES
51 – void
52 – _modinit(void)
53 – {
54 –  mod_add_cmd(&connect_msgtab);
55 – }
56 –
57 – void
58 – _moddeinit(void)
59 – {
60 –  mod_del_cmd(&connect_msgtab);
61 – }
62 –
63 – const char *_version = "$Revision$";
64 – #endif
40  
41   /*
42   * mo_connect - CONNECT command handler
# Line 93 | Line 68 | mo_connect(struct Client *client_p, stru
68  
69    if (parc > 3)
70    {
71 <    if (!IsOperRemote(source_p))
71 >    if (!HasOFlag(source_p, OPER_FLAG_REMOTE))
72      {
73        sendto_one(source_p, form_str(ERR_NOPRIVS),
74                   me.name, source_p->name, "connect");
# Line 105 | Line 80 | mo_connect(struct Client *client_p, stru
80        return;
81    }
82  
83 <  if ((target_p = find_server(parv[1])))
83 >  if ((target_p = hash_find_server(parv[1])))
84    {
85      sendto_one(source_p,
86                 ":%s NOTICE %s :Connect: Server %s already exists from %s.",
# Line 163 | Line 138 | mo_connect(struct Client *client_p, stru
138    /*
139     * Notify all operators about remote connect requests
140     */
141 <  ilog(L_TRACE, "CONNECT From %s : %s %s",
141 >  ilog(LOG_TYPE_IRCD, "CONNECT From %s : %s %s",
142         source_p->name, parv[1], parv[2] ? parv[2] : "");
143  
144    aconf->port = port;
# Line 173 | Line 148 | mo_connect(struct Client *client_p, stru
148     */
149    if (serv_connect(aconf, source_p))
150    {
151 <    if (!ConfigServerHide.hide_server_ips && IsAdmin(source_p))
151 >    if (!ConfigServerHide.hide_server_ips && HasUMode(source_p, UMODE_ADMIN))
152        sendto_one(source_p, ":%s NOTICE %s :*** Connecting to %s[%s].%d",
153                   me.name, source_p->name, aconf->host,
154                   conf->name, aconf->port);
# Line 218 | Line 193 | ms_connect(struct Client *client_p, stru
193                    ":%s CONNECT %s %s :%s", 3, parc, parv) != HUNTED_ISME)
194      return;
195  
196 <  if (*parv[1] == '\0')
196 >  if (EmptyString(parv[1]))
197    {
198      sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS),
199                 me.name, source_p->name, "CONNECT");
200      return;
201    }
202  
203 <  if ((target_p = find_server(parv[1])))
203 >  if ((target_p = hash_find_server(parv[1])))
204    {
205      sendto_one(source_p,
206                 ":%s NOTICE %s :Connect: Server %s already exists from %s.",
# Line 290 | Line 265 | ms_connect(struct Client *client_p, stru
265     */
266    sendto_wallops_flags(UMODE_WALLOP, &me, "Remote CONNECT %s %d from %s",
267                         parv[1], port, source_p->name);
268 <  sendto_server(NULL, NULL, NOCAPS, NOCAPS,
268 >  sendto_server(NULL, NOCAPS, CAP_TS6,
269                  ":%s WALLOPS :Remote CONNECT %s %d from %s",
270                  me.name, parv[1], port, source_p->name);
271 +  sendto_server(NULL, CAP_TS6, NOCAPS,
272 +                ":%s WALLOPS :Remote CONNECT %s %d from %s",
273 +                me.id, parv[1], port, source_p->name);
274  
275 <  ilog(L_TRACE, "CONNECT From %s : %s %d",
275 >  ilog(LOG_TYPE_IRCD, "CONNECT From %s : %s %d",
276         source_p->name, parv[1], port);
277  
278    aconf->port = port;
# Line 316 | Line 294 | ms_connect(struct Client *client_p, stru
294    aconf->port = tmpport;
295   }
296  
297 + static struct Message connect_msgtab = {
298 +  "CONNECT", 0, 0, 2, MAXPARA, MFLG_SLOW, 0,
299 +  { m_unregistered, m_not_oper, ms_connect, m_ignore, mo_connect, m_ignore }
300 + };
301 +
302 + static void
303 + module_init(void)
304 + {
305 +  mod_add_cmd(&connect_msgtab);
306 + }
307 +
308 + static void
309 + module_exit(void)
310 + {
311 +  mod_del_cmd(&connect_msgtab);
312 + }
313 +
314 + struct module module_entry = {
315 +  .node    = { NULL, NULL, NULL },
316 +  .name    = NULL,
317 +  .version = "$Revision$",
318 +  .handle  = NULL,
319 +  .modinit = module_init,
320 +  .modexit = module_exit,
321 +  .flags   = 0
322 + };

Diff Legend

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