mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
Preliminary Client refactor.
Add client to ircd::client:: namespace. Also move former struct User and struct Server into client.cc as opaque structure demo.
This commit is contained in:
parent
90093b82e6
commit
dd9124b687
197 changed files with 2164 additions and 2011 deletions
|
@ -35,7 +35,7 @@ DECLARE_MODULE_AV2(chm_adminonly, _modinit, _moddeinit, NULL, NULL, adminonly_hf
|
|||
static void
|
||||
h_can_join(hook_data_channel *data)
|
||||
{
|
||||
struct Client *source_p = data->client;
|
||||
client::client *source_p = data->client;
|
||||
const auto &chptr(data->chptr);
|
||||
|
||||
if((chptr->mode.mode & mymode) && !IsAdmin(source_p)) {
|
||||
|
|
|
@ -37,7 +37,7 @@ DECLARE_MODULE_AV2(chm_insecure, _modinit, _moddeinit, NULL, NULL, sslonly_hfnli
|
|||
static void
|
||||
h_can_join(hook_data_channel *data)
|
||||
{
|
||||
struct Client *source_p = data->client;
|
||||
client::client *source_p = data->client;
|
||||
const auto &chptr(data->chptr);
|
||||
|
||||
if(!(chptr->mode.mode & mymode) && !IsSSLClient(source_p)) {
|
||||
|
|
|
@ -36,7 +36,7 @@ DECLARE_MODULE_AV2(chm_operonly, _modinit, _moddeinit, NULL, NULL, operonly_hfnl
|
|||
static void
|
||||
h_can_join(hook_data_channel *data)
|
||||
{
|
||||
struct Client *source_p = data->client;
|
||||
client::client *source_p = data->client;
|
||||
const auto &chptr(data->chptr);
|
||||
|
||||
if((chptr->mode.mode & mymode) && !IsOper(source_p)) {
|
||||
|
|
|
@ -10,7 +10,7 @@ static const char chm_operonly_compat[] =
|
|||
|
||||
static int _modinit(void);
|
||||
static void _moddeinit(void);
|
||||
static void chm_operonly(struct Client *source_p, chan::chan *chptr,
|
||||
static void chm_operonly(client::client *source_p, chan::chan *chptr,
|
||||
int alevel, int parc, int *parn,
|
||||
const char **parv, int *errors, int dir, char c, type type);
|
||||
|
||||
|
@ -35,7 +35,7 @@ _moddeinit(void)
|
|||
}
|
||||
|
||||
static void
|
||||
chm_operonly(struct Client *source_p, chan::chan *chptr,
|
||||
chm_operonly(client::client *source_p, chan::chan *chptr,
|
||||
int alevel, int parc, int *parn,
|
||||
const char **parv, int *errors, int dir, char c, type type)
|
||||
{
|
||||
|
|
|
@ -40,8 +40,8 @@ DECLARE_MODULE_AV2(chm_operpeace, _modinit, _moddeinit, NULL, NULL, chm_operpeac
|
|||
static void
|
||||
hdl_can_kick(hook_data_channel_approval *data)
|
||||
{
|
||||
struct Client *source_p = data->client;
|
||||
struct Client *who = data->target;
|
||||
client::client *source_p = data->client;
|
||||
client::client *who = data->target;
|
||||
const auto &chptr(data->chptr);
|
||||
|
||||
if(IsOper(source_p))
|
||||
|
|
|
@ -12,7 +12,7 @@ static const char chm_quietunreg_compat_desc[] =
|
|||
|
||||
static int _modinit(void);
|
||||
static void _moddeinit(void);
|
||||
static void chm_quietunreg(struct Client *source_p, chan::chan *chptr,
|
||||
static void chm_quietunreg(client::client *source_p, chan::chan *chptr,
|
||||
int alevel, int parc, int *parn,
|
||||
const char **parv, int *errors, int dir, char c, type type);
|
||||
|
||||
|
@ -37,7 +37,7 @@ _moddeinit(void)
|
|||
}
|
||||
|
||||
static void
|
||||
chm_quietunreg(struct Client *source_p, chan::chan *chptr,
|
||||
chm_quietunreg(client::client *source_p, chan::chan *chptr,
|
||||
int alevel, int parc, int *parn,
|
||||
const char **parv, int *errors, int dir, char c, type type)
|
||||
{
|
||||
|
|
|
@ -35,7 +35,7 @@ DECLARE_MODULE_AV2(chm_sslonly, _modinit, _moddeinit, NULL, NULL, sslonly_hfnlis
|
|||
static void
|
||||
h_can_join(hook_data_channel *data)
|
||||
{
|
||||
struct Client *source_p = data->client;
|
||||
client::client *source_p = data->client;
|
||||
const auto &chptr(data->chptr);
|
||||
|
||||
if((chptr->mode.mode & mymode) && !IsSSLClient(source_p)) {
|
||||
|
|
|
@ -10,7 +10,7 @@ static const char chm_sslonly_compat_desc[] =
|
|||
|
||||
static int _modinit(void);
|
||||
static void _moddeinit(void);
|
||||
static void chm_sslonly(struct Client *source_p, chan::chan *chptr,
|
||||
static void chm_sslonly(client::client *source_p, chan::chan *chptr,
|
||||
int alevel, int parc, int *parn,
|
||||
const char **parv, int *errors, int dir, char c, type type);
|
||||
|
||||
|
@ -35,7 +35,7 @@ _moddeinit(void)
|
|||
}
|
||||
|
||||
static void
|
||||
chm_sslonly(struct Client *source_p, chan::chan *chptr,
|
||||
chm_sslonly(client::client *source_p, chan::chan *chptr,
|
||||
int alevel, int parc, int *parn,
|
||||
const char **parv, int *errors, int dir, char c, type type)
|
||||
{
|
||||
|
|
|
@ -22,8 +22,8 @@ DECLARE_MODULE_AV2(createauthonly, NULL, NULL, NULL, NULL, restrict_hfnlist, NUL
|
|||
static void
|
||||
h_can_create_channel_authenticated(hook_data_client_approval *data)
|
||||
{
|
||||
struct Client *source_p = data->client;
|
||||
client::client *source_p = data->client;
|
||||
|
||||
if (source_p->user->suser.empty() && !IsOper(source_p))
|
||||
if (suser(user(*source_p)).empty() && !IsOper(source_p))
|
||||
data->approved = ERR_NEEDREGGEDNICK;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ DECLARE_MODULE_AV2(createoperonly, NULL, NULL, NULL, NULL, restrict_hfnlist, NUL
|
|||
static void
|
||||
h_can_create_channel_authenticated(hook_data_client_approval *data)
|
||||
{
|
||||
struct Client *source_p = data->client;
|
||||
client::client *source_p = data->client;
|
||||
|
||||
if (!IsOper(source_p))
|
||||
{
|
||||
|
|
|
@ -38,11 +38,11 @@ static const char example_desc[] = "This is an example Charybdis module.";
|
|||
* parv == an array of the parameters
|
||||
*/
|
||||
|
||||
static void munreg_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
|
||||
static void mclient_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
|
||||
static void mserver_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
|
||||
static void mrclient_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
|
||||
static void moper_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
|
||||
static void munreg_test(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[]);
|
||||
static void mclient_test(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[]);
|
||||
static void mserver_test(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[]);
|
||||
static void mrclient_test(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[]);
|
||||
static void moper_test(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[]);
|
||||
|
||||
/* Show the commands this module can handle in a msgtab
|
||||
* and give the msgtab a name, here its test_msgtab
|
||||
|
@ -176,7 +176,7 @@ DECLARE_MODULE_AV2(
|
|||
* and the fairly normal C coding
|
||||
*/
|
||||
static void
|
||||
munreg_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
munreg_test(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(parc < 2)
|
||||
{
|
||||
|
@ -196,7 +196,7 @@ munreg_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
|
|||
* parv[1] = parameter
|
||||
*/
|
||||
static void
|
||||
mclient_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
mclient_test(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(parc < 2)
|
||||
{
|
||||
|
@ -216,7 +216,7 @@ mclient_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *so
|
|||
* parv[1] = parameter
|
||||
*/
|
||||
static void
|
||||
mrclient_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
mrclient_test(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(parc < 2)
|
||||
{
|
||||
|
@ -233,7 +233,7 @@ mrclient_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *s
|
|||
* parv[1] = parameter
|
||||
*/
|
||||
static void
|
||||
mserver_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
mserver_test(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(parc < 2)
|
||||
{
|
||||
|
@ -250,7 +250,7 @@ mserver_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *so
|
|||
* parv[1] = parameter
|
||||
*/
|
||||
static void
|
||||
moper_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
moper_test(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(parc < 2)
|
||||
{
|
||||
|
|
|
@ -11,7 +11,7 @@ static const char extb_desc[] = "Account ($a) extban type";
|
|||
|
||||
static int _modinit(void);
|
||||
static void _moddeinit(void);
|
||||
static int eb_account(const char *data, struct Client *client_p, chan::chan *chptr, mode::type);
|
||||
static int eb_account(const char *data, client::client *client_p, chan::chan *chptr, mode::type);
|
||||
|
||||
DECLARE_MODULE_AV2(extb_account, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc);
|
||||
|
||||
|
@ -29,7 +29,7 @@ _moddeinit(void)
|
|||
ext::table['a'] = NULL;
|
||||
}
|
||||
|
||||
static int eb_account(const char *data, struct Client *client_p,
|
||||
static int eb_account(const char *data, client::client *client_p,
|
||||
chan::chan *chptr, mode::type type)
|
||||
{
|
||||
using namespace ext;
|
||||
|
@ -37,7 +37,7 @@ static int eb_account(const char *data, struct Client *client_p,
|
|||
(void)chptr;
|
||||
/* $a alone matches any logged in user */
|
||||
if (data == NULL)
|
||||
return client_p->user->suser.empty()? NOMATCH : MATCH;
|
||||
return suser(user(*client_p)).empty()? NOMATCH : MATCH;
|
||||
/* $a:MASK matches users logged in under matching account */
|
||||
return match(data, client_p->user->suser) ? MATCH : NOMATCH;
|
||||
return match(data, suser(user(*client_p))) ? MATCH : NOMATCH;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ static const char extb_desc[] = "Can join ($j) extban type - matches users who a
|
|||
|
||||
static int _modinit(void);
|
||||
static void _moddeinit(void);
|
||||
static int eb_canjoin(const char *data, struct Client *client_p, chan::chan *chptr, mode::type type);
|
||||
static int eb_canjoin(const char *data, client::client *client_p, chan::chan *chptr, mode::type type);
|
||||
|
||||
DECLARE_MODULE_AV2(extb_canjoin, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc);
|
||||
|
||||
|
@ -31,7 +31,7 @@ _moddeinit(void)
|
|||
}
|
||||
|
||||
static int
|
||||
eb_canjoin(const char *data, struct Client *client_p, chan::chan *chptr, mode::type type)
|
||||
eb_canjoin(const char *data, client::client *client_p, chan::chan *chptr, mode::type type)
|
||||
{
|
||||
using namespace ext;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ static const char extb_desc[] = "Channel ($c) extban type";
|
|||
|
||||
static int _modinit(void);
|
||||
static void _moddeinit(void);
|
||||
static int eb_channel(const char *data, struct Client *client_p, chan::chan *chptr, mode::type type);
|
||||
static int eb_channel(const char *data, client::client *client_p, chan::chan *chptr, mode::type type);
|
||||
|
||||
DECLARE_MODULE_AV2(extb_channel, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc);
|
||||
|
||||
|
@ -29,7 +29,7 @@ _moddeinit(void)
|
|||
ext::table['c'] = NULL;
|
||||
}
|
||||
|
||||
static int eb_channel(const char *data, struct Client *client_p,
|
||||
static int eb_channel(const char *data, client::client *client_p,
|
||||
chan::chan *chptr, mode::type type)
|
||||
{
|
||||
using namespace ext;
|
||||
|
|
|
@ -49,9 +49,9 @@ static const char extb_desc[] = "Combination ($&, $|) extban types";
|
|||
|
||||
static int _modinit(void);
|
||||
static void _moddeinit(void);
|
||||
static int eb_or(const char *data, struct Client *client_p, chan::chan *chptr, mode::type);
|
||||
static int eb_and(const char *data, struct Client *client_p, chan::chan *chptr, mode::type);
|
||||
static int eb_combi(const char *data, struct Client *client_p, chan::chan *chptr, mode::type, bool is_and);
|
||||
static int eb_or(const char *data, client::client *client_p, chan::chan *chptr, mode::type);
|
||||
static int eb_and(const char *data, client::client *client_p, chan::chan *chptr, mode::type);
|
||||
static int eb_combi(const char *data, client::client *client_p, chan::chan *chptr, mode::type, bool is_and);
|
||||
static int recursion_depth = 0;
|
||||
|
||||
DECLARE_MODULE_AV2(extb_extended, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc);
|
||||
|
@ -72,19 +72,19 @@ _moddeinit(void)
|
|||
ext::table['|'] = NULL;
|
||||
}
|
||||
|
||||
static int eb_or(const char *data, struct Client *client_p,
|
||||
static int eb_or(const char *data, client::client *client_p,
|
||||
chan::chan *chptr, mode::type type)
|
||||
{
|
||||
return eb_combi(data, client_p, chptr, type, false);
|
||||
}
|
||||
|
||||
static int eb_and(const char *data, struct Client *client_p,
|
||||
static int eb_and(const char *data, client::client *client_p,
|
||||
chan::chan *chptr, mode::type type)
|
||||
{
|
||||
return eb_combi(data, client_p, chptr, type, true);
|
||||
}
|
||||
|
||||
static int eb_combi(const char *data, struct Client *client_p,
|
||||
static int eb_combi(const char *data, client::client *client_p,
|
||||
chan::chan *chptr, mode::type type, bool is_and)
|
||||
{
|
||||
using namespace ext;
|
||||
|
|
|
@ -12,7 +12,7 @@ static const char extb_desc[] = "Extended mask ($x) extban type";
|
|||
|
||||
static int _modinit(void);
|
||||
static void _moddeinit(void);
|
||||
static int eb_extended(const char *data, struct Client *client_p, chan::chan *chptr, mode::type);
|
||||
static int eb_extended(const char *data, client::client *client_p, chan::chan *chptr, mode::type);
|
||||
|
||||
DECLARE_MODULE_AV2(extb_extended, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc);
|
||||
|
||||
|
@ -30,7 +30,7 @@ _moddeinit(void)
|
|||
ext::table['x'] = NULL;
|
||||
}
|
||||
|
||||
static int eb_extended(const char *data, struct Client *client_p,
|
||||
static int eb_extended(const char *data, client::client *client_p,
|
||||
chan::chan *chptr, mode::type type)
|
||||
{
|
||||
using namespace ext;
|
||||
|
|
|
@ -11,7 +11,7 @@ static const char extb_desc[] = "Hostmask ($m) extban type";
|
|||
|
||||
static int _modinit(void);
|
||||
static void _moddeinit(void);
|
||||
static int eb_hostmask(const char *data, struct Client *client_p, chan::chan *chptr, mode::type);
|
||||
static int eb_hostmask(const char *data, client::client *client_p, chan::chan *chptr, mode::type);
|
||||
|
||||
DECLARE_MODULE_AV2(extb_hostmask, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc);
|
||||
|
||||
|
@ -29,7 +29,7 @@ _moddeinit(void)
|
|||
}
|
||||
|
||||
static int
|
||||
eb_hostmask(const char *banstr, struct Client *client_p, chan::chan *chptr, mode::type type)
|
||||
eb_hostmask(const char *banstr, client::client *client_p, chan::chan *chptr, mode::type type)
|
||||
{
|
||||
using namespace ext;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ static const char extb_desc[] = "Oper ($o) extban type";
|
|||
|
||||
static int _modinit(void);
|
||||
static void _moddeinit(void);
|
||||
static int eb_oper(const char *data, struct Client *client_p, chan::chan *chptr, mode::type);
|
||||
static int eb_oper(const char *data, client::client *client_p, chan::chan *chptr, mode::type);
|
||||
|
||||
DECLARE_MODULE_AV2(extb_oper, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc);
|
||||
|
||||
|
@ -30,7 +30,7 @@ _moddeinit(void)
|
|||
}
|
||||
|
||||
static int
|
||||
eb_oper(const char *data, struct Client *client_p, chan::chan *chptr, mode::type type)
|
||||
eb_oper(const char *data, client::client *client_p, chan::chan *chptr, mode::type type)
|
||||
{
|
||||
using namespace ext;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ static const char extb_desc[] = "Realname/GECOS ($r) extban type";
|
|||
|
||||
static int _modinit(void);
|
||||
static void _moddeinit(void);
|
||||
static int eb_realname(const char *data, struct Client *client_p, chan::chan *chptr, mode::type);
|
||||
static int eb_realname(const char *data, client::client *client_p, chan::chan *chptr, mode::type);
|
||||
|
||||
DECLARE_MODULE_AV2(extb_realname, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc);
|
||||
|
||||
|
@ -30,7 +30,7 @@ _moddeinit(void)
|
|||
}
|
||||
|
||||
static int
|
||||
eb_realname(const char *data, struct Client *client_p, chan::chan *chptr, mode::type type)
|
||||
eb_realname(const char *data, client::client *client_p, chan::chan *chptr, mode::type type)
|
||||
{
|
||||
using namespace ext;
|
||||
using namespace mode;
|
||||
|
|
|
@ -11,7 +11,7 @@ static const char extb_desc[] = "Server ($s) extban type";
|
|||
|
||||
static int _modinit(void);
|
||||
static void _moddeinit(void);
|
||||
static int eb_server(const char *data, struct Client *client_p, chan::chan *chptr, mode::type);
|
||||
static int eb_server(const char *data, client::client *client_p, chan::chan *chptr, mode::type);
|
||||
|
||||
DECLARE_MODULE_AV2(extb_server, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc);
|
||||
|
||||
|
@ -30,7 +30,7 @@ _moddeinit(void)
|
|||
}
|
||||
|
||||
static int
|
||||
eb_server(const char *data, struct Client *client_p, chan::chan *chptr, mode::type type)
|
||||
eb_server(const char *data, client::client *client_p, chan::chan *chptr, mode::type type)
|
||||
{
|
||||
using namespace ext;
|
||||
using namespace mode;
|
||||
|
|
|
@ -8,7 +8,7 @@ static const char extb_desc[] = "SSL/TLS ($z) extban type";
|
|||
|
||||
static int _modinit(void);
|
||||
static void _moddeinit(void);
|
||||
static int eb_ssl(const char *data, struct Client *client_p, chan::chan *chptr, mode::type);
|
||||
static int eb_ssl(const char *data, client::client *client_p, chan::chan *chptr, mode::type);
|
||||
|
||||
DECLARE_MODULE_AV2(extb_ssl, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc);
|
||||
|
||||
|
@ -26,7 +26,7 @@ _moddeinit(void)
|
|||
ext::table['z'] = NULL;
|
||||
}
|
||||
|
||||
static int eb_ssl(const char *data, struct Client *client_p,
|
||||
static int eb_ssl(const char *data, client::client *client_p,
|
||||
chan::chan *chptr, mode::type type)
|
||||
{
|
||||
using namespace ext;
|
||||
|
|
|
@ -11,7 +11,7 @@ static const char extb_desc[] = "Usermode ($m) extban type";
|
|||
|
||||
static int _modinit(void);
|
||||
static void _moddeinit(void);
|
||||
static int eb_usermode(const char *data, struct Client *client_p, chan::chan *chptr, mode::type);
|
||||
static int eb_usermode(const char *data, client::client *client_p, chan::chan *chptr, mode::type);
|
||||
|
||||
DECLARE_MODULE_AV2(extb_usermode, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc);
|
||||
|
||||
|
@ -29,7 +29,7 @@ _moddeinit(void)
|
|||
ext::table['u'] = NULL;
|
||||
}
|
||||
|
||||
static int eb_usermode(const char *data, struct Client *client_p,
|
||||
static int eb_usermode(const char *data, client::client *client_p,
|
||||
chan::chan *chptr, mode::type type)
|
||||
{
|
||||
using namespace ext;
|
||||
|
|
|
@ -23,7 +23,7 @@ DECLARE_MODULE_AV2(force_user_invis, NULL, NULL, NULL, NULL, noi_hfnlist, NULL,
|
|||
static void
|
||||
h_noi_umode_changed(hook_data_umode_changed *hdata)
|
||||
{
|
||||
struct Client *source_p = hdata->client;
|
||||
client::client *source_p = hdata->client;
|
||||
|
||||
if (MyClient(source_p) && !IsOper(source_p) && !IsInvisible(source_p)) {
|
||||
SetInvisible(source_p);
|
||||
|
|
|
@ -9,13 +9,13 @@ static const char helpops_desc[] = "The helpops system as used by freenode";
|
|||
|
||||
static rb_dlink_list helper_list = { NULL, NULL, 0 };
|
||||
static void h_hdl_stats_request(hook_data_int *hdata);
|
||||
static void h_hdl_new_remote_user(struct Client *client_p);
|
||||
static void h_hdl_new_remote_user(client::client *client_p);
|
||||
static void h_hdl_client_exit(hook_data_client_exit *hdata);
|
||||
static void h_hdl_umode_changed(hook_data_umode_changed *hdata);
|
||||
static void h_hdl_whois(hook_data_client *hdata);
|
||||
static void mo_dehelper(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
static void me_dehelper(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
static void do_dehelper(struct Client *source_p, struct Client *target_p);
|
||||
static void mo_dehelper(struct MsgBuf *, client::client *, client::client *, int, const char **);
|
||||
static void me_dehelper(struct MsgBuf *, client::client *, client::client *, int, const char **);
|
||||
static void do_dehelper(client::client *source_p, client::client *target_p);
|
||||
|
||||
mapi_hfn_list_av1 helpops_hfnlist[] = {
|
||||
{ "doing_stats", (hookfn) h_hdl_stats_request },
|
||||
|
@ -37,9 +37,9 @@ struct Message dehelper_msgtab = {
|
|||
mapi_clist_av1 helpops_clist[] = { &dehelper_msgtab, NULL };
|
||||
|
||||
static void
|
||||
mo_dehelper(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char **parv)
|
||||
mo_dehelper(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char **parv)
|
||||
{
|
||||
struct Client *target_p;
|
||||
client::client *target_p;
|
||||
|
||||
if (!IsOperAdmin(source_p))
|
||||
{
|
||||
|
@ -47,7 +47,7 @@ mo_dehelper(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
|
|||
return;
|
||||
}
|
||||
|
||||
if(!(target_p = find_named_person(parv[1])))
|
||||
if(!(target_p = client::find_named_person(parv[1])))
|
||||
{
|
||||
sendto_one_numeric(source_p, ERR_NOSUCHNICK, form_str(ERR_NOSUCHNICK), parv[1]);
|
||||
return;
|
||||
|
@ -61,9 +61,9 @@ mo_dehelper(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
|
|||
}
|
||||
|
||||
static void
|
||||
me_dehelper(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char **parv)
|
||||
me_dehelper(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char **parv)
|
||||
{
|
||||
struct Client *target_p = find_person(parv[1]);
|
||||
client::client *target_p = client::find_person(parv[1]);
|
||||
if(!target_p)
|
||||
{
|
||||
sendto_one_numeric(source_p, ERR_NOSUCHNICK, form_str(ERR_NOSUCHNICK), parv[1]);
|
||||
|
@ -76,7 +76,7 @@ me_dehelper(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
|
|||
}
|
||||
|
||||
static void
|
||||
do_dehelper(struct Client *source_p, struct Client *target_p)
|
||||
do_dehelper(client::client *source_p, client::client *target_p)
|
||||
{
|
||||
const char *fakeparv[4];
|
||||
|
||||
|
@ -114,7 +114,7 @@ _moddeinit(void)
|
|||
static void
|
||||
h_hdl_stats_request(hook_data_int *hdata)
|
||||
{
|
||||
struct Client *target_p;
|
||||
client::client *target_p;
|
||||
rb_dlink_node *helper_ptr;
|
||||
unsigned int count = 0;
|
||||
|
||||
|
@ -123,9 +123,9 @@ h_hdl_stats_request(hook_data_int *hdata)
|
|||
|
||||
RB_DLINK_FOREACH (helper_ptr, helper_list.head)
|
||||
{
|
||||
target_p = (Client *)helper_ptr->data;
|
||||
target_p = (client::client *)helper_ptr->data;
|
||||
|
||||
if (target_p->user->away.size())
|
||||
if (away(user(*target_p)).size())
|
||||
continue;
|
||||
|
||||
count++;
|
||||
|
@ -143,7 +143,7 @@ h_hdl_stats_request(hook_data_int *hdata)
|
|||
}
|
||||
|
||||
static void
|
||||
h_hdl_new_remote_user(struct Client *client_p)
|
||||
h_hdl_new_remote_user(client::client *client_p)
|
||||
{
|
||||
if (client_p->umodes & UMODE_HELPOPS)
|
||||
rb_dlinkAddAlloc(client_p, &helper_list);
|
||||
|
@ -159,7 +159,7 @@ h_hdl_client_exit(hook_data_client_exit *hdata)
|
|||
static void
|
||||
h_hdl_umode_changed(hook_data_umode_changed *hdata)
|
||||
{
|
||||
struct Client *source_p = hdata->client;
|
||||
client::client *source_p = hdata->client;
|
||||
|
||||
/* didn't change +H umode, we don't need to do anything */
|
||||
if (!((hdata->oldumodes ^ source_p->umodes) & UMODE_HELPOPS))
|
||||
|
@ -183,10 +183,10 @@ h_hdl_umode_changed(hook_data_umode_changed *hdata)
|
|||
static void
|
||||
h_hdl_whois(hook_data_client *hdata)
|
||||
{
|
||||
struct Client *source_p = hdata->client;
|
||||
struct Client *target_p = hdata->target;
|
||||
client::client *source_p = hdata->client;
|
||||
client::client *target_p = hdata->target;
|
||||
|
||||
if ((target_p->umodes & UMODE_HELPOPS) && target_p->user->away.empty())
|
||||
if ((target_p->umodes & UMODE_HELPOPS) && away(user(*target_p)).empty())
|
||||
{
|
||||
sendto_one_numeric(source_p, RPL_WHOISHELPOP, form_str(RPL_WHOISHELPOP), target_p->name);
|
||||
}
|
||||
|
|
|
@ -36,16 +36,16 @@ typedef struct _hurt {
|
|||
/* }}} */
|
||||
|
||||
/* {{{ Prototypes */
|
||||
static void mo_hurt(struct MsgBuf *msgbuf_p, struct Client *, struct Client *, int, const char **);
|
||||
static void me_hurt(struct MsgBuf *msgbuf_p, struct Client *, struct Client *, int, const char **);
|
||||
static void mo_heal(struct MsgBuf *msgbuf_p, struct Client *, struct Client *, int, const char **);
|
||||
static void me_heal(struct MsgBuf *msgbuf_p, struct Client *, struct Client *, int, const char **);
|
||||
static void mo_hurt(struct MsgBuf *msgbuf_p, client::client *, client::client *, int, const char **);
|
||||
static void me_hurt(struct MsgBuf *msgbuf_p, client::client *, client::client *, int, const char **);
|
||||
static void mo_heal(struct MsgBuf *msgbuf_p, client::client *, client::client *, int, const char **);
|
||||
static void me_heal(struct MsgBuf *msgbuf_p, client::client *, client::client *, int, const char **);
|
||||
|
||||
static int modinit(void);
|
||||
static void modfini(void);
|
||||
|
||||
static void client_exit_hook(hook_data_client_exit *);
|
||||
static void new_local_user_hook(struct Client *);
|
||||
static void new_local_user_hook(client::client *);
|
||||
static void doing_stats_hook(hook_data_int *hdata);
|
||||
|
||||
static void hurt_check_event(void *);
|
||||
|
@ -53,13 +53,13 @@ static void hurt_expire_event(void *);
|
|||
|
||||
static hurt_t *hurt_new(time_t, const char *, const char *);
|
||||
static void hurt_add(hurt_t *);
|
||||
static void hurt_propagate(struct Client *, struct Client *, hurt_t *);
|
||||
static void hurt_propagate(client::client *, client::client *, hurt_t *);
|
||||
static hurt_t *hurt_find(const char *ip);
|
||||
static hurt_t *hurt_find_exact(const char *ip);
|
||||
static void hurt_remove(const char *ip);
|
||||
static void hurt_destroy(void *hurt);
|
||||
|
||||
static void heal_nick(struct Client *, struct Client *);
|
||||
static void heal_nick(client::client *, client::client *);
|
||||
|
||||
/* }}} */
|
||||
|
||||
|
@ -171,13 +171,13 @@ modfini(void)
|
|||
* parv[3] - reason or NULL
|
||||
*/
|
||||
static void
|
||||
mo_hurt(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
|
||||
mo_hurt(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p,
|
||||
int parc, const char **parv)
|
||||
{
|
||||
const char *ip, *expire, *reason;
|
||||
int expire_time;
|
||||
hurt_t *hurt;
|
||||
struct Client *target_p;
|
||||
client::client *target_p;
|
||||
|
||||
if (!IsOperK(source_p)) {
|
||||
sendto_one(source_p, form_str(ERR_NOPRIVS), me.name,
|
||||
|
@ -204,7 +204,7 @@ mo_hurt(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
|
|||
/* Is this a client? */
|
||||
if (strchr(ip, '.') == NULL && strchr(ip, ':') == NULL)
|
||||
{
|
||||
target_p = find_named_person(ip);
|
||||
target_p = client::find_named_person(ip);
|
||||
if (target_p == NULL)
|
||||
{
|
||||
sendto_one_numeric(source_p, ERR_NOSUCHNICK,
|
||||
|
@ -253,7 +253,7 @@ mo_hurt(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
|
|||
* parv[3] - reason
|
||||
*/
|
||||
static void
|
||||
me_hurt(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
|
||||
me_hurt(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p,
|
||||
int parc, const char **parv)
|
||||
{
|
||||
time_t expire_time;
|
||||
|
@ -288,10 +288,10 @@ me_hurt(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
|
|||
* parv[1] - nick or ip
|
||||
*/
|
||||
static void
|
||||
mo_heal(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
|
||||
mo_heal(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p,
|
||||
int parc, const char **parv)
|
||||
{
|
||||
struct Client *target_p;
|
||||
client::client *target_p;
|
||||
|
||||
if (!IsOperUnkline(source_p))
|
||||
{
|
||||
|
@ -300,9 +300,9 @@ mo_heal(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
|
|||
return;
|
||||
}
|
||||
|
||||
if (clean_nick(parv[1], 0))
|
||||
if (client::clean_nick(parv[1], 0))
|
||||
{
|
||||
target_p = find_named_person(parv[1]);
|
||||
target_p = client::find_named_person(parv[1]);
|
||||
if (target_p == NULL)
|
||||
{
|
||||
sendto_one_numeric(source_p, ERR_NOSUCHNICK,
|
||||
|
@ -339,10 +339,10 @@ mo_heal(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
|
|||
/* }}} */
|
||||
|
||||
static void
|
||||
me_heal(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
|
||||
me_heal(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p,
|
||||
int parc, const char **parv)
|
||||
{
|
||||
struct Client *target_p;
|
||||
client::client *target_p;
|
||||
|
||||
/* as noted in me_hurt(), if we don't get sufficient arguments...
|
||||
* *poof*, it's dropped...
|
||||
|
@ -350,9 +350,9 @@ me_heal(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
|
|||
if (parc < 2)
|
||||
return;
|
||||
|
||||
if (clean_nick(parv[1], 0))
|
||||
if (client::clean_nick(parv[1], 0))
|
||||
{
|
||||
target_p = find_person(parv[1]);
|
||||
target_p = client::find_person(parv[1]);
|
||||
if (target_p != NULL && MyConnect(target_p))
|
||||
heal_nick(source_p, target_p);
|
||||
}
|
||||
|
@ -376,11 +376,11 @@ static void
|
|||
hurt_check_event(void *arg)
|
||||
{
|
||||
rb_dlink_node *ptr, *next_ptr;
|
||||
struct Client *client_p;
|
||||
client::client *client_p;
|
||||
|
||||
RB_DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_state.hurt_clients.head) {
|
||||
client_p = (Client *)ptr->data;
|
||||
if (client_p->user->suser.size())
|
||||
client_p = (client::client *)ptr->data;
|
||||
if (suser(user(*client_p)).size())
|
||||
{
|
||||
rb_dlinkDestroy(ptr, &hurt_state.hurt_clients);
|
||||
sendto_one_notice(client_p, ":HURT restriction removed for this session");
|
||||
|
@ -429,9 +429,9 @@ client_exit_hook(hook_data_client_exit *data)
|
|||
|
||||
/* {{{ static void new_local_user_hook() */
|
||||
static void
|
||||
new_local_user_hook(struct Client *source_p)
|
||||
new_local_user_hook(client::client *source_p)
|
||||
{
|
||||
if (IsAnyDead(source_p) || source_p->user->suser.size() ||
|
||||
if (IsAnyDead(source_p) || suser(user(*source_p)).size() ||
|
||||
IsExemptKline(source_p))
|
||||
return;
|
||||
|
||||
|
@ -451,7 +451,7 @@ doing_stats_hook(hook_data_int *hdata)
|
|||
{
|
||||
rb_dlink_node *ptr;
|
||||
hurt_t *hurt;
|
||||
struct Client *source_p;
|
||||
client::client *source_p;
|
||||
|
||||
s_assert(hdata);
|
||||
s_assert(hdata->client);
|
||||
|
@ -500,7 +500,7 @@ doing_stats_hook(hook_data_int *hdata)
|
|||
* hurt - HURT to be propagated
|
||||
*/
|
||||
static void
|
||||
hurt_propagate(struct Client *client_p, struct Client *source_p, hurt_t *hurt)
|
||||
hurt_propagate(client::client *client_p, client::client *source_p, hurt_t *hurt)
|
||||
{
|
||||
if (client_p)
|
||||
sendto_one(client_p,
|
||||
|
@ -600,7 +600,7 @@ hurt_remove(const char *ip)
|
|||
|
||||
/* {{{ static void heal_nick() */
|
||||
static void
|
||||
heal_nick(struct Client *source_p, struct Client *target_p)
|
||||
heal_nick(client::client *source_p, client::client *target_p)
|
||||
{
|
||||
if (rb_dlinkFindDestroy(target_p, &hurt_state.hurt_clients))
|
||||
{
|
||||
|
|
|
@ -39,7 +39,7 @@ DECLARE_MODULE_AV2(ip_cloaking, _modinit, _moddeinit, NULL, NULL,
|
|||
ip_cloaking_hfnlist, NULL, NULL, ip_cloaking_desc);
|
||||
|
||||
static void
|
||||
distribute_hostchange(struct Client *client_p, char *newhost)
|
||||
distribute_hostchange(client::client *client_p, char *newhost)
|
||||
{
|
||||
if (newhost != client_p->orighost)
|
||||
sendto_one_numeric(client_p, RPL_HOSTHIDDEN, "%s :is now your hidden host",
|
||||
|
@ -156,7 +156,7 @@ static void
|
|||
check_umode_change(void *vdata)
|
||||
{
|
||||
hook_data_umode_changed *data = (hook_data_umode_changed *)vdata;
|
||||
struct Client *source_p = data->client;
|
||||
client::client *source_p = data->client;
|
||||
|
||||
if (!MyClient(source_p))
|
||||
return;
|
||||
|
@ -193,7 +193,7 @@ check_umode_change(void *vdata)
|
|||
static void
|
||||
check_new_user(void *vdata)
|
||||
{
|
||||
struct Client *source_p = (Client *)vdata;
|
||||
client::client *source_p = (client::client *)vdata;
|
||||
|
||||
if (IsIPSpoof(source_p))
|
||||
{
|
||||
|
|
|
@ -35,7 +35,7 @@ DECLARE_MODULE_AV2(ip_cloaking, _modinit, _moddeinit, NULL, NULL,
|
|||
ip_cloaking_hfnlist, NULL, NULL, ip_cloaking_desc);
|
||||
|
||||
static void
|
||||
distribute_hostchange(struct Client *client_p, char *newhost)
|
||||
distribute_hostchange(client::client *client_p, char *newhost)
|
||||
{
|
||||
if (newhost != client_p->orighost)
|
||||
sendto_one_numeric(client_p, RPL_HOSTHIDDEN, "%s :is now your hidden host",
|
||||
|
@ -162,7 +162,7 @@ static void
|
|||
check_umode_change(void *vdata)
|
||||
{
|
||||
hook_data_umode_changed *data = (hook_data_umode_changed *)vdata;
|
||||
struct Client *source_p = data->client;
|
||||
client::client *source_p = data->client;
|
||||
|
||||
if (!MyClient(source_p))
|
||||
return;
|
||||
|
@ -199,7 +199,7 @@ check_umode_change(void *vdata)
|
|||
static void
|
||||
check_new_user(void *vdata)
|
||||
{
|
||||
struct Client *source_p = (Client *)vdata;
|
||||
client::client *source_p = (client::client *)vdata;
|
||||
|
||||
if (IsIPSpoof(source_p))
|
||||
{
|
||||
|
|
|
@ -39,7 +39,7 @@ DECLARE_MODULE_AV2(ip_cloaking, _modinit, _moddeinit, NULL, NULL,
|
|||
ip_cloaking_hfnlist, NULL, NULL, ip_cloaking_desc);
|
||||
|
||||
static void
|
||||
distribute_hostchange(struct Client *client_p, char *newhost)
|
||||
distribute_hostchange(client::client *client_p, char *newhost)
|
||||
{
|
||||
if (newhost != client_p->orighost)
|
||||
sendto_one_numeric(client_p, RPL_HOSTHIDDEN, "%s :is now your hidden host",
|
||||
|
@ -156,7 +156,7 @@ static void
|
|||
check_umode_change(void *vdata)
|
||||
{
|
||||
hook_data_umode_changed *data = (hook_data_umode_changed *)vdata;
|
||||
struct Client *source_p = data->client;
|
||||
client::client *source_p = data->client;
|
||||
|
||||
if (!MyClient(source_p))
|
||||
return;
|
||||
|
@ -193,7 +193,7 @@ check_umode_change(void *vdata)
|
|||
static void
|
||||
check_new_user(void *vdata)
|
||||
{
|
||||
struct Client *source_p = (Client *)vdata;
|
||||
client::client *source_p = (client::client *)vdata;
|
||||
|
||||
if (IsIPSpoof(source_p))
|
||||
{
|
||||
|
|
|
@ -35,7 +35,7 @@ DECLARE_MODULE_AV2(ip_cloaking, _modinit, _moddeinit, NULL, NULL,
|
|||
ip_cloaking_hfnlist, NULL, NULL, ip_cloaking_desc);
|
||||
|
||||
static void
|
||||
distribute_hostchange(struct Client *client_p, char *newhost)
|
||||
distribute_hostchange(client::client *client_p, char *newhost)
|
||||
{
|
||||
if (newhost != client_p->orighost)
|
||||
sendto_one_numeric(client_p, RPL_HOSTHIDDEN, "%s :is now your hidden host",
|
||||
|
@ -104,7 +104,7 @@ static void
|
|||
check_umode_change(void *vdata)
|
||||
{
|
||||
hook_data_umode_changed *data = (hook_data_umode_changed *)vdata;
|
||||
struct Client *source_p = data->client;
|
||||
client::client *source_p = data->client;
|
||||
|
||||
if (!MyClient(source_p))
|
||||
return;
|
||||
|
@ -141,7 +141,7 @@ check_umode_change(void *vdata)
|
|||
static void
|
||||
check_new_user(void *vdata)
|
||||
{
|
||||
struct Client *source_p = (Client *)vdata;
|
||||
client::client *source_p = (client::client *)vdata;
|
||||
|
||||
if (IsIPSpoof(source_p))
|
||||
{
|
||||
|
|
|
@ -27,8 +27,8 @@ using namespace ircd;
|
|||
static const char adminwall_desc[] =
|
||||
"Provides the ADMINWALL command to send a message to all administrators";
|
||||
|
||||
static void mo_adminwall(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
static void me_adminwall(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
static void mo_adminwall(struct MsgBuf *, client::client *, client::client *, int, const char **);
|
||||
static void me_adminwall(struct MsgBuf *, client::client *, client::client *, int, const char **);
|
||||
|
||||
struct Message adminwall_msgtab = {
|
||||
"ADMINWALL", 0, 0, 0, 0,
|
||||
|
@ -45,7 +45,7 @@ DECLARE_MODULE_AV2(adminwall, NULL, NULL, adminwall_clist, NULL, NULL, NULL, NUL
|
|||
*/
|
||||
|
||||
static void
|
||||
mo_adminwall(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
mo_adminwall(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(!IsAdmin(source_p))
|
||||
{
|
||||
|
@ -58,7 +58,7 @@ mo_adminwall(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *so
|
|||
}
|
||||
|
||||
static void
|
||||
me_adminwall(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
me_adminwall(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
sendto_wallops_flags(UMODE_ADMIN, source_p, "ADMINWALL - %s", parv[1]);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using namespace ircd;
|
||||
|
||||
static void m_echotags(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
|
||||
static void m_echotags(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[]);
|
||||
|
||||
struct Message echotags_msgtab = {
|
||||
"ECHOTAGS", 0, 0, 0, 0,
|
||||
|
@ -14,7 +14,7 @@ static const char echotags_desc[] = "A test module for tags";
|
|||
DECLARE_MODULE_AV2(echotags, NULL, NULL, echotags_clist, NULL, NULL, NULL, NULL, echotags_desc);
|
||||
|
||||
static void
|
||||
m_echotags(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
m_echotags(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
sendto_one_notice(source_p, ":*** You sent %zu tags.", msgbuf_p->n_tags);
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@ using namespace ircd;
|
|||
static const char extendchans_desc[] =
|
||||
"Allow an oper or service to let a given user join more channels";
|
||||
|
||||
static void mo_extendchans(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
static void me_extendchans(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
static void mo_extendchans(struct MsgBuf *, client::client *, client::client *, int, const char **);
|
||||
static void me_extendchans(struct MsgBuf *, client::client *, client::client *, int, const char **);
|
||||
|
||||
struct Message extendchans_msgtab = {
|
||||
"EXTENDCHANS", 0, 0, 0, 0,
|
||||
|
@ -42,9 +42,9 @@ mapi_clist_av1 extendchans_clist[] = { &extendchans_msgtab, NULL };
|
|||
DECLARE_MODULE_AV2(extendchans, NULL, NULL, extendchans_clist, NULL, NULL, NULL, NULL, extendchans_desc);
|
||||
|
||||
static void
|
||||
mo_extendchans(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
mo_extendchans(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
struct Client *target_p;
|
||||
client::client *target_p;
|
||||
|
||||
if(!HasPrivilege(source_p, "oper:extendchans"))
|
||||
{
|
||||
|
@ -70,7 +70,7 @@ mo_extendchans(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *
|
|||
}
|
||||
else /* Target user isn't local, so pass it on. */
|
||||
{
|
||||
struct Client *cptr = target_p->servptr;
|
||||
client::client *cptr = target_p->servptr;
|
||||
sendto_one(cptr, ":%s ENCAP %s EXTENDCHANS %s",
|
||||
get_id(source_p, cptr), cptr->name, get_id(target_p, cptr));
|
||||
}
|
||||
|
@ -80,11 +80,11 @@ mo_extendchans(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *
|
|||
}
|
||||
|
||||
static void
|
||||
me_extendchans(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
me_extendchans(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
struct Client *target_p;
|
||||
client::client *target_p;
|
||||
|
||||
target_p = find_person(parv[1]);
|
||||
target_p = client::find_person(parv[1]);
|
||||
if(target_p == NULL)
|
||||
{
|
||||
sendto_one_numeric(source_p, ERR_NOSUCHNICK, form_str(ERR_NOSUCHNICK), parv[1]);
|
||||
|
@ -94,7 +94,7 @@ me_extendchans(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *
|
|||
/* Is the target user local? If not, pass it on. */
|
||||
if(!MyClient(target_p))
|
||||
{
|
||||
struct Client *cptr = target_p->servptr;
|
||||
client::client *cptr = target_p->servptr;
|
||||
sendto_one(cptr, ":%s ENCAP %s EXTENDCHANS %s",
|
||||
get_id(source_p, cptr), cptr->name, get_id(target_p, cptr));
|
||||
return;
|
||||
|
|
|
@ -22,7 +22,7 @@ using namespace ircd;
|
|||
|
||||
static const char findfowards_desc[] = "Allows operators to find forwards to a given channel";
|
||||
|
||||
static void m_findforwards(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
|
||||
static void m_findforwards(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p,
|
||||
int parc, const char *parv[]);
|
||||
|
||||
struct Message findforwards_msgtab = {
|
||||
|
@ -39,7 +39,7 @@ DECLARE_MODULE_AV2(findforwards, NULL, NULL, findforwards_clist, NULL, NULL, NUL
|
|||
** parv[1] = channel
|
||||
*/
|
||||
static void
|
||||
m_findforwards(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
m_findforwards(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
static time_t last_used = 0;
|
||||
chan::chan *chptr;
|
||||
|
|
|
@ -36,7 +36,7 @@ using namespace ircd;
|
|||
|
||||
static const char identify_desc[] = "Adds the IDENTIFY alias that forwards to NickServ or ChanServ";
|
||||
|
||||
static void m_identify(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
|
||||
static void m_identify(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[]);
|
||||
|
||||
struct Message identify_msgtab = {
|
||||
"IDENTIFY", 0, 0, 0, 0,
|
||||
|
@ -51,10 +51,10 @@ mapi_clist_av1 identify_clist[] = {
|
|||
DECLARE_MODULE_AV2(identify, NULL, NULL, identify_clist, NULL, NULL, NULL, NULL, identify_desc);
|
||||
|
||||
static void
|
||||
m_identify(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
m_identify(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
const char *nick;
|
||||
struct Client *target_p;
|
||||
client::client *target_p;
|
||||
|
||||
if (parc < 2 || EmptyString(parv[1]))
|
||||
{
|
||||
|
@ -63,7 +63,7 @@ m_identify(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sour
|
|||
}
|
||||
|
||||
nick = parv[1][0] == '#' ? SVS_chanserv_NICK : SVS_nickserv_NICK;
|
||||
if ((target_p = find_named_person(nick)) && IsService(target_p))
|
||||
if ((target_p = client::find_named_person(nick)) && IsService(target_p))
|
||||
{
|
||||
sendto_one(target_p, ":%s PRIVMSG %s :IDENTIFY %s", get_id(source_p, target_p), get_id(target_p, target_p), reconstruct_parv(parc - 1, &parv[1]));
|
||||
}
|
||||
|
|
|
@ -27,9 +27,9 @@ using namespace ircd;
|
|||
static const char locops_desc[] =
|
||||
"Provides the LOCOPS command to send a message to all local operators";
|
||||
|
||||
static void m_locops(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
static void ms_locops(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
static void me_locops(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
static void m_locops(struct MsgBuf *, client::client *, client::client *, int, const char **);
|
||||
static void ms_locops(struct MsgBuf *, client::client *, client::client *, int, const char **);
|
||||
static void me_locops(struct MsgBuf *, client::client *, client::client *, int, const char **);
|
||||
|
||||
struct Message locops_msgtab = {
|
||||
"LOCOPS", 0, 0, 0, 0,
|
||||
|
@ -46,7 +46,7 @@ DECLARE_MODULE_AV2(locops, NULL, NULL, locops_clist, NULL, NULL, NULL, NULL, loc
|
|||
* parv[1] = message text
|
||||
*/
|
||||
static void
|
||||
m_locops(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
m_locops(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
sendto_wallops_flags(UMODE_LOCOPS, source_p, "LOCOPS - %s", parv[1]);
|
||||
|
||||
|
@ -56,7 +56,7 @@ m_locops(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
|
|||
}
|
||||
|
||||
static void
|
||||
ms_locops(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
ms_locops(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
/* source_p parv[1] parv[2]
|
||||
* oper target serv message
|
||||
|
@ -72,7 +72,7 @@ ms_locops(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sourc
|
|||
}
|
||||
|
||||
static void
|
||||
me_locops(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
|
||||
me_locops(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p,
|
||||
int parc, const char *parv[])
|
||||
{
|
||||
if(!IsPerson(source_p))
|
||||
|
|
|
@ -9,9 +9,9 @@ using namespace ircd;
|
|||
|
||||
const char mkpasswd_desc[] = "Hash a password for use in ircd.conf";
|
||||
|
||||
static void m_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
|
||||
static void m_mkpasswd(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p,
|
||||
int parc, const char *parv[]);
|
||||
static void mo_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
|
||||
static void mo_mkpasswd(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p,
|
||||
int parc, const char *parv[]);
|
||||
|
||||
static char *make_md5_salt(int);
|
||||
|
@ -38,7 +38,7 @@ DECLARE_MODULE_AV2(mkpasswd, NULL, NULL, mkpasswd_clist, NULL, NULL, NULL, NULL,
|
|||
* parv[2] = type
|
||||
*/
|
||||
static void
|
||||
m_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
m_mkpasswd(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
static time_t last_used = 0;
|
||||
char *salt;
|
||||
|
@ -88,7 +88,7 @@ m_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sour
|
|||
* parv[2] = type
|
||||
*/
|
||||
static void
|
||||
mo_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
mo_mkpasswd(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
char *salt;
|
||||
const char *crypted;
|
||||
|
|
|
@ -21,7 +21,7 @@ using namespace ircd;
|
|||
|
||||
static const char ojoin_desc[] = "Allow admins to forcibly join channels with the OJOIN command";
|
||||
|
||||
static void mo_ojoin(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
|
||||
static void mo_ojoin(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[]);
|
||||
|
||||
struct Message ojoin_msgtab = {
|
||||
"OJOIN", 0, 0, 0, 0,
|
||||
|
@ -37,7 +37,7 @@ DECLARE_MODULE_AV2(ojoin, NULL, NULL, ojoin_clist, NULL, NULL, NULL, NULL, ojoin
|
|||
** parv[1] = channel
|
||||
*/
|
||||
static void
|
||||
mo_ojoin(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
mo_ojoin(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
chan::chan *chptr;
|
||||
int move_me = 0;
|
||||
|
|
|
@ -25,7 +25,7 @@ using namespace ircd;
|
|||
|
||||
static const char okick_desc[] = "Allow admins to forcibly kick users from channels with the OKICK command";
|
||||
|
||||
static void mo_okick(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
|
||||
static void mo_okick(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[]);
|
||||
|
||||
struct Message okick_msgtab = {
|
||||
"OKICK", 0, 0, 0, 0,
|
||||
|
@ -43,10 +43,10 @@ DECLARE_MODULE_AV2(okick, NULL, NULL, okick_clist, NULL, NULL, NULL, NULL, okick
|
|||
** parv[3] = kick comment
|
||||
*/
|
||||
static void
|
||||
mo_okick(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
mo_okick(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
struct Client *who;
|
||||
struct Client *target_p;
|
||||
client::client *who;
|
||||
client::client *target_p;
|
||||
chan::chan *chptr;
|
||||
chan::membership *msptr;
|
||||
int chasing = 0;
|
||||
|
|
|
@ -27,7 +27,7 @@ using namespace ircd;
|
|||
|
||||
static const char omode_desc[] = "Allow admins to forcibly change modes on channels with the OMODE command";
|
||||
|
||||
static void mo_omode(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
static void mo_omode(struct MsgBuf *, client::client *, client::client *, int, const char **);
|
||||
|
||||
struct Message omode_msgtab = {
|
||||
"OMODE", 0, 0, 0, 0,
|
||||
|
@ -43,7 +43,7 @@ DECLARE_MODULE_AV2(omode, NULL, NULL, omode_clist, NULL, NULL, NULL, NULL, omode
|
|||
* parv[1] - channel
|
||||
*/
|
||||
static void
|
||||
mo_omode(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
mo_omode(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
chan::chan *chptr = NULL;
|
||||
chan::membership *msptr;
|
||||
|
|
|
@ -21,7 +21,7 @@ using namespace ircd;
|
|||
|
||||
static const char opme_desc[] = "Allow admins to op themselves on opless channels";
|
||||
|
||||
static void mo_opme(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
|
||||
static void mo_opme(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[]);
|
||||
|
||||
struct Message opme_msgtab = {
|
||||
"OPME", 0, 0, 0, 0,
|
||||
|
@ -37,7 +37,7 @@ DECLARE_MODULE_AV2(opme, NULL, NULL, opme_clist, NULL, NULL, NULL, NULL, opme_de
|
|||
** parv[1] = channel
|
||||
*/
|
||||
static void
|
||||
mo_opme(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
mo_opme(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
chan::chan *chptr;
|
||||
chan::membership *msptr;
|
||||
|
|
|
@ -26,7 +26,7 @@ using namespace ircd;
|
|||
|
||||
static const char description[] = "Provides the REMOVE command, an alternative to KICK";
|
||||
|
||||
static void m_remove(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
static void m_remove(struct MsgBuf *, client::client *, client::client *, int, const char **);
|
||||
static void remove_quote_part(hook_data_privmsg_channel *);
|
||||
|
||||
unsigned int CAP_REMOVE;
|
||||
|
@ -50,10 +50,10 @@ mapi_cap_list_av2 remove_cap_list[] = {
|
|||
DECLARE_MODULE_AV2(remove, NULL, NULL, remove_clist, NULL, remove_hfnlist, remove_cap_list, NULL, description);
|
||||
|
||||
static void
|
||||
m_remove(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
m_remove(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
chan::membership *msptr;
|
||||
struct Client *who;
|
||||
client::client *who;
|
||||
chan::chan *chptr;
|
||||
int chasing = 0;
|
||||
char *comment;
|
||||
|
|
|
@ -18,13 +18,13 @@ using namespace ircd;
|
|||
static const char roleplay_desc[] =
|
||||
"Adds a roleplaying system that allows faked nicknames to talk in a channel set +N";
|
||||
|
||||
static void m_scene(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
|
||||
static void m_fsay(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
|
||||
static void m_faction(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
|
||||
static void m_npc(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
|
||||
static void m_npca(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
|
||||
static void m_displaymsg(struct MsgBuf *msgbuf_p, struct Client *source_p, const char *channel, int underline, int action, const char *nick, const char *text);
|
||||
static void me_roleplay(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
|
||||
static void m_scene(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[]);
|
||||
static void m_fsay(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[]);
|
||||
static void m_faction(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[]);
|
||||
static void m_npc(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[]);
|
||||
static void m_npca(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[]);
|
||||
static void m_displaymsg(struct MsgBuf *msgbuf_p, client::client *source_p, const char *channel, int underline, int action, const char *nick, const char *text);
|
||||
static void me_roleplay(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[]);
|
||||
static unsigned int mymode;
|
||||
|
||||
static int
|
||||
|
@ -89,37 +89,37 @@ mapi_clist_av1 roleplay_clist[] = { &scene_msgtab, &ambiance_msgtab, &fsay_msgta
|
|||
DECLARE_MODULE_AV2(roleplay, _modinit, _moddeinit, roleplay_clist, NULL, NULL, NULL, NULL, roleplay_desc);
|
||||
|
||||
static void
|
||||
m_scene(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
m_scene(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
m_displaymsg(msgbuf_p, source_p, parv[1], 0, 0, "=Scene=", parv[2]);
|
||||
}
|
||||
|
||||
static void
|
||||
m_fsay(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
m_fsay(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
m_displaymsg(msgbuf_p, source_p, parv[1], 0, 0, parv[2], parv[3]);
|
||||
}
|
||||
|
||||
static void
|
||||
m_faction(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
m_faction(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
m_displaymsg(msgbuf_p, source_p, parv[1], 0, 1, parv[2], parv[3]);
|
||||
}
|
||||
|
||||
static void
|
||||
m_npc(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
m_npc(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
m_displaymsg(msgbuf_p, source_p, parv[1], 1, 0, parv[2], parv[3]);
|
||||
}
|
||||
|
||||
static void
|
||||
m_npca(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
m_npca(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
m_displaymsg(msgbuf_p, source_p, parv[1], 1, 1, parv[2], parv[3]);
|
||||
}
|
||||
|
||||
static void
|
||||
m_displaymsg(struct MsgBuf *msgbuf_p, struct Client *source_p, const char *channel, int underline, int action, const char *nick, const char *text)
|
||||
m_displaymsg(struct MsgBuf *msgbuf_p, client::client *source_p, const char *channel, int underline, int action, const char *nick, const char *text)
|
||||
{
|
||||
chan::chan *chptr;
|
||||
chan::membership *msptr;
|
||||
|
@ -197,7 +197,7 @@ m_displaymsg(struct MsgBuf *msgbuf_p, struct Client *source_p, const char *chann
|
|||
}
|
||||
|
||||
static void
|
||||
me_roleplay(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
me_roleplay(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
chan::chan *chptr;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ using namespace ircd;
|
|||
static const char sendbands_desc[] =
|
||||
"Adds the ability to send all permanent RESVs and XLINEs to given server";
|
||||
|
||||
static void mo_sendbans(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
|
||||
static void mo_sendbans(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[]);
|
||||
|
||||
struct Message sendbans_msgtab = {
|
||||
"SENDBANS", 0, 0, 0, 0,
|
||||
|
@ -73,13 +73,13 @@ static const char *expand_xline(const char *mask)
|
|||
}
|
||||
|
||||
static void
|
||||
mo_sendbans(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
mo_sendbans(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
struct ConfItem *aconf;
|
||||
rb_dlink_node *ptr;
|
||||
int count;
|
||||
const char *target, *mask2;
|
||||
struct Client *server_p;
|
||||
client::client *server_p;
|
||||
struct rb_radixtree_iteration_state state;
|
||||
|
||||
if (!IsOperRemoteBan(source_p))
|
||||
|
@ -105,7 +105,7 @@ mo_sendbans(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
|
|||
count = 0;
|
||||
RB_DLINK_FOREACH(ptr, global_serv_list.head)
|
||||
{
|
||||
server_p = (Client *)ptr->data;
|
||||
server_p = (client::client *)ptr->data;
|
||||
if (IsMe(server_p))
|
||||
continue;
|
||||
if (match(target, server_p->name))
|
||||
|
|
|
@ -42,7 +42,7 @@ using namespace ircd;
|
|||
|
||||
static const char webirc_desc[] = "Adds support for the WebIRC system";
|
||||
|
||||
static void mr_webirc(struct MsgBuf *msgbuf_p, struct Client *, struct Client *, int, const char **);
|
||||
static void mr_webirc(struct MsgBuf *msgbuf_p, client::client *, client::client *, int, const char **);
|
||||
|
||||
struct Message webirc_msgtab = {
|
||||
"WEBIRC", 0, 0, 0, 0,
|
||||
|
@ -61,7 +61,7 @@ DECLARE_MODULE_AV2(webirc, NULL, NULL, webirc_clist, NULL, NULL, NULL, NULL, web
|
|||
* parv[4] = fake ip
|
||||
*/
|
||||
static void
|
||||
mr_webirc(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
mr_webirc(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
struct ConfItem *aconf;
|
||||
const char *encr;
|
||||
|
|
|
@ -19,7 +19,7 @@ DECLARE_MODULE_AV2(no_locops, NULL, NULL, NULL, NULL, nl_hfnlist, NULL, NULL, no
|
|||
static void
|
||||
h_nl_umode_changed(hook_data_umode_changed *hdata)
|
||||
{
|
||||
struct Client *source_p = hdata->client;
|
||||
client::client *source_p = hdata->client;
|
||||
|
||||
if (MyClient(source_p) && source_p->umodes & UMODE_LOCOPS)
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@ DECLARE_MODULE_AV2(no_oper_invis, NULL, NULL, NULL, NULL, noi_hfnlist, NULL, NUL
|
|||
static void
|
||||
h_noi_umode_changed(hook_data_umode_changed *hdata)
|
||||
{
|
||||
struct Client *source_p = hdata->client;
|
||||
client::client *source_p = hdata->client;
|
||||
|
||||
if (MyClient(source_p) && IsOper(source_p) && !IsOperInvis(source_p) &&
|
||||
IsInvisible(source_p))
|
||||
|
|
|
@ -36,14 +36,14 @@ mapi_hfn_list_av1 override_hfnlist[] = {
|
|||
struct OverrideSession {
|
||||
rb_dlink_node node;
|
||||
|
||||
struct Client *client;
|
||||
client::client *client;
|
||||
time_t deadline;
|
||||
};
|
||||
|
||||
rb_dlink_list overriding_opers = { NULL, NULL, 0 };
|
||||
|
||||
static void
|
||||
update_session_deadline(struct Client *source_p, struct OverrideSession *session_p)
|
||||
update_session_deadline(client::client *source_p, struct OverrideSession *session_p)
|
||||
{
|
||||
if (session_p == NULL)
|
||||
{
|
||||
|
@ -96,7 +96,7 @@ static void
|
|||
check_umode_change(void *vdata)
|
||||
{
|
||||
hook_data_umode_changed *data = (hook_data_umode_changed *)vdata;
|
||||
struct Client *source_p = data->client;
|
||||
client::client *source_p = data->client;
|
||||
|
||||
if (!MyClient(source_p))
|
||||
return;
|
||||
|
@ -230,7 +230,7 @@ handle_client_exit(void *vdata)
|
|||
{
|
||||
hook_data_client_exit *data = (hook_data_client_exit *) vdata;
|
||||
rb_dlink_node *n, *tn;
|
||||
struct Client *source_p = data->target;
|
||||
client::client *source_p = data->target;
|
||||
|
||||
RB_DLINK_FOREACH_SAFE(n, tn, overriding_opers.head)
|
||||
{
|
||||
|
|
|
@ -22,7 +22,7 @@ hack_channel_access(void *vdata)
|
|||
if (!MyClient(data->client))
|
||||
return;
|
||||
|
||||
if (data->client->user->suser.empty())
|
||||
if (suser(user(*data->client)).empty())
|
||||
data->approved = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ h_scc_channel_join(void *vdata)
|
|||
{
|
||||
hook_data_channel_activity *data = (hook_data_channel_activity *)vdata;
|
||||
const auto chptr(data->chptr);
|
||||
struct Client *source_p = data->client;
|
||||
client::client *source_p = data->client;
|
||||
|
||||
/* If they just joined a channel, and it only has one member, then they just created it. */
|
||||
if(size(chptr->members) == 1 && is_chanop(get(chptr->members, *source_p, std::nothrow)))
|
||||
|
|
|
@ -13,7 +13,7 @@ static const char sno_desc[] =
|
|||
|
||||
static int _modinit(void);
|
||||
static void _moddeinit(void);
|
||||
static void h_gcn_new_remote_user(struct Client *);
|
||||
static void h_gcn_new_remote_user(client::client *);
|
||||
static void h_gcn_client_exit(hook_data_client_exit *);
|
||||
|
||||
mapi_hfn_list_av1 gcn_hfnlist[] = {
|
||||
|
@ -44,7 +44,7 @@ _moddeinit(void)
|
|||
}
|
||||
|
||||
static void
|
||||
h_gcn_new_remote_user(struct Client *source_p)
|
||||
h_gcn_new_remote_user(client::client *source_p)
|
||||
{
|
||||
|
||||
if (!HasSentEob(source_p->servptr))
|
||||
|
@ -59,7 +59,7 @@ h_gcn_new_remote_user(struct Client *source_p)
|
|||
static void
|
||||
h_gcn_client_exit(hook_data_client_exit *hdata)
|
||||
{
|
||||
struct Client *source_p;
|
||||
client::client *source_p;
|
||||
|
||||
source_p = hdata->target;
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ DECLARE_MODULE_AV2(globallineactive, NULL, NULL, NULL, NULL, gla_hfnlist, NULL,
|
|||
static void
|
||||
h_gla_client_exit(hook_data_client_exit *hdata)
|
||||
{
|
||||
struct Client *source_p;
|
||||
client::client *source_p;
|
||||
|
||||
source_p = hdata->target;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ _modinit(void)
|
|||
static void
|
||||
h_gnc_nick_change(hook_data *data)
|
||||
{
|
||||
struct Client *source_p = data->client;
|
||||
client::client *source_p = data->client;
|
||||
const char *oldnick = (const char *)data->arg1;
|
||||
const char *newnick = (const char *)data->arg2;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ static void
|
|||
h_sgo_umode_changed(void *vdata)
|
||||
{
|
||||
hook_data_umode_changed *data = (hook_data_umode_changed *)vdata;
|
||||
struct Client *source_p = data->client;
|
||||
client::client *source_p = data->client;
|
||||
|
||||
if (MyConnect(source_p) || !HasSentEob(source_p->servptr))
|
||||
return;
|
||||
|
|
|
@ -47,8 +47,8 @@ DECLARE_MODULE_AV2(sno_whois, init, fini, NULL, NULL, whois_hfnlist, NULL, NULL,
|
|||
void
|
||||
show_whois(hook_data_client *data)
|
||||
{
|
||||
struct Client *source_p = data->client;
|
||||
struct Client *target_p = data->target;
|
||||
client::client *source_p = data->client;
|
||||
client::client *target_p = data->target;
|
||||
|
||||
if(MyClient(target_p) &&
|
||||
#ifdef OPERONLY
|
||||
|
|
|
@ -619,7 +619,7 @@ struct Expr *match_any_expr(const char *const text,
|
|||
*/
|
||||
|
||||
static
|
||||
int dump_pcre_config(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
int dump_pcre_config(client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
union
|
||||
{
|
||||
|
@ -702,7 +702,7 @@ int dump_pcre_config(struct Client *client_p, struct Client *source_p, int parc,
|
|||
|
||||
|
||||
static
|
||||
int spamexpr_info(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
int spamexpr_info(client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(parc > 0 && !IsOper(source_p))
|
||||
{
|
||||
|
@ -752,7 +752,7 @@ int spamexpr_info(struct Client *client_p, struct Client *source_p, int parc, co
|
|||
|
||||
|
||||
static
|
||||
int spamexpr_list(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
int spamexpr_list(client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(parc > 0 && !IsOper(source_p))
|
||||
{
|
||||
|
@ -788,7 +788,7 @@ int spamexpr_list(struct Client *client_p, struct Client *source_p, int parc, co
|
|||
* example: CASELESS|ANCHORED|DOTALL
|
||||
*/
|
||||
static
|
||||
int spamexpr_add(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
int spamexpr_add(client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(!IsOper(source_p) && !IsServer(source_p))
|
||||
{
|
||||
|
@ -844,7 +844,7 @@ int spamexpr_add(struct Client *client_p, struct Client *source_p, int parc, con
|
|||
|
||||
|
||||
static
|
||||
int spamexpr_del(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
int spamexpr_del(client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(!IsOper(source_p) && !IsServer(source_p))
|
||||
{
|
||||
|
@ -884,7 +884,7 @@ int spamexpr_del(struct Client *client_p, struct Client *source_p, int parc, con
|
|||
|
||||
|
||||
static
|
||||
int spamexpr_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
int spamexpr_test(client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(!IsOper(source_p))
|
||||
{
|
||||
|
@ -935,7 +935,7 @@ int spamexpr_test(struct Client *client_p, struct Client *source_p, int parc, co
|
|||
|
||||
|
||||
static
|
||||
int spamexpr_sync(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
int spamexpr_sync(client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(!IsOper(source_p) && !IsServer(source_p))
|
||||
{
|
||||
|
@ -966,7 +966,7 @@ int spamexpr_sync(struct Client *client_p, struct Client *source_p, int parc, co
|
|||
|
||||
|
||||
static void
|
||||
m_spamexpr(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
m_spamexpr(struct MsgBuf *msgbuf_p, client::client *client_p, client::client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(parc <= 1)
|
||||
{
|
||||
|
|
|
@ -213,7 +213,7 @@ static
|
|||
int real_test_token(const char *const token,
|
||||
struct chan *const chan)
|
||||
{
|
||||
struct Client *const client = find_named_client(token);
|
||||
client::client *const client = find_named_client(token);
|
||||
return client && is_member(chan, client);
|
||||
}
|
||||
|
||||
|
|
|
@ -69,11 +69,11 @@ void restart_authd(void);
|
|||
void rehash_authd(void);
|
||||
void check_authd(void);
|
||||
|
||||
void authd_initiate_client(struct Client *, bool defer);
|
||||
void authd_deferred_client(struct Client *);
|
||||
void authd_accept_client(struct Client *client_p, const char *ident, const char *host);
|
||||
void authd_reject_client(struct Client *client_p, const char *ident, const char *host, char cause, const char *data, const char *reason);
|
||||
void authd_abort_client(struct Client *);
|
||||
void authd_initiate_client(client::client *, bool defer);
|
||||
void authd_deferred_client(client::client *);
|
||||
void authd_accept_client(client::client *client_p, const char *ident, const char *host);
|
||||
void authd_reject_client(client::client *client_p, const char *ident, const char *host, char cause, const char *data, const char *reason);
|
||||
void authd_abort_client(client::client *);
|
||||
|
||||
void add_blacklist(const char *host, const char *reason, uint8_t iptype, rb_dlink_list *filters);
|
||||
void del_blacklist(const char *host);
|
||||
|
|
|
@ -35,7 +35,7 @@ typedef enum
|
|||
LAST_BANDB_TYPE
|
||||
} bandb_type;
|
||||
|
||||
void bandb_add(bandb_type, struct Client *source_p, const char *mask1,
|
||||
void bandb_add(bandb_type, client::client *source_p, const char *mask1,
|
||||
const char *mask2, const char *reason, const char *oper_reason, int perm);
|
||||
void bandb_del(bandb_type, const char *mask1, const char *mask2);
|
||||
void bandb_rehash_bans(void);
|
||||
|
|
|
@ -43,8 +43,8 @@ namespace motd
|
|||
extern file user;
|
||||
extern file oper;
|
||||
|
||||
void send_user(Client *);
|
||||
void send_oper(Client *);
|
||||
void send_user(client::client *);
|
||||
void send_oper(client::client *);
|
||||
|
||||
void cache_user();
|
||||
void cache_oper();
|
||||
|
|
|
@ -97,7 +97,7 @@ uint operator~(const modes &);
|
|||
|
||||
struct membership
|
||||
{
|
||||
using global = std::map<client *, membership>;
|
||||
using global = std::map<client::client *, membership>;
|
||||
using local = std::list<membership *>;
|
||||
|
||||
uint flags;
|
||||
|
@ -116,8 +116,8 @@ bool is_voiced(const membership *const &);
|
|||
bool can_send_banned(const membership &);
|
||||
bool can_send_banned(const membership *const &);
|
||||
const char *find_status(const membership *const &msptr, const int &combine);
|
||||
const client &get_client(const membership &);
|
||||
client &get_client(membership &);
|
||||
const client::client &get_client(const membership &);
|
||||
client::client &get_client(membership &);
|
||||
|
||||
struct members
|
||||
{
|
||||
|
@ -132,11 +132,11 @@ bool empty(const members &);
|
|||
size_t size(const members &);
|
||||
bool local_empty(const members &);
|
||||
size_t local_size(const members &);
|
||||
bool exists(const members &, const client &);
|
||||
const membership *get(const members &, const client &, std::nothrow_t);
|
||||
const membership &get(const members &, const client &);
|
||||
membership *get(members &, const client &, std::nothrow_t);
|
||||
membership &get(members &, const client &);
|
||||
bool exists(const members &, const client::client &);
|
||||
const membership *get(const members &, const client::client &, std::nothrow_t);
|
||||
const membership &get(const members &, const client::client &);
|
||||
membership *get(members &, const client::client &, std::nothrow_t);
|
||||
membership &get(members &, const client::client &);
|
||||
|
||||
bool has_prefix(const char *const &name);
|
||||
bool has_prefix(const std::string &name);
|
||||
|
@ -150,7 +150,7 @@ struct chan
|
|||
std::string mode_lock;
|
||||
struct topic topic;
|
||||
struct members members;
|
||||
std::set<client *> invites;
|
||||
std::set<client::client *> invites;
|
||||
list bans;
|
||||
list excepts;
|
||||
list invexs;
|
||||
|
@ -165,7 +165,7 @@ struct chan
|
|||
time_t bants;
|
||||
time_t channelts;
|
||||
time_t last_checked_ts;
|
||||
const client *last_checked_client;
|
||||
const client::client *last_checked_client;
|
||||
mode::type last_checked_type;
|
||||
bool last_checked_result;
|
||||
|
||||
|
@ -180,10 +180,10 @@ bool is_hidden(const chan &);
|
|||
bool is_hidden(const chan *const &);
|
||||
bool is_public(const chan &);
|
||||
bool is_public(const chan *const &);
|
||||
bool is_member(const chan &c, const client &);
|
||||
bool is_member(const chan *const &, const client *const &);
|
||||
bool can_show(const chan &, const client &);
|
||||
bool can_show(const chan *const &, const client *const &);
|
||||
bool is_member(const chan &c, const client::client &);
|
||||
bool is_member(const chan *const &, const client::client *const &);
|
||||
bool can_show(const chan &, const client::client &);
|
||||
bool can_show(const chan *const &, const client::client *const &);
|
||||
|
||||
enum : int
|
||||
{
|
||||
|
@ -191,11 +191,11 @@ enum : int
|
|||
CAN_SEND_NONOP = 1,
|
||||
CAN_SEND_OPV = 2,
|
||||
};
|
||||
int can_send(chan *, client *, membership *);
|
||||
int can_join(client *source, chan *, const char *key, const char **forward);
|
||||
int can_send(chan *, client::client *, membership *);
|
||||
int can_join(client::client *source, chan *, const char *key, const char **forward);
|
||||
|
||||
bool cache_check(const chan &, const mode::type &, const client &, bool &result);
|
||||
void cache_result(chan &, const mode::type &, const client &, const bool &result, membership *const &msptr = nullptr);
|
||||
bool cache_check(const chan &, const mode::type &, const client::client &, bool &result);
|
||||
void cache_result(chan &, const mode::type &, const client::client &, const bool &result, membership *const &msptr = nullptr);
|
||||
void cache_invalidate(chan &, const mode::type &, time_t time = 0);
|
||||
|
||||
const list &get(const chan &, const mode::type &);
|
||||
|
@ -211,41 +211,41 @@ struct check_data
|
|||
const char *iphost;
|
||||
const char **forward;
|
||||
};
|
||||
bool check(chan &, const mode::type &, const client &, check_data *const &data = nullptr);
|
||||
bool check(chan &, const mode::type &, const client::client &, check_data *const &data = nullptr);
|
||||
const ban &get(const chan &, const mode::type &, const std::string &mask);
|
||||
bool add(chan &, const mode::type &, const std::string &mask, client &source, const std::string &forward = {});
|
||||
bool add(chan &, const mode::type &, const std::string &mask, client::client &source, const std::string &forward = {});
|
||||
bool del(chan &, const mode::type &, const std::string &mask);
|
||||
|
||||
void del_invite(chan &, client &);
|
||||
void del_invite(chan &, client::client &);
|
||||
void clear_invites(chan &);
|
||||
|
||||
bool flood_attack_channel(int p_or_n, client *source, chan *);
|
||||
void invalidate_bancache_user(client *);
|
||||
void channel_member_names(chan *, client *, int show_eon);
|
||||
const char *channel_modes(chan *, client *who);
|
||||
chan *find_bannickchange_channel(client *);
|
||||
void check_spambot_warning(client *source, const char *name);
|
||||
bool flood_attack_channel(int p_or_n, client::client *source, chan *);
|
||||
void invalidate_bancache_user(client::client *);
|
||||
void channel_member_names(chan *, client::client *, int show_eon);
|
||||
const char *channel_modes(chan *, client::client *who);
|
||||
chan *find_bannickchange_channel(client::client *);
|
||||
void check_spambot_warning(client::client *source, const char *name);
|
||||
void check_splitmode(void *);
|
||||
void set_channel_topic(chan *, const char *topic, const char *topic_info, time_t topicts);
|
||||
void init_chcap_usage_counts(void);
|
||||
void set_chcap_usage_counts(client *serv_p);
|
||||
void unset_chcap_usage_counts(client *serv_p);
|
||||
void send_cap_mode_changes(client *, client *source, chan *, mode::change foo[], int);
|
||||
void set_chcap_usage_counts(client::client *serv_p);
|
||||
void unset_chcap_usage_counts(client::client *serv_p);
|
||||
void send_cap_mode_changes(client::client *, client::client *source, chan *, mode::change foo[], int);
|
||||
void resv_chan_forcepart(const char *name, const char *reason, int temp_time);
|
||||
void set_channel_mode(client *, client *source, chan *, membership *, int parc, const char *parv[]);
|
||||
void set_channel_mlock(client *, client *source, chan *, const char *newmlock, bool propagate);
|
||||
int match_extban(const char *banstr, client *, chan *, long mode_type);
|
||||
int valid_extban(const char *banstr, client *, chan *, long mode_type);
|
||||
void set_channel_mode(client::client *, client::client *source, chan *, membership *, int parc, const char *parv[]);
|
||||
void set_channel_mlock(client::client *, client::client *source, chan *, const char *newmlock, bool propagate);
|
||||
int match_extban(const char *banstr, client::client *, chan *, long mode_type);
|
||||
int valid_extban(const char *banstr, client::client *, chan *, long mode_type);
|
||||
const char * get_extban_string(void);
|
||||
int get_channel_access(client *source, chan *, membership *, int dir, const char *modestr);
|
||||
void send_join(chan &, client &);
|
||||
int get_channel_access(client::client *source, chan *, membership *, int dir, const char *modestr);
|
||||
void send_join(chan &, client::client &);
|
||||
|
||||
auto empty(const chan &);
|
||||
auto local_size(const chan &);
|
||||
auto size(const chan &);
|
||||
void add(chan &, client &, const int &flags = PEON);
|
||||
void del(chan &, client &);
|
||||
void del(client &); // remove from all channels
|
||||
void add(chan &, client::client &, const int &flags = PEON);
|
||||
void del(chan &, client::client &);
|
||||
void del(client::client &); // remove from all channels
|
||||
|
||||
// Channels
|
||||
extern std::map<const std::string *, std::unique_ptr<chan>, rfc1459::less> chans;
|
||||
|
@ -253,7 +253,7 @@ extern std::map<const std::string *, std::unique_ptr<chan>, rfc1459::less> chans
|
|||
bool exists(const std::string &name);
|
||||
chan *get(const std::string &name, std::nothrow_t);
|
||||
chan &get(const std::string &name);
|
||||
chan &add(const std::string &name, client &); // get or add (but does not join the client)
|
||||
chan &add(const std::string &name, client::client &); // get or add (but does not join the client)
|
||||
bool del(const std::string &name);
|
||||
bool del(const chan &);
|
||||
|
||||
|
@ -316,25 +316,25 @@ is_public(const chan *const &c)
|
|||
}
|
||||
|
||||
inline bool
|
||||
is_member(const chan &c, const client &client)
|
||||
is_member(const chan &c, const client::client &client)
|
||||
{
|
||||
return exists(c.members, client);
|
||||
}
|
||||
|
||||
inline bool
|
||||
is_member(const chan *const &c, const client *const &client)
|
||||
is_member(const chan *const &c, const client::client *const &client)
|
||||
{
|
||||
return c && client && is_member(*c, *client);
|
||||
}
|
||||
|
||||
inline bool
|
||||
can_show(const chan &c, const client &client)
|
||||
can_show(const chan &c, const client::client &client)
|
||||
{
|
||||
return is_public(c) || is_member(c, client);
|
||||
}
|
||||
|
||||
inline bool
|
||||
can_show(const chan *const &c, const client *const &client)
|
||||
can_show(const chan *const &c, const client::client *const &client)
|
||||
{
|
||||
return is_public(c) || is_member(c, client);
|
||||
}
|
||||
|
@ -394,18 +394,18 @@ empty(const members &m)
|
|||
}
|
||||
|
||||
inline bool
|
||||
exists(const members &m, const client &c)
|
||||
exists(const members &m, const client::client &c)
|
||||
{
|
||||
return m.global.count(const_cast<client *>(&c));
|
||||
return m.global.count(const_cast<client::client *>(&c));
|
||||
}
|
||||
|
||||
inline client &
|
||||
inline client::client &
|
||||
get_client(membership &m)
|
||||
{
|
||||
return *m.git->first;
|
||||
}
|
||||
|
||||
inline const client &
|
||||
inline const client::client &
|
||||
get_client(const membership &m)
|
||||
{
|
||||
return *m.git->first;
|
||||
|
|
|
@ -41,7 +41,6 @@ enum : int
|
|||
namespace chan {
|
||||
|
||||
struct chan;
|
||||
using client = Client; //TODO: XXX: temp
|
||||
|
||||
namespace mode {
|
||||
|
||||
|
@ -98,7 +97,7 @@ struct change
|
|||
int mems = 0;
|
||||
};
|
||||
|
||||
using func = void (*)(client *, struct chan *, int alevel, int parc, int *parn, const char **parv, int *errors, int dir, char c, type type);
|
||||
using func = void (*)(client::client *, struct chan *, int alevel, int parc, int *parn, const char **parv, int *errors, int dir, char c, type type);
|
||||
|
||||
struct mode
|
||||
{
|
||||
|
@ -121,12 +120,12 @@ namespace ext
|
|||
MATCH = 1, // matches
|
||||
};
|
||||
|
||||
using func = int (*)(const char *data, client *, chan *, type type);
|
||||
using func = int (*)(const char *data, client::client *, chan *, type type);
|
||||
extern func table[256];
|
||||
}
|
||||
|
||||
#define CHM_FUNCTION(_NAME_) \
|
||||
void _NAME_(client *source_p, chan *chptr, \
|
||||
void _NAME_(client::client *source_p, chan *chptr, \
|
||||
int alevel, int parc, int *parn, const char **parv, \
|
||||
int *errors, int dir, char c, type type);
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
namespace ircd {
|
||||
|
||||
struct ConfItem;
|
||||
struct Client;
|
||||
struct _patricia_tree_t;
|
||||
|
||||
struct Class
|
||||
|
@ -87,16 +86,16 @@ void add_class(struct Class *);
|
|||
|
||||
struct Class *make_class(void);
|
||||
|
||||
extern long get_sendq(struct Client *);
|
||||
extern long get_sendq(client::client *);
|
||||
extern int get_con_freq(struct Class *);
|
||||
extern struct Class *find_class(const char *);
|
||||
extern const char *get_client_class(struct Client *);
|
||||
extern int get_client_ping(struct Client *);
|
||||
extern const char *get_client_class(client::client *);
|
||||
extern int get_client_ping(client::client *);
|
||||
extern void check_class(void);
|
||||
extern void initclass(void);
|
||||
extern void free_class(struct Class *);
|
||||
extern void fix_class(struct ConfItem *, struct ConfItem *);
|
||||
extern void report_classes(struct Client *);
|
||||
extern void report_classes(client::client *);
|
||||
|
||||
} // namespace ircd
|
||||
#endif // __cplusplus
|
||||
|
|
|
@ -25,12 +25,84 @@
|
|||
|
||||
#pragma once
|
||||
#define HAVE_IRCD_CLIENT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace ircd {
|
||||
|
||||
/* other structs */
|
||||
struct Blacklist;
|
||||
namespace ircd
|
||||
{
|
||||
namespace client
|
||||
{
|
||||
struct client;
|
||||
struct LocalUser;
|
||||
struct PreClient;
|
||||
struct ListClient;
|
||||
}
|
||||
|
||||
namespace chan
|
||||
{
|
||||
struct chan;
|
||||
struct membership;
|
||||
}
|
||||
|
||||
struct ConfItem;
|
||||
struct Whowas;
|
||||
struct DNSReply;
|
||||
struct Listener;
|
||||
struct Blacklist;
|
||||
struct PrivilegeSet;
|
||||
struct _ssl_ctl;
|
||||
struct ev_ctl;
|
||||
struct ws_ctl;
|
||||
struct scache_entry;
|
||||
struct server_conf;
|
||||
}
|
||||
|
||||
|
||||
namespace ircd {
|
||||
namespace client {
|
||||
namespace user
|
||||
{
|
||||
using invites_t = std::set<chan::chan *>;
|
||||
using chans_t = std::map<chan::chan *, chan::membership *>;
|
||||
|
||||
struct user;
|
||||
|
||||
std::string &away(user &);
|
||||
std::string &suser(user &);
|
||||
invites_t &invites(user &);
|
||||
chans_t &chans(user &);
|
||||
}
|
||||
} // namespace client
|
||||
} // namespace ircd
|
||||
|
||||
|
||||
namespace ircd {
|
||||
namespace client {
|
||||
namespace serv
|
||||
{
|
||||
using list = std::list<struct client *>;
|
||||
using user::user;
|
||||
|
||||
struct serv;
|
||||
|
||||
list &users(serv &);
|
||||
list &servers(serv &);
|
||||
|
||||
// who activated this connection
|
||||
std::shared_ptr<struct user> &user(serv &);
|
||||
std::string &by(serv &);
|
||||
|
||||
// capabilities bit-field
|
||||
int &caps(serv &);
|
||||
std::string &fullcaps(serv &);
|
||||
|
||||
struct scache_entry *&nameinfo(serv &);
|
||||
}
|
||||
} // namespace client
|
||||
} // namespace ircd
|
||||
|
||||
|
||||
namespace ircd {
|
||||
namespace client {
|
||||
|
||||
/* we store ipv6 ips for remote clients, so this needs to be v6 always */
|
||||
#define HOSTIPLEN 53 /* sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255.ipv6") */
|
||||
|
@ -45,44 +117,6 @@ struct Blacklist;
|
|||
#define TGCHANGE_INITIAL 10 /* initial free targets (normal) */
|
||||
#define TGCHANGE_INITIAL_LOW 4 /* initial free targets (possible spambot) */
|
||||
|
||||
/*
|
||||
* pre declare structs
|
||||
*/
|
||||
struct ConfItem;
|
||||
struct Whowas;
|
||||
struct DNSReply;
|
||||
struct Listener;
|
||||
struct Client;
|
||||
struct Server;
|
||||
struct LocalUser;
|
||||
struct PreClient;
|
||||
struct ListClient;
|
||||
struct scache_entry;
|
||||
struct ws_ctl;
|
||||
|
||||
typedef int SSL_OPEN_CB(struct Client *, int status);
|
||||
|
||||
struct user
|
||||
{
|
||||
std::map<chan::chan *, chan::membership *> channel;
|
||||
std::set<chan::chan *> invited;
|
||||
std::string away;
|
||||
std::string suser;
|
||||
|
||||
user(const std::string &suser = {}): suser(suser) {}
|
||||
};
|
||||
|
||||
struct Server
|
||||
{
|
||||
std::unique_ptr<struct user> user; // who activated this connection
|
||||
char by[NICKLEN];
|
||||
rb_dlink_list servers;
|
||||
rb_dlink_list users;
|
||||
int caps; /* capabilities bit-field */
|
||||
char *fullcaps;
|
||||
struct scache_entry *nameinfo;
|
||||
};
|
||||
|
||||
struct ZipStats
|
||||
{
|
||||
unsigned long long in;
|
||||
|
@ -93,14 +127,14 @@ struct ZipStats
|
|||
double out_ratio;
|
||||
};
|
||||
|
||||
struct Client
|
||||
struct client
|
||||
{
|
||||
rb_dlink_node node;
|
||||
rb_dlink_node lnode;
|
||||
std::unique_ptr<struct user> user; // ...defined, if this is a user
|
||||
struct Server *serv; /* ...defined, if this is a server */
|
||||
struct Client *servptr; /* Points to server this Client is on */
|
||||
struct Client *from; /* == self, if Local Client, *NEVER* NULL! */
|
||||
serv::list::iterator lnode;
|
||||
std::shared_ptr<user::user> user; // ...defined, if this is a user
|
||||
std::shared_ptr<serv::serv> serv; // ...defined, if this is a server
|
||||
struct client *servptr; /* Points to server this Client is on */
|
||||
struct client *from; /* == self, if Local Client, *NEVER* NULL! */
|
||||
|
||||
rb_dlink_list whowas_clist;
|
||||
|
||||
|
@ -152,8 +186,13 @@ struct Client
|
|||
|
||||
time_t large_ctcp_sent; /* ctcp to large group sent, relax flood checks */
|
||||
char *certfp; /* client certificate fingerprint */
|
||||
|
||||
client();
|
||||
~client() noexcept;
|
||||
};
|
||||
|
||||
typedef int SSL_OPEN_CB(client *, int status);
|
||||
|
||||
struct LocalUser
|
||||
{
|
||||
rb_dlink_node tnode; /* This is the node for the local list type the client is on */
|
||||
|
@ -283,6 +322,7 @@ struct LocalUser
|
|||
time_t sasl_next_retry;
|
||||
};
|
||||
|
||||
|
||||
#define AUTHC_F_DEFERRED 0x01
|
||||
#define AUTHC_F_COMPLETE 0x02
|
||||
|
||||
|
@ -337,7 +377,7 @@ struct ListClient
|
|||
#define IsServer(x) ((x)->status == STAT_SERVER)
|
||||
|
||||
inline bool
|
||||
is_client(const Client &client)
|
||||
is_client(const client &client)
|
||||
{
|
||||
return client.status == STAT_CLIENT;
|
||||
}
|
||||
|
@ -468,13 +508,13 @@ is_client(const Client &client)
|
|||
#define MyClient(x) (MyConnect(x) && IsClient(x))
|
||||
|
||||
inline bool
|
||||
my(const Client &client)
|
||||
my(const client &client)
|
||||
{
|
||||
return MyClient(&client);
|
||||
}
|
||||
|
||||
inline bool
|
||||
is_person(const Client &client)
|
||||
is_person(const client &client)
|
||||
{
|
||||
return IsPerson(&client);
|
||||
}
|
||||
|
@ -587,44 +627,58 @@ extern void check_dlines(void);
|
|||
extern void check_xlines(void);
|
||||
extern void resv_nick_fnc(const char *mask, const char *reason, int temp_time);
|
||||
|
||||
extern const char *get_client_name(struct Client *client, int show_ip);
|
||||
extern const char *log_client_name(struct Client *, int);
|
||||
extern int is_remote_connect(struct Client *);
|
||||
extern void init_client(void);
|
||||
extern struct Client *make_client(struct Client *from);
|
||||
extern void free_pre_client(struct Client *client);
|
||||
extern void free_client(struct Client *client);
|
||||
extern const char *get_client_name(client *client, int show_ip);
|
||||
extern const char *log_client_name(client *, int);
|
||||
extern int is_remote_connect(client *);
|
||||
void init(void);
|
||||
extern client *make_client(client *from);
|
||||
extern void free_pre_client(client *client);
|
||||
extern void free_client(client *client);
|
||||
|
||||
extern int exit_client(struct Client *, struct Client *, struct Client *, const char *);
|
||||
extern int exit_client(client *, client *, client *, const char *);
|
||||
|
||||
extern void error_exit_client(struct Client *, int);
|
||||
extern void error_exit_client(client *, int);
|
||||
|
||||
extern void count_local_client_memory(size_t * count, size_t * memory);
|
||||
extern void count_remote_client_memory(size_t * count, size_t * memory);
|
||||
|
||||
extern int clean_nick(const char *, int loc_client);
|
||||
|
||||
extern struct Client *find_chasing(struct Client *, const char *, int *);
|
||||
extern struct Client *find_person(const char *);
|
||||
extern struct Client *find_named_person(const char *);
|
||||
extern struct Client *next_client(struct Client *, const char *);
|
||||
extern client *find_chasing(client *, const char *, int *);
|
||||
extern client *find_person(const char *);
|
||||
|
||||
extern client *find_named_person(const char *);
|
||||
client *find_named_person(const std::string &);
|
||||
|
||||
extern client *next_client(client *, const char *);
|
||||
|
||||
#define accept_message(s, t) ((s) == (t) || (rb_dlinkFind((s), &((t)->localClient->allow_list))))
|
||||
extern void del_all_accepts(struct Client *client_p);
|
||||
extern void del_all_accepts(client *client_p);
|
||||
|
||||
extern void dead_link(struct Client *client_p, int sendqex);
|
||||
extern int show_ip(struct Client *source_p, struct Client *target_p);
|
||||
extern int show_ip_conf(struct ConfItem *aconf, struct Client *source_p);
|
||||
extern int show_ip_whowas(struct Whowas *whowas, struct Client *source_p);
|
||||
extern void dead_link(client *client_p, int sendqex);
|
||||
extern int show_ip(client *source_p, client *target_p);
|
||||
extern int show_ip_conf(struct ConfItem *aconf, client *source_p);
|
||||
extern int show_ip_whowas(struct Whowas *whowas, client *source_p);
|
||||
|
||||
extern struct Server *make_server(struct Client *);
|
||||
extern void close_connection(struct Client *);
|
||||
extern void close_connection(client *);
|
||||
extern void init_uid(void);
|
||||
extern char *generate_uid(void);
|
||||
|
||||
uint32_t connid_get(struct Client *client_p);
|
||||
uint32_t connid_get(client *client_p);
|
||||
void connid_put(uint32_t id);
|
||||
void client_release_connids(struct Client *client_p);
|
||||
void client_release_connids(client *client_p);
|
||||
|
||||
user::user &make_user(client &, const std::string &login = {});
|
||||
serv::serv &make_serv(client &);
|
||||
|
||||
} // namespace client
|
||||
|
||||
using client::ZipStats;
|
||||
using client::LocalUser;
|
||||
using client::ListClient;
|
||||
|
||||
client::user::user &user(client::client &client);
|
||||
client::serv::serv &serv(client::client &client);
|
||||
|
||||
} // namespace ircd
|
||||
#endif // __cplusplus
|
||||
|
|
|
@ -58,7 +58,6 @@ extern rb_radixtree *resv_tree;
|
|||
#define HASH_WALK_SAFE(i, max, ptr, nptr, table) for (i = 0; i < max; i++) { RB_DLINK_FOREACH_SAFE(ptr, nptr, table[i].head)
|
||||
#define HASH_WALK_END }
|
||||
|
||||
struct Client;
|
||||
struct ConfItem;
|
||||
struct nd_entry;
|
||||
|
||||
|
@ -69,18 +68,18 @@ extern uint32_t fnv_hash_upper_len(const unsigned char *s, int bits, int len);
|
|||
|
||||
extern void init_hash(void);
|
||||
|
||||
extern void add_to_client_hash(const char *name, struct Client *client);
|
||||
extern void del_from_client_hash(const char *name, struct Client *client);
|
||||
extern struct Client *find_client(const char *name);
|
||||
extern struct Client *find_named_client(const char *name);
|
||||
extern struct Client *find_server(struct Client *source_p, const char *name);
|
||||
extern void add_to_client_hash(const char *name, client::client *client);
|
||||
extern void del_from_client_hash(const char *name, client::client *client);
|
||||
extern client::client *find_client(const char *name);
|
||||
extern client::client *find_named_client(const char *name);
|
||||
extern client::client *find_server(client::client *source_p, const char *name);
|
||||
|
||||
extern void add_to_id_hash(const char *, struct Client *);
|
||||
extern void del_from_id_hash(const char *name, struct Client *client);
|
||||
extern struct Client *find_id(const char *name);
|
||||
extern void add_to_id_hash(const char *, client::client *);
|
||||
extern void del_from_id_hash(const char *name, client::client *client);
|
||||
extern client::client *find_id(const char *name);
|
||||
|
||||
extern void add_to_hostname_hash(const char *, struct Client *);
|
||||
extern void del_from_hostname_hash(const char *, struct Client *);
|
||||
extern void add_to_hostname_hash(const char *, client::client *);
|
||||
extern void del_from_hostname_hash(const char *, client::client *);
|
||||
extern rb_dlink_node *find_hostname(const char *);
|
||||
|
||||
extern void add_to_resv_hash(const char *name, struct ConfItem *aconf);
|
||||
|
@ -88,9 +87,9 @@ extern void del_from_resv_hash(const char *name, struct ConfItem *aconf);
|
|||
extern struct ConfItem *hash_find_resv(const char *name);
|
||||
extern void clear_resv_hash(void);
|
||||
|
||||
void add_to_cli_connid_hash(struct Client *client_p, uint32_t id);
|
||||
void add_to_cli_connid_hash(client::client *client_p, uint32_t id);
|
||||
void del_from_cli_connid_hash(uint32_t id);
|
||||
struct Client *find_cli_connid_hash(uint32_t connid);
|
||||
client::client *find_cli_connid_hash(uint32_t connid);
|
||||
|
||||
} // namespace ircd
|
||||
#endif // __cplusplus
|
||||
|
|
|
@ -47,21 +47,21 @@ void call_hook(int id, void *arg);
|
|||
|
||||
typedef struct
|
||||
{
|
||||
struct Client *client;
|
||||
client::client *client;
|
||||
void *arg1;
|
||||
void *arg2;
|
||||
} hook_data;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
struct Client *client;
|
||||
client::client *client;
|
||||
const void *arg1;
|
||||
const void *arg2;
|
||||
} hook_cdata;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
struct Client *client;
|
||||
client::client *client;
|
||||
const void *arg1;
|
||||
int arg2;
|
||||
int result;
|
||||
|
@ -69,32 +69,32 @@ typedef struct
|
|||
|
||||
typedef struct
|
||||
{
|
||||
struct Client *client;
|
||||
struct Client *target;
|
||||
client::client *client;
|
||||
client::client *target;
|
||||
chan::chan *chptr;
|
||||
int approved;
|
||||
} hook_data_client;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
struct Client *client;
|
||||
client::client *client;
|
||||
chan::chan *chptr;
|
||||
int approved;
|
||||
} hook_data_channel;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
struct Client *client;
|
||||
client::client *client;
|
||||
chan::chan *chptr;
|
||||
char *key;
|
||||
} hook_data_channel_activity;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
struct Client *client;
|
||||
client::client *client;
|
||||
chan::chan *chptr;
|
||||
chan::membership *msptr;
|
||||
struct Client *target;
|
||||
client::client *target;
|
||||
int approved;
|
||||
int dir;
|
||||
const char *modestr;
|
||||
|
@ -102,22 +102,22 @@ typedef struct
|
|||
|
||||
typedef struct
|
||||
{
|
||||
struct Client *client;
|
||||
struct Client *target;
|
||||
client::client *client;
|
||||
client::client *target;
|
||||
int approved;
|
||||
} hook_data_client_approval;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
struct Client *local_link; /* local client originating this, or NULL */
|
||||
struct Client *target; /* dying client */
|
||||
struct Client *from; /* causing client (could be &me or target) */
|
||||
client::client *local_link; /* local client originating this, or NULL */
|
||||
client::client *target; /* dying client */
|
||||
client::client *from; /* causing client (could be &me or target) */
|
||||
const char *comment;
|
||||
} hook_data_client_exit;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
struct Client *client;
|
||||
client::client *client;
|
||||
unsigned int oldumodes;
|
||||
unsigned int oldsnomask;
|
||||
} hook_data_umode_changed;
|
||||
|
@ -132,7 +132,7 @@ enum message_type {
|
|||
typedef struct
|
||||
{
|
||||
enum message_type msgtype;
|
||||
struct Client *source_p;
|
||||
client::client *source_p;
|
||||
chan::chan *chptr;
|
||||
const char *text;
|
||||
int approved;
|
||||
|
@ -142,8 +142,8 @@ typedef struct
|
|||
typedef struct
|
||||
{
|
||||
enum message_type msgtype;
|
||||
struct Client *source_p;
|
||||
struct Client *target_p;
|
||||
client::client *source_p;
|
||||
client::client *target_p;
|
||||
const char *text;
|
||||
int approved;
|
||||
} hook_data_privmsg_user;
|
||||
|
|
|
@ -60,7 +60,7 @@ struct ConfItem *find_dline(struct sockaddr *, int);
|
|||
(struct sockaddr *)&(x)->localClient->ip, CONF_KILL,\
|
||||
GET_SS_FAMILY(&(x)->localClient->ip), (x)->username, NULL))
|
||||
|
||||
void report_auth(struct Client *);
|
||||
void report_auth(client::client *);
|
||||
#ifdef RB_IPV6
|
||||
int match_ipv6(struct sockaddr *, struct sockaddr *, int);
|
||||
#endif
|
||||
|
|
|
@ -34,8 +34,6 @@
|
|||
#ifdef __cplusplus
|
||||
namespace ircd {
|
||||
|
||||
struct Client;
|
||||
|
||||
struct SetOptions
|
||||
{
|
||||
int maxclients; /* max clients allowed */
|
||||
|
@ -73,9 +71,9 @@ extern bool server_state_foreground;
|
|||
extern bool opers_see_all_users; /* sno_farconnect.so loaded, operspy without
|
||||
accountability, etc */
|
||||
|
||||
extern struct Client me;
|
||||
extern client::client me;
|
||||
extern rb_dlink_list global_client_list;
|
||||
extern struct Client *local[];
|
||||
extern client::client *local[];
|
||||
extern struct Counter Count;
|
||||
extern int default_server_capabs;
|
||||
|
||||
|
|
|
@ -28,8 +28,6 @@
|
|||
#ifdef __cplusplus
|
||||
namespace ircd {
|
||||
|
||||
struct Client;
|
||||
|
||||
struct Listener
|
||||
{
|
||||
struct Listener *next; /* list node pointer */
|
||||
|
@ -48,7 +46,7 @@ extern void add_listener(int port, const char *vaddr_ip, int family, int ssl, in
|
|||
extern void close_listener(struct Listener *listener);
|
||||
extern void close_listeners(void);
|
||||
extern const char *get_listener_name(const struct Listener *listener);
|
||||
extern void show_ports(struct Client *client);
|
||||
extern void show_ports(client::client *client);
|
||||
extern void free_listener(struct Listener *);
|
||||
|
||||
} // namespace ircd
|
||||
|
|
|
@ -50,8 +50,6 @@ typedef enum ilogfile
|
|||
LAST_LOGFILE
|
||||
} ilogfile;
|
||||
|
||||
struct Client;
|
||||
|
||||
extern void init_main_logfile(void);
|
||||
extern void open_logfiles(void);
|
||||
extern void close_logfiles(void);
|
||||
|
@ -60,7 +58,7 @@ extern void idebug(const char *fmt, ...) AFP(1, 2);
|
|||
extern void inotice(const char *fmt, ...) AFP(1, 2);
|
||||
extern void iwarn(const char *fmt, ...) AFP(1, 2);
|
||||
extern void ierror(const char *fmt, ...) AFP(1, 2);
|
||||
extern void report_operspy(struct Client *, const char *, const char *);
|
||||
extern void report_operspy(client::client *, const char *, const char *);
|
||||
extern const char *smalldate(time_t);
|
||||
extern void ilog_error(const char *);
|
||||
|
||||
|
|
|
@ -29,10 +29,10 @@ void free_monitor(struct monitor *);
|
|||
|
||||
void init_monitor(void);
|
||||
struct monitor *find_monitor(const char *name, int add);
|
||||
void clear_monitor(struct Client *);
|
||||
void clear_monitor(client::client *);
|
||||
|
||||
void monitor_signon(struct Client *);
|
||||
void monitor_signoff(struct Client *);
|
||||
void monitor_signon(client::client *);
|
||||
void monitor_signoff(client::client *);
|
||||
|
||||
} // namespace ircd
|
||||
#endif // __cplusplus
|
||||
|
|
|
@ -28,8 +28,6 @@
|
|||
#ifdef __cplusplus
|
||||
namespace ircd {
|
||||
|
||||
struct Client;
|
||||
|
||||
/* MessageHandler */
|
||||
typedef enum HandlerType
|
||||
{
|
||||
|
@ -44,12 +42,12 @@ typedef enum HandlerType
|
|||
HandlerType;
|
||||
|
||||
/* struct MsgBuf* msgbuf_p - message buffer (including tags)
|
||||
* struct Client* client_p - connection message originated from
|
||||
* struct Client* source_p - source of message, may be different from client_p
|
||||
* client::client* client_p - connection message originated from
|
||||
* client::client* source_p - source of message, may be different from client_p
|
||||
* int parc - parameter count (from msgbuf_p)
|
||||
* char* parv[] - parameter vector (from msgbuf_p)
|
||||
*/
|
||||
typedef void (*MessageHandler) (struct MsgBuf *, struct Client *, struct Client *, int, const char *[]);
|
||||
typedef void (*MessageHandler) (struct MsgBuf *, client::client *, client::client *, int, const char *[]);
|
||||
|
||||
struct MessageEntry
|
||||
{
|
||||
|
@ -73,10 +71,10 @@ struct Message
|
|||
};
|
||||
|
||||
/* generic handlers */
|
||||
extern void m_ignore(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
extern void m_not_oper(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
extern void m_registered(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
extern void m_unregistered(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
extern void m_ignore(struct MsgBuf *, client::client *, client::client *, int, const char **);
|
||||
extern void m_not_oper(struct MsgBuf *, client::client *, client::client *, int, const char **);
|
||||
extern void m_registered(struct MsgBuf *, client::client *, client::client *, int, const char **);
|
||||
extern void m_unregistered(struct MsgBuf *, client::client *, client::client *, int, const char **);
|
||||
|
||||
#define mg_ignore { m_ignore, 0 }
|
||||
#define mg_not_oper { m_not_oper, 0 }
|
||||
|
@ -85,7 +83,7 @@ extern void m_unregistered(struct MsgBuf *, struct Client *, struct Client *, in
|
|||
|
||||
/*
|
||||
* m_functions execute protocol messages on this server:
|
||||
* void m_func(struct MsgBuf *, struct Client* client_p, struct Client* source_p, int parc, char* parv[]);
|
||||
* void m_func(struct MsgBuf *, client::client* client_p, client::client* source_p, int parc, char* parv[]);
|
||||
*
|
||||
* client_p is always NON-NULL, pointing to a *LOCAL* client
|
||||
* structure (with an open socket connected!). This
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace ircd {
|
|||
|
||||
extern PF read_packet;
|
||||
extern EVH flood_recalc;
|
||||
extern void flood_endgrace(struct Client *);
|
||||
extern void flood_endgrace(client::client *);
|
||||
|
||||
} // namespace ircd
|
||||
#endif // __cplusplus
|
||||
|
|
|
@ -29,12 +29,11 @@
|
|||
namespace ircd {
|
||||
|
||||
struct Message;
|
||||
struct Client;
|
||||
struct MsgBuf;
|
||||
struct alias_entry;
|
||||
|
||||
extern void parse(struct Client *, char *, char *);
|
||||
extern void handle_encap(struct MsgBuf *, struct Client *, struct Client *,
|
||||
extern void parse(client::client *, char *, char *);
|
||||
extern void handle_encap(struct MsgBuf *, client::client *, client::client *,
|
||||
const char *, int, const char *parv[]);
|
||||
extern void mod_add_cmd(struct Message *msg);
|
||||
extern void mod_del_cmd(struct Message *msg);
|
||||
|
|
|
@ -49,7 +49,7 @@ struct PrivilegeSet *privilegeset_ref(struct PrivilegeSet *set);
|
|||
void privilegeset_unref(struct PrivilegeSet *set);
|
||||
void privilegeset_mark_all_illegal(void);
|
||||
void privilegeset_delete_all_illegal(void);
|
||||
void privilegeset_report(struct Client *source_p);
|
||||
void privilegeset_report(client::client *source_p);
|
||||
|
||||
} // namespace ircd
|
||||
#endif // __cplusplus
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
#ifdef __cplusplus
|
||||
namespace ircd {
|
||||
|
||||
int ratelimit_client(struct Client *client_p, unsigned int penalty);
|
||||
int ratelimit_client_who(struct Client *client_p, unsigned int penalty);
|
||||
void credit_client_join(struct Client *client_p);
|
||||
int ratelimit_client(client::client *client_p, unsigned int penalty);
|
||||
int ratelimit_client_who(client::client *client_p, unsigned int penalty);
|
||||
void credit_client_join(client::client *client_p);
|
||||
|
||||
} // namespace ircd
|
||||
#endif // __cplusplus
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace ircd {
|
|||
|
||||
void init_reject(void);
|
||||
int check_reject(rb_fde_t *F, struct sockaddr *addr);
|
||||
void add_reject(struct Client *, const char *mask1, const char *mask2);
|
||||
void add_reject(client::client *, const char *mask1, const char *mask2);
|
||||
int is_reject_ip(struct sockaddr *addr);
|
||||
void flush_reject(void);
|
||||
int remove_reject_ip(const char *ip);
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#ifdef __cplusplus
|
||||
namespace ircd {
|
||||
|
||||
struct Client;
|
||||
struct DNSReply;
|
||||
struct hostent;
|
||||
|
||||
|
@ -343,17 +342,17 @@ extern void replace_old_ban(struct ConfItem *);
|
|||
|
||||
extern void read_conf_files(bool cold);
|
||||
|
||||
extern int attach_conf(struct Client *, struct ConfItem *);
|
||||
extern int check_client(struct Client *client_p, struct Client *source_p, const char *);
|
||||
extern int attach_conf(client::client *, struct ConfItem *);
|
||||
extern int check_client(client::client *client_p, client::client *source_p, const char *);
|
||||
|
||||
extern int detach_conf(struct Client *);
|
||||
extern int detach_conf(client::client *);
|
||||
|
||||
extern struct ConfItem *find_tkline(const char *, const char *, struct sockaddr *);
|
||||
extern char *show_iline_prefix(struct Client *, struct ConfItem *, char *);
|
||||
extern char *show_iline_prefix(client::client *, struct ConfItem *, char *);
|
||||
extern void get_printable_conf(struct ConfItem *,
|
||||
char **, char **, const char **, char **, int *, char **);
|
||||
extern char *get_user_ban_reason(struct ConfItem *aconf);
|
||||
extern void get_printable_kline(struct Client *, struct ConfItem *,
|
||||
extern void get_printable_kline(client::client *, struct ConfItem *,
|
||||
char **, char **, char **, char **);
|
||||
|
||||
int conf_yy_fatal_error(const char *);
|
||||
|
@ -362,8 +361,8 @@ int conf_fgets(char *, int, FILE *);
|
|||
extern int valid_wild_card(const char *, const char *);
|
||||
extern void add_temp_kline(struct ConfItem *);
|
||||
extern void add_temp_dline(struct ConfItem *);
|
||||
extern void report_temp_klines(struct Client *);
|
||||
extern void show_temp_klines(struct Client *, rb_dlink_list *);
|
||||
extern void report_temp_klines(client::client *);
|
||||
extern void show_temp_klines(client::client *, rb_dlink_list *);
|
||||
|
||||
extern bool rehash(bool);
|
||||
extern void rehash_bans(void);
|
||||
|
@ -375,7 +374,7 @@ extern void conf_add_class(struct ConfItem *, int);
|
|||
extern void conf_add_d_conf(struct ConfItem *);
|
||||
extern void flush_expired_ips(void *);
|
||||
|
||||
extern char *get_oper_name(struct Client *client_p);
|
||||
extern char *get_oper_name(client::client *client_p);
|
||||
|
||||
extern unsigned long cidr_to_bitmask[];
|
||||
|
||||
|
|
|
@ -133,9 +133,9 @@ extern void free_remote_conf(struct remote_conf *);
|
|||
|
||||
extern bool find_shared_conf(const char *username, const char *host,
|
||||
const char *server, int flags);
|
||||
extern void propagate_generic(struct Client *source_p, const char *command,
|
||||
extern void propagate_generic(client::client *source_p, const char *command,
|
||||
const char *target, int cap, const char *format, ...);
|
||||
extern void cluster_generic(struct Client *, const char *, int cltype,
|
||||
extern void cluster_generic(client::client *, const char *, int cltype,
|
||||
int cap, const char *format, ...);
|
||||
|
||||
#define OPER_ENCRYPTED 0x00001
|
||||
|
@ -228,9 +228,9 @@ extern void add_server_conf(struct server_conf *);
|
|||
|
||||
extern struct server_conf *find_server_conf(const char *name);
|
||||
|
||||
extern void attach_server_conf(struct Client *, struct server_conf *);
|
||||
extern void detach_server_conf(struct Client *);
|
||||
extern void set_server_conf_autoconn(struct Client *source_p, const char *name,
|
||||
extern void attach_server_conf(client::client *, struct server_conf *);
|
||||
extern void detach_server_conf(client::client *);
|
||||
extern void set_server_conf_autoconn(client::client *source_p, const char *name,
|
||||
int newval);
|
||||
extern void disable_server_conf_autoconn(const char *name);
|
||||
|
||||
|
|
|
@ -52,8 +52,8 @@ extern ircd::capability::index cli_capindex; //TODO: namespace
|
|||
#define CLICAP_FLAGS_REQACK 0x002
|
||||
|
||||
struct ClientCapability {
|
||||
bool (*visible)(struct Client *); /* whether or not to display the capability. set to NULL or true return value = displayed */
|
||||
const char *(*data)(struct Client *); /* any custom data for the capability. set to NULL or return NULL = no data */
|
||||
bool (*visible)(client::client *); /* whether or not to display the capability. set to NULL or true return value = displayed */
|
||||
const char *(*data)(client::client *); /* any custom data for the capability. set to NULL or return NULL = no data */
|
||||
unsigned int flags;
|
||||
};
|
||||
|
||||
|
@ -130,17 +130,17 @@ extern int refresh_user_links;
|
|||
|
||||
extern void init_builtin_capabs(void);
|
||||
|
||||
extern int hunt_server(struct Client *client_pt,
|
||||
struct Client *source_pt,
|
||||
extern int hunt_server(client::client *client_pt,
|
||||
client::client *source_pt,
|
||||
const char *command, int server, int parc, const char **parv);
|
||||
extern void send_capabilities(struct Client *, unsigned int);
|
||||
extern const char *show_capabilities(struct Client *client);
|
||||
extern void send_capabilities(client::client *, unsigned int);
|
||||
extern const char *show_capabilities(client::client *client);
|
||||
extern void try_connections(void *unused);
|
||||
|
||||
extern int check_server(const char *name, struct Client *server);
|
||||
extern int server_estab(struct Client *client_p);
|
||||
extern int check_server(const char *name, client::client *server);
|
||||
extern int server_estab(client::client *client_p);
|
||||
|
||||
extern int serv_connect(struct server_conf *, struct Client *);
|
||||
extern int serv_connect(struct server_conf *, client::client *);
|
||||
|
||||
} // namespace ircd
|
||||
#endif // __cplusplus
|
||||
|
|
|
@ -36,8 +36,6 @@
|
|||
#ifdef __cplusplus
|
||||
namespace ircd {
|
||||
|
||||
struct Client;
|
||||
|
||||
/*
|
||||
* statistics structures
|
||||
*/
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#ifdef __cplusplus
|
||||
namespace ircd {
|
||||
|
||||
struct Client;
|
||||
struct User;
|
||||
struct oper_conf;
|
||||
extern time_t LastUsedWallops;
|
||||
|
@ -36,22 +35,22 @@ extern time_t LastUsedWallops;
|
|||
extern bool valid_hostname(const char *hostname);
|
||||
extern bool valid_username(const char *username);
|
||||
|
||||
extern int user_mode(struct Client *, struct Client *, int, const char **);
|
||||
extern void send_umode(struct Client *, struct Client *, int, char *);
|
||||
extern void send_umode_out(struct Client *, struct Client *, int);
|
||||
extern void show_lusers(struct Client *source_p);
|
||||
extern int register_local_user(struct Client *, struct Client *);
|
||||
extern int user_mode(client::client *, client::client *, int, const char **);
|
||||
extern void send_umode(client::client *, client::client *, int, char *);
|
||||
extern void send_umode_out(client::client *, client::client *, int);
|
||||
extern void show_lusers(client::client *source_p);
|
||||
extern int register_local_user(client::client *, client::client *);
|
||||
|
||||
void introduce_client(struct Client *client_p, struct Client *source_p, user &user, const char *nick, int use_euid);
|
||||
void introduce_client(client::client *client_p, client::client *source_p, 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(client::client *target_p, const char *nick, const char *user,
|
||||
const char *host, int newts, const char *format, ...);
|
||||
|
||||
extern int user_modes[256];
|
||||
extern unsigned int find_umode_slot(void);
|
||||
extern void construct_umodebuf(void);
|
||||
|
||||
extern void oper_up(struct Client *, struct oper_conf *);
|
||||
extern void oper_up(client::client *, struct oper_conf *);
|
||||
|
||||
} // namespace ircd
|
||||
#endif // __cplusplus
|
||||
|
|
|
@ -28,15 +28,14 @@
|
|||
#ifdef __cplusplus
|
||||
namespace ircd {
|
||||
|
||||
struct Client;
|
||||
struct scache_entry;
|
||||
|
||||
extern void clear_scache_hash_table(void);
|
||||
extern struct scache_entry *scache_connect(const char *name, const char *info, int hidden);
|
||||
extern void scache_split(struct scache_entry *ptr);
|
||||
extern const char *scache_get_name(struct scache_entry *ptr);
|
||||
extern void scache_send_flattened_links(struct Client *source_p);
|
||||
extern void scache_send_missing(struct Client *source_p);
|
||||
extern void scache_send_flattened_links(client::client *source_p);
|
||||
extern void scache_send_missing(client::client *source_p);
|
||||
extern void count_scache(size_t *, size_t *);
|
||||
|
||||
} // namespace ircd
|
||||
|
|
|
@ -28,65 +28,64 @@
|
|||
#ifdef __cplusplus
|
||||
namespace ircd {
|
||||
|
||||
struct Client;
|
||||
struct monitor;
|
||||
|
||||
/* The nasty global also used in s_serv.c for server bursts */
|
||||
extern unsigned long current_serial;
|
||||
|
||||
extern struct Client *remote_rehash_oper_p;
|
||||
extern client::client *remote_rehash_oper_p;
|
||||
|
||||
extern void send_pop_queue(struct Client *);
|
||||
extern void send_pop_queue(client::client *);
|
||||
|
||||
extern void send_queued(struct Client *to);
|
||||
extern void send_queued(client::client *to);
|
||||
|
||||
extern void sendto_one(struct Client *target_p, const char *, ...) AFP(2, 3);
|
||||
extern void sendto_one_notice(struct Client *target_p,const char *, ...) AFP(2, 3);
|
||||
extern void sendto_one_prefix(struct Client *target_p, struct Client *source_p,
|
||||
extern void sendto_one(client::client *target_p, const char *, ...) AFP(2, 3);
|
||||
extern void sendto_one_notice(client::client *target_p,const char *, ...) AFP(2, 3);
|
||||
extern void sendto_one_prefix(client::client *target_p, client::client *source_p,
|
||||
const char *command, const char *, ...) AFP(4, 5);
|
||||
extern void sendto_one_numeric(struct Client *target_p,
|
||||
extern void sendto_one_numeric(client::client *target_p,
|
||||
int numeric, const char *, ...) AFP(3, 4);
|
||||
|
||||
extern void sendto_server(struct Client *one, chan::chan *chptr,
|
||||
extern void sendto_server(client::client *one, chan::chan *chptr,
|
||||
unsigned long caps, unsigned long nocaps,
|
||||
const char *format, ...) AFP(5, 6);
|
||||
|
||||
extern void sendto_channel_flags(struct Client *one, int type, struct Client *source_p,
|
||||
extern void sendto_channel_flags(client::client *one, int type, client::client *source_p,
|
||||
chan::chan *chptr, const char *, ...) AFP(5, 6);
|
||||
extern void sendto_channel_opmod(struct Client *one, struct Client *source_p,
|
||||
extern void sendto_channel_opmod(client::client *one, client::client *source_p,
|
||||
chan::chan *chptr, const char *command,
|
||||
const char *text);
|
||||
|
||||
extern void sendto_channel_local(int type, chan::chan *, const char *, ...) AFP(3, 4);
|
||||
extern void sendto_channel_local_butone(struct Client *, int type, chan::chan *, const char *, ...) AFP(4, 5);
|
||||
extern void sendto_channel_local_butone(client::client *, int type, chan::chan *, const char *, ...) AFP(4, 5);
|
||||
|
||||
extern void sendto_channel_local_with_capability(int type, int caps, int negcaps, chan::chan *, const char *, ...) AFP(5, 6);
|
||||
extern void sendto_channel_local_with_capability_butone(struct Client *, int type, int caps, int negcaps, chan::chan *,
|
||||
extern void sendto_channel_local_with_capability_butone(client::client *, int type, int caps, int negcaps, chan::chan *,
|
||||
const char *, ...) AFP(6, 7);
|
||||
|
||||
extern void sendto_common_channels_local(struct Client *, int cap, int negcap, const char *, ...) AFP(4, 5);
|
||||
extern void sendto_common_channels_local_butone(struct Client *, int cap, int negcap, const char *, ...) AFP(4, 5);
|
||||
extern void sendto_common_channels_local(client::client *, int cap, int negcap, const char *, ...) AFP(4, 5);
|
||||
extern void sendto_common_channels_local_butone(client::client *, int cap, int negcap, const char *, ...) AFP(4, 5);
|
||||
|
||||
|
||||
extern void sendto_match_butone(struct Client *, struct Client *,
|
||||
extern void sendto_match_butone(client::client *, client::client *,
|
||||
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(client::client *source_p, const char *mask,
|
||||
int capab, int, const char *, ...) AFP(5, 6);
|
||||
|
||||
extern void sendto_monitor(struct monitor *monptr, const char *, ...) AFP(2, 3);
|
||||
|
||||
extern void sendto_anywhere(struct Client *, struct Client *, const char *,
|
||||
extern void sendto_anywhere(client::client *, client::client *, const char *,
|
||||
const char *, ...) AFP(4, 5);
|
||||
extern void sendto_local_clients_with_capability(int cap, const char *pattern, ...) AFP(2, 3);
|
||||
|
||||
extern void sendto_realops_snomask(int, int, const char *, ...) AFP(3, 4);
|
||||
extern void sendto_realops_snomask_from(int, int, struct Client *, const char *, ...) AFP(4, 5);
|
||||
extern void sendto_realops_snomask_from(int, int, client::client *, const char *, ...) AFP(4, 5);
|
||||
|
||||
extern void sendto_wallops_flags(int, struct Client *, const char *, ...) AFP(3, 4);
|
||||
extern void sendto_wallops_flags(int, client::client *, const char *, ...) AFP(3, 4);
|
||||
|
||||
extern void kill_client(struct Client *client_p, struct Client *diedie,
|
||||
extern void kill_client(client::client *client_p, client::client *diedie,
|
||||
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(client::client *one, client::client *source_p,
|
||||
const char *pattern, ...) AFP(3, 4);
|
||||
|
||||
#define L_ALL 0
|
||||
|
|
|
@ -43,10 +43,12 @@ namespace ircd
|
|||
#include "err.h"
|
||||
|
||||
#include "fs.h"
|
||||
#include "listener.h"
|
||||
#include "s_assert.h"
|
||||
|
||||
#include "match.h"
|
||||
|
||||
#include "client.h"
|
||||
|
||||
#include "chmode.h"
|
||||
#include "channel.h"
|
||||
|
||||
|
@ -56,7 +58,6 @@ namespace ircd
|
|||
#include "capability.h"
|
||||
#include "certfp.h"
|
||||
#include "class.h"
|
||||
#include "client.h"
|
||||
#include "dns.h"
|
||||
#include "hash.h"
|
||||
#include "hook.h"
|
||||
|
@ -64,6 +65,7 @@ namespace ircd
|
|||
#include "ircd_getopt.h"
|
||||
#include "ircd_linker.h"
|
||||
#include "ircd_signal.h"
|
||||
#include "listener.h"
|
||||
#include "logger.h"
|
||||
#include "info.h"
|
||||
#include "modules.h"
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace ircd {
|
|||
extern void add_isupport(const char *, const char *(*)(const void *), const void *);
|
||||
extern const void *change_isupport(const char *, const char *(*)(const void *), const void *);
|
||||
extern void delete_isupport(const char *);
|
||||
extern void show_isupport(struct Client *);
|
||||
extern void show_isupport(client::client *);
|
||||
extern void init_isupport(void);
|
||||
|
||||
extern const char *isupport_intptr(const void *);
|
||||
|
|
|
@ -28,13 +28,13 @@
|
|||
namespace ircd {
|
||||
|
||||
/* finds a channel where source_p has op or voice and target_p is a member */
|
||||
chan::chan *find_allowing_channel(struct Client *source_p, struct Client *target_p);
|
||||
chan::chan *find_allowing_channel(client::client *source_p, client::client *target_p);
|
||||
/* checks if source_p is allowed to send to target_p */
|
||||
int add_target(struct Client *source_p, struct Client *target_p);
|
||||
int add_target(client::client *source_p, client::client *target_p);
|
||||
/* checks if source_p is allowed to send to chptr */
|
||||
int add_channel_target(struct Client *source_p, chan::chan *chptr);
|
||||
int add_channel_target(client::client *source_p, chan::chan *chptr);
|
||||
/* allows source_p to send to target_p */
|
||||
void add_reply_target(struct Client *source_p, struct Client *target_p);
|
||||
void add_reply_target(client::client *source_p, client::client *target_p);
|
||||
|
||||
} // namespace ircd
|
||||
#endif // __cplusplus
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
namespace ircd {
|
||||
|
||||
struct User;
|
||||
struct Client;
|
||||
|
||||
/*
|
||||
lets speed this up...
|
||||
|
@ -51,7 +50,7 @@ struct Whowas
|
|||
unsigned char flags;
|
||||
const char *servername;
|
||||
time_t logoff;
|
||||
struct Client *online; /* Pointer to new nickname for chasing or NULL */
|
||||
client::client *online; /* Pointer to new nickname for chasing or NULL */
|
||||
};
|
||||
|
||||
/* Flags */
|
||||
|
@ -70,7 +69,7 @@ extern void whowas_init(void);
|
|||
** Client must be a fully registered user (specifically,
|
||||
** the user structure must have been allocated).
|
||||
*/
|
||||
void whowas_add_history(struct Client *, int);
|
||||
void whowas_add_history(client::client *, int);
|
||||
|
||||
/*
|
||||
** off_history
|
||||
|
@ -79,7 +78,7 @@ void whowas_add_history(struct Client *, int);
|
|||
** structures and it must know when they cease to exist. This
|
||||
** also implicitly calls AddHistory.
|
||||
*/
|
||||
void whowas_off_history(struct Client *);
|
||||
void whowas_off_history(client::client *);
|
||||
|
||||
/*
|
||||
** get_history
|
||||
|
@ -87,7 +86,7 @@ void whowas_off_history(struct Client *);
|
|||
** nickname within the timelimit. Returns NULL, if no
|
||||
** one found...
|
||||
*/
|
||||
struct Client *whowas_get_history(const char *, time_t);
|
||||
client::client *whowas_get_history(const char *, time_t);
|
||||
/* Nick name */
|
||||
/* Time limit in seconds */
|
||||
|
||||
|
|
|
@ -145,15 +145,15 @@ str_to_cid(const char *str)
|
|||
return (uint32_t)lcid;
|
||||
}
|
||||
|
||||
static inline struct Client *
|
||||
static inline client::client *
|
||||
cid_to_client(uint32_t ncid, bool del)
|
||||
{
|
||||
struct Client *client_p;
|
||||
client::client *client_p;
|
||||
|
||||
if(del)
|
||||
client_p = (Client *)rb_dictionary_delete(cid_clients, RB_UINT_TO_POINTER(ncid));
|
||||
client_p = (client::client *)rb_dictionary_delete(cid_clients, RB_UINT_TO_POINTER(ncid));
|
||||
else
|
||||
client_p = (Client *)rb_dictionary_retrieve(cid_clients, RB_UINT_TO_POINTER(ncid));
|
||||
client_p = (client::client *)rb_dictionary_retrieve(cid_clients, RB_UINT_TO_POINTER(ncid));
|
||||
|
||||
/* If the client's not found, that's okay, it may have already gone away.
|
||||
* --Elizafox */
|
||||
|
@ -161,7 +161,7 @@ cid_to_client(uint32_t ncid, bool del)
|
|||
return client_p;
|
||||
}
|
||||
|
||||
static inline struct Client *
|
||||
static inline client::client *
|
||||
str_cid_to_client(const char *str, bool del)
|
||||
{
|
||||
uint32_t ncid = str_to_cid(str);
|
||||
|
@ -175,7 +175,7 @@ str_cid_to_client(const char *str, bool del)
|
|||
static void
|
||||
cmd_accept_client(int parc, char **parv)
|
||||
{
|
||||
struct Client *client_p;
|
||||
client::client *client_p;
|
||||
|
||||
/* cid to uid (retrieve and delete) */
|
||||
if((client_p = str_cid_to_client(parv[1], true)) == NULL)
|
||||
|
@ -193,7 +193,7 @@ cmd_dns_result(int parc, char **parv)
|
|||
static void
|
||||
cmd_notice_client(int parc, char **parv)
|
||||
{
|
||||
struct Client *client_p;
|
||||
client::client *client_p;
|
||||
|
||||
if((client_p = str_cid_to_client(parv[1], false)) == NULL)
|
||||
return;
|
||||
|
@ -204,7 +204,7 @@ cmd_notice_client(int parc, char **parv)
|
|||
static void
|
||||
cmd_reject_client(int parc, char **parv)
|
||||
{
|
||||
struct Client *client_p;
|
||||
client::client *client_p;
|
||||
|
||||
/* cid to uid (retrieve and delete) */
|
||||
if((client_p = str_cid_to_client(parv[1], true)) == NULL)
|
||||
|
@ -348,7 +348,7 @@ configure_authd(void)
|
|||
}
|
||||
|
||||
static void
|
||||
authd_free_client(struct Client *client_p)
|
||||
authd_free_client(client::client *client_p)
|
||||
{
|
||||
if(client_p == NULL || client_p->preClient == NULL)
|
||||
return;
|
||||
|
@ -366,12 +366,12 @@ authd_free_client(struct Client *client_p)
|
|||
static void
|
||||
authd_free_client_cb(rb_dictionary_element *delem, void *unused)
|
||||
{
|
||||
struct Client *client_p = (Client *)delem->data;
|
||||
client::client *client_p = (client::client *)delem->data;
|
||||
authd_free_client(client_p);
|
||||
}
|
||||
|
||||
void
|
||||
authd_abort_client(struct Client *client_p)
|
||||
authd_abort_client(client::client *client_p)
|
||||
{
|
||||
rb_dictionary_delete(cid_clients, RB_UINT_TO_POINTER(client_p->preClient->auth.cid));
|
||||
authd_free_client(client_p);
|
||||
|
@ -381,7 +381,7 @@ static void
|
|||
restart_authd_cb(rb_helper * helper)
|
||||
{
|
||||
rb_dictionary_iter iter;
|
||||
struct Client *client_p;
|
||||
client::client *client_p;
|
||||
|
||||
iwarn("authd: restart_authd_cb called, authd died?");
|
||||
sendto_realops_snomask(SNO_GENERAL, L_ALL, "authd: restart_authd_cb called, authd died?");
|
||||
|
@ -443,7 +443,7 @@ generate_cid(void)
|
|||
* could then be processed too early by read_packet().
|
||||
*/
|
||||
void
|
||||
authd_initiate_client(struct Client *client_p, bool defer)
|
||||
authd_initiate_client(client::client *client_p, bool defer)
|
||||
{
|
||||
char client_ipaddr[HOSTIPLEN+1];
|
||||
char listen_ipaddr[HOSTIPLEN+1];
|
||||
|
@ -476,7 +476,7 @@ authd_initiate_client(struct Client *client_p, bool defer)
|
|||
}
|
||||
|
||||
static inline void
|
||||
authd_read_client(struct Client *client_p)
|
||||
authd_read_client(client::client *client_p)
|
||||
{
|
||||
/*
|
||||
* When a client has auth'ed, we want to start reading what it sends
|
||||
|
@ -497,7 +497,7 @@ authd_read_client(struct Client *client_p)
|
|||
* to authd_deferred_client().
|
||||
*/
|
||||
static inline void
|
||||
authd_decide_client(struct Client *client_p, const char *ident, const char *host, bool accept, char cause, const char *data, const char *reason)
|
||||
authd_decide_client(client::client *client_p, const char *ident, const char *host, bool accept, char cause, const char *data, const char *reason)
|
||||
{
|
||||
if(client_p->preClient == NULL || client_p->preClient->auth.cid == 0)
|
||||
return;
|
||||
|
@ -528,7 +528,7 @@ authd_decide_client(struct Client *client_p, const char *ident, const char *host
|
|||
}
|
||||
|
||||
void
|
||||
authd_deferred_client(struct Client *client_p)
|
||||
authd_deferred_client(client::client *client_p)
|
||||
{
|
||||
client_p->preClient->auth.flags &= ~AUTHC_F_DEFERRED;
|
||||
if(client_p->preClient->auth.flags & AUTHC_F_COMPLETE)
|
||||
|
@ -537,14 +537,14 @@ authd_deferred_client(struct Client *client_p)
|
|||
|
||||
/* Convenience function to accept client */
|
||||
void
|
||||
authd_accept_client(struct Client *client_p, const char *ident, const char *host)
|
||||
authd_accept_client(client::client *client_p, const char *ident, const char *host)
|
||||
{
|
||||
authd_decide_client(client_p, ident, host, true, '\0', NULL, NULL);
|
||||
}
|
||||
|
||||
/* Convenience function to reject client */
|
||||
void
|
||||
authd_reject_client(struct Client *client_p, const char *ident, const char *host, char cause, const char *data, const char *reason)
|
||||
authd_reject_client(client::client *client_p, const char *ident, const char *host, char cause, const char *data, const char *reason)
|
||||
{
|
||||
authd_decide_client(client_p, ident, host, false, cause, data, reason);
|
||||
}
|
||||
|
@ -553,14 +553,14 @@ static void
|
|||
timeout_dead_authd_clients(void *notused)
|
||||
{
|
||||
rb_dictionary_iter iter;
|
||||
struct Client *client_p;
|
||||
client::client *client_p;
|
||||
rb_dlink_list freelist = { NULL, NULL, 0 };
|
||||
rb_dlink_node *ptr, *nptr;
|
||||
|
||||
void *elem;
|
||||
RB_DICTIONARY_FOREACH(elem, &iter, cid_clients)
|
||||
{
|
||||
client_p = (Client *)elem;
|
||||
client_p = (client::client *)elem;
|
||||
if(client_p->preClient->auth.timeout < rb_current_time())
|
||||
{
|
||||
authd_free_client(client_p);
|
||||
|
@ -571,7 +571,7 @@ timeout_dead_authd_clients(void *notused)
|
|||
/* RB_DICTIONARY_FOREACH is not safe for deletion, so we do this crap */
|
||||
RB_DLINK_FOREACH_SAFE(ptr, nptr, freelist.head)
|
||||
{
|
||||
client_p = (Client *)ptr->data;
|
||||
client_p = (client::client *)ptr->data;
|
||||
rb_dictionary_delete(cid_clients, RB_UINT_TO_POINTER(client_p->preClient->auth.cid));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ start_bandb(void)
|
|||
}
|
||||
|
||||
void
|
||||
bandb_add(bandb_type type, struct Client *source_p, const char *mask1,
|
||||
bandb_add(bandb_type type, client::client *source_p, const char *mask1,
|
||||
const char *mask2, const char *reason, const char *oper_reason, int perm)
|
||||
{
|
||||
if(bandb_helper == NULL)
|
||||
|
@ -363,7 +363,7 @@ bandb_handle_finish(void)
|
|||
}
|
||||
}
|
||||
|
||||
check_banned_lines();
|
||||
client::check_banned_lines();
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -184,7 +184,7 @@ cache::motd::cache_oper(void)
|
|||
* side effects -
|
||||
*/
|
||||
void
|
||||
cache::motd::send_user(Client *source_p)
|
||||
cache::motd::send_user(client::client *source_p)
|
||||
{
|
||||
const char *const myname(get_id(&me, source_p));
|
||||
const char *const nick(get_id(source_p, source_p));
|
||||
|
@ -210,7 +210,7 @@ cache::motd::send_user(Client *source_p)
|
|||
* side effects -
|
||||
*/
|
||||
void
|
||||
cache::motd::send_oper(Client *source_p)
|
||||
cache::motd::send_oper(client::client *source_p)
|
||||
{
|
||||
if (oper.contents.empty())
|
||||
return;
|
||||
|
|
110
ircd/channel.cc
110
ircd/channel.cc
|
@ -55,7 +55,7 @@ chan::del(const std::string &name)
|
|||
|
||||
chan::chan &
|
||||
chan::add(const std::string &name,
|
||||
client &client)
|
||||
client::client &client)
|
||||
{
|
||||
if (name.empty())
|
||||
throw err::BADCHANNAME("");
|
||||
|
@ -148,10 +148,11 @@ noexcept
|
|||
* side effects - user is removed from all channels
|
||||
*/
|
||||
void
|
||||
chan::del(client &client)
|
||||
chan::del(client::client &client)
|
||||
{
|
||||
auto &client_chans(client.user->channel);
|
||||
for(const auto &pit : client_chans)
|
||||
using client::user::chans;
|
||||
|
||||
for(const auto &pit : chans(user(client)))
|
||||
{
|
||||
auto &chan(*pit.first);
|
||||
auto &member(*pit.second);
|
||||
|
@ -166,21 +167,21 @@ chan::del(client &client)
|
|||
del(chan);
|
||||
}
|
||||
|
||||
client_chans.clear();
|
||||
client.user->invited.clear();
|
||||
chans(user(client)).clear();
|
||||
invites(user(client)).clear();
|
||||
}
|
||||
|
||||
void
|
||||
chan::del(chan &chan,
|
||||
client &client)
|
||||
client::client &client)
|
||||
{
|
||||
// These are the relevant containers.
|
||||
using client::user::chans;
|
||||
|
||||
auto &global(chan.members.global);
|
||||
auto &local(chan.members.local);
|
||||
auto &client_chans(client.user->channel);
|
||||
|
||||
const auto it(client_chans.find(&chan));
|
||||
if (it == end(client_chans))
|
||||
const auto it(chans(user(client)).find(&chan));
|
||||
if (it == end(chans(user(client))))
|
||||
return;
|
||||
|
||||
auto &member(*it->second);
|
||||
|
@ -189,7 +190,7 @@ chan::del(chan &chan,
|
|||
chan.members.local.erase(member.lit);
|
||||
|
||||
chan.members.global.erase(member.git); // The member is destroyed at this point.
|
||||
client_chans.erase(it);
|
||||
chans(user(client)).erase(it);
|
||||
|
||||
if (empty(chan) && ~chan.mode & mode::PERMANENT)
|
||||
del(chan);
|
||||
|
@ -197,9 +198,11 @@ chan::del(chan &chan,
|
|||
|
||||
void
|
||||
chan::add(chan &chan,
|
||||
client &client,
|
||||
client::client &client,
|
||||
const int &flags)
|
||||
{
|
||||
using client::user::chans;
|
||||
|
||||
if (!client.user)
|
||||
{
|
||||
s_assert(0);
|
||||
|
@ -209,7 +212,6 @@ chan::add(chan &chan,
|
|||
// These are the relevant containers.
|
||||
auto &global(chan.members.global);
|
||||
auto &local(chan.members.local);
|
||||
auto &client_chans(client.user->channel);
|
||||
|
||||
// Add client to channel's global map
|
||||
const auto iit(global.emplace(&client, flags));
|
||||
|
@ -227,7 +229,7 @@ chan::add(chan &chan,
|
|||
member.lit = local.emplace(end(local), &member);
|
||||
|
||||
// Add channel to client's channel map, pointing to the membership;
|
||||
client_chans.emplace(&chan, &member);
|
||||
chans(user(client)).emplace(&chan, &member);
|
||||
}
|
||||
|
||||
|
||||
|
@ -274,7 +276,7 @@ chan::ban::ban(const std::string &banstr,
|
|||
|
||||
void
|
||||
chan::send_join(chan &chan,
|
||||
Client &client)
|
||||
client::client &client)
|
||||
{
|
||||
if (!IsClient(&client))
|
||||
return;
|
||||
|
@ -292,27 +294,27 @@ chan::send_join(chan &chan,
|
|||
client.username,
|
||||
client.host,
|
||||
chan.name.c_str(),
|
||||
client.user->suser.empty()? "*" : client.user->suser.c_str(),
|
||||
suser(user(client)).empty()? "*" : suser(user(client)).c_str(),
|
||||
client.info);
|
||||
|
||||
// Send away message to away-notify enabled clients.
|
||||
if (!client.user->away.empty())
|
||||
if (!away(user(client)).empty())
|
||||
sendto_channel_local_with_capability_butone(&client, ALL_MEMBERS, CLICAP_AWAY_NOTIFY, NOCAPS, &chan,
|
||||
":%s!%s@%s AWAY :%s",
|
||||
client.name,
|
||||
client.username,
|
||||
client.host,
|
||||
client.user->away.c_str());
|
||||
away(user(client)).c_str());
|
||||
}
|
||||
|
||||
chan::membership &
|
||||
chan::get(members &members,
|
||||
const client &client)
|
||||
const client::client &client)
|
||||
{
|
||||
if (!is_client(client))
|
||||
throw invalid_argument();
|
||||
|
||||
const auto key(const_cast<ircd::chan::client *>(&client)); //TODO: temp elaborated
|
||||
const auto key(const_cast<client::client *>(&client));
|
||||
const auto it(members.global.find(key));
|
||||
if (it == end(members.global))
|
||||
throw err::NOTONCHANNEL(client.name);
|
||||
|
@ -322,12 +324,12 @@ chan::get(members &members,
|
|||
|
||||
const chan::membership &
|
||||
chan::get(const members &members,
|
||||
const client &client)
|
||||
const client::client &client)
|
||||
{
|
||||
if (!is_client(client))
|
||||
throw invalid_argument();
|
||||
|
||||
const auto key(const_cast<ircd::chan::client *>(&client)); //TODO: temp elaborated
|
||||
const auto key(const_cast<client::client *>(&client));
|
||||
const auto it(members.global.find(key));
|
||||
if (it == end(members.global))
|
||||
throw err::NOTONCHANNEL(client.name);
|
||||
|
@ -337,13 +339,13 @@ chan::get(const members &members,
|
|||
|
||||
chan::membership *
|
||||
chan::get(members &members,
|
||||
const client &client,
|
||||
const client::client &client,
|
||||
std::nothrow_t)
|
||||
{
|
||||
if (!is_client(client))
|
||||
return nullptr;
|
||||
|
||||
const auto key(const_cast<ircd::chan::client *>(&client)); //TODO: temp elaborated
|
||||
const auto key(const_cast<client::client *>(&client));
|
||||
const auto it(members.global.find(key));
|
||||
if (it == end(members.global))
|
||||
return nullptr;
|
||||
|
@ -353,13 +355,13 @@ chan::get(members &members,
|
|||
|
||||
const chan::membership *
|
||||
chan::get(const members &members,
|
||||
const client &client,
|
||||
const client::client &client,
|
||||
std::nothrow_t)
|
||||
{
|
||||
if (!is_client(client))
|
||||
return nullptr;
|
||||
|
||||
const auto key(const_cast<ircd::chan::client *>(&client)); //TODO: temp elaborated
|
||||
const auto key(const_cast<client::client *>(&client));
|
||||
const auto it(members.global.find(key));
|
||||
if (it == end(members.global))
|
||||
return nullptr;
|
||||
|
@ -404,12 +406,14 @@ chan::find_status(const membership *const &msptr,
|
|||
* to be used after a nick change
|
||||
*/
|
||||
void
|
||||
chan::invalidate_bancache_user(client *client)
|
||||
chan::invalidate_bancache_user(client::client *client)
|
||||
{
|
||||
using client::user::chans;
|
||||
|
||||
if(!client)
|
||||
return;
|
||||
|
||||
for(const auto &pair : client->user->channel)
|
||||
for(const auto &pair : chans(user(*client)))
|
||||
{
|
||||
auto &chan(*pair.first);
|
||||
auto &member(*pair.second);
|
||||
|
@ -439,9 +443,9 @@ channel_pub_or_secret(chan::chan *const &chptr)
|
|||
* side effects - client is given list of users on channel
|
||||
*/
|
||||
void
|
||||
chan::channel_member_names(chan *chptr, client *client_p, int show_eon)
|
||||
chan::channel_member_names(chan *chptr, client::client *client_p, int show_eon)
|
||||
{
|
||||
client *target_p;
|
||||
client::client *target_p;
|
||||
rb_dlink_node *ptr;
|
||||
char lbuf[BUFSIZE];
|
||||
char *t;
|
||||
|
@ -522,20 +526,20 @@ void
|
|||
chan::clear_invites(chan &chan)
|
||||
{
|
||||
for (auto &client : chan.invites)
|
||||
client->user->invited.erase(&chan);
|
||||
invites(user(*client)).erase(&chan);
|
||||
}
|
||||
|
||||
void
|
||||
chan::del_invite(chan &chan, client &client)
|
||||
chan::del_invite(chan &chan, client::client &client)
|
||||
{
|
||||
chan.invites.erase(&client);
|
||||
client.user->invited.erase(&chan);
|
||||
invites(user(client)).erase(&chan);
|
||||
}
|
||||
|
||||
bool
|
||||
chan::cache_check(const chan &chan,
|
||||
const mode::type &type,
|
||||
const client &who,
|
||||
const client::client &who,
|
||||
bool &result)
|
||||
{
|
||||
using namespace mode;
|
||||
|
@ -561,7 +565,7 @@ chan::cache_check(const chan &chan,
|
|||
void
|
||||
chan::cache_result(chan &chan,
|
||||
const mode::type &type,
|
||||
const client &client,
|
||||
const client::client &client,
|
||||
const bool &result,
|
||||
membership *const &membership)
|
||||
{
|
||||
|
@ -596,7 +600,7 @@ chan::cache_result(chan &chan,
|
|||
bool
|
||||
chan::check(chan &chan,
|
||||
const mode::type &type,
|
||||
const client &client,
|
||||
const client::client &client,
|
||||
check_data *const &data)
|
||||
{
|
||||
bool result;
|
||||
|
@ -671,7 +675,7 @@ chan::check(chan &chan,
|
|||
if (s[ALTHOST] && match(mask, s[ALTHOST]))
|
||||
return true;
|
||||
|
||||
if (match_extban(mask.c_str(), const_cast<Client *>(&client), &chan, mode::BAN))
|
||||
if (match_extban(mask.c_str(), const_cast<client::client *>(&client), &chan, mode::BAN))
|
||||
return true;
|
||||
|
||||
#ifdef RB_IPV6
|
||||
|
@ -719,7 +723,7 @@ chan::check(chan &chan,
|
|||
* caveats - this function should only be called on a local user.
|
||||
*/
|
||||
int
|
||||
chan::can_join(client *source_p, chan *chptr, const char *key, const char **forward)
|
||||
chan::can_join(client::client *source_p, chan *chptr, const char *key, const char **forward)
|
||||
{
|
||||
rb_dlink_node *ptr;
|
||||
bool invited(false);
|
||||
|
@ -817,7 +821,7 @@ chan::can_join(client *source_p, chan *chptr, const char *key, const char **forw
|
|||
|
||||
if(chptr->mode.limit && size(chptr->members) >= ulong(chptr->mode.limit))
|
||||
i = ERR_CHANNELISFULL;
|
||||
if(chptr->mode.mode & mode::REGONLY && source_p->user->suser.empty())
|
||||
if(chptr->mode.mode & mode::REGONLY && suser(user(*source_p)).empty())
|
||||
i = ERR_NEEDREGGEDNICK;
|
||||
/* join throttling stuff --nenolod */
|
||||
else if(chptr->mode.join_num > 0 && chptr->mode.join_time > 0)
|
||||
|
@ -848,7 +852,7 @@ finish_join_check:
|
|||
* side effects -
|
||||
*/
|
||||
int
|
||||
chan::can_send(chan *chptr, client *source_p, membership *msptr)
|
||||
chan::can_send(chan *chptr, client::client *source_p, membership *msptr)
|
||||
{
|
||||
hook_data_channel_approval moduledata;
|
||||
|
||||
|
@ -929,7 +933,7 @@ chan::can_send(chan *chptr, client *source_p, membership *msptr)
|
|||
* side effects - check for flood attack on target chptr
|
||||
*/
|
||||
bool
|
||||
chan::flood_attack_channel(int p_or_n, client *source_p, chan *chptr)
|
||||
chan::flood_attack_channel(int p_or_n, client::client *source_p, chan *chptr)
|
||||
{
|
||||
int delta;
|
||||
|
||||
|
@ -980,8 +984,10 @@ chan::flood_attack_channel(int p_or_n, client *source_p, chan *chptr)
|
|||
* Output: channel preventing nick change
|
||||
*/
|
||||
chan::chan *
|
||||
chan::find_bannickchange_channel(client *client_p)
|
||||
chan::find_bannickchange_channel(client::client *client_p)
|
||||
{
|
||||
using client::user::chans;
|
||||
|
||||
chan *chptr;
|
||||
membership *msptr;
|
||||
rb_dlink_node *ptr;
|
||||
|
@ -994,7 +1000,7 @@ chan::find_bannickchange_channel(client *client_p)
|
|||
sprintf(src_host, "%s!%s@%s", client_p->name, client_p->username, client_p->host);
|
||||
sprintf(src_iphost, "%s!%s@%s", client_p->name, client_p->username, client_p->sockhost);
|
||||
|
||||
for(const auto &pit : client_p->user->channel)
|
||||
for(const auto &pit : chans(user(*client_p)))
|
||||
{
|
||||
auto &chptr(pit.first);
|
||||
auto &msptr(pit.second);
|
||||
|
@ -1025,7 +1031,7 @@ chan::find_bannickchange_channel(client *client_p)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* void check_spambot_warning(client *source_p)
|
||||
/* void check_spambot_warning(client::client *source_p)
|
||||
* Input: Client to check, channel name or NULL if this is a part.
|
||||
* Output: none
|
||||
* Side-effects: Updates the client's oper_warn_count_down, warns the
|
||||
|
@ -1033,7 +1039,7 @@ chan::find_bannickchange_channel(client *client_p)
|
|||
* needed.
|
||||
*/
|
||||
void
|
||||
chan::check_spambot_warning(client *source_p, const char *name)
|
||||
chan::check_spambot_warning(client::client *source_p, const char *name)
|
||||
{
|
||||
int t_delta;
|
||||
int decrement_count;
|
||||
|
@ -1161,7 +1167,7 @@ chan::set_channel_topic(chan *chptr, const char *topic, const char *topic_info,
|
|||
* Stolen from ShadowIRCd 4 --nenolod
|
||||
*/
|
||||
const char *
|
||||
chan::channel_modes(chan *chptr, client *client_p)
|
||||
chan::channel_modes(chan *chptr, client::client *client_p)
|
||||
{
|
||||
int i;
|
||||
char buf1[BUFSIZE];
|
||||
|
@ -1222,8 +1228,8 @@ chan::channel_modes(chan *chptr, client *client_p)
|
|||
return final;
|
||||
}
|
||||
|
||||
/* void send_cap_mode_changes(client *client_p,
|
||||
* client *source_p,
|
||||
/* void send_cap_mode_changes(client::client *client_p,
|
||||
* client::client *source_p,
|
||||
* chan *chptr, int cap, int nocap)
|
||||
* Input: The client sending(client_p), the source client(source_p),
|
||||
* the channel to send mode changes for(chptr)
|
||||
|
@ -1238,7 +1244,7 @@ chan::channel_modes(chan *chptr, client *client_p)
|
|||
* 2.8.21+CSr and stuff. --nenolod
|
||||
*/
|
||||
void
|
||||
chan::send_cap_mode_changes(client *client_p, client *source_p,
|
||||
chan::send_cap_mode_changes(client::client *client_p, client::client *source_p,
|
||||
chan *chptr, mode::change mode_changes[], int mode_count)
|
||||
{
|
||||
static char modebuf[BUFSIZE];
|
||||
|
@ -1341,7 +1347,7 @@ chan::resv_chan_forcepart(const char *name, const char *reason, int temp_time)
|
|||
rb_dlink_node *next_ptr;
|
||||
chan *chptr;
|
||||
membership *msptr;
|
||||
client *target_p;
|
||||
client::client *target_p;
|
||||
|
||||
if(!ConfigChannel.resv_forcepart)
|
||||
return;
|
||||
|
@ -1390,7 +1396,7 @@ bool
|
|||
chan::add(chan &chan,
|
||||
const mode::type &type,
|
||||
const std::string &mask,
|
||||
client &source,
|
||||
client::client &source,
|
||||
const std::string &forward)
|
||||
|
||||
{
|
||||
|
|
|
@ -196,7 +196,7 @@ mode::orphan(const uint8_t &c)
|
|||
namespace ircd {
|
||||
|
||||
int
|
||||
chan::get_channel_access(client *source_p, chan *chptr, membership *msptr, int dir, const char *modestr)
|
||||
chan::get_channel_access(client::client *source_p, chan *chptr, membership *msptr, int dir, const char *modestr)
|
||||
{
|
||||
hook_data_channel_approval moduledata;
|
||||
|
||||
|
@ -225,7 +225,7 @@ chan::get_channel_access(client *source_p, chan *chptr, membership *msptr, int d
|
|||
* side effects - error message sent on failure
|
||||
*/
|
||||
static bool
|
||||
allow_mode_change(struct Client *source_p, chan::chan *chptr, int alevel,
|
||||
allow_mode_change(client::client *source_p, chan::chan *chptr, int alevel,
|
||||
int *errors, char c)
|
||||
{
|
||||
/* If this mode char is locked, don't allow local users to change it. */
|
||||
|
@ -409,7 +409,7 @@ pretty_mask(const char *idmask)
|
|||
* side effects - numeric sent if not allowed
|
||||
*/
|
||||
static bool
|
||||
check_forward(Client *source_p, chan::chan *chptr, const char *forward)
|
||||
check_forward(client::client *source_p, chan::chan *chptr, const char *forward)
|
||||
{
|
||||
chan::chan *targptr = NULL;
|
||||
chan::membership *msptr;
|
||||
|
@ -499,7 +499,7 @@ fix_key_remote(char *arg)
|
|||
* The handlers for each specific mode.
|
||||
*/
|
||||
void
|
||||
mode::functor::nosuch(struct Client *source_p, chan *chptr,
|
||||
mode::functor::nosuch(client::client *source_p, chan *chptr,
|
||||
int alevel, int parc, int *parn,
|
||||
const char **parv, int *errors, int dir, char c, type mode_type)
|
||||
{
|
||||
|
@ -510,7 +510,7 @@ mode::functor::nosuch(struct Client *source_p, chan *chptr,
|
|||
}
|
||||
|
||||
void
|
||||
mode::functor::simple(struct Client *source_p, chan *chptr,
|
||||
mode::functor::simple(client::client *source_p, chan *chptr,
|
||||
int alevel, int parc, int *parn,
|
||||
const char **parv, int *errors, int dir, char c, type mode_type)
|
||||
{
|
||||
|
@ -549,7 +549,7 @@ mode::functor::simple(struct Client *source_p, chan *chptr,
|
|||
}
|
||||
|
||||
void
|
||||
mode::functor::orphaned(struct Client *source_p, chan *chptr,
|
||||
mode::functor::orphaned(client::client *source_p, chan *chptr,
|
||||
int alevel, int parc, int *parn,
|
||||
const char **parv, int *errors, int dir, char c, type mode_type)
|
||||
{
|
||||
|
@ -579,7 +579,7 @@ mode::functor::orphaned(struct Client *source_p, chan *chptr,
|
|||
}
|
||||
|
||||
void
|
||||
mode::functor::hidden(struct Client *source_p, chan *chptr,
|
||||
mode::functor::hidden(client::client *source_p, chan *chptr,
|
||||
int alevel, int parc, int *parn,
|
||||
const char **parv, int *errors, int dir, char c, type mode_type)
|
||||
{
|
||||
|
@ -626,7 +626,7 @@ mode::functor::hidden(struct Client *source_p, chan *chptr,
|
|||
}
|
||||
|
||||
void
|
||||
mode::functor::staff(struct Client *source_p, chan *chptr,
|
||||
mode::functor::staff(client::client *source_p, chan *chptr,
|
||||
int alevel, int parc, int *parn,
|
||||
const char **parv, int *errors, int dir, char c, type mode_type)
|
||||
{
|
||||
|
@ -676,7 +676,7 @@ mode::functor::staff(struct Client *source_p, chan *chptr,
|
|||
}
|
||||
|
||||
void
|
||||
mode::functor::ban(client *source_p, chan *chptr,
|
||||
mode::functor::ban(client::client *source_p, chan *chptr,
|
||||
int alevel, int parc, int *parn,
|
||||
const char **parv, int *errors, int dir, char c, type mode_type)
|
||||
{
|
||||
|
@ -926,13 +926,13 @@ mode::functor::ban(client *source_p, chan *chptr,
|
|||
}
|
||||
|
||||
void
|
||||
mode::functor::op(client *source_p, chan *chptr,
|
||||
mode::functor::op(client::client *source_p, chan *chptr,
|
||||
int alevel, int parc, int *parn,
|
||||
const char **parv, int *errors, int dir, char c, type mode_type)
|
||||
{
|
||||
membership *mstptr;
|
||||
const char *opnick;
|
||||
client *targ_p;
|
||||
client::client *targ_p;
|
||||
|
||||
if(!allow_mode_change(source_p, chptr, alevel, errors, c))
|
||||
return;
|
||||
|
@ -1002,13 +1002,13 @@ mode::functor::op(client *source_p, chan *chptr,
|
|||
}
|
||||
|
||||
void
|
||||
mode::functor::voice(client *source_p, chan *chptr,
|
||||
mode::functor::voice(client::client *source_p, chan *chptr,
|
||||
int alevel, int parc, int *parn,
|
||||
const char **parv, int *errors, int dir, char c, type mode_type)
|
||||
{
|
||||
membership *mstptr;
|
||||
const char *opnick;
|
||||
client *targ_p;
|
||||
client::client *targ_p;
|
||||
|
||||
if(!allow_mode_change(source_p, chptr, alevel, errors, c))
|
||||
return;
|
||||
|
@ -1068,7 +1068,7 @@ mode::functor::voice(client *source_p, chan *chptr,
|
|||
}
|
||||
|
||||
void
|
||||
mode::functor::limit(client *source_p, chan *chptr,
|
||||
mode::functor::limit(client::client *source_p, chan *chptr,
|
||||
int alevel, int parc, int *parn,
|
||||
const char **parv, int *errors, int dir, char c, type mode_type)
|
||||
{
|
||||
|
@ -1119,7 +1119,7 @@ mode::functor::limit(client *source_p, chan *chptr,
|
|||
}
|
||||
|
||||
void
|
||||
mode::functor::throttle(client *source_p, chan *chptr,
|
||||
mode::functor::throttle(client::client *source_p, chan *chptr,
|
||||
int alevel, int parc, int *parn,
|
||||
const char **parv, int *errors, int dir, char c, type mode_type)
|
||||
{
|
||||
|
@ -1172,7 +1172,7 @@ mode::functor::throttle(client *source_p, chan *chptr,
|
|||
}
|
||||
|
||||
void
|
||||
mode::functor::forward(client *source_p, chan *chptr,
|
||||
mode::functor::forward(client::client *source_p, chan *chptr,
|
||||
int alevel, int parc, int *parn,
|
||||
const char **parv, int *errors, int dir, char c, type mode_type)
|
||||
{
|
||||
|
@ -1248,7 +1248,7 @@ mode::functor::forward(client *source_p, chan *chptr,
|
|||
}
|
||||
|
||||
void
|
||||
mode::functor::key(client *source_p, chan *chptr,
|
||||
mode::functor::key(client::client *source_p, chan *chptr,
|
||||
int alevel, int parc, int *parn,
|
||||
const char **parv, int *errors, int dir, char c, type mode_type)
|
||||
{
|
||||
|
@ -1325,7 +1325,7 @@ mode::functor::key(client *source_p, chan *chptr,
|
|||
* Extensively modified to be hotpluggable, 03/09/06 -- nenolod
|
||||
*/
|
||||
void
|
||||
chan::set_channel_mode(client *client_p, client *source_p,
|
||||
chan::set_channel_mode(client::client *client_p, client::client *source_p,
|
||||
chan *chptr, membership *msptr, int parc, const char *parv[])
|
||||
{
|
||||
static char modebuf[BUFSIZE];
|
||||
|
@ -1340,7 +1340,7 @@ chan::set_channel_mode(client *client_p, client *source_p,
|
|||
int alevel;
|
||||
const char *ml = parv[0];
|
||||
char c;
|
||||
client *fakesource_p;
|
||||
client::client *fakesource_p;
|
||||
int reauthorized = 0; /* if we change from MODE_QUERY to MODE_ADD/MODE_DEL, then reauth once, ugly but it works */
|
||||
int flags_list[3] = { ALL_MEMBERS, ONLY_CHANOPS, ONLY_OPERS };
|
||||
|
||||
|
@ -1485,7 +1485,7 @@ chan::set_channel_mode(client *client_p, client *source_p,
|
|||
* side effects - channel mlock is changed / MLOCK is propagated
|
||||
*/
|
||||
void
|
||||
chan::set_channel_mlock(client *client_p, client *source_p,
|
||||
chan::set_channel_mlock(client::client *client_p, client::client *source_p,
|
||||
chan *chptr, const char *newmlock, bool propagate)
|
||||
{
|
||||
chptr->mode_lock = newmlock?: std::string{};
|
||||
|
|
|
@ -80,7 +80,7 @@ get_conf_ping(struct ConfItem *aconf)
|
|||
* side effects - NONE
|
||||
*/
|
||||
const char *
|
||||
get_client_class(struct Client *target_p)
|
||||
get_client_class(client::client *target_p)
|
||||
{
|
||||
const char *retc = "unknown";
|
||||
|
||||
|
@ -114,7 +114,7 @@ get_client_class(struct Client *target_p)
|
|||
* side effects - NONE
|
||||
*/
|
||||
int
|
||||
get_client_ping(struct Client *target_p)
|
||||
get_client_ping(client::client *target_p)
|
||||
{
|
||||
int ping = 0;
|
||||
|
||||
|
@ -269,7 +269,7 @@ initclass()
|
|||
* side effects - class report is done to this client
|
||||
*/
|
||||
void
|
||||
report_classes(struct Client *source_p)
|
||||
report_classes(client::client *source_p)
|
||||
{
|
||||
struct Class *cltmp;
|
||||
rb_dlink_node *ptr;
|
||||
|
@ -306,7 +306,7 @@ report_classes(struct Client *source_p)
|
|||
* side effects - NONE
|
||||
*/
|
||||
long
|
||||
get_sendq(struct Client *client_p)
|
||||
get_sendq(client::client *client_p)
|
||||
{
|
||||
if(client_p == NULL || IsMe(client_p))
|
||||
return DEFAULT_SENDQ;
|
||||
|
|
515
ircd/client.cc
515
ircd/client.cc
File diff suppressed because it is too large
Load diff
|
@ -28,7 +28,7 @@ using namespace ext;
|
|||
ext::func ext::table[256] = { NULL };
|
||||
|
||||
int
|
||||
chan::match_extban(const char *banstr, client *client_p, chan *chptr, long mode_type)
|
||||
chan::match_extban(const char *banstr, client::client *client_p, chan *chptr, long mode_type)
|
||||
{
|
||||
const char *p;
|
||||
int invert(0), result(INVALID);
|
||||
|
@ -63,7 +63,7 @@ chan::match_extban(const char *banstr, client *client_p, chan *chptr, long mode_
|
|||
}
|
||||
|
||||
int
|
||||
chan::valid_extban(const char *banstr, client *client_p, chan *chptr, long mode_type)
|
||||
chan::valid_extban(const char *banstr, client::client *client_p, chan *chptr, long mode_type)
|
||||
{
|
||||
const char *p;
|
||||
int result(INVALID);
|
||||
|
|
38
ircd/hash.cc
38
ircd/hash.cc
|
@ -116,7 +116,7 @@ fnv_hash_upper_len(const unsigned char *s, int bits, int len)
|
|||
* adds an entry to the id hash table
|
||||
*/
|
||||
void
|
||||
add_to_id_hash(const char *name, struct Client *client_p)
|
||||
add_to_id_hash(const char *name, client::client *client_p)
|
||||
{
|
||||
if(EmptyString(name) || (client_p == NULL))
|
||||
return;
|
||||
|
@ -129,7 +129,7 @@ add_to_id_hash(const char *name, struct Client *client_p)
|
|||
* adds an entry (client/server) to the client hash table
|
||||
*/
|
||||
void
|
||||
add_to_client_hash(const char *name, struct Client *client_p)
|
||||
add_to_client_hash(const char *name, client::client *client_p)
|
||||
{
|
||||
s_assert(name != NULL);
|
||||
s_assert(client_p != NULL);
|
||||
|
@ -144,7 +144,7 @@ add_to_client_hash(const char *name, struct Client *client_p)
|
|||
* adds a client entry to the hostname hash table
|
||||
*/
|
||||
void
|
||||
add_to_hostname_hash(const char *hostname, struct Client *client_p)
|
||||
add_to_hostname_hash(const char *hostname, client::client *client_p)
|
||||
{
|
||||
rb_dlink_list *list;
|
||||
|
||||
|
@ -185,7 +185,7 @@ add_to_resv_hash(const char *name, struct ConfItem *aconf)
|
|||
* removes an id from the id hash table
|
||||
*/
|
||||
void
|
||||
del_from_id_hash(const char *id, struct Client *client_p)
|
||||
del_from_id_hash(const char *id, client::client *client_p)
|
||||
{
|
||||
s_assert(id != NULL);
|
||||
s_assert(client_p != NULL);
|
||||
|
@ -200,7 +200,7 @@ del_from_id_hash(const char *id, struct Client *client_p)
|
|||
* removes a client/server from the client hash table
|
||||
*/
|
||||
void
|
||||
del_from_client_hash(const char *name, struct Client *client_p)
|
||||
del_from_client_hash(const char *name, client::client *client_p)
|
||||
{
|
||||
/* no s_asserts, this can happen when removing a client that
|
||||
* is unregistered.
|
||||
|
@ -216,7 +216,7 @@ del_from_client_hash(const char *name, struct Client *client_p)
|
|||
* removes a client entry from the hostname hash table
|
||||
*/
|
||||
void
|
||||
del_from_hostname_hash(const char *hostname, struct Client *client_p)
|
||||
del_from_hostname_hash(const char *hostname, client::client *client_p)
|
||||
{
|
||||
rb_dlink_list *list;
|
||||
|
||||
|
@ -255,20 +255,20 @@ del_from_resv_hash(const char *name, struct ConfItem *aconf)
|
|||
*
|
||||
* finds a client entry from the id hash table
|
||||
*/
|
||||
struct Client *
|
||||
client::client *
|
||||
find_id(const char *name)
|
||||
{
|
||||
if(EmptyString(name))
|
||||
return NULL;
|
||||
|
||||
return (Client *)rb_radixtree_retrieve(client_id_tree, name);
|
||||
return (client::client *)rb_radixtree_retrieve(client_id_tree, name);
|
||||
}
|
||||
|
||||
/* find_client()
|
||||
*
|
||||
* finds a client/server entry from the client hash table
|
||||
*/
|
||||
struct Client *
|
||||
client::client *
|
||||
find_client(const char *name)
|
||||
{
|
||||
s_assert(name != NULL);
|
||||
|
@ -279,31 +279,31 @@ find_client(const char *name)
|
|||
if(rfc1459::is_digit(*name))
|
||||
return (find_id(name));
|
||||
|
||||
return (Client *)rb_radixtree_retrieve(client_name_tree, name);
|
||||
return (client::client *)rb_radixtree_retrieve(client_name_tree, name);
|
||||
}
|
||||
|
||||
/* find_named_client()
|
||||
*
|
||||
* finds a client/server entry from the client hash table
|
||||
*/
|
||||
struct Client *
|
||||
client::client *
|
||||
find_named_client(const char *name)
|
||||
{
|
||||
s_assert(name != NULL);
|
||||
if(EmptyString(name))
|
||||
return NULL;
|
||||
|
||||
return (Client *)rb_radixtree_retrieve(client_name_tree, name);
|
||||
return (client::client *)rb_radixtree_retrieve(client_name_tree, name);
|
||||
}
|
||||
|
||||
/* find_server()
|
||||
*
|
||||
* finds a server from the client hash table
|
||||
*/
|
||||
struct Client *
|
||||
find_server(struct Client *source_p, const char *name)
|
||||
client::client *
|
||||
find_server(client::client *source_p, const char *name)
|
||||
{
|
||||
struct Client *target_p;
|
||||
client::client *target_p;
|
||||
|
||||
if(EmptyString(name))
|
||||
return NULL;
|
||||
|
@ -315,7 +315,7 @@ find_server(struct Client *source_p, const char *name)
|
|||
return(target_p);
|
||||
}
|
||||
|
||||
target_p = (Client *)rb_radixtree_retrieve(client_name_tree, name);
|
||||
target_p = (client::client *)rb_radixtree_retrieve(client_name_tree, name);
|
||||
if (target_p != NULL)
|
||||
{
|
||||
if(IsServer(target_p) || IsMe(target_p))
|
||||
|
@ -390,7 +390,7 @@ clear_resv_hash(void)
|
|||
}
|
||||
|
||||
void
|
||||
add_to_cli_connid_hash(struct Client *client_p, uint32_t id)
|
||||
add_to_cli_connid_hash(client::client *client_p, uint32_t id)
|
||||
{
|
||||
rb_dictionary_add(client_connid_tree, RB_UINT_TO_POINTER(id), client_p);
|
||||
}
|
||||
|
@ -401,10 +401,10 @@ del_from_cli_connid_hash(uint32_t id)
|
|||
rb_dictionary_delete(client_connid_tree, RB_UINT_TO_POINTER(id));
|
||||
}
|
||||
|
||||
struct Client *
|
||||
client::client *
|
||||
find_cli_connid_hash(uint32_t connid)
|
||||
{
|
||||
return (Client *)rb_dictionary_retrieve(client_connid_tree, RB_UINT_TO_POINTER(connid));
|
||||
return (client::client *)rb_dictionary_retrieve(client_connid_tree, RB_UINT_TO_POINTER(connid));
|
||||
}
|
||||
|
||||
} // namespace ircd
|
||||
|
|
|
@ -691,14 +691,14 @@ clear_out_address_conf_bans(void)
|
|||
/*
|
||||
* show_iline_prefix()
|
||||
*
|
||||
* inputs - pointer to struct Client requesting output
|
||||
* inputs - pointer to client::client requesting output
|
||||
* - pointer to struct ConfItem
|
||||
* - name to which iline prefix will be prefixed to
|
||||
* output - pointer to static string with prefixes listed in ascii form
|
||||
* side effects - NONE
|
||||
*/
|
||||
char *
|
||||
show_iline_prefix(struct Client *sptr, struct ConfItem *aconf, char *name)
|
||||
show_iline_prefix(client::client *sptr, struct ConfItem *aconf, char *name)
|
||||
{
|
||||
static char prefix_of_host[USERLEN + 15];
|
||||
char *prefix_ptr;
|
||||
|
@ -730,7 +730,7 @@ show_iline_prefix(struct Client *sptr, struct ConfItem *aconf, char *name)
|
|||
* Side effects: Reports configured auth{} blocks to client_p
|
||||
*/
|
||||
void
|
||||
report_auth(struct Client *client_p)
|
||||
report_auth(client::client *client_p)
|
||||
{
|
||||
char *name, *host, *user, *classname;
|
||||
const char *pass;
|
||||
|
|
16
ircd/ircd.cc
16
ircd/ircd.cc
|
@ -43,7 +43,7 @@ struct Counter Count;
|
|||
struct ServerStatistics ServerStats;
|
||||
|
||||
int maxconnections;
|
||||
struct Client me; /* That's me */
|
||||
client::client me; /* That's me */
|
||||
struct LocalUser meLocalUser; /* That's also part of me */
|
||||
|
||||
rb_dlink_list global_client_list;
|
||||
|
@ -83,12 +83,12 @@ const char *pidFileName = NULL;
|
|||
void
|
||||
ircd_shutdown(const char *reason)
|
||||
{
|
||||
struct Client *target_p;
|
||||
client::client *target_p;
|
||||
rb_dlink_node *ptr;
|
||||
|
||||
RB_DLINK_FOREACH(ptr, lclient_list.head)
|
||||
{
|
||||
target_p = (struct Client *)ptr->data;
|
||||
target_p = (client::client *)ptr->data;
|
||||
|
||||
sendto_one(target_p, ":%s NOTICE %s :Server Terminating. %s",
|
||||
me.name, target_p->name, reason);
|
||||
|
@ -96,7 +96,7 @@ ircd_shutdown(const char *reason)
|
|||
|
||||
RB_DLINK_FOREACH(ptr, serv_list.head)
|
||||
{
|
||||
target_p = (struct Client *)ptr->data;
|
||||
target_p = (client::client *)ptr->data;
|
||||
|
||||
sendto_one(target_p, ":%s ERROR :Terminated by %s",
|
||||
me.name, reason);
|
||||
|
@ -627,7 +627,7 @@ charybdis_main(int argc, char * const argv[])
|
|||
init_hash();
|
||||
clear_scache_hash_table(); /* server cache name table */
|
||||
init_host_hash();
|
||||
init_client();
|
||||
client::init();
|
||||
init_hook();
|
||||
chan::init();
|
||||
initclass();
|
||||
|
@ -674,7 +674,7 @@ charybdis_main(int argc, char * const argv[])
|
|||
return -2;
|
||||
}
|
||||
rb_strlcpy(me.id, ServerInfo.sid, sizeof(me.id));
|
||||
init_uid();
|
||||
client::init_uid();
|
||||
|
||||
/* serverinfo{} description must exist. If not, error out. */
|
||||
if(ServerInfo.description == NULL)
|
||||
|
@ -706,10 +706,10 @@ charybdis_main(int argc, char * const argv[])
|
|||
me.from = &me;
|
||||
me.servptr = &me;
|
||||
SetMe(&me);
|
||||
make_server(&me);
|
||||
make_serv(me);
|
||||
add_to_client_hash(me.name, &me);
|
||||
add_to_id_hash(me.id, &me);
|
||||
me.serv->nameinfo = scache_connect(me.name, me.info, 0);
|
||||
nameinfo(serv(me)) = scache_connect(me.name, me.info, 0);
|
||||
|
||||
rb_dlinkAddAlloc(&me, &global_serv_list);
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ static const struct in6_addr in6addr_any =
|
|||
static struct Listener *ListenerPollList = NULL;
|
||||
static int accept_precallback(rb_fde_t *F, struct sockaddr *addr, rb_socklen_t addrlen, void *data);
|
||||
static void accept_callback(rb_fde_t *F, int status, struct sockaddr *addr, rb_socklen_t addrlen, void *data);
|
||||
static SSL_OPEN_CB accept_sslcallback;
|
||||
static client::SSL_OPEN_CB accept_sslcallback;
|
||||
|
||||
static struct Listener *
|
||||
make_listener(struct rb_sockaddr_storage *addr)
|
||||
|
@ -112,7 +112,7 @@ get_listener_name(const struct Listener *listener)
|
|||
* side effects - show ports
|
||||
*/
|
||||
void
|
||||
show_ports(struct Client *source_p)
|
||||
show_ports(client::client *source_p)
|
||||
{
|
||||
struct Listener *listener = 0;
|
||||
|
||||
|
@ -430,7 +430,7 @@ close_listeners()
|
|||
static void
|
||||
add_connection(struct Listener *listener, rb_fde_t *F, struct sockaddr *sai, struct sockaddr *lai)
|
||||
{
|
||||
struct Client *new_client;
|
||||
client::client *new_client;
|
||||
bool defer = false;
|
||||
s_assert(NULL != listener);
|
||||
|
||||
|
@ -438,7 +438,7 @@ add_connection(struct Listener *listener, rb_fde_t *F, struct sockaddr *sai, str
|
|||
* get the client socket name from the socket
|
||||
* the client has already been checked out in accept_connection
|
||||
*/
|
||||
new_client = make_client(NULL);
|
||||
new_client = client::make_client(NULL);
|
||||
|
||||
if (listener->ssl)
|
||||
{
|
||||
|
@ -499,7 +499,7 @@ add_connection(struct Listener *listener, rb_fde_t *F, struct sockaddr *sai, str
|
|||
}
|
||||
|
||||
static int
|
||||
accept_sslcallback(struct Client *client_p, int status)
|
||||
accept_sslcallback(client::client *client_p, int status)
|
||||
{
|
||||
authd_deferred_client(client_p);
|
||||
return 0; /* use default handler if status != RB_OK */
|
||||
|
|
|
@ -262,7 +262,7 @@ ierror(const char *format, ...)
|
|||
}
|
||||
|
||||
void
|
||||
report_operspy(struct Client *source_p, const char *token, const char *arg)
|
||||
report_operspy(client::client *source_p, const char *token, const char *arg)
|
||||
{
|
||||
/* if its not my client its already propagated */
|
||||
if(MyClient(source_p))
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue