summaryrefslogtreecommitdiff
path: root/modules/m_svinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/m_svinfo.c')
-rw-r--r--modules/m_svinfo.c33
1 files changed, 19 insertions, 14 deletions
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$",