Remove trailing whitespace from all .c and .h files.
3134 bytes were removed.
This commit is contained in:
parent
00533129dc
commit
55abcbb20a
147 changed files with 2365 additions and 2365 deletions
|
@ -128,7 +128,7 @@ static void wipe_schema(void);
|
||||||
static void drop_dupes(const char *user, const char *host, const char *t);
|
static void drop_dupes(const char *user, const char *host, const char *t);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* swing your pants
|
* swing your pants
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003-2006 Lee Hardy <leeh@leeh.co.uk>
|
* Copyright (C) 2003-2006 Lee Hardy <leeh@leeh.co.uk>
|
||||||
* Copyright (C) 2003-2006 ircd-ratbox development team
|
* Copyright (C) 2003-2006 ircd-ratbox development team
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
* met:
|
* met:
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: rsdb_sqlite3.c 26182 2008-11-11 02:52:41Z androsyn $
|
* $Id: rsdb_sqlite3.c 26182 2008-11-11 02:52:41Z androsyn $
|
||||||
*/
|
*/
|
||||||
#include "stdinc.h"
|
#include "stdinc.h"
|
||||||
|
@ -82,7 +82,7 @@ rsdb_init(rsdb_error_cb * ecb)
|
||||||
{
|
{
|
||||||
rb_snprintf(errbuf, sizeof(errbuf), "Unable to open sqlite database for write: %s", strerror(errno));
|
rb_snprintf(errbuf, sizeof(errbuf), "Unable to open sqlite database for write: %s", strerror(errno));
|
||||||
mlog(errbuf);
|
mlog(errbuf);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
2478
bandb/sqlite3.c
2478
bandb/sqlite3.c
File diff suppressed because it is too large
Load diff
570
bandb/sqlite3.h
570
bandb/sqlite3.h
File diff suppressed because it is too large
Load diff
|
@ -94,7 +94,7 @@ mapi_clist_av1 test_clist[] = { &test_msgtab, NULL };
|
||||||
* terminated with NULLs.
|
* terminated with NULLs.
|
||||||
*/
|
*/
|
||||||
int doing_example_hook;
|
int doing_example_hook;
|
||||||
mapi_hlist_av1 test_hlist[] = {
|
mapi_hlist_av1 test_hlist[] = {
|
||||||
{ "doing_example_hook", &doing_example_hook, },
|
{ "doing_example_hook", &doing_example_hook, },
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
|
@ -173,7 +173,7 @@ modfini(void)
|
||||||
/* {{{ static int mo_hurt()
|
/* {{{ static int mo_hurt()
|
||||||
*
|
*
|
||||||
* HURT [<expire>] <ip> <reason>
|
* HURT [<expire>] <ip> <reason>
|
||||||
*
|
*
|
||||||
* parv[1] - expire or ip
|
* parv[1] - expire or ip
|
||||||
* parv[2] - ip or reason
|
* parv[2] - ip or reason
|
||||||
* parv[3] - reason or NULL
|
* parv[3] - reason or NULL
|
||||||
|
@ -459,7 +459,7 @@ new_local_user_hook(struct Client *source_p)
|
||||||
SetTGChange(source_p);
|
SetTGChange(source_p);
|
||||||
rb_dlinkAddAlloc(source_p, &hurt_state.hurt_clients);
|
rb_dlinkAddAlloc(source_p, &hurt_state.hurt_clients);
|
||||||
sendto_one_notice(source_p, ":You are hurt. Please identify to services immediately, or use /stats p for assistance.");
|
sendto_one_notice(source_p, ":You are hurt. Please identify to services immediately, or use /stats p for assistance.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Charybdis: an advanced ircd
|
* Charybdis: an advanced ircd
|
||||||
* ip_cloaking.c: provide user hostname cloaking
|
* ip_cloaking.c: provide user hostname cloaking
|
||||||
*
|
*
|
||||||
|
@ -88,7 +88,7 @@ do_host_cloak_ip(const char *inbuf, char *outbuf)
|
||||||
{
|
{
|
||||||
ipv6 = 1;
|
ipv6 = 1;
|
||||||
|
|
||||||
/* Damn you IPv6...
|
/* Damn you IPv6...
|
||||||
* We count the number of colons so we can calculate how much
|
* We count the number of colons so we can calculate how much
|
||||||
* of the host to cloak. This is because some hostmasks may not
|
* of the host to cloak. This is because some hostmasks may not
|
||||||
* have as many octets as we'd like.
|
* have as many octets as we'd like.
|
||||||
|
@ -103,7 +103,7 @@ do_host_cloak_ip(const char *inbuf, char *outbuf)
|
||||||
else if (!strchr(outbuf, '.'))
|
else if (!strchr(outbuf, '.'))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (tptr = outbuf; *tptr != '\0'; tptr++)
|
for (tptr = outbuf; *tptr != '\0'; tptr++)
|
||||||
{
|
{
|
||||||
if (*tptr == ':' || *tptr == '.')
|
if (*tptr == ':' || *tptr == '.')
|
||||||
{
|
{
|
||||||
|
@ -131,7 +131,7 @@ do_host_cloak_host(const char *inbuf, char *outbuf)
|
||||||
|
|
||||||
rb_strlcpy(outbuf, inbuf, HOSTLEN + 1);
|
rb_strlcpy(outbuf, inbuf, HOSTLEN + 1);
|
||||||
|
|
||||||
/* pass 1: scramble first section of hostname using base26
|
/* pass 1: scramble first section of hostname using base26
|
||||||
* alphabet toasted against the FNV hash of the string.
|
* alphabet toasted against the FNV hash of the string.
|
||||||
*
|
*
|
||||||
* numbers are not changed at this time, only letters.
|
* numbers are not changed at this time, only letters.
|
||||||
|
@ -157,7 +157,7 @@ do_host_cloak_host(const char *inbuf, char *outbuf)
|
||||||
*tptr = '0' + (*tptr + accum) % 10;
|
*tptr = '0' + (*tptr + accum) % 10;
|
||||||
|
|
||||||
accum = (accum << 1) | (accum >> 31);
|
accum = (accum << 1) | (accum >> 31);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -141,7 +141,7 @@ do_host_cloak_host(const char *inbuf, char *outbuf)
|
||||||
|
|
||||||
strncpy(outbuf, inbuf, HOSTLEN);
|
strncpy(outbuf, inbuf, HOSTLEN);
|
||||||
|
|
||||||
/* pass 1: scramble first section of hostname using base26
|
/* pass 1: scramble first section of hostname using base26
|
||||||
* alphabet toasted against the weighted entropy of the string.
|
* alphabet toasted against the weighted entropy of the string.
|
||||||
*
|
*
|
||||||
* numbers are not changed at this time, only letters.
|
* numbers are not changed at this time, only letters.
|
||||||
|
@ -164,7 +164,7 @@ do_host_cloak_host(const char *inbuf, char *outbuf)
|
||||||
{
|
{
|
||||||
*tptr = 48 + ((*tptr * accum) % 10);
|
*tptr = 48 + ((*tptr * accum) % 10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Charybdis: an advanced ircd
|
* Charybdis: an advanced ircd
|
||||||
* ip_cloaking.c: provide user hostname cloaking
|
* ip_cloaking.c: provide user hostname cloaking
|
||||||
*
|
*
|
||||||
|
@ -88,7 +88,7 @@ do_host_cloak_ip(const char *inbuf, char *outbuf)
|
||||||
{
|
{
|
||||||
ipv6 = 1;
|
ipv6 = 1;
|
||||||
|
|
||||||
/* Damn you IPv6...
|
/* Damn you IPv6...
|
||||||
* We count the number of colons so we can calculate how much
|
* We count the number of colons so we can calculate how much
|
||||||
* of the host to cloak. This is because some hostmasks may not
|
* of the host to cloak. This is because some hostmasks may not
|
||||||
* have as many octets as we'd like.
|
* have as many octets as we'd like.
|
||||||
|
@ -103,7 +103,7 @@ do_host_cloak_ip(const char *inbuf, char *outbuf)
|
||||||
else if (!strchr(outbuf, '.'))
|
else if (!strchr(outbuf, '.'))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (tptr = outbuf; *tptr != '\0'; tptr++)
|
for (tptr = outbuf; *tptr != '\0'; tptr++)
|
||||||
{
|
{
|
||||||
if (*tptr == ':' || *tptr == '.')
|
if (*tptr == ':' || *tptr == '.')
|
||||||
{
|
{
|
||||||
|
@ -131,7 +131,7 @@ do_host_cloak_host(const char *inbuf, char *outbuf)
|
||||||
|
|
||||||
rb_strlcpy(outbuf, inbuf, HOSTLEN + 1);
|
rb_strlcpy(outbuf, inbuf, HOSTLEN + 1);
|
||||||
|
|
||||||
/* pass 1: scramble first section of hostname using base26
|
/* pass 1: scramble first section of hostname using base26
|
||||||
* alphabet toasted against the FNV hash of the string.
|
* alphabet toasted against the FNV hash of the string.
|
||||||
*
|
*
|
||||||
* numbers are not changed at this time, only letters.
|
* numbers are not changed at this time, only letters.
|
||||||
|
@ -157,7 +157,7 @@ do_host_cloak_host(const char *inbuf, char *outbuf)
|
||||||
*tptr = '0' + (*tptr + accum) % 10;
|
*tptr = '0' + (*tptr + accum) % 10;
|
||||||
|
|
||||||
accum = (accum << 1) | (accum >> 31);
|
accum = (accum << 1) | (accum >> 31);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -73,7 +73,7 @@ do_host_cloak(const char *inbuf, char *outbuf, int ipmask)
|
||||||
{
|
{
|
||||||
int cyc;
|
int cyc;
|
||||||
unsigned int hosthash = 1, hosthash2 = 1;
|
unsigned int hosthash = 1, hosthash2 = 1;
|
||||||
unsigned int maxcycle = strlen(inbuf);
|
unsigned int maxcycle = strlen(inbuf);
|
||||||
int len1;
|
int len1;
|
||||||
const char *rest, *next;
|
const char *rest, *next;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) infinity-infinity God <God@Heaven>
|
* Copyright (C) infinity-infinity God <God@Heaven>
|
||||||
*
|
*
|
||||||
* Bob was here
|
* Bob was here
|
||||||
* $Id: m_42.c 3161 2007-01-25 07:23:01Z nenolod $
|
* $Id: m_42.c 3161 2007-01-25 07:23:01Z nenolod $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ struct Message adminwall_msgtab = {
|
||||||
"ADMINWALL", 0, 0, 0, MFLG_SLOW,
|
"ADMINWALL", 0, 0, 0, MFLG_SLOW,
|
||||||
{mg_unreg, mg_not_oper, mg_ignore, mg_ignore, {me_adminwall, 2}, {mo_adminwall, 2}}
|
{mg_unreg, mg_not_oper, mg_ignore, mg_ignore, {me_adminwall, 2}, {mo_adminwall, 2}}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
mapi_clist_av1 adminwall_clist[] = { &adminwall_msgtab, NULL };
|
mapi_clist_av1 adminwall_clist[] = { &adminwall_msgtab, NULL };
|
||||||
DECLARE_MODULE_AV1(adminwall, NULL, NULL, adminwall_clist, NULL, NULL, "$Revision: 20702 $");
|
DECLARE_MODULE_AV1(adminwall, NULL, NULL, adminwall_clist, NULL, NULL, "$Revision: 20702 $");
|
||||||
|
@ -58,8 +58,8 @@ DECLARE_MODULE_AV1(adminwall, NULL, NULL, adminwall_clist, NULL, NULL, "$Revisio
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
mo_adminwall(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
mo_adminwall(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||||
{
|
{
|
||||||
if(!IsAdmin(source_p))
|
if(!IsAdmin(source_p))
|
||||||
{
|
{
|
||||||
sendto_one(source_p, form_str(ERR_NOPRIVS),
|
sendto_one(source_p, form_str(ERR_NOPRIVS),
|
||||||
|
@ -69,11 +69,11 @@ mo_adminwall(struct Client *client_p, struct Client *source_p, int parc, const c
|
||||||
sendto_wallops_flags(UMODE_ADMIN, source_p, "ADMINWALL - %s", parv[1]);
|
sendto_wallops_flags(UMODE_ADMIN, source_p, "ADMINWALL - %s", parv[1]);
|
||||||
sendto_match_servs(source_p, "*", CAP_ENCAP, NOCAPS, "ENCAP * ADMINWALL :%s", parv[1]);
|
sendto_match_servs(source_p, "*", CAP_ENCAP, NOCAPS, "ENCAP * ADMINWALL :%s", parv[1]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
me_adminwall(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
me_adminwall(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||||
{
|
{
|
||||||
sendto_wallops_flags(UMODE_ADMIN, source_p, "ADMINWALL - %s", parv[1]);
|
sendto_wallops_flags(UMODE_ADMIN, source_p, "ADMINWALL - %s", parv[1]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ m_findforwards(struct Client *client_p, struct Client *source_p, int parc, const
|
||||||
else
|
else
|
||||||
last_used = rb_current_time();
|
last_used = rb_current_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
RB_DLINK_FOREACH(ptr, global_channel_list.head)
|
RB_DLINK_FOREACH(ptr, global_channel_list.head)
|
||||||
{
|
{
|
||||||
chptr = ptr->data;
|
chptr = ptr->data;
|
||||||
|
|
|
@ -21,17 +21,17 @@
|
||||||
|
|
||||||
#include "stdinc.h"
|
#include "stdinc.h"
|
||||||
#include "channel.h"
|
#include "channel.h"
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "ircd.h"
|
#include "ircd.h"
|
||||||
#include "numeric.h"
|
#include "numeric.h"
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
#include "s_serv.h"
|
#include "s_serv.h"
|
||||||
#include "s_conf.h"
|
#include "s_conf.h"
|
||||||
#include "s_newconf.h"
|
#include "s_newconf.h"
|
||||||
#include "send.h"
|
#include "send.h"
|
||||||
#include "whowas.h"
|
#include "whowas.h"
|
||||||
#include "match.h"
|
#include "match.h"
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
#include "msg.h"
|
#include "msg.h"
|
||||||
#include "parse.h"
|
#include "parse.h"
|
||||||
#include "modules.h"
|
#include "modules.h"
|
||||||
|
|
|
@ -101,7 +101,7 @@ mo_okick(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
|
|
||||||
if((p = strchr(parv[2], ',')))
|
if((p = strchr(parv[2], ',')))
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
user = LOCAL_COPY(parv[2]); // strtoken(&p2, parv[2], ",");
|
user = LOCAL_COPY(parv[2]); // strtoken(&p2, parv[2], ",");
|
||||||
if(!(who = find_chasing(source_p, user, &chasing)))
|
if(!(who = find_chasing(source_p, user, &chasing)))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -110,20 +110,20 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
rb_strlcat(params, parv[i], sizeof params);
|
rb_strlcat(params, parv[i], sizeof params);
|
||||||
}
|
}
|
||||||
|
|
||||||
sendto_wallops_flags(UMODE_WALLOP, &me,
|
sendto_wallops_flags(UMODE_WALLOP, &me,
|
||||||
"OMODE called for [%s] [%s] by %s!%s@%s",
|
"OMODE called for [%s] [%s] by %s!%s@%s",
|
||||||
parv[1], params, source_p->name, source_p->username, source_p->host);
|
parv[1], params, source_p->name, source_p->username, source_p->host);
|
||||||
ilog(L_MAIN, "OMODE called for [%s] [%s] by %s",
|
ilog(L_MAIN, "OMODE called for [%s] [%s] by %s",
|
||||||
parv[1], params, get_oper_name(source_p));
|
parv[1], params, get_oper_name(source_p));
|
||||||
|
|
||||||
if(*chptr->chname != '&')
|
if(*chptr->chname != '&')
|
||||||
sendto_server(NULL, NULL, NOCAPS, NOCAPS,
|
sendto_server(NULL, NULL, NOCAPS, NOCAPS,
|
||||||
":%s WALLOPS :OMODE called for [%s] [%s] by %s!%s@%s",
|
":%s WALLOPS :OMODE called for [%s] [%s] by %s!%s@%s",
|
||||||
me.name, parv[1], params, source_p->name, source_p->username,
|
me.name, parv[1], params, source_p->name, source_p->username,
|
||||||
source_p->host);
|
source_p->host);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
set_channel_mode(client_p, source_p->servptr, chptr, msptr,
|
set_channel_mode(client_p, source_p->servptr, chptr, msptr,
|
||||||
parc - 2, parv + 2);
|
parc - 2, parv + 2);
|
||||||
#else
|
#else
|
||||||
if (parc == 4 && !strcmp(parv[2], "+o") && !irccmp(parv[3], source_p->name))
|
if (parc == 4 && !strcmp(parv[2], "+o") && !irccmp(parv[3], source_p->name))
|
||||||
|
@ -153,7 +153,7 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
add_user_to_channel(chptr, source_p, CHFL_CHANOP);
|
add_user_to_channel(chptr, source_p, CHFL_CHANOP);
|
||||||
msptr = find_channel_membership(chptr, source_p);
|
msptr = find_channel_membership(chptr, source_p);
|
||||||
}
|
}
|
||||||
set_channel_mode(client_p, source_p, chptr, msptr,
|
set_channel_mode(client_p, source_p, chptr, msptr,
|
||||||
parc - 2, parv + 2);
|
parc - 2, parv + 2);
|
||||||
/* We know they were not opped before and they can't have opped
|
/* We know they were not opped before and they can't have opped
|
||||||
* themselves as set_channel_mode() does not allow that
|
* themselves as set_channel_mode() does not allow that
|
||||||
|
|
|
@ -131,12 +131,12 @@ m_remove(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
* There are two cases we can get to this point then...
|
* There are two cases we can get to this point then...
|
||||||
*
|
*
|
||||||
* 1) connect burst is happening, and for some reason a legit
|
* 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...)
|
* been seen. (who knows.. due to lag...)
|
||||||
*
|
*
|
||||||
* 2) The channel is desynced. That can STILL happen with TS
|
* 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
|
* go through. Thats quite legit, but lets weird things like
|
||||||
* KICKS by users who appear not to be chanopped happen,
|
* KICKS by users who appear not to be chanopped happen,
|
||||||
* or even neater, they appear not to be on the channel.
|
* or even neater, they appear not to be on the channel.
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
* to clearly show that it is fake. SCENE is a special case and not underlined.
|
* to clearly show that it is fake. SCENE is a special case and not underlined.
|
||||||
* these commands only work on channels set +N
|
* these commands only work on channels set +N
|
||||||
*
|
*
|
||||||
* also adds oper commands FSAY and FACTION, which are like NPC and NPCA
|
* also adds oper commands FSAY and FACTION, which are like NPC and NPCA
|
||||||
* except without the underline.
|
* except without the underline.
|
||||||
*
|
*
|
||||||
* all of these messages have the hostmask npc.fakeuser.invalid, and their ident
|
* all of these messages have the hostmask npc.fakeuser.invalid, and their ident
|
||||||
* is the nickname of the user running the commands.
|
* is the nickname of the user running the commands.
|
||||||
*/
|
*/
|
||||||
|
@ -66,32 +66,32 @@ struct Message scene_msgtab = {
|
||||||
struct Message ambiance_msgtab = {
|
struct Message ambiance_msgtab = {
|
||||||
"AMBIANCE", 0, 0, 0, MFLG_SLOW,
|
"AMBIANCE", 0, 0, 0, MFLG_SLOW,
|
||||||
{mg_unreg, {m_scene, 3}, mg_ignore, mg_ignore, mg_ignore, {m_scene, 3}}
|
{mg_unreg, {m_scene, 3}, mg_ignore, mg_ignore, mg_ignore, {m_scene, 3}}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Message fsay_msgtab = {
|
struct Message fsay_msgtab = {
|
||||||
"FSAY", 0, 0, 0, MFLG_SLOW,
|
"FSAY", 0, 0, 0, MFLG_SLOW,
|
||||||
{mg_unreg, {m_npc, 4}, mg_ignore, mg_ignore, mg_ignore, {m_fsay, 4}}
|
{mg_unreg, {m_npc, 4}, mg_ignore, mg_ignore, mg_ignore, {m_fsay, 4}}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Message faction_msgtab = {
|
struct Message faction_msgtab = {
|
||||||
"FACTION", 0, 0, 0, MFLG_SLOW,
|
"FACTION", 0, 0, 0, MFLG_SLOW,
|
||||||
{mg_unreg, {m_npca, 4}, mg_ignore, mg_ignore, mg_ignore, {m_faction, 4}}
|
{mg_unreg, {m_npca, 4}, mg_ignore, mg_ignore, mg_ignore, {m_faction, 4}}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Message npc_msgtab = {
|
struct Message npc_msgtab = {
|
||||||
"NPC", 0, 0, 0, MFLG_SLOW,
|
"NPC", 0, 0, 0, MFLG_SLOW,
|
||||||
{mg_unreg, {m_npc, 4}, mg_ignore, mg_ignore, mg_ignore, {m_npc, 4}}
|
{mg_unreg, {m_npc, 4}, mg_ignore, mg_ignore, mg_ignore, {m_npc, 4}}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Message npca_msgtab = {
|
struct Message npca_msgtab = {
|
||||||
"NPCA", 0, 0, 0, MFLG_SLOW,
|
"NPCA", 0, 0, 0, MFLG_SLOW,
|
||||||
{mg_unreg, {m_npca, 4}, mg_ignore, mg_ignore, mg_ignore, {m_npca, 4}}
|
{mg_unreg, {m_npca, 4}, mg_ignore, mg_ignore, mg_ignore, {m_npca, 4}}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Message roleplay_msgtab = {
|
struct Message roleplay_msgtab = {
|
||||||
"ROLEPLAY", 0, 0, 0, MFLG_SLOW,
|
"ROLEPLAY", 0, 0, 0, MFLG_SLOW,
|
||||||
{mg_ignore, mg_ignore, mg_ignore, mg_ignore, {me_roleplay, 4}, mg_ignore}
|
{mg_ignore, mg_ignore, mg_ignore, mg_ignore, {me_roleplay, 4}, mg_ignore}
|
||||||
};
|
};
|
||||||
|
|
||||||
mapi_clist_av1 roleplay_clist[] = { &scene_msgtab, &ambiance_msgtab, &fsay_msgtab, &faction_msgtab, &npc_msgtab, &npca_msgtab, &roleplay_msgtab, NULL };
|
mapi_clist_av1 roleplay_clist[] = { &scene_msgtab, &ambiance_msgtab, &fsay_msgtab, &faction_msgtab, &npc_msgtab, &npca_msgtab, &roleplay_msgtab, NULL };
|
||||||
|
|
||||||
|
@ -221,6 +221,6 @@ me_roleplay(struct Client *client_p, struct Client *source_p, int parc, const ch
|
||||||
if((chptr = find_channel(parv[1])) == NULL)
|
if((chptr = find_channel(parv[1])) == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@npc.fakeuser.invalid PRIVMSG %s :%s", parv[2], source_p->name, parv[1], parv[3]);
|
sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@npc.fakeuser.invalid PRIVMSG %s :%s", parv[2], source_p->name, parv[1], parv[3]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ DECLARE_MODULE_AV1(webirc, NULL, NULL, webirc_clist, NULL, NULL, "$Revision: 207
|
||||||
* mr_webirc - webirc message handler
|
* mr_webirc - webirc message handler
|
||||||
* parv[1] = password
|
* parv[1] = password
|
||||||
* parv[2] = fake username (we ignore this)
|
* parv[2] = fake username (we ignore this)
|
||||||
* parv[3] = fake hostname
|
* parv[3] = fake hostname
|
||||||
* parv[4] = fake ip
|
* parv[4] = fake ip
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
|
@ -87,7 +87,7 @@ mr_webirc(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
aconf = find_address_conf(client_p->host, client_p->sockhost,
|
aconf = find_address_conf(client_p->host, client_p->sockhost,
|
||||||
IsGotId(client_p) ? client_p->username : "webirc",
|
IsGotId(client_p) ? client_p->username : "webirc",
|
||||||
IsGotId(client_p) ? client_p->username : "webirc",
|
IsGotId(client_p) ? client_p->username : "webirc",
|
||||||
(struct sockaddr *) &client_p->localClient->ip,
|
(struct sockaddr *) &client_p->localClient->ip,
|
||||||
|
@ -143,7 +143,7 @@ mr_webirc(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
source_p->localClient->ip = addr;
|
source_p->localClient->ip = addr;
|
||||||
|
|
||||||
/* Check dlines now, klines will be checked on registration */
|
/* Check dlines now, klines will be checked on registration */
|
||||||
if((aconf = find_dline((struct sockaddr *)&source_p->localClient->ip,
|
if((aconf = find_dline((struct sockaddr *)&source_p->localClient->ip,
|
||||||
source_p->localClient->ip.ss_family)))
|
source_p->localClient->ip.ss_family)))
|
||||||
{
|
{
|
||||||
if(!(aconf->status & CONF_EXEMPTDLINE))
|
if(!(aconf->status & CONF_EXEMPTDLINE))
|
||||||
|
|
|
@ -221,7 +221,7 @@ handle_client_exit(void *vdata)
|
||||||
|
|
||||||
rb_dlinkDelete(n, &overriding_opers);
|
rb_dlinkDelete(n, &overriding_opers);
|
||||||
rb_free(session_p);
|
rb_free(session_p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ev_entry *expire_override_deadlines_ev = NULL;
|
struct ev_entry *expire_override_deadlines_ev = NULL;
|
||||||
|
|
|
@ -48,7 +48,7 @@ show_whois(hook_data_client *data)
|
||||||
struct Client *source_p = data->client;
|
struct Client *source_p = data->client;
|
||||||
struct Client *target_p = data->target;
|
struct Client *target_p = data->target;
|
||||||
|
|
||||||
if(MyClient(target_p) &&
|
if(MyClient(target_p) &&
|
||||||
#ifdef OPERONLY
|
#ifdef OPERONLY
|
||||||
IsOper(target_p) &&
|
IsOper(target_p) &&
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -215,7 +215,7 @@ void free_ban(struct Ban *bptr);
|
||||||
|
|
||||||
extern void destroy_channel(struct Channel *);
|
extern void destroy_channel(struct Channel *);
|
||||||
|
|
||||||
extern int can_send(struct Channel *chptr, struct Client *who,
|
extern int can_send(struct Channel *chptr, struct Client *who,
|
||||||
struct membership *);
|
struct membership *);
|
||||||
extern int flood_attack_channel(int p_or_n, struct Client *source_p,
|
extern int flood_attack_channel(int p_or_n, struct Client *source_p,
|
||||||
struct Channel *chptr, char *chname);
|
struct Channel *chptr, char *chname);
|
||||||
|
|
|
@ -133,10 +133,10 @@ struct Client
|
||||||
/* client->name is the unique name for a client nick or host */
|
/* client->name is the unique name for a client nick or host */
|
||||||
char name[HOSTLEN + 1];
|
char name[HOSTLEN + 1];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* client->username is the username from ident or the USER message,
|
* client->username is the username from ident or the USER message,
|
||||||
* If the client is idented the USER message is ignored, otherwise
|
* If the client is idented the USER message is ignored, otherwise
|
||||||
* the username part of the USER message is put here prefixed with a
|
* the username part of the USER message is put here prefixed with a
|
||||||
* tilde depending on the I:line, Once a client has registered, this
|
* tilde depending on the I:line, Once a client has registered, this
|
||||||
* field should be considered read-only.
|
* field should be considered read-only.
|
||||||
*/
|
*/
|
||||||
|
@ -177,13 +177,13 @@ struct LocalUser
|
||||||
* (directly connected to *this* server with a socket.
|
* (directly connected to *this* server with a socket.
|
||||||
*/
|
*/
|
||||||
/* Anti flooding part, all because of lamers... */
|
/* Anti flooding part, all because of lamers... */
|
||||||
time_t last_join_time; /* when this client last
|
time_t last_join_time; /* when this client last
|
||||||
joined a channel */
|
joined a channel */
|
||||||
time_t last_leave_time; /* when this client last
|
time_t last_leave_time; /* when this client last
|
||||||
* left a channel */
|
* left a channel */
|
||||||
int join_leave_count; /* count of JOIN/LEAVE in less than
|
int join_leave_count; /* count of JOIN/LEAVE in less than
|
||||||
MIN_JOIN_LEAVE_TIME seconds */
|
MIN_JOIN_LEAVE_TIME seconds */
|
||||||
int oper_warn_count_down; /* warn opers of this possible
|
int oper_warn_count_down; /* warn opers of this possible
|
||||||
spambot every time this gets to 0 */
|
spambot every time this gets to 0 */
|
||||||
time_t last_caller_id_time;
|
time_t last_caller_id_time;
|
||||||
|
|
||||||
|
@ -197,10 +197,10 @@ struct LocalUser
|
||||||
* we want to use unsigned int here so the sizes have a better chance of
|
* we want to use unsigned int here so the sizes have a better chance of
|
||||||
* staying the same on 64 bit machines. The current trend is to use
|
* staying the same on 64 bit machines. The current trend is to use
|
||||||
* I32LP64, (32 bit ints, 64 bit longs and pointers) and since ircd
|
* I32LP64, (32 bit ints, 64 bit longs and pointers) and since ircd
|
||||||
* will NEVER run on an operating system where ints are less than 32 bits,
|
* will NEVER run on an operating system where ints are less than 32 bits,
|
||||||
* it's a relatively safe bet to use ints. Since right shift operations are
|
* it's a relatively safe bet to use ints. Since right shift operations are
|
||||||
* performed on these, it's not safe to allow them to become negative,
|
* performed on these, it's not safe to allow them to become negative,
|
||||||
* which is possible for long running server connections. Unsigned values
|
* which is possible for long running server connections. Unsigned values
|
||||||
* generally overflow gracefully. --Bleep
|
* generally overflow gracefully. --Bleep
|
||||||
*/
|
*/
|
||||||
unsigned int sendM; /* Statistics: protocol messages send */
|
unsigned int sendM; /* Statistics: protocol messages send */
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Directory paths and filenames for UNIX systems.
|
* Directory paths and filenames for UNIX systems.
|
||||||
* IRCD_PREFIX is set using ./configure --prefix, see INSTALL.
|
* IRCD_PREFIX is set using ./configure --prefix, see INSTALL.
|
||||||
* The other defaults should be fine.
|
* The other defaults should be fine.
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
#define LIBPATH IRCD_PREFIX "/lib/"
|
#define LIBPATH IRCD_PREFIX "/lib/"
|
||||||
#define MODPATH MODULE_DIR
|
#define MODPATH MODULE_DIR
|
||||||
#define AUTOMODPATH MODULE_DIR "/autoload/"
|
#define AUTOMODPATH MODULE_DIR "/autoload/"
|
||||||
#define ETCPATH ETC_DIR
|
#define ETCPATH ETC_DIR
|
||||||
#define LOGPATH LOG_DIR
|
#define LOGPATH LOG_DIR
|
||||||
#define UHPATH HELP_DIR "/users"
|
#define UHPATH HELP_DIR "/users"
|
||||||
#define HPATH HELP_DIR "/opers"
|
#define HPATH HELP_DIR "/opers"
|
||||||
|
@ -95,7 +95,7 @@
|
||||||
#define KILLCHASETIMELIMIT 90 /* Recommended value: 90 */
|
#define KILLCHASETIMELIMIT 90 /* Recommended value: 90 */
|
||||||
|
|
||||||
/* RATBOX_SOMAXCONN
|
/* RATBOX_SOMAXCONN
|
||||||
* Use SOMAXCONN if OS has it, otherwise use this value for the
|
* Use SOMAXCONN if OS has it, otherwise use this value for the
|
||||||
* listen(); backlog. 5 for AIX/SUNOS, 25 for other OSs.
|
* listen(); backlog. 5 for AIX/SUNOS, 25 for other OSs.
|
||||||
*/
|
*/
|
||||||
#define RATBOX_SOMAXCONN 25
|
#define RATBOX_SOMAXCONN 25
|
||||||
|
|
|
@ -47,7 +47,7 @@ void delete_one_address_conf(const char *, struct ConfItem *);
|
||||||
void clear_out_address_conf(void);
|
void clear_out_address_conf(void);
|
||||||
void clear_out_address_conf_bans(void);
|
void clear_out_address_conf_bans(void);
|
||||||
void init_host_hash(void);
|
void init_host_hash(void);
|
||||||
struct ConfItem *find_address_conf(const char *host, const char *sockhost,
|
struct ConfItem *find_address_conf(const char *host, const char *sockhost,
|
||||||
const char *, const char *, struct sockaddr *,
|
const char *, const char *, struct sockaddr *,
|
||||||
int, char *);
|
int, char *);
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NOTE: NICKLEN and TOPICLEN do not live here anymore. Set it with configure
|
* NOTE: NICKLEN and TOPICLEN do not live here anymore. Set it with configure
|
||||||
* Otherwise there are no user servicable part here.
|
* Otherwise there are no user servicable part here.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -91,8 +91,8 @@
|
||||||
|
|
||||||
#define HELPLEN 400
|
#define HELPLEN 400
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* message return values
|
* message return values
|
||||||
*/
|
*/
|
||||||
#define CLIENT_EXITED -2
|
#define CLIENT_EXITED -2
|
||||||
#define CLIENT_PARSE_ERROR -1
|
#define CLIENT_PARSE_ERROR -1
|
||||||
|
|
|
@ -52,9 +52,9 @@ int comp_with_mask(void *addr, void *dest, u_int mask);
|
||||||
int comp_with_mask_sock(struct sockaddr *addr, struct sockaddr *dest, u_int mask);
|
int comp_with_mask_sock(struct sockaddr *addr, struct sockaddr *dest, u_int mask);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* collapse - collapse a string in place, converts multiple adjacent *'s
|
* collapse - collapse a string in place, converts multiple adjacent *'s
|
||||||
* into a single *.
|
* into a single *.
|
||||||
* collapse - modifies the contents of pattern
|
* collapse - modifies the contents of pattern
|
||||||
*
|
*
|
||||||
* collapse_esc() - collapse with support for escaping chars
|
* collapse_esc() - collapse with support for escaping chars
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* ircd-ratbox: an advanced Internet Relay Chat Daemon(ircd).
|
* ircd-ratbox: an advanced Internet Relay Chat Daemon(ircd).
|
||||||
* monitor.h: Code for server-side notify lists.
|
* monitor.h: Code for server-side notify lists.
|
||||||
*
|
*
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
#define RPL_STATSYLINE 218
|
#define RPL_STATSYLINE 218
|
||||||
#define RPL_ENDOFSTATS 219
|
#define RPL_ENDOFSTATS 219
|
||||||
/* note ircu uses 217 for STATSPLINE frip. conflict
|
/* note ircu uses 217 for STATSPLINE frip. conflict
|
||||||
* as RPL_STATSQLINE was used in old 2.8 for Q line
|
* as RPL_STATSQLINE was used in old 2.8 for Q line
|
||||||
* I'm going to steal 220 for now *sigh*
|
* I'm going to steal 220 for now *sigh*
|
||||||
* -Dianora
|
* -Dianora
|
||||||
*/
|
*/
|
||||||
|
@ -302,7 +302,7 @@
|
||||||
|
|
||||||
#define ERR_USERNOTONSERV 504
|
#define ERR_USERNOTONSERV 504
|
||||||
|
|
||||||
/* #define ERR_LAST_ERR_MSG 505
|
/* #define ERR_LAST_ERR_MSG 505
|
||||||
* moved to 999
|
* moved to 999
|
||||||
*/
|
*/
|
||||||
#define ERR_WRONGPONG 513
|
#define ERR_WRONGPONG 513
|
||||||
|
|
|
@ -33,7 +33,7 @@ struct Message;
|
||||||
struct Client;
|
struct Client;
|
||||||
|
|
||||||
extern void parse(struct Client *, char *, char *);
|
extern void parse(struct Client *, char *, char *);
|
||||||
extern void handle_encap(struct Client *, struct Client *,
|
extern void handle_encap(struct Client *, struct Client *,
|
||||||
const char *, int, const char *parv[]);
|
const char *, int, const char *parv[]);
|
||||||
extern void clear_hash_parse(void);
|
extern void clear_hash_parse(void);
|
||||||
extern void mod_add_cmd(struct Message *msg);
|
extern void mod_add_cmd(struct Message *msg);
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include "match.h"
|
#include "match.h"
|
||||||
#include "ircd.h"
|
#include "ircd.h"
|
||||||
|
|
||||||
/* Maximum number of nameservers in /etc/resolv.conf we care about
|
/* Maximum number of nameservers in /etc/resolv.conf we care about
|
||||||
* In hybrid, this was 2 -- but in Charybdis, we want to track
|
* In hybrid, this was 2 -- but in Charybdis, we want to track
|
||||||
* a few more than that ;) --nenolod
|
* a few more than that ;) --nenolod
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -150,7 +150,7 @@ struct config_file_entry
|
||||||
|
|
||||||
char *identifyservice;
|
char *identifyservice;
|
||||||
char *identifycommand;
|
char *identifycommand;
|
||||||
|
|
||||||
char *fname_userlog;
|
char *fname_userlog;
|
||||||
char *fname_fuserlog;
|
char *fname_fuserlog;
|
||||||
char *fname_operlog;
|
char *fname_operlog;
|
||||||
|
|
|
@ -220,7 +220,7 @@ extern struct server_conf *find_server_conf(const char *name);
|
||||||
|
|
||||||
extern void attach_server_conf(struct Client *, struct server_conf *);
|
extern void attach_server_conf(struct Client *, struct server_conf *);
|
||||||
extern void detach_server_conf(struct Client *);
|
extern void detach_server_conf(struct Client *);
|
||||||
extern void set_server_conf_autoconn(struct Client *source_p, const char *name,
|
extern void set_server_conf_autoconn(struct Client *source_p, const char *name,
|
||||||
int newval);
|
int newval);
|
||||||
extern void disable_server_conf_autoconn(const char *name);
|
extern void disable_server_conf_autoconn(const char *name);
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
/*
|
/*
|
||||||
* number of seconds to wait after server starts up, before
|
* number of seconds to wait after server starts up, before
|
||||||
* starting try_connections()
|
* starting try_connections()
|
||||||
* TOO SOON and you can nick collide like crazy.
|
* TOO SOON and you can nick collide like crazy.
|
||||||
*/
|
*/
|
||||||
#define STARTUP_CONNECTIONS_TIME 60
|
#define STARTUP_CONNECTIONS_TIME 60
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ extern int MaxConnectionCount; /* GLOBAL - highest number of connections */
|
||||||
extern int refresh_user_links;
|
extern int refresh_user_links;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* return values for hunt_server()
|
* return values for hunt_server()
|
||||||
*/
|
*/
|
||||||
#define HUNTED_NOSUCH (-1) /* if the hunted server is not found */
|
#define HUNTED_NOSUCH (-1) /* if the hunted server is not found */
|
||||||
#define HUNTED_ISME 0 /* if this server should execute the command */
|
#define HUNTED_ISME 0 /* if this server should execute the command */
|
||||||
|
|
|
@ -43,7 +43,7 @@ extern void send_umode_out(struct Client *, struct Client *, int);
|
||||||
extern int show_lusers(struct Client *source_p);
|
extern int show_lusers(struct Client *source_p);
|
||||||
extern int register_local_user(struct Client *, struct Client *, const char *);
|
extern int register_local_user(struct Client *, struct Client *, const char *);
|
||||||
|
|
||||||
extern int introduce_client(struct Client *client_p, struct Client *source_p,
|
extern int introduce_client(struct Client *client_p, struct Client *source_p,
|
||||||
struct User *user, const char *nick, int use_euid);
|
struct User *user, const char *nick, int use_euid);
|
||||||
|
|
||||||
extern void change_nick_user_host(struct Client *target_p, const char *nick, const char *user,
|
extern void change_nick_user_host(struct Client *target_p, const char *nick, const char *user,
|
||||||
|
|
|
@ -74,7 +74,7 @@ extern void sendto_common_channels_local_butone(struct Client *, int cap, const
|
||||||
|
|
||||||
extern void sendto_match_butone(struct Client *, struct Client *,
|
extern void sendto_match_butone(struct Client *, struct Client *,
|
||||||
const char *, int, const char *, ...) AFP(5, 6);
|
const char *, int, const char *, ...) AFP(5, 6);
|
||||||
extern void sendto_match_servs(struct Client *source_p, const char *mask,
|
extern void sendto_match_servs(struct Client *source_p, const char *mask,
|
||||||
int capab, int, const char *, ...) AFP(5, 6);
|
int capab, int, const char *, ...) AFP(5, 6);
|
||||||
|
|
||||||
extern void sendto_monitor(struct monitor *monptr, const char *, ...) AFP(2, 3);
|
extern void sendto_monitor(struct monitor *monptr, const char *, ...) AFP(2, 3);
|
||||||
|
@ -89,7 +89,7 @@ extern void sendto_wallops_flags(int, struct Client *, const char *, ...) AFP(3,
|
||||||
|
|
||||||
extern void kill_client(struct Client *client_p, struct Client *diedie,
|
extern void kill_client(struct Client *client_p, struct Client *diedie,
|
||||||
const char *pattern, ...) AFP(3, 4);
|
const char *pattern, ...) AFP(3, 4);
|
||||||
extern void kill_client_serv_butone(struct Client *one, struct Client *source_p,
|
extern void kill_client_serv_butone(struct Client *one, struct Client *source_p,
|
||||||
const char *pattern, ...) AFP(3, 4);
|
const char *pattern, ...) AFP(3, 4);
|
||||||
|
|
||||||
#define L_ALL 0
|
#define L_ALL 0
|
||||||
|
|
|
@ -49,7 +49,7 @@ char *alloca ();
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_STDLIB_H
|
#ifdef HAVE_STDLIB_H
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -143,7 +143,7 @@ extern int errno;
|
||||||
|
|
||||||
|
|
||||||
#ifdef strdupa
|
#ifdef strdupa
|
||||||
#define LOCAL_COPY(s) strdupa(s)
|
#define LOCAL_COPY(s) strdupa(s)
|
||||||
#else
|
#else
|
||||||
#if defined(__INTEL_COMPILER) || defined(__GNUC__)
|
#if defined(__INTEL_COMPILER) || defined(__GNUC__)
|
||||||
# define LOCAL_COPY(s) __extension__({ char *_s = alloca(strlen(s) + 1); strcpy(_s, s); _s; })
|
# define LOCAL_COPY(s) __extension__({ char *_s = alloca(strlen(s) + 1); strcpy(_s, s); _s; })
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
*
|
*
|
||||||
* Entirely rewritten, August 2006 by Jilles Tjoelker
|
* Entirely rewritten, August 2006 by Jilles Tjoelker
|
||||||
* Copyright (C) 2006 Jilles Tjoelker
|
* Copyright (C) 2006 Jilles Tjoelker
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
* met:
|
* met:
|
||||||
*
|
*
|
||||||
* 1.Redistributions of source code must retain the above copyright notice,
|
* 1.Redistributions of source code must retain the above copyright notice,
|
||||||
* this list of conditions and the following disclaimer.
|
* this list of conditions and the following disclaimer.
|
||||||
* 2.Redistributions in binary form must reproduce the above copyright
|
* 2.Redistributions in binary form must reproduce the above copyright
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* 3.The name of the author may not be used to endorse or promote products
|
* 3.The name of the author may not be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* ircd-ratbox: A slightly useful ircd
|
* ircd-ratbox: A slightly useful ircd
|
||||||
* helper.h: Starts and deals with ircd helpers
|
* helper.h: Starts and deals with ircd helpers
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Aaron Sethman <androsyn@ratbox.org>
|
* Copyright (C) 2006 Aaron Sethman <androsyn@ratbox.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* Dave Plonka <plonka@doit.wisc.edu>
|
* Dave Plonka <plonka@doit.wisc.edu>
|
||||||
*
|
*
|
||||||
* This product includes software developed by the University of Michigan,
|
* This product includes software developed by the University of Michigan,
|
||||||
* Merit Network, Inc., and their contributors.
|
* Merit Network, Inc., and their contributors.
|
||||||
*
|
*
|
||||||
* This file had been called "radix.h" in the MRT sources.
|
* This file had been called "radix.h" in the MRT sources.
|
||||||
*
|
*
|
||||||
|
|
|
@ -69,14 +69,14 @@ void rb_init_rb_dlink_nodes(size_t dh_size);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Walks forward of a list.
|
* Walks forward of a list.
|
||||||
* pos is your node
|
* pos is your node
|
||||||
* head is your list head
|
* head is your list head
|
||||||
*/
|
*/
|
||||||
#define RB_DLINK_FOREACH(pos, head) for (pos = (head); pos != NULL; pos = pos->next)
|
#define RB_DLINK_FOREACH(pos, head) for (pos = (head); pos != NULL; pos = pos->next)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Walks forward of a list safely while removing nodes
|
* Walks forward of a list safely while removing nodes
|
||||||
* pos is your node
|
* pos is your node
|
||||||
* n is another list head for temporary storage
|
* n is another list head for temporary storage
|
||||||
* head is your list head
|
* head is your list head
|
||||||
|
@ -94,7 +94,7 @@ void rb_init_rb_dlink_nodes(size_t dh_size);
|
||||||
#define rb_dlinkDestroy(node, list) do { rb_dlinkDelete(node, list); rb_free_rb_dlink_node(node); } while(0)
|
#define rb_dlinkDestroy(node, list) do { rb_dlinkDelete(node, list); rb_free_rb_dlink_node(node); } while(0)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* dlink_ routines are stolen from squid, except for rb_dlinkAddBefore,
|
* dlink_ routines are stolen from squid, except for rb_dlinkAddBefore,
|
||||||
* which is mine.
|
* which is mine.
|
||||||
* -- adrian
|
* -- adrian
|
||||||
|
@ -183,7 +183,7 @@ rb_dlinkMoveTail(rb_dlink_node *m, rb_dlink_list *list)
|
||||||
if(list->tail == m)
|
if(list->tail == m)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* From here assume that m->next != NULL as that can only
|
/* From here assume that m->next != NULL as that can only
|
||||||
* be at the tail and assume that the node is on the list
|
* be at the tail and assume that the node is on the list
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -293,7 +293,7 @@ rb_dlinkFindDestroy(void *data, rb_dlink_list *list)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* rb_dlinkFind
|
* rb_dlinkFind
|
||||||
* inputs - list to search
|
* inputs - list to search
|
||||||
* - data
|
* - data
|
||||||
* output - pointer to link or NULL if not found
|
* output - pointer to link or NULL if not found
|
||||||
* side effects - Look for ptr in the linked listed pointed to by link.
|
* side effects - Look for ptr in the linked listed pointed to by link.
|
||||||
|
|
|
@ -6,11 +6,11 @@
|
||||||
* Copyright (C) 1996-2002 Hybrid Development Team
|
* Copyright (C) 1996-2002 Hybrid Development Team
|
||||||
* Copyright (C) 2002-2006 ircd-ratbox development team
|
* Copyright (C) 2002-2006 ircd-ratbox development team
|
||||||
*
|
*
|
||||||
* Below are the orignal headers from the old blalloc.c
|
* Below are the orignal headers from the old blalloc.c
|
||||||
*
|
*
|
||||||
* File: blalloc.c
|
* File: blalloc.c
|
||||||
* Owner: Wohali (Joan Touzet)
|
* Owner: Wohali (Joan Touzet)
|
||||||
*
|
*
|
||||||
* Modified 2001/11/29 for mmap() support by Aaron Sethman <androsyn@ratbox.org>
|
* Modified 2001/11/29 for mmap() support by Aaron Sethman <androsyn@ratbox.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
* $Id: balloc.c 26100 2008-09-20 01:27:19Z androsyn $
|
* $Id: balloc.c 26100 2008-09-20 01:27:19Z androsyn $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* About the block allocator
|
* About the block allocator
|
||||||
*
|
*
|
||||||
* Basically we have three ways of getting memory off of the operating
|
* Basically we have three ways of getting memory off of the operating
|
||||||
|
@ -39,11 +39,11 @@
|
||||||
*
|
*
|
||||||
* 1. mmap() anonymous pages with the MMAP_ANON flag.
|
* 1. mmap() anonymous pages with the MMAP_ANON flag.
|
||||||
* 2. mmap() via the /dev/zero trick.
|
* 2. mmap() via the /dev/zero trick.
|
||||||
* 3. HeapCreate/HeapAlloc (on win32)
|
* 3. HeapCreate/HeapAlloc (on win32)
|
||||||
* 4. malloc()
|
* 4. malloc()
|
||||||
*
|
*
|
||||||
* The advantages of 1 and 2 are this. We can munmap() the pages which will
|
* The advantages of 1 and 2 are this. We can munmap() the pages which will
|
||||||
* return the pages back to the operating system, thus reducing the size
|
* return the pages back to the operating system, thus reducing the size
|
||||||
* of the process as the memory is unused. malloc() on many systems just keeps
|
* of the process as the memory is unused. malloc() on many systems just keeps
|
||||||
* a heap of memory to itself, which never gets given back to the OS, except on
|
* a heap of memory to itself, which never gets given back to the OS, except on
|
||||||
* exit. This of course is bad, if say we have an event that causes us to allocate
|
* exit. This of course is bad, if say we have an event that causes us to allocate
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
* malloc() has it locked up in its heap. With the mmap() method, we can munmap()
|
* malloc() has it locked up in its heap. With the mmap() method, we can munmap()
|
||||||
* the block and return it back to the OS, thus causing our memory consumption to go
|
* the block and return it back to the OS, thus causing our memory consumption to go
|
||||||
* down after we no longer need it.
|
* down after we no longer need it.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -138,7 +138,7 @@ free_block(void *ptr, size_t size)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* void rb_init_bh(void)
|
* void rb_init_bh(void)
|
||||||
*
|
*
|
||||||
* Inputs: None
|
* Inputs: None
|
||||||
* Outputs: None
|
* Outputs: None
|
||||||
* Side Effects: Initializes the block heap
|
* Side Effects: Initializes the block heap
|
||||||
|
@ -171,7 +171,7 @@ rb_init_bh(void)
|
||||||
#ifndef NOBALLOC
|
#ifndef NOBALLOC
|
||||||
/*
|
/*
|
||||||
* static inline void *get_block(size_t size)
|
* static inline void *get_block(size_t size)
|
||||||
*
|
*
|
||||||
* Input: Size of block to allocate
|
* Input: Size of block to allocate
|
||||||
* Output: Pointer to new block
|
* Output: Pointer to new block
|
||||||
* Side Effects: None
|
* Side Effects: None
|
||||||
|
|
|
@ -199,7 +199,7 @@ rb_getmaxconnect(void)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* set_sock_buffers - set send and receive buffers for socket
|
* set_sock_buffers - set send and receive buffers for socket
|
||||||
*
|
*
|
||||||
* inputs - fd file descriptor
|
* inputs - fd file descriptor
|
||||||
* - size to set
|
* - size to set
|
||||||
* output - returns true (1) if successful, false (0) otherwise
|
* output - returns true (1) if successful, false (0) otherwise
|
||||||
|
@ -218,7 +218,7 @@ rb_set_buffers(rb_fde_t *F, int size)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* set_non_blocking - Set the client connection into non-blocking mode.
|
* set_non_blocking - Set the client connection into non-blocking mode.
|
||||||
*
|
*
|
||||||
* inputs - fd to set into non blocking mode
|
* inputs - fd to set into non blocking mode
|
||||||
* output - 1 if successful 0 if not
|
* output - 1 if successful 0 if not
|
||||||
|
@ -696,7 +696,7 @@ rb_socket(int family, int sock_type, int proto, const char *note)
|
||||||
return NULL; /* errno will be passed through, yay.. */
|
return NULL; /* errno will be passed through, yay.. */
|
||||||
|
|
||||||
#if defined(RB_IPV6) && defined(IPV6_V6ONLY)
|
#if defined(RB_IPV6) && defined(IPV6_V6ONLY)
|
||||||
/*
|
/*
|
||||||
* Make sure we can take both IPv4 and IPv6 connections
|
* Make sure we can take both IPv4 and IPv6 connections
|
||||||
* on an AF_INET6 socket
|
* on an AF_INET6 socket
|
||||||
*/
|
*/
|
||||||
|
@ -991,8 +991,8 @@ rb_read(rb_fde_t *F, void *buf, int count)
|
||||||
if(F == NULL)
|
if(F == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* This needs to be *before* RB_FD_SOCKET otherwise you'll process
|
/* This needs to be *before* RB_FD_SOCKET otherwise you'll process
|
||||||
* an SSL socket as a regular socket
|
* an SSL socket as a regular socket
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_SSL
|
#ifdef HAVE_SSL
|
||||||
if(F->type & RB_FD_SSL)
|
if(F->type & RB_FD_SSL)
|
||||||
|
@ -1104,7 +1104,7 @@ rb_writev(rb_fde_t *F, struct rb_iovec * vector, int count)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* From: Thomas Helvey <tomh@inxpress.net>
|
* From: Thomas Helvey <tomh@inxpress.net>
|
||||||
*/
|
*/
|
||||||
static const char *IpQuadTab[] = {
|
static const char *IpQuadTab[] = {
|
||||||
|
|
|
@ -143,7 +143,7 @@ rb_crypt(const char *key, const char *salt)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* Re-entrantify me -- all this junk needs to be in
|
/* Re-entrantify me -- all this junk needs to be in
|
||||||
* struct crypt_data to make this really reentrant... */
|
* struct crypt_data to make this really reentrant... */
|
||||||
static uint8_t inv_key_perm[64];
|
static uint8_t inv_key_perm[64];
|
||||||
static uint8_t inv_comp_perm[56];
|
static uint8_t inv_comp_perm[56];
|
||||||
|
@ -160,8 +160,8 @@ static uint32_t old_salt;
|
||||||
static uint32_t old_rawkey0, old_rawkey1;
|
static uint32_t old_rawkey0, old_rawkey1;
|
||||||
|
|
||||||
|
|
||||||
/* Static stuff that stays resident and doesn't change after
|
/* Static stuff that stays resident and doesn't change after
|
||||||
* being initialized, and therefore doesn't need to be made
|
* being initialized, and therefore doesn't need to be made
|
||||||
* reentrant. */
|
* reentrant. */
|
||||||
static uint8_t init_perm[64], final_perm[64];
|
static uint8_t init_perm[64], final_perm[64];
|
||||||
static uint8_t m_sbox[4][4096];
|
static uint8_t m_sbox[4][4096];
|
||||||
|
@ -777,7 +777,7 @@ static void MD5Final (unsigned char [16], MD5_CTX *);
|
||||||
#ifndef WORDS_BIGENDIAN
|
#ifndef WORDS_BIGENDIAN
|
||||||
#define Encode memcpy
|
#define Encode memcpy
|
||||||
#define Decode memcpy
|
#define Decode memcpy
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Encodes input (uint32_t) into output (unsigned char). Assumes len is
|
* Encodes input (uint32_t) into output (unsigned char). Assumes len is
|
||||||
|
@ -866,7 +866,7 @@ MD5Init (context)
|
||||||
context->state[3] = 0x10325476;
|
context->state[3] = 0x10325476;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MD5 block update operation. Continues an MD5 message-digest
|
* MD5 block update operation. Continues an MD5 message-digest
|
||||||
* operation, processing another message block, and updating the
|
* operation, processing another message block, and updating the
|
||||||
* context.
|
* context.
|
||||||
|
|
|
@ -54,7 +54,7 @@ static rb_dlink_list event_list;
|
||||||
static time_t event_time_min = -1;
|
static time_t event_time_min = -1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* struct ev_entry *
|
* struct ev_entry *
|
||||||
* rb_event_find(EVH *func, void *arg)
|
* rb_event_find(EVH *func, void *arg)
|
||||||
*
|
*
|
||||||
* Input: Event function and the argument passed to it
|
* Input: Event function and the argument passed to it
|
||||||
|
@ -77,7 +77,7 @@ rb_event_find(EVH * func, void *arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* struct ev_entry *
|
* struct ev_entry *
|
||||||
* rb_event_add(const char *name, EVH *func, void *arg, time_t when)
|
* rb_event_add(const char *name, EVH *func, void *arg, time_t when)
|
||||||
*
|
*
|
||||||
* Input: Name of event, function to call, arguments to pass, and frequency
|
* Input: Name of event, function to call, arguments to pass, and frequency
|
||||||
|
@ -158,7 +158,7 @@ rb_event_find_delete(EVH * func, void *arg)
|
||||||
rb_event_delete(rb_event_find(func, arg));
|
rb_event_delete(rb_event_find(func, arg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* struct ev_entry *
|
* struct ev_entry *
|
||||||
* rb_event_addish(const char *name, EVH *func, void *arg, time_t delta_isa)
|
* rb_event_addish(const char *name, EVH *func, void *arg, time_t delta_isa)
|
||||||
*
|
*
|
||||||
|
@ -266,7 +266,7 @@ rb_event_io_register_all(void)
|
||||||
*
|
*
|
||||||
* Input: None
|
* Input: None
|
||||||
* Output: None
|
* Output: None
|
||||||
* Side Effects: Initializes the event system.
|
* Side Effects: Initializes the event system.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
rb_event_init(void)
|
rb_event_init(void)
|
||||||
|
@ -298,7 +298,7 @@ rb_dump_events(void (*func) (char *, void *), void *ptr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* void rb_set_back_events(time_t by)
|
* void rb_set_back_events(time_t by)
|
||||||
* Input: Time to set back events by.
|
* Input: Time to set back events by.
|
||||||
* Output: None.
|
* Output: None.
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
||||||
|
@ -128,7 +128,7 @@ rb_ssl_tryaccept(rb_fde_t *F, void *data)
|
||||||
F->accept = NULL;
|
F->accept = NULL;
|
||||||
rb_settimeout(F, 0, NULL, NULL);
|
rb_settimeout(F, 0, NULL, NULL);
|
||||||
rb_setselect(F, RB_SELECT_READ | RB_SELECT_WRITE, NULL, NULL);
|
rb_setselect(F, RB_SELECT_READ | RB_SELECT_WRITE, NULL, NULL);
|
||||||
|
|
||||||
if(ret > 0)
|
if(ret > 0)
|
||||||
ad->callback(F, RB_OK, (struct sockaddr *)&ad->S, ad->addrlen, ad->data);
|
ad->callback(F, RB_OK, (struct sockaddr *)&ad->S, ad->addrlen, ad->data);
|
||||||
else
|
else
|
||||||
|
@ -617,9 +617,9 @@ rb_supports_ssl(void)
|
||||||
void
|
void
|
||||||
rb_get_ssl_info(char *buf, size_t len)
|
rb_get_ssl_info(char *buf, size_t len)
|
||||||
{
|
{
|
||||||
rb_snprintf(buf, len, "GNUTLS: compiled (%s), library(%s)",
|
rb_snprintf(buf, len, "GNUTLS: compiled (%s), library(%s)",
|
||||||
LIBGNUTLS_VERSION, gnutls_check_version(NULL));
|
LIBGNUTLS_VERSION, gnutls_check_version(NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* HAVE_GNUTLS */
|
#endif /* HAVE_GNUTLS */
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* ircd-ratbox: A slightly useful ircd
|
* ircd-ratbox: A slightly useful ircd
|
||||||
* helper.c: Starts and deals with ircd helpers
|
* helper.c: Starts and deals with ircd helpers
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Aaron Sethman <androsyn@ratbox.org>
|
* Copyright (C) 2006 Aaron Sethman <androsyn@ratbox.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
@ -185,7 +185,7 @@ rb_linebuf_donebuf(buf_head_t * bufhead)
|
||||||
* rb_linebuf_copy_line
|
* rb_linebuf_copy_line
|
||||||
*
|
*
|
||||||
* Okay..this functions comments made absolutely no sense.
|
* Okay..this functions comments made absolutely no sense.
|
||||||
*
|
*
|
||||||
* Basically what we do is this. Find the first chunk of text
|
* Basically what we do is this. Find the first chunk of text
|
||||||
* and then scan for a CRLF. If we didn't find it, but we didn't
|
* and then scan for a CRLF. If we didn't find it, but we didn't
|
||||||
* overflow our buffer..we wait for some more data.
|
* overflow our buffer..we wait for some more data.
|
||||||
|
@ -700,8 +700,8 @@ rb_linebuf_flush(rb_fde_t *F, buf_head_t * bufhead)
|
||||||
buf_line_t *bufline;
|
buf_line_t *bufline;
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* autoconf checks for this..but really just want to use it if we have a
|
* autoconf checks for this..but really just want to use it if we have a
|
||||||
* native version even if libircd provides a fake version...
|
* native version even if libircd provides a fake version...
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_WRITEV
|
#ifdef HAVE_WRITEV
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* libratbox: a library used by ircd-ratbox and other things
|
* libratbox: a library used by ircd-ratbox and other things
|
||||||
* nossl.c: ssl stub code
|
* nossl.c: ssl stub code
|
||||||
*
|
*
|
||||||
|
@ -14,12 +14,12 @@
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
||||||
* USA
|
* USA
|
||||||
*
|
*
|
||||||
* $Id: commio.c 24808 2008-01-02 08:17:05Z androsyn $
|
* $Id: commio.c 24808 2008-01-02 08:17:05Z androsyn $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ rb_ssl_clear_handshake_count(rb_fde_t *F)
|
||||||
void
|
void
|
||||||
rb_get_ssl_info(char *buf, size_t len)
|
rb_get_ssl_info(char *buf, size_t len)
|
||||||
{
|
{
|
||||||
rb_snprintf(buf, len, "Not compiled with SSL support");
|
rb_snprintf(buf, len, "Not compiled with SSL support");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !HAVE_OPENSSL */
|
#endif /* !HAVE_OPENSSL */
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
||||||
|
@ -682,7 +682,7 @@ rb_supports_ssl(void)
|
||||||
void
|
void
|
||||||
rb_get_ssl_info(char *buf, size_t len)
|
rb_get_ssl_info(char *buf, size_t len)
|
||||||
{
|
{
|
||||||
rb_snprintf(buf, len, "Using SSL: %s compiled: 0x%lx, library 0x%lx",
|
rb_snprintf(buf, len, "Using SSL: %s compiled: 0x%lx, library 0x%lx",
|
||||||
SSLeay_version(SSLEAY_VERSION),
|
SSLeay_version(SSLEAY_VERSION),
|
||||||
(long)OPENSSL_VERSION_NUMBER, SSLeay());
|
(long)OPENSSL_VERSION_NUMBER, SSLeay());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Yanked out of Net::Patricia by Aaron Sethman <androsyn@ratbox.org>
|
* Yanked out of Net::Patricia by Aaron Sethman <androsyn@ratbox.org>
|
||||||
*
|
*
|
||||||
* This was then yanked out of the ratbox/devel/src tree and stuffed into
|
* This was then yanked out of the ratbox/devel/src tree and stuffed into
|
||||||
* libratbox and had function names changed, but otherwise not really altered.
|
* libratbox and had function names changed, but otherwise not really altered.
|
||||||
*
|
*
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
* Dave Plonka <plonka@doit.wisc.edu>
|
* Dave Plonka <plonka@doit.wisc.edu>
|
||||||
*
|
*
|
||||||
* This product includes software developed by the University of Michigan,
|
* This product includes software developed by the University of Michigan,
|
||||||
* Merit Network, Inc., and their contributors.
|
* Merit Network, Inc., and their contributors.
|
||||||
*
|
*
|
||||||
* This file had been called "radix.c" in the MRT sources.
|
* This file had been called "radix.c" in the MRT sources.
|
||||||
*
|
*
|
||||||
|
@ -263,7 +263,7 @@ Deref_Prefix(rb_prefix_t *prefix)
|
||||||
|
|
||||||
/* } */
|
/* } */
|
||||||
|
|
||||||
// #define PATRICIA_DEBUG 1
|
// #define PATRICIA_DEBUG 1
|
||||||
|
|
||||||
static int num_active_patricia = 0;
|
static int num_active_patricia = 0;
|
||||||
|
|
||||||
|
|
|
@ -106,9 +106,9 @@ rb_setselect_ports(rb_fde_t *F, unsigned int type, PF * handler, void *client_da
|
||||||
port_dissociate(pe, PORT_SOURCE_FD, F->fd);
|
port_dissociate(pe, PORT_SOURCE_FD, F->fd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
port_associate(pe, PORT_SOURCE_FD, F->fd, F->pflags, F);
|
port_associate(pe, PORT_SOURCE_FD, F->fd, F->pflags, F);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -191,24 +191,24 @@ rb_ports_sched_event(struct ev_entry *event, int when)
|
||||||
|
|
||||||
event->comm_ptr = rb_malloc(sizeof(timer_t));
|
event->comm_ptr = rb_malloc(sizeof(timer_t));
|
||||||
id = event->comm_ptr;
|
id = event->comm_ptr;
|
||||||
|
|
||||||
memset(&ev, 0, sizeof(ev));
|
memset(&ev, 0, sizeof(ev));
|
||||||
ev.sigev_notify = SIGEV_PORT;
|
ev.sigev_notify = SIGEV_PORT;
|
||||||
ev.sigev_value.sival_ptr = ¬
|
ev.sigev_value.sival_ptr = ¬
|
||||||
|
|
||||||
memset(¬, 0, sizeof(not));
|
memset(¬, 0, sizeof(not));
|
||||||
not.portnfy_port = pe;
|
not.portnfy_port = pe;
|
||||||
not.portnfy_user = event;
|
not.portnfy_user = event;
|
||||||
|
|
||||||
if(timer_create(CLOCK_REALTIME, &ev, id) < 0)
|
if(timer_create(CLOCK_REALTIME, &ev, id) < 0)
|
||||||
{
|
{
|
||||||
rb_lib_log("timer_create: %s\n", strerror(errno));
|
rb_lib_log("timer_create: %s\n", strerror(errno));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&ts, 0, sizeof(ts));
|
memset(&ts, 0, sizeof(ts));
|
||||||
ts.it_value.tv_sec = when;
|
ts.it_value.tv_sec = when;
|
||||||
ts.it_value.tv_nsec = 0;
|
ts.it_value.tv_nsec = 0;
|
||||||
if(event->frequency != 0)
|
if(event->frequency != 0)
|
||||||
ts.it_interval = ts.it_value;
|
ts.it_interval = ts.it_value;
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ rb_ports_sched_event(struct ev_entry *event, int when)
|
||||||
rb_lib_log("timer_settime: %s\n", strerror(errno));
|
rb_lib_log("timer_settime: %s\n", strerror(errno));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -241,14 +241,14 @@ rb_ports_init_event(void)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
rb_ports_sched_event(struct ev_entry *event, int when)
|
rb_ports_sched_event(struct ev_entry *event, int when)
|
||||||
{
|
{
|
||||||
errno = ENOSYS;
|
errno = ENOSYS;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
rb_ports_unsched_event(struct ev_entry *event)
|
rb_ports_unsched_event(struct ev_entry *event)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* ircd-ratbox: A slight useful ircd
|
* ircd-ratbox: A slight useful ircd
|
||||||
* rawbuf.c: raw buffer (non-line oriented buffering)
|
* rawbuf.c: raw buffer (non-line oriented buffering)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Aaron Sethman <androsyn@ratbox.org>
|
* Copyright (C) 2007 Aaron Sethman <androsyn@ratbox.org>
|
||||||
* Copyright (C) 2007 ircd-ratbox development team
|
* Copyright (C) 2007 ircd-ratbox development team
|
||||||
*
|
*
|
||||||
|
|
|
@ -121,7 +121,7 @@ resize_pollarray(int fd)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* void setup_sigio_fd(int fd)
|
* void setup_sigio_fd(int fd)
|
||||||
*
|
*
|
||||||
* Input: File descriptor
|
* Input: File descriptor
|
||||||
* Output: None
|
* Output: None
|
||||||
* Side Effect: Sets the FD up for SIGIO
|
* Side Effect: Sets the FD up for SIGIO
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* Wirzenius wrote this portably, Torvalds fucked it up :-)
|
* Wirzenius wrote this portably, Torvalds fucked it up :-)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fri Jul 13 2001 Crutcher Dunnavant <crutcher+kernel@datastacks.com>
|
* Fri Jul 13 2001 Crutcher Dunnavant <crutcher+kernel@datastacks.com>
|
||||||
* - changed to provide snprintf and vsnprintf functions
|
* - changed to provide snprintf and vsnprintf functions
|
||||||
* So Feb 1 16:51:32 CET 2004 Juergen Quade <quade@hsnr.de>
|
* So Feb 1 16:51:32 CET 2004 Juergen Quade <quade@hsnr.de>
|
||||||
|
|
|
@ -70,7 +70,7 @@ rb_make_rb_dlink_node(void)
|
||||||
*
|
*
|
||||||
* inputs - pointer to rb_dlink_node
|
* inputs - pointer to rb_dlink_node
|
||||||
* output - NONE
|
* output - NONE
|
||||||
* side effects - free given rb_dlink_node
|
* side effects - free given rb_dlink_node
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
rb_free_rb_dlink_node(rb_dlink_node *ptr)
|
rb_free_rb_dlink_node(rb_dlink_node *ptr)
|
||||||
|
@ -206,7 +206,7 @@ rb_strnlen(const char *s, size_t count)
|
||||||
*
|
*
|
||||||
* input -
|
* input -
|
||||||
* output -
|
* output -
|
||||||
* side effects -
|
* side effects -
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
rb_basename(const char *path)
|
rb_basename(const char *path)
|
||||||
|
@ -233,11 +233,11 @@ rb_dirname (const char *path)
|
||||||
if(s == NULL)
|
if(s == NULL)
|
||||||
{
|
{
|
||||||
return rb_strdup(".");
|
return rb_strdup(".");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove extra slashes */
|
/* remove extra slashes */
|
||||||
while(s > path && *s == '/')
|
while(s > path && *s == '/')
|
||||||
--s;
|
--s;
|
||||||
|
|
||||||
return rb_strndup(path, ((uintptr_t)s - (uintptr_t)path) + 2);
|
return rb_strndup(path, ((uintptr_t)s - (uintptr_t)path) + 2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#include <spawn.h>
|
#include <spawn.h>
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <crt_externs.h>
|
#include <crt_externs.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
|
|
|
@ -157,7 +157,7 @@ rb_kill(int pid, int sig)
|
||||||
HANDLE hProcess;
|
HANDLE hProcess;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, pid);
|
hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, pid);
|
||||||
|
|
||||||
if(hProcess)
|
if(hProcess)
|
||||||
{
|
{
|
||||||
switch (sig)
|
switch (sig)
|
||||||
|
@ -188,7 +188,7 @@ rb_kill(int pid, int sig)
|
||||||
WSAPROTOCOL_INFO * count
|
WSAPROTOCOL_INFO * count
|
||||||
size_t datasize
|
size_t datasize
|
||||||
data
|
data
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -477,7 +477,7 @@ rb_select_win32(long delay)
|
||||||
if(has_set_timer == 0)
|
if(has_set_timer == 0)
|
||||||
{
|
{
|
||||||
/* XXX should probably have this handle all the events
|
/* XXX should probably have this handle all the events
|
||||||
* instead of busy looping
|
* instead of busy looping
|
||||||
*/
|
*/
|
||||||
SetTimer(hwnd, 0, delay, NULL);
|
SetTimer(hwnd, 0, delay, NULL);
|
||||||
has_set_timer = 1;
|
has_set_timer = 1;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* charybdis: An advanced ircd.
|
* charybdis: An advanced ircd.
|
||||||
* m_ban.c: Propagates network bans across servers.
|
* m_ban.c: Propagates network bans across servers.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010 Jilles Tjoelker
|
* Copyright (C) 2010 Jilles Tjoelker
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -640,7 +640,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
|
|
||||||
if(isnew)
|
if(isnew)
|
||||||
chptr->channelts = newts;
|
chptr->channelts = newts;
|
||||||
|
|
||||||
else if(newts == 0 || oldts == 0)
|
else if(newts == 0 || oldts == 0)
|
||||||
chptr->channelts = 0;
|
chptr->channelts = 0;
|
||||||
else if(newts == oldts)
|
else if(newts == oldts)
|
||||||
|
@ -1183,8 +1183,8 @@ set_final_mode(struct Mode *mode, struct Mode *oldmode)
|
||||||
* remove_our_modes
|
* remove_our_modes
|
||||||
*
|
*
|
||||||
* inputs -
|
* inputs -
|
||||||
* output -
|
* output -
|
||||||
* side effects -
|
* side effects -
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
remove_our_modes(struct Channel *chptr, struct Client *source_p)
|
remove_our_modes(struct Channel *chptr, struct Client *source_p)
|
||||||
|
|
|
@ -120,12 +120,12 @@ m_kick(struct Client *client_p, struct Client *source_p, int parc, const char *p
|
||||||
* There are two cases we can get to this point then...
|
* There are two cases we can get to this point then...
|
||||||
*
|
*
|
||||||
* 1) connect burst is happening, and for some reason a legit
|
* 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...)
|
* been seen. (who knows.. due to lag...)
|
||||||
*
|
*
|
||||||
* 2) The channel is desynced. That can STILL happen with TS
|
* 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
|
* go through. Thats quite legit, but lets weird things like
|
||||||
* KICKS by users who appear not to be chanopped happen,
|
* KICKS by users who appear not to be chanopped happen,
|
||||||
* or even neater, they appear not to be on the channel.
|
* or even neater, they appear not to be on the channel.
|
||||||
|
|
|
@ -141,7 +141,7 @@ mo_kill(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
* that have been around for ever, for no reason.. */
|
* that have been around for ever, for no reason.. */
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||||
"Received KILL message for %s!%s@%s. From %s Path: %s (%s)",
|
"Received KILL message for %s!%s@%s. From %s Path: %s (%s)",
|
||||||
target_p->name, target_p->username, target_p->orighost,
|
target_p->name, target_p->username, target_p->orighost,
|
||||||
source_p->name, me.name, reason);
|
source_p->name, me.name, reason);
|
||||||
|
|
||||||
ilog(L_KILL, "%c %s %s!%s@%s %s %s",
|
ilog(L_KILL, "%c %s %s!%s@%s %s %s",
|
||||||
|
@ -217,7 +217,7 @@ ms_kill(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
if((target_p = find_person(user)) == NULL)
|
if((target_p = find_person(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.
|
* not an uid, automatically rewrite the KILL for this new nickname.
|
||||||
* --this keeps servers in synch when nick change and kill collide
|
* --this keeps servers in synch when nick change and kill collide
|
||||||
*/
|
*/
|
||||||
|
@ -258,7 +258,7 @@ ms_kill(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
{
|
{
|
||||||
sendto_realops_snomask(IsService(source_p) ? SNO_SKILL : SNO_GENERAL, L_ALL,
|
sendto_realops_snomask(IsService(source_p) ? SNO_SKILL : SNO_GENERAL, L_ALL,
|
||||||
"Received KILL message for %s!%s@%s. From %s Path: %s!%s!%s!%s %s",
|
"Received KILL message for %s!%s@%s. From %s Path: %s!%s!%s!%s %s",
|
||||||
target_p->name, target_p->username, target_p->orighost, source_p->name,
|
target_p->name, target_p->username, target_p->orighost, source_p->name,
|
||||||
source_p->servptr->name, source_p->host, source_p->username,
|
source_p->servptr->name, source_p->host, source_p->username,
|
||||||
source_p->name, reason);
|
source_p->name, reason);
|
||||||
|
|
||||||
|
|
|
@ -618,7 +618,7 @@ msg_channel_opmod(enum message_type msgtype,
|
||||||
/*
|
/*
|
||||||
* msg_channel_flags
|
* 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
|
* say NOTICE must not auto reply
|
||||||
* - pointer to client_p
|
* - pointer to client_p
|
||||||
* - pointer to source_p
|
* - pointer to source_p
|
||||||
|
@ -704,7 +704,7 @@ expire_tgchange(void *unused)
|
||||||
/*
|
/*
|
||||||
* msg_client
|
* 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
|
* say NOTICE must not auto reply
|
||||||
* - pointer to source_p source (struct Client *)
|
* - pointer to source_p source (struct Client *)
|
||||||
* - pointer to target_p target (struct Client *)
|
* - pointer to target_p target (struct Client *)
|
||||||
|
@ -746,7 +746,7 @@ msg_client(enum message_type msgtype,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* reset idle time for message only if its not to self
|
/* reset idle time for message only if its not to self
|
||||||
* and its not a notice */
|
* and its not a notice */
|
||||||
if(msgtype != MESSAGE_TYPE_NOTICE)
|
if(msgtype != MESSAGE_TYPE_NOTICE)
|
||||||
source_p->localClient->last = rb_current_time();
|
source_p->localClient->last = rb_current_time();
|
||||||
|
@ -878,7 +878,7 @@ msg_client(enum message_type msgtype,
|
||||||
* flood_attack_client
|
* flood_attack_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
|
* say NOTICE must not auto reply
|
||||||
* - pointer to source Client
|
* - pointer to source Client
|
||||||
* - pointer to target Client
|
* - pointer to target Client
|
||||||
* output - 1 if target is under flood attack
|
* output - 1 if target is under flood attack
|
||||||
* side effects - check for flood attack on target target_p
|
* side effects - check for flood attack on target target_p
|
||||||
|
|
|
@ -239,7 +239,7 @@ m_nick(struct Client *client_p, struct Client *source_p, int parc, const char *p
|
||||||
}
|
}
|
||||||
|
|
||||||
/* mc_nick()
|
/* mc_nick()
|
||||||
*
|
*
|
||||||
* server -> server nick change
|
* server -> server nick change
|
||||||
* parv[1] = nickname
|
* parv[1] = nickname
|
||||||
* parv[2] = TS when nick change
|
* parv[2] = TS when nick change
|
||||||
|
@ -529,7 +529,7 @@ ms_save(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
*
|
*
|
||||||
* input - nickname to check
|
* input - nickname to check
|
||||||
* output - 0 if erroneous, else 1
|
* output - 0 if erroneous, else 1
|
||||||
* side effects -
|
* side effects -
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
clean_nick(const char *nick, int loc_client)
|
clean_nick(const char *nick, int loc_client)
|
||||||
|
@ -740,7 +740,7 @@ change_local_nick(struct Client *client_p, struct Client *source_p,
|
||||||
monitor_signon(source_p);
|
monitor_signon(source_p);
|
||||||
|
|
||||||
/* Make sure everyone that has this client on its accept list
|
/* Make sure everyone that has this client on its accept list
|
||||||
* loses that reference.
|
* loses that reference.
|
||||||
*/
|
*/
|
||||||
/* we used to call del_all_accepts() here, but theres no real reason
|
/* we used to call del_all_accepts() here, but theres no real reason
|
||||||
* to clear a clients own list of accepted clients. So just remove
|
* to clear a clients own list of accepted clients. So just remove
|
||||||
|
|
|
@ -98,7 +98,7 @@ m_part(struct Client *client_p, struct Client *source_p, int parc, const char *p
|
||||||
* - pointer to source client to remove
|
* - pointer to source client to remove
|
||||||
* - char pointer of name of channel to remove from
|
* - char pointer of name of channel to remove from
|
||||||
* output - none
|
* output - none
|
||||||
* side effects - remove ONE client given the channel name
|
* side effects - remove ONE client given the channel name
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
part_one_client(struct Client *client_p, struct Client *source_p, char *name, const char *reason)
|
part_one_client(struct Client *client_p, struct Client *source_p, char *name, const char *reason)
|
||||||
|
|
|
@ -93,7 +93,7 @@ mr_server(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reject a direct nonTS server connection if we're TS_ONLY -orabidoo
|
* Reject a direct nonTS server connection if we're TS_ONLY -orabidoo
|
||||||
*/
|
*/
|
||||||
if(!DoesTS(client_p))
|
if(!DoesTS(client_p))
|
||||||
|
@ -178,7 +178,7 @@ mr_server(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||||
"Connection from servername %s requires SSL/TLS but is plaintext",
|
"Connection from servername %s requires SSL/TLS but is plaintext",
|
||||||
name);
|
name);
|
||||||
ilog(L_SERVER, "Access denied, requires SSL/TLS but is plaintext from %s",
|
ilog(L_SERVER, "Access denied, requires SSL/TLS but is plaintext from %s",
|
||||||
log_client_name(client_p, SHOW_IP));
|
log_client_name(client_p, SHOW_IP));
|
||||||
|
|
||||||
exit_client(client_p, client_p, client_p, "Access denied, requires SSL/TLS but is plaintext");
|
exit_client(client_p, client_p, client_p, "Access denied, requires SSL/TLS but is plaintext");
|
||||||
|
@ -325,7 +325,7 @@ ms_server(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
* that already exists, then sends you a client burst, you squit the
|
* 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
|
* server, but you keep getting the burst of clients on a server that
|
||||||
* doesnt exist, although ircd can handle it, its not a realistic
|
* doesnt exist, although ircd can handle it, its not a realistic
|
||||||
* solution.. --fl_
|
* solution.. --fl_
|
||||||
*/
|
*/
|
||||||
ilog(L_SERVER, "Link %s cancelled, server %s already exists",
|
ilog(L_SERVER, "Link %s cancelled, server %s already exists",
|
||||||
client_p->name, name);
|
client_p->name, name);
|
||||||
|
@ -337,7 +337,7 @@ ms_server(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* User nicks never have '.' in them and server names
|
* User nicks never have '.' in them and server names
|
||||||
* must always have '.' in them.
|
* must always have '.' in them.
|
||||||
*/
|
*/
|
||||||
|
@ -393,7 +393,7 @@ ms_server(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
* name = "irc.bighub.net";
|
* name = "irc.bighub.net";
|
||||||
* hub_mask="*";
|
* hub_mask="*";
|
||||||
* ...
|
* ...
|
||||||
*
|
*
|
||||||
* That would allow "irc.bighub.net" to introduce anything it wanted..
|
* That would allow "irc.bighub.net" to introduce anything it wanted..
|
||||||
*
|
*
|
||||||
* However
|
* However
|
||||||
|
@ -431,7 +431,7 @@ ms_server(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
"Link %s introduced leafed server %s.",
|
"Link %s introduced leafed server %s.",
|
||||||
client_p->name, name);
|
client_p->name, name);
|
||||||
ilog(L_SERVER, "Link %s introduced leafed server %s.",
|
ilog(L_SERVER, "Link %s introduced leafed server %s.",
|
||||||
client_p->name, name);
|
client_p->name, name);
|
||||||
|
|
||||||
rb_snprintf(squitreason, sizeof squitreason,
|
rb_snprintf(squitreason, sizeof squitreason,
|
||||||
"Matching leaf_mask for %s",
|
"Matching leaf_mask for %s",
|
||||||
|
@ -601,7 +601,7 @@ ms_sid(struct Client *client_p, struct Client *source_p, int parc, const char *p
|
||||||
"Link %s introduced leafed server %s.",
|
"Link %s introduced leafed server %s.",
|
||||||
client_p->name, parv[1]);
|
client_p->name, parv[1]);
|
||||||
ilog(L_SERVER, "Link %s introduced leafed server %s.",
|
ilog(L_SERVER, "Link %s introduced leafed server %s.",
|
||||||
client_p->name, parv[1]);
|
client_p->name, parv[1]);
|
||||||
|
|
||||||
rb_snprintf(squitreason, sizeof squitreason,
|
rb_snprintf(squitreason, sizeof squitreason,
|
||||||
"Matching leaf_mask for %s",
|
"Matching leaf_mask for %s",
|
||||||
|
|
|
@ -140,7 +140,7 @@ m_accept(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
* - pointer to addbuffer
|
* - pointer to addbuffer
|
||||||
* - pointer to remove buffer
|
* - pointer to remove buffer
|
||||||
* - pointer to list of nicks
|
* - pointer to list of nicks
|
||||||
* output -
|
* output -
|
||||||
* side effects - addbuf/delbuf are modified to give valid nicks
|
* side effects - addbuf/delbuf are modified to give valid nicks
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
|
@ -167,7 +167,7 @@ build_nicklist(struct Client *source_p, char *addbuf, char *delbuf, const char *
|
||||||
|
|
||||||
if(find_named_person(name) == NULL)
|
if(find_named_person(name) == NULL)
|
||||||
{
|
{
|
||||||
sendto_one_numeric(source_p, ERR_NOSUCHNICK,
|
sendto_one_numeric(source_p, ERR_NOSUCHNICK,
|
||||||
form_str(ERR_NOSUCHNICK), name);
|
form_str(ERR_NOSUCHNICK), name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -251,10 +251,10 @@ list_accepts(struct Client *source_p)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(*nicks)
|
if(*nicks)
|
||||||
sendto_one(source_p, form_str(RPL_ACCEPTLIST),
|
sendto_one(source_p, form_str(RPL_ACCEPTLIST),
|
||||||
me.name, source_p->name, nicks);
|
me.name, source_p->name, nicks);
|
||||||
|
|
||||||
sendto_one(source_p, form_str(RPL_ENDOFACCEPT),
|
sendto_one(source_p, form_str(RPL_ENDOFACCEPT),
|
||||||
me.name, source_p->name);
|
me.name, source_p->name);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ struct Message admin_msgtab = {
|
||||||
int doing_admin_hook;
|
int doing_admin_hook;
|
||||||
|
|
||||||
mapi_clist_av1 admin_clist[] = { &admin_msgtab, NULL };
|
mapi_clist_av1 admin_clist[] = { &admin_msgtab, NULL };
|
||||||
mapi_hlist_av1 admin_hlist[] = {
|
mapi_hlist_av1 admin_hlist[] = {
|
||||||
{ "doing_admin", &doing_admin_hook },
|
{ "doing_admin", &doing_admin_hook },
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
@ -60,7 +60,7 @@ DECLARE_MODULE_AV1(admin, NULL, NULL, admin_clist, admin_hlist, NULL, "$Revision
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* mr_admin - ADMIN command handler
|
* mr_admin - ADMIN command handler
|
||||||
* parv[1] = servername
|
* parv[1] = servername
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
mr_admin(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
mr_admin(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||||
|
@ -69,9 +69,9 @@ mr_admin(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
|
|
||||||
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
|
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
|
||||||
{
|
{
|
||||||
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
||||||
me.name,
|
me.name,
|
||||||
EmptyString(source_p->name) ? "*" : source_p->name,
|
EmptyString(source_p->name) ? "*" : source_p->name,
|
||||||
"ADMIN");
|
"ADMIN");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ m_admin(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
last_used = rb_current_time();
|
last_used = rb_current_time();
|
||||||
|
|
||||||
if(hunt_server(client_p, source_p, ":%s ADMIN :%s", 1, parc, parv) != HUNTED_ISME)
|
if(hunt_server(client_p, source_p, ":%s ADMIN :%s", 1, parc, parv) != HUNTED_ISME)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ mapi_clist_av1 away_clist[] = { &away_msgtab, NULL };
|
||||||
DECLARE_MODULE_AV1(away, NULL, NULL, away_clist, NULL, NULL, "$Revision: 3370 $");
|
DECLARE_MODULE_AV1(away, NULL, NULL, away_clist, NULL, NULL, "$Revision: 3370 $");
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* m_away() - Added 14 Dec 1988 by jto.
|
* m_away() - Added 14 Dec 1988 by jto.
|
||||||
* Not currently really working, I don't like this
|
* Not currently really working, I don't like this
|
||||||
* call at all...
|
* call at all...
|
||||||
*
|
*
|
||||||
|
@ -56,7 +56,7 @@ DECLARE_MODULE_AV1(away, NULL, NULL, away_clist, NULL, NULL, "$Revision: 3370 $"
|
||||||
* but perhaps it's worth the load it causes to net.
|
* but perhaps it's worth the load it causes to net.
|
||||||
* This requires flooding of the whole net like NICK,
|
* This requires flooding of the whole net like NICK,
|
||||||
* USER, MODE, etc messages... --msa
|
* USER, MODE, etc messages... --msa
|
||||||
*
|
*
|
||||||
* The above comments have long since irrelvant, but
|
* The above comments have long since irrelvant, but
|
||||||
* are kept for historical purposes now ;)
|
* are kept for historical purposes now ;)
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
@ -116,7 +116,7 @@ m_away(struct Client *client_p, struct Client *source_p, int parc, const char *p
|
||||||
if(strncmp(source_p->user->away, parv[1], AWAYLEN - 1))
|
if(strncmp(source_p->user->away, parv[1], AWAYLEN - 1))
|
||||||
{
|
{
|
||||||
rb_strlcpy(source_p->user->away, parv[1], AWAYLEN);
|
rb_strlcpy(source_p->user->away, parv[1], AWAYLEN);
|
||||||
sendto_server(client_p, NULL, CAP_TS6, NOCAPS,
|
sendto_server(client_p, NULL, CAP_TS6, NOCAPS,
|
||||||
":%s AWAY :%s", use_id(source_p), source_p->user->away);
|
":%s AWAY :%s", use_id(source_p), source_p->user->away);
|
||||||
sendto_common_channels_local_butone(source_p,
|
sendto_common_channels_local_butone(source_p,
|
||||||
CLICAP_AWAY_NOTIFY,
|
CLICAP_AWAY_NOTIFY,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* modules/m_cap.c
|
/* modules/m_cap.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2005 Lee Hardy <lee@leeh.co.uk>
|
* Copyright (C) 2005 Lee Hardy <lee@leeh.co.uk>
|
||||||
* Copyright (C) 2005 ircd-ratbox development team
|
* Copyright (C) 2005 ircd-ratbox development team
|
||||||
*
|
*
|
||||||
|
@ -151,7 +151,7 @@ clicap_find(const char *data, int *negate, int *finished)
|
||||||
if((s = strchr(p, ' ')))
|
if((s = strchr(p, ' ')))
|
||||||
*s++ = '\0';
|
*s++ = '\0';
|
||||||
|
|
||||||
if((cap = bsearch(p, clicap_list, CLICAP_LIST_LEN,
|
if((cap = bsearch(p, clicap_list, CLICAP_LIST_LEN,
|
||||||
sizeof(struct clicap), (bqcmp) clicap_compare)))
|
sizeof(struct clicap), (bqcmp) clicap_compare)))
|
||||||
{
|
{
|
||||||
if(s)
|
if(s)
|
||||||
|
@ -182,8 +182,8 @@ clicap_generate(struct Client *source_p, const char *subcmd, int flags, int clea
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
mlen = rb_sprintf(buf, ":%s CAP %s %s",
|
mlen = rb_sprintf(buf, ":%s CAP %s %s",
|
||||||
me.name,
|
me.name,
|
||||||
EmptyString(source_p->name) ? "*" : source_p->name,
|
EmptyString(source_p->name) ? "*" : source_p->name,
|
||||||
subcmd);
|
subcmd);
|
||||||
|
|
||||||
p = capbuf;
|
p = capbuf;
|
||||||
|
@ -229,7 +229,7 @@ clicap_generate(struct Client *source_p, const char *subcmd, int flags, int clea
|
||||||
buflen++;
|
buflen++;
|
||||||
|
|
||||||
/* needs a client ack */
|
/* needs a client ack */
|
||||||
if(clicap_list[i].cap_cli &&
|
if(clicap_list[i].cap_cli &&
|
||||||
IsCapable(source_p, clicap_list[i].cap_cli))
|
IsCapable(source_p, clicap_list[i].cap_cli))
|
||||||
{
|
{
|
||||||
*p++ = '~';
|
*p++ = '~';
|
||||||
|
@ -305,7 +305,7 @@ cap_ack(struct Client *source_p, const char *arg)
|
||||||
static void
|
static void
|
||||||
cap_clear(struct Client *source_p, const char *arg)
|
cap_clear(struct Client *source_p, const char *arg)
|
||||||
{
|
{
|
||||||
clicap_generate(source_p, "ACK",
|
clicap_generate(source_p, "ACK",
|
||||||
source_p->localClient->caps ? source_p->localClient->caps : -1, 1);
|
source_p->localClient->caps ? source_p->localClient->caps : -1, 1);
|
||||||
|
|
||||||
/* XXX - sticky capabs */
|
/* XXX - sticky capabs */
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
static int challenge_load(void)
|
static int challenge_load(void)
|
||||||
{
|
{
|
||||||
#ifndef STATIC_MODULES
|
#ifndef STATIC_MODULES
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||||
"Challenge module not loaded because OpenSSL is not available.");
|
"Challenge module not loaded because OpenSSL is not available.");
|
||||||
ilog(L_MAIN, "Challenge module not loaded because OpenSSL is not available.");
|
ilog(L_MAIN, "Challenge module not loaded because OpenSSL is not available.");
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -90,7 +90,7 @@ cleanup_challenge(struct Client *target_p)
|
||||||
{
|
{
|
||||||
if(target_p->localClient == NULL)
|
if(target_p->localClient == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
rb_free(target_p->localClient->challenge);
|
rb_free(target_p->localClient->challenge);
|
||||||
rb_free(target_p->localClient->opername);
|
rb_free(target_p->localClient->opername);
|
||||||
target_p->localClient->challenge = NULL;
|
target_p->localClient->challenge = NULL;
|
||||||
|
@ -108,7 +108,7 @@ m_challenge(struct Client *client_p, struct Client *source_p, int parc, const ch
|
||||||
{
|
{
|
||||||
struct oper_conf *oper_p;
|
struct oper_conf *oper_p;
|
||||||
char *challenge = NULL; /* to placate gcc */
|
char *challenge = NULL; /* to placate gcc */
|
||||||
char chal_line[CHALLENGE_WIDTH];
|
char chal_line[CHALLENGE_WIDTH];
|
||||||
unsigned char *b_response;
|
unsigned char *b_response;
|
||||||
size_t cnt;
|
size_t cnt;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
@ -140,7 +140,7 @@ m_challenge(struct Client *client_p, struct Client *source_p, int parc, const ch
|
||||||
source_p->name, source_p->username,
|
source_p->name, source_p->username,
|
||||||
source_p->host);
|
source_p->host);
|
||||||
cleanup_challenge(source_p);
|
cleanup_challenge(source_p);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
parv[1]++;
|
parv[1]++;
|
||||||
|
@ -167,8 +167,8 @@ m_challenge(struct Client *client_p, struct Client *source_p, int parc, const ch
|
||||||
|
|
||||||
rb_free(b_response);
|
rb_free(b_response);
|
||||||
|
|
||||||
oper_p = find_oper_conf(source_p->username, source_p->orighost,
|
oper_p = find_oper_conf(source_p->username, source_p->orighost,
|
||||||
source_p->sockhost,
|
source_p->sockhost,
|
||||||
source_p->localClient->opername);
|
source_p->localClient->opername);
|
||||||
|
|
||||||
if(oper_p == NULL)
|
if(oper_p == NULL)
|
||||||
|
@ -192,14 +192,14 @@ m_challenge(struct Client *client_p, struct Client *source_p, int parc, const ch
|
||||||
oper_up(source_p, oper_p);
|
oper_up(source_p, oper_p);
|
||||||
|
|
||||||
ilog(L_OPERED, "OPER %s by %s!%s@%s (%s)",
|
ilog(L_OPERED, "OPER %s by %s!%s@%s (%s)",
|
||||||
source_p->localClient->opername, source_p->name,
|
source_p->localClient->opername, source_p->name,
|
||||||
source_p->username, source_p->host, source_p->sockhost);
|
source_p->username, source_p->host, source_p->sockhost);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup_challenge(source_p);
|
cleanup_challenge(source_p);
|
||||||
|
|
||||||
oper_p = find_oper_conf(source_p->username, source_p->orighost,
|
oper_p = find_oper_conf(source_p->username, source_p->orighost,
|
||||||
source_p->sockhost, parv[1]);
|
source_p->sockhost, parv[1]);
|
||||||
|
|
||||||
if(oper_p == NULL)
|
if(oper_p == NULL)
|
||||||
|
@ -269,9 +269,9 @@ m_challenge(struct Client *client_p, struct Client *source_p, int parc, const ch
|
||||||
chal += CHALLENGE_WIDTH - 1;
|
chal += CHALLENGE_WIDTH - 1;
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
sendto_one(source_p, form_str(RPL_ENDOFRSACHALLENGE2),
|
sendto_one(source_p, form_str(RPL_ENDOFRSACHALLENGE2),
|
||||||
me.name, source_p->name);
|
me.name, source_p->name);
|
||||||
rb_free(challenge);
|
rb_free(challenge);
|
||||||
source_p->localClient->opername = rb_strdup(oper_p->name);
|
source_p->localClient->opername = rb_strdup(oper_p->name);
|
||||||
|
|
|
@ -58,7 +58,7 @@ clean_host(const char *host)
|
||||||
{
|
{
|
||||||
int len = 0;
|
int len = 0;
|
||||||
const char *last_slash = 0;
|
const char *last_slash = 0;
|
||||||
|
|
||||||
if (*host == '\0' || *host == ':')
|
if (*host == '\0' || *host == ':')
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ m_cmessage(int p_or_n, const char *command,
|
||||||
{
|
{
|
||||||
if(p_or_n != NOTICE)
|
if(p_or_n != NOTICE)
|
||||||
sendto_one_numeric(source_p, ERR_NOTONCHANNEL,
|
sendto_one_numeric(source_p, ERR_NOTONCHANNEL,
|
||||||
form_str(ERR_NOTONCHANNEL),
|
form_str(ERR_NOTONCHANNEL),
|
||||||
chptr->chname);
|
chptr->chname);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ DECLARE_MODULE_AV1(connect, NULL, NULL, connect_clist, NULL, NULL, "$Revision: 3
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* mo_connect - CONNECT command handler
|
* mo_connect - CONNECT command handler
|
||||||
*
|
*
|
||||||
* Added by Jto 11 Feb 1989
|
* Added by Jto 11 Feb 1989
|
||||||
*
|
*
|
||||||
* m_connect
|
* m_connect
|
||||||
|
@ -83,7 +83,7 @@ mo_connect(struct Client *client_p, struct Client *source_p, int parc, const cha
|
||||||
|
|
||||||
if((target_p = find_server(source_p, parv[1])))
|
if((target_p = find_server(source_p, parv[1])))
|
||||||
{
|
{
|
||||||
sendto_one_notice(source_p, ":Connect: Server %s already exists from %s.", parv[1],
|
sendto_one_notice(source_p, ":Connect: Server %s already exists from %s.", parv[1],
|
||||||
target_p->from->name);
|
target_p->from->name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ mo_connect(struct Client *client_p, struct Client *source_p, int parc, const cha
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ms_connect - CONNECT command handler
|
* ms_connect - CONNECT command handler
|
||||||
*
|
*
|
||||||
* Added by Jto 11 Feb 1989
|
* Added by Jto 11 Feb 1989
|
||||||
*
|
*
|
||||||
* m_connect
|
* m_connect
|
||||||
|
@ -222,7 +222,7 @@ ms_connect(struct Client *client_p, struct Client *source_p, int parc, const cha
|
||||||
* Notify all operators about remote connect requests
|
* Notify all operators about remote connect requests
|
||||||
*/
|
*/
|
||||||
sendto_wallops_flags(UMODE_WALLOP, &me,
|
sendto_wallops_flags(UMODE_WALLOP, &me,
|
||||||
"Remote CONNECT %s %d from %s",
|
"Remote CONNECT %s %d from %s",
|
||||||
parv[1], port, source_p->name);
|
parv[1], port, source_p->name);
|
||||||
sendto_server(NULL, NULL, CAP_TS6, NOCAPS,
|
sendto_server(NULL, NULL, CAP_TS6, NOCAPS,
|
||||||
":%s WALLOPS :Remote CONNECT %s %d from %s",
|
":%s WALLOPS :Remote CONNECT %s %d from %s",
|
||||||
|
|
|
@ -69,7 +69,7 @@ static int apply_dline(struct Client *, const char *, int, char *);
|
||||||
static int apply_undline(struct Client *, const char *);
|
static int apply_undline(struct Client *, const char *);
|
||||||
|
|
||||||
/* mo_dline()
|
/* mo_dline()
|
||||||
*
|
*
|
||||||
* parv[1] - dline to add
|
* parv[1] - dline to add
|
||||||
* parv[2] - reason
|
* parv[2] - reason
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -70,7 +70,7 @@ ms_encap(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
ptr = buffer;
|
ptr = buffer;
|
||||||
|
|
||||||
for(i = 1; i < parc - 1; i++)
|
for(i = 1; i < parc - 1; i++)
|
||||||
{
|
{
|
||||||
len = strlen(parv[i]) + 1;
|
len = strlen(parv[i]) + 1;
|
||||||
|
|
|
@ -134,7 +134,7 @@ me_etrace(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
if((target_p = find_person(parv[1])) && MyClient(target_p))
|
if((target_p = find_person(parv[1])) && MyClient(target_p))
|
||||||
do_single_etrace(source_p, target_p);
|
do_single_etrace(source_p, target_p);
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_ENDOFTRACE, form_str(RPL_ENDOFTRACE),
|
sendto_one_numeric(source_p, RPL_ENDOFTRACE, form_str(RPL_ENDOFTRACE),
|
||||||
target_p ? target_p->name : parv[1]);
|
target_p ? target_p->name : parv[1]);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -158,8 +158,8 @@ do_etrace(struct Client *source_p, int ipv4, int ipv6)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sendto_one(source_p, form_str(RPL_ETRACE),
|
sendto_one(source_p, form_str(RPL_ETRACE),
|
||||||
me.name, source_p->name,
|
me.name, source_p->name,
|
||||||
IsOper(target_p) ? "Oper" : "User",
|
IsOper(target_p) ? "Oper" : "User",
|
||||||
get_client_class(target_p),
|
get_client_class(target_p),
|
||||||
target_p->name, target_p->username, target_p->host,
|
target_p->name, target_p->username, target_p->host,
|
||||||
show_ip(source_p, target_p) ? target_p->sockhost : "255.255.255.255",
|
show_ip(source_p, target_p) ? target_p->sockhost : "255.255.255.255",
|
||||||
|
@ -197,17 +197,17 @@ do_single_etrace(struct Client *source_p, struct Client *target_p)
|
||||||
*/
|
*/
|
||||||
if(!show_ip(source_p, target_p))
|
if(!show_ip(source_p, target_p))
|
||||||
sendto_one(source_p, form_str(RPL_ETRACEFULL),
|
sendto_one(source_p, form_str(RPL_ETRACEFULL),
|
||||||
me.name, source_p->name,
|
me.name, source_p->name,
|
||||||
IsOper(target_p) ? "Oper" : "User",
|
IsOper(target_p) ? "Oper" : "User",
|
||||||
get_client_class(target_p),
|
get_client_class(target_p),
|
||||||
target_p->name, target_p->username, target_p->host,
|
target_p->name, target_p->username, target_p->host,
|
||||||
"255.255.255.255", "<hidden> <hidden>", target_p->info);
|
"255.255.255.255", "<hidden> <hidden>", target_p->info);
|
||||||
else
|
else
|
||||||
sendto_one(source_p, form_str(RPL_ETRACEFULL),
|
sendto_one(source_p, form_str(RPL_ETRACEFULL),
|
||||||
me.name, source_p->name,
|
me.name, source_p->name,
|
||||||
IsOper(target_p) ? "Oper" : "User",
|
IsOper(target_p) ? "Oper" : "User",
|
||||||
get_client_class(target_p),
|
get_client_class(target_p),
|
||||||
target_p->name, target_p->username,
|
target_p->name, target_p->username,
|
||||||
target_p->host, target_p->sockhost,
|
target_p->host, target_p->sockhost,
|
||||||
target_p->localClient->fullcaps, target_p->info);
|
target_p->localClient->fullcaps, target_p->info);
|
||||||
}
|
}
|
||||||
|
@ -269,7 +269,7 @@ m_chantrace(struct Client *client_p, struct Client *source_p, int parc, const ch
|
||||||
sockhost = target_p->sockhost;
|
sockhost = target_p->sockhost;
|
||||||
|
|
||||||
sendto_one(source_p, form_str(RPL_ETRACE),
|
sendto_one(source_p, form_str(RPL_ETRACE),
|
||||||
me.name, source_p->name,
|
me.name, source_p->name,
|
||||||
IsOper(target_p) ? "Oper" : "User",
|
IsOper(target_p) ? "Oper" : "User",
|
||||||
/* class field -- pretend its server.. */
|
/* class field -- pretend its server.. */
|
||||||
target_p->servptr->name,
|
target_p->servptr->name,
|
||||||
|
@ -288,14 +288,14 @@ match_masktrace(struct Client *source_p, rb_dlink_list *list,
|
||||||
{
|
{
|
||||||
struct Client *target_p;
|
struct Client *target_p;
|
||||||
rb_dlink_node *ptr;
|
rb_dlink_node *ptr;
|
||||||
const char *sockhost;
|
const char *sockhost;
|
||||||
|
|
||||||
RB_DLINK_FOREACH(ptr, list->head)
|
RB_DLINK_FOREACH(ptr, list->head)
|
||||||
{
|
{
|
||||||
target_p = ptr->data;
|
target_p = ptr->data;
|
||||||
if(!IsPerson(target_p))
|
if(!IsPerson(target_p))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(EmptyString(target_p->sockhost))
|
if(EmptyString(target_p->sockhost))
|
||||||
sockhost = empty_sockhost;
|
sockhost = empty_sockhost;
|
||||||
else if(!show_ip(source_p, target_p))
|
else if(!show_ip(source_p, target_p))
|
||||||
|
@ -313,9 +313,9 @@ match_masktrace(struct Client *source_p, rb_dlink_list *list,
|
||||||
|
|
||||||
if(gecos != NULL && !match_esc(gecos, target_p->info))
|
if(gecos != NULL && !match_esc(gecos, target_p->info))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
sendto_one(source_p, form_str(RPL_ETRACE),
|
sendto_one(source_p, form_str(RPL_ETRACE),
|
||||||
me.name, source_p->name,
|
me.name, source_p->name,
|
||||||
IsOper(target_p) ? "Oper" : "User",
|
IsOper(target_p) ? "Oper" : "User",
|
||||||
/* class field -- pretend its server.. */
|
/* class field -- pretend its server.. */
|
||||||
target_p->servptr->name,
|
target_p->servptr->name,
|
||||||
|
@ -326,15 +326,15 @@ match_masktrace(struct Client *source_p, rb_dlink_list *list,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
mo_masktrace(struct Client *client_p, struct Client *source_p, int parc,
|
mo_masktrace(struct Client *client_p, struct Client *source_p, int parc,
|
||||||
const char *parv[])
|
const char *parv[])
|
||||||
{
|
{
|
||||||
char *name, *username, *hostname, *gecos;
|
char *name, *username, *hostname, *gecos;
|
||||||
const char *mask;
|
const char *mask;
|
||||||
int operspy = 0;
|
int operspy = 0;
|
||||||
|
|
||||||
mask = parv[1];
|
mask = parv[1];
|
||||||
name = LOCAL_COPY(parv[1]);
|
name = LOCAL_COPY(parv[1]);
|
||||||
collapse(name);
|
collapse(name);
|
||||||
|
|
||||||
if(IsOperSpy(source_p) && parv[1][0] == '!')
|
if(IsOperSpy(source_p) && parv[1][0] == '!')
|
||||||
|
@ -342,15 +342,15 @@ mo_masktrace(struct Client *client_p, struct Client *source_p, int parc,
|
||||||
name++;
|
name++;
|
||||||
mask++;
|
mask++;
|
||||||
operspy = 1;
|
operspy = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(parc > 2 && !EmptyString(parv[2]))
|
if(parc > 2 && !EmptyString(parv[2]))
|
||||||
{
|
{
|
||||||
gecos = LOCAL_COPY(parv[2]);
|
gecos = LOCAL_COPY(parv[2]);
|
||||||
collapse_esc(gecos);
|
collapse_esc(gecos);
|
||||||
} else
|
} else
|
||||||
gecos = NULL;
|
gecos = NULL;
|
||||||
|
|
||||||
|
|
||||||
if((hostname = strchr(name, '@')) == NULL)
|
if((hostname = strchr(name, '@')) == NULL)
|
||||||
{
|
{
|
||||||
|
@ -359,7 +359,7 @@ mo_masktrace(struct Client *client_p, struct Client *source_p, int parc,
|
||||||
}
|
}
|
||||||
|
|
||||||
*hostname++ = '\0';
|
*hostname++ = '\0';
|
||||||
|
|
||||||
if((username = strchr(name, '!')) == NULL)
|
if((username = strchr(name, '!')) == NULL)
|
||||||
{
|
{
|
||||||
username = name;
|
username = name;
|
||||||
|
@ -372,7 +372,7 @@ mo_masktrace(struct Client *client_p, struct Client *source_p, int parc,
|
||||||
sendto_one_notice(source_p, ":Invalid parameters");
|
sendto_one_notice(source_p, ":Invalid parameters");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(operspy) {
|
if(operspy) {
|
||||||
if (!ConfigFileEntry.operspy_dont_care_user_info)
|
if (!ConfigFileEntry.operspy_dont_care_user_info)
|
||||||
{
|
{
|
||||||
|
@ -381,14 +381,14 @@ mo_masktrace(struct Client *client_p, struct Client *source_p, int parc,
|
||||||
if(!EmptyString(gecos)) {
|
if(!EmptyString(gecos)) {
|
||||||
rb_strlcat(buf, " ", sizeof(buf));
|
rb_strlcat(buf, " ", sizeof(buf));
|
||||||
rb_strlcat(buf, gecos, sizeof(buf));
|
rb_strlcat(buf, gecos, sizeof(buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
report_operspy(source_p, "MASKTRACE", buf);
|
report_operspy(source_p, "MASKTRACE", buf);
|
||||||
}
|
}
|
||||||
match_masktrace(source_p, &global_client_list, username, hostname, name, gecos);
|
match_masktrace(source_p, &global_client_list, username, hostname, name, gecos);
|
||||||
} else
|
} else
|
||||||
match_masktrace(source_p, &lclient_list, username, hostname, name, gecos);
|
match_masktrace(source_p, &lclient_list, username, hostname, name, gecos);
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_ENDOFTRACE, form_str(RPL_ENDOFTRACE), me.name);
|
sendto_one_numeric(source_p, RPL_ENDOFTRACE, form_str(RPL_ENDOFTRACE), me.name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -413,7 +413,7 @@ static struct InfoStruct info_table[] = {
|
||||||
{
|
{
|
||||||
"reject_after_count",
|
"reject_after_count",
|
||||||
OUTPUT_DECIMAL,
|
OUTPUT_DECIMAL,
|
||||||
&ConfigFileEntry.reject_after_count,
|
&ConfigFileEntry.reject_after_count,
|
||||||
"Client rejection threshold setting",
|
"Client rejection threshold setting",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -485,13 +485,13 @@ static struct InfoStruct info_table[] = {
|
||||||
{
|
{
|
||||||
"throttle_count",
|
"throttle_count",
|
||||||
OUTPUT_DECIMAL,
|
OUTPUT_DECIMAL,
|
||||||
&ConfigFileEntry.throttle_count,
|
&ConfigFileEntry.throttle_count,
|
||||||
"Connection throttle threshold",
|
"Connection throttle threshold",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"throttle_duration",
|
"throttle_duration",
|
||||||
OUTPUT_DECIMAL,
|
OUTPUT_DECIMAL,
|
||||||
&ConfigFileEntry.throttle_duration,
|
&ConfigFileEntry.throttle_duration,
|
||||||
"Connection throttle duration",
|
"Connection throttle duration",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -758,11 +758,11 @@ send_birthdate_online_time(struct Client *source_p)
|
||||||
{
|
{
|
||||||
char tbuf[26]; /* this needs to be 26 - see ctime_r manpage */
|
char tbuf[26]; /* this needs to be 26 - see ctime_r manpage */
|
||||||
sendto_one(source_p, ":%s %d %s :Birth Date: %s, compile # %s",
|
sendto_one(source_p, ":%s %d %s :Birth Date: %s, compile # %s",
|
||||||
get_id(&me, source_p), RPL_INFO,
|
get_id(&me, source_p), RPL_INFO,
|
||||||
get_id(source_p, source_p), creation, generation);
|
get_id(source_p, source_p), creation, generation);
|
||||||
|
|
||||||
sendto_one(source_p, ":%s %d %s :On-line since %s",
|
sendto_one(source_p, ":%s %d %s :On-line since %s",
|
||||||
get_id(&me, source_p), RPL_INFO,
|
get_id(&me, source_p), RPL_INFO,
|
||||||
get_id(source_p, source_p), rb_ctime(startup_time, tbuf, sizeof(tbuf)));
|
get_id(source_p, source_p), rb_ctime(startup_time, tbuf, sizeof(tbuf)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -790,7 +790,7 @@ send_conf_options(struct Client *source_p)
|
||||||
sendto_one(source_p, ":%s %d %s :%-30s %-5d [%-30s]",
|
sendto_one(source_p, ":%s %d %s :%-30s %-5d [%-30s]",
|
||||||
get_id(&me, source_p), RPL_INFO,
|
get_id(&me, source_p), RPL_INFO,
|
||||||
get_id(source_p, source_p),
|
get_id(source_p, source_p),
|
||||||
infoptr->name, infoptr->intvalue,
|
infoptr->name, infoptr->intvalue,
|
||||||
infoptr->desc);
|
infoptr->desc);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -798,7 +798,7 @@ send_conf_options(struct Client *source_p)
|
||||||
sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
|
sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
|
||||||
get_id(&me, source_p), RPL_INFO,
|
get_id(&me, source_p), RPL_INFO,
|
||||||
get_id(source_p, source_p),
|
get_id(source_p, source_p),
|
||||||
infoptr->name, infoptr->strvalue,
|
infoptr->name, infoptr->strvalue,
|
||||||
infoptr->desc);
|
infoptr->desc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -914,7 +914,7 @@ send_conf_options(struct Client *source_p)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* info_spy()
|
/* info_spy()
|
||||||
*
|
*
|
||||||
* input - pointer to client
|
* input - pointer to client
|
||||||
* output - none
|
* output - none
|
||||||
* side effects - hook doing_info is called
|
* side effects - hook doing_info is called
|
||||||
|
|
|
@ -74,12 +74,12 @@ m_invite(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
if(target_p == NULL)
|
if(target_p == NULL)
|
||||||
{
|
{
|
||||||
if(!MyClient(source_p) && IsDigit(parv[1][0]))
|
if(!MyClient(source_p) && IsDigit(parv[1][0]))
|
||||||
sendto_one_numeric(source_p, ERR_NOSUCHNICK,
|
sendto_one_numeric(source_p, ERR_NOSUCHNICK,
|
||||||
"* :Target left IRC. Failed to invite to %s",
|
"* :Target left IRC. Failed to invite to %s",
|
||||||
parv[2]);
|
parv[2]);
|
||||||
else
|
else
|
||||||
sendto_one_numeric(source_p, ERR_NOSUCHNICK,
|
sendto_one_numeric(source_p, ERR_NOSUCHNICK,
|
||||||
form_str(ERR_NOSUCHNICK),
|
form_str(ERR_NOSUCHNICK),
|
||||||
parv[1]);
|
parv[1]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ m_invite(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do not send local channel invites to users if they are not on the
|
/* Do not send local channel invites to users if they are not on the
|
||||||
* same server as the person sending the INVITE message.
|
* same server as the person sending the INVITE message.
|
||||||
*/
|
*/
|
||||||
if(parv[2][0] == '&' && !MyConnect(target_p))
|
if(parv[2][0] == '&' && !MyConnect(target_p))
|
||||||
{
|
{
|
||||||
|
@ -163,7 +163,7 @@ m_invite(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
me.name, source_p->name, target_p->name);
|
me.name, source_p->name, target_p->name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
sendto_one(source_p, form_str(RPL_INVITING),
|
sendto_one(source_p, form_str(RPL_INVITING),
|
||||||
me.name, source_p->name,
|
me.name, source_p->name,
|
||||||
target_p->name, parv[2]);
|
target_p->name, parv[2]);
|
||||||
if(target_p->user->away)
|
if(target_p->user->away)
|
||||||
|
@ -208,8 +208,8 @@ m_invite(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
add_reply_target(target_p, source_p);
|
add_reply_target(target_p, source_p);
|
||||||
sendto_one(target_p, ":%s!%s@%s INVITE %s :%s",
|
sendto_one(target_p, ":%s!%s@%s INVITE %s :%s",
|
||||||
source_p->name, source_p->username, source_p->host,
|
source_p->name, source_p->username, source_p->host,
|
||||||
target_p->name, chptr->chname);
|
target_p->name, chptr->chname);
|
||||||
|
|
||||||
if(store_invite)
|
if(store_invite)
|
||||||
|
@ -243,7 +243,7 @@ add_invite(struct Channel *chptr, struct Client *who)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ok, if their invite list is too long, remove the tail */
|
/* ok, if their invite list is too long, remove the tail */
|
||||||
if((int)rb_dlink_list_length(&who->user->invited) >=
|
if((int)rb_dlink_list_length(&who->user->invited) >=
|
||||||
ConfigChannel.max_chans_per_user)
|
ConfigChannel.max_chans_per_user)
|
||||||
{
|
{
|
||||||
ptr = who->user->invited.tail;
|
ptr = who->user->invited.tail;
|
||||||
|
|
|
@ -428,7 +428,7 @@ mo_unkline(struct Client *client_p, struct Client *source_p, int parc, const cha
|
||||||
sendto_one_notice(source_p, ":No K-Line for %s@%s", user, host);
|
sendto_one_notice(source_p, ":No K-Line for %s@%s", user, host);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(aconf->lifetime)
|
if(aconf->lifetime)
|
||||||
{
|
{
|
||||||
if(propagated)
|
if(propagated)
|
||||||
|
@ -509,7 +509,7 @@ handle_remote_unkline(struct Client *source_p, const char *user, const char *hos
|
||||||
|
|
||||||
/* apply_kline()
|
/* apply_kline()
|
||||||
*
|
*
|
||||||
* inputs -
|
* inputs -
|
||||||
* output - NONE
|
* output - NONE
|
||||||
* side effects - kline as given, is added to the hashtable
|
* side effects - kline as given, is added to the hashtable
|
||||||
* and conf file
|
* and conf file
|
||||||
|
@ -632,7 +632,7 @@ apply_prop_kline(struct Client *source_p, struct ConfItem *aconf,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find_user_host()
|
/* find_user_host()
|
||||||
*
|
*
|
||||||
* inputs - client placing kline, user@host, user buffer, host buffer
|
* inputs - client placing kline, user@host, user buffer, host buffer
|
||||||
* output - 0 if not ok to kline, 1 to kline i.e. if valid user host
|
* output - 0 if not ok to kline, 1 to kline i.e. if valid user host
|
||||||
* side effects -
|
* side effects -
|
||||||
|
|
|
@ -94,8 +94,8 @@ m_knock(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!((chptr->mode.mode & MODE_INVITEONLY) || (*chptr->mode.key) ||
|
if(!((chptr->mode.mode & MODE_INVITEONLY) || (*chptr->mode.key) ||
|
||||||
(chptr->mode.limit &&
|
(chptr->mode.limit &&
|
||||||
rb_dlink_list_length(&chptr->members) >= (unsigned long)chptr->mode.limit)))
|
rb_dlink_list_length(&chptr->members) >= (unsigned long)chptr->mode.limit)))
|
||||||
{
|
{
|
||||||
sendto_one_numeric(source_p, ERR_CHANOPEN,
|
sendto_one_numeric(source_p, ERR_CHANOPEN,
|
||||||
|
@ -111,7 +111,7 @@ m_knock(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(MyClient(source_p))
|
if(MyClient(source_p))
|
||||||
{
|
{
|
||||||
/* don't allow a knock if the user is banned */
|
/* don't allow a knock if the user is banned */
|
||||||
|
@ -127,7 +127,7 @@ m_knock(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
* allow one knock per user per knock_delay
|
* allow one knock per user per knock_delay
|
||||||
* allow one knock per channel per knock_delay_channel
|
* allow one knock per channel per knock_delay_channel
|
||||||
*/
|
*/
|
||||||
if(!IsOper(source_p) &&
|
if(!IsOper(source_p) &&
|
||||||
(source_p->localClient->last_knock + ConfigChannel.knock_delay) > rb_current_time())
|
(source_p->localClient->last_knock + ConfigChannel.knock_delay) > rb_current_time())
|
||||||
{
|
{
|
||||||
sendto_one(source_p, form_str(ERR_TOOMANYKNOCK),
|
sendto_one(source_p, form_str(ERR_TOOMANYKNOCK),
|
||||||
|
|
|
@ -62,7 +62,7 @@ DECLARE_MODULE_AV1(links, NULL, NULL, links_clist, links_hlist, NULL, "$Revision
|
||||||
* m_links - LINKS message handler
|
* m_links - LINKS message handler
|
||||||
* parv[1] = servername mask
|
* parv[1] = servername mask
|
||||||
* or
|
* or
|
||||||
* parv[1] = server to query
|
* parv[1] = server to query
|
||||||
* parv[2] = servername mask
|
* parv[2] = servername mask
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
|
@ -117,7 +117,7 @@ mo_links(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* We just send the reply, as if theyre here theres either no SHIDE,
|
/* We just send the reply, as if theyre here theres either no SHIDE,
|
||||||
* or theyre an oper..
|
* or theyre an oper..
|
||||||
*/
|
*/
|
||||||
sendto_one_numeric(source_p, RPL_LINKS, form_str(RPL_LINKS),
|
sendto_one_numeric(source_p, RPL_LINKS, form_str(RPL_LINKS),
|
||||||
target_p->name, target_p->servptr->name,
|
target_p->name, target_p->servptr->name,
|
||||||
|
|
|
@ -200,7 +200,7 @@ static int mo_list(struct Client *client_p, struct Client *source_p, int parc, c
|
||||||
params->users_min = 3;
|
params->users_min = 3;
|
||||||
params->users_max = INT_MAX;
|
params->users_max = INT_MAX;
|
||||||
params->operspy = operspy;
|
params->operspy = operspy;
|
||||||
params->created_min = params->topic_min =
|
params->created_min = params->topic_min =
|
||||||
params->created_max = params->topic_max = 0;
|
params->created_max = params->topic_max = 0;
|
||||||
|
|
||||||
if (args && !EmptyString(args))
|
if (args && !EmptyString(args))
|
||||||
|
@ -484,7 +484,7 @@ static void safelist_iterate_client(struct Client *source_p)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RB_DLINK_FOREACH(ptr, channelTable[iter].head)
|
RB_DLINK_FOREACH(ptr, channelTable[iter].head)
|
||||||
safelist_one_channel(source_p, (struct Channel *) ptr->data);
|
safelist_one_channel(source_p, (struct Channel *) ptr->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -495,6 +495,6 @@ static void safelist_iterate_clients(void *unused)
|
||||||
{
|
{
|
||||||
rb_dlink_node *n, *n2;
|
rb_dlink_node *n, *n2;
|
||||||
|
|
||||||
RB_DLINK_FOREACH_SAFE(n, n2, safelisting_clients.head)
|
RB_DLINK_FOREACH_SAFE(n, n2, safelisting_clients.head)
|
||||||
safelist_iterate_client((struct Client *)n->data);
|
safelist_iterate_client((struct Client *)n->data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ static int
|
||||||
m_locops(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
m_locops(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||||
{
|
{
|
||||||
sendto_wallops_flags(UMODE_LOCOPS, source_p, "LOCOPS - %s", parv[1]);
|
sendto_wallops_flags(UMODE_LOCOPS, source_p, "LOCOPS - %s", parv[1]);
|
||||||
|
|
||||||
if(rb_dlink_list_length(&cluster_conf_list) > 0)
|
if(rb_dlink_list_length(&cluster_conf_list) > 0)
|
||||||
cluster_generic(source_p, "LOCOPS", SHARED_LOCOPS, CAP_CLUSTER,
|
cluster_generic(source_p, "LOCOPS", SHARED_LOCOPS, CAP_CLUSTER,
|
||||||
":%s", parv[1]);
|
":%s", parv[1]);
|
||||||
|
@ -74,7 +74,7 @@ ms_locops(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
/* source_p parv[1] parv[2]
|
/* source_p parv[1] parv[2]
|
||||||
* oper target serv message
|
* oper target serv message
|
||||||
*/
|
*/
|
||||||
propagate_generic(source_p, "LOCOPS", parv[1], CAP_CLUSTER,
|
propagate_generic(source_p, "LOCOPS", parv[1], CAP_CLUSTER,
|
||||||
":%s", parv[2]);
|
":%s", parv[2]);
|
||||||
|
|
||||||
if(!match(parv[1], me.name))
|
if(!match(parv[1], me.name))
|
||||||
|
|
|
@ -51,7 +51,7 @@ DECLARE_MODULE_AV1(lusers, NULL, NULL, lusers_clist, NULL, NULL, "$Revision: 254
|
||||||
* m_lusers - LUSERS message handler
|
* m_lusers - LUSERS message handler
|
||||||
* parv[1] = host/server mask.
|
* parv[1] = host/server mask.
|
||||||
* parv[2] = server to query
|
* parv[2] = server to query
|
||||||
*
|
*
|
||||||
* 199970918 JRL hacked to ignore parv[1] completely and require parc > 3
|
* 199970918 JRL hacked to ignore parv[1] completely and require parc > 3
|
||||||
* to cause a force
|
* to cause a force
|
||||||
*/
|
*/
|
||||||
|
@ -86,7 +86,7 @@ m_lusers(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
* ms_lusers - LUSERS message handler for servers and opers
|
* ms_lusers - LUSERS message handler for servers and opers
|
||||||
* parv[1] = host/server mask.
|
* parv[1] = host/server mask.
|
||||||
* parv[2] = server to query
|
* parv[2] = server to query
|
||||||
*
|
*
|
||||||
* 199970918 JRL hacked to ignore parv[1] completely and require parc > 3
|
* 199970918 JRL hacked to ignore parv[1] completely and require parc > 3
|
||||||
* to cause a force
|
* to cause a force
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* modules/m_monitor.c
|
/* modules/m_monitor.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2005 Lee Hardy <lee@leeh.co.uk>
|
* Copyright (C) 2005 Lee Hardy <lee@leeh.co.uk>
|
||||||
* Copyright (C) 2005 ircd-ratbox development team
|
* Copyright (C) 2005 ircd-ratbox development team
|
||||||
*
|
*
|
||||||
|
@ -111,7 +111,7 @@ add_monitor(struct Client *client_p, const char *nicks)
|
||||||
|
|
||||||
if((target_p = find_named_person(name)) != NULL)
|
if((target_p = find_named_person(name)) != NULL)
|
||||||
{
|
{
|
||||||
if(cur_onlen + strlen(target_p->name) +
|
if(cur_onlen + strlen(target_p->name) +
|
||||||
strlen(target_p->username) + strlen(target_p->host) + 3 >= BUFSIZE-3)
|
strlen(target_p->username) + strlen(target_p->host) + 3 >= BUFSIZE-3)
|
||||||
{
|
{
|
||||||
sendto_one(client_p, "%s", onbuf);
|
sendto_one(client_p, "%s", onbuf);
|
||||||
|
@ -228,7 +228,7 @@ list_monitor(struct Client *client_p)
|
||||||
}
|
}
|
||||||
|
|
||||||
sendto_one(client_p, "%s", buf);
|
sendto_one(client_p, "%s", buf);
|
||||||
sendto_one(client_p, form_str(RPL_ENDOFMONLIST),
|
sendto_one(client_p, form_str(RPL_ENDOFMONLIST),
|
||||||
me.name, client_p->name);
|
me.name, client_p->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,7 +257,7 @@ show_monitor_status(struct Client *client_p)
|
||||||
|
|
||||||
if((target_p = find_named_person(monptr->name)) != NULL)
|
if((target_p = find_named_person(monptr->name)) != NULL)
|
||||||
{
|
{
|
||||||
if(cur_onlen + strlen(target_p->name) +
|
if(cur_onlen + strlen(target_p->name) +
|
||||||
strlen(target_p->username) + strlen(target_p->host) + 3 >= BUFSIZE-3)
|
strlen(target_p->username) + strlen(target_p->host) + 3 >= BUFSIZE-3)
|
||||||
{
|
{
|
||||||
sendto_one(client_p, "%s", onbuf);
|
sendto_one(client_p, "%s", onbuf);
|
||||||
|
|
|
@ -83,7 +83,7 @@ m_names(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
if((chptr = find_channel(p)) != NULL)
|
if((chptr = find_channel(p)) != NULL)
|
||||||
channel_member_names(chptr, source_p, 1);
|
channel_member_names(chptr, source_p, 1);
|
||||||
else
|
else
|
||||||
sendto_one(source_p, form_str(RPL_ENDOFNAMES),
|
sendto_one(source_p, form_str(RPL_ENDOFNAMES),
|
||||||
me.name, source_p->name, p);
|
me.name, source_p->name, p);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -103,7 +103,7 @@ m_names(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
}
|
}
|
||||||
|
|
||||||
names_global(source_p);
|
names_global(source_p);
|
||||||
sendto_one(source_p, form_str(RPL_ENDOFNAMES),
|
sendto_one(source_p, form_str(RPL_ENDOFNAMES),
|
||||||
me.name, source_p->name, "*");
|
me.name, source_p->name, "*");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ names_global(struct Client *source_p)
|
||||||
chptr = ptr->data;
|
chptr = ptr->data;
|
||||||
channel_member_names(chptr, source_p, 0);
|
channel_member_names(chptr, source_p, 0);
|
||||||
}
|
}
|
||||||
cur_len = mlen = rb_sprintf(buf, form_str(RPL_NAMREPLY),
|
cur_len = mlen = rb_sprintf(buf, form_str(RPL_NAMREPLY),
|
||||||
me.name, source_p->name, "*", "*");
|
me.name, source_p->name, "*", "*");
|
||||||
t = buf + mlen;
|
t = buf + mlen;
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ m_oper(struct Client *client_p, struct Client *source_p, int parc, const char *p
|
||||||
if(!IsFloodDone(source_p))
|
if(!IsFloodDone(source_p))
|
||||||
flood_endgrace(source_p);
|
flood_endgrace(source_p);
|
||||||
|
|
||||||
oper_p = find_oper_conf(source_p->username, source_p->orighost,
|
oper_p = find_oper_conf(source_p->username, source_p->orighost,
|
||||||
source_p->sockhost, name);
|
source_p->sockhost, name);
|
||||||
|
|
||||||
if(oper_p == NULL)
|
if(oper_p == NULL)
|
||||||
|
@ -167,7 +167,7 @@ m_oper(struct Client *client_p, struct Client *source_p, int parc, const char *p
|
||||||
* match_oper_password
|
* match_oper_password
|
||||||
*
|
*
|
||||||
* inputs - pointer to given password
|
* inputs - pointer to given password
|
||||||
* - pointer to Conf
|
* - pointer to Conf
|
||||||
* output - YES or NO if match
|
* output - YES or NO if match
|
||||||
* side effects - none
|
* side effects - none
|
||||||
*/
|
*/
|
||||||
|
@ -183,7 +183,7 @@ match_oper_password(const char *password, struct oper_conf *oper_p)
|
||||||
if(IsOperConfEncrypted(oper_p))
|
if(IsOperConfEncrypted(oper_p))
|
||||||
{
|
{
|
||||||
/* use first two chars of the password they send in as salt */
|
/* use first two chars of the password they send in as salt */
|
||||||
/* If the password in the conf is MD5, and ircd is linked
|
/* If the password in the conf is MD5, and ircd is linked
|
||||||
* to scrypt on FreeBSD, or the standard crypt library on
|
* to scrypt on FreeBSD, or the standard crypt library on
|
||||||
* glibc Linux, then this code will work fine on generating
|
* glibc Linux, then this code will work fine on generating
|
||||||
* the proper encrypted hash for comparison.
|
* the proper encrypted hash for comparison.
|
||||||
|
|
|
@ -61,7 +61,7 @@ mr_pass(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
{
|
{
|
||||||
char *auth_user, *pass, *buf;
|
char *auth_user, *pass, *buf;
|
||||||
buf = LOCAL_COPY(parv[1]);
|
buf = LOCAL_COPY(parv[1]);
|
||||||
|
|
||||||
if(client_p->localClient->passwd)
|
if(client_p->localClient->passwd)
|
||||||
{
|
{
|
||||||
memset(client_p->localClient->passwd, 0,
|
memset(client_p->localClient->passwd, 0,
|
||||||
|
@ -80,24 +80,24 @@ mr_pass(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
|
|
||||||
if ((pass = strchr(buf, ':')) != NULL)
|
if ((pass = strchr(buf, ':')) != NULL)
|
||||||
{
|
{
|
||||||
*pass++ = '\0';
|
*pass++ = '\0';
|
||||||
auth_user = buf;
|
auth_user = buf;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pass = buf;
|
pass = buf;
|
||||||
auth_user = NULL;
|
auth_user = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
client_p->localClient->passwd = *pass ? rb_strndup(pass, PASSWDLEN) : NULL;
|
client_p->localClient->passwd = *pass ? rb_strndup(pass, PASSWDLEN) : NULL;
|
||||||
|
|
||||||
if(auth_user && *auth_user)
|
if(auth_user && *auth_user)
|
||||||
client_p->localClient->auth_user = rb_strndup(auth_user, PASSWDLEN);
|
client_p->localClient->auth_user = rb_strndup(auth_user, PASSWDLEN);
|
||||||
|
|
||||||
/* These are for servers only */
|
/* These are for servers only */
|
||||||
if(parc > 2 && client_p->user == NULL)
|
if(parc > 2 && client_p->user == NULL)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* 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...
|
* than one set of option strings possible here...
|
||||||
* i.e. ":AABBTS" as long as TS was the last two chars
|
* i.e. ":AABBTS" as long as TS was the last two chars
|
||||||
|
|
|
@ -96,7 +96,7 @@ ms_ping(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
irccmp(destination, me.id))
|
irccmp(destination, me.id))
|
||||||
{
|
{
|
||||||
if((target_p = find_client(destination)) && IsServer(target_p))
|
if((target_p = find_client(destination)) && IsServer(target_p))
|
||||||
sendto_one(target_p, ":%s PING %s :%s",
|
sendto_one(target_p, ":%s PING %s :%s",
|
||||||
get_id(source_p, target_p), source_p->name,
|
get_id(source_p, target_p), source_p->name,
|
||||||
get_id(target_p, target_p));
|
get_id(target_p, target_p));
|
||||||
/* not directed at an id.. */
|
/* not directed at an id.. */
|
||||||
|
@ -106,8 +106,8 @@ ms_ping(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
destination);
|
destination);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sendto_one(source_p, ":%s PONG %s :%s",
|
sendto_one(source_p, ":%s PONG %s :%s",
|
||||||
get_id(&me, source_p), me.name,
|
get_id(&me, source_p), me.name,
|
||||||
get_id(source_p, source_p));
|
get_id(source_p, source_p));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -70,8 +70,8 @@ ms_pong(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
irccmp(destination, me.id))
|
irccmp(destination, me.id))
|
||||||
{
|
{
|
||||||
if((target_p = find_client(destination)))
|
if((target_p = find_client(destination)))
|
||||||
sendto_one(target_p, ":%s PONG %s %s",
|
sendto_one(target_p, ":%s PONG %s %s",
|
||||||
get_id(source_p, target_p), parv[1],
|
get_id(source_p, target_p), parv[1],
|
||||||
get_id(target_p, target_p));
|
get_id(target_p, target_p));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -76,7 +76,7 @@ rehash_bans_loc(struct Client *source_p)
|
||||||
static void
|
static void
|
||||||
rehash_dns(struct Client *source_p)
|
rehash_dns(struct Client *source_p)
|
||||||
{
|
{
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s is rehashing DNS",
|
sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s is rehashing DNS",
|
||||||
get_oper_name(source_p));
|
get_oper_name(source_p));
|
||||||
if (!MyConnect(source_p))
|
if (!MyConnect(source_p))
|
||||||
remote_rehash_oper_p = source_p;
|
remote_rehash_oper_p = source_p;
|
||||||
|
@ -245,7 +245,7 @@ static void
|
||||||
rehash_help(struct Client *source_p)
|
rehash_help(struct Client *source_p)
|
||||||
{
|
{
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||||
"%s is forcing re-reading of HELP files",
|
"%s is forcing re-reading of HELP files",
|
||||||
get_oper_name(source_p));
|
get_oper_name(source_p));
|
||||||
if (!MyConnect(source_p))
|
if (!MyConnect(source_p))
|
||||||
remote_rehash_oper_p = source_p;
|
remote_rehash_oper_p = source_p;
|
||||||
|
@ -268,7 +268,7 @@ rehash_nickdelay(struct Client *source_p)
|
||||||
RB_DLINK_FOREACH_SAFE(ptr, safe_ptr, nd_list.head)
|
RB_DLINK_FOREACH_SAFE(ptr, safe_ptr, nd_list.head)
|
||||||
{
|
{
|
||||||
nd = ptr->data;
|
nd = ptr->data;
|
||||||
|
|
||||||
free_nd_entry(nd);
|
free_nd_entry(nd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ struct Message sasl_msgtab = {
|
||||||
{mg_ignore, mg_ignore, mg_ignore, mg_ignore, {me_sasl, 5}, mg_ignore}
|
{mg_ignore, mg_ignore, mg_ignore, mg_ignore, {me_sasl, 5}, mg_ignore}
|
||||||
};
|
};
|
||||||
|
|
||||||
mapi_clist_av1 sasl_clist[] = {
|
mapi_clist_av1 sasl_clist[] = {
|
||||||
&authenticate_msgtab, &sasl_msgtab, NULL
|
&authenticate_msgtab, &sasl_msgtab, NULL
|
||||||
};
|
};
|
||||||
mapi_hfn_list_av1 sasl_hfnlist[] = {
|
mapi_hfn_list_av1 sasl_hfnlist[] = {
|
||||||
|
@ -174,7 +174,7 @@ me_sasl(struct Client *client_p, struct Client *source_p,
|
||||||
}
|
}
|
||||||
else if(*parv[3] == 'M')
|
else if(*parv[3] == 'M')
|
||||||
sendto_one(target_p, form_str(RPL_SASLMECHS), me.name, EmptyString(target_p->name) ? "*" : target_p->name, parv[4]);
|
sendto_one(target_p, form_str(RPL_SASLMECHS), me.name, EmptyString(target_p->name) ? "*" : target_p->name, parv[4]);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ struct Message scan_msgtab = {
|
||||||
mapi_clist_av1 scan_clist[] = { &scan_msgtab, NULL };
|
mapi_clist_av1 scan_clist[] = { &scan_msgtab, NULL };
|
||||||
DECLARE_MODULE_AV1(scan, NULL, NULL, scan_clist, NULL, NULL, "$Revision: 1853 $");
|
DECLARE_MODULE_AV1(scan, NULL, NULL, scan_clist, NULL, NULL, "$Revision: 1853 $");
|
||||||
|
|
||||||
typedef int (*scan_handler)(struct Client *, struct Client *, int,
|
typedef int (*scan_handler)(struct Client *, struct Client *, int,
|
||||||
const char **);
|
const char **);
|
||||||
|
|
||||||
struct scan_cmd {
|
struct scan_cmd {
|
||||||
|
@ -84,7 +84,7 @@ static const char *spoofed_sockhost = "0";
|
||||||
* parv[2] = [target]
|
* parv[2] = [target]
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
mo_scan(struct Client *client_p, struct Client *source_p, int parc,
|
mo_scan(struct Client *client_p, struct Client *source_p, int parc,
|
||||||
const char *parv[])
|
const char *parv[])
|
||||||
{
|
{
|
||||||
struct scan_cmd *sptr;
|
struct scan_cmd *sptr;
|
||||||
|
@ -267,7 +267,7 @@ scan_umodes(struct Client *client_p, struct Client *source_p, int parc,
|
||||||
sendto_one_numeric(source_p, RPL_SCANUMODES,
|
sendto_one_numeric(source_p, RPL_SCANUMODES,
|
||||||
form_str(RPL_SCANUMODES),
|
form_str(RPL_SCANUMODES),
|
||||||
target_p->name, target_p->username,
|
target_p->name, target_p->username,
|
||||||
target_p->host, sockhost,
|
target_p->host, sockhost,
|
||||||
target_p->servptr->name, modebuf,
|
target_p->servptr->name, modebuf,
|
||||||
target_p->info);
|
target_p->info);
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ struct Message nickdelay_msgtab = {
|
||||||
{mg_unreg, mg_ignore, mg_ignore, mg_ignore, {me_nickdelay, 3}, mg_ignore}
|
{mg_unreg, mg_ignore, mg_ignore, mg_ignore, {me_nickdelay, 3}, mg_ignore}
|
||||||
};
|
};
|
||||||
|
|
||||||
mapi_clist_av1 services_clist[] = {
|
mapi_clist_av1 services_clist[] = {
|
||||||
&su_msgtab, &login_msgtab, &rsfnc_msgtab, &nickdelay_msgtab, NULL
|
&su_msgtab, &login_msgtab, &rsfnc_msgtab, &nickdelay_msgtab, NULL
|
||||||
};
|
};
|
||||||
mapi_hfn_list_av1 services_hfnlist[] = {
|
mapi_hfn_list_av1 services_hfnlist[] = {
|
||||||
|
@ -214,7 +214,7 @@ me_rsfnc(struct Client *client_p, struct Client *source_p,
|
||||||
char buf[BUFSIZE];
|
char buf[BUFSIZE];
|
||||||
|
|
||||||
/* this would be one hell of a race condition to trigger
|
/* this would be one hell of a race condition to trigger
|
||||||
* this one given the tsinfo check above, but its here for
|
* this one given the tsinfo check above, but its here for
|
||||||
* safety --anfl
|
* safety --anfl
|
||||||
*/
|
*/
|
||||||
if(target_p == exist_p)
|
if(target_p == exist_p)
|
||||||
|
|
|
@ -80,7 +80,7 @@ static void quote_splitusers(struct Client *, const char *, int);
|
||||||
static void list_quote_commands(struct Client *);
|
static void list_quote_commands(struct Client *);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If this ever needs to be expanded to more than one arg of each
|
* If this ever needs to be expanded to more than one arg of each
|
||||||
* type, want_char/want_int could be the count of the arguments,
|
* type, want_char/want_int could be the count of the arguments,
|
||||||
* instead of just a boolean flag...
|
* instead of just a boolean flag...
|
||||||
|
@ -235,7 +235,7 @@ quote_max(struct Client *source_p, const char *arg, int newval)
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||||
"%s!%s@%s set new MAXCLIENTS to %d (%lu current)",
|
"%s!%s@%s set new MAXCLIENTS to %d (%lu current)",
|
||||||
source_p->name, source_p->username, source_p->host,
|
source_p->name, source_p->username, source_p->host,
|
||||||
GlobalSetOptions.maxclients,
|
GlobalSetOptions.maxclients,
|
||||||
rb_dlink_list_length(&lclient_list));
|
rb_dlink_list_length(&lclient_list));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -259,7 +259,7 @@ quote_operstring(struct Client *source_p, const char *arg, int newval)
|
||||||
{
|
{
|
||||||
rb_strlcpy(GlobalSetOptions.operstring, arg,
|
rb_strlcpy(GlobalSetOptions.operstring, arg,
|
||||||
sizeof(GlobalSetOptions.operstring));
|
sizeof(GlobalSetOptions.operstring));
|
||||||
|
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||||
"%s has changed OPERSTRING to '%s'",
|
"%s has changed OPERSTRING to '%s'",
|
||||||
get_oper_name(source_p), arg);
|
get_oper_name(source_p), arg);
|
||||||
|
@ -278,7 +278,7 @@ quote_adminstring(struct Client *source_p, const char *arg, int newval)
|
||||||
{
|
{
|
||||||
rb_strlcpy(GlobalSetOptions.adminstring, arg,
|
rb_strlcpy(GlobalSetOptions.adminstring, arg,
|
||||||
sizeof(GlobalSetOptions.adminstring));
|
sizeof(GlobalSetOptions.adminstring));
|
||||||
|
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||||
"%s has changed ADMINSTRING to '%s'",
|
"%s has changed ADMINSTRING to '%s'",
|
||||||
get_oper_name(source_p), arg);
|
get_oper_name(source_p), arg);
|
||||||
|
@ -407,7 +407,7 @@ quote_splitmode(struct Client *source_p, const char *charval, int intval)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
/* if we add splitchecking to splitmode*2 we get a unique table to
|
/* if we add splitchecking to splitmode*2 we get a unique table to
|
||||||
* pull values back out of, splitmode can be four states - but you can
|
* pull values back out of, splitmode can be four states - but you can
|
||||||
* only set to three, which means we cant use the same table --fl_
|
* only set to three, which means we cant use the same table --fl_
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -65,7 +65,7 @@ struct Message signon_msgtab = {
|
||||||
{mg_ignore, mg_ignore, {ms_signon, 6}, mg_ignore, mg_ignore, mg_ignore}
|
{mg_ignore, mg_ignore, {ms_signon, 6}, mg_ignore, mg_ignore, mg_ignore}
|
||||||
};
|
};
|
||||||
|
|
||||||
mapi_clist_av1 signon_clist[] = {
|
mapi_clist_av1 signon_clist[] = {
|
||||||
&svslogin_msgtab, &signon_msgtab, NULL
|
&svslogin_msgtab, &signon_msgtab, NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -345,17 +345,17 @@ ms_signon(struct Client *client_p, struct Client *source_p,
|
||||||
"Nick change collision from SIGNON from %s to %s(%s <- %s)(both killed)",
|
"Nick change collision from SIGNON from %s to %s(%s <- %s)(both killed)",
|
||||||
source_p->name, target_p->name, target_p->from->name,
|
source_p->name, target_p->name, target_p->from->name,
|
||||||
client_p->name);
|
client_p->name);
|
||||||
|
|
||||||
ServerStats.is_kill++;
|
ServerStats.is_kill++;
|
||||||
sendto_one_numeric(target_p, ERR_NICKCOLLISION,
|
sendto_one_numeric(target_p, ERR_NICKCOLLISION,
|
||||||
form_str(ERR_NICKCOLLISION), target_p->name);
|
form_str(ERR_NICKCOLLISION), target_p->name);
|
||||||
|
|
||||||
kill_client_serv_butone(NULL, source_p, "%s (Nick change collision)", me.name);
|
kill_client_serv_butone(NULL, source_p, "%s (Nick change collision)", me.name);
|
||||||
|
|
||||||
ServerStats.is_kill++;
|
ServerStats.is_kill++;
|
||||||
|
|
||||||
kill_client_serv_butone(NULL, target_p, "%s (Nick change collision)", me.name);
|
kill_client_serv_butone(NULL, target_p, "%s (Nick change collision)", me.name);
|
||||||
|
|
||||||
target_p->flags |= FLAGS_KILLED;
|
target_p->flags |= FLAGS_KILLED;
|
||||||
exit_client(NULL, target_p, &me, "Nick collision(new)");
|
exit_client(NULL, target_p, &me, "Nick collision(new)");
|
||||||
source_p->flags |= FLAGS_KILLED;
|
source_p->flags |= FLAGS_KILLED;
|
||||||
|
@ -366,7 +366,7 @@ ms_signon(struct Client *client_p, struct Client *source_p,
|
||||||
{
|
{
|
||||||
sameuser = !irccmp(target_p->username, source_p->username) &&
|
sameuser = !irccmp(target_p->username, source_p->username) &&
|
||||||
!irccmp(target_p->host, source_p->host);
|
!irccmp(target_p->host, source_p->host);
|
||||||
|
|
||||||
if((sameuser && newts < target_p->tsinfo) ||
|
if((sameuser && newts < target_p->tsinfo) ||
|
||||||
(!sameuser && newts > target_p->tsinfo))
|
(!sameuser && newts > target_p->tsinfo))
|
||||||
{
|
{
|
||||||
|
@ -380,18 +380,18 @@ ms_signon(struct Client *client_p, struct Client *source_p,
|
||||||
"Nick change collision from SIGNON from %s to %s(%s <- %s)(newer killed)",
|
"Nick change collision from SIGNON from %s to %s(%s <- %s)(newer killed)",
|
||||||
source_p->name, target_p->name,
|
source_p->name, target_p->name,
|
||||||
target_p->from->name, client_p->name);
|
target_p->from->name, client_p->name);
|
||||||
|
|
||||||
ServerStats.is_kill++;
|
ServerStats.is_kill++;
|
||||||
|
|
||||||
sendto_one_numeric(target_p, ERR_NICKCOLLISION,
|
sendto_one_numeric(target_p, ERR_NICKCOLLISION,
|
||||||
form_str(ERR_NICKCOLLISION), target_p->name);
|
form_str(ERR_NICKCOLLISION), target_p->name);
|
||||||
|
|
||||||
/* kill the client issuing the nickchange */
|
/* kill the client issuing the nickchange */
|
||||||
kill_client_serv_butone(client_p, source_p,
|
kill_client_serv_butone(client_p, source_p,
|
||||||
"%s (Nick change collision)", me.name);
|
"%s (Nick change collision)", me.name);
|
||||||
|
|
||||||
source_p->flags |= FLAGS_KILLED;
|
source_p->flags |= FLAGS_KILLED;
|
||||||
|
|
||||||
if(sameuser)
|
if(sameuser)
|
||||||
exit_client(client_p, source_p, &me, "Nick collision(old)");
|
exit_client(client_p, source_p, &me, "Nick collision(old)");
|
||||||
else
|
else
|
||||||
|
@ -410,21 +410,21 @@ ms_signon(struct Client *client_p, struct Client *source_p,
|
||||||
"Nick collision from SIGNON on %s(%s <- %s)(newer killed)",
|
"Nick collision from SIGNON on %s(%s <- %s)(newer killed)",
|
||||||
target_p->name, target_p->from->name,
|
target_p->name, target_p->from->name,
|
||||||
client_p->name);
|
client_p->name);
|
||||||
|
|
||||||
sendto_one_numeric(target_p, ERR_NICKCOLLISION,
|
sendto_one_numeric(target_p, ERR_NICKCOLLISION,
|
||||||
form_str(ERR_NICKCOLLISION), target_p->name);
|
form_str(ERR_NICKCOLLISION), target_p->name);
|
||||||
|
|
||||||
/* kill the client who existed before hand */
|
/* kill the client who existed before hand */
|
||||||
kill_client_serv_butone(client_p, target_p,
|
kill_client_serv_butone(client_p, target_p,
|
||||||
"%s (Nick collision)", me.name);
|
"%s (Nick collision)", me.name);
|
||||||
|
|
||||||
ServerStats.is_kill++;
|
ServerStats.is_kill++;
|
||||||
|
|
||||||
target_p->flags |= FLAGS_KILLED;
|
target_p->flags |= FLAGS_KILLED;
|
||||||
(void) exit_client(client_p, target_p, &me, "Nick collision");
|
(void) exit_client(client_p, target_p, &me, "Nick collision");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ DECLARE_MODULE_AV1(snote, NULL, NULL, snote_clist, NULL, NULL, "$Revision: 623 $
|
||||||
* parv[2] = message
|
* parv[2] = message
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
me_snote(struct Client *client_p, struct Client *source_p, int parc,
|
me_snote(struct Client *client_p, struct Client *source_p, int parc,
|
||||||
const char *parv[])
|
const char *parv[])
|
||||||
{
|
{
|
||||||
/* if there's more than just two params, this is a protocol
|
/* if there's more than just two params, this is a protocol
|
||||||
|
|
|
@ -183,7 +183,7 @@ static struct StatsStruct stats_cmd_table[] = {
|
||||||
* parv[2] = (if present) server/mask in stats L, or target
|
* parv[2] = (if present) server/mask in stats L, or target
|
||||||
*
|
*
|
||||||
* This will search the tables for the appropriate stats letter,
|
* This will search the tables for the appropriate stats letter,
|
||||||
* if found execute it.
|
* if found execute it.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
m_stats(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
m_stats(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||||
|
@ -202,7 +202,7 @@ m_stats(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
/* safe enough to give this on a local connect only */
|
/* safe enough to give this on a local connect only */
|
||||||
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
||||||
me.name, source_p->name, "STATS");
|
me.name, source_p->name, "STATS");
|
||||||
sendto_one_numeric(source_p, RPL_ENDOFSTATS,
|
sendto_one_numeric(source_p, RPL_ENDOFSTATS,
|
||||||
form_str(RPL_ENDOFSTATS), statchar);
|
form_str(RPL_ENDOFSTATS), statchar);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -246,7 +246,7 @@ m_stats(struct Client *client_p, struct Client *source_p, int parc, const char *
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Send the end of stats notice, and the stats_spy */
|
/* Send the end of stats notice, and the stats_spy */
|
||||||
sendto_one_numeric(source_p, RPL_ENDOFSTATS,
|
sendto_one_numeric(source_p, RPL_ENDOFSTATS,
|
||||||
form_str(RPL_ENDOFSTATS), statchar);
|
form_str(RPL_ENDOFSTATS), statchar);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -285,7 +285,7 @@ stats_connect(struct Client *source_p)
|
||||||
char *s;
|
char *s;
|
||||||
rb_dlink_node *ptr;
|
rb_dlink_node *ptr;
|
||||||
|
|
||||||
if((ConfigFileEntry.stats_c_oper_only ||
|
if((ConfigFileEntry.stats_c_oper_only ||
|
||||||
(ConfigServerHide.flatten_links && !IsExemptShide(source_p))) &&
|
(ConfigServerHide.flatten_links && !IsExemptShide(source_p))) &&
|
||||||
!IsOper(source_p))
|
!IsOper(source_p))
|
||||||
{
|
{
|
||||||
|
@ -320,9 +320,9 @@ stats_connect(struct Client *source_p)
|
||||||
|
|
||||||
*s = '\0';
|
*s = '\0';
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_STATSCLINE,
|
sendto_one_numeric(source_p, RPL_STATSCLINE,
|
||||||
form_str(RPL_STATSCLINE),
|
form_str(RPL_STATSCLINE),
|
||||||
"*@127.0.0.1",
|
"*@127.0.0.1",
|
||||||
buf, server_p->name,
|
buf, server_p->name,
|
||||||
server_p->port, server_p->class_name);
|
server_p->port, server_p->class_name);
|
||||||
}
|
}
|
||||||
|
@ -355,7 +355,7 @@ stats_tdeny (struct Client *source_p)
|
||||||
|
|
||||||
get_printable_kline(source_p, aconf, &host, &pass, &user, &oper_reason);
|
get_printable_kline(source_p, aconf, &host, &pass, &user, &oper_reason);
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_STATSDLINE,
|
sendto_one_numeric(source_p, RPL_STATSDLINE,
|
||||||
form_str (RPL_STATSDLINE),
|
form_str (RPL_STATSDLINE),
|
||||||
'd', host, pass,
|
'd', host, pass,
|
||||||
oper_reason ? "|" : "",
|
oper_reason ? "|" : "",
|
||||||
|
@ -392,7 +392,7 @@ stats_deny (struct Client *source_p)
|
||||||
|
|
||||||
get_printable_kline(source_p, aconf, &host, &pass, &user, &oper_reason);
|
get_printable_kline(source_p, aconf, &host, &pass, &user, &oper_reason);
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_STATSDLINE,
|
sendto_one_numeric(source_p, RPL_STATSDLINE,
|
||||||
form_str (RPL_STATSDLINE),
|
form_str (RPL_STATSDLINE),
|
||||||
'D', host, pass,
|
'D', host, pass,
|
||||||
oper_reason ? "|" : "",
|
oper_reason ? "|" : "",
|
||||||
|
@ -434,7 +434,7 @@ stats_exempt(struct Client *source_p)
|
||||||
get_printable_conf (aconf, &name, &host, &pass,
|
get_printable_conf (aconf, &name, &host, &pass,
|
||||||
&user, &port, &classname);
|
&user, &port, &classname);
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_STATSDLINE,
|
sendto_one_numeric(source_p, RPL_STATSDLINE,
|
||||||
form_str(RPL_STATSDLINE),
|
form_str(RPL_STATSDLINE),
|
||||||
'e', host, pass, "", "");
|
'e', host, pass, "", "");
|
||||||
}
|
}
|
||||||
|
@ -469,7 +469,7 @@ stats_prop_klines(struct Client *source_p)
|
||||||
if(aconf->status != CONF_KILL)
|
if(aconf->status != CONF_KILL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
get_printable_kline(source_p, aconf, &host, &pass,
|
get_printable_kline(source_p, aconf, &host, &pass,
|
||||||
&user, &oper_reason);
|
&user, &oper_reason);
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_STATSKLINE,
|
sendto_one_numeric(source_p, RPL_STATSKLINE,
|
||||||
|
@ -486,7 +486,7 @@ stats_hubleaf(struct Client *source_p)
|
||||||
struct remote_conf *hub_p;
|
struct remote_conf *hub_p;
|
||||||
rb_dlink_node *ptr;
|
rb_dlink_node *ptr;
|
||||||
|
|
||||||
if((ConfigFileEntry.stats_h_oper_only ||
|
if((ConfigFileEntry.stats_h_oper_only ||
|
||||||
(ConfigServerHide.flatten_links && !IsExemptShide(source_p))) &&
|
(ConfigServerHide.flatten_links && !IsExemptShide(source_p))) &&
|
||||||
!IsOper(source_p))
|
!IsOper(source_p))
|
||||||
{
|
{
|
||||||
|
@ -587,7 +587,7 @@ stats_tklines(struct Client *source_p)
|
||||||
|
|
||||||
get_printable_kline(source_p, aconf, &host, &pass, &user, &oper_reason);
|
get_printable_kline(source_p, aconf, &host, &pass, &user, &oper_reason);
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_STATSKLINE,
|
sendto_one_numeric(source_p, RPL_STATSKLINE,
|
||||||
form_str(RPL_STATSKLINE), aconf->flags & CONF_FLAGS_TEMPORARY ? 'k' : 'K',
|
form_str(RPL_STATSKLINE), aconf->flags & CONF_FLAGS_TEMPORARY ? 'k' : 'K',
|
||||||
host, user, pass, oper_reason ? "|" : "",
|
host, user, pass, oper_reason ? "|" : "",
|
||||||
oper_reason ? oper_reason : "");
|
oper_reason ? oper_reason : "");
|
||||||
|
@ -606,7 +606,7 @@ stats_tklines(struct Client *source_p)
|
||||||
{
|
{
|
||||||
aconf = ptr->data;
|
aconf = ptr->data;
|
||||||
|
|
||||||
get_printable_kline(source_p, aconf, &host, &pass,
|
get_printable_kline(source_p, aconf, &host, &pass,
|
||||||
&user, &oper_reason);
|
&user, &oper_reason);
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_STATSKLINE,
|
sendto_one_numeric(source_p, RPL_STATSKLINE,
|
||||||
|
@ -700,8 +700,8 @@ stats_oper(struct Client *source_p)
|
||||||
RB_DLINK_FOREACH(ptr, oper_conf_list.head)
|
RB_DLINK_FOREACH(ptr, oper_conf_list.head)
|
||||||
{
|
{
|
||||||
oper_p = ptr->data;
|
oper_p = ptr->data;
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_STATSOLINE,
|
sendto_one_numeric(source_p, RPL_STATSOLINE,
|
||||||
form_str(RPL_STATSOLINE),
|
form_str(RPL_STATSOLINE),
|
||||||
oper_p->username, oper_p->host, oper_p->name,
|
oper_p->username, oper_p->host, oper_p->name,
|
||||||
IsOper(source_p) ? oper_p->privset->name : "0", "-1");
|
IsOper(source_p) ? oper_p->privset->name : "0", "-1");
|
||||||
|
@ -755,7 +755,7 @@ stats_operedup (struct Client *source_p)
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
"p :%s (%s@%s)",
|
"p :%s (%s@%s)",
|
||||||
target_p->name, target_p->username,
|
target_p->name, target_p->username,
|
||||||
target_p->host);
|
target_p->host);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -786,7 +786,7 @@ stats_tresv(struct Client *source_p)
|
||||||
{
|
{
|
||||||
aconf = ptr->data;
|
aconf = ptr->data;
|
||||||
if(aconf->hold)
|
if(aconf->hold)
|
||||||
sendto_one_numeric(source_p, RPL_STATSQLINE,
|
sendto_one_numeric(source_p, RPL_STATSQLINE,
|
||||||
form_str(RPL_STATSQLINE),
|
form_str(RPL_STATSQLINE),
|
||||||
'q', aconf->port, aconf->host, aconf->passwd);
|
'q', aconf->port, aconf->host, aconf->passwd);
|
||||||
}
|
}
|
||||||
|
@ -795,7 +795,7 @@ stats_tresv(struct Client *source_p)
|
||||||
{
|
{
|
||||||
aconf = ptr->data;
|
aconf = ptr->data;
|
||||||
if(aconf->hold)
|
if(aconf->hold)
|
||||||
sendto_one_numeric(source_p, RPL_STATSQLINE,
|
sendto_one_numeric(source_p, RPL_STATSQLINE,
|
||||||
form_str(RPL_STATSQLINE),
|
form_str(RPL_STATSQLINE),
|
||||||
'q', aconf->port, aconf->host, aconf->passwd);
|
'q', aconf->port, aconf->host, aconf->passwd);
|
||||||
}
|
}
|
||||||
|
@ -814,7 +814,7 @@ stats_resv(struct Client *source_p)
|
||||||
{
|
{
|
||||||
aconf = ptr->data;
|
aconf = ptr->data;
|
||||||
if(!aconf->hold)
|
if(!aconf->hold)
|
||||||
sendto_one_numeric(source_p, RPL_STATSQLINE,
|
sendto_one_numeric(source_p, RPL_STATSQLINE,
|
||||||
form_str(RPL_STATSQLINE),
|
form_str(RPL_STATSQLINE),
|
||||||
'Q', aconf->port, aconf->host, aconf->passwd);
|
'Q', aconf->port, aconf->host, aconf->passwd);
|
||||||
}
|
}
|
||||||
|
@ -823,7 +823,7 @@ stats_resv(struct Client *source_p)
|
||||||
{
|
{
|
||||||
aconf = ptr->data;
|
aconf = ptr->data;
|
||||||
if(!aconf->hold)
|
if(!aconf->hold)
|
||||||
sendto_one_numeric(source_p, RPL_STATSQLINE,
|
sendto_one_numeric(source_p, RPL_STATSQLINE,
|
||||||
form_str(RPL_STATSQLINE),
|
form_str(RPL_STATSQLINE),
|
||||||
'Q', aconf->port, aconf->host, aconf->passwd);
|
'Q', aconf->port, aconf->host, aconf->passwd);
|
||||||
}
|
}
|
||||||
|
@ -859,17 +859,17 @@ stats_usage (struct Client *source_p)
|
||||||
rup = (rb_current_time() - startup_time) * hzz;
|
rup = (rb_current_time() - startup_time) * hzz;
|
||||||
if(0 == rup)
|
if(0 == rup)
|
||||||
rup = 1;
|
rup = 1;
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
"R :CPU Secs %d:%02d User %d:%02d System %d:%02d",
|
"R :CPU Secs %d:%02d User %d:%02d System %d:%02d",
|
||||||
(int) (secs / 60), (int) (secs % 60),
|
(int) (secs / 60), (int) (secs % 60),
|
||||||
(int) (rus.ru_utime.tv_sec / 60),
|
(int) (rus.ru_utime.tv_sec / 60),
|
||||||
(int) (rus.ru_utime.tv_sec % 60),
|
(int) (rus.ru_utime.tv_sec % 60),
|
||||||
(int) (rus.ru_stime.tv_sec / 60),
|
(int) (rus.ru_stime.tv_sec / 60),
|
||||||
(int) (rus.ru_stime.tv_sec % 60));
|
(int) (rus.ru_stime.tv_sec % 60));
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
"R :RSS %ld ShMem %ld Data %ld Stack %ld",
|
"R :RSS %ld ShMem %ld Data %ld Stack %ld",
|
||||||
rus.ru_maxrss, (rus.ru_ixrss / rup),
|
rus.ru_maxrss, (rus.ru_ixrss / rup),
|
||||||
(rus.ru_idrss / rup), (rus.ru_isrss / rup));
|
(rus.ru_idrss / rup), (rus.ru_isrss / rup));
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
"R :Swaps %d Reclaims %d Faults %d",
|
"R :Swaps %d Reclaims %d Faults %d",
|
||||||
|
@ -882,7 +882,7 @@ stats_usage (struct Client *source_p)
|
||||||
(int) rus.ru_msgrcv, (int) rus.ru_msgsnd);
|
(int) rus.ru_msgrcv, (int) rus.ru_msgsnd);
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
"R :Signals %d Context Vol. %d Invol %d",
|
"R :Signals %d Context Vol. %d Invol %d",
|
||||||
(int) rus.ru_nsignals, (int) rus.ru_nvcsw,
|
(int) rus.ru_nsignals, (int) rus.ru_nvcsw,
|
||||||
(int) rus.ru_nivcsw);
|
(int) rus.ru_nivcsw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -923,7 +923,7 @@ stats_tstats (struct Client *source_p)
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
"T :accepts %u refused %u", sp.is_ac, sp.is_ref);
|
"T :accepts %u refused %u", sp.is_ac, sp.is_ref);
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
"T :rejected %u delaying %lu",
|
"T :rejected %u delaying %lu",
|
||||||
sp.is_rej, delay_exit_length());
|
sp.is_rej, delay_exit_length());
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
"T :throttled refused %u throttle list size %lu", sp.is_thr, throttle_size());
|
"T :throttled refused %u throttle list size %lu", sp.is_thr, throttle_size());
|
||||||
|
@ -937,7 +937,7 @@ stats_tstats (struct Client *source_p)
|
||||||
"T :nick collisions %u saves %u unknown closes %u",
|
"T :nick collisions %u saves %u unknown closes %u",
|
||||||
sp.is_kill, sp.is_save, sp.is_ni);
|
sp.is_kill, sp.is_save, sp.is_ni);
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
"T :wrong direction %u empty %u",
|
"T :wrong direction %u empty %u",
|
||||||
sp.is_wrdi, sp.is_empt);
|
sp.is_wrdi, sp.is_empt);
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
"T :numerics seen %u", sp.is_num);
|
"T :numerics seen %u", sp.is_num);
|
||||||
|
@ -957,11 +957,11 @@ stats_tstats (struct Client *source_p)
|
||||||
"T :connected %u %u", sp.is_cl, sp.is_sv);
|
"T :connected %u %u", sp.is_cl, sp.is_sv);
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
"T :bytes sent %lluK %lluK",
|
"T :bytes sent %lluK %lluK",
|
||||||
sp.is_cbs / 1024,
|
sp.is_cbs / 1024,
|
||||||
sp.is_sbs / 1024);
|
sp.is_sbs / 1024);
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
"T :bytes recv %lluK %lluK",
|
"T :bytes recv %lluK %lluK",
|
||||||
sp.is_cbr / 1024,
|
sp.is_cbr / 1024,
|
||||||
sp.is_sbr / 1024);
|
sp.is_sbr / 1024);
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
"T :time connected %llu %llu",
|
"T :time connected %llu %llu",
|
||||||
|
@ -974,13 +974,13 @@ stats_uptime (struct Client *source_p)
|
||||||
time_t now;
|
time_t now;
|
||||||
|
|
||||||
now = rb_current_time() - startup_time;
|
now = rb_current_time() - startup_time;
|
||||||
sendto_one_numeric(source_p, RPL_STATSUPTIME,
|
sendto_one_numeric(source_p, RPL_STATSUPTIME,
|
||||||
form_str (RPL_STATSUPTIME),
|
form_str (RPL_STATSUPTIME),
|
||||||
(int)(now / 86400), (int)((now / 3600) % 24),
|
(int)(now / 86400), (int)((now / 3600) % 24),
|
||||||
(int)((now / 60) % 60), (int)(now % 60));
|
(int)((now / 60) % 60), (int)(now % 60));
|
||||||
sendto_one_numeric(source_p, RPL_STATSCONN,
|
sendto_one_numeric(source_p, RPL_STATSCONN,
|
||||||
form_str (RPL_STATSCONN),
|
form_str (RPL_STATSCONN),
|
||||||
MaxConnectionCount, MaxClientCount,
|
MaxConnectionCount, MaxClientCount,
|
||||||
Count.totalrestartcount);
|
Count.totalrestartcount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1034,7 +1034,7 @@ stats_shared (struct Client *source_p)
|
||||||
|
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_STATSULINE,
|
sendto_one_numeric(source_p, RPL_STATSULINE,
|
||||||
form_str(RPL_STATSULINE),
|
form_str(RPL_STATSULINE),
|
||||||
shared_p->server, shared_p->username,
|
shared_p->server, shared_p->username,
|
||||||
shared_p->host, buf);
|
shared_p->host, buf);
|
||||||
|
@ -1056,7 +1056,7 @@ stats_shared (struct Client *source_p)
|
||||||
|
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_STATSULINE,
|
sendto_one_numeric(source_p, RPL_STATSULINE,
|
||||||
form_str(RPL_STATSULINE),
|
form_str(RPL_STATSULINE),
|
||||||
shared_p->server, "*", "*", buf);
|
shared_p->server, "*", "*", buf);
|
||||||
}
|
}
|
||||||
|
@ -1106,7 +1106,7 @@ stats_servers (struct Client *source_p)
|
||||||
(target_p->serv->by[0] ? target_p->serv->by : "Remote."),
|
(target_p->serv->by[0] ? target_p->serv->by : "Remote."),
|
||||||
(int) (rb_current_time() - target_p->localClient->lasttime),
|
(int) (rb_current_time() - target_p->localClient->lasttime),
|
||||||
(int) rb_linebuf_len (&target_p->localClient->buf_sendq),
|
(int) rb_linebuf_len (&target_p->localClient->buf_sendq),
|
||||||
days, (days == 1) ? "" : "s", hours, minutes,
|
days, (days == 1) ? "" : "s", hours, minutes,
|
||||||
(int) seconds);
|
(int) seconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1145,7 +1145,7 @@ stats_gecos(struct Client *source_p)
|
||||||
if(!aconf->hold)
|
if(!aconf->hold)
|
||||||
sendto_one_numeric(source_p, RPL_STATSXLINE,
|
sendto_one_numeric(source_p, RPL_STATSXLINE,
|
||||||
form_str(RPL_STATSXLINE),
|
form_str(RPL_STATSXLINE),
|
||||||
'X', aconf->port, aconf->host,
|
'X', aconf->port, aconf->host,
|
||||||
aconf->passwd);
|
aconf->passwd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1283,7 +1283,7 @@ stats_memory (struct Client *source_p)
|
||||||
"z :Users %u(%lu) Invites %u(%lu)",
|
"z :Users %u(%lu) Invites %u(%lu)",
|
||||||
users_counted,
|
users_counted,
|
||||||
(unsigned long) users_counted * sizeof(struct User),
|
(unsigned long) users_counted * sizeof(struct User),
|
||||||
users_invited_count,
|
users_invited_count,
|
||||||
(unsigned long) users_invited_count * sizeof(rb_dlink_node));
|
(unsigned long) users_invited_count * sizeof(rb_dlink_node));
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
|
@ -1302,7 +1302,7 @@ stats_memory (struct Client *source_p)
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
"z :Classes %u(%lu)",
|
"z :Classes %u(%lu)",
|
||||||
class_count,
|
class_count,
|
||||||
(unsigned long) class_count * sizeof(struct Class));
|
(unsigned long) class_count * sizeof(struct Class));
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
|
@ -1320,7 +1320,7 @@ stats_memory (struct Client *source_p)
|
||||||
"z :Channel members %u(%lu) invite %u(%lu)",
|
"z :Channel members %u(%lu) invite %u(%lu)",
|
||||||
channel_users,
|
channel_users,
|
||||||
(unsigned long) channel_users * sizeof(rb_dlink_node),
|
(unsigned long) channel_users * sizeof(rb_dlink_node),
|
||||||
channel_invites,
|
channel_invites,
|
||||||
(unsigned long) channel_invites * sizeof(rb_dlink_node));
|
(unsigned long) channel_invites * sizeof(rb_dlink_node));
|
||||||
|
|
||||||
total_channel_memory = channel_memory +
|
total_channel_memory = channel_memory +
|
||||||
|
@ -1335,7 +1335,7 @@ stats_memory (struct Client *source_p)
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
"z :Hash: client %u(%ld) chan %u(%ld)",
|
"z :Hash: client %u(%ld) chan %u(%ld)",
|
||||||
U_MAX, (long)(U_MAX * sizeof(rb_dlink_list)),
|
U_MAX, (long)(U_MAX * sizeof(rb_dlink_list)),
|
||||||
CH_MAX, (long)(CH_MAX * sizeof(rb_dlink_list)));
|
CH_MAX, (long)(CH_MAX * sizeof(rb_dlink_list)));
|
||||||
|
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
|
@ -1357,8 +1357,8 @@ stats_memory (struct Client *source_p)
|
||||||
|
|
||||||
total_memory += mem_servers_cached;
|
total_memory += mem_servers_cached;
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
"z :Total: whowas %d channel %d conf %d",
|
"z :Total: whowas %d channel %d conf %d",
|
||||||
(int) totww, (int) total_channel_memory,
|
(int) totww, (int) total_channel_memory,
|
||||||
(int) conf_memory);
|
(int) conf_memory);
|
||||||
|
|
||||||
count_local_client_memory(&local_client_count, &local_client_memory_used);
|
count_local_client_memory(&local_client_count, &local_client_memory_used);
|
||||||
|
@ -1391,7 +1391,7 @@ stats_ziplinks (struct Client *source_p)
|
||||||
target_p = ptr->data;
|
target_p = ptr->data;
|
||||||
if(IsCapable (target_p, CAP_ZIP))
|
if(IsCapable (target_p, CAP_ZIP))
|
||||||
{
|
{
|
||||||
zipstats = target_p->localClient->zipstats;
|
zipstats = target_p->localClient->zipstats;
|
||||||
sprintf(buf, "%.2f%%", zipstats->out_ratio);
|
sprintf(buf, "%.2f%%", zipstats->out_ratio);
|
||||||
sprintf(buf1, "%.2f%%", zipstats->in_ratio);
|
sprintf(buf1, "%.2f%%", zipstats->in_ratio);
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||||
|
@ -1399,8 +1399,8 @@ stats_ziplinks (struct Client *source_p)
|
||||||
"(%llu kB data/%llu kB wire)] recv[%s compression "
|
"(%llu kB data/%llu kB wire)] recv[%s compression "
|
||||||
"(%llu kB data/%llu kB wire)]",
|
"(%llu kB data/%llu kB wire)]",
|
||||||
target_p->name,
|
target_p->name,
|
||||||
buf, zipstats->out >> 10,
|
buf, zipstats->out >> 10,
|
||||||
zipstats->out_wire >> 10, buf1,
|
zipstats->out_wire >> 10, buf1,
|
||||||
zipstats->in >> 10, zipstats->in_wire >> 10);
|
zipstats->in >> 10, zipstats->in_wire >> 10);
|
||||||
sent_data++;
|
sent_data++;
|
||||||
}
|
}
|
||||||
|
@ -1447,7 +1447,7 @@ stats_servlinks (struct Client *source_p)
|
||||||
(int) target_p->localClient->receiveM,
|
(int) target_p->localClient->receiveM,
|
||||||
(int) target_p->localClient->receiveK,
|
(int) target_p->localClient->receiveK,
|
||||||
rb_current_time() - target_p->localClient->firsttime,
|
rb_current_time() - target_p->localClient->firsttime,
|
||||||
(rb_current_time() > target_p->localClient->lasttime) ?
|
(rb_current_time() > target_p->localClient->lasttime) ?
|
||||||
(rb_current_time() - target_p->localClient->lasttime) : 0,
|
(rb_current_time() - target_p->localClient->lasttime) : 0,
|
||||||
IsOper (source_p) ? show_capabilities (target_p) : "TS");
|
IsOper (source_p) ? show_capabilities (target_p) : "TS");
|
||||||
}
|
}
|
||||||
|
@ -1466,7 +1466,7 @@ stats_servlinks (struct Client *source_p)
|
||||||
|
|
||||||
uptime = (rb_current_time() - startup_time);
|
uptime = (rb_current_time() - startup_time);
|
||||||
snprintf(buf, sizeof buf, "%7.2f %s (%4.1f K/s)",
|
snprintf(buf, sizeof buf, "%7.2f %s (%4.1f K/s)",
|
||||||
_GMKv (me.localClient->sendK),
|
_GMKv (me.localClient->sendK),
|
||||||
_GMKs (me.localClient->sendK),
|
_GMKs (me.localClient->sendK),
|
||||||
(float) ((float) me.localClient->sendK / (float) uptime));
|
(float) ((float) me.localClient->sendK / (float) uptime));
|
||||||
sendto_one_numeric(source_p, RPL_STATSDEBUG, "? :Server send: %s", buf);
|
sendto_one_numeric(source_p, RPL_STATSDEBUG, "? :Server send: %s", buf);
|
||||||
|
@ -1610,7 +1610,7 @@ stats_l_client(struct Client *source_p, struct Client *target_p,
|
||||||
(int) target_p->localClient->receiveM,
|
(int) target_p->localClient->receiveM,
|
||||||
(int) target_p->localClient->receiveK,
|
(int) target_p->localClient->receiveK,
|
||||||
rb_current_time() - target_p->localClient->firsttime,
|
rb_current_time() - target_p->localClient->firsttime,
|
||||||
(rb_current_time() > target_p->localClient->lasttime) ?
|
(rb_current_time() > target_p->localClient->lasttime) ?
|
||||||
(rb_current_time() - target_p->localClient->lasttime) : 0,
|
(rb_current_time() - target_p->localClient->lasttime) : 0,
|
||||||
IsOper(source_p) ? show_capabilities(target_p) : "-");
|
IsOper(source_p) ? show_capabilities(target_p) : "-");
|
||||||
}
|
}
|
||||||
|
@ -1629,7 +1629,7 @@ stats_l_client(struct Client *source_p, struct Client *target_p,
|
||||||
(int) target_p->localClient->receiveM,
|
(int) target_p->localClient->receiveM,
|
||||||
(int) target_p->localClient->receiveK,
|
(int) target_p->localClient->receiveK,
|
||||||
rb_current_time() - target_p->localClient->firsttime,
|
rb_current_time() - target_p->localClient->firsttime,
|
||||||
(rb_current_time() > target_p->localClient->lasttime) ?
|
(rb_current_time() > target_p->localClient->lasttime) ?
|
||||||
(rb_current_time() - target_p->localClient->lasttime) : 0,
|
(rb_current_time() - target_p->localClient->lasttime) : 0,
|
||||||
"-");
|
"-");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* modules/m_tb.c
|
/* modules/m_tb.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003 Lee Hardy <lee@leeh.co.uk>
|
* Copyright (C) 2003 Lee Hardy <lee@leeh.co.uk>
|
||||||
* Copyright (C) 2003-2005 ircd-ratbox development team
|
* Copyright (C) 2003-2005 ircd-ratbox development team
|
||||||
*
|
*
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue