diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-01-15 23:12:35 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-01-15 23:12:35 +0000 |
commit | 6050eda92352c426897d0f4ffefff1e14d82a131 (patch) | |
tree | 805c366d597006c8397a09f60a395fab60547d60 /modules | |
parent | b7561a82c59655512bc85214ae434eb245d5d936 (diff) |
- Clean up all files in modules/ (fixed indentation, removed whitespaces/tabs)
- Fixed copyright years
- Made module handlers int type for later use
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2821 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'modules')
74 files changed, 1903 insertions, 1519 deletions
diff --git a/modules/core/m_die.c b/modules/core/m_die.c index b47c92c..463ccb0 100644 --- a/modules/core/m_die.c +++ b/modules/core/m_die.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_die.c: Kills off this server. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_die.c + * \brief Includes required functions for processing the DIE command. + * \version $Id$ */ #include "stdinc.h" @@ -37,7 +39,7 @@ /* * mo_die - DIE command handler */ -static void +static int mo_die(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -47,31 +49,33 @@ mo_die(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "die"); - return; + return 0; } if (parc < 2 || EmptyString(parv[1])) { sendto_one(source_p, ":%s NOTICE %s :Need server name /die %s", me.name, source_p->name, me.name); - return; + return 0; } if (irccmp(parv[1], me.name)) { sendto_one(source_p, ":%s NOTICE %s :Mismatch on /die %s", me.name, source_p->name, me.name); - return; + return 0; } snprintf(buf, sizeof(buf), "received DIE command from %s", get_oper_name(source_p)); server_die(buf, 0); + return 0; } -static struct Message die_msgtab = { +static struct Message die_msgtab = +{ "DIE", 0, 0, 1, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_not_oper, m_ignore, m_ignore, mo_die, m_ignore} + { m_unregistered, m_not_oper, m_ignore, m_ignore, mo_die, m_ignore } }; static void @@ -86,7 +90,8 @@ module_exit(void) mod_del_cmd(&die_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/core/m_error.c b/modules/core/m_error.c index a4ffffb..5801337 100644 --- a/modules/core/m_error.c +++ b/modules/core/m_error.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_error.c: Handles error messages from the other end. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_error.c + * \brief Includes required functions for processing the ERROR command. + * \version $Id$ */ #include "stdinc.h" @@ -39,8 +41,8 @@ * parv[0] = sender prefix * parv[*] = parameters */ -static void -mr_error(struct Client *client_p, struct Client *source_p, +static int +mr_error(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { const char *para = (parc > 1 && !EmptyString(parv[1])) ? parv[1] : "<>"; @@ -48,7 +50,7 @@ mr_error(struct Client *client_p, struct Client *source_p, assert(source_p == client_p); if (!IsHandshake(source_p) && !IsConnecting(source_p)) - return; + return 0; ilog(LOG_TYPE_IRCD, "Received ERROR message from %s: %s", source_p->name, para); @@ -71,9 +73,11 @@ mr_error(struct Client *client_p, struct Client *source_p, "ERROR :from %s via %s -- %s", source_p->name, get_client_name(client_p, MASK_IP), para); } + + return 0; } -static void +static int ms_error(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -91,10 +95,12 @@ ms_error(struct Client *client_p, struct Client *source_p, "ERROR :from %s via %s -- %s", source_p->name, get_client_name(client_p, MASK_IP), para); + return 0; } -static struct Message error_msgtab = { - "ERROR", 0, 0, 1, MAXPARA, MFLG_SLOW, 0, +static struct Message error_msgtab = +{ + "ERROR", 0, 0, 1, MAXPARA, MFLG_SLOW, 0, { mr_error, m_ignore, ms_error, m_ignore, m_ignore, m_ignore } }; @@ -110,7 +116,8 @@ module_exit(void) mod_del_cmd(&error_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/core/m_join.c b/modules/core/m_join.c index aa8cdc8..e982888 100644 --- a/modules/core/m_join.c +++ b/modules/core/m_join.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_join.c: Joins a channel. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_join.c + * \brief Includes required functions for processing the JOIN command. + * \version $Id$ */ #include "stdinc.h" @@ -88,7 +90,7 @@ last0(struct Client *client_p, struct Client *source_p, char *chanlist) * parv[1] = channel * parv[2] = channel password (key) */ -static void +static int m_join(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -105,7 +107,7 @@ m_join(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "JOIN"); - return; + return 0; } assert(client_p == source_p); @@ -276,6 +278,8 @@ m_join(struct Client *client_p, struct Client *source_p, source_p->localClient->last_join_time = CurrentTime; } + + return 0; } /* ms_join() @@ -286,12 +290,12 @@ m_join(struct Client *client_p, struct Client *source_p, * parv[3] = modes (Deprecated) * output - none * side effects - handles remote JOIN's sent by servers. In TSora - * remote clients are joined using SJOIN, hence a + * remote clients are joined using SJOIN, hence a * JOIN sent by a server on behalf of a client is an error. * here, the initial code is in to take an extra parameter * and use it for the TimeStamp on a new channel. */ -static void +static int ms_join(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -307,18 +311,18 @@ ms_join(struct Client *client_p, struct Client *source_p, if (parc == 2 && !irccmp(parv[1], "0")) { do_join_0(client_p, source_p); - return; + return 0; } if (parc < 4) - return; + return 0; if (!check_channel_name(parv[2], 0)) { sendto_realops_flags(UMODE_DEBUG, L_ALL, SEND_NOTICE, "*** Too long or invalid channel name from %s: %s", client_p->name, parv[2]); - return; + return 0; } mbuf = modebuf; @@ -407,7 +411,7 @@ ms_join(struct Client *client_p, struct Client *source_p, me.name, chptr->chname, chptr->chname, (unsigned long)oldts, (unsigned long)newts); } - + if (*modebuf != '\0') { servername = (ConfigServerHide.hide_servers || IsHidden(source_p)) ? @@ -439,6 +443,7 @@ ms_join(struct Client *client_p, struct Client *source_p, ":%s SJOIN %lu %s + :%s", source_p->servptr->name, (unsigned long)chptr->channelts, chptr->chname, source_p->name); + return 0; } /* do_join_0() diff --git a/modules/core/m_kick.c b/modules/core/m_kick.c index 26dccfa..c4cec5e 100644 --- a/modules/core/m_kick.c +++ b/modules/core/m_kick.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_kick.c: Kicks a user from a channel. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_kick.c + * \brief Includes required functions for processing the KICK command. + * \version $Id$ */ #include "stdinc.h" @@ -44,7 +46,7 @@ * parv[2] = client to kick * parv[3] = kick comment */ -static void +static int m_kick(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -74,7 +76,7 @@ m_kick(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), from, to, "KICK"); - return; + return 0; } if (MyClient(source_p) && !IsFloodDone(source_p)) @@ -88,13 +90,13 @@ m_kick(struct Client *client_p, struct Client *source_p, if ((p = strchr(name,',')) != NULL) *p = '\0'; if (*name == '\0') - return; + return 0; if ((chptr = hash_find_channel(name)) == NULL) { sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), from, to, name); - return; + return 0; } if (!IsServer(source_p) && !HasFlag(source_p, FLAGS_SERVICE)) @@ -105,7 +107,7 @@ m_kick(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOTONCHANNEL), me.name, source_p->name, name); - return; + return 0; } } @@ -117,15 +119,15 @@ m_kick(struct Client *client_p, struct Client *source_p, /* user on _my_ server, with no chanops.. so go away */ sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED), me.name, source_p->name, name); - return; + return 0; } if (chptr->channelts == 0) { - /* If its a TS 0 channel, do it the old way */ + /* If its a TS 0 channel, do it the old way */ sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED), from, to, name); - return; + return 0; } /* Its a user doing a kick, but is not showing as chanop locally @@ -133,12 +135,12 @@ m_kick(struct Client *client_p, struct Client *source_p, * There are two cases we can get to this point then... * * 1) connect burst is happening, and for some reason a legit - * op has sent a KICK, but the SJOIN hasn't happened yet or + * op has sent a KICK, but the SJOIN hasn't happened yet or * been seen. (who knows.. due to lag...) * * 2) The channel is desynced. That can STILL happen with TS - * - * Now, the old code roger wrote, would allow the KICK to + * + * Now, the old code roger wrote, would allow the KICK to * go through. Thats quite legit, but lets weird things like * KICKS by users who appear not to be chanopped happen, * or even neater, they appear not to be on the channel. @@ -156,10 +158,10 @@ m_kick(struct Client *client_p, struct Client *source_p, *p = '\0'; if (*user == '\0') - return; + return 0; if ((who = find_chasing(source_p, user, &chasing)) == NULL) - return; + return 0; if ((ms_target = find_channel_link(who, chptr)) != NULL) { @@ -172,7 +174,7 @@ m_kick(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED), me.name, source_p->name, name); - return; + return 0; } } #endif @@ -204,11 +206,13 @@ m_kick(struct Client *client_p, struct Client *source_p, else sendto_one(source_p, form_str(ERR_USERNOTINCHANNEL), from, to, user, name); + return 0; } -static struct Message kick_msgtab = { +static struct Message kick_msgtab = +{ "KICK", 0, 0, 3, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_kick, m_kick, m_ignore, m_kick, m_ignore} + { m_unregistered, m_kick, m_kick, m_ignore, m_kick, m_ignore } }; static void @@ -223,7 +227,8 @@ module_exit(void) mod_del_cmd(&kick_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/core/m_kill.c b/modules/core/m_kill.c index 49d8dcb..18673d0 100644 --- a/modules/core/m_kill.c +++ b/modules/core/m_kill.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_kill.c: Kills a user. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,14 +17,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_kill.c + * \brief Includes required functions for processing the KILL command. + * \version $Id$ */ #include "stdinc.h" #include "list.h" #include "client.h" -#include "hash.h" /* for find_client() */ +#include "hash.h" #include "ircd.h" #include "numeric.h" #include "log.h" @@ -72,7 +74,7 @@ relay_kill(struct Client *one, struct Client *source_p, * parv[1] = kill victim * parv[2] = kill path */ -static void +static int mo_kill(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -89,7 +91,7 @@ mo_kill(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "KILL"); - return; + return 0; } if (!EmptyString(reason)) @@ -107,13 +109,13 @@ mo_kill(struct Client *client_p, struct Client *source_p, * rewrite the KILL for this new nickname--this keeps * servers in synch when nick change and kill collide */ - if ((target_p = whowas_get_history(user, + if ((target_p = whowas_get_history(user, (time_t)ConfigFileEntry.kill_chase_time_limit)) == NULL) { sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, source_p->name, user); - return; + return 0; } sendto_one(source_p, ":%s NOTICE %s :KILL changed from %s to %s", @@ -124,25 +126,25 @@ mo_kill(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "kill:remote"); - return; + return 0; } if (MyConnect(target_p) && !HasOFlag(source_p, OPER_FLAG_KILL)) { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "kill"); - return; + return 0; } if (IsServer(target_p) || IsMe(target_p)) { sendto_one(source_p, form_str(ERR_CANTKILLSERVER), me.name, source_p->name); - return; + return 0; } if (MyConnect(target_p)) - sendto_one(target_p, ":%s!%s@%s KILL %s :%s", + sendto_one(target_p, ":%s!%s@%s KILL %s :%s", source_p->name, source_p->username, source_p->host, target_p->name, reason); @@ -151,7 +153,7 @@ mo_kill(struct Client *client_p, struct Client *source_p, * that have been around for ever, for no reason.. */ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, - "Received KILL message for %s!%s@%s[%s/%s]. From %s Path: %s (%s)", + "Received KILL message for %s!%s@%s[%s/%s]. From %s Path: %s (%s)", target_p->name, target_p->username, target_p->host, target_p->servptr->name, target_p->servptr->id[0] ? target_p->servptr->id : "<>", @@ -179,6 +181,7 @@ mo_kill(struct Client *client_p, struct Client *source_p, snprintf(buf, sizeof(buf), "Killed (%s (%s))", source_p->name, reason); exit_client(target_p, source_p, buf); + return 0; } /* ms_kill() @@ -186,7 +189,7 @@ mo_kill(struct Client *client_p, struct Client *source_p, * parv[1] = kill victim * parv[2] = kill path and reason */ -static void +static int ms_kill(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -200,7 +203,7 @@ ms_kill(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "KILL"); - return; + return 0; } user = parv[1]; @@ -227,19 +230,19 @@ ms_kill(struct Client *client_p, struct Client *source_p, if ((target_p = find_person(client_p, user)) == NULL) { /* - * If the user has recently changed nick, but only if its + * If the user has recently changed nick, but only if its * not an uid, automatically rewrite the KILL for this new nickname. * --this keeps servers in synch when nick change and kill collide */ if (IsDigit(*user)) /* Somehow an uid was not found in the hash ! */ - return; + return 0; if ((target_p = whowas_get_history(user, (time_t)ConfigFileEntry.kill_chase_time_limit)) == NULL) { sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, source_p->name, user); - return; + return 0; } sendto_one(source_p,":%s NOTICE %s :KILL changed from %s to %s", @@ -250,7 +253,7 @@ ms_kill(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_CANTKILLSERVER), me.name, source_p->name); - return; + return 0; } if (MyConnect(target_p)) @@ -308,12 +311,14 @@ ms_kill(struct Client *client_p, struct Client *source_p, snprintf(buf, sizeof(buf), "Killed (%s %s)", source_p->name, reason); exit_client(target_p, source_p, buf); + return 0; } -static struct Message kill_msgtab = { +static struct Message kill_msgtab = +{ "KILL", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_not_oper, ms_kill, m_ignore, mo_kill, m_ignore} + { m_unregistered, m_not_oper, ms_kill, m_ignore, mo_kill, m_ignore } }; static void @@ -328,7 +333,8 @@ module_exit(void) mod_del_cmd(&kill_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/core/m_message.c b/modules/core/m_message.c index 59a77c8..0fa48db 100644 --- a/modules/core/m_message.c +++ b/modules/core/m_message.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_message.c: Sends a (PRIVMSG|NOTICE) message to a user or channel. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_message.c + * \brief Includes required functions for processing the PRIVMSG/NOTICE command. + * \version $Id$ */ #include "stdinc.h" @@ -140,7 +142,7 @@ find_userhost(char *user, char *host, int *count) * * inputs - flag 0 if PRIVMSG 1 if NOTICE. RFC * say NOTICE must not auto reply - * - pointer to source Client + * - pointer to source Client * - pointer to target Client * output - 1 if target is under flood attack * side effects - check for flood attack on target target_p @@ -201,7 +203,7 @@ flood_attack_client(int p_or_n, struct Client *source_p, * * inputs - flag 0 if PRIVMSG 1 if NOTICE. RFC * says NOTICE must not auto reply - * - pointer to source Client + * - pointer to source Client * - pointer to target channel * output - 1 if target is under flood attack * side effects - check for flood attack on target chptr @@ -308,7 +310,7 @@ msg_channel(int p_or_n, const char *command, struct Client *client_p, /* msg_channel_flags() * - * inputs - flag 0 if PRIVMSG 1 if NOTICE. RFC + * inputs - flag 0 if PRIVMSG 1 if NOTICE. RFC * say NOTICE must not auto reply * - pointer to command, "PRIVMSG" or "NOTICE" * - pointer to client_p @@ -354,7 +356,7 @@ msg_channel_flags(int p_or_n, const char *command, struct Client *client_p, /* msg_client() * - * inputs - flag 0 if PRIVMSG 1 if NOTICE. RFC + * inputs - flag 0 if PRIVMSG 1 if NOTICE. RFC * say NOTICE must not auto reply * - pointer to command, "PRIVMSG" or "NOTICE" * - pointer to source_p source (struct Client *) @@ -442,7 +444,7 @@ msg_client(int p_or_n, const char *command, struct Client *source_p, /* * If the client is remote, we dont perform a special check for * flooding.. as we wouldnt block their message anyway.. this means - * we dont give warnings.. we then check if theyre opered + * we dont give warnings.. we then check if theyre opered * (to avoid flood warnings), lastly if theyre our client * and flooding -- fl */ @@ -582,7 +584,7 @@ handle_special(int p_or_n, const char *command, struct Client *client_p, ++nick; else if (MyClient(source_p) && HasUMode(source_p, UMODE_OPER)) { - sendto_one(source_p, + sendto_one(source_p, ":%s NOTICE %s :The command %s %s is no longer supported, please use $%s", me.name, source_p->name, command, nick, nick); return; @@ -606,7 +608,7 @@ handle_special(int p_or_n, const char *command, struct Client *client_p, ID_or_name(source_p, client_p), nick); return; } - + sendto_match_butone(IsServer(client_p) ? client_p : NULL, source_p, nick + 1, (*nick == '#') ? MATCH_HOST : MATCH_SERVER, "%s $%s :%s", command, nick, text); @@ -706,7 +708,7 @@ build_target_list(int p_or_n, const char *command, struct Client *client_p, continue; } - + /* @#channel or +#channel message ? */ type = 0; with_prefix = nick; @@ -763,7 +765,7 @@ build_target_list(int p_or_n, const char *command, struct Client *client_p, ID_or_name(&me, client_p), ID_or_name(source_p, client_p), nick, ConfigFileEntry.max_targets); - return 1; + return 1; } targets[ntargets].ptr = chptr; @@ -858,7 +860,7 @@ m_message(int p_or_n, const char *command, struct Client *client_p, } } -static void +static int m_privmsg(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -867,28 +869,30 @@ m_privmsg(struct Client *client_p, struct Client *source_p, * for a notice.. (for example remote kline replies) --fl_ */ if (!IsClient(source_p)) - return; + return 0; m_message(PRIVMSG, "PRIVMSG", client_p, source_p, parc, parv); + return 0; } -static void +static int m_notice(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { m_message(NOTICE, "NOTICE", client_p, source_p, parc, parv); + return 0; } static struct Message privmsg_msgtab = { "PRIVMSG", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_privmsg, m_privmsg, m_ignore, m_privmsg, m_ignore} + { m_unregistered, m_privmsg, m_privmsg, m_ignore, m_privmsg, m_ignore } }; static struct Message notice_msgtab = { "NOTICE", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_notice, m_notice, m_ignore, m_notice, m_ignore} + { m_unregistered, m_notice, m_notice, m_ignore, m_notice, m_ignore } }; static void diff --git a/modules/core/m_mode.c b/modules/core/m_mode.c index 304925a..dc4f001 100644 --- a/modules/core/m_mode.c +++ b/modules/core/m_mode.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_mode.c: Sets a user or channel mode. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_mode.c + * \brief Includes required functions for processing the MODE/TMODE/BMASK command. + * \version $Id$ */ #include "stdinc.h" @@ -45,7 +47,7 @@ * parv[0] - sender * parv[1] - channel */ -static void +static int m_mode(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -58,7 +60,7 @@ m_mode(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "MODE"); - return; + return 0; } /* Now, try to find the channel in question */ @@ -66,16 +68,16 @@ m_mode(struct Client *client_p, struct Client *source_p, { /* if here, it has to be a non-channel name */ set_user_mode(client_p, source_p, parc, parv); - return; + return 0; } if ((chptr = hash_find_channel(parv[1])) == NULL) { sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), - ID_or_name(&me, source_p->from), - ID_or_name(source_p, source_p->from), - parv[1]); - return; + ID_or_name(&me, source_p->from), + ID_or_name(source_p, source_p->from), + parv[1]); + return 0; } /* Now known the channel exists */ @@ -86,7 +88,7 @@ m_mode(struct Client *client_p, struct Client *source_p, me.name, source_p->name, chptr->chname, modebuf, parabuf); sendto_one(source_p, form_str(RPL_CREATIONTIME), me.name, source_p->name, chptr->chname, chptr->channelts); - return; + return 0; } /* @@ -112,6 +114,8 @@ m_mode(struct Client *client_p, struct Client *source_p, chptr->chname); } } + + return 0; } /* @@ -122,7 +126,7 @@ m_mode(struct Client *client_p, struct Client *source_p, * parv[2] = channel name * parv[3] = modestring */ -static void +static int ms_tmode(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { struct Channel *chptr = NULL; @@ -132,11 +136,11 @@ ms_tmode(struct Client *client_p, struct Client *source_p, int parc, char *parv[ { sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), ID_or_name(&me, client_p), ID_or_name(source_p, client_p), parv[2]); - return; + return 0; } if (atol(parv[1]) > chptr->channelts) - return; + return 0; if (IsServer(source_p) || HasFlag(source_p, FLAGS_SERVICE)) set_channel_mode(client_p, source_p, chptr, NULL, parc - 3, parv + 3, chptr->chname); @@ -146,10 +150,12 @@ ms_tmode(struct Client *client_p, struct Client *source_p, int parc, char *parv[ /* XXX are we sure we just want to bail here? */ if (has_member_flags(member, CHFL_DEOPPED)) - return; + return 0; set_channel_mode(client_p, source_p, chptr, member, parc - 3, parv + 3, chptr->chname); } + + return 0; } /* @@ -165,12 +171,12 @@ ms_tmode(struct Client *client_p, struct Client *source_p, int parc, char *parv[ * sends plain modes to the others. nothing is sent * to the server the issuing server is connected through */ -static void +static int ms_bmask(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { - static char modebuf[IRCD_BUFSIZE]; - static char parabuf[IRCD_BUFSIZE]; - static char banbuf[IRCD_BUFSIZE]; + char modebuf[IRCD_BUFSIZE]; + char parabuf[IRCD_BUFSIZE]; + char banbuf[IRCD_BUFSIZE]; struct Channel *chptr; char *s, *t, *mbuf, *pbuf; long mode_type; @@ -179,11 +185,11 @@ ms_bmask(struct Client *client_p, struct Client *source_p, int parc, char *parv[ int needcap = NOCAPS; if ((chptr = hash_find_channel(parv[2])) == NULL) - return; + return 0; /* TS is higher, drop it. */ if (atol(parv[1]) > chptr->channelts) - return; + return 0; switch (*parv[3]) { @@ -203,7 +209,7 @@ ms_bmask(struct Client *client_p, struct Client *source_p, int parc, char *parv[ /* maybe we should just blindly propagate this? */ default: - return; + return 0; } parabuf[0] = '\0'; @@ -217,12 +223,13 @@ ms_bmask(struct Client *client_p, struct Client *source_p, int parc, char *parv[ mbuf = modebuf + mlen; pbuf = parabuf; - do { - if ((t = strchr(s, ' ')) != NULL) + do + { + if ((t = strchr(s, ' '))) *t++ = '\0'; tlen = strlen(s); - /* I dont even want to begin parsing this.. */ + /* I don't even want to begin parsing this.. */ if (tlen > MODEBUFLEN) break; @@ -262,25 +269,28 @@ ms_bmask(struct Client *client_p, struct Client *source_p, int parc, char *parv[ } /* assumption here is that since the server sent BMASK, they are TS6, so they have an ID */ - sendto_server(client_p, CAP_TS6|needcap, NOCAPS, - ":%s BMASK %lu %s %s :%s", + sendto_server(client_p, CAP_TS6|needcap, NOCAPS, ":%s BMASK %lu %s %s :%s", source_p->id, (unsigned long)chptr->channelts, chptr->chname, parv[3], parv[4]); + return 0; } -static struct Message mode_msgtab = { +static struct Message mode_msgtab = +{ "MODE", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_mode, m_mode, m_ignore, m_mode, m_ignore} + { m_unregistered, m_mode, m_mode, m_ignore, m_mode, m_ignore } }; -static struct Message tmode_msgtab = { +static struct Message tmode_msgtab = +{ "TMODE", 0, 0, 4, MAXPARA, MFLG_SLOW, 0, - {m_ignore, m_ignore, ms_tmode, m_ignore, m_ignore, m_ignore} + { m_ignore, m_ignore, ms_tmode, m_ignore, m_ignore, m_ignore } }; -static struct Message bmask_msgtab = { +static struct Message bmask_msgtab = +{ "BMASK", 0, 0, 5, MAXPARA, MFLG_SLOW, 0, - {m_ignore, m_ignore, ms_bmask, m_ignore, m_ignore, m_ignore} + { m_ignore, m_ignore, ms_bmask, m_ignore, m_ignore, m_ignore } }; static void @@ -299,7 +309,8 @@ module_exit(void) mod_del_cmd(&bmask_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/core/m_nick.c b/modules/core/m_nick.c index fd09626..0b25d53 100644 --- a/modules/core/m_nick.c +++ b/modules/core/m_nick.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_nick.c: Sets a users nick. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_nick.c + * \brief Includes required functions for processing the NICK command. + * \version $Id$ */ #include "stdinc.h" @@ -181,7 +183,7 @@ set_initial_nick(struct Client *source_p, const char *nick) * inputs - pointer to server * - pointer to client * - nick - * output - + * output - * side effects - changes nick of a LOCAL user */ static void @@ -392,12 +394,12 @@ uid_from_server(struct Client *client_p, struct Client *source_p, int parc, } static void -perform_nick_collides(struct Client *source_p, struct Client *client_p, - struct Client *target_p, int parc, char *parv[], +perform_nick_collides(struct Client *source_p, struct Client *client_p, + struct Client *target_p, int parc, char *parv[], time_t newts, const char *svsid, char *nick, char *gecos, char *uid) { int sameuser = 0; - + /* Server introducing new nick */ if (IsServer(source_p)) { @@ -408,7 +410,7 @@ perform_nick_collides(struct Client *source_p, struct Client *client_p, "Nick collision on %s(%s <- %s)(both killed)", target_p->name, target_p->from->name, client_p->name); - + /* if we have a UID, issue a kill for it */ if (uid) sendto_one(client_p, ":%s KILL %s :%s (Nick collision (new))", @@ -429,7 +431,7 @@ perform_nick_collides(struct Client *source_p, struct Client *client_p, { sameuser = !irccmp(target_p->username, parv[5]) && !irccmp(target_p->host, parv[6]); - + /* * If the users are the same (loaded a client on a different server) * and the new users ts is older, or the users are different and the @@ -485,7 +487,7 @@ perform_nick_collides(struct Client *source_p, struct Client *client_p, "Nick change collision from %s to %s(%s <- %s)(both killed)", source_p->name, target_p->name, target_p->from->name, client_p->name); - + sendto_one(target_p, form_str(ERR_NICKCOLLISION), me.name, target_p->name, target_p->name); @@ -580,7 +582,7 @@ perform_nick_collides(struct Client *source_p, struct Client *client_p, * - parv[0] = sender prefix * - parv[1] = nickname */ -static void +static int mr_nick(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -592,7 +594,7 @@ mr_nick(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), me.name, source_p->name[0] ? source_p->name : "*"); - return; + return 0; } /* Copy the nick and terminate it */ @@ -604,7 +606,7 @@ mr_nick(struct Client *client_p, struct Client *source_p, sendto_one(source_p, form_str(ERR_ERRONEUSNICKNAME), me.name, source_p->name[0] ? source_p->name : "*", parv[1], "Erroneous Nickname"); - return; + return 0; } /* Check if the nick is resv'd */ @@ -616,7 +618,7 @@ mr_nick(struct Client *client_p, struct Client *source_p, sendto_realops_flags(UMODE_REJ, L_ALL, SEND_NOTICE, "Forbidding reserved nick %s from user %s", nick, get_client_name(client_p, HIDE_IP)); - return; + return 0; } if ((target_p = hash_find_client(nick)) == NULL) @@ -625,6 +627,7 @@ mr_nick(struct Client *client_p, struct Client *source_p, strlcpy(source_p->name, nick, sizeof(source_p->name)); else sendto_one(source_p, form_str(ERR_NICKNAMEINUSE), me.name, "*", nick); + return 0; } /*! \brief NICK command handler (called by already registered, @@ -641,7 +644,7 @@ mr_nick(struct Client *client_p, struct Client *source_p, * - parv[0] = sender prefix * - parv[1] = nickname */ -static void +static int m_nick(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -655,7 +658,7 @@ m_nick(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), me.name, source_p->name); - return; + return 0; } /* mark end of grace period, to prevent nickflooding */ @@ -670,7 +673,7 @@ m_nick(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_ERRONEUSNICKNAME), me.name, source_p->name, nick, "Erroneous Nickname"); - return; + return 0; } if (!IsExemptResv(source_p) && @@ -683,7 +686,7 @@ m_nick(struct Client *client_p, struct Client *source_p, sendto_realops_flags(UMODE_REJ, L_ALL, SEND_NOTICE, "Forbidding reserved nick %s from user %s", nick, get_client_name(client_p, HIDE_IP)); - return; + return 0; } if ((target_p = hash_find_client(nick)) == NULL) @@ -711,6 +714,7 @@ m_nick(struct Client *client_p, struct Client *source_p, else sendto_one(source_p, form_str(ERR_NICKNAMEINUSE), me.name, source_p->name, nick); + return 0; } /*! \brief NICK command handler (called by servers and remotely @@ -753,7 +757,7 @@ m_nick(struct Client *client_p, struct Client *source_p, * - parv[8] = services id (timestamp) * - parv[9] = ircname */ -static void +static int ms_nick(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -762,7 +766,7 @@ ms_nick(struct Client *client_p, struct Client *source_p, const char *svsid = "0"; if (parc < 3 || EmptyString(parv[parc - 1])) - return; + return 0; if (parc >= 9) { @@ -775,13 +779,13 @@ ms_nick(struct Client *client_p, struct Client *source_p, parv[7], source_p->name, parv[1]); sendto_one(client_p, ":%s KILL %s :%s (Server doesn't exist!)", me.name, parv[1], me.name); - return; + return 0; } if (check_clean_nick(client_p, source_p, parv[1], server_p) || check_clean_user(client_p, parv[1], parv[5], server_p) || check_clean_host(client_p, parv[1], parv[6], server_p)) - return; + return 0; if (IsServer(source_p)) newts = atol(parv[3]); @@ -792,11 +796,11 @@ ms_nick(struct Client *client_p, struct Client *source_p, { if (IsServer(source_p)) /* Servers can't change nicks.. */ - return; + return 0; if (check_clean_nick(client_p, source_p, parv[1], source_p->servptr)) - return; + return 0; newts = atol(parv[2]); } @@ -818,6 +822,7 @@ ms_nick(struct Client *client_p, struct Client *source_p, else perform_nick_collides(source_p, client_p, target_p, parc, parv, newts, svsid, parv[1], parv[parc-1], NULL); + return 0; } /*! \brief UID command handler (called by servers) @@ -856,7 +861,7 @@ ms_nick(struct Client *client_p, struct Client *source_p, * - parv[ 9] = services id (timestamp) * - parv[10] = ircname (gecos) */ -static void +static int ms_uid(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -865,12 +870,12 @@ ms_uid(struct Client *client_p, struct Client *source_p, const char *svsid = "0"; if (parc < 10 || EmptyString(parv[parc-1])) - return; + return 0; if (check_clean_nick(client_p, source_p, parv[1], source_p) || check_clean_user(client_p, parv[1], parv[5], source_p) || check_clean_host(client_p, parv[1], parv[6], source_p)) - return; + return 0; newts = atol(parv[3]); svsid = parc == 11 ? parv[9] : "0"; @@ -892,7 +897,7 @@ ms_uid(struct Client *client_p, struct Client *source_p, ++ServerStats.is_kill; AddFlag(target_p, FLAGS_KILLED); exit_client(target_p, &me, "ID Collision"); - return; + return 0; } if ((target_p = hash_find_client(parv[1])) == NULL) @@ -905,16 +910,19 @@ ms_uid(struct Client *client_p, struct Client *source_p, else perform_nick_collides(source_p, client_p, target_p, parc, parv, newts, svsid, parv[1], parv[parc-1], parv[8]); + return 0; } -static struct Message nick_msgtab = { +static struct Message nick_msgtab = +{ "NICK", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, - {mr_nick, m_nick, ms_nick, m_ignore, m_nick, m_ignore} + { mr_nick, m_nick, ms_nick, m_ignore, m_nick, m_ignore } }; -static struct Message uid_msgtab = { +static struct Message uid_msgtab = +{ "UID", 0, 0, 10, MAXPARA, MFLG_SLOW, 0, - {m_ignore, m_ignore, ms_uid, m_ignore, m_ignore, m_ignore} + { m_ignore, m_ignore, ms_uid, m_ignore, m_ignore, m_ignore } }; static void @@ -931,7 +939,8 @@ module_exit(void) mod_del_cmd(&nick_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/core/m_part.c b/modules/core/m_part.c index c6c7a69..f995f55 100644 --- a/modules/core/m_part.c +++ b/modules/core/m_part.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_part.c: Parts a user from a channel. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_part.c + * \brief Includes required functions for processing the PART command. + * \version $Id$ */ #include "stdinc.h" @@ -45,7 +47,7 @@ * - pointer to source client to remove * - char pointer of name of channel to remove from * output - none - * side effects - remove ONE client given the channel name + * side effects - remove ONE client given the channel name */ static void part_one_client(struct Client *source_p, const char *name, const char *reason) @@ -109,7 +111,7 @@ part_one_client(struct Client *source_p, const char *name, const char *reason) ** parv[1] = channel ** parv[2] = reason */ -static void +static int m_part(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -117,13 +119,13 @@ m_part(struct Client *client_p, struct Client *source_p, char reason[KICKLEN + 1] = { '\0' }; if (IsServer(source_p)) - return; + return 0; if (EmptyString(parv[1])) { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "PART"); - return; + return 0; } if (parc > 2 && !EmptyString(parv[2])) @@ -136,9 +138,11 @@ m_part(struct Client *client_p, struct Client *source_p, for (name = strtoken(&p, parv[1], ","); name; name = strtoken(&p, NULL, ",")) part_one_client(source_p, name, reason); + return 0; } -static struct Message part_msgtab = { +static struct Message part_msgtab = +{ "PART", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_part, m_part, m_ignore, m_part, m_ignore } }; @@ -155,7 +159,8 @@ module_exit(void) mod_del_cmd(&part_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/core/m_quit.c b/modules/core/m_quit.c index d103729..ce2501d 100644 --- a/modules/core/m_quit.c +++ b/modules/core/m_quit.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_quit.c: Makes a user quit from IRC. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_quit.c + * \brief Includes required functions for processing the QUIT command. + * \version $Id$ */ #include "stdinc.h" @@ -38,7 +40,7 @@ ** parv[0] = sender prefix ** parv[1] = comment */ -static void +static int m_quit(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -50,6 +52,7 @@ m_quit(struct Client *client_p, struct Client *source_p, strlcpy(reason + 6, parv[1], sizeof(reason) - 6); exit_client(source_p, source_p, reason); + return 0; } /* @@ -57,7 +60,7 @@ m_quit(struct Client *client_p, struct Client *source_p, ** parv[0] = sender prefix ** parv[1] = comment */ -static void +static int ms_quit(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -69,11 +72,13 @@ ms_quit(struct Client *client_p, struct Client *source_p, strlcpy(reason, client_p->name, sizeof(reason)); exit_client(source_p, source_p, reason); + return 0; } -static struct Message quit_msgtab = { +static struct Message quit_msgtab = +{ "QUIT", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, - {m_quit, m_quit, ms_quit, m_ignore, m_quit, m_ignore} + { m_quit, m_quit, ms_quit, m_ignore, m_quit, m_ignore } }; static void @@ -88,7 +93,8 @@ module_exit(void) mod_del_cmd(&quit_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/core/m_server.c b/modules/core/m_server.c index 37fb02f..c58cc74 100644 --- a/modules/core/m_server.c +++ b/modules/core/m_server.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_server.c: Introduces a server. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,23 +17,26 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_server.c + * \brief Includes required functions for processing the SERVER/SID command. + * \version $Id$ */ #include "stdinc.h" #include "list.h" -#include "client.h" /* client struct */ +#include "client.h" #include "event.h" -#include "hash.h" /* add_to_client_hash_table */ -#include "irc_string.h" -#include "ircd.h" /* me */ -#include "numeric.h" /* ERR_xxx */ -#include "conf.h" /* struct MaskItem */ -#include "log.h" /* log level defines */ -#include "s_serv.h" /* server_estab, check_server */ +#include "hash.h" +#include "irc_string.h" +#include "ircd.h" +#include "numeric.h" +#include "conf.h" +#include "log.h" +#include "s_serv.h" #include "s_user.h" -#include "send.h" /* sendto_one */ +#include "send.h" #include "parse.h" #include "modules.h" @@ -69,7 +71,7 @@ set_server_gecos(struct Client *client_p, const char *info) * parv[2] = serverinfo/hopcount * parv[3] = serverinfo */ -static void +static int mr_server(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -81,7 +83,7 @@ mr_server(struct Client *client_p, struct Client *source_p, { sendto_one(client_p, "ERROR :No servername"); exit_client(client_p, client_p, "Wrong number of args"); - return; + return 0; } name = parv[1]; @@ -99,7 +101,7 @@ mr_server(struct Client *client_p, struct Client *source_p, "Unauthorized server connection attempt from %s: Non-TS server " "for server %s", get_client_name(client_p, MASK_IP), name); exit_client(client_p, client_p, "Non-TS server"); - return; + return 0; } if (!valid_servname(name)) @@ -111,7 +113,7 @@ mr_server(struct Client *client_p, struct Client *source_p, "Unauthorized server connection attempt from %s: Bogus server name " "for server %s", get_client_name(client_p, MASK_IP), name); exit_client(client_p, client_p, "Bogus server name"); - return; + return 0; } /* Now we just have to call check_server and everything should @@ -132,7 +134,7 @@ mr_server(struct Client *client_p, struct Client *source_p, } exit_client(client_p, client_p, "Invalid servername."); - return; + return 0; /* NOT REACHED */ break; @@ -146,7 +148,7 @@ mr_server(struct Client *client_p, struct Client *source_p, "for server %s", get_client_name(client_p, MASK_IP), name); exit_client(client_p, client_p, "Invalid password."); - return; + return 0; /* NOT REACHED */ break; @@ -160,7 +162,7 @@ mr_server(struct Client *client_p, struct Client *source_p, "for server %s", get_client_name(client_p, MASK_IP), name); exit_client(client_p, client_p, "Invalid host."); - return; + return 0; case -4: sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, "Unauthorized server connection attempt from %s: Invalid certificate fingerprint " @@ -171,7 +173,7 @@ mr_server(struct Client *client_p, struct Client *source_p, "for server %s", get_client_name(client_p, MASK_IP), name); exit_client(client_p, client_p, "Invalid certificate fingerprint."); - return; + return 0; /* NOT REACHED */ break; } @@ -190,16 +192,16 @@ mr_server(struct Client *client_p, struct Client *source_p, * connect - A1kmm. */ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, - "Attempt to re-introduce server %s SID %s from %s", - name, client_p->id, - get_client_name(client_p, HIDE_IP)); + "Attempt to re-introduce server %s SID %s from %s", + name, client_p->id, + get_client_name(client_p, HIDE_IP)); sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE, - "Attempt to re-introduce server %s SID %s from %s", + "Attempt to re-introduce server %s SID %s from %s", name, client_p->id, - get_client_name(client_p, MASK_IP)); + get_client_name(client_p, MASK_IP)); sendto_one(client_p, "ERROR :Server ID already exists."); exit_client(client_p, client_p, "Server ID Exists"); - return; + return 0; } /* XXX If somehow there is a connect in progress and @@ -217,6 +219,7 @@ mr_server(struct Client *client_p, struct Client *source_p, set_server_gecos(client_p, parv[3]); client_p->hopcount = hop; server_estab(client_p); + return 0; } /* ms_server() @@ -225,7 +228,7 @@ mr_server(struct Client *client_p, struct Client *source_p, * parv[2] = serverinfo/hopcount * parv[3] = serverinfo */ -static void +static int ms_server(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -239,12 +242,12 @@ ms_server(struct Client *client_p, struct Client *source_p, /* Just to be sure -A1kmm. */ if (!IsServer(source_p)) - return; + return 0; if (EmptyString(parv[3])) { sendto_one(client_p, "ERROR :No servername"); - return; + return 0; } name = parv[1]; @@ -260,7 +263,7 @@ ms_server(struct Client *client_p, struct Client *source_p, get_client_name(client_p, MASK_IP), name); sendto_one(client_p, "ERROR :Bogus server name introduced"); exit_client(client_p, &me, "Bogus server name intoduced"); - return; + return 0; } if ((target_p = hash_find_server(name))) @@ -280,17 +283,17 @@ ms_server(struct Client *client_p, struct Client *source_p, * that already exists, then sends you a client burst, you squit the * server, but you keep getting the burst of clients on a server that * doesnt exist, although ircd can handle it, its not a realistic - * solution.. --fl_ + * solution.. --fl_ */ sendto_one(client_p, "ERROR :Server %s already exists", name); sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, - "Link %s cancelled, server %s already exists", + "Link %s cancelled, server %s already exists", get_client_name(client_p, SHOW_IP), name); sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE, - "Link %s cancelled, server %s already exists", + "Link %s cancelled, server %s already exists", client_p->name, name); exit_client(client_p, &me, "Server Exists"); - return; + return 0; } /* XXX If somehow there is a connect in progress and @@ -329,7 +332,7 @@ ms_server(struct Client *client_p, struct Client *source_p, * name = "irc.bighub.net"; * hub_mask="*"; * ... - * + * * That would allow "irc.bighub.net" to introduce anything it wanted.. * * However @@ -354,7 +357,7 @@ ms_server(struct Client *client_p, struct Client *source_p, "Non-Hub link %s introduced %s.", get_client_name(client_p, MASK_IP), name); exit_client(source_p, &me, "No matching hub_mask."); - return; + return 0; } /* Check for the new server being leafed behind this HUB */ @@ -362,10 +365,10 @@ ms_server(struct Client *client_p, struct Client *source_p, { /* OOOPs nope can't HUB this leaf */ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, - "Link %s introduced leafed server %s.", + "Link %s introduced leafed server %s.", get_client_name(client_p, HIDE_IP), name); sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE, - "Link %s introduced leafed server %s.", + "Link %s introduced leafed server %s.", get_client_name(client_p, MASK_IP), name); /* If it is new, we are probably misconfigured, so split the * non-hub server introducing this. Otherwise, split the new @@ -375,7 +378,7 @@ ms_server(struct Client *client_p, struct Client *source_p, * larger networks, dont bother. --fl_ */ exit_client(client_p, &me, "Leafed Server."); - return; + return 0; } target_p = make_client(client_p); @@ -404,6 +407,7 @@ ms_server(struct Client *client_p, struct Client *source_p, sendto_realops_flags(UMODE_EXTERNAL, L_ALL, SEND_NOTICE, "Server %s being introduced by %s", target_p->name, source_p->name); + return 0; } /* ms_sid() @@ -413,7 +417,7 @@ ms_server(struct Client *client_p, struct Client *source_p, * parv[3] = sid of new server * parv[4] = serverinfo */ -static void +static int ms_sid(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -426,12 +430,12 @@ ms_sid(struct Client *client_p, struct Client *source_p, /* Just to be sure -A1kmm. */ if (!IsServer(source_p)) - return; + return 0; if (EmptyString(parv[4])) { sendto_one(client_p, "ERROR :No servername"); - return; + return 0; } hop = atoi(parv[2]); @@ -446,7 +450,7 @@ ms_sid(struct Client *client_p, struct Client *source_p, get_client_name(client_p, MASK_IP), parv[1]); sendto_one(client_p, "ERROR :Bogus server name introduced"); exit_client(client_p, &me, "Bogus server name intoduced"); - return; + return 0; } if (!valid_sid(parv[3])) @@ -459,7 +463,7 @@ ms_sid(struct Client *client_p, struct Client *source_p, get_client_name(client_p, MASK_IP), parv[3]); sendto_one(client_p, "ERROR :Bogus server ID introduced"); exit_client(client_p, &me, "Bogus server ID intoduced"); - return; + return 0; } /* collision on SID? */ @@ -467,13 +471,13 @@ ms_sid(struct Client *client_p, struct Client *source_p, { sendto_one(client_p, "ERROR :SID %s already exists", parv[3]); sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, - "Link %s cancelled, SID %s already exists", + "Link %s cancelled, SID %s already exists", get_client_name(client_p, SHOW_IP), parv[3]); sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE, - "Link %s cancelled, SID %s already exists", + "Link %s cancelled, SID %s already exists", client_p->name, parv[3]); exit_client(client_p, &me, "SID Exists"); - return; + return 0; } /* collision on name? */ @@ -481,13 +485,13 @@ ms_sid(struct Client *client_p, struct Client *source_p, { sendto_one(client_p, "ERROR :Server %s already exists", parv[1]); sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, - "Link %s cancelled, server %s already exists", + "Link %s cancelled, server %s already exists", get_client_name(client_p, SHOW_IP), parv[1]); sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE, - "Link %s cancelled, server %s already exists", + "Link %s cancelled, server %s already exists", client_p->name, parv[1]); exit_client(client_p, &me, "Server Exists"); - return; + return 0; } /* XXX If somehow there is a connect in progress and @@ -527,7 +531,7 @@ ms_sid(struct Client *client_p, struct Client *source_p, * name = "irc.bighub.net"; * hub_mask="*"; * ... - * + * * That would allow "irc.bighub.net" to introduce anything it wanted.. * * However @@ -552,7 +556,7 @@ ms_sid(struct Client *client_p, struct Client *source_p, "Non-Hub link %s introduced %s.", get_client_name(client_p, MASK_IP), parv[1]); exit_client(source_p, &me, "No matching hub_mask."); - return; + return 0; } /* Check for the new server being leafed behind this HUB */ @@ -560,13 +564,13 @@ ms_sid(struct Client *client_p, struct Client *source_p, { /* OOOPs nope can't HUB this leaf */ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, - "Link %s introduced leafed server %s.", + "Link %s introduced leafed server %s.", get_client_name(client_p, SHOW_IP), parv[1]); sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE, - "Link %s introduced leafed server %s.", + "Link %s introduced leafed server %s.", get_client_name(client_p, MASK_IP), parv[1]); exit_client(client_p, &me, "Leafed Server."); - return; + return 0; } target_p = make_client(client_p); @@ -600,16 +604,19 @@ ms_sid(struct Client *client_p, struct Client *source_p, sendto_realops_flags(UMODE_EXTERNAL, L_ALL, SEND_NOTICE, "Server %s being introduced by %s", target_p->name, source_p->name); + return 0; } -static struct Message server_msgtab = { +static struct Message server_msgtab = +{ "SERVER", 0, 0, 4, MAXPARA, MFLG_SLOW, 0, - {mr_server, m_registered, ms_server, m_ignore, m_registered, m_ignore} + { mr_server, m_registered, ms_server, m_ignore, m_registered, m_ignore } }; -static struct Message sid_msgtab = { +static struct Message sid_msgtab = +{ "SID", 0, 0, 5, MAXPARA, MFLG_SLOW, 0, - {m_ignore, m_ignore, ms_sid, m_ignore, m_ignore, m_ignore} + { m_ignore, m_ignore, ms_sid, m_ignore, m_ignore, m_ignore } }; static void @@ -626,7 +633,8 @@ module_exit(void) mod_del_cmd(&server_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/core/m_sjoin.c b/modules/core/m_sjoin.c index 204bb29..7213b2d 100644 --- a/modules/core/m_sjoin.c +++ b/modules/core/m_sjoin.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_sjoin.c: Joins a user to a channel. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_sjoin.c + * \brief Includes required functions for processing the SJOIN command. + * \version $Id$ */ #include "stdinc.h" @@ -64,7 +66,7 @@ static void remove_ban_list(struct Channel *, struct Client *, dlink_list *, cha * incoming modes or undo the existing ones or merge them, and JOIN * all the specified users while sending JOIN/MODEs to local clients */ -static void +static int ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -86,27 +88,27 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int len_uid = 0; int isnew = 0; int buflen = 0; - int slen; + int slen; unsigned int fl; char *s; - char *sptr; + char *sptr; char nick_buf[IRCD_BUFSIZE]; /* buffer for modes and prefix */ char uid_buf[IRCD_BUFSIZE]; /* buffer for modes/prefixes for CAP_TS6 servers */ char *nick_ptr, *uid_ptr; /* pointers used for making the two mode/prefix buffers */ char *p; /* pointer used making sjbuf */ dlink_node *m; const char *servername = (ConfigServerHide.hide_servers || IsHidden(source_p)) ? - me.name : source_p->name; + me.name : source_p->name; if (IsClient(source_p) || parc < 5) - return; + return 0; if (!check_channel_name(parv[2], 0)) { sendto_realops_flags(UMODE_DEBUG, L_ALL, SEND_NOTICE, "*** Too long or invalid channel name from %s: %s", client_p->name, parv[2]); - return; + return 0; } modebuf[0] = '\0'; @@ -160,14 +162,14 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, args++; if (parc < 5 + args) - return; + return 0; break; case 'l': mode.limit = atoi(parv[4 + args]); args++; if (parc < 5 + args) - return; + return 0; break; } } @@ -187,9 +189,9 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, if (newts < 800000000) { sendto_realops_flags(UMODE_DEBUG, L_ALL, SEND_NOTICE, - "*** Bogus TS %lu on %s ignored from %s", - (unsigned long)newts, chptr->chname, - client_p->name); + "*** Bogus TS %lu on %s ignored from %s", + (unsigned long)newts, chptr->chname, + client_p->name); newts = (oldts == 0) ? 0 : 800000000; } @@ -199,11 +201,11 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, if (!newts && !isnew && oldts) { sendto_channel_local(ALL_MEMBERS, 0, chptr, - ":%s NOTICE %s :*** Notice -- TS for %s changed from %lu to 0", - me.name, chptr->chname, chptr->chname, (unsigned long)oldts); + ":%s NOTICE %s :*** Notice -- TS for %s changed from %lu to 0", + me.name, chptr->chname, chptr->chname, (unsigned long)oldts); sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, - "Server %s changing TS on %s from %lu to 0", - source_p->name, chptr->chname, (unsigned long)oldts); + "Server %s changing TS on %s from %lu to 0", + source_p->name, chptr->chname, (unsigned long)oldts); } } @@ -252,9 +254,9 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, } sendto_channel_local(ALL_MEMBERS, 0, chptr, - ":%s NOTICE %s :*** Notice -- TS for %s changed from %lu to %lu", - me.name, chptr->chname, chptr->chname, - (unsigned long)oldts, (unsigned long)newts); + ":%s NOTICE %s :*** Notice -- TS for %s changed from %lu to %lu", + me.name, chptr->chname, chptr->chname, + (unsigned long)oldts, (unsigned long)newts); } if (*modebuf != '\0') @@ -262,7 +264,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, /* This _SHOULD_ be to ALL_MEMBERS * It contains only +imnpstlk, etc */ sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s MODE %s %s %s", - servername, chptr->chname, modebuf, parabuf); + servername, chptr->chname, modebuf, parabuf); } if (parv[3][0] != '0' && keep_new_modes) @@ -291,9 +293,9 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, if (buflen >= (IRCD_BUFSIZE - IRCD_MAX(NICKLEN, IDLEN) - 2 - 3 - 1)) { sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, - "Long SJOIN from server: %s(via %s) (ignored)", - source_p->name, client_p->name); - return; + "Long SJOIN from server: %s(via %s) (ignored)", + source_p->name, client_p->name); + return 0; } mbuf = modebuf; @@ -323,22 +325,22 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, switch (*s) { case '@': - fl |= CHFL_CHANOP; - s++; - break; + fl |= CHFL_CHANOP; + s++; + break; #ifdef HALFOPS case '%': - fl |= CHFL_HALFOP; - s++; - break; + fl |= CHFL_HALFOP; + s++; + break; #endif case '+': fl |= CHFL_VOICE; s++; - break; + break; default: - valid_mode = 0; - break; + valid_mode = 0; + break; } } while (valid_mode); @@ -370,7 +372,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, *np++ = '@'; *up++ = '@'; len_nick++; - len_uid++; + len_uid++; } #ifdef HALFOPS if (fl & CHFL_HALFOP) @@ -378,7 +380,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, *np++ = '%'; *up++ = '%'; len_nick++; - len_uid++; + len_uid++; } #endif if (fl & CHFL_VOICE) @@ -386,7 +388,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, *np++ = '+'; *up++ = '+'; len_nick++; - len_uid++; + len_uid++; } } else @@ -401,7 +403,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, if ((nick_ptr - nick_buf + len_nick) > (IRCD_BUFSIZE - 2)) { sendto_server(client_p, 0, CAP_TS6, "%s", nick_buf); - + buflen = snprintf(nick_buf, sizeof(nick_buf), ":%s SJOIN %lu %s %s %s:", source_p->name, (unsigned long)tstosend, chptr->chname, modebuf, parabuf); @@ -409,11 +411,11 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, } nick_ptr += sprintf(nick_ptr, "%s%s ", nick_prefix, target_p->name); - + if ((uid_ptr - uid_buf + len_uid) > (IRCD_BUFSIZE - 2)) { sendto_server(client_p, CAP_TS6, 0, "%s", uid_buf); - + buflen = snprintf(uid_buf, sizeof(uid_buf), ":%s SJOIN %lu %s %s %s:", ID(source_p), (unsigned long)tstosend, chptr->chname, modebuf, parabuf); @@ -421,7 +423,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, } uid_ptr += sprintf(uid_ptr, "%s%s ", uid_prefix, ID(target_p)); - + if (!IsMember(target_p, chptr)) { add_user_to_channel(chptr, target_p, fl, !have_many_nicks); @@ -442,21 +444,22 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, if (pargs >= MAXMODEPARAMS) { - /* - * Ok, the code is now going to "walk" through - * sendbuf, filling in para strings. So, I will use sptr - * to point into the sendbuf. - * Notice, that ircsprintf() returns the number of chars - * successfully inserted into string. - * - Dianora - */ - - sptr = sendbuf; + /* + * Ok, the code is now going to "walk" through + * sendbuf, filling in para strings. So, I will use sptr + * to point into the sendbuf. + * Notice, that ircsprintf() returns the number of chars + * successfully inserted into string. + * - Dianora + */ + + sptr = sendbuf; *mbuf = '\0'; + for(lcount = 0; lcount < MAXMODEPARAMS; lcount++) { - slen = sprintf(sptr, " %s", para[lcount]); /* see? */ - sptr += slen; /* ready for next */ + slen = sprintf(sptr, " %s", para[lcount]); /* see? */ + sptr += slen; /* ready for next */ } sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s MODE %s %s%s", servername, chptr->chname, modebuf, sendbuf); @@ -500,12 +503,12 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, if (pargs >= MAXMODEPARAMS) { - sptr = sendbuf; + sptr = sendbuf; *mbuf = '\0'; for (lcount = 0; lcount < MAXMODEPARAMS; lcount++) { slen = sprintf(sptr, " %s", para[lcount]); - sptr += slen; + sptr += slen; } sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s MODE %s %s%s", servername, chptr->chname, modebuf, sendbuf); @@ -567,11 +570,11 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, if ((dlink_list_length(&chptr->members) == 0) && isnew) { destroy_channel(chptr); - return; + return 0; } if (parv[4 + args][0] == '\0') - return; + return 0; /* relay the SJOIN to other servers */ DLINK_FOREACH(m, serv_list.head) @@ -601,7 +604,9 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, remove_ban_list(chptr, client_p, &chptr->invexlist, 'I', CAP_IE); clear_ban_cache(chptr); - } + } + + return 0; } /* set_final_mode @@ -736,16 +741,14 @@ remove_a_mode(struct Channel *chptr, struct Client *source_p, for(i = 0; i < MAXMODEPARAMS; i++) { l = sprintf(sp, " %s", lpara[i]); - sp += l; + sp += l; } *mbuf = '\0'; - sendto_channel_local(ALL_MEMBERS, 0, chptr, - ":%s MODE %s %s%s", - (IsHidden(source_p) || - ConfigServerHide.hide_servers) ? - me.name : source_p->name, - chptr->chname, lmodebuf, sendbuf); + sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s MODE %s %s%s", + (IsHidden(source_p) || ConfigServerHide.hide_servers) ? + me.name : source_p->name, + chptr->chname, lmodebuf, sendbuf); mbuf = lmodebuf; *mbuf++ = '-'; count = 0; @@ -762,11 +765,10 @@ remove_a_mode(struct Channel *chptr, struct Client *source_p, l = sprintf(sp, " %s", lpara[i]); sp += l; } - sendto_channel_local(ALL_MEMBERS, 0, chptr, - ":%s MODE %s %s%s", - (IsHidden(source_p) || ConfigServerHide.hide_servers) ? - me.name : source_p->name, - chptr->chname, lmodebuf, sendbuf); + sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s MODE %s %s%s", + (IsHidden(source_p) || ConfigServerHide.hide_servers) ? + me.name : source_p->name, + chptr->chname, lmodebuf, sendbuf); } } @@ -787,11 +789,10 @@ remove_ban_list(struct Channel *chptr, struct Client *source_p, dlink_node *ptr = NULL; dlink_node *next_ptr = NULL; char *pbuf = NULL; - int count = 0; + int count = 0; int cur_len, mlen, plen; pbuf = lparabuf; - cur_len = mlen = sprintf(lmodebuf, ":%s MODE %s -", source_p->name, chptr->chname); mbuf = lmodebuf + mlen; @@ -808,14 +809,13 @@ remove_ban_list(struct Channel *chptr, struct Client *source_p, *mbuf = *(pbuf - 1) = '\0'; sendto_channel_local(ALL_MEMBERS, 0, chptr, "%s %s", lmodebuf, lparabuf); - sendto_server(source_p, cap, CAP_TS6, - "%s %s", lmodebuf, lparabuf); + sendto_server(source_p, cap, CAP_TS6, "%s %s", lmodebuf, lparabuf); cur_len = mlen; mbuf = lmodebuf + mlen; pbuf = lparabuf; count = 0; - } + } *mbuf++ = c; cur_len += plen; @@ -828,13 +828,13 @@ remove_ban_list(struct Channel *chptr, struct Client *source_p, *mbuf = *(pbuf - 1) = '\0'; sendto_channel_local(ALL_MEMBERS, 0, chptr, "%s %s", lmodebuf, lparabuf); - sendto_server(source_p, cap, CAP_TS6, - "%s %s", lmodebuf, lparabuf); + sendto_server(source_p, cap, CAP_TS6, "%s %s", lmodebuf, lparabuf); } -static struct Message sjoin_msgtab = { +static struct Message sjoin_msgtab = +{ "SJOIN", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_ignore, ms_sjoin, m_ignore, m_ignore, m_ignore} + { m_unregistered, m_ignore, ms_sjoin, m_ignore, m_ignore, m_ignore } }; static void @@ -849,7 +849,8 @@ module_exit(void) mod_del_cmd(&sjoin_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/core/m_squit.c b/modules/core/m_squit.c index 966a831..c12409f 100644 --- a/modules/core/m_squit.c +++ b/modules/core/m_squit.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_squit.c: Makes a server quit. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_squit.c + * \brief Includes required functions for processing the SQUIT command. + * \version $Id$ */ #include "stdinc.h" @@ -42,7 +44,7 @@ * parv[1] = server name * parv[2] = comment */ -static void +static int mo_squit(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -57,7 +59,7 @@ mo_squit(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "SQUIT"); - return; + return 0; } server = parv[1]; @@ -83,21 +85,21 @@ mo_squit(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOSUCHSERVER), me.name, source_p->name, server); - return; + return 0; } if (!MyConnect(target_p) && !HasOFlag(source_p, OPER_FLAG_SQUIT_REMOTE)) { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "squit:remote"); - return; + return 0; } if (MyConnect(target_p) && !HasOFlag(source_p, OPER_FLAG_SQUIT)) { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "squit"); - return; + return 0; } comment = (parc > 2 && parv[2]) ? parv[2] : def_reason; @@ -115,6 +117,7 @@ mo_squit(struct Client *client_p, struct Client *source_p, } exit_client(target_p, source_p, comment); + return 0; } /** NOTE: I removed wildcard lookups here, because a wildcarded @@ -126,7 +129,7 @@ mo_squit(struct Client *client_p, struct Client *source_p, * parv[1] = server name * parv[2] = comment */ -static void +static int ms_squit(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -134,13 +137,13 @@ ms_squit(struct Client *client_p, struct Client *source_p, const char *comment = NULL; if (parc < 2 || EmptyString(parv[parc - 1])) - return; + return 0; if ((target_p = hash_find_server(parv[1])) == NULL) - return; + return 0; if (!IsServer(target_p) && !IsMe(target_p)) - return; + return 0; if (IsMe(target_p)) target_p = client_p; @@ -159,14 +162,16 @@ ms_squit(struct Client *client_p, struct Client *source_p, me.name, target_p->name, source_p->name, comment); ilog(LOG_TYPE_IRCD, "SQUIT From %s : %s (%s)", source_p->name, target_p->name, comment); - } + } - exit_client(target_p, source_p, comment); + exit_client(target_p, source_p, comment); + return 0; } -static struct Message squit_msgtab = { +static struct Message squit_msgtab = +{ "SQUIT", 0, 0, 1, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_not_oper, ms_squit, m_ignore, mo_squit, m_ignore} + { m_unregistered, m_not_oper, ms_squit, m_ignore, mo_squit, m_ignore } }; static void @@ -181,7 +186,8 @@ module_exit(void) mod_del_cmd(&squit_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_accept.c b/modules/m_accept.c index 7815083..7774fef 100644 --- a/modules/m_accept.c +++ b/modules/m_accept.c @@ -1,7 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 2000-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -117,7 +117,7 @@ add_accept(const struct split_nuh_item *nuh, struct Client *source_p) * - parv[0] = sender prefix * - parv[1] = list of masks to be accepted or removed (optional) */ -static void +static int m_accept(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -132,7 +132,7 @@ m_accept(struct Client *client_p, struct Client *source_p, if (EmptyString(parv[1]) || !irccmp(parv[1], "*")) { list_accepts(source_p); - return; + return 0; } for (mask = strtoken(&p, parv[1], ","); mask != NULL; @@ -167,7 +167,7 @@ m_accept(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_ACCEPTFULL), me.name, source_p->name); - return; + return 0; } nuh.nuhmask = mask; @@ -191,9 +191,12 @@ m_accept(struct Client *client_p, struct Client *source_p, add_accept(&nuh, source_p); } } + + return 0; } -static struct Message accept_msgtab = { +static struct Message accept_msgtab = +{ "ACCEPT", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_accept, m_ignore, m_ignore, m_accept, m_ignore } }; @@ -210,7 +213,8 @@ module_exit(void) mod_del_cmd(&accept_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_admin.c b/modules/m_admin.c index 345582a..fb039a5 100644 --- a/modules/m_admin.c +++ b/modules/m_admin.c @@ -1,7 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,7 +41,7 @@ * * \param source_p Pointer to client to report to */ -static void +static int do_admin(struct Client *source_p) { const char *me_name = ID_or_name(&me, source_p->from); @@ -64,6 +64,7 @@ do_admin(struct Client *source_p) if (AdminInfo.email != NULL) sendto_one(source_p, form_str(RPL_ADMINEMAIL), me_name, nick, AdminInfo.email); + return 0; } /*! \brief NICK command handler (called by already registered, @@ -80,7 +81,7 @@ do_admin(struct Client *source_p) * - parv[0] = sender prefix * - parv[1] = nickname/servername */ -static void +static int m_admin(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -90,7 +91,7 @@ m_admin(struct Client *client_p, struct Client *source_p, { sendto_one(source_p,form_str(RPL_LOAD2HI), me.name, source_p->name); - return; + return 0; } last_used = CurrentTime; @@ -98,9 +99,9 @@ m_admin(struct Client *client_p, struct Client *source_p, if (!ConfigServerHide.disable_remote_commands) if (hunt_server(client_p, source_p, ":%s ADMIN :%s", 1, parc, parv) != HUNTED_ISME) - return; + return 0; - do_admin(source_p); + return do_admin(source_p); } /*! \brief ADMIN command handler (called by operators and @@ -117,18 +118,19 @@ m_admin(struct Client *client_p, struct Client *source_p, * - parv[0] = sender prefix * - parv[1] = nickname/servername */ -static void +static int ms_admin(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if (hunt_server(client_p, source_p, ":%s ADMIN :%s", 1, parc, parv) != HUNTED_ISME) - return; + return 0; - do_admin(source_p); + return do_admin(source_p); } -static struct Message admin_msgtab = { +static struct Message admin_msgtab = +{ "ADMIN", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_admin, ms_admin, m_ignore, ms_admin, m_ignore } }; @@ -145,7 +147,8 @@ module_exit(void) mod_del_cmd(&admin_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_away.c b/modules/m_away.c index e690036..d0befb3 100644 --- a/modules/m_away.c +++ b/modules/m_away.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_away.c: Sets/removes away status on a user. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_away.c + * \brief Includes required functions for processing the AWAY command. + * \version $Id$ */ #include "stdinc.h" @@ -41,7 +43,7 @@ * parv[0] = sender prefix * parv[1] = away message */ -static void +static int m_away(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -67,21 +69,21 @@ m_away(struct Client *client_p, struct Client *source_p, sendto_one(source_p, form_str(RPL_UNAWAY), me.name, source_p->name); - return; + return 0; } if ((CurrentTime - source_p->localClient->last_away) < ConfigFileEntry.pace_wait) { sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name); - return; + return 0; } source_p->localClient->last_away = CurrentTime; sendto_one(source_p, form_str(RPL_NOWAWAY), me.name, source_p->name); if (!strncmp(source_p->away, parv[1], sizeof(source_p->away) - 1)) - return; + return 0; strlcpy(source_p->away, parv[1], sizeof(source_p->away)); @@ -93,9 +95,10 @@ m_away(struct Client *client_p, struct Client *source_p, ":%s AWAY :%s", ID(source_p), source_p->away); sendto_server(client_p, NOCAPS, CAP_TS6, ":%s AWAY :%s", source_p->name, source_p->away); + return 0; } -static void +static int ms_away(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -116,11 +119,11 @@ ms_away(struct Client *client_p, struct Client *source_p, source_p->host); } - return; + return 0; } if (!strncmp(source_p->away, parv[1], sizeof(source_p->away) - 1)) - return; + return 0; strlcpy(source_p->away, parv[1], sizeof(source_p->away)); @@ -132,9 +135,11 @@ ms_away(struct Client *client_p, struct Client *source_p, ":%s AWAY :%s", ID(source_p), source_p->away); sendto_server(client_p, NOCAPS, CAP_TS6, ":%s AWAY :%s", source_p->name, source_p->away); + return 0; } -static struct Message away_msgtab = { +static struct Message away_msgtab = +{ "AWAY", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_away, ms_away, m_ignore, m_away, m_ignore } }; @@ -153,7 +158,8 @@ module_exit(void) delete_isupport("AWAYLEN"); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_cap.c b/modules/m_cap.c index 93e3698..7771d31 100644 --- a/modules/m_cap.c +++ b/modules/m_cap.c @@ -1,8 +1,8 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2004 Kevin L. Mitchell <klmitch@mit.edu> - * Copyright (C) 2006-2012 Hybrid Development Team + * Copyright (c) 2004 Kevin L. Mitchell <klmitch@mit.edu> + * Copyright (c) 2006-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,13 +18,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ */ -/** @file - * @brief Capability negotiation commands - * @version $Id$ +/*! \file m_cap.c + * \brief Includes required functions for processing the CAP command. + * \version $Id$ */ #include "stdinc.h" @@ -76,8 +74,8 @@ capab_search(const char *key, const struct capabilities *cap) { const char *rb = cap->name; - while (ToLower(*key) == ToLower(*rb)) /* walk equivalent part of strings */ - if (*key++ == '\0') /* hit the end, all right... */ + while (ToLower(*key) == ToLower(*rb)) /* Walk equivalent part of strings */ + if (*key++ == '\0') /* Hit the end, all right... */ return 0; else /* OK, let's move on... */ rb++; @@ -97,7 +95,7 @@ find_cap(const char **caplist_p, int *neg_p) const char *caplist = *caplist_p; struct capabilities *cap = NULL; - *neg_p = 0; /* clear negative flag... */ + *neg_p = 0; /* Clear negative flag... */ if (!inited) { @@ -113,8 +111,8 @@ find_cap(const char **caplist_p, int *neg_p) /* We are now at the beginning of an element of the list; is it negative? */ if (*caplist == '-') { - ++caplist; /* yes; step past the flag... */ - *neg_p = 1; /* remember that it is negative... */ + ++caplist; /* Yes; step past the flag... */ + *neg_p = 1; /* Remember that it is negative... */ } /* OK, now see if we can look up the capability... */ @@ -129,15 +127,15 @@ find_cap(const char **caplist_p, int *neg_p) ++caplist; } else - caplist += cap->namelen; /* advance to end of capability name */ + caplist += cap->namelen; /* Advance to end of capability name */ } - assert(caplist != *caplist_p || !*caplist); /* we *must* advance */ + assert(caplist != *caplist_p || !*caplist); /* We *must* advance */ - /* move ahead in capability list string--or zero pointer if we hit end */ + /* Move ahead in capability list string--or zero pointer if we hit end */ *caplist_p = *caplist ? caplist : 0; - return cap; /* and return the capability (if any) */ + return cap; /* And return the capability (if any) */ } /** Send a CAP \a subcmd list of capability changes to \a source_p. @@ -156,7 +154,7 @@ send_caplist(struct Client *source_p, unsigned int set, char cmdbuf[IRCD_BUFSIZE] = ""; unsigned int i, loc, len, flags, pfx_len, clen; - /* set up the buffer for the final LS message... */ + /* Set up the buffer for the final LS message... */ clen = snprintf(cmdbuf, sizeof(capbuf), ":%s CAP %s %s ", me.name, source_p->name[0] ? source_p->name : "*", subcmd); @@ -192,13 +190,13 @@ send_caplist(struct Client *source_p, unsigned int set, pfx[pfx_len] = '\0'; - len = capab_list[i].namelen + pfx_len; /* how much we'd add... */ + len = capab_list[i].namelen + pfx_len; /* How much we'd add... */ if (sizeof(capbuf) < (clen + loc + len + 15)) { - /* would add too much; must flush */ + /* Would add too much; must flush */ sendto_one(source_p, "%s* :%s", cmdbuf, capbuf); - capbuf[(loc = 0)] = '\0'; /* re-terminate the buffer... */ + capbuf[(loc = 0)] = '\0'; /* Re-terminate the buffer... */ } loc += snprintf(capbuf + loc, sizeof(capbuf) - loc, @@ -207,16 +205,16 @@ send_caplist(struct Client *source_p, unsigned int set, sendto_one(source_p, "%s:%s", cmdbuf, capbuf); - return 0; /* convenience return */ + return 0; /* Convenience return */ } static int cap_ls(struct Client *source_p, const char *caplist) { - if (IsUnknown(source_p)) /* registration hasn't completed; suspend it... */ + if (IsUnknown(source_p)) /* Registration hasn't completed; suspend it... */ source_p->localClient->registration |= REG_NEED_CAP; - return send_caplist(source_p, 0, 0, "LS"); /* send list of capabilities */ + return send_caplist(source_p, 0, 0, "LS"); /* Send list of capabilities */ } static int @@ -229,21 +227,21 @@ cap_req(struct Client *source_p, const char *caplist) unsigned int as = source_p->localClient->cap_active; /* active set */ int neg = 0; - if (IsUnknown(source_p)) /* registration hasn't completed; suspend it... */ + if (IsUnknown(source_p)) /* Registration hasn't completed; suspend it... */ source_p->localClient->registration |= REG_NEED_CAP; - while (cl) { /* walk through the capabilities list... */ - if (!(cap = find_cap(&cl, &neg)) /* look up capability... */ - || (!neg && (cap->flags & CAPFL_PROHIBIT)) /* is it prohibited? */ - || (neg && (cap->flags & CAPFL_STICKY))) { /* is it sticky? */ + while (cl) { /* Walk through the capabilities list... */ + if (!(cap = find_cap(&cl, &neg)) /* Look up capability... */ + || (!neg && (cap->flags & CAPFL_PROHIBIT)) /* Is it prohibited? */ + || (neg && (cap->flags & CAPFL_STICKY))) { /* Is it sticky? */ sendto_one(source_p, ":%s CAP %s NAK :%s", me.name, source_p->name[0] ? source_p->name : "*", caplist); - return 0; /* can't complete requested op... */ + return 0; /* Can't complete requested op... */ } if (neg) { - /* set or clear the capability... */ + /* Set or clear the capability... */ rem |= cap->cap; set &= ~cap->cap; cs &= ~cap->cap; @@ -280,18 +278,18 @@ cap_ack(struct Client *source_p, const char *caplist) /* * Coming from the client, this generally indicates that the client - * is using a new backwards-incompatible protocol feature. As such, + * is using a new backwards-incompatible protocol feature. As such, * it does not require further response from the server. */ while (cl) { - /* walk through the capabilities list... */ - if (!(cap = find_cap(&cl, &neg)) || /* look up capability... */ + /* Walk through the capabilities list... */ + if (!(cap = find_cap(&cl, &neg)) || /* Look up capability... */ (neg ? (source_p->localClient->cap_active & cap->cap) : !(source_p->localClient->cap_active & cap->cap))) /* uh... */ continue; - if (neg) /* set or clear the active capability... */ + if (neg) /* Set or clear the active capability... */ source_p->localClient->cap_active &= ~cap->cap; else source_p->localClient->cap_active |= cap->cap; @@ -328,13 +326,13 @@ cap_clear(struct Client *source_p, const char *caplist) static int cap_end(struct Client *source_p, const char *caplist) { - if (!IsUnknown(source_p)) /* registration has completed... */ - return 0; /* so just ignore the message... */ + if (!IsUnknown(source_p)) /* Registration has completed... */ + return 0; /* So just ignore the message... */ - /* capability negotiation is now done... */ + /* Capability negotiation is now done... */ source_p->localClient->registration &= ~REG_NEED_CAP; - /* if client is now done... */ + /* If client is now done... */ if (!source_p->localClient->registration) { register_local_user(source_p); @@ -377,36 +375,38 @@ subcmd_search(const char *cmd, const struct subcmd *elem) * \param parc Number of arguments. * \param parv Argument vector. */ -static void +static int m_cap(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { const char *subcmd = NULL, *caplist = NULL; struct subcmd *cmd = NULL; - if (EmptyString(parv[1])) /* a subcommand is required */ - return; + if (EmptyString(parv[1])) /* A subcommand is required */ + return 0; subcmd = parv[1]; - if (parc > 2) /* a capability list was provided */ + if (parc > 2) /* A capability list was provided */ caplist = parv[2]; - /* find the subcommand handler */ + /* Find the subcommand handler */ if (!(cmd = bsearch(subcmd, cmdlist, sizeof(cmdlist) / sizeof(struct subcmd), sizeof(struct subcmd), (bqcmp)subcmd_search))) { sendto_one(source_p, form_str(ERR_INVALIDCAPCMD), me.name, source_p->name[0] ? source_p->name : "*", subcmd); - return; + return 0; } - /* then execute it... */ + /* Then execute it... */ if (cmd->proc) (cmd->proc)(source_p, caplist); + return 0; } -static struct Message cap_msgtab = { +static struct Message cap_msgtab = +{ "CAP", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, { m_cap, m_cap, m_ignore, m_ignore, m_cap, m_ignore } }; @@ -423,7 +423,8 @@ module_exit(void) mod_del_cmd(&cap_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_capab.c b/modules/m_capab.c index a282920..ea1e5f9 100644 --- a/modules/m_capab.c +++ b/modules/m_capab.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_capab.c: Negotiates capabilities with a remote server. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1998-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_capab.c + * \brief Includes required functions for processing the CAPAB command. + * \version $Id$ */ #include "stdinc.h" @@ -37,7 +39,7 @@ * parv[1] = space-separated list of capabilities * */ -static void +static int mr_capab(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -49,7 +51,7 @@ mr_capab(struct Client *client_p, struct Client *source_p, if (client_p->localClient->caps && !(IsCapable(client_p, CAP_TS6))) { exit_client(client_p, client_p, "CAPAB received twice"); - return; + return 0; } SetCapable(client_p, CAP_CAP); @@ -59,9 +61,12 @@ mr_capab(struct Client *client_p, struct Client *source_p, s = strtoken(&p, NULL, " ")) if ((cap = find_capability(s))) SetCapable(client_p, cap); + + return 0; } -static struct Message capab_msgtab = { +static struct Message capab_msgtab = +{ "CAPAB", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, { mr_capab, m_ignore, m_ignore, m_ignore, m_ignore, m_ignore } }; @@ -78,7 +83,8 @@ module_exit(void) mod_del_cmd(&capab_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_certfp.c b/modules/m_certfp.c index 50674de..a63ae4b 100644 --- a/modules/m_certfp.c +++ b/modules/m_certfp.c @@ -1,7 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 2013-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -48,12 +48,12 @@ * - parv[0] = sender prefix * - parv[1] = certificate fingerprint */ -static void +static int ms_certfp(struct Client *source_p, struct Client *client_p, int parc, char *parv[]) { if (!IsClient(source_p)) - return; + return 0; MyFree(source_p->certfp); source_p->certfp = strdup(parv[1]); @@ -62,9 +62,11 @@ ms_certfp(struct Client *source_p, struct Client *client_p, ID(source_p), parv[1]); sendto_server(client_p, NOCAPS, CAP_TS6, ":%s CERTFP %s", source_p->name, parv[1]); + return 0; } -static struct Message certfp_msgtab = { +static struct Message certfp_msgtab = +{ "CERTFP", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, { m_ignore, m_ignore, ms_certfp, m_ignore, m_ignore, m_ignore } }; @@ -81,7 +83,8 @@ module_exit(void) mod_del_cmd(&certfp_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_challenge.c b/modules/m_challenge.c index 29ff32f..78d44fe 100644 --- a/modules/m_challenge.c +++ b/modules/m_challenge.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_challenge.c: Allows an IRC Operator to securely authenticate. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 2000-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_challenge.c + * \brief Includes required functions for processing the CHALLENGE command. + * \version $Id$ */ #include "stdinc.h" @@ -67,7 +69,7 @@ failed_challenge_notice(struct Client *source_p, const char *name, * parv[1] = operator to challenge for, or +response * */ -static void +static int m_challenge(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -78,7 +80,7 @@ m_challenge(struct Client *client_p, struct Client *source_p, { /* Ignore it if we aren't expecting this... -A1kmm */ if (source_p->localClient->response == NULL) - return; + return 0; if (irccmp(source_p->localClient->response, ++parv[1])) { @@ -86,7 +88,7 @@ m_challenge(struct Client *client_p, struct Client *source_p, source_p->name); failed_challenge_notice(source_p, source_p->localClient->auth_oper, "challenge failed"); - return; + return 0; } conf = find_exact_name_conf(CONF_OPER, source_p, @@ -95,7 +97,7 @@ m_challenge(struct Client *client_p, struct Client *source_p, { /* XXX: logging */ sendto_one(source_p, form_str(ERR_NOOPERHOST), me.name, source_p->name); - return; + return 0; } if (attach_conf(source_p, conf) != 0) @@ -103,7 +105,7 @@ m_challenge(struct Client *client_p, struct Client *source_p, sendto_one(source_p,":%s NOTICE %s :Can't attach conf!", me.name, source_p->name); failed_challenge_notice(source_p, conf->name, "can't attach conf!"); - return; + return 0; } ++conf->count; @@ -117,7 +119,7 @@ m_challenge(struct Client *client_p, struct Client *source_p, MyFree(source_p->localClient->auth_oper); source_p->localClient->response = NULL; source_p->localClient->auth_oper = NULL; - return; + return 0; } MyFree(source_p->localClient->response); @@ -133,7 +135,7 @@ m_challenge(struct Client *client_p, struct Client *source_p, conf = find_exact_name_conf(CONF_OPER, NULL, parv[1], NULL, NULL); failed_challenge_notice(source_p, parv[1], (conf != NULL) ? "host mismatch" : "no oper {} block"); - return; + return 0; } if (conf->rsa_public_key == NULL) @@ -141,14 +143,14 @@ m_challenge(struct Client *client_p, struct Client *source_p, sendto_one(source_p, ":%s NOTICE %s :I'm sorry, PK authentication " "is not enabled for your oper{} block.", me.name, source_p->name); - return; + return 0; } if (IsConfSSL(conf) && !HasUMode(source_p, UMODE_SSL)) { sendto_one(source_p, form_str(ERR_NOOPERHOST), me.name, source_p->name); failed_challenge_notice(source_p, conf->name, "requires SSL/TLS"); - return; + return 0; } if (!EmptyString(conf->certfp)) @@ -157,7 +159,7 @@ m_challenge(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOOPERHOST), me.name, source_p->name); failed_challenge_notice(source_p, conf->name, "client certificate fingerprint mismatch"); - return; + return 0; } } @@ -168,17 +170,20 @@ m_challenge(struct Client *client_p, struct Client *source_p, source_p->localClient->auth_oper = xstrdup(conf->name); MyFree(challenge); + return 0; } -static void +static int mo_challenge(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { sendto_one(source_p, form_str(RPL_YOUREOPER), me.name, source_p->name); + return 0; } -static struct Message challenge_msgtab = { +static struct Message challenge_msgtab = +{ "CHALLENGE", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_challenge, m_ignore, m_ignore, mo_challenge, m_ignore } }; @@ -208,7 +213,8 @@ module_exit(void) } #endif -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_close.c b/modules/m_close.c index 4395935..a8a30e6 100644 --- a/modules/m_close.c +++ b/modules/m_close.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_close.c: Closes all unregistered connections. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_close.c + * \brief Includes required functions for processing the CLOSE command. + * \version $Id$ */ #include "stdinc.h" @@ -36,7 +38,7 @@ * mo_close - CLOSE message handler * - added by Darren Reed Jul 13 1992. */ -static void +static int mo_close(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -52,7 +54,7 @@ mo_close(struct Client *client_p, struct Client *source_p, get_client_name(target_p, SHOW_IP), target_p->status); /* - * exit here is safe, because it is guaranteed not to be source_p + * Exit here is safe, because it is guaranteed not to be source_p * because it is unregistered and source_p is an oper. */ exit_client(target_p, target_p, "Oper Closing"); @@ -60,9 +62,11 @@ mo_close(struct Client *client_p, struct Client *source_p, sendto_one(source_p, form_str(RPL_CLOSEEND), me.name, source_p->name, closed); + return 0; } -static struct Message close_msgtab = { +static struct Message close_msgtab = +{ "CLOSE", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_not_oper, m_ignore, m_ignore, mo_close, m_ignore } }; @@ -79,7 +83,8 @@ module_exit(void) mod_del_cmd(&close_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_connect.c b/modules/m_connect.c index e7ece76..9f77e0e 100644 --- a/modules/m_connect.c +++ b/modules/m_connect.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_connect.c: Connects to a remote IRC server. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_connect.c + * \brief Includes required functions for processing the CONNECT command. + * \version $Id$ */ #include "stdinc.h" @@ -49,7 +51,7 @@ * parv[2] = port number * parv[3] = remote server */ -static void +static int mo_connect(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -62,7 +64,7 @@ mo_connect(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "CONNECT"); - return; + return 0; } if (parc > 3) @@ -71,18 +73,18 @@ mo_connect(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "connect:remote"); - return; + return 0; } if (hunt_server(client_p, source_p, ":%s CONNECT %s %s :%s", 3, parc, parv) != HUNTED_ISME) - return; + return 0; } else if (!HasOFlag(source_p, OPER_FLAG_CONNECT)) { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "connect"); - return; + return 0; } if ((target_p = hash_find_server(parv[1]))) @@ -90,11 +92,11 @@ mo_connect(struct Client *client_p, struct Client *source_p, sendto_one(source_p, ":%s NOTICE %s :Connect: Server %s already exists from %s.", me.name, source_p->name, parv[1], target_p->from->name); - return; + return 0; } /* - * try to find the name, then host, if both fail notify ops and bail + * Try to find the name, then host, if both fail notify ops and bail */ if (!(conf = find_matching_name_conf(CONF_SERVER, parv[1], NULL, NULL, 0))) { @@ -103,7 +105,7 @@ mo_connect(struct Client *client_p, struct Client *source_p, sendto_one(source_p, ":%s NOTICE %s :Connect: Host %s not listed in ircd.conf", me.name, source_p->name, parv[1]); - return; + return 0; } } @@ -120,21 +122,21 @@ mo_connect(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, ":%s NOTICE %s :Connect: Illegal port number", me.name, source_p->name); - return; + return 0; } } else if (port <= 0 && (port = PORTNUM) <= 0) { sendto_one(source_p, ":%s NOTICE %s :Connect: missing port number", me.name, source_p->name); - return; + return 0; } if (find_servconn_in_progress(conf->name)) { sendto_one(source_p, ":%s NOTICE %s :Connect: a connection to %s " "is already in progress.", me.name, source_p->name, conf->name); - return; + return 0; } /* @@ -146,7 +148,7 @@ mo_connect(struct Client *client_p, struct Client *source_p, conf->port = port; /* - * at this point we should be calling connect_server with a valid + * At this point we should be calling connect_server with a valid * C:line and a valid port in the C:line */ if (serv_connect(conf, source_p)) @@ -170,6 +172,7 @@ mo_connect(struct Client *client_p, struct Client *source_p, * destroyed */ conf->port = tmpport; + return 0; } /* @@ -183,7 +186,7 @@ mo_connect(struct Client *client_p, struct Client *source_p, * parv[2] = port number * parv[3] = remote server */ -static void +static int ms_connect(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -194,13 +197,13 @@ ms_connect(struct Client *client_p, struct Client *source_p, if (hunt_server(client_p, source_p, ":%s CONNECT %s %s :%s", 3, parc, parv) != HUNTED_ISME) - return; + return 0; if (EmptyString(parv[1])) { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "CONNECT"); - return; + return 0; } if ((target_p = hash_find_server(parv[1]))) @@ -208,11 +211,11 @@ ms_connect(struct Client *client_p, struct Client *source_p, sendto_one(source_p, ":%s NOTICE %s :Connect: Server %s already exists from %s.", me.name, source_p->name, parv[1], target_p->from->name); - return; + return 0; } /* - * try to find the name, then host, if both fail notify ops and bail + * Try to find the name, then host, if both fail notify ops and bail */ if (!(conf = find_matching_name_conf(CONF_SERVER, parv[1], NULL, NULL, 0))) { @@ -221,7 +224,7 @@ ms_connect(struct Client *client_p, struct Client *source_p, sendto_one(source_p, ":%s NOTICE %s :Connect: Host %s not listed in ircd.conf", me.name, source_p->name, parv[1]); - return; + return 0; } } @@ -237,7 +240,7 @@ ms_connect(struct Client *client_p, struct Client *source_p, port = atoi(parv[2]); /* - * if someone sends port 0, and we have a config port.. use it + * If someone sends port 0, and we have a config port.. use it */ if (port == 0 && conf->port) port = conf->port; @@ -245,21 +248,21 @@ ms_connect(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, ":%s NOTICE %s :Connect: Illegal port number", me.name, source_p->name); - return; + return 0; } } else if (port <= 0 && (port = PORTNUM) <= 0) { sendto_one(source_p, ":%s NOTICE %s :Connect: missing port number", me.name, source_p->name); - return; + return 0; } if (find_servconn_in_progress(conf->name)) { sendto_one(source_p, ":%s NOTICE %s :Connect: a connection to %s " "is already in progress.", me.name, source_p->name, conf->name); - return; + return 0; } /* @@ -294,9 +297,11 @@ ms_connect(struct Client *client_p, struct Client *source_p, * destroyed */ conf->port = tmpport; + return 0; } -static struct Message connect_msgtab = { +static struct Message connect_msgtab = +{ "CONNECT", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_not_oper, ms_connect, m_ignore, mo_connect, m_ignore } }; @@ -313,7 +318,8 @@ module_exit(void) mod_del_cmd(&connect_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_dline.c b/modules/m_dline.c index eae25ba..23791ba 100644 --- a/modules/m_dline.c +++ b/modules/m_dline.c @@ -136,7 +136,7 @@ remove_dline_match(const char *host) * side effects - D line is added * */ -static void +static int mo_dline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -158,12 +158,12 @@ mo_dline(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "dline"); - return; + return 0; } if (parse_aline("DLINE", source_p, parc, parv, AWILD, &dlhost, NULL, &tkline_time, &target_server, &reason) < 0) - return; + return 0; if (target_server != NULL) { @@ -173,7 +173,7 @@ mo_dline(struct Client *client_p, struct Client *source_p, /* Allow ON to apply local kline as well if it matches */ if (match(target_server, me.name)) - return; + return 0; } else cluster_a_line(source_p, "DLINE", CAP_DLN, SHARED_DLINE, @@ -182,21 +182,21 @@ mo_dline(struct Client *client_p, struct Client *source_p, if ((t = parse_netmask(dlhost, NULL, &bits)) == HM_HOST) { if ((target_p = find_chasing(source_p, dlhost, NULL)) == NULL) - return; + return 0; if (!MyConnect(target_p)) { sendto_one(source_p, ":%s NOTICE %s :Can't DLINE nick on another server", me.name, source_p->name); - return; + return 0; } if (IsExemptKline(target_p)) { sendto_one(source_p, ":%s NOTICE %s :%s is E-lined", me.name, source_p->name, target_p->name); - return; + return 0; } getnameinfo((struct sockaddr *)&target_p->localClient->ip, @@ -212,7 +212,7 @@ mo_dline(struct Client *client_p, struct Client *source_p, sendto_one(source_p, ":%s NOTICE %s :For safety, bitmasks less than 8 require conf access.", me.name, source_p->name); - return; + return 0; } #ifdef IPV6 @@ -234,14 +234,14 @@ mo_dline(struct Client *client_p, struct Client *source_p, else sendto_one(source_p, ":%s NOTICE %s :[%s] already D-lined by [%s] - %s", me.name, source_p->name, dlhost, conf->host, creason); - return; + return 0; } cur_time = CurrentTime; current_date = smalldate(cur_time); if (!valid_comment(source_p, reason, 1)) - return; + return 0; conf = conf_make(CONF_DLINE); conf->host = xstrdup(dlhost); @@ -255,9 +255,10 @@ mo_dline(struct Client *client_p, struct Client *source_p, conf->reason = xstrdup(buffer); apply_dline(source_p, conf, tkline_time); rehashed_klines = 1; + return 0; } -static void +static int ms_dline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -275,7 +276,7 @@ ms_dline(struct Client *client_p, struct Client *source_p, char buffer[IRCD_BUFSIZE]; if (parc != 5 || EmptyString(parv[4])) - return; + return 0; /* parv[0] parv[1] parv[2] parv[3] parv[4] */ /* oper target_server tkline_time host reason */ @@ -284,7 +285,7 @@ ms_dline(struct Client *client_p, struct Client *source_p, parv[1], parv[2], parv[3], parv[4]); if (match(parv[1], me.name)) - return; + return 0; tkline_time = valid_tkline(parv[2], TK_SECONDS); dlhost = parv[3]; @@ -296,18 +297,19 @@ ms_dline(struct Client *client_p, struct Client *source_p, SHARED_DLINE)) { if (!IsClient(source_p)) - return; + return 0; + if ((t = parse_netmask(dlhost, NULL, &bits)) == HM_HOST) { if ((target_p = find_chasing(source_p, dlhost, NULL)) == NULL) - return; + return 0; if (!MyConnect(target_p)) { sendto_one(source_p, ":%s NOTICE %s :Can't DLINE nick on another server", me.name, source_p->name); - return; + return 0; } if (IsExemptKline(target_p)) @@ -315,7 +317,7 @@ ms_dline(struct Client *client_p, struct Client *source_p, sendto_one(source_p, ":%s NOTICE %s :%s is E-lined", me.name, source_p->name, target_p->name); - return; + return 0; } getnameinfo((struct sockaddr *)&target_p->localClient->ip, @@ -331,7 +333,7 @@ ms_dline(struct Client *client_p, struct Client *source_p, sendto_one(source_p, ":%s NOTICE %s :For safety, bitmasks less than 8 require conf access.", me.name, source_p->name); - return; + return 0; } #ifdef IPV6 @@ -354,14 +356,14 @@ ms_dline(struct Client *client_p, struct Client *source_p, sendto_one(source_p, ":%s NOTICE %s :[%s] already D-lined by [%s] - %s", me.name, source_p->name, dlhost, conf->host, creason); - return; + return 0; } cur_time = CurrentTime; current_date = smalldate(cur_time); if (!valid_comment(source_p, reason, 1)) - return; + return 0; conf = conf_make(CONF_DLINE); conf->host = xstrdup(dlhost); @@ -376,6 +378,8 @@ ms_dline(struct Client *client_p, struct Client *source_p, apply_dline(source_p, conf, tkline_time); rehashed_klines = 1; } + + return 0; } /* @@ -387,7 +391,7 @@ ms_dline(struct Client *client_p, struct Client *source_p, ** parv[0] = sender nick ** parv[1] = dline to remove */ -static void +static int mo_undline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -398,19 +402,19 @@ mo_undline(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "undline"); - return; + return 0; } if (parc < 2 || EmptyString(parv[1])) { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "UNDLINE"); - return; + return 0; } if (parse_aline("UNDLINE", source_p, parc, parv, 0, &user, &addr, NULL, &target_server, NULL) < 0) - return; + return 0; if (target_server != NULL) { @@ -419,7 +423,7 @@ mo_undline(struct Client *client_p, struct Client *source_p, /* Allow ON to apply local unkline as well if it matches */ if (match(target_server, me.name)) - return; + return 0; } else cluster_a_line(source_p, "UNDLINE", CAP_UNDLN, SHARED_UNDLINE, @@ -438,21 +442,22 @@ mo_undline(struct Client *client_p, struct Client *source_p, else sendto_one(source_p, ":%s NOTICE %s :No D-Line for [%s] found", me.name, source_p->name, addr); + return 0; } -static void +static int me_undline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { const char *addr = NULL; if (parc != 3 || EmptyString(parv[2])) - return; + return 0; addr = parv[2]; if (!IsClient(source_p) || match(parv[1], me.name)) - return; + return 0; if (HasFlag(source_p, FLAGS_SERVICE) || find_matching_name_conf(CONF_ULINE, source_p->servptr->name, @@ -473,20 +478,22 @@ me_undline(struct Client *client_p, struct Client *source_p, sendto_one(source_p, ":%s NOTICE %s :No D-Line for [%s] found", me.name, source_p->name, addr); } + + return 0; } -static void +static int ms_undline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if (parc != 3 || EmptyString(parv[2])) - return; + return 0; sendto_match_servs(source_p, parv[1], CAP_UNDLN, "UNDLINE %s %s", parv[1], parv[2]); - me_undline(client_p, source_p, parc, parv); + return me_undline(client_p, source_p, parc, parv); } static struct Message dline_msgtab = diff --git a/modules/m_encap.c b/modules/m_encap.c index 70bb3d8..5390f62 100644 --- a/modules/m_encap.c +++ b/modules/m_encap.c @@ -40,7 +40,7 @@ * output - none * side effects - propagates subcommand to locally connected servers */ -static void +static int ms_encap(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -57,7 +57,7 @@ ms_encap(struct Client *client_p, struct Client *source_p, len = strlen(parv[i]) + 1; if ((cur_len + len) >= sizeof(buffer)) - return; + return 0; snprintf(ptr, sizeof(buffer) - cur_len, "%s ", parv[i]); cur_len += len; @@ -67,11 +67,10 @@ ms_encap(struct Client *client_p, struct Client *source_p, len = strlen(parv[i]); /* - * if the final parameter crosses our buffer size, should we bail, + * If the final parameter crosses our buffer size, should we bail, * like the rest, or should we truncate? ratbox seems to think truncate, * so i'll do that for now until i can talk to lee. -bill */ - if (parc == 3) snprintf(ptr, sizeof(buffer) - cur_len, "%s", parv[2]); else @@ -84,10 +83,10 @@ ms_encap(struct Client *client_p, struct Client *source_p, "ENCAP %s", buffer); if (match(parv[1], me.name)) - return; + return 0; if ((mptr = find_command(parv[2])) == NULL) - return; + return 0; #ifdef NOT_USED_YET paramcount = mptr->parameters; @@ -110,6 +109,7 @@ ms_encap(struct Client *client_p, struct Client *source_p, if ((handler = mptr->handlers[ENCAP_HANDLER])) (*handler)(client_p, source_p, parc, parv); + return 0; } static struct Message encap_msgtab = diff --git a/modules/m_eob.c b/modules/m_eob.c index e052488..46982cb 100644 --- a/modules/m_eob.c +++ b/modules/m_eob.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_eob.c: Signifies the end of a server burst. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 2000-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_eob.c + * \brief Includes required functions for processing the EOB command. + * \version $Id$ */ #include "stdinc.h" @@ -36,7 +38,7 @@ * parv[0] = sender prefix * parv[1] = servername */ -static void +static int ms_eob(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -54,11 +56,13 @@ ms_eob(struct Client *client_p, struct Client *source_p, ":%s EOB", ID(source_p)); sendto_server(client_p, NOCAPS, CAP_TS6, ":%s EOB", source_p->name); + return 0; } -static struct Message eob_msgtab = { +static struct Message eob_msgtab = +{ "EOB", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_ignore, ms_eob, m_ignore, m_ignore, m_ignore} + { m_unregistered, m_ignore, ms_eob, m_ignore, m_ignore, m_ignore } }; static void @@ -73,7 +77,8 @@ module_exit(void) mod_del_cmd(&eob_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_etrace.c b/modules/m_etrace.c index 88ab898..948db2c 100644 --- a/modules/m_etrace.c +++ b/modules/m_etrace.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_etrace.c: Traces a path to a client/server. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 2004-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_etrace.c + * \brief Includes required functions for processing the ETRACE command. + * \version $Id$ */ #include "stdinc.h" @@ -79,8 +81,8 @@ do_etrace(struct Client *source_p, int parc, char *parv[]) if (target_p && MyClient(target_p)) report_this_status(source_p, target_p); - - sendto_one(source_p, form_str(RPL_ENDOFTRACE), me.name, + + sendto_one(source_p, form_str(RPL_ENDOFTRACE), me.name, source_p->name, tname); return; } @@ -106,11 +108,12 @@ do_etrace(struct Client *source_p, int parc, char *parv[]) * parv[0] = sender prefix * parv[1] = servername */ -static void +static int mo_etrace(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { do_etrace(source_p, parc, parv); + return 0; } /* report_this_status() @@ -127,33 +130,34 @@ report_this_status(struct Client *source_p, struct Client *target_p) if (target_p->status == STAT_CLIENT) { if (ConfigFileEntry.hide_spoof_ips) - sendto_one(source_p, form_str(RPL_ETRACE), - me.name, - source_p->name, - HasUMode(target_p, UMODE_OPER) ? "Oper" : "User", - get_client_class(&target_p->localClient->confs), - target_p->name, - target_p->username, - target_p->host, - IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost, - target_p->info); + sendto_one(source_p, form_str(RPL_ETRACE), + me.name, + source_p->name, + HasUMode(target_p, UMODE_OPER) ? "Oper" : "User", + get_client_class(&target_p->localClient->confs), + target_p->name, + target_p->username, + target_p->host, + IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost, + target_p->info); else - sendto_one(source_p, form_str(RPL_ETRACE), - me.name, - source_p->name, - HasUMode(target_p, UMODE_OPER) ? "Oper" : "User", - get_client_class(&target_p->localClient->confs), - target_p->name, - target_p->username, - target_p->host, - target_p->sockhost, - target_p->info); + sendto_one(source_p, form_str(RPL_ETRACE), + me.name, + source_p->name, + HasUMode(target_p, UMODE_OPER) ? "Oper" : "User", + get_client_class(&target_p->localClient->confs), + target_p->name, + target_p->username, + target_p->host, + target_p->sockhost, + target_p->info); } } -static struct Message etrace_msgtab = { +static struct Message etrace_msgtab = +{ "ETRACE", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_not_oper, m_ignore, m_ignore, mo_etrace, m_ignore} + { m_unregistered, m_not_oper, m_ignore, m_ignore, mo_etrace, m_ignore } }; static void @@ -168,7 +172,8 @@ module_exit(void) mod_del_cmd(&etrace_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_gline.c b/modules/m_gline.c index 8326d03..1e79b9a 100644 --- a/modules/m_gline.c +++ b/modules/m_gline.c @@ -1,7 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ */ /*! \file m_gline.c - * \brief Includes required functions for processing the GLINE command. + * \brief Includes required functions for processing the GLINE/GUNGLINE command. * \version $Id$ */ @@ -366,7 +366,7 @@ do_sgline(struct Client *source_p, int parc, char *parv[], int prop) * - parv[1] = user\@host mask * - parv[2] = reason */ -static void +static int mo_gline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -379,19 +379,19 @@ mo_gline(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "gline"); - return; + return 0; } if (!ConfigFileEntry.glines) { sendto_one(source_p, ":%s NOTICE %s :GLINE disabled", me.name, source_p->name); - return; + return 0; } if (parse_aline("GLINE", source_p, parc, parv, AWILD, &user, &host, NULL, NULL, &reason) < 0) - return; + return 0; if ((p = strchr(host, '/')) != NULL) { @@ -402,7 +402,7 @@ mo_gline(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, ":%s NOTICE %s :Cannot set G-Lines with CIDR length < %d", me.name, source_p->name, min_bitlen); - return; + return 0; } } @@ -413,7 +413,7 @@ mo_gline(struct Client *client_p, struct Client *source_p, sendto_one(source_p, ":%s NOTICE %s :This server or oper has already voted", me.name, source_p->name); - return; + return 0; } /* @@ -434,6 +434,7 @@ mo_gline(struct Client *client_p, struct Client *source_p, sendto_server(NULL, CAP_GLN, CAP_TS6, ":%s GLINE %s %s :%s", source_p->name, user, host, reason); + return 0; } /* ms_gline() @@ -452,18 +453,20 @@ mo_gline(struct Client *client_p, struct Client *source_p, * ENCAP'd GLINES are propagated by encap code. */ -static void +static int ms_gline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { do_sgline(source_p, parc, parv, 1); + return 0; } -static void +static int me_gline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { do_sgline(source_p, parc, parv, 0); + return 0; } static void @@ -511,12 +514,13 @@ do_sungline(struct Client *source_p, const char *user, * - parv[2] = hostname * - parv[3] = reason */ -static void +static int me_gungline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if (ConfigFileEntry.glines) do_sungline(source_p, parv[1], parv[2], parv[3], 0); + return 0; } /*! \brief GUNGLINE command handler (called by operators) @@ -533,7 +537,7 @@ me_gungline(struct Client *client_p, struct Client *source_p, * - parv[1] = user\@host mask * - parv[2] = reason */ -static void +static int mo_gungline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -545,21 +549,22 @@ mo_gungline(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "gline"); - return; + return 0; } if (!ConfigFileEntry.glines) { sendto_one(source_p, ":%s NOTICE %s :GUNGLINE disabled", me.name, source_p->name); - return; + return 0; } if (parse_aline("GUNGLINE", source_p, parc, parv, 0, &user, &host, NULL, NULL, &reason) < 0) - return; + return 0; do_sungline(source_p, user, host, reason, 1); + return 0; } /* @@ -567,12 +572,14 @@ mo_gungline(struct Client *client_p, struct Client *source_p, * a gline is not valid with "No reason" * -db */ -static struct Message gline_msgtab = { +static struct Message gline_msgtab = +{ "GLINE", 0, 0, 3, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_not_oper, ms_gline, me_gline, mo_gline, m_ignore } }; -static struct Message ungline_msgtab = { +static struct Message ungline_msgtab = +{ "GUNGLINE", 0, 0, 3, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_not_oper, m_ignore, me_gungline, mo_gungline, m_ignore } }; @@ -593,7 +600,8 @@ module_exit(void) delete_capability("GLN"); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_globops.c b/modules/m_globops.c index 3e59501..ac00f2e 100644 --- a/modules/m_globops.c +++ b/modules/m_globops.c @@ -1,7 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 2011-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_globops.c + * \brief Includes required functions for processing the GLOBOPS command. + * \version $Id$ */ #include "stdinc.h" @@ -38,7 +41,7 @@ * parv[0] = sender prefix * parv[1] = message text */ -static void +static int mo_globops(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -48,31 +51,32 @@ mo_globops(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "globops"); - return; + return 0; } if (EmptyString(message)) { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "GLOBOPS"); - return; + return 0; } - sendto_server(NULL, CAP_TS6, NOCAPS, - ":%s GLOBOPS :%s", ID(source_p), message); - sendto_server(NULL, NOCAPS, CAP_TS6, - ":%s GLOBOPS :%s", source_p->name, message); + sendto_server(NULL, CAP_TS6, NOCAPS, ":%s GLOBOPS :%s", + ID(source_p), message); + sendto_server(NULL, NOCAPS, CAP_TS6, ":%s GLOBOPS :%s", + source_p->name, message); sendto_realops_flags(UMODE_ALL, L_ALL, SEND_GLOBAL, "from: %s: %s", source_p->name, message); + return 0; } -static void +static int ms_globops(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if (EmptyString(parv[1])) - return; + return 0; sendto_server(client_p, CAP_TS6, NOCAPS, ":%s GLOBOPS :%s", ID(source_p), parv[1]); @@ -81,9 +85,11 @@ ms_globops(struct Client *client_p, struct Client *source_p, sendto_realops_flags(UMODE_ALL, L_ALL, SEND_GLOBAL, "from: %s: %s", source_p->name, parv[1]); + return 0; } -static struct Message globops_msgtab = { +static struct Message globops_msgtab = +{ "GLOBOPS", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_not_oper, ms_globops, m_ignore, mo_globops, m_ignore } }; @@ -100,7 +106,8 @@ module_exit(void) mod_del_cmd(&globops_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_hash.c b/modules/m_hash.c index 0e4c54f..bdf0300 100644 --- a/modules/m_hash.c +++ b/modules/m_hash.c @@ -1,7 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_hash.c + * \brief Includes required functions for processing the HASH command. + * \version $Id$ */ #include "stdinc.h" @@ -36,7 +39,7 @@ #include "userhost.h" -static void +static int mo_hash(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -136,10 +139,12 @@ mo_hash(struct Client *client_p, struct Client *source_p, sendto_one(source_p, ":%s NOTICE %s :UserHost: entries: %u buckets: %u " "max chain: %u", me.name, source_p->name, count, buckets, max_chain); + return 0; } -static struct Message hash_msgtab = { - "HASH", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, +static struct Message hash_msgtab = +{ + "HASH", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_not_oper, m_ignore, m_ignore, mo_hash, m_ignore } }; @@ -155,7 +160,8 @@ module_exit(void) mod_del_cmd(&hash_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_help.c b/modules/m_help.c index 053e9fc..59e0805 100644 --- a/modules/m_help.c +++ b/modules/m_help.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_help.c: Provides help information to a user/operator. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1999-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_help.c + * \brief Includes required functions for processing the HELP command. + * \version $Id$ */ #include "stdinc.h" @@ -35,7 +37,7 @@ #define HELPLEN 400 -static void +static int sendhelpfile(struct Client *source_p, const char *path, const char *topic) { FILE *file = NULL; @@ -45,7 +47,7 @@ sendhelpfile(struct Client *source_p, const char *path, const char *topic) { sendto_one(source_p, form_str(ERR_HELPNOTFOUND), me.name, source_p->name, topic); - return; + return 0; } if (fgets(line, sizeof(line), file) == NULL) @@ -53,7 +55,7 @@ sendhelpfile(struct Client *source_p, const char *path, const char *topic) sendto_one(source_p, form_str(ERR_HELPNOTFOUND), me.name, source_p->name, topic); fclose(file); - return; + return 0; } line[strlen(line) - 1] = '\0'; @@ -71,9 +73,10 @@ sendhelpfile(struct Client *source_p, const char *path, const char *topic) fclose(file); sendto_one(source_p, form_str(RPL_ENDOFHELP), me.name, source_p->name, topic); + return 0; } -static void +static int dohelp(struct Client *source_p, char *topic) { char *p = topic; @@ -91,14 +94,14 @@ dohelp(struct Client *source_p, char *topic) { sendto_one(source_p, form_str(ERR_HELPNOTFOUND), me.name, source_p->name, topic); - return; + return 0; } if (strlen(HPATH) + strlen(topic) + 1 > HYB_PATH_MAX) { sendto_one(source_p, form_str(ERR_HELPNOTFOUND), me.name, source_p->name, topic); - return; + return 0; } snprintf(path, sizeof(path), "%s/%s", HPATH, topic); @@ -107,24 +110,24 @@ dohelp(struct Client *source_p, char *topic) { sendto_one(source_p, form_str(ERR_HELPNOTFOUND), me.name, source_p->name, topic); - return; + return 0; } if (!S_ISREG(sb.st_mode)) { sendto_one(source_p, form_str(ERR_HELPNOTFOUND), me.name, source_p->name, topic); - return; + return 0; } - sendhelpfile(source_p, path, topic); + return sendhelpfile(source_p, path, topic); } /* * m_help - HELP message handler * parv[0] = sender prefix */ -static void +static int m_help(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -136,28 +139,29 @@ m_help(struct Client *client_p, struct Client *source_p, /* safe enough to give this on a local connect only */ sendto_one(source_p,form_str(RPL_LOAD2HI), me.name, source_p->name); - return; + return 0; } last_used = CurrentTime; - dohelp(source_p, parv[1]); + return dohelp(source_p, parv[1]); } /* * mo_help - HELP message handler * parv[0] = sender prefix */ -static void +static int mo_help(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { - dohelp(source_p, parv[1]); + return dohelp(source_p, parv[1]); } -static struct Message help_msgtab = { +static struct Message help_msgtab = +{ "HELP", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_help, m_ignore, m_ignore, mo_help, m_ignore} + { m_unregistered, m_help, m_ignore, m_ignore, mo_help, m_ignore } }; static void @@ -172,7 +176,8 @@ module_exit(void) mod_del_cmd(&help_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_info.c b/modules/m_info.c index 8988e14..1c0b8a9 100644 --- a/modules/m_info.c +++ b/modules/m_info.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_info.c: Sends information about the server. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2005 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_info.c + * \brief Includes required functions for processing the INFO command. + * \version $Id$ */ #include "stdinc.h" @@ -649,7 +651,7 @@ send_conf_options(struct Client *source_p) * output - NONE * side effects - info text is sent to client */ -static void +static int send_info_text(struct Client *source_p) { const char **text = infotext; @@ -684,6 +686,7 @@ send_info_text(struct Client *source_p) sendto_one(source_p, form_str(RPL_ENDOFINFO), me.name, source_p->name); + return 0; } /* @@ -691,7 +694,7 @@ send_info_text(struct Client *source_p) ** parv[0] = sender prefix ** parv[1] = servername */ -static void +static int m_info(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -702,7 +705,7 @@ m_info(struct Client *client_p, struct Client *source_p, /* safe enough to give this on a local connect only */ sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name); - return; + return 0; } last_used = CurrentTime; @@ -710,9 +713,9 @@ m_info(struct Client *client_p, struct Client *source_p, if (!ConfigServerHide.disable_remote_commands) if (hunt_server(client_p,source_p, ":%s INFO :%s", 1, parc, parv) != HUNTED_ISME) - return; + return 0; - send_info_text(source_p); + return send_info_text(source_p); } /* @@ -720,18 +723,19 @@ m_info(struct Client *client_p, struct Client *source_p, ** parv[0] = sender prefix ** parv[1] = servername */ -static void +static int ms_info(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if (hunt_server(client_p, source_p, ":%s INFO :%s", 1, parc, parv) != HUNTED_ISME) - return; + return 0; - send_info_text(source_p); + return send_info_text(source_p); } -static struct Message info_msgtab = { +static struct Message info_msgtab = +{ "INFO", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_info, ms_info, m_ignore, ms_info, m_ignore } }; @@ -748,7 +752,8 @@ module_exit(void) mod_del_cmd(&info_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_invite.c b/modules/m_invite.c index 21c9ac9..914ce54 100644 --- a/modules/m_invite.c +++ b/modules/m_invite.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_invite.c: Invites the user to join a channel. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_invite.c + * \brief Includes required functions for processing the INVITE command. + * \version $Id$ */ #include "stdinc.h" @@ -46,7 +48,7 @@ ** parv[2] - channel name ** parv[3] - invite timestamp */ -static void +static int m_invite(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -55,13 +57,13 @@ m_invite(struct Client *client_p, struct Client *source_p, struct Membership *ms = NULL; if (IsServer(source_p)) - return; + return 0; if (EmptyString(parv[2])) { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "INVITE"); - return; + return 0; } if (MyClient(source_p) && !IsFloodDone(source_p)) @@ -71,35 +73,35 @@ m_invite(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, source_p->name, parv[1]); - return; + return 0; } if ((chptr = hash_find_channel(parv[2])) == NULL) { sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), me.name, source_p->name, parv[2]); - return; + return 0; } if (MyConnect(source_p) && (ms = find_channel_link(source_p, chptr)) == NULL) { sendto_one(source_p, form_str(ERR_NOTONCHANNEL), me.name, source_p->name, chptr->chname); - return; + return 0; } if (MyConnect(source_p) && !has_member_flags(ms, CHFL_CHANOP)) { sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED), me.name, source_p->name, chptr->chname); - return; + return 0; } if (IsMember(target_p, chptr)) { - sendto_one(source_p, form_str(ERR_USERONCHANNEL), - me.name, source_p->name, target_p->name, chptr->chname); - return; + sendto_one(source_p, form_str(ERR_USERONCHANNEL), me.name, + source_p->name, target_p->name, chptr->chname); + return 0; } if (MyConnect(source_p)) @@ -114,7 +116,7 @@ m_invite(struct Client *client_p, struct Client *source_p, } else if (parc > 3 && IsDigit(*parv[3])) if (atoi(parv[3]) > chptr->channelts) - return; + return 0; if (MyConnect(target_p)) { @@ -139,9 +141,11 @@ m_invite(struct Client *client_p, struct Client *source_p, ID_or_name(source_p, target_p->from), ID_or_name(target_p, target_p->from), chptr->chname, (unsigned long)chptr->channelts); + return 0; } -static struct Message invite_msgtab = { +static struct Message invite_msgtab = +{ "INVITE", 0, 0, 3, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_invite, m_invite, m_ignore, m_invite, m_ignore } }; @@ -158,7 +162,8 @@ module_exit(void) mod_del_cmd(&invite_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_ison.c b/modules/m_ison.c index 96e30e3..9a1b864 100644 --- a/modules/m_ison.c +++ b/modules/m_ison.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_ison.c: Provides a single line answer of whether a user is online. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_ison.c + * \brief Includes required functions for processing the ISON command. + * \version $Id$ */ #include "stdinc.h" @@ -41,7 +43,7 @@ * format: * ISON :nicklist */ -static void +static int m_ison(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -96,11 +98,13 @@ m_ison(struct Client *client_p, struct Client *source_p, *current_insert_point = '\0'; sendto_one(source_p, "%s", buf); + return 0; } -static struct Message ison_msgtab = { +static struct Message ison_msgtab = +{ "ISON", 0, 0, 2, 1, MFLG_SLOW, 0, - {m_unregistered, m_ison, m_ignore, m_ignore, m_ison, m_ignore} + { m_unregistered, m_ison, m_ignore, m_ignore, m_ison, m_ignore } }; static void @@ -115,7 +119,8 @@ module_exit(void) mod_del_cmd(&ison_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_kline.c b/modules/m_kline.c index f8e47df..d4617f2 100644 --- a/modules/m_kline.c +++ b/modules/m_kline.c @@ -222,7 +222,7 @@ already_placed_kline(struct Client *source_p, const char *luser, const char *lho * output - * side effects - k line is added */ -static void +static int mo_kline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -240,12 +240,12 @@ mo_kline(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "kline"); - return; + return 0; } if (parse_aline("KLINE", source_p, parc, parv, AWILD, &user, &host, &tkline_time, &target_server, &reason) < 0) - return; + return 0; if (target_server != NULL) { @@ -255,14 +255,14 @@ mo_kline(struct Client *client_p, struct Client *source_p, /* Allow ON to apply local kline as well if it matches */ if (match(target_server, me.name)) - return; + return 0; } else cluster_a_line(source_p, "KLINE", CAP_KLN, SHARED_KLINE, "%d %s %s :%s", tkline_time, user, host, reason); if (already_placed_kline(source_p, user, host, 1)) - return; + return 0; cur_time = CurrentTime; current_date = smalldate(cur_time); @@ -279,10 +279,11 @@ mo_kline(struct Client *client_p, struct Client *source_p, conf->reason = xstrdup(buffer); m_kline_add_kline(source_p, conf, tkline_time); + return 0; } /* me_kline - handle remote kline. no propagation */ -static void +static int me_kline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -294,10 +295,10 @@ me_kline(struct Client *client_p, struct Client *source_p, char *kuser, *khost, *kreason; if (parc != 6 || EmptyString(parv[5])) - return; + return 0; if (match(parv[1], me.name)) - return; + return 0; tkline_time = valid_tkline(parv[2], TK_SECONDS); kuser = parv[3]; @@ -314,7 +315,7 @@ me_kline(struct Client *client_p, struct Client *source_p, { if (!IsClient(source_p) || already_placed_kline(source_p, kuser, khost, 1)) - return; + return 0; conf = conf_make(CONF_KLINE); conf->host = xstrdup(khost); @@ -329,22 +330,23 @@ me_kline(struct Client *client_p, struct Client *source_p, conf->reason = xstrdup(buffer); m_kline_add_kline(source_p, conf, tkline_time); } + + return 0; } -static void +static int ms_kline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if (parc != 6 || EmptyString(parv[5])) - return; + return 0; /* parv[0] parv[1] parv[2] parv[3] parv[4] parv[5] */ /* oper target_server tkline_time user host reason */ - sendto_match_servs(source_p, parv[1], CAP_KLN, - "KLINE %s %s %s %s :%s", + sendto_match_servs(source_p, parv[1], CAP_KLN, "KLINE %s %s %s %s :%s", parv[1], parv[2], parv[3], parv[4], parv[5]); - me_kline(client_p, source_p, parc, parv); + return me_kline(client_p, source_p, parc, parv); } /* @@ -357,7 +359,7 @@ ms_kline(struct Client *client_p, struct Client *source_p, * * */ -static void +static int mo_unkline(struct Client *client_p,struct Client *source_p, int parc, char *parv[]) { @@ -368,19 +370,19 @@ mo_unkline(struct Client *client_p,struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "unkline"); - return; + return 0; } if (EmptyString(parv[1])) { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "UNKLINE"); - return; + return 0; } if (parse_aline("UNKLINE", source_p, parc, parv, 0, &user, &host, NULL, &target_server, NULL) < 0) - return; + return 0; if (target_server != NULL) { @@ -390,7 +392,7 @@ mo_unkline(struct Client *client_p,struct Client *source_p, /* Allow ON to apply local unkline as well if it matches */ if (match(target_server, me.name)) - return; + return 0; } else cluster_a_line(source_p, "UNKLINE", CAP_UNKLN, SHARED_UNKLINE, @@ -409,6 +411,7 @@ mo_unkline(struct Client *client_p,struct Client *source_p, else sendto_one(source_p, ":%s NOTICE %s :No K-Line for [%s@%s] found", me.name, source_p->name, user, host); + return 0; } /* me_unkline() @@ -421,20 +424,20 @@ mo_unkline(struct Client *client_p,struct Client *source_p, * side effects - if server is authorized, kline is removed * does not propagate message */ -static void +static int me_unkline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { const char *kuser, *khost; if (parc != 4) - return; + return 0; kuser = parv[2]; khost = parv[3]; if (!IsClient(source_p) || match(parv[1], me.name)) - return; + return 0; if (HasFlag(source_p, FLAGS_SERVICE) || find_matching_name_conf(CONF_ULINE, source_p->servptr->name, @@ -455,21 +458,23 @@ me_unkline(struct Client *client_p, struct Client *source_p, sendto_one(source_p, ":%s NOTICE %s :No K-Line for [%s@%s] found", me.name, source_p->name, kuser, khost); } + + return 0; } /* ms_unkline - propagates and handles a remote unkline message */ -static void +static int ms_unkline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if (parc != 4) - return; + return 0; sendto_match_servs(source_p, parv[1], CAP_UNKLN, "UNKLINE %s %s %s", parv[1], parv[2], parv[3]); - me_unkline(client_p, source_p, parc, parv); + return me_unkline(client_p, source_p, parc, parv); } static struct Message kline_msgtab = diff --git a/modules/m_knock.c b/modules/m_knock.c index 51bb53d..567fbb2 100644 --- a/modules/m_knock.c +++ b/modules/m_knock.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_knock.c: Requests to be invited to a channel. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1998-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_knock.c + * \brief Includes required functions for processing the KNOCK command. + * \version $Id$ */ #include "stdinc.h" @@ -53,7 +55,7 @@ * of these conditions. Concept by Dianora <db@db.net> and written by * <anonymous> */ -static void +static int m_knock(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -63,14 +65,14 @@ m_knock(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "KNOCK"); - return; + return 0; } if ((chptr = hash_find_channel(parv[1])) == NULL) { sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), me.name, source_p->name, parv[1]); - return; + return 0; } /* Normal channel, just be sure they aren't on it */ @@ -78,7 +80,7 @@ m_knock(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_KNOCKONCHAN), me.name, source_p->name, chptr->chname); - return; + return 0; } if (!((chptr->mode.mode & MODE_INVITEONLY) || (*chptr->mode.key) || @@ -87,7 +89,7 @@ m_knock(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_CHANOPEN), me.name, source_p->name, chptr->chname); - return; + return 0; } if (MyClient(source_p)) @@ -99,7 +101,7 @@ m_knock(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_CANNOTSENDTOCHAN), me.name, source_p->name, chptr->chname); - return; + return 0; } /* @@ -114,14 +116,14 @@ m_knock(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_TOOMANYKNOCK), me.name, source_p->name, chptr->chname, "user"); - return; + return 0; } if ((chptr->last_knock + ConfigChannel.knock_delay_channel) > CurrentTime) { sendto_one(source_p, form_str(ERR_TOOMANYKNOCK), me.name, source_p->name, chptr->chname, "channel"); - return; + return 0; } source_p->localClient->last_knock = CurrentTime; @@ -143,9 +145,11 @@ m_knock(struct Client *client_p, struct Client *source_p, ":%s KNOCK %s", ID(source_p), chptr->chname); sendto_server(client_p, CAP_KNOCK, CAP_TS6, ":%s KNOCK %s", source_p->name, chptr->chname); + return 0; } -static struct Message knock_msgtab = { +static struct Message knock_msgtab = +{ "KNOCK", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_knock, m_knock, m_ignore, m_knock, m_ignore } }; @@ -166,7 +170,8 @@ module_exit(void) delete_isupport("KNOCK"); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_links.c b/modules/m_links.c index 4078a2e..fa2c12f 100644 --- a/modules/m_links.c +++ b/modules/m_links.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_links.c: Shows what servers are currently connected. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_links.c + * \brief Includes required functions for processing the LINKS command. + * \version $Id$ */ #include "stdinc.h" @@ -72,7 +74,7 @@ do_links(struct Client *source_p, int parc, char *parv[]) /* * We just send the reply, as if they are here there's either no SHIDE, - * or they're an oper.. + * or they're an oper.. */ sendto_one(source_p, form_str(RPL_LINKS), me_name, nick, @@ -106,7 +108,7 @@ do_links(struct Client *source_p, int parc, char *parv[]) } } -static void +static int mo_links(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -114,9 +116,10 @@ mo_links(struct Client *client_p, struct Client *source_p, if (!ConfigServerHide.disable_remote_commands || HasUMode(source_p, UMODE_OPER)) if (hunt_server(client_p, source_p, ":%s LINKS %s :%s", 1, parc, parv) != HUNTED_ISME) - return; + return 0; do_links(source_p, parc, parv); + return 0; } /* @@ -125,10 +128,10 @@ mo_links(struct Client *client_p, struct Client *source_p, * parv[1] = servername mask * or * parv[0] = sender prefix - * parv[1] = server to query + * parv[1] = server to query * parv[2] = servername mask */ -static void +static int m_links(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -138,18 +141,16 @@ m_links(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name); - return; + return 0; } last_used = CurrentTime; if (!ConfigServerHide.flatten_links) - { - mo_links(client_p, source_p, parc, parv); - return; - } + return mo_links(client_p, source_p, parc, parv); do_links(source_p, parc, parv); + return 0; } /* @@ -158,23 +159,24 @@ m_links(struct Client *client_p, struct Client *source_p, * parv[1] = servername mask * or * parv[0] = sender prefix - * parv[1] = server to query + * parv[1] = server to query * parv[2] = servername mask */ -static void +static int ms_links(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if (hunt_server(client_p, source_p, ":%s LINKS %s :%s", 1, parc, parv) != HUNTED_ISME) - return; + return 0; - m_links(client_p, source_p, parc, parv); + return m_links(client_p, source_p, parc, parv); } -static struct Message links_msgtab = { +static struct Message links_msgtab = +{ "LINKS", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_links, ms_links, m_ignore, mo_links, m_ignore} + { m_unregistered, m_links, ms_links, m_ignore, mo_links, m_ignore } }; static void @@ -189,7 +191,8 @@ module_exit(void) mod_del_cmd(&links_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_list.c b/modules/m_list.c index c2258a0..6415a00 100644 --- a/modules/m_list.c +++ b/modules/m_list.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_list.c: List channel given or all channels. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_list.c + * \brief Includes required functions for processing the LIST command. + * \version $Id$ */ #include "stdinc.h" @@ -172,14 +174,16 @@ do_list(struct Client *source_p, int parc, char *parv[]) ** parv[0] = sender prefix ** parv[1] = channel */ -static void +static int m_list(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { do_list(source_p, parc, parv); + return 0; } -static struct Message list_msgtab = { +static struct Message list_msgtab = +{ "LIST", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_list, m_ignore, m_ignore, m_list, m_ignore } }; @@ -200,7 +204,8 @@ module_exit(void) delete_isupport("SAFELIST"); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_locops.c b/modules/m_locops.c index 708f457..f4c45a9 100644 --- a/modules/m_locops.c +++ b/modules/m_locops.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_locops.c: Sends a message to all operators on the local server. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_locops.c + * \brief Includes required functions for processing the LOCOPS command. + * \version $Id$ */ #include "stdinc.h" @@ -40,7 +42,7 @@ * parv[0] = sender prefix * parv[1] = message text */ -static void +static int mo_locops(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -50,27 +52,28 @@ mo_locops(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "locops"); - return; + return 0; } if (EmptyString(message)) { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "LOCOPS"); - return; + return 0; } sendto_realops_flags(UMODE_LOCOPS, L_ALL, SEND_LOCOPS, "from: %s: %s", source_p->name, message); cluster_a_line(source_p, "LOCOPS", 0, SHARED_LOCOPS, message); + return 0; } -static void +static int ms_locops(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if (parc != 3 || EmptyString(parv[2])) - return; + return 0; sendto_server(client_p, CAP_TS6|CAP_CLUSTER, NOCAPS, ":%s LOCOPS %s :%s", ID(source_p), parv[1], parv[2]); @@ -78,15 +81,17 @@ ms_locops(struct Client *client_p, struct Client *source_p, source_p->name, parv[1], parv[2]); if (!IsClient(source_p) || match(parv[1], me.name)) - return; + return 0; if (find_matching_name_conf(CONF_ULINE, source_p->servptr->name, "*", "*", SHARED_LOCOPS)) sendto_realops_flags(UMODE_LOCOPS, L_ALL, SEND_LOCOPS, "from: %s: %s", source_p->name, parv[2]); + return 0; } -static struct Message locops_msgtab = { +static struct Message locops_msgtab = +{ "LOCOPS", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_not_oper, ms_locops, m_ignore, mo_locops, m_ignore } }; @@ -103,7 +108,8 @@ module_exit(void) mod_del_cmd(&locops_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_lusers.c b/modules/m_lusers.c index 3fd23ce..77adc69 100644 --- a/modules/m_lusers.c +++ b/modules/m_lusers.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_lusers.c: Sends user statistics. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,16 +17,19 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_lusers.c + * \brief Includes required functions for processing the LUSERS command. + * \version $Id$ */ #include "stdinc.h" #include "client.h" #include "ircd.h" #include "numeric.h" -#include "s_serv.h" /* hunt_server */ -#include "s_user.h" /* show_lusers */ +#include "s_serv.h" +#include "s_user.h" #include "send.h" #include "conf.h" #include "parse.h" @@ -44,7 +46,7 @@ * * 2003 hacked parv[1] back in, by request of efnet admins/opers -Dianora */ -static void +static int m_lusers(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -54,7 +56,7 @@ m_lusers(struct Client *client_p, struct Client *source_p, { /* safe enough to give this on a local connect only */ sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name); - return; + return 0; } last_used = CurrentTime; @@ -62,9 +64,10 @@ m_lusers(struct Client *client_p, struct Client *source_p, if (parc > 2 && !ConfigServerHide.disable_remote_commands) if (hunt_server(client_p, source_p, ":%s LUSERS %s :%s", 2, parc, parv) != HUNTED_ISME) - return; + return 0; show_lusers(source_p); + return 0; } /* ms_lusers - LUSERS message handler for servers and opers @@ -72,21 +75,23 @@ m_lusers(struct Client *client_p, struct Client *source_p, * parv[1] = host/server mask. * parv[2] = server to query */ -static void +static int ms_lusers(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if (parc > 2) if (hunt_server(client_p, source_p, ":%s LUSERS %s :%s", 2, parc, parv) != HUNTED_ISME) - return; + return 0; show_lusers(source_p); + return 0; } -static struct Message lusers_msgtab = { +static struct Message lusers_msgtab = +{ "LUSERS", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_lusers, ms_lusers, m_ignore, ms_lusers, m_ignore} + { m_unregistered, m_lusers, ms_lusers, m_ignore, ms_lusers, m_ignore } }; static void @@ -101,7 +106,8 @@ module_exit(void) mod_del_cmd(&lusers_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_map.c b/modules/m_map.c index 8195037..36f0648 100644 --- a/modules/m_map.c +++ b/modules/m_map.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_map.c: Sends an Undernet compatible map to a user. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 2001-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_map.c + * \brief Includes required functions for processing the MAP command. + * \version $Id$ */ #include "stdinc.h" @@ -112,44 +114,44 @@ static void dump_map(struct Client *client, /* m_map() * parv[0] = sender prefix */ -static void +static int m_map(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { static time_t last_used = 0; if (ConfigServerHide.flatten_links) - { - m_not_oper(client_p, source_p, parc, parv); - return; - } + return m_not_oper(client_p, source_p, parc, parv); if ((last_used + ConfigFileEntry.pace_wait) > CurrentTime) { /* safe enough to give this on a local connect only */ sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name); - return; + return 0; } last_used = CurrentTime; dump_map(source_p, &me, 0); sendto_one(source_p, form_str(RPL_MAPEND), me.name, source_p->name); + return 0; } /* mo_map() * parv[0] = sender prefix */ -static void +static int mo_map(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { dump_map(source_p, &me, 0); sendto_one(source_p, form_str(RPL_MAPEND), me.name, source_p->name); + return 0; } -static struct Message map_msgtab = { +static struct Message map_msgtab = +{ "MAP", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_map, m_ignore, m_ignore, mo_map, m_ignore } }; @@ -166,7 +168,8 @@ module_exit(void) mod_del_cmd(&map_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_module.c b/modules/m_module.c index 307a873..2ae7d60 100644 --- a/modules/m_module.c +++ b/modules/m_module.c @@ -1,7 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 2000-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -54,7 +54,7 @@ * - parv[1] = action [LOAD, UNLOAD, RELOAD, LIST] * - parv[2] = module name */ -static void +static int mo_module(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -66,14 +66,14 @@ mo_module(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "module"); - return; + return 0; } if (EmptyString(parv[1])) { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "MODULE"); - return; + return 0; } if (!irccmp(parv[1], "LOAD")) @@ -82,18 +82,18 @@ mo_module(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "MODULE"); - return; + return 0; } - if (findmodule_byname((m_bn = libio_basename(parv[2]))) != NULL) + if (findmodule_byname((m_bn = libio_basename(parv[2])))) { sendto_one(source_p, ":%s NOTICE %s :Module %s is already loaded", me.name, source_p->name, m_bn); - return; + return 0; } load_one_module(parv[2]); - return; + return 0; } if (!irccmp(parv[1], "UNLOAD")) @@ -102,14 +102,14 @@ mo_module(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "MODULE"); - return; + return 0; } if ((modp = findmodule_byname((m_bn = libio_basename(parv[2])))) == NULL) { sendto_one(source_p, ":%s NOTICE %s :Module %s is not loaded", me.name, source_p->name, m_bn); - return; + return 0; } if (modp->flags & MODULE_FLAG_CORE) @@ -117,7 +117,7 @@ mo_module(struct Client *client_p, struct Client *source_p, sendto_one(source_p, ":%s NOTICE %s :Module %s is a core module and may not be unloaded", me.name, source_p->name, m_bn); - return; + return 0; } if (modp->flags & MODULE_FLAG_NOUNLOAD) @@ -125,13 +125,13 @@ mo_module(struct Client *client_p, struct Client *source_p, sendto_one(source_p, ":%s NOTICE %s :Module %s is a resident module and may not be unloaded", me.name, source_p->name, m_bn); - return; + return 0; } if (unload_one_module(m_bn, 1) == -1) sendto_one(source_p, ":%s NOTICE %s :Module %s is not loaded", me.name, source_p->name, m_bn); - return; + return 0; } if (!irccmp(parv[1], "RELOAD")) @@ -140,7 +140,7 @@ mo_module(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "MODULE"); - return; + return 0; } if (!strcmp(parv[2], "*")) @@ -170,14 +170,14 @@ mo_module(struct Client *client_p, struct Client *source_p, modnum, dlink_list_length(&modules_list)); ilog(LOG_TYPE_IRCD, "Module Restart: %u modules unloaded, %u modules loaded", modnum, dlink_list_length(&modules_list)); - return; + return 0; } if ((modp = findmodule_byname((m_bn = libio_basename(parv[2])))) == NULL) { sendto_one(source_p, ":%s NOTICE %s :Module %s is not loaded", me.name, source_p->name, m_bn); - return; + return 0; } if (modp->flags & MODULE_FLAG_NOUNLOAD) @@ -185,7 +185,7 @@ mo_module(struct Client *client_p, struct Client *source_p, sendto_one(source_p, ":%s NOTICE %s :Module %s is a resident module and may not be unloaded", me.name, source_p->name, m_bn); - return; + return 0; } check_core = (modp->flags & MODULE_FLAG_CORE) != 0; @@ -194,7 +194,7 @@ mo_module(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, ":%s NOTICE %s :Module %s is not loaded", me.name, source_p->name, m_bn); - return; + return 0; } if ((load_one_module(parv[2]) == -1) && check_core) @@ -206,7 +206,7 @@ mo_module(struct Client *client_p, struct Client *source_p, exit(0); } - return; + return 0; } if (!irccmp(parv[1], "LIST")) @@ -227,18 +227,20 @@ mo_module(struct Client *client_p, struct Client *source_p, sendto_one(source_p, form_str(RPL_ENDOFMODLIST), me.name, source_p->name); - return; + return 0; } sendto_one(source_p, ":%s NOTICE %s :%s is not a valid option. " "Choose from LOAD, UNLOAD, RELOAD, LIST", me.name, source_p->name, parv[1]); + return 0; } -static struct Message module_msgtab = { - "MODULE", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_not_oper, m_ignore, m_ignore, mo_module, m_ignore} +static struct Message module_msgtab = +{ + "MODULE", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, + { m_unregistered, m_not_oper, m_ignore, m_ignore, mo_module, m_ignore } }; static void @@ -253,7 +255,8 @@ module_exit(void) mod_del_cmd(&module_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_motd.c b/modules/m_motd.c index f84eeb4..42d788a 100644 --- a/modules/m_motd.c +++ b/modules/m_motd.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_motd.c: Shows the current message of the day. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_motd.c + * \brief Includes required functions for processing the MOTD command. + * \version $Id$ */ #include "stdinc.h" @@ -35,7 +37,7 @@ #include "conf.h" -static void +static int do_motd(struct Client *source_p) { sendto_realops_flags(UMODE_SPY, L_ALL, SEND_NOTICE, @@ -43,6 +45,7 @@ do_motd(struct Client *source_p) source_p->name, source_p->username, source_p->host, source_p->servptr->name); motd_send(source_p); + return 0; } /* @@ -50,7 +53,7 @@ do_motd(struct Client *source_p) ** parv[0] = sender prefix ** parv[1] = servername */ -static void +static int m_motd(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -61,7 +64,7 @@ m_motd(struct Client *client_p, struct Client *source_p, /* safe enough to give this on a local connect only */ sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name); - return; + return 0; } last_used = CurrentTime; @@ -70,9 +73,9 @@ m_motd(struct Client *client_p, struct Client *source_p, if (!ConfigServerHide.disable_remote_commands && !ConfigServerHide.hide_servers) if (hunt_server(client_p, source_p, ":%s MOTD :%s", 1, parc, parv) != HUNTED_ISME) - return; + return 0; - do_motd(source_p); + return do_motd(source_p); } /* @@ -88,18 +91,19 @@ m_motd(struct Client *client_p, struct Client *source_p, ** parv[0] = sender prefix ** parv[1] = servername */ -static void +static int mo_motd(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if (hunt_server(client_p, source_p, ":%s MOTD :%s", 1, parc, parv) != HUNTED_ISME) - return; + return 0; - do_motd(source_p); + return do_motd(source_p); } -static struct Message motd_msgtab = { +static struct Message motd_msgtab = +{ "MOTD", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_motd, mo_motd, m_ignore, mo_motd, m_ignore } }; @@ -116,7 +120,8 @@ module_exit(void) mod_del_cmd(&motd_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_names.c b/modules/m_names.c index 07cf820..7936084 100644 --- a/modules/m_names.c +++ b/modules/m_names.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_names.c: Shows the users who are online. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_names.c + * \brief Includes required functions for processing the NAMES command. + * \version $Id$ */ #include "stdinc.h" @@ -48,7 +50,7 @@ names_all_visible_channels(struct Client *source_p) { dlink_node *ptr = NULL; - /* + /* * First, do all visible channels (public and the one user self is) */ DLINK_FOREACH(ptr, global_channel_list.head) @@ -93,7 +95,7 @@ names_non_public_non_secret(struct Client *source_p) * channels with source_p, they have not been shown yet. */ DLINK_FOREACH(lp, c2ptr->channel.head) { - ch3ptr = ((struct Membership *) lp->data)->chptr; + ch3ptr = ((struct Membership *)lp->data)->chptr; if (IsMember(source_p, ch3ptr)) { @@ -133,7 +135,7 @@ names_non_public_non_secret(struct Client *source_p) ** parv[0] = sender prefix ** parv[1] = channel */ -static void +static int m_names(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -147,7 +149,7 @@ m_names(struct Client *client_p, struct Client *source_p, *s = '\0'; if (*para == '\0') - return; + return 0; if ((chptr = hash_find_channel(para)) != NULL) channel_member_names(source_p, chptr, 1); @@ -162,11 +164,14 @@ m_names(struct Client *client_p, struct Client *source_p, sendto_one(source_p, form_str(RPL_ENDOFNAMES), me.name, source_p->name, "*"); } + + return 0; } -static struct Message names_msgtab = { +static struct Message names_msgtab = +{ "NAMES", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_names, m_ignore, m_ignore, m_names, m_ignore} + { m_unregistered, m_names, m_ignore, m_ignore, m_names, m_ignore } }; static void @@ -181,7 +186,8 @@ module_exit(void) mod_del_cmd(&names_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_oper.c b/modules/m_oper.c index 976fdc4..003a342 100644 --- a/modules/m_oper.c +++ b/modules/m_oper.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_oper.c: Makes a user an IRC Operator. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_oper.c + * \brief Includes required functions for processing the OPER command. + * \version $Id$ */ #include "stdinc.h" @@ -67,7 +69,7 @@ failed_oper_notice(struct Client *source_p, const char *name, ** parv[1] = oper name ** parv[2] = oper password */ -static void +static int m_oper(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -79,7 +81,7 @@ m_oper(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "OPER"); - return; + return 0; } /* end the grace period */ @@ -92,14 +94,14 @@ m_oper(struct Client *client_p, struct Client *source_p, conf = find_exact_name_conf(CONF_OPER, NULL, name, NULL, NULL); failed_oper_notice(source_p, name, (conf != NULL) ? "host mismatch" : "no oper {} block"); - return; + return 0; } if (IsConfSSL(conf) && !HasUMode(source_p, UMODE_SSL)) { sendto_one(source_p, form_str(ERR_NOOPERHOST), me.name, source_p->name); failed_oper_notice(source_p, name, "requires SSL/TLS"); - return; + return 0; } if (!EmptyString(conf->certfp)) @@ -108,7 +110,7 @@ m_oper(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOOPERHOST), me.name, source_p->name); failed_oper_notice(source_p, name, "client certificate fingerprint mismatch"); - return; + return 0; } } @@ -119,7 +121,7 @@ m_oper(struct Client *client_p, struct Client *source_p, sendto_one(source_p, ":%s NOTICE %s :Can't attach conf!", me.name, source_p->name); failed_oper_notice(source_p, name, "can't attach conf!"); - return; + return 0; } ++conf->count; @@ -133,6 +135,8 @@ m_oper(struct Client *client_p, struct Client *source_p, sendto_one(source_p, form_str(ERR_PASSWDMISMATCH), me.name, source_p->name); failed_oper_notice(source_p, name, "password mismatch"); } + + return 0; } /* @@ -141,15 +145,17 @@ m_oper(struct Client *client_p, struct Client *source_p, ** parv[1] = oper name ** parv[2] = oper password */ -static void +static int mo_oper(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { sendto_one(source_p, form_str(RPL_YOUREOPER), me.name, source_p->name); + return 0; } -static struct Message oper_msgtab = { +static struct Message oper_msgtab = +{ "OPER", 0, 0, 3, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_oper, m_ignore, m_ignore, mo_oper, m_ignore } }; @@ -166,7 +172,8 @@ module_exit(void) mod_del_cmd(&oper_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_operwall.c b/modules/m_operwall.c index 4d81f1c..6114916 100644 --- a/modules/m_operwall.c +++ b/modules/m_operwall.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_operwall.c: Sends a message to all IRCOps. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_operwall.c + * \brief Includes required functions for processing the OPERWALL command. + * \version $Id$ */ #include "stdinc.h" @@ -40,7 +42,7 @@ * parv[0] = sender prefix * parv[1] = message text */ -static void +static int mo_operwall(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -50,21 +52,22 @@ mo_operwall(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "operwall"); - return; + return 0; } if (EmptyString(message)) { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "OPERWALL"); - return; + return 0; } - sendto_server(NULL, CAP_TS6, NOCAPS, - ":%s OPERWALL :%s", ID(source_p), message); - sendto_server(NULL, NOCAPS, CAP_TS6, - ":%s OPERWALL :%s", source_p->name, message); + sendto_server(NULL, CAP_TS6, NOCAPS, ":%s OPERWALL :%s", + ID(source_p), message); + sendto_server(NULL, NOCAPS, CAP_TS6, ":%s OPERWALL :%s", + source_p->name, message); sendto_wallops_flags(UMODE_OPERWALL, source_p, "OPERWALL - %s", message); + return 0; } /* @@ -73,20 +76,21 @@ mo_operwall(struct Client *client_p, struct Client *source_p, * parv[0] = sender prefix * parv[1] = message text */ -static void +static int ms_operwall(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { const char *message = parv[1]; if (EmptyString(message)) - return; + return 0; sendto_server(client_p, CAP_TS6, NOCAPS, ":%s OPERWALL :%s", ID(source_p), message); sendto_server(client_p, NOCAPS, CAP_TS6, ":%s OPERWALL :%s", source_p->name, message); sendto_wallops_flags(UMODE_OPERWALL, source_p, "OPERWALL - %s", message); + return 0; } /* @@ -97,21 +101,23 @@ ms_operwall(struct Client *client_p, struct Client *source_p, * * Lets ms_encap handle propagation. */ -static void +static int me_operwall(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { const char *message = parv[1]; if (EmptyString(message)) - return; + return 0; sendto_wallops_flags(UMODE_OPERWALL, source_p, "OPERWALL - %s", message); + return 0; } -static struct Message operwall_msgtab = { +static struct Message operwall_msgtab = +{ "OPERWALL", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_not_oper, ms_operwall, me_operwall, mo_operwall, m_ignore} + { m_unregistered, m_not_oper, ms_operwall, me_operwall, mo_operwall, m_ignore } }; static void @@ -126,7 +132,8 @@ module_exit(void) mod_del_cmd(&operwall_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_pass.c b/modules/m_pass.c index eda2ad0..a0985e6 100644 --- a/modules/m_pass.c +++ b/modules/m_pass.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_pass.c: Used to send a password for a server or client{} block. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,16 +17,19 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_pass.c + * \brief Includes required functions for processing the PASS command. + * \version $Id$ */ #include "stdinc.h" -#include "client.h" /* client struct */ -#include "irc_string.h" -#include "send.h" /* sendto_one */ -#include "numeric.h" /* ERR_xxx */ -#include "ircd.h" /* me */ +#include "client.h" +#include "irc_string.h" +#include "send.h" +#include "numeric.h" +#include "ircd.h" #include "parse.h" #include "modules.h" #include "s_serv.h" @@ -45,7 +47,7 @@ * parv[1] = password * parv[2] = optional extra version information */ -static void +static int mr_pass(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -55,7 +57,7 @@ mr_pass(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name[0] ? source_p->name : "*", "PASS"); - return; + return 0; } MyFree(source_p->localClient->passwd); @@ -63,18 +65,19 @@ mr_pass(struct Client *client_p, struct Client *source_p, if (parc > 2) { - /* It looks to me as if orabidoo wanted to have more + /* + * It looks to me as if orabidoo wanted to have more * than one set of option strings possible here... * i.e. ":AABBTS" as long as TS was the last two chars * however, as we are now using CAPAB, I think we can - * safely assume if there is a ":TS" then its a TS server + * safely assume if there is a ":TS" then it's a TS server * -Dianora */ if (!irccmp(parv[2], "TS") && source_p->tsinfo == 0) source_p->tsinfo = TS_DOESTS; } - /* only do this stuff if we are doing ts6 */ + /* Only do this stuff if we are doing ts6 */ if (parc > 4) { if (atoi(parv[3]) >= 6 && valid_sid(parv[4])) @@ -83,9 +86,12 @@ mr_pass(struct Client *client_p, struct Client *source_p, SetCapable(source_p, CAP_TS6); } } + + return 0; } -static struct Message pass_msgtab = { +static struct Message pass_msgtab = +{ "PASS", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, { mr_pass, m_registered, m_ignore, m_ignore, m_registered, mr_pass } }; @@ -102,7 +108,8 @@ module_exit(void) mod_del_cmd(&pass_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_ping.c b/modules/m_ping.c index dfc1a9a..1b969c0 100644 --- a/modules/m_ping.c +++ b/modules/m_ping.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_ping.c: Requests that a PONG message be sent back. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_ping.c + * \brief Includes required functions for processing the PING command. + * \version $Id$ */ #include "stdinc.h" @@ -41,28 +43,28 @@ ** parv[1] = origin ** parv[2] = destination */ -static void +static int m_ping(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { struct Client *target_p; - char *origin, *destination; + char *origin, *destination; if (parc < 2 || EmptyString(parv[1])) { sendto_one(source_p, form_str(ERR_NOORIGIN), me.name, source_p->name); - return; + return 0; } origin = parv[1]; - destination = parv[2]; /* Will get NULL or pointer (parc >= 2!!) */ + destination = parv[2]; /* Will get NULL or pointer (parc >= 2!!) */ if (ConfigServerHide.disable_remote_commands && !HasUMode(source_p, UMODE_OPER)) { sendto_one(source_p, ":%s PONG %s :%s", me.name, (destination) ? destination : me.name, origin); - return; + return 0; } if (!EmptyString(destination) && irccmp(destination, me.name) != 0) @@ -70,24 +72,20 @@ m_ping(struct Client *client_p, struct Client *source_p, /* We're sending it across servers.. origin == client_p->name --fl_ */ origin = client_p->name; - if ((target_p = hash_find_server(destination)) != NULL) - { + if ((target_p = hash_find_server(destination))) sendto_one(target_p, ":%s PING %s :%s", source_p->name, origin, destination); - } else - { sendto_one(source_p, form_str(ERR_NOSUCHSERVER), me.name, source_p->name, destination); - return; - } } else sendto_one(source_p, ":%s PONG %s :%s", me.name, (destination) ? destination : me.name, origin); + return 0; } -static void +static int ms_ping(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -98,11 +96,11 @@ ms_ping(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOORIGIN), me.name, source_p->name); - return; + return 0; } origin = source_p->name; - destination = parv[2]; /* Will get NULL or pointer (parc >= 2!!) */ + destination = parv[2]; /* Will get NULL or pointer (parc >= 2!!) */ if (!EmptyString(destination) && irccmp(destination, me.name) != 0 && irccmp(destination, me.id) != 0) { @@ -110,20 +108,19 @@ ms_ping(struct Client *client_p, struct Client *source_p, sendto_one(target_p, ":%s PING %s :%s", source_p->name, origin, destination); else - { - sendto_one(source_p, form_str(ERR_NOSUCHSERVER), - ID_or_name(&me, client_p), source_p->name, destination); - return; - } + sendto_one(source_p, form_str(ERR_NOSUCHSERVER), ID_or_name(&me, client_p), + source_p->name, destination); } else - sendto_one(source_p, ":%s PONG %s :%s", - ID_or_name(&me, client_p), (destination) ? destination : me.name, origin); + sendto_one(source_p, ":%s PONG %s :%s", ID_or_name(&me, client_p), + (destination) ? destination : me.name, origin); + return 0; } -static struct Message ping_msgtab = { +static struct Message ping_msgtab = +{ "PING", 0, 0, 1, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_ping, ms_ping, m_ignore, m_ping, m_ping} + { m_unregistered, m_ping, ms_ping, m_ignore, m_ping, m_ping } }; static void diff --git a/modules/m_pong.c b/modules/m_pong.c index 6d472f7..05d86be 100644 --- a/modules/m_pong.c +++ b/modules/m_pong.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_pong.c: The reply to a ping message. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,15 +17,18 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_pong.c + * \brief Includes required functions for processing the PONG command. + * \version $Id$ */ #include "stdinc.h" #include "ircd.h" #include "s_user.h" #include "client.h" -#include "hash.h" /* for find_client() */ +#include "hash.h" #include "numeric.h" #include "conf.h" #include "send.h" @@ -35,7 +37,7 @@ #include "modules.h" -static void +static int ms_pong(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -46,7 +48,7 @@ ms_pong(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOORIGIN), me.name, source_p->name); - return; + return 0; } origin = parv[1]; @@ -66,15 +68,14 @@ ms_pong(struct Client *client_p, struct Client *source_p, sendto_one(target_p, ":%s PONG %s %s", source_p->name, origin, destination); else - { sendto_one(source_p, form_str(ERR_NOSUCHSERVER), me.name, source_p->name, destination); - return; - } } + + return 0; } -static void +static int mr_pong(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -94,22 +95,21 @@ mr_pong(struct Client *client_p, struct Client *source_p, register_local_user(source_p); } else - { sendto_one(source_p, form_str(ERR_WRONGPONG), me.name, source_p->name, source_p->localClient->random_ping); - return; - } } } } else sendto_one(source_p, form_str(ERR_NOORIGIN), me.name, source_p->name); + return 0; } -static struct Message pong_msgtab = { +static struct Message pong_msgtab = +{ "PONG", 0, 0, 1, MAXPARA, MFLG_SLOW, 0, - {mr_pong, m_ignore, ms_pong, m_ignore, m_ignore, m_ignore} + { mr_pong, m_ignore, ms_pong, m_ignore, m_ignore, m_ignore } }; static void @@ -124,7 +124,8 @@ module_exit(void) mod_del_cmd(&pong_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_post.c b/modules/m_post.c index 7dade59..e0c8ae0 100644 --- a/modules/m_post.c +++ b/modules/m_post.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_post.c: Exits the user if unregistered, it is a web form. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2001-2002 Hybrid Development Team + * Copyright (c) 2001-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_post.c + * \brief Includes required functions for processing the POST/GET/PUT command. + * \version $Id$ */ #include "stdinc.h" @@ -35,7 +37,7 @@ ** parv[0] = sender prefix ** parv[1] = comment */ -static void +static int mr_dumb_proxy(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -43,21 +45,25 @@ mr_dumb_proxy(struct Client *client_p, struct Client *source_p, "HTTP Proxy disconnected: [%s@%s]", client_p->username, client_p->host); exit_client(source_p, source_p, "Client Exit"); + return 0; } -static struct Message post_msgtab = { +static struct Message post_msgtab = +{ "POST", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, - {mr_dumb_proxy, m_ignore, m_ignore, m_ignore, m_ignore, m_ignore} + { mr_dumb_proxy, m_ignore, m_ignore, m_ignore, m_ignore, m_ignore } }; -static struct Message get_msgtab = { +static struct Message get_msgtab = +{ "GET", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, - {mr_dumb_proxy, m_ignore, m_ignore, m_ignore, m_ignore, m_ignore} + { mr_dumb_proxy, m_ignore, m_ignore, m_ignore, m_ignore, m_ignore } }; -static struct Message put_msgtab = { +static struct Message put_msgtab = +{ "PUT", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, - {mr_dumb_proxy, m_ignore, m_ignore, m_ignore, m_ignore, m_ignore} + { mr_dumb_proxy, m_ignore, m_ignore, m_ignore, m_ignore, m_ignore } }; static void @@ -76,7 +82,8 @@ module_exit(void) mod_del_cmd(&put_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_rehash.c b/modules/m_rehash.c index d039def..42861e6 100644 --- a/modules/m_rehash.c +++ b/modules/m_rehash.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_rehash.c: Re-reads the configuration file. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_rehash.c + * \brief Includes required functions for processing the REHASH command. + * \version $Id$ */ #include "stdinc.h" @@ -41,7 +43,7 @@ * mo_rehash - REHASH message handler * */ -static void +static int mo_rehash(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -51,7 +53,7 @@ mo_rehash(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "rehash"); - return; + return 0; } if (!EmptyString(parv[1])) @@ -76,18 +78,12 @@ mo_rehash(struct Client *client_p, struct Client *source_p, } if (found) - { ilog(LOG_TYPE_IRCD, "REHASH %s From %s", parv[1], get_oper_name(source_p)); - return; - } else - { sendto_one(source_p, ":%s NOTICE %s :%s is not a valid option. " "Choose from DNS, MOTD", me.name, source_p->name, parv[1]); - return; - } } else { @@ -100,11 +96,14 @@ mo_rehash(struct Client *client_p, struct Client *source_p, get_oper_name(source_p)); rehash(0); } + + return 0; } -static struct Message rehash_msgtab = { +static struct Message rehash_msgtab = +{ "REHASH", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_not_oper, m_ignore, m_ignore, mo_rehash, m_ignore} + { m_unregistered, m_not_oper, m_ignore, m_ignore, mo_rehash, m_ignore } }; static void @@ -119,7 +118,8 @@ module_exit(void) mod_del_cmd(&rehash_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_restart.c b/modules/m_restart.c index 50e91ea..e5c5995 100644 --- a/modules/m_restart.c +++ b/modules/m_restart.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_restart.c: Exits and re-runs ircd. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_restart.c + * \brief Includes required functions for processing the RESTART command. + * \version $Id$ */ #include "stdinc.h" @@ -38,39 +40,41 @@ * mo_restart * */ -static void +static int mo_restart(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { - char buf[IRCD_BUFSIZE]; + char buf[IRCD_BUFSIZE]; if (!HasOFlag(source_p, OPER_FLAG_RESTART)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), - me.name, source_p->name, "restart"); - return; + sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, + source_p->name, "restart"); + return 0; } if (EmptyString(parv[1])) { sendto_one(source_p, ":%s NOTICE %s :Need server name /restart %s", me.name, source_p->name, me.name); - return; + return 0; } if (irccmp(parv[1], me.name)) { sendto_one(source_p, ":%s NOTICE %s :Mismatch on /restart %s", me.name, source_p->name, me.name); - return; + return 0; } snprintf(buf, sizeof(buf), "received RESTART command from %s", get_oper_name(source_p)); server_die(buf, 1); + return 0; } -static struct Message restart_msgtab = { +static struct Message restart_msgtab = +{ "RESTART", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_not_oper, m_ignore, m_ignore, mo_restart, m_ignore } }; @@ -87,7 +91,8 @@ module_exit(void) mod_del_cmd(&restart_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_resv.c b/modules/m_resv.c index 945bee0..e40ea5c 100644 --- a/modules/m_resv.c +++ b/modules/m_resv.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_resv.c: Reserves(jupes) a nickname or channel. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2001-2002 Hybrid Development Team + * Copyright (c) 2001-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_resv.c + * \brief Includes required functions for processing the RESV/UNRESV command. + * \version $Id$ */ #include "stdinc.h" @@ -46,7 +48,7 @@ static void remove_resv(struct Client *, const char *); * parv[0] = sender prefix * parv[1] = channel/nick to forbid */ -static void +static int mo_resv(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -58,24 +60,24 @@ mo_resv(struct Client *client_p, struct Client *source_p, /* RESV #channel ON irc.server.com :abuse * RESV kiddie ON irc.server.com :abuse */ - if (parse_aline("RESV", source_p, parc, parv, - AWILD, &resv, NULL, &tkline_time, &target_server, &reason) < 0) - return; + if (parse_aline("RESV", source_p, parc, parv, AWILD, &resv, NULL, + &tkline_time, &target_server, &reason) < 0) + return 0; if (target_server != NULL) { /* if a given expire time is given, ENCAP it */ if (tkline_time != 0) sendto_match_servs(source_p, target_server, CAP_ENCAP, - "ENCAP %s RESV %d %s 0 :%s", - target_server, (int)tkline_time, resv, reason); + "ENCAP %s RESV %d %s 0 :%s", + target_server, (int)tkline_time, resv, reason); else sendto_match_servs(source_p, target_server, CAP_CLUSTER, - "RESV %s %s :%s", - target_server, resv, reason); + "RESV %s %s :%s", + target_server, resv, reason); /* Allow ON to apply local resv as well if it matches */ if (match(target_server, me.name)) - return; + return 0; } else { @@ -84,13 +86,14 @@ mo_resv(struct Client *client_p, struct Client *source_p, */ if (tkline_time != 0) cluster_a_line(source_p, "ENCAP", CAP_ENCAP, SHARED_RESV, - "RESV %d %s 0 : %s", (int)tkline_time, resv, reason); + "RESV %d %s 0 : %s", (int)tkline_time, resv, reason); else cluster_a_line(source_p, "RESV", CAP_KLN, SHARED_RESV, - "%s : %s", resv, reason); + "%s : %s", resv, reason); } parse_resv(source_p, resv, (int)tkline_time, reason); + return 0; } /* me_resv() @@ -110,14 +113,15 @@ mo_resv(struct Client *client_p, struct Client *source_p, * outputs - NONE * side effects - */ -static void +static int me_resv(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if (parc != 5 || !IsClient(source_p)) - return; + return 0; parse_resv(source_p, parv[2], atoi(parv[1]), parv[4]); + return 0; } /* ms_resv() @@ -126,31 +130,32 @@ me_resv(struct Client *client_p, struct Client *source_p, * parv[2] = channel/nick to resv * parv[3] = reason */ -static void +static int ms_resv(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if ((parc != 4) || EmptyString(parv[3])) - return; + return 0; sendto_match_servs(source_p, parv[1], CAP_CLUSTER, "RESV %s %s :%s", parv[1], parv[2], parv[3]); if (!IsClient(source_p) || match(parv[1], me.name)) - return; + return 0; if (HasFlag(source_p, FLAGS_SERVICE) || find_matching_name_conf(CONF_ULINE, source_p->servptr->name, source_p->username, source_p->host, SHARED_RESV)) parse_resv(source_p, parv[2], 0, parv[3]); + return 0; } /* mo_unresv() * parv[0] = sender prefix * parv[1] = channel/nick to unforbid */ -static void +static int mo_unresv(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -160,9 +165,9 @@ mo_unresv(struct Client *client_p, struct Client *source_p, /* UNRESV #channel ON irc.server.com */ /* UNRESV kiddie ON irc.server.com */ - if (parse_aline("UNRESV", source_p, parc, parv, - 0, &resv, NULL, NULL, &target_server, &reason) < 0) - return; + if (parse_aline("UNRESV", source_p, parc, parv, 0, &resv, NULL, + NULL, &target_server, &reason) < 0) + return 0; if (target_server != NULL) { @@ -172,12 +177,13 @@ mo_unresv(struct Client *client_p, struct Client *source_p, /* Allow ON to apply local unresv as well if it matches */ if (match(target_server, me.name)) - return; + return 0; } - else + else cluster_a_line(source_p, "UNRESV", CAP_KLN, SHARED_UNRESV, resv); remove_resv(source_p, resv); + return 0; } /* ms_unresv() @@ -185,24 +191,25 @@ mo_unresv(struct Client *client_p, struct Client *source_p, * parv[1] = target server * parv[2] = resv to remove */ -static void +static int ms_unresv(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if ((parc != 3) || EmptyString(parv[2])) - return; + return 0; sendto_match_servs(source_p, parv[1], CAP_CLUSTER, "UNRESV %s %s", parv[1], parv[2]); if (!IsClient(source_p) || match(parv[1], me.name)) - return; + return 0; if (HasFlag(source_p, FLAGS_SERVICE) || find_matching_name_conf(CONF_ULINE, source_p->servptr->name, source_p->username, source_p->host, SHARED_UNRESV)) remove_resv(source_p, parv[2]); + return 0; } /* parse_resv() @@ -224,8 +231,8 @@ parse_resv(struct Client *source_p, char *name, int tkline_time, char *reason) if ((conf = create_resv(name, reason, NULL)) == NULL) { sendto_one(source_p, - ":%s NOTICE %s :A RESV has already been placed on channel: %s", - me.name, source_p->name, name); + ":%s NOTICE %s :A RESV has already been placed on channel: %s", + me.name, source_p->name, name); return; } @@ -235,32 +242,31 @@ parse_resv(struct Client *source_p, char *name, int tkline_time, char *reason) if (tkline_time != 0) { sendto_one(source_p, - ":%s NOTICE %s :A %d minute %s RESV has been placed on channel: %s", - me.name, source_p->name, - tkline_time/60, + ":%s NOTICE %s :A %d minute %s RESV has been placed on channel: %s", + me.name, source_p->name, tkline_time/60, (MyClient(source_p) ? "local" : "remote"), name); sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, - "%s has placed a %d minute %s RESV on channel: %s [%s]", - get_oper_name(source_p), - tkline_time/60, - (MyClient(source_p) ? "local" : "remote"), - conf->name, conf->reason); + "%s has placed a %d minute %s RESV on channel: %s [%s]", + get_oper_name(source_p), + tkline_time/60, + (MyClient(source_p) ? "local" : "remote"), + conf->name, conf->reason); ilog(LOG_TYPE_RESV, "%s added temporary %d min. RESV for [%s] [%s]", - source_p->name, (int)tkline_time/60, - conf->name, conf->reason); + source_p->name, (int)tkline_time/60, + conf->name, conf->reason); conf->until = CurrentTime + tkline_time; } else { sendto_one(source_p, - ":%s NOTICE %s :A %s RESV has been placed on channel %s", + ":%s NOTICE %s :A %s RESV has been placed on channel %s", me.name, source_p->name, - (MyClient(source_p) ? "local" : "remote"), name); + (MyClient(source_p) ? "local" : "remote"), name); sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, - "%s has placed a %s RESV on channel %s : [%s]", - get_oper_name(source_p), - (MyClient(source_p) ? "local" : "remote"), - conf->name, conf->reason); + "%s has placed a %s RESV on channel %s : [%s]", + get_oper_name(source_p), + (MyClient(source_p) ? "local" : "remote"), + conf->name, conf->reason); } } else @@ -295,34 +301,31 @@ parse_resv(struct Client *source_p, char *name, int tkline_time, char *reason) if (tkline_time != 0) { sendto_one(source_p, - ":%s NOTICE %s :A %d minute %s RESV has been placed on nick %s : [%s]", - me.name, source_p->name, - tkline_time/60, + ":%s NOTICE %s :A %d minute %s RESV has been placed on nick %s : [%s]", + me.name, source_p->name, tkline_time/60, (MyClient(source_p) ? "local" : "remote"), conf->name, conf->reason); sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, - "%s has placed a %d minute %s RESV on nick %s : [%s]", - get_oper_name(source_p), - tkline_time/60, - (MyClient(source_p) ? "local" : "remote"), - conf->name, conf->reason); + "%s has placed a %d minute %s RESV on nick %s : [%s]", + get_oper_name(source_p), tkline_time/60, + (MyClient(source_p) ? "local" : "remote"), + conf->name, conf->reason); ilog(LOG_TYPE_RESV, "%s added temporary %d min. RESV for [%s] [%s]", - source_p->name, (int)tkline_time/60, - conf->name, conf->reason); + source_p->name, (int)tkline_time/60, conf->name, conf->reason); conf->until = CurrentTime + tkline_time; } else { sendto_one(source_p, - ":%s NOTICE %s :A %s RESV has been placed on nick %s : [%s]", + ":%s NOTICE %s :A %s RESV has been placed on nick %s : [%s]", me.name, source_p->name, (MyClient(source_p) ? "local" : "remote"), conf->name, conf->reason); sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, - "%s has placed a %s RESV on nick %s : [%s]", - get_oper_name(source_p), - (MyClient(source_p) ? "local" : "remote"), - conf->name, conf->reason); + "%s has placed a %s RESV on nick %s : [%s]", + get_oper_name(source_p), + (MyClient(source_p) ? "local" : "remote"), + conf->name, conf->reason); } } } @@ -388,12 +391,14 @@ remove_resv(struct Client *source_p, const char *name) } } -static struct Message resv_msgtab = { +static struct Message resv_msgtab = +{ "RESV", 0, 0, 3, MAXPARA, MFLG_SLOW, 0, { m_ignore, m_not_oper, ms_resv, me_resv, mo_resv, m_ignore } }; -static struct Message unresv_msgtab = { +static struct Message unresv_msgtab = +{ "UNRESV", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, { m_ignore, m_not_oper, ms_unresv, m_ignore, mo_unresv, m_ignore } }; @@ -412,7 +417,8 @@ module_exit(void) mod_del_cmd(&unresv_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_services.c b/modules/m_services.c index ce93ba1..43ed37f 100644 --- a/modules/m_services.c +++ b/modules/m_services.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 1999 by the Bahamut Development Team. - * Copyright (C) 2011 by the Hybrid Development Team. + * Copyright (c) 2005-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +20,7 @@ */ /*! \file m_services.c - * \brief Provides service aliases + * \brief Includes required functions for processing the CS/NS/MS/OS/BS services command. * \version $Id$ */ @@ -45,7 +44,7 @@ * Configureable aliases will get implemented. */ -static void +static int m_nickserv(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -58,21 +57,22 @@ m_nickserv(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOTEXTTOSEND), me.name, source_p->name); - return; + return 0; } if ((target_p = hash_find_server(ConfigFileEntry.service_name))) { sendto_one(target_p, ":%s PRIVMSG NickServ@%s :%s", source_p->name, ConfigFileEntry.service_name, parv[1]); - return; + return 0; } sendto_one(source_p, form_str(ERR_SERVICESDOWN), me.name, source_p->name, "NickServ"); + return 0; } -static void +static int m_chanserv(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -85,21 +85,22 @@ m_chanserv(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOTEXTTOSEND), me.name, source_p->name); - return; + return 0; } if ((target_p = hash_find_server(ConfigFileEntry.service_name))) { sendto_one(target_p, ":%s PRIVMSG ChanServ@%s :%s", source_p->name, ConfigFileEntry.service_name, parv[1]); - return; + return 0; } sendto_one(source_p, form_str(ERR_SERVICESDOWN), me.name, source_p->name, "ChanServ"); + return 0; } -static void +static int m_memoserv(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -112,21 +113,22 @@ m_memoserv(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOTEXTTOSEND), me.name, source_p->name); - return; + return 0; } if ((target_p = hash_find_server(ConfigFileEntry.service_name))) { sendto_one(target_p, ":%s PRIVMSG MemoServ@%s :%s", source_p->name, ConfigFileEntry.service_name, parv[1]); - return; + return 0; } sendto_one(source_p, form_str(ERR_SERVICESDOWN), me.name, source_p->name, "MemoServ"); + return 0; } -static void +static int m_operserv(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -139,21 +141,22 @@ m_operserv(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOTEXTTOSEND), me.name, source_p->name); - return; + return 0; } if ((target_p = hash_find_server(ConfigFileEntry.service_name))) { sendto_one(target_p, ":%s PRIVMSG OperServ@%s :%s", source_p->name, ConfigFileEntry.service_name, parv[1]); - return; + return 0; } sendto_one(source_p, form_str(ERR_SERVICESDOWN), me.name, source_p->name, "OperServ"); + return 0; } -static void +static int m_statserv(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -166,21 +169,22 @@ m_statserv(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOTEXTTOSEND), me.name, source_p->name); - return; + return 0; } if ((target_p = hash_find_server(ConfigFileEntry.service_name))) { sendto_one(target_p, ":%s PRIVMSG StatServ@%s :%s", source_p->name, ConfigFileEntry.service_name, parv[1]); - return; + return 0; } sendto_one(source_p, form_str(ERR_SERVICESDOWN), me.name, source_p->name, "StatServ"); + return 0; } -static void +static int m_hostserv(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -193,21 +197,22 @@ m_hostserv(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOTEXTTOSEND), me.name, source_p->name); - return; + return 0; } if ((target_p = hash_find_server(ConfigFileEntry.service_name))) { sendto_one(target_p, ":%s PRIVMSG HostServ@%s :%s", source_p->name, ConfigFileEntry.service_name, parv[1]); - return; + return 0; } sendto_one(source_p, form_str(ERR_SERVICESDOWN), me.name, source_p->name, "HelpServ"); + return 0; } -static void +static int m_botserv(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -220,89 +225,104 @@ m_botserv(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOTEXTTOSEND), me.name, source_p->name); - return; + return 0; } if ((target_p = hash_find_server(ConfigFileEntry.service_name))) { sendto_one(target_p, ":%s PRIVMSG BotServ@%s :%s", source_p->name, ConfigFileEntry.service_name, parv[1]); - return; + return 0; } sendto_one(source_p, form_str(ERR_SERVICESDOWN), me.name, source_p->name, "BotServ"); + return 0; } -static struct Message ms_msgtab = { +static struct Message ms_msgtab = +{ "MS", 0, 0, 0, 1, MFLG_SLOW, 0, - {m_unregistered, m_memoserv, m_ignore, m_ignore, m_memoserv, m_ignore} + { m_unregistered, m_memoserv, m_ignore, m_ignore, m_memoserv, m_ignore } }; -static struct Message ns_msgtab = { +static struct Message ns_msgtab = +{ "NS", 0, 0, 0, 1, MFLG_SLOW, 0, - {m_unregistered, m_nickserv, m_ignore, m_ignore, m_nickserv, m_ignore} + { m_unregistered, m_nickserv, m_ignore, m_ignore, m_nickserv, m_ignore } }; -static struct Message os_msgtab = { +static struct Message os_msgtab = +{ "OS", 0, 0, 0, 1, MFLG_SLOW, 0, - {m_unregistered, m_operserv, m_ignore, m_ignore, m_operserv, m_ignore} + { m_unregistered, m_operserv, m_ignore, m_ignore, m_operserv, m_ignore } }; -static struct Message bs_msgtab = { +static struct Message bs_msgtab = +{ "BS", 0, 0, 0, 1, MFLG_SLOW, 0, - {m_unregistered, m_botserv, m_ignore, m_ignore, m_botserv, m_ignore} + { m_unregistered, m_botserv, m_ignore, m_ignore, m_botserv, m_ignore } }; -static struct Message cs_msgtab = { +static struct Message cs_msgtab = +{ "CS", 0, 0, 0, 1, MFLG_SLOW, 0, - {m_unregistered, m_chanserv, m_ignore, m_ignore, m_chanserv, m_ignore} + { m_unregistered, m_chanserv, m_ignore, m_ignore, m_chanserv, m_ignore } }; -static struct Message ss_msgtab = { +static struct Message ss_msgtab = +{ "SS", 0, 0, 0, 1, MFLG_SLOW, 0, - {m_unregistered, m_statserv, m_ignore, m_ignore, m_statserv, m_ignore} + { m_unregistered, m_statserv, m_ignore, m_ignore, m_statserv, m_ignore } }; -static struct Message hs_msgtab = { +static struct Message hs_msgtab = +{ "HS", 0, 0, 0, 1, MFLG_SLOW, 0, - {m_unregistered, m_hostserv, m_ignore, m_ignore, m_hostserv, m_ignore} + { m_unregistered, m_hostserv, m_ignore, m_ignore, m_hostserv, m_ignore } }; -static struct Message botserv_msgtab = { +static struct Message botserv_msgtab = +{ "BOTSERV", 0, 0, 0, 1, MFLG_SLOW, 0, - {m_unregistered, m_botserv, m_ignore, m_ignore, m_botserv, m_ignore} + { m_unregistered, m_botserv, m_ignore, m_ignore, m_botserv, m_ignore } }; -static struct Message chanserv_msgtab = { +static struct Message chanserv_msgtab = +{ "CHANSERV", 0, 0, 0, 1, MFLG_SLOW, 0, - {m_unregistered, m_chanserv, m_ignore, m_ignore, m_chanserv, m_ignore} + { m_unregistered, m_chanserv, m_ignore, m_ignore, m_chanserv, m_ignore } }; -static struct Message memoserv_msgtab = { +static struct Message memoserv_msgtab = +{ "MEMOSERV", 0, 0, 0, 1, MFLG_SLOW, 0, - {m_unregistered, m_memoserv, m_ignore, m_ignore, m_memoserv, m_ignore} + { m_unregistered, m_memoserv, m_ignore, m_ignore, m_memoserv, m_ignore } }; -static struct Message nickserv_msgtab = { +static struct Message nickserv_msgtab = +{ "NICKSERV", 0, 0, 0, 1, MFLG_SLOW, 0, - {m_unregistered, m_nickserv, m_ignore, m_ignore, m_nickserv, m_ignore} + { m_unregistered, m_nickserv, m_ignore, m_ignore, m_nickserv, m_ignore } }; -static struct Message operserv_msgtab = { +static struct Message operserv_msgtab = +{ "OPERSERV", 0, 0, 0, 1, MFLG_SLOW, 0, - {m_unregistered, m_operserv, m_ignore, m_ignore, m_operserv, m_ignore} + { m_unregistered, m_operserv, m_ignore, m_ignore, m_operserv, m_ignore } }; -static struct Message statserv_msgtab = { +static struct Message statserv_msgtab = +{ "STATSERV", 0, 0, 0, 1, MFLG_SLOW, 0, - {m_unregistered, m_statserv, m_ignore, m_ignore, m_statserv, m_ignore} + { m_unregistered, m_statserv, m_ignore, m_ignore, m_statserv, m_ignore } }; -static struct Message hostserv_msgtab = { +static struct Message hostserv_msgtab = +{ "HOSTSERV", 0, 0, 0, 1, MFLG_SLOW, 0, - {m_unregistered, m_hostserv, m_ignore, m_ignore, m_hostserv, m_ignore} + { m_unregistered, m_hostserv, m_ignore, m_ignore, m_hostserv, m_ignore } }; @@ -344,7 +364,8 @@ module_exit(void) mod_del_cmd(&hs_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_set.c b/modules/m_set.c index 308e358..b8522d6 100644 --- a/modules/m_set.c +++ b/modules/m_set.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_set.c: Sets a server parameter. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,11 +17,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ */ -/* rewritten by jdc */ +/*! \file m_set.c + * \brief Includes required functions for processing the SET command. + * \version $Id$ + */ #include "stdinc.h" #include "client.h" @@ -432,7 +432,7 @@ list_quote_commands(struct Client *source_p) * mo_set - SET command handler * set options while running */ -static void +static int mo_set(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -446,7 +446,7 @@ mo_set(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "set"); - return; + return 0; } if (parc > 1) @@ -490,7 +490,7 @@ mo_set(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "SET"); - return; + return 0; } if (tab->wants_int && (parc > 2)) @@ -514,7 +514,7 @@ mo_set(struct Client *client_p, struct Client *source_p, me.name, source_p->name, tab->name); - return; + return 0; } } else @@ -526,7 +526,7 @@ mo_set(struct Client *client_p, struct Client *source_p, tab->handler(source_p, arg, newval); else tab->handler(source_p, arg); - return; + return 0; } else { @@ -536,7 +536,7 @@ mo_set(struct Client *client_p, struct Client *source_p, /* Just in case someone actually wants a * set function that takes no args.. *shrug* */ tab->handler(source_p); - return; + return 0; } } } @@ -547,15 +547,17 @@ mo_set(struct Client *client_p, struct Client *source_p, */ sendto_one(source_p, ":%s NOTICE %s :Variable not found.", me.name, source_p->name); - return; + return 0; } list_quote_commands(source_p); + return 0; } -static struct Message set_msgtab = { +static struct Message set_msgtab = +{ "SET", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_not_oper, m_ignore, m_ignore, mo_set, m_ignore} + { m_unregistered, m_not_oper, m_ignore, m_ignore, mo_set, m_ignore } }; static void @@ -570,7 +572,8 @@ module_exit(void) mod_del_cmd(&set_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_stats.c b/modules/m_stats.c index b6e56bb..7ca8f0d 100644 --- a/modules/m_stats.c +++ b/modules/m_stats.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_stats.c: Sends the user statistics or config information. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,33 +17,36 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_stats.c + * \brief Includes required functions for processing the STATS command. + * \version $Id$ */ #include "stdinc.h" -#include "list.h" /* dlink_node/dlink_list */ -#include "client.h" /* Client */ -#include "irc_string.h" -#include "ircd.h" /* me */ -#include "listener.h" /* show_ports */ +#include "list.h" +#include "client.h" +#include "irc_string.h" +#include "ircd.h" +#include "listener.h" #include "s_gline.h" #include "conf.h" #include "conf_class.h" #include "hostmask.h" -#include "numeric.h" /* ERR_xxx */ -#include "send.h" /* sendto_one */ -#include "fdlist.h" /* PF and friends */ -#include "s_bsd.h" /* highest_fd */ -#include "s_misc.h" /* serv_info */ -#include "s_serv.h" /* hunt_server */ -#include "s_user.h" /* show_opers */ -#include "event.h" /* events */ +#include "numeric.h" +#include "send.h" +#include "fdlist.h" +#include "s_bsd.h" +#include "s_misc.h" +#include "s_serv.h" +#include "s_user.h" +#include "event.h" #include "dbuf.h" #include "hook.h" #include "parse.h" #include "modules.h" -#include "resv.h" /* report_resv */ +#include "resv.h" #include "whowas.h" #include "watch.h" #include "irc_res.h" @@ -93,9 +95,9 @@ report_confitem_types(struct Client *source_p, enum maskitem_type type) conf = ptr->data; sendto_one(source_p, form_str(RPL_STATSXLINE), - me.name, source_p->name, - conf->until ? 'x': 'X', conf->count, - conf->name, conf->reason); + me.name, source_p->name, + conf->until ? 'x': 'X', conf->count, + conf->name, conf->reason); } break; @@ -115,9 +117,9 @@ report_confitem_types(struct Client *source_p, enum maskitem_type type) *p++ = ToLower(shared->letter); sendto_one(source_p, form_str(RPL_STATSULINE), - me.name, source_p->name, conf->name, + me.name, source_p->name, conf->name, conf->user?conf->user: "*", - conf->host?conf->host: "*", buf); + conf->host?conf->host: "*", buf); } shared = flag_table; @@ -148,15 +150,15 @@ report_confitem_types(struct Client *source_p, enum maskitem_type type) /* Don't allow non opers to see oper privs */ if (HasUMode(source_p, UMODE_OPER)) - sendto_one(source_p, form_str(RPL_STATSOLINE), - me.name, source_p->name, 'O', conf->count, conf->user, conf->host, - conf->name, oper_privs_as_string(conf->port), - conf->class ? conf->class->name : "<default>"); + sendto_one(source_p, form_str(RPL_STATSOLINE), + me.name, source_p->name, 'O', conf->count, conf->user, conf->host, + conf->name, oper_privs_as_string(conf->port), + conf->class ? conf->class->name : "<default>"); else - sendto_one(source_p, form_str(RPL_STATSOLINE), - me.name, source_p->name, 'O', conf->count, conf->user, conf->host, + sendto_one(source_p, form_str(RPL_STATSOLINE), + me.name, source_p->name, 'O', conf->count, conf->user, conf->host, conf->name, "0", - conf->class ? conf->class->name : "<default>"); + conf->class ? conf->class->name : "<default>"); } break; @@ -178,11 +180,11 @@ report_confitem_types(struct Client *source_p, enum maskitem_type type) buf[0] = '\0'; if (IsConfAllowAutoConn(conf)) - *p++ = 'A'; + *p++ = 'A'; if (IsConfSSL(conf)) *p++ = 'S'; if (buf[0] == '\0') - *p++ = '*'; + *p++ = '*'; *p = '\0'; @@ -190,15 +192,15 @@ report_confitem_types(struct Client *source_p, enum maskitem_type type) * Allow admins to see actual ips unless hide_server_ips is enabled */ if (!ConfigServerHide.hide_server_ips && HasUMode(source_p, UMODE_ADMIN)) - sendto_one(source_p, form_str(RPL_STATSCLINE), - me.name, source_p->name, 'C', conf->host, - buf, conf->name, conf->port, - conf->class ? conf->class->name : "<default>"); + sendto_one(source_p, form_str(RPL_STATSCLINE), + me.name, source_p->name, 'C', conf->host, + buf, conf->name, conf->port, + conf->class ? conf->class->name : "<default>"); else sendto_one(source_p, form_str(RPL_STATSCLINE), me.name, source_p->name, 'C', - "*@127.0.0.1", buf, conf->name, conf->port, - conf->class ? conf->class->name : "<default>"); + "*@127.0.0.1", buf, conf->name, conf->port, + conf->class ? conf->class->name : "<default>"); } break; @@ -700,7 +702,7 @@ stats_pending_glines(struct Client *source_p, int parc, char *parv[]) if (!ConfigFileEntry.glines) { sendto_one(source_p, ":%s NOTICE %s :This server does not support G-Lines", - from, to); + from, to); return; } @@ -839,7 +841,7 @@ stats_hubleaf(struct Client *source_p, int parc, char *parv[]) * show_iline_prefix() * * inputs - pointer to struct Client requesting output - * - pointer to struct MaskItem + * - pointer to struct MaskItem * - name to which iline prefix will be prefixed to * output - pointer to static string with prefixes listed in ascii form * side effects - NONE @@ -940,11 +942,10 @@ stats_auth(struct Client *source_p, int parc, char *parv[]) if (MyConnect(source_p)) conf = find_conf_by_address(source_p->host, - &source_p->localClient->ip, - CONF_CLIENT, - source_p->localClient->aftype, - source_p->username, - source_p->localClient->passwd, 1); + &source_p->localClient->ip, CONF_CLIENT, + source_p->localClient->aftype, + source_p->username, + source_p->localClient->passwd, 1); else conf = find_conf_by_address(source_p->host, NULL, CONF_CLIENT, 0, source_p->username, NULL, 1); @@ -952,11 +953,10 @@ stats_auth(struct Client *source_p, int parc, char *parv[]) if (conf == NULL) return; - sendto_one(source_p, form_str(RPL_STATSILINE), from, - to, 'I', - "*", show_iline_prefix(source_p, conf), - conf->host, conf->port, - conf->class ? conf->class->name : "<default>"); + sendto_one(source_p, form_str(RPL_STATSILINE), from, to, + 'I', "*", show_iline_prefix(source_p, conf), + conf->host, conf->port, + conf->class ? conf->class->name : "<default>"); } /* They are opered, or allowed to see all auth blocks */ else @@ -966,7 +966,7 @@ stats_auth(struct Client *source_p, int parc, char *parv[]) /* report_Klines() * Inputs: Client to report to, * type(==0 for perm, !=0 for temporary) - * mask + * mask * Output: None * Side effects: Reports configured K(or k)-lines to client_p. */ @@ -1025,10 +1025,9 @@ stats_tklines(struct Client *source_p, int parc, char *parv[]) if (MyConnect(source_p)) conf = find_conf_by_address(source_p->host, - &source_p->localClient->ip, - CONF_KLINE, - source_p->localClient->aftype, - source_p->username, NULL, 1); + &source_p->localClient->ip, CONF_KLINE, + source_p->localClient->aftype, + source_p->username, NULL, 1); else conf = find_conf_by_address(source_p->host, NULL, CONF_KLINE, 0, source_p->username, NULL, 1); @@ -1065,10 +1064,9 @@ stats_klines(struct Client *source_p, int parc, char *parv[]) /* search for a kline */ if (MyConnect(source_p)) conf = find_conf_by_address(source_p->host, - &source_p->localClient->ip, - CONF_KLINE, - source_p->localClient->aftype, - source_p->username, NULL, 0); + &source_p->localClient->ip, CONF_KLINE, + source_p->localClient->aftype, + source_p->username, NULL, 0); else conf = find_conf_by_address(source_p->host, NULL, CONF_KLINE, 0, source_p->username, NULL, 0); @@ -1079,7 +1077,7 @@ stats_klines(struct Client *source_p, int parc, char *parv[]) /* dont report a tkline as a kline */ if (conf->until) return; - + sendto_one(source_p, form_str(RPL_STATSKLINE), from, to, 'K', conf->host, conf->user, conf->reason); } @@ -1126,14 +1124,14 @@ stats_operedup(struct Client *source_p, int parc, char *parv[]) sendto_one(source_p, ":%s %d %s p :[%c][%s] %s (%s@%s) Idle: %u", from, RPL_STATSDEBUG, to, HasUMode(target_p, UMODE_ADMIN) ? 'A' : 'O', - oper_privs_as_string(target_p->localClient->operflags), - target_p->name, target_p->username, target_p->host, + oper_privs_as_string(target_p->localClient->operflags), + target_p->name, target_p->username, target_p->host, idle_time_get(source_p, target_p)); else sendto_one(source_p, ":%s %d %s p :[%c] %s (%s@%s) Idle: %u", from, RPL_STATSDEBUG, to, HasUMode(target_p, UMODE_ADMIN) ? 'A' : 'O', - target_p->name, target_p->username, target_p->host, + target_p->name, target_p->username, target_p->host, idle_time_get(source_p, target_p)); } @@ -1387,7 +1385,7 @@ stats_servlinks(struct Client *source_p, int parc, char *parv[]) * output - pointer to name to use * side effects - * common parse routine for m_stats args - * + * */ static char * parse_stats_args(int parc, char *parv[], int *doall, int *wilds) @@ -1627,11 +1625,11 @@ do_stats(struct Client *source_p, int parc, char *parv[]) * parv[0] = sender prefix * parv[1] = stat letter/command * parv[2] = (if present) server/mask in stats L - * + * * This will search the tables for the appropriate stats letter/command, - * if found execute it. + * if found execute it. */ -static void +static int m_stats(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -1653,7 +1651,7 @@ m_stats(struct Client *client_p, struct Client *source_p, { sendto_one(source_p,form_str(RPL_LOAD2HI), from, to); - return; + return 0; } last_used = CurrentTime; @@ -1662,9 +1660,10 @@ m_stats(struct Client *client_p, struct Client *source_p, if (!ConfigServerHide.disable_remote_commands) if (hunt_server(client_p, source_p, ":%s STATS %s :%s", 2, parc, parv) != HUNTED_ISME) - return; + return 0; do_stats(source_p, parc, parv); + return 0; } /* @@ -1674,15 +1673,15 @@ m_stats(struct Client *client_p, struct Client *source_p, * parv[2] = (if present) server/mask in stats L, or target * * This will search the tables for the appropriate stats letter, - * if found execute it. + * if found execute it. */ -static void +static int mo_stats(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if (hunt_server(client_p, source_p, ":%s STATS %s :%s", 2, parc, parv) != HUNTED_ISME) - return; + return 0; if (!MyClient(source_p) && IsCapable(source_p->from, CAP_TS6) && HasID(source_p)) { @@ -1696,9 +1695,11 @@ mo_stats(struct Client *client_p, struct Client *source_p, } do_stats(source_p, parc, parv); + return 0; } -static struct Message stats_msgtab = { +static struct Message stats_msgtab = +{ "STATS", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_stats, mo_stats, m_ignore, mo_stats, m_ignore } }; @@ -1715,7 +1716,8 @@ module_exit(void) mod_del_cmd(&stats_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_svinfo.c b/modules/m_svinfo.c index cc82b80..28072f6 100644 --- a/modules/m_svinfo.c +++ b/modules/m_svinfo.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_svinfo.c: Sends TS information for clock & compatibility checks. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_svinfo.c + * \brief Includes required functions for processing the SVINFO command. + * \version $Id$ */ #include "stdinc.h" @@ -41,7 +43,7 @@ * parv[3] = server is standalone or connected to non-TS only * parv[4] = server's idea of UTC time */ -static void +static int ms_svinfo(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -51,11 +53,11 @@ ms_svinfo(struct Client *client_p, struct Client *source_p, if (MyConnect(source_p) && IsUnknown(source_p)) { exit_client(source_p, source_p, "Need SERVER before SVINFO"); - return; + return 0; } if (!IsServer(source_p) || !MyConnect(source_p) || parc < 5) - return; + return 0; if (TS_CURRENT < atoi(parv[2]) || atoi(parv[1]) < TS_MIN) { @@ -71,13 +73,13 @@ ms_svinfo(struct Client *client_p, struct Client *source_p, "Link %s dropped, wrong TS protocol version (%s,%s)", get_client_name(source_p, MASK_IP), parv[1], parv[2]); exit_client(source_p, source_p, "Incompatible TS version"); - return; + return 0; } /* * since we're here, might as well set CurrentTime while we're at it */ - set_time(); + set_time(); theirtime = atol(parv[4]); deltat = abs(theirtime - CurrentTime); @@ -102,7 +104,7 @@ ms_svinfo(struct Client *client_p, struct Client *source_p, (unsigned long) theirtime, (int) deltat); exit_client(source_p, source_p, "Excessive TS delta"); - return; + return 0; } if (deltat > ConfigFileEntry.ts_warn_delta) @@ -112,11 +114,13 @@ ms_svinfo(struct Client *client_p, struct Client *source_p, (unsigned long) CurrentTime, (unsigned long) theirtime, (int) deltat); + return 0; } -static struct Message svinfo_msgtab = { +static struct Message svinfo_msgtab = +{ "SVINFO", 0, 0, 4, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_ignore, ms_svinfo, m_ignore, m_ignore, m_ignore} + { m_unregistered, m_ignore, ms_svinfo, m_ignore, m_ignore, m_ignore } }; static void @@ -131,7 +135,8 @@ module_exit(void) mod_del_cmd(&svinfo_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_svskill.c b/modules/m_svskill.c index 04feec6..96f97bf 100644 --- a/modules/m_svskill.c +++ b/modules/m_svskill.c @@ -1,8 +1,8 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 1999 by the Bahamut Development Team. - * Copyright (C) 2013 by the Hybrid Development Team. + * Copyright (c) 1999 Bahamut development team. + * Copyright (c) 2013-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -53,7 +53,7 @@ * - parv[2] = TS * - parv[3] = kill message */ -static void +static int ms_svskill(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { struct Client *target_p = NULL; @@ -62,10 +62,10 @@ ms_svskill(struct Client *client_p, struct Client *source_p, int parc, char *par time_t ts = 0; if (!HasFlag(source_p, FLAGS_SERVICE)) - return; + return 0; if (EmptyString(parv[1])) - return; + return 0; if (parc > 3) { @@ -76,16 +76,16 @@ ms_svskill(struct Client *client_p, struct Client *source_p, int parc, char *par comment = (parc > 2 && parv[2]) ? parv[2] : source_p->name; if ((target_p = find_person(client_p, parv[1])) == NULL) - return; + return 0; if (ts && (ts != target_p->tsinfo)) - return; + return 0; if (MyConnect(target_p)) { strlcpy(reason + 11, comment, sizeof(reason) - 11); exit_client(target_p, target_p, reason); - return; + return 0; } if (target_p->from == client_p) @@ -95,7 +95,7 @@ ms_svskill(struct Client *client_p, struct Client *source_p, int parc, char *par "for %s (behind %s) from %s", target_p->name, client_p->name, get_client_name(source_p, HIDE_IP)); - return; + return 0; } if (ts == 0) @@ -106,11 +106,13 @@ ms_svskill(struct Client *client_p, struct Client *source_p, int parc, char *par sendto_one(target_p, ":%s SVSKILL %s %lu :%s", ID_or_name(source_p, target_p->from), ID_or_name(target_p, target_p->from), ts, comment); + return 0; } -static struct Message svskill_msgtab = { +static struct Message svskill_msgtab = +{ "SVSKILL", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, - {m_ignore, m_ignore, ms_svskill, m_ignore, m_ignore, m_ignore} + { m_ignore, m_ignore, ms_svskill, m_ignore, m_ignore, m_ignore } }; static void @@ -125,7 +127,8 @@ module_exit(void) mod_del_cmd(&svskill_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_svsmode.c b/modules/m_svsmode.c index 4db45d1..45dbb9d 100644 --- a/modules/m_svsmode.c +++ b/modules/m_svsmode.c @@ -1,8 +1,8 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 1999 by the Bahamut Development Team. - * Copyright (C) 2011 by the Hybrid Development Team. + * Copyright (c) 1999 Bahamut development team. + * Copyright (c) 2011-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -54,7 +54,7 @@ * - parv[3] = mode (or services id if old svs version) * - parv[4] = optional argument (services id) */ -static void +static int ms_svsmode(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -65,7 +65,7 @@ ms_svsmode(struct Client *client_p, struct Client *source_p, time_t ts = 0; if (!HasFlag(source_p, FLAGS_SERVICE)) - return; + return 0; if ((parc >= 4) && ((*parv[3] == '+') || (*parv[3] == '-'))) { @@ -80,10 +80,10 @@ ms_svsmode(struct Client *client_p, struct Client *source_p, } if ((target_p = find_person(client_p, parv[1])) == NULL) - return; + return 0; if (ts && (ts != target_p->tsinfo)) - return; + return 0; setmodes = target_p->umodes; @@ -121,9 +121,9 @@ ms_svsmode(struct Client *client_p, struct Client *source_p, detach_conf(target_p, CONF_OPER); ClrOFlag(target_p); DelUMode(target_p, ConfigFileEntry.oper_only_umodes); - - if ((dm = dlinkFindDelete(&oper_list, target_p)) != NULL) - free_dlink_node(dm); + + if ((dm = dlinkFindDelete(&oper_list, target_p))) + free_dlink_node(dm); } } @@ -186,11 +186,14 @@ ms_svsmode(struct Client *client_p, struct Client *source_p, send_umode(target_p, target_p, setmodes, 0xffffffff, modebuf); } + + return 0; } -static struct Message svsmode_msgtab = { +static struct Message svsmode_msgtab = +{ "SVSMODE", 0, 0, 3, MAXPARA, MFLG_SLOW, 0, - {m_ignore, m_ignore, ms_svsmode, m_ignore, m_ignore, m_ignore} + { m_ignore, m_ignore, ms_svsmode, m_ignore, m_ignore, m_ignore } }; static void @@ -205,7 +208,8 @@ module_exit(void) mod_del_cmd(&svsmode_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_svsnick.c b/modules/m_svsnick.c index cabefbe..999cf56 100644 --- a/modules/m_svsnick.c +++ b/modules/m_svsnick.c @@ -1,8 +1,8 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 1999 by the Bahamut Development Team. - * Copyright (C) 2011 by the Hybrid Development Team. + * Copyright (c) 1999 Bahamut development team. + * Copyright (c) 2011-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,6 +25,7 @@ * \version $Id$ */ + #include "stdinc.h" #include "client.h" #include "ircd.h" @@ -56,21 +57,21 @@ * - parv[2] = new nickname * - parv[3] = timestamp */ -static void +static int ms_svsnick(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { struct Client *target_p = NULL, *exists_p = NULL; if (!HasFlag(source_p, FLAGS_SERVICE) || !valid_nickname(parv[2], 1)) - return; + return 0; if (hunt_server(client_p, source_p, ":%s SVSNICK %s %s :%s", 1, parc, parv) != HUNTED_ISME) - return; + return 0; if ((target_p = find_person(client_p, parv[1])) == NULL) - return; + return 0; assert(MyClient(target_p)); @@ -81,7 +82,7 @@ ms_svsnick(struct Client *client_p, struct Client *source_p, else { exit_client(target_p, &me, "SVSNICK Collide"); - return; + return 0; } } @@ -104,11 +105,9 @@ ms_svsnick(struct Client *client_p, struct Client *source_p, whowas_add_history(target_p, 1); - sendto_server(NULL, CAP_TS6, NOCAPS, - ":%s NICK %s :%lu", + sendto_server(NULL, CAP_TS6, NOCAPS, ":%s NICK %s :%lu", ID(target_p), parv[2], (unsigned long)target_p->tsinfo); - sendto_server(NULL, NOCAPS, CAP_TS6, - ":%s NICK %s :%lu", + sendto_server(NULL, NOCAPS, CAP_TS6, ":%s NICK %s :%lu", target_p->name, parv[2], (unsigned long)target_p->tsinfo); hash_del_client(target_p); @@ -118,9 +117,11 @@ ms_svsnick(struct Client *client_p, struct Client *source_p, watch_check_hash(target_p, RPL_LOGON); fd_note(&target_p->localClient->fd, "Nick: %s", parv[2]); + return 0; } -static struct Message svsnick_msgtab = { +static struct Message svsnick_msgtab = +{ "SVSNICK", 0, 0, 4, MAXPARA, MFLG_SLOW, 0, {m_ignore, m_ignore, ms_svsnick, m_ignore, m_ignore, m_ignore} }; @@ -137,7 +138,8 @@ module_exit(void) mod_del_cmd(&svsnick_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_tburst.c b/modules/m_tburst.c index 89e912c..6938527 100644 --- a/modules/m_tburst.c +++ b/modules/m_tburst.c @@ -1,31 +1,27 @@ -/* modules/m_tburst.c - * Copyright (C) 2002, 2003, 2004, 2005 Hybrid Development Team +/* + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: + * Copyright (c) 2002-2014 ircd-hybrid development team * - * 1.Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2.Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3.The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * $Id$ + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + +/*! \file m_tburst.c + * \brief Includes required functions for processing the TBURST command. + * \version $Id$ */ #include "stdinc.h" @@ -48,7 +44,7 @@ * parv[4] = topic setter * parv[5] = topic */ -static void +static int ms_tburst(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -68,7 +64,7 @@ ms_tburst(struct Client *client_p, struct Client *source_p, if ((chptr = hash_find_channel(parv[2])) == NULL) - return; + return 0; /* * The logic for accepting and rejecting channel topics was @@ -108,9 +104,12 @@ ms_tburst(struct Client *client_p, struct Client *source_p, hidden_server ? me.name : source_p->name, chptr->chname, chptr->topic); } + + return 0; } -static struct Message tburst_msgtab = { +static struct Message tburst_msgtab = +{ "TBURST", 0, 0, 6, MAXPARA, MFLG_SLOW, 0, { m_ignore, m_ignore, ms_tburst, m_ignore, m_ignore, m_ignore } }; @@ -129,7 +128,8 @@ module_exit(void) delete_capability("TBURST"); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_time.c b/modules/m_time.c index 3e9a0df..ba6bcba 100644 --- a/modules/m_time.c +++ b/modules/m_time.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_time.c: Sends the current time on the server. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_time.c + * \brief Includes required functions for processing the TIME command. + * \version $Id$ */ #include "stdinc.h" @@ -40,7 +42,7 @@ * parv[0] = sender prefix * parv[1] = servername */ -static void +static int m_time(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -51,10 +53,11 @@ m_time(struct Client *client_p, struct Client *source_p, /* This is safe enough to use during non hidden server mode */ if (!ConfigServerHide.disable_remote_commands) if (hunt_server(client_p, source_p, ":%s TIME :%s", 1, parc, parv) != HUNTED_ISME) - return; + return 0; sendto_one(source_p, form_str(RPL_TIME), me.name, source_p->name, me.name, date(0)); + return 0; } /* @@ -62,16 +65,18 @@ m_time(struct Client *client_p, struct Client *source_p, * parv[0] = sender prefix * parv[1] = servername */ -static void +static int mo_time(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if (hunt_server(client_p, source_p, ":%s TIME :%s", 1, parc, parv) == HUNTED_ISME) sendto_one(source_p, form_str(RPL_TIME), me.name, source_p->name, me.name, date(0)); + return 0; } -static struct Message time_msgtab = { +static struct Message time_msgtab = +{ "TIME", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_time, mo_time, m_ignore, mo_time, m_ignore } }; @@ -88,7 +93,8 @@ module_exit(void) mod_del_cmd(&time_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_topic.c b/modules/m_topic.c index 9eeba26..82c3f72 100644 --- a/modules/m_topic.c +++ b/modules/m_topic.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_topic.c: Sets a channel topic. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_topic.c + * \brief Includes required functions for processing the TOPIC command. + * \version $Id$ */ #include "stdinc.h" @@ -43,7 +45,7 @@ * parv[1] = channel name * parv[2] = new topic, if setting topic */ -static void +static int m_topic(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -53,7 +55,7 @@ m_topic(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "TOPIC"); - return; + return 0; } if (!IsFloodDone(source_p)) @@ -63,7 +65,7 @@ m_topic(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), me.name, source_p->name, parv[1]); - return; + return 0; } /* setting topic */ @@ -75,13 +77,13 @@ m_topic(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOTONCHANNEL), me.name, source_p->name, parv[1]); - return; + return 0; } if (!(chptr->mode.mode & MODE_TOPICLIMIT) || has_member_flags(ms, CHFL_CHANOP|CHFL_HALFOP)) { - char topic_info[USERHOST_REPLYLEN]; + char topic_info[USERHOST_REPLYLEN]; snprintf(topic_info, sizeof(topic_info), "%s!%s@%s", source_p->name, source_p->username, source_p->host); @@ -128,9 +130,11 @@ m_topic(struct Client *client_p, struct Client *source_p, sendto_one(source_p, form_str(ERR_NOTONCHANNEL), me.name, source_p->name, chptr->chname); } + + return 0; } -static void +static int ms_topic(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -153,14 +157,14 @@ ms_topic(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), from, to, "TOPIC"); - return; + return 0; } if ((chptr = hash_find_channel(parv[1])) == NULL) { sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), from, to, parv[1]); - return; + return 0; } if (!IsClient(source_p)) @@ -188,12 +192,14 @@ ms_topic(struct Client *client_p, struct Client *source_p, source_p->username, source_p->host, chptr->chname, chptr->topic); + return 0; } -static struct Message topic_msgtab = { +static struct Message topic_msgtab = +{ "TOPIC", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_topic, ms_topic, m_ignore, m_topic, m_ignore} + { m_unregistered, m_topic, ms_topic, m_ignore, m_topic, m_ignore } }; static void @@ -208,7 +214,8 @@ module_exit(void) mod_del_cmd(&topic_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_trace.c b/modules/m_trace.c index bc9ce02..7daa44e 100644 --- a/modules/m_trace.c +++ b/modules/m_trace.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_trace.c: Traces a path to a client/server. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_trace.c + * \brief Includes required functions for processing the TRACE command. + * \version $Id$ */ #include "stdinc.h" @@ -60,7 +62,7 @@ trace_get_dependent(unsigned int *const server, * parv[0] = sender prefix * parv[1] = target client/server to trace */ -static void +static int m_trace(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -73,13 +75,14 @@ m_trace(struct Client *client_p, struct Client *source_p, sendto_one(source_p, form_str(RPL_ENDOFTRACE), me.name, source_p->name, tname); + return 0; } /* mo_trace() * parv[0] = sender prefix * parv[1] = servername */ -static void +static int mo_trace(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -89,7 +92,7 @@ mo_trace(struct Client *client_p, struct Client *source_p, if (parc > 2) if (hunt_server(client_p, source_p, ":%s TRACE %s :%s", 2, parc, parv) != HUNTED_ISME) - return; + return 0; if (parc > 1) tname = parv[1]; @@ -132,15 +135,17 @@ mo_trace(struct Client *client_p, struct Client *source_p, else sendto_one(source_p, form_str(RPL_TRACELINK), from, to, ircd_version, tname, "ac2ptr_is_NULL!!"); - return; + return 0; } case HUNTED_ISME: do_actual_trace(source_p, parc, parv); break; default: - return; + return 0; } + + return 0; } /* @@ -148,15 +153,16 @@ mo_trace(struct Client *client_p, struct Client *source_p, ** parv[0] = sender prefix ** parv[1] = servername */ -static void +static int ms_trace(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if (hunt_server(client_p, source_p, ":%s TRACE %s :%s", 2, parc, parv)) - return; + return 0; if (HasUMode(source_p, UMODE_OPER)) mo_trace(client_p, source_p, parc, parv); + return 0; } static void @@ -207,7 +213,7 @@ do_actual_trace(struct Client *source_p, int parc, char *parv[]) const char *name; target_p = hash_find_client(tname); - if (target_p && IsClient(target_p)) + if (target_p && IsClient(target_p)) { name = get_client_name(target_p, HIDE_IP); @@ -358,7 +364,7 @@ report_this_status(struct Client *source_p, struct Client *target_p, int dow) { if (ConfigFileEntry.hide_spoof_ips) sendto_one(source_p, form_str(RPL_TRACEOPERATOR), - from, to, class_name, name, + from, to, class_name, name, IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost, CurrentTime - target_p->localClient->lasttime, idle_time_get(source_p, target_p)); @@ -405,7 +411,7 @@ report_this_status(struct Client *source_p, struct Client *target_p, int dow) me.name, CurrentTime - target_p->localClient->lasttime); break; } - + default: /* ...we actually shouldn't come here... --msa */ sendto_one(source_p, form_str(RPL_TRACENEWTYPE), from, to, name); @@ -413,7 +419,8 @@ report_this_status(struct Client *source_p, struct Client *target_p, int dow) } } -static struct Message trace_msgtab = { +static struct Message trace_msgtab = +{ "TRACE", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_trace, ms_trace, m_ignore, mo_trace, m_ignore } }; @@ -430,7 +437,8 @@ module_exit(void) mod_del_cmd(&trace_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_user.c b/modules/m_user.c index 9b00c29..5ca7f0f 100644 --- a/modules/m_user.c +++ b/modules/m_user.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_user.c: Sends username information. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_user.c + * \brief Includes required functions for processing the USER command. + * \version $Id$ */ #include "stdinc.h" @@ -73,7 +75,7 @@ do_local_user(struct Client *source_p, ** parv[3] = server host name (used only from other servers) ** parv[4] = users real name info */ -static void +static int mr_user(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -82,17 +84,17 @@ mr_user(struct Client *client_p, struct Client *source_p, if (source_p->localClient->listener->flags & LISTENER_SERVER) { exit_client(source_p, &me, "Use a different port"); - return; + return 0; } if ((p = strchr(parv[1], '@')) != NULL) - *p = '\0'; + *p = '\0'; if (EmptyString(parv[4])) { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name[0] ? source_p->name : "*", "USER"); - return; + return 0; } do_local_user(source_p, @@ -100,9 +102,11 @@ mr_user(struct Client *client_p, struct Client *source_p, parv[2], /* host */ parv[3], /* server */ parv[4] /* users real name */ ); + return 0; } -static struct Message user_msgtab = { +static struct Message user_msgtab = +{ "USER", 0, 0, 5, MAXPARA, MFLG_SLOW, 0, { mr_user, m_registered, m_ignore, m_ignore, m_registered, m_ignore } }; @@ -119,7 +123,8 @@ module_exit(void) mod_del_cmd(&user_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_userhost.c b/modules/m_userhost.c index 1f7c604..74df972 100644 --- a/modules/m_userhost.c +++ b/modules/m_userhost.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_userhost.c: Shows a user's host. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_userhost.c + * \brief Includes required functions for processing the USERHOST command. + * \version $Id$ */ #include "stdinc.h" @@ -38,7 +40,7 @@ * the need for complicated requests like WHOIS. It returns user/host * information only (no spurious AWAY labels or channels). */ -static void +static int m_userhost(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -96,11 +98,13 @@ m_userhost(struct Client *client_p, struct Client *source_p, } sendto_one(source_p, "%s", buf); + return 0; } -static struct Message userhost_msgtab = { +static struct Message userhost_msgtab = +{ "USERHOST", 0, 0, 2, 1, MFLG_SLOW, 0, - {m_unregistered, m_userhost, m_userhost, m_ignore, m_userhost, m_ignore} + { m_unregistered, m_userhost, m_userhost, m_ignore, m_userhost, m_ignore } }; static void @@ -115,7 +119,8 @@ module_exit(void) mod_del_cmd(&userhost_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_users.c b/modules/m_users.c index 06c8200..f743d07 100644 --- a/modules/m_users.c +++ b/modules/m_users.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_users.c: Gives some basic user statistics. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_users.c + * \brief Includes required functions for processing the USERS command. + * \version $Id$ */ #include "stdinc.h" @@ -38,7 +40,7 @@ * parv[0] = sender prefix * parv[1] = servername */ -static void +static int m_users(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -48,7 +50,7 @@ m_users(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name); - return; + return 0; } last_used = CurrentTime; @@ -56,13 +58,14 @@ m_users(struct Client *client_p, struct Client *source_p, if (!ConfigServerHide.disable_remote_commands) if (hunt_server(client_p, source_p, ":%s USERS :%s", 1, parc, parv) != HUNTED_ISME) - return; + return 0; sendto_one(source_p, form_str(RPL_LOCALUSERS), me.name, source_p->name, ConfigServerHide.hide_servers ? Count.total : Count.local, ConfigServerHide.hide_servers ? Count.max_tot : Count.max_loc); sendto_one(source_p, form_str(RPL_GLOBALUSERS), me.name, source_p->name, Count.total, Count.max_tot); + return 0; } /* @@ -70,13 +73,13 @@ m_users(struct Client *client_p, struct Client *source_p, * parv[0] = sender prefix * parv[1] = servername */ -static void +static int mo_users(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if (hunt_server(client_p, source_p, ":%s USERS :%s", 1, parc, parv) != HUNTED_ISME) - return; + return 0; if (!HasUMode(source_p, UMODE_OPER) && ConfigServerHide.hide_servers) sendto_one(source_p, form_str(RPL_LOCALUSERS), me.name, source_p->name, @@ -87,9 +90,11 @@ mo_users(struct Client *client_p, struct Client *source_p, sendto_one(source_p, form_str(RPL_GLOBALUSERS), me.name, source_p->name, Count.total, Count.max_tot); + return 0; } -static struct Message users_msgtab = { +static struct Message users_msgtab = +{ "USERS", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_users, mo_users, m_ignore, mo_users, m_ignore } }; @@ -106,7 +111,8 @@ module_exit(void) mod_del_cmd(&users_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_version.c b/modules/m_version.c index 1822179..dede2b4 100644 --- a/modules/m_version.c +++ b/modules/m_version.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_version.c: Shows ircd version information. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_version.c + * \brief Includes required functions for processing the VERSION command. + * \version $Id$ */ #include "stdinc.h" @@ -35,7 +37,8 @@ /* Option string. */ -static const char serveropts[] = { +static const char serveropts[] = +{ 'T', 'S', #ifdef TS_CURRENT @@ -53,7 +56,7 @@ static const char serveropts[] = { * parv[0] = sender prefix * parv[1] = remote server */ -static void +static int m_version(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -64,7 +67,7 @@ m_version(struct Client *client_p, struct Client *source_p, /* safe enough to give this on a local connect only */ sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name); - return; + return 0; } last_used = CurrentTime; @@ -72,12 +75,13 @@ m_version(struct Client *client_p, struct Client *source_p, if (!ConfigServerHide.disable_remote_commands) if (hunt_server(client_p, source_p, ":%s VERSION :%s", 1, parc, parv) != HUNTED_ISME) - return; + return 0; sendto_one(source_p, form_str(RPL_VERSION), me.name, source_p->name, ircd_version, serno, me.name, serveropts); show_isupport(source_p); + return 0; } /* @@ -85,19 +89,20 @@ m_version(struct Client *client_p, struct Client *source_p, * parv[0] = sender prefix * parv[1] = remote server */ -static void +static int mo_version(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { - - if (hunt_server(client_p, source_p, ":%s VERSION :%s", + + if (hunt_server(client_p, source_p, ":%s VERSION :%s", 1, parc, parv) != HUNTED_ISME) - return; + return 0; sendto_one(source_p, form_str(RPL_VERSION), me.name, source_p->name, ircd_version, serno, me.name, serveropts); show_isupport(source_p); + return 0; } /* @@ -105,13 +110,13 @@ mo_version(struct Client *client_p, struct Client *source_p, * parv[0] = sender prefix * parv[1] = remote server */ -static void +static int ms_version(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { - if (hunt_server(client_p, source_p, ":%s VERSION :%s", + if (hunt_server(client_p, source_p, ":%s VERSION :%s", 1, parc, parv) != HUNTED_ISME) - return; + return 0; sendto_one(source_p, form_str(RPL_VERSION), ID_or_name(&me, client_p), @@ -119,9 +124,11 @@ ms_version(struct Client *client_p, struct Client *source_p, ircd_version, serno, me.name, serveropts); show_isupport(source_p); + return 0; } -static struct Message version_msgtab = { +static struct Message version_msgtab = +{ "VERSION", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_version, ms_version, m_ignore, mo_version, m_ignore } }; @@ -138,7 +145,8 @@ module_exit(void) mod_del_cmd(&version_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_wallops.c b/modules/m_wallops.c index 1426aa9..28841de 100644 --- a/modules/m_wallops.c +++ b/modules/m_wallops.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_wallops.c: Sends a message to all operators. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_wallops.c + * \brief Includes required functions for processing the WALLOPS command. + * \version $Id$ */ #include "stdinc.h" @@ -39,24 +41,24 @@ * parv[0] = sender prefix * parv[1] = message text */ -static void +static int mo_wallops(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) -{ +{ const char *message = parv[1]; if (!HasOFlag(source_p, OPER_FLAG_WALLOPS)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), - me.name, source_p->name, "wallops"); - return; + sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, + source_p->name, "wallops"); + return 0; } if (EmptyString(message)) { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "WALLOPS"); - return; + return 0; } sendto_wallops_flags(UMODE_OPERWALL, source_p, "OPERWALL - %s", message); @@ -64,6 +66,7 @@ mo_wallops(struct Client *client_p, struct Client *source_p, ":%s WALLOPS :%s", ID(source_p), message); sendto_server(NULL, NOCAPS, CAP_TS6, ":%s WALLOPS :%s", source_p->name, message); + return 0; } /* @@ -71,29 +74,31 @@ mo_wallops(struct Client *client_p, struct Client *source_p, * parv[0] = sender prefix * parv[1] = message text */ -static void +static int ms_wallops(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) -{ +{ const char *message = parv[1]; if (EmptyString(message)) - return; + return 0; if (IsClient(source_p)) sendto_wallops_flags(UMODE_OPERWALL, source_p, "OPERWALL - %s", message); else - sendto_wallops_flags(UMODE_WALLOP, source_p, "%s", message); + sendto_wallops_flags(UMODE_WALLOP, source_p, "%s", message); sendto_server(client_p, CAP_TS6, NOCAPS, ":%s WALLOPS :%s", ID(source_p), message); sendto_server(client_p, NOCAPS, CAP_TS6, ":%s WALLOPS :%s", source_p->name, message); + return 0; } -static struct Message wallops_msgtab = { +static struct Message wallops_msgtab = +{ "WALLOPS", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_not_oper, ms_wallops, m_ignore, mo_wallops, m_ignore} + { m_unregistered, m_not_oper, ms_wallops, m_ignore, mo_wallops, m_ignore } }; static void @@ -108,7 +113,8 @@ module_exit(void) mod_del_cmd(&wallops_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_watch.c b/modules/m_watch.c index fb75aa4..32a8f5f 100644 --- a/modules/m_watch.c +++ b/modules/m_watch.c @@ -1,9 +1,8 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_watch.c: Maintains notify list + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 1997 Jukka Santala (Donwulff) - * Copyright (C) 2005 by the Hybrid Development Team. + * Copyright (c) 1997 Jukka Santala (Donwulff) + * Copyright (c) 2000-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,8 +18,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_watch.c + * \brief Includes required functions for processing the WATCH command. + * \version $Id$ */ #include "stdinc.h" @@ -63,7 +65,7 @@ show_watch(struct Client *client_p, const char *name, * parv[0] = sender prefix * parv[1] = watch options */ -static void +static int m_watch(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { dlink_node *ptr = NULL; @@ -236,9 +238,12 @@ m_watch(struct Client *client_p, struct Client *source_p, int parc, char *parv[] /* Hmm.. unknown prefix character.. Ignore it. :-) */ } + + return 0; } -static struct Message watch_msgtab = { +static struct Message watch_msgtab = +{ "WATCH", 0, 0, 0, 1, MFLG_SLOW, 0, { m_unregistered, m_watch, m_ignore, m_ignore, m_watch, m_ignore } }; @@ -257,7 +262,8 @@ module_exit(void) delete_isupport("WATCH"); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_webirc.c b/modules/m_webirc.c index 5a96eb2..8a53b6b 100644 --- a/modules/m_webirc.c +++ b/modules/m_webirc.c @@ -1,10 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_webirc.c: Makes CGI:IRC users appear as coming from their real host + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center - * Copyright (C) 2002-2006 ircd-ratbox development team - * Copyright (C) 1996-2012 Hybrid Development Team + * Copyright (c) 2012-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_webirc.c + * \brief Includes required functions for processing the WEBIRC command. + * \version $Id$ */ #include "stdinc.h" @@ -42,10 +42,10 @@ * parv[0] = sender prefix * parv[1] = password * parv[2] = fake username (we ignore this) - * parv[3] = fake hostname + * parv[3] = fake hostname * parv[4] = fake ip */ -static void +static int mr_webirc(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { struct MaskItem *conf = NULL; @@ -57,7 +57,7 @@ mr_webirc(struct Client *client_p, struct Client *source_p, int parc, char *parv { sendto_one(source_p, ":%s NOTICE %s :CGI:IRC: Invalid hostname", me.name, source_p->name[0] ? source_p->name : "*"); - return; + return 0; } conf = find_address_conf(source_p->host, @@ -65,27 +65,27 @@ mr_webirc(struct Client *client_p, struct Client *source_p, int parc, char *parv &source_p->localClient->ip, source_p->localClient->aftype, parv[1]); if (conf == NULL || !IsConfClient(conf)) - return; + return 0; if (!IsConfWebIRC(conf)) { sendto_one(source_p, ":%s NOTICE %s :Not a CGI:IRC auth block", me.name, source_p->name[0] ? source_p->name : "*"); - return; + return 0; } if (EmptyString(conf->passwd)) { sendto_one(source_p, ":%s NOTICE %s :CGI:IRC auth blocks must have a password", me.name, source_p->name[0] ? source_p->name : "*"); - return; + return 0; } if (!match_conf_password(parv[1], conf)) { sendto_one(source_p, ":%s NOTICE %s :CGI:IRC password incorrect", me.name, source_p->name[0] ? source_p->name : "*"); - return; + return 0; } memset(&hints, 0, sizeof(hints)); @@ -99,7 +99,7 @@ mr_webirc(struct Client *client_p, struct Client *source_p, int parc, char *parv sendto_one(source_p, ":%s NOTICE %s :Invalid CGI:IRC IP %s", me.name, source_p->name[0] ? source_p->name : "*", parv[4]); - return; + return 0; } assert(res != NULL); @@ -120,16 +120,18 @@ mr_webirc(struct Client *client_p, struct Client *source_p, int parc, char *parv if (!(conf->type == CONF_EXEMPT)) { exit_client(client_p, &me, "D-lined"); - return; + return 0; } } AddUMode(source_p, UMODE_WEBIRC); sendto_one(source_p, ":%s NOTICE %s :CGI:IRC host/IP set to %s %s", me.name, source_p->name[0] ? source_p->name : "*", parv[3], parv[4]); + return 0; } -static struct Message webirc_msgtab = { +static struct Message webirc_msgtab = +{ "WEBIRC", 0, 0, 5, MAXPARA, MFLG_SLOW, 0, { mr_webirc, m_registered, m_ignore, m_ignore, m_registered, m_ignore } }; @@ -146,7 +148,8 @@ module_exit(void) mod_del_cmd(&webirc_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_who.c b/modules/m_who.c index fde58c2..11cd0a5 100644 --- a/modules/m_who.c +++ b/modules/m_who.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_who.c: Shows who is on a channel. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_who.c + * \brief Includes required functions for processing the WHO command. + * \version $Id$ */ #include "stdinc.h" @@ -112,7 +114,7 @@ who_common_channel(struct Client *source_p, struct Channel *chptr, if ((mask == NULL) || !match(mask, target_p->name) || !match(mask, target_p->username) || - !match(mask, target_p->host) || + !match(mask, target_p->host) || ((!ConfigServerHide.hide_servers || HasUMode(source_p, UMODE_OPER)) && !match(mask, target_p->servptr->name)) || !match(mask, target_p->info)) @@ -241,7 +243,7 @@ do_who_on_channel(struct Client *source_p, struct Channel *chptr, ** parv[1] = nickname mask list ** parv[2] = additional selection flag, only 'o' for now. */ -static void +static int m_who(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -257,7 +259,7 @@ m_who(struct Client *client_p, struct Client *source_p, who_global(source_p, mask, server_oper); sendto_one(source_p, form_str(RPL_ENDOFWHO), me.name, source_p->name, "*"); - return; + return 0; } /* mask isn't NULL at this point. repeat after me... -db */ @@ -277,7 +279,7 @@ m_who(struct Client *client_p, struct Client *source_p, sendto_one(source_p, form_str(RPL_ENDOFWHO), me.name, source_p->name, mask); - return; + return 0; } /* '/who nick' */ @@ -299,7 +301,7 @@ m_who(struct Client *client_p, struct Client *source_p, sendto_one(source_p, form_str(RPL_ENDOFWHO), me.name, source_p->name, mask); - return; + return 0; } /* '/who *' */ @@ -314,7 +316,7 @@ m_who(struct Client *client_p, struct Client *source_p, sendto_one(source_p, form_str(RPL_ENDOFWHO), me.name, source_p->name, "*"); - return; + return 0; } /* '/who 0' */ @@ -326,11 +328,13 @@ m_who(struct Client *client_p, struct Client *source_p, /* Wasn't a nick, wasn't a channel, wasn't a '*' so ... */ sendto_one(source_p, form_str(RPL_ENDOFWHO), me.name, source_p->name, mask); + return 0; } -static struct Message who_msgtab = { +static struct Message who_msgtab = +{ "WHO", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_who, m_ignore, m_ignore, m_who, m_ignore} + { m_unregistered, m_who, m_ignore, m_ignore, m_who, m_ignore } }; static void @@ -345,7 +349,8 @@ module_exit(void) mod_del_cmd(&who_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_whois.c b/modules/m_whois.c index 858f865..d45f48f 100644 --- a/modules/m_whois.c +++ b/modules/m_whois.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_whois.c: Shows who a user is. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2005 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_whois.c + * \brief Includes required functions for processing the WHOIS command. + * \version $Id$ */ #include "stdinc.h" @@ -216,7 +218,7 @@ do_whois(struct Client *source_p, const char *name) ** parv[0] = sender prefix ** parv[1] = nickname masklist */ -static void +static int m_whois(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -226,7 +228,7 @@ m_whois(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), me.name, source_p->name); - return; + return 0; } if (parc > 2 && !EmptyString(parv[2])) @@ -236,7 +238,7 @@ m_whois(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name); - return; + return 0; } last_used = CurrentTime; @@ -251,12 +253,13 @@ m_whois(struct Client *client_p, struct Client *source_p, if (hunt_server(client_p, source_p, ":%s WHOIS %s :%s", 1, parc, parv) != HUNTED_ISME) - return; + return 0; parv[1] = parv[2]; } do_whois(source_p, parv[1]); + return 0; } /* @@ -264,7 +267,7 @@ m_whois(struct Client *client_p, struct Client *source_p, ** parv[0] = sender prefix ** parv[1] = nickname masklist */ -static void +static int mo_whois(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -272,22 +275,24 @@ mo_whois(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), me.name, source_p->name); - return; + return 0; } if (parc > 2 && !EmptyString(parv[2])) { if (hunt_server(client_p, source_p, ":%s WHOIS %s :%s", 1, parc, parv) != HUNTED_ISME) - return; + return 0; parv[1] = parv[2]; } do_whois(source_p, parv[1]); + return 0; } -static struct Message whois_msgtab = { +static struct Message whois_msgtab = +{ "WHOIS", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_whois, mo_whois, m_ignore, mo_whois, m_ignore } }; @@ -304,7 +309,8 @@ module_exit(void) mod_del_cmd(&whois_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_whowas.c b/modules/m_whowas.c index 6becef5..02c43e8 100644 --- a/modules/m_whowas.c +++ b/modules/m_whowas.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_whois.c: Shows who a user was. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_whowas.c + * \brief Includes required functions for processing the WHOWAS command. + * \version $Id$ */ #include "stdinc.h" @@ -95,7 +97,7 @@ whowas_do(struct Client *client_p, struct Client *source_p, ** parv[0] = sender prefix ** parv[1] = nickname queried */ -static void +static int m_whowas(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -105,22 +107,23 @@ m_whowas(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), me.name, source_p->name); - return; + return 0; } if ((last_used + ConfigFileEntry.pace_wait) > CurrentTime) { sendto_one(source_p,form_str(RPL_LOAD2HI), me.name, source_p->name); - return; + return 0; } last_used = CurrentTime; whowas_do(client_p, source_p, parc, parv); + return 0; } -static void +static int mo_whowas(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -128,13 +131,15 @@ mo_whowas(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), me.name, source_p->name); - return; + return 0; } whowas_do(client_p, source_p, parc, parv); + return 0; } -static struct Message whowas_msgtab = { +static struct Message whowas_msgtab = +{ "WHOWAS", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_whowas, mo_whowas, m_ignore, mo_whowas, m_ignore } }; @@ -151,7 +156,8 @@ module_exit(void) mod_del_cmd(&whowas_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", diff --git a/modules/m_xline.c b/modules/m_xline.c index 8f04b24..3fea582 100644 --- a/modules/m_xline.c +++ b/modules/m_xline.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_xline.c: xlines an user. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 2003-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_xline.c + * \brief Includes required functions for processing the XLINE/UNXLINE command. + * \version $Id$ */ #include "stdinc.h" @@ -62,7 +64,7 @@ static void relay_xline(struct Client *, char *[]); * side effects - x line is added * */ -static void +static int mo_xline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -74,9 +76,9 @@ mo_xline(struct Client *client_p, struct Client *source_p, if (!HasOFlag(source_p, OPER_FLAG_X)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), - me.name, source_p->name, "xline"); - return; + sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, + source_p->name, "xline"); + return 0; } /* @@ -85,47 +87,47 @@ mo_xline(struct Client *client_p, struct Client *source_p, */ if (parse_aline("XLINE", source_p, parc, parv, AWILD, &gecos, NULL, &tkline_time, &target_server, &reason) < 0) - return; + return 0; if (target_server != NULL) { /* if a given expire time is given, ENCAP it */ if (tkline_time != 0) sendto_match_servs(source_p, target_server, CAP_ENCAP, - "ENCAP %s XLINE %d %s 0 :%s", - target_server, (int)tkline_time, gecos, reason); + "ENCAP %s XLINE %d %s 0 :%s", + target_server, (int)tkline_time, gecos, reason); else sendto_match_servs(source_p, target_server, CAP_CLUSTER, - "XLINE %s %s %d :%s", - target_server, gecos, (int)tkline_time, reason); + "XLINE %s %s %d :%s", + target_server, gecos, (int)tkline_time, reason); /* Allow ON to apply local xline as well if it matches */ if (match(target_server, me.name)) - return; + return 0; } - else + else { if (tkline_time != 0) cluster_a_line(source_p, "ENCAP", CAP_ENCAP, SHARED_XLINE, - "XLINE %d %s 0 :%s", (int)tkline_time, gecos, reason); + "XLINE %d %s 0 :%s", (int)tkline_time, gecos, reason); else cluster_a_line(source_p, "XLINE", CAP_KLN, SHARED_XLINE, - "%s 0 :%s", gecos, reason); + "%s 0 :%s", gecos, reason); } if (!valid_xline(source_p, gecos, reason, 0)) - return; + return 0; - if ((conf = find_matching_name_conf(CONF_XLINE, gecos, - NULL, NULL, 0)) != NULL) + if ((conf = find_matching_name_conf(CONF_XLINE, gecos, NULL, NULL, 0))) { sendto_one(source_p, ":%s NOTICE %s :[%s] already X-Lined by [%s] - %s", me.name, source_p->name, gecos, conf->name, conf->reason); - return; + return 0; } write_xline(source_p, gecos, reason, tkline_time); + return 0; } /* ms_xline() @@ -135,20 +137,21 @@ mo_xline(struct Client *client_p, struct Client *source_p, * outputs - none * side effects - propagates xline, applies it if we are a target */ -static void +static int ms_xline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if (parc != 5 || EmptyString(parv[4])) - return; + return 0; if (!IsClient(source_p)) - return; + return 0; if (!valid_xline(source_p, parv[2], parv[4], 0)) - return; + return 0; relay_xline(source_p, parv); + return 0; } /* me_xline() @@ -165,16 +168,17 @@ ms_xline(struct Client *client_p, struct Client *source_p, * parv[5] = reason * * outputs - none - * side effects - + * side effects - */ -static void +static int me_xline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if (!IsClient(source_p) || parc != 5) - return; + return 0; relay_xline(source_p, parv); + return 0; } static void @@ -196,8 +200,7 @@ relay_xline(struct Client *source_p, char *parv[]) source_p->username, source_p->host, SHARED_XLINE)) { - if ((conf = find_matching_name_conf(CONF_XLINE, parv[2], - NULL, NULL, 0)) != NULL) + if ((conf = find_matching_name_conf(CONF_XLINE, parv[2], NULL, NULL, 0))) { sendto_one(source_p, ":%s NOTICE %s :[%s] already X-Lined by [%s] - %s", ID_or_name(&me, source_p->from), @@ -219,7 +222,7 @@ relay_xline(struct Client *source_p, char *parv[]) * output - * side effects - removes a xline */ -static void +static int mo_unxline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -228,15 +231,15 @@ mo_unxline(struct Client *client_p, struct Client *source_p, if (!HasOFlag(source_p, OPER_FLAG_X)) { - sendto_one(source_p, form_str(ERR_NOPRIVS), - me.name, source_p->name, "unxline"); - return; + sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, + source_p->name, "xline"); + return 0; } /* UNXLINE bill ON irc.server.com */ if (parse_aline("UNXLINE", source_p, parc, parv, 0, &gecos, NULL, NULL, &target_server, NULL) < 0) - return; + return 0; if (target_server != NULL) { @@ -245,13 +248,14 @@ mo_unxline(struct Client *client_p, struct Client *source_p, /* Allow ON to apply local unxline as well if it matches */ if (match(target_server, me.name)) - return; + return 0; } else cluster_a_line(source_p, "UNXLINE", CAP_CLUSTER, SHARED_UNXLINE, - "%s", gecos); + "%s", gecos); remove_xline(source_p, gecos); + return 0; } /* ms_unxline() @@ -260,26 +264,27 @@ mo_unxline(struct Client *client_p, struct Client *source_p, * outputs - none * side effects - propagates unxline, applies it if we are a target */ -static void +static int ms_unxline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { if (parc != 3) - return; + return 0; if (!IsClient(source_p) || EmptyString(parv[2])) - return; + return 0; sendto_match_servs(source_p, parv[1], CAP_CLUSTER, "UNXLINE %s %s", parv[1], parv[2]); if (match(parv[1], me.name)) - return; + return 0; if (HasFlag(source_p, FLAGS_SERVICE) || find_matching_name_conf(CONF_ULINE, source_p->servptr->name, source_p->username, source_p->host, SHARED_UNXLINE)) remove_xline(source_p, parv[2]); + return 0; } /* valid_xline() @@ -319,7 +324,7 @@ valid_xline(struct Client *source_p, char *gecos, char *reason, int warn) */ static void write_xline(struct Client *source_p, char *gecos, char *reason, - time_t tkline_time) + time_t tkline_time) { struct MaskItem *conf = conf_make(CONF_XLINE); @@ -333,15 +338,14 @@ write_xline(struct Client *source_p, char *gecos, char *reason, if (tkline_time != 0) { sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, - "%s added temporary %d min. X-Line for [%s] [%s]", - get_oper_name(source_p), (int)tkline_time/60, - conf->name, conf->reason); + "%s added temporary %d min. X-Line for [%s] [%s]", + get_oper_name(source_p), (int)tkline_time/60, + conf->name, conf->reason); sendto_one(source_p, ":%s NOTICE %s :Added temporary %d min. X-Line [%s]", - MyConnect(source_p) ? me.name : ID_or_name(&me, source_p->from), - source_p->name, (int)tkline_time/60, conf->name); + MyConnect(source_p) ? me.name : ID_or_name(&me, source_p->from), + source_p->name, (int)tkline_time/60, conf->name); ilog(LOG_TYPE_XLINE, "%s added temporary %d min. X-Line for [%s] [%s]", - source_p->name, (int)tkline_time/60, - conf->name, conf->reason); + source_p->name, (int)tkline_time/60, conf->name, conf->reason); conf->until = CurrentTime + tkline_time; } else @@ -408,12 +412,14 @@ remove_xline_match(const char *gecos) return 0; } -static struct Message xline_msgtab = { +static struct Message xline_msgtab = +{ "XLINE", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_not_oper, ms_xline, me_xline, mo_xline, m_ignore } }; -static struct Message unxline_msgtab = { +static struct Message unxline_msgtab = +{ "UNXLINE", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_not_oper, ms_unxline, m_ignore, mo_unxline, m_ignore } }; @@ -432,7 +438,8 @@ module_exit(void) mod_del_cmd(&unxline_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", |