* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
- *
- * $Id: m_squit.c 3161 2007-01-25 07:23:01Z nenolod $
*/
#include "stdinc.h"
#include "client.h"
-#include "common.h" /* FALSE bleah */
#include "match.h"
#include "ircd.h"
#include "numeric.h"
#include "hash.h"
#include "s_newconf.h"
-static int ms_squit(struct Client *, struct Client *, int, const char **);
-static int mo_squit(struct Client *, struct Client *, int, const char **);
+static const char squit_desc[] = "Provides the SQUIT command to cause a server to quit";
+
+static void ms_squit(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void mo_squit(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
struct Message squit_msgtab = {
- "SQUIT", 0, 0, 0, MFLG_SLOW,
+ "SQUIT", 0, 0, 0, 0,
{mg_unreg, mg_not_oper, {ms_squit, 0}, {ms_squit, 0}, mg_ignore, {mo_squit, 2}}
};
mapi_clist_av1 squit_clist[] = { &squit_msgtab, NULL };
-DECLARE_MODULE_AV1(squit, NULL, NULL, squit_clist, NULL, NULL, "$Revision: 3161 $");
+DECLARE_MODULE_AV2(squit, NULL, NULL, squit_clist, NULL, NULL, NULL, NULL, squit_desc);
struct squit_parms
{
/*
* mo_squit - SQUIT message handler
- * parv[0] = sender prefix
* parv[1] = server name
* parv[2] = comment
*/
-static int
-mo_squit(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+static void
+mo_squit(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
struct squit_parms *found_squit;
const char *comment = (parc > 2 && parv[2]) ? parv[2] : client_p->name;
{
sendto_one(source_p, form_str(ERR_NOPRIVS),
me.name, source_p->name, "remote");
- return 0;
+ return;
}
exit_client(client_p, found_squit->target_p, source_p, comment);
- return 0;
+ return;
}
else
{
sendto_one_numeric(source_p, ERR_NOSUCHSERVER, form_str(ERR_NOSUCHSERVER), parv[1]);
}
-
- return 0;
}
/*
* ms_squit - SQUIT message handler
- * parv[0] = sender prefix
* parv[1] = server name
* parv[2] = comment
*/
-static int
-ms_squit(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+static void
+ms_squit(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
struct Client *target_p;
const char *comment = (parc > 2 && parv[2]) ? parv[2] : client_p->name;
else
{
if((target_p = find_server(NULL, parv[1])) == NULL)
- return 0;
+ return;
if(IsMe(target_p))
target_p = client_p;
if(!IsServer(target_p))
- return 0;
+ return;
}
/* Server is closing its link */
":%s WALLOPS :Remote SQUIT %s from %s (%s)",
me.id, target_p->name, source_p->name, comment);
- ilog(L_SERVER, "SQUIT From %s : %s (%s)", parv[0], target_p->name, comment);
+ ilog(L_SERVER, "SQUIT From %s : %s (%s)", source_p->name, target_p->name, comment);
}
exit_client(client_p, target_p, source_p, comment);
- return 0;
}