#include "modules.h"
#include "sslproc.h"
-static int mo_connect(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static int ms_connect(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static const char connect_desc[] =
+ "Provides the CONNECT command to introduce servers to the network";
+
+static void mo_connect(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void ms_connect(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
struct Message connect_msgtab = {
"CONNECT", 0, 0, 0, 0,
mapi_clist_av1 connect_clist[] = { &connect_msgtab, NULL };
-static const char connect_desc[] =
- "Provides the CONNECT command to introduce servers to the network";
-
DECLARE_MODULE_AV2(connect, NULL, NULL, connect_clist, NULL, NULL, NULL, NULL, connect_desc);
/*
* parv[2] = port number
* parv[3] = remote server
*/
-static int
+static void
mo_connect(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
int port;
{
sendto_one(source_p, form_str(ERR_NOPRIVS),
me.name, source_p->name, "remote");
- return 0;
+ return;
}
if(hunt_server(client_p, source_p, ":%s CONNECT %s %s :%s", 3, parc, parv) != HUNTED_ISME)
- return 0;
+ return;
if((target_p = find_server(source_p, parv[1])))
{
sendto_one_notice(source_p, ":Connect: Server %s already exists from %s.", parv[1],
target_p->from->name);
- return 0;
+ return;
}
/*
if((server_p = find_server_conf(parv[1])) == NULL)
{
sendto_one_notice(source_p, ":Connect: Host %s not listed in ircd.conf", parv[1]);
- return 0;
+ return;
}
- if(ServerConfSSL(server_p) && (!ssl_ok || !get_ssld_count()))
+ if(ServerConfSSL(server_p) && (!ircd_ssl_ok || !get_ssld_count()))
{
sendto_one_notice(source_p,
":Connect: Server %s is set to use SSL/TLS but SSL/TLS is not configured.",
parv[1]);
- return 0;
+ return;
}
/*
else if(port <= 0)
{
sendto_one_notice(source_p, ":Connect: illegal port number");
- return 0;
+ return;
}
/*
* destroyed, so reset it back to the configured settings
*/
server_p->port = tmpport;
-
- return 0;
}
/*
* parv[2] = port number
* parv[3] = remote server
*/
-static int
+static void
ms_connect(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
int port;
struct Client *target_p;
if(hunt_server(client_p, source_p, ":%s CONNECT %s %s :%s", 3, parc, parv) != HUNTED_ISME)
- return 0;
+ return;
if((target_p = find_server(NULL, parv[1])))
{
sendto_one_notice(source_p, ":Connect: Server %s already exists from %s.",
parv[1], target_p->from->name);
- return 0;
+ return;
}
/*
{
sendto_one_notice(source_p, ":Connect: Host %s not listed in ircd.conf",
parv[1]);
- return 0;
+ return;
}
- if(ServerConfSSL(server_p) && (!ssl_ok || !get_ssld_count()))
+ if(ServerConfSSL(server_p) && (!ircd_ssl_ok || !get_ssld_count()))
{
sendto_one_notice(source_p,
":Connect: Server %s is set to use SSL/TLS but SSL/TLS is not configured.",
parv[1]);
- return 0;
+ return;
}
/*
else if(port <= 0)
{
sendto_one_notice(source_p, ":Connect: Illegal port number");
- return 0;
+ return;
}
/*
* destroyed
*/
server_p->port = tmpport;
- return 0;
}