Merge pull request #101 from Elizafox/master

Relocate report_Klines to proper home
This commit is contained in:
William Pitcock 2015-08-08 18:41:32 -04:00
commit 00fda7b7bd
3 changed files with 37 additions and 37 deletions

View file

@ -58,7 +58,6 @@ struct ConfItem *find_dline(struct sockaddr *, int);
(struct sockaddr *)&(x)->localClient->ip, CONF_KILL,\
(x)->localClient->ip.ss_family, (x)->username, NULL))
void report_Klines(struct Client *);
void report_auth(struct Client *);
#ifdef RB_IPV6
int match_ipv6(struct sockaddr *, struct sockaddr *, int);

View file

@ -621,6 +621,43 @@ stats_tklines(struct Client *source_p)
}
}
/* report_Klines()
*
* inputs - Client to report to, mask
* outputs -
* side effects - Reports configured K-lines to client_p.
*/
static void
report_Klines(struct Client *source_p)
{
char *host, *pass, *user, *oper_reason;
struct AddressRec *arec;
struct ConfItem *aconf = NULL;
int i;
for (i = 0; i < ATABLE_SIZE; i++)
{
for (arec = atable[i]; arec; arec = arec->next)
{
if(arec->type == CONF_KILL)
{
aconf = arec->aconf;
/* its a tempkline, theyre reported elsewhere */
if(aconf->flags & CONF_FLAGS_TEMPORARY)
continue;
get_printable_kline(source_p, aconf, &host, &pass, &user, &oper_reason);
sendto_one_numeric(source_p, RPL_STATSKLINE,
form_str(RPL_STATSKLINE),
'K', host, user, pass,
oper_reason ? "|" : "",
oper_reason ? oper_reason : "");
}
}
}
}
static void
stats_klines(struct Client *source_p)
{

View file

@ -770,39 +770,3 @@ report_auth(struct Client *client_p)
}
}
/* report_Klines()
*
* inputs - Client to report to, mask
* outputs -
* side effects - Reports configured K-lines to client_p.
*/
void
report_Klines(struct Client *source_p)
{
char *host, *pass, *user, *oper_reason;
struct AddressRec *arec;
struct ConfItem *aconf = NULL;
int i;
for (i = 0; i < ATABLE_SIZE; i++)
{
for (arec = atable[i]; arec; arec = arec->next)
{
if(arec->type == CONF_KILL)
{
aconf = arec->aconf;
/* its a tempkline, theyre reported elsewhere */
if(aconf->flags & CONF_FLAGS_TEMPORARY)
continue;
get_printable_kline(source_p, aconf, &host, &pass, &user, &oper_reason);
sendto_one_numeric(source_p, RPL_STATSKLINE,
form_str(RPL_STATSKLINE),
'K', host, user, pass,
oper_reason ? "|" : "",
oper_reason ? oper_reason : "");
}
}
}
}