From 8049d81b2a13d802a41016396781b02fad16f443 Mon Sep 17 00:00:00 2001 From: "Kevin L. Mitchell" Date: Fri, 28 Apr 2000 17:34:45 +0000 Subject: [PATCH] Author: Kev Log message: a couple more of the send.c conversions, and make all those RPL_EXPLICITs into SND_EXPLICITs Status: Unstable, needs testing Testing needed: Still need to verify all of the command code paths carefully git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@214 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 16 +++++++++++++++- include/ircd_reply.h | 2 +- ircd/gline.c | 2 +- ircd/ircd.c | 4 ++-- ircd/ircd_relay.c | 2 +- ircd/ircd_reply.c | 4 ++-- ircd/list.c | 16 ++++++++-------- ircd/m_defaults.c | 4 ++-- ircd/m_desynch.c | 20 ++++++-------------- ircd/m_info.c | 12 ++++++------ ircd/m_motd.c | 12 ++++++------ ircd/m_pong.c | 2 +- ircd/m_proto.c | 2 +- ircd/m_rehash.c | 1 - ircd/m_userhost.c | 2 +- ircd/m_whois.c | 6 +++--- ircd/res.c | 4 ++-- ircd/s_conf.c | 14 +++++++------- ircd/s_debug.c | 32 ++++++++++++++++---------------- ircd/s_misc.c | 24 ++++++++++++------------ ircd/s_user.c | 6 +++--- 21 files changed, 96 insertions(+), 91 deletions(-) diff --git a/ChangeLog b/ChangeLog index 29e7f0e..2c9e013 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,19 @@ 2000-04-28 Kevin L. Mitchell + * include/ircd_reply.h (SND_EXPLICIT): use instead of RPL_EXPLICIT + + * ircd/ircd_reply.c (send_reply): use SND_EXPLICIT instead of + RPL_EXPLICIT + + * ircd/m_userhost.c (m_userhost): add a dead code comment + + * ircd/m_desynch.c: forgot one... + + * ircd/m_rehash.c (mo_rehash): er, duplicates :) + + * ircd/m_proto.c (proto_send_supported): just change a comment so + it doesn't show up in my scans + * ircd/ircd_reply.c (send_reply): fix a slight bug... * ircd/s_numeric.c (do_numeric): use new sendcmdto_* functions, @@ -955,7 +969,7 @@ # # ChangeLog for ircu2.10.11 # -# $Id: ChangeLog,v 1.111 2000-04-28 16:16:06 kev Exp $ +# $Id: ChangeLog,v 1.112 2000-04-28 17:34:44 kev Exp $ # # Insert new changes at beginning of the change list. # diff --git a/include/ircd_reply.h b/include/ircd_reply.h index c792bdb..a99ac3e 100644 --- a/include/ircd_reply.h +++ b/include/ircd_reply.h @@ -30,7 +30,7 @@ extern int send_error_to_client(struct Client* cptr, int error, ...); extern int send_reply(struct Client *to, int reply, ...); extern int send_admin_info(struct Client* sptr, const struct ConfItem* data); -#define RPL_EXPLICIT 0x40000000 /* first arg is a pattern to use */ +#define SND_EXPLICIT 0x40000000 /* first arg is a pattern to use */ #endif /* INCLUDED_ircd_reply_h */ diff --git a/ircd/gline.c b/ircd/gline.c index 86017fc..a79f5d8 100644 --- a/ircd/gline.c +++ b/ircd/gline.c @@ -152,7 +152,7 @@ do_gline(struct Client *cptr, struct Client *sptr, struct Gline *gline) (!acptr->user->username || match(gline->gl_user, acptr->user->username) == 0)) { /* ok, here's one that got G-lined */ - send_reply(acptr, RPL_EXPLICIT | ERR_YOUREBANNEDCREEP, ":%s", + send_reply(acptr, SND_EXPLICIT | ERR_YOUREBANNEDCREEP, ":%s", gline->gl_reason); /* let the ops know about it */ diff --git a/ircd/ircd.c b/ircd/ircd.c index f490331..47ea5c6 100644 --- a/ircd/ircd.c +++ b/ircd/ircd.c @@ -340,9 +340,9 @@ static time_t check_pings(void) * nospoof PONG. */ if (*cptr->name && cptr->user && *cptr->user->username) { - send_reply(cptr, RPL_EXPLICIT | ERR_BADPING, + send_reply(cptr, SND_EXPLICIT | ERR_BADPING, ":Your client may not be compatible with this server."); - send_reply(cptr, RPL_EXPLICIT | ERR_BADPING, + send_reply(cptr, SND_EXPLICIT | ERR_BADPING, ":Compatible clients are available at " "ftp://ftp.undernet.org/pub/irc/clients"); } diff --git a/ircd/ircd_relay.c b/ircd/ircd_relay.c index a6d771d..7930420 100644 --- a/ircd/ircd_relay.c +++ b/ircd/ircd_relay.c @@ -291,7 +291,7 @@ void server_relay_private_message(struct Client* sptr, const char* name, const c * nickname addressed? */ if (0 == (acptr = findNUser(name)) || !IsUser(acptr)) { - send_reply(sptr, RPL_EXPLICIT | ERR_NOSUCHNICK, "* :Target left UnderNet. " + send_reply(sptr, SND_EXPLICIT | ERR_NOSUCHNICK, "* :Target left UnderNet. " "Failed to deliver: [%.20s]", text); return; } diff --git a/ircd/ircd_reply.c b/ircd/ircd_reply.c index 043da3c..57a97de 100644 --- a/ircd/ircd_reply.c +++ b/ircd/ircd_reply.c @@ -101,11 +101,11 @@ int send_reply(struct Client *to, int reply, ...) assert(0 != to); assert(0 != reply); - num = get_error_numeric(reply & ~RPL_EXPLICIT); /* get reply... */ + num = get_error_numeric(reply & ~SND_EXPLICIT); /* get reply... */ va_start(vd.vd_args, reply); - if (reply & RPL_EXPLICIT) /* get right pattern */ + if (reply & SND_EXPLICIT) /* get right pattern */ vd.vd_format = (const char *) va_arg(vd.vd_args, char *); else vd.vd_format = num->format; diff --git a/ircd/list.c b/ircd/list.c index 0eff954..275062e 100644 --- a/ircd/list.c +++ b/ircd/list.c @@ -315,34 +315,34 @@ void send_listinfo(struct Client *cptr, char *name) { int inuse = 0, mem = 0, tmp = 0; - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":Local: inuse: %d(%d)", + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Local: inuse: %d(%d)", inuse += cloc.inuse, tmp = cloc.inuse * CLIENT_LOCAL_SIZE); mem += tmp; - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":Remote: inuse: %d(%d)", + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Remote: inuse: %d(%d)", crem.inuse, tmp = crem.inuse * CLIENT_REMOTE_SIZE); mem += tmp; inuse += crem.inuse; - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":Users: inuse: %d(%d)", + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Users: inuse: %d(%d)", users.inuse, tmp = users.inuse * sizeof(struct User)); mem += tmp; inuse += users.inuse; - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":Servs: inuse: %d(%d)", + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Servs: inuse: %d(%d)", servs.inuse, tmp = servs.inuse * sizeof(struct Server)); mem += tmp; inuse += servs.inuse; - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":Links: inuse: %d(%d)", + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Links: inuse: %d(%d)", links.inuse, tmp = links.inuse * sizeof(struct SLink)); mem += tmp; inuse += links.inuse; - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":Classes: inuse: %d(%d)", + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Classes: inuse: %d(%d)", classs.inuse, tmp = classs.inuse * sizeof(struct ConfClass)); mem += tmp; inuse += classs.inuse; - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":Confs: inuse: %d(%d)", + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Confs: inuse: %d(%d)", GlobalConfCount, tmp = GlobalConfCount * sizeof(struct ConfItem)); mem += tmp; inuse += GlobalConfCount; - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":Totals: inuse %d %d", + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Totals: inuse %d %d", inuse, mem); } diff --git a/ircd/m_defaults.c b/ircd/m_defaults.c index 4404cc1..06f6baa 100644 --- a/ircd/m_defaults.c +++ b/ircd/m_defaults.c @@ -105,7 +105,7 @@ int m_not_oper(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) int m_unregistered(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { - send_reply(cptr, RPL_EXPLICIT | ERR_NOTREGISTERED, "%s :Register first.", + send_reply(cptr, SND_EXPLICIT | ERR_NOTREGISTERED, "%s :Register first.", parv[0]); return 0; } @@ -123,7 +123,7 @@ int m_ignore(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) int m_unsupported(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { #if 0 - send_reply(cptr, RPL_EXPLICIT | ERR_UNSUPPORTED, "%s :Unsupported command", + send_reply(cptr, SND_EXPLICIT | ERR_UNSUPPORTED, "%s :Unsupported command", parv[0]); #endif return 0; diff --git a/ircd/m_desynch.c b/ircd/m_desynch.c index 89b998c..de7cad8 100644 --- a/ircd/m_desynch.c +++ b/ircd/m_desynch.c @@ -92,6 +92,7 @@ #include "ircd.h" #include "ircd_reply.h" #include "ircd_string.h" +#include "msg.h" #include "numeric.h" #include "numnicks.h" #include "s_bsd.h" @@ -111,18 +112,9 @@ int ms_desynch(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { if (IsServer(sptr) && parc >= 2) - { - int i; - struct Client *acptr; - /* Send message to local +g clients as if it were a wallops */ - sprintf_irc(sendbuf, ":%s WALLOPS :%s", parv[0], parv[parc - 1]); - for (i = 0; i <= HighestFd; i++) - if ((acptr = LocalClientArray[i]) && !IsServer(acptr) && !IsMe(acptr) && - SendDebug(acptr)) - sendbufto_one(acptr); - /* Send message to remote +g clients */ - sendto_g_serv_butone(cptr, "%s DESYNCH :%s", NumServ(sptr), parv[parc - 1]); - } + sendcmdto_flag_butone(sptr, CMD_DESYNCH, cptr, FLAGS_DEBUG, ":%s", + parv[parc - 1]); + return 0; } @@ -147,9 +139,9 @@ int m_desynch(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) for (i = 0; i <= HighestFd; i++) if ((acptr = LocalClientArray[i]) && !IsServer(acptr) && !IsMe(acptr) && SendDebug(acptr)) - sendbufto_one(acptr); + sendbufto_one(acptr); /* XXX DEAD */ /* Send message to remote +g clients */ - sendto_g_serv_butone(cptr, "%s DESYNCH :%s", NumServ(sptr), parv[parc - 1]); + sendto_g_serv_butone(cptr, "%s DESYNCH :%s", NumServ(sptr), parv[parc - 1]); /* XXX DEAD */ } return 0; } diff --git a/ircd/m_info.c b/ircd/m_info.c index d1c28c9..3fe6a26 100644 --- a/ircd/m_info.c +++ b/ircd/m_info.c @@ -126,9 +126,9 @@ int m_info(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) send_reply(sptr, RPL_INFO, *text++); send_reply(sptr, RPL_INFO, ""); } - send_reply(sptr, RPL_EXPLICIT | RPL_INFO, ":Birth Date: %s, compile # %s", + send_reply(sptr, SND_EXPLICIT | RPL_INFO, ":Birth Date: %s, compile # %s", creation, generation); - send_reply(sptr, RPL_EXPLICIT | RPL_INFO, ":On-line since %s", + send_reply(sptr, SND_EXPLICIT | RPL_INFO, ":On-line since %s", myctime(me.firsttime)); send_reply(sptr, RPL_ENDOFINFO); } @@ -163,9 +163,9 @@ int ms_info(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) send_reply(sptr, RPL_INFO, *text++); send_reply(sptr, RPL_INFO, ""); } - send_reply(sptr, RPL_EXPLICIT | RPL_INFO, ":Birth Date: %s, compile # %s", + send_reply(sptr, SND_EXPLICIT | RPL_INFO, ":Birth Date: %s, compile # %s", creation, generation); - send_reply(sptr, RPL_EXPLICIT | RPL_INFO, ":On-line since %s", + send_reply(sptr, SND_EXPLICIT | RPL_INFO, ":On-line since %s", myctime(me.firsttime)); send_reply(sptr, RPL_ENDOFINFO); } @@ -197,9 +197,9 @@ int mo_info(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) send_reply(sptr, RPL_INFO, *text++); send_reply(sptr, RPL_INFO, ""); } - send_reply(sptr, RPL_EXPLICIT | RPL_INFO, ":Birth Date: %s, compile # %s", + send_reply(sptr, SND_EXPLICIT | RPL_INFO, ":Birth Date: %s, compile # %s", creation, generation); - send_reply(sptr, RPL_EXPLICIT | RPL_INFO, ":On-line since %s", + send_reply(sptr, SND_EXPLICIT | RPL_INFO, ":On-line since %s", myctime(me.firsttime)); send_reply(sptr, RPL_ENDOFINFO); } diff --git a/ircd/m_motd.c b/ircd/m_motd.c index 88eb8f4..4a83540 100644 --- a/ircd/m_motd.c +++ b/ircd/m_motd.c @@ -178,7 +178,7 @@ int m_motd(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) if (tm) /* Not remote? */ { send_reply(sptr, RPL_MOTDSTART, me.name); - send_reply(sptr, RPL_EXPLICIT | RPL_MOTD, "- %d/%d/%d %d:%02d", + send_reply(sptr, SND_EXPLICIT | RPL_MOTD, "- %d/%d/%d %d:%02d", tm->tm_mday, tm->tm_mon + 1, 1900 + tm->tm_year, tm->tm_hour, tm->tm_min); count = 100; @@ -196,9 +196,9 @@ int m_motd(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) else { send_reply(sptr, RPL_MOTDSTART, me.name); - send_reply(sptr, RPL_EXPLICIT | RPL_MOTD, ":Type /MOTD to read the " + send_reply(sptr, SND_EXPLICIT | RPL_MOTD, ":Type /MOTD to read the " "AUP before continuing using this service."); - send_reply(sptr, RPL_EXPLICIT | RPL_MOTD, ":The message of the day was " + send_reply(sptr, SND_EXPLICIT | RPL_MOTD, ":The message of the day was " "last changed: %d/%d/%d", tm->tm_mday, tm->tm_mon + 1, 1900 + tm->tm_year); } @@ -284,7 +284,7 @@ int ms_motd(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) if (tm) /* Not remote? */ { send_reply(sptr, RPL_MOTDSTART, me.name); - send_reply(sptr, RPL_EXPLICIT | RPL_MOTD, ":- %d/%d/%d %d:%02d", + send_reply(sptr, SND_EXPLICIT | RPL_MOTD, ":- %d/%d/%d %d:%02d", tm->tm_mday, tm->tm_mon + 1, 1900 + tm->tm_year, tm->tm_hour, tm->tm_min); count = 100; @@ -302,9 +302,9 @@ int ms_motd(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) else { send_reply(sptr, RPL_MOTDSTART, me.name); - send_reply(sptr, RPL_EXPLICIT | RPL_MOTD, ":Type /MOTD to read the " + send_reply(sptr, SND_EXPLICIT | RPL_MOTD, ":Type /MOTD to read the " "AUP before continuing using this service."); - send_reply(sptr, RPL_EXPLICIT | RPL_MOTD, ":The message of the day was " + send_reply(sptr, SND_EXPLICIT | RPL_MOTD, ":The message of the day was " "last changed: %d/%d/%d", tm->tm_mday, tm->tm_mon + 1, 1900 + tm->tm_year); } diff --git a/ircd/m_pong.c b/ircd/m_pong.c index bbe4d53..95a411e 100644 --- a/ircd/m_pong.c +++ b/ircd/m_pong.c @@ -170,7 +170,7 @@ int mr_pong(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) return register_user(cptr, sptr, sptr->name, sptr->user->username); } else - send_reply(sptr, RPL_EXPLICIT | ERR_BADPING, + send_reply(sptr, SND_EXPLICIT | ERR_BADPING, ":To connect, type /QUOTE PONG %u", sptr->cookie); } return 0; diff --git a/ircd/m_proto.c b/ircd/m_proto.c index 9abd3d1..fa82b58 100644 --- a/ircd/m_proto.c +++ b/ircd/m_proto.c @@ -130,7 +130,7 @@ int proto_handle_req(struct Client* cptr, const char* msg) int proto_send_supported(struct Client* cptr) { /* - * sendto_one(cptr, RPL_PROTOLIST, me.name, cptr->name, "stuff"); + * send_reply(cptr, RPL_PROTOLIST, "stuff"); */ return 0; } diff --git a/ircd/m_rehash.c b/ircd/m_rehash.c index 24055ea..0d2358a 100644 --- a/ircd/m_rehash.c +++ b/ircd/m_rehash.c @@ -115,7 +115,6 @@ int mo_rehash(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) #endif { send_reply(sptr, ERR_NOPRIVILEGES); - sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); return 0; } send_reply(sptr, RPL_REHASHING, configfile); diff --git a/ircd/m_userhost.c b/ircd/m_userhost.c index b372e58..a01d38b 100644 --- a/ircd/m_userhost.c +++ b/ircd/m_userhost.c @@ -155,7 +155,7 @@ int m_userhost(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) else { if (i < j) - sendbufto_one(sptr); + sendbufto_one(sptr); /* XXX DEAD */ sendto_one(sptr, err_str(ERR_NOSUCHNICK), me.name, parv[0], s); /* XXX DEAD */ sbuf = sprintf_irc(sendbuf, rpl_str(RPL_USERHOST), me.name, parv[0]); j = i - 1; diff --git a/ircd/m_whois.c b/ircd/m_whois.c index 034374f..0f2bf93 100644 --- a/ircd/m_whois.c +++ b/ircd/m_whois.c @@ -245,7 +245,7 @@ exact_match: { if (len + strlen(chptr->chname) + mlen > BUFSIZE - 5) { - send_reply(sptr, RPL_EXPLICIT | RPL_WHOISCHANNELS, + send_reply(sptr, SND_EXPLICIT | RPL_WHOISCHANNELS, "%s :%s", name, buf); *buf = '\0'; len = 0; @@ -455,7 +455,7 @@ exact_match: { if (len + strlen(chptr->chname) + mlen > BUFSIZE - 5) { - send_reply(sptr, RPL_EXPLICIT | RPL_WHOISCHANNELS, + send_reply(sptr, SND_EXPLICIT | RPL_WHOISCHANNELS, "%s :%s", name, buf); *buf = '\0'; len = 0; @@ -665,7 +665,7 @@ exact_match: { if (len + strlen(chptr->chname) + mlen > BUFSIZE - 5) { - send_reply(sptr, RPL_EXPLICIT | RPL_WHOISCHANNELS, + send_reply(sptr, SND_EXPLICIT | RPL_WHOISCHANNELS, "%s :%s", name, buf); *buf = '\0'; len = 0; diff --git a/ircd/res.c b/ircd/res.c index c708c3f..ba447e2 100644 --- a/ircd/res.c +++ b/ircd/res.c @@ -1726,12 +1726,12 @@ size_t cres_mem(struct Client* sptr) } if (cachedCount != cache_count) { - send_reply(sptr, RPL_EXPLICIT | RPL_STATSDEBUG, + send_reply(sptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Resolver: cache count mismatch: %d != %d", cachedCount, cache_count); assert(cachedCount == cache_count); } - send_reply(sptr, RPL_EXPLICIT | RPL_STATSDEBUG, + send_reply(sptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Resolver: cache %d(%d) requests %d(%d)", cache_count, cache_mem, request_count, request_mem); return cache_mem + request_mem; diff --git a/ircd/s_conf.c b/ircd/s_conf.c index dbd0f02..ec96c49 100644 --- a/ircd/s_conf.c +++ b/ircd/s_conf.c @@ -164,7 +164,7 @@ static void killcomment(struct Client *sptr, char *parv, char *filename) if (NULL == (file = fbopen(filename, "r"))) { send_reply(sptr, ERR_NOMOTD); - send_reply(sptr, RPL_EXPLICIT | ERR_YOUREBANNEDCREEP, + send_reply(sptr, SND_EXPLICIT | ERR_YOUREBANNEDCREEP, ":Connection from your host is refused on this server."); return; } @@ -177,7 +177,7 @@ static void killcomment(struct Client *sptr, char *parv, char *filename) *tmp = '\0'; send_reply(sptr, RPL_MOTD, line); } - send_reply(sptr, RPL_EXPLICIT | ERR_YOUREBANNEDCREEP, + send_reply(sptr, SND_EXPLICIT | ERR_YOUREBANNEDCREEP, ":Connection from your host is refused on this server."); fbclose(file); } @@ -1413,14 +1413,14 @@ int find_kill(struct Client *cptr) } } if (reply[0]) - send_reply(cptr, RPL_EXPLICIT | ERR_YOUREBANNEDCREEP, reply); + send_reply(cptr, SND_EXPLICIT | ERR_YOUREBANNEDCREEP, reply); else if (tmp) { if (EmptyString(tmp->passwd)) - send_reply(cptr, RPL_EXPLICIT | ERR_YOUREBANNEDCREEP, + send_reply(cptr, SND_EXPLICIT | ERR_YOUREBANNEDCREEP, ":Connection from your host is refused on this server."); else { if (*tmp->passwd == '"') { - send_reply(cptr, RPL_EXPLICIT | ERR_YOUREBANNEDCREEP, ":%*s.", + send_reply(cptr, SND_EXPLICIT | ERR_YOUREBANNEDCREEP, ":%*s.", strlen(tmp->passwd + 1) - 1, tmp->passwd + 1); } else if (*tmp->passwd == '!') @@ -1429,7 +1429,7 @@ int find_kill(struct Client *cptr) #ifdef COMMENT_IS_FILE killcomment(cptr, cptr->name, tmp->passwd); #else - send_reply(cptr, RPL_EXPLICIT | ERR_YOUREBANNEDCREEP, ":%s.", + send_reply(cptr, SND_EXPLICIT | ERR_YOUREBANNEDCREEP, ":%s.", tmp->passwd); #endif } @@ -1438,7 +1438,7 @@ int find_kill(struct Client *cptr) /* find active glines */ /* added a check against the user's IP address to find_gline() -Kev */ else if ((agline = gline_lookup(cptr)) && GlineIsActive(agline)) - send_reply(cptr, RPL_EXPLICIT | ERR_YOUREBANNEDCREEP, ":%s.", + send_reply(cptr, SND_EXPLICIT | ERR_YOUREBANNEDCREEP, ":%s.", GlineReason(agline)); else agline = NULL; /* if a gline was found, it was inactive */ diff --git a/ircd/s_debug.c b/ircd/s_debug.c index bfa9828..904f289 100644 --- a/ircd/s_debug.c +++ b/ircd/s_debug.c @@ -235,7 +235,7 @@ void debug(int level, const char *form, ...) static void debug_enumerator(struct Client* cptr, const char* msg) { assert(0 != cptr); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":%s", msg); + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":%s", msg); } /* @@ -249,7 +249,7 @@ void send_usage(struct Client *cptr, char *nick) { os_get_rusage(cptr, CurrentTime - me.since, debug_enumerator); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":DBUF alloc %d used %d", + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":DBUF alloc %d used %d", DBufAllocCount, DBufUsedCount); } #endif /* DEBUGMODE */ @@ -355,44 +355,44 @@ void count_memory(struct Client *cptr, char *nick) for (cltmp = classes; cltmp; cltmp = cltmp->next) cl++; - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Client Local %d(%zu) Remote %d(%zu)", lc, lcm, rc, rcm); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Users %d(%zu) Invites %d(%zu)", us, us * sizeof(struct User), usi, usi * sizeof(struct SLink)); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":User channels %d(%zu) Aways %d(%zu)", memberships, memberships * sizeof(struct Membership), aw, awm); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":Attached confs %d(%zu)", + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Attached confs %d(%zu)", lcc, lcc * sizeof(struct SLink)); totcl = lcm + rcm + us * sizeof(struct User) + memberships * sizeof(struct Membership) + awm; totcl += lcc * sizeof(struct SLink) + usi * sizeof(struct SLink); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":Conflines %d(%zu)", co, + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Conflines %d(%zu)", co, com); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":Classes %d(%zu)", cl, + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Classes %d(%zu)", cl, cl * sizeof(struct ConfClass)); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Channels %d(%zu) Bans %d(%zu)", ch, chm, chb, chbm); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Channel membrs %d(%zu) invite %d(%zu)", memberships, memberships * sizeof(struct Membership), chi, chi * sizeof(struct SLink)); totch = chm + chbm + chi * sizeof(struct SLink); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Whowas users %d(%zu) away %d(%zu)", wwu, wwu * sizeof(struct User), wwa, wwam); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":Whowas array %d(%zu)", + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Whowas array %d(%zu)", NICKNAMEHISTORYLENGTH, wwm); totww = wwu * sizeof(struct User) + wwam + wwm; - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Hash: client %d(%zu), chan is the same", HASHSIZE, sizeof(void *) * HASHSIZE); @@ -405,7 +405,7 @@ void count_memory(struct Client *cptr, char *nick) * are sent. */ dbuf_count_memory(&dbufs_allocated, &dbufs_used); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":DBufs allocated %d(%zu) used %d(%zu)", DBufAllocCount, dbufs_allocated, DBufUsedCount, dbufs_used); @@ -417,11 +417,11 @@ void count_memory(struct Client *cptr, char *nick) tot += sizeof(void *) * HASHSIZE * 3; #if !defined(NDEBUG) - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":Allocations: %zu(%zu)", + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Allocations: %zu(%zu)", fda_get_block_count(), fda_get_byte_count()); #endif - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Total: ww %zu ch %zu cl %zu co %zu db %zu", totww, totch, totcl, com, dbufs_allocated); } diff --git a/ircd/s_misc.c b/ircd/s_misc.c index 8d568b4..c5d26f4 100644 --- a/ircd/s_misc.c +++ b/ircd/s_misc.c @@ -598,27 +598,27 @@ void tstats(struct Client *cptr, char *name) sp->is_ni++; } - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":accepts %u refused %u", + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":accepts %u refused %u", sp->is_ac, sp->is_ref); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":unknown commands %u prefixes %u", sp->is_unco, sp->is_unpf); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":nick collisions %u unknown closes %u", sp->is_kill, sp->is_ni); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":wrong direction %u empty %u", sp->is_wrdi, sp->is_empt); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":numerics seen %u mode fakes %u", sp->is_num, sp->is_fake); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":auth successes %u fails %u", sp->is_asuc, sp->is_abad); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":local connections %u", + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":local connections %u", sp->is_loc); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":Client server"); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":connected %u %u", + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Client server"); + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":connected %u %u", sp->is_cl, sp->is_sv); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":bytes sent %u.%uK %u.%uK", + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":bytes sent %u.%uK %u.%uK", sp->is_cks, sp->is_cbs, sp->is_sks, sp->is_sbs); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":bytes recv %u.%uK %u.%uK", + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":bytes recv %u.%uK %u.%uK", sp->is_ckr, sp->is_cbr, sp->is_skr, sp->is_sbr); - send_reply(cptr, RPL_EXPLICIT | RPL_STATSDEBUG, ":time connected %Tu %Tu", + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":time connected %Tu %Tu", sp->is_cti, sp->is_sti); } diff --git a/ircd/s_user.c b/ircd/s_user.c index 615f869..17ebfb5 100644 --- a/ircd/s_user.c +++ b/ircd/s_user.c @@ -580,11 +580,11 @@ int register_user(struct Client *cptr, struct Client *sptr, { ServerStats->is_ref++; - send_reply(cptr, RPL_EXPLICIT | ERR_INVALIDUSERNAME, + send_reply(cptr, SND_EXPLICIT | ERR_INVALIDUSERNAME, ":Your username is invalid."); - send_reply(cptr, RPL_EXPLICIT | ERR_INVALIDUSERNAME, + send_reply(cptr, SND_EXPLICIT | ERR_INVALIDUSERNAME, ":Connect with your real username, in lowercase."); - send_reply(cptr, RPL_EXPLICIT | ERR_INVALIDUSERNAME, + send_reply(cptr, SND_EXPLICIT | ERR_INVALIDUSERNAME, ":If your mail address were foo@bar.com, your username " "would be foo."); return exit_client(cptr, sptr, &me, "USER: Bad username"); -- 2.20.1