#include "hash.h"
#include "reject.h"
#include "whowas.h"
+#include "irc_radixtree.h"
static int m_stats (struct Client *, struct Client *, int, const char **);
}
}
+static void
+stats_hash_cb(const char *buf, void *client_p)
+{
+ sendto_one_numeric(client_p, RPL_STATSDEBUG, "B :%s", buf);
+}
+
static void
stats_hash(struct Client *source_p)
{
- hash_stats(source_p);
+ sendto_one_numeric(source_p, RPL_STATSDEBUG, "B :%-30s %-15s %-10s %-10s %-10s %-10s",
+ "NAME", "TYPE", "OBJECTS", "DEPTH SUM", "AVG DEPTH", "MAX DEPTH");
+
+ irc_dictionary_stats_walk(stats_hash_cb, source_p);
+ irc_radixtree_stats_walk(stats_hash_cb, source_p);
}
static void
}
}
+/* 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)
{
stats_tresv(struct Client *source_p)
{
struct ConfItem *aconf;
+ struct irc_radixtree_iteration_state state;
rb_dlink_node *ptr;
int i;
'q', aconf->port, aconf->host, aconf->passwd);
}
- HASH_WALK(i, R_MAX, ptr, resvTable)
+ IRC_RADIXTREE_FOREACH(aconf, &state, resv_tree)
{
- aconf = ptr->data;
if(aconf->hold)
sendto_one_numeric(source_p, RPL_STATSQLINE,
form_str(RPL_STATSQLINE),
'q', aconf->port, aconf->host, aconf->passwd);
}
- HASH_WALK_END
}
stats_resv(struct Client *source_p)
{
struct ConfItem *aconf;
+ struct irc_radixtree_iteration_state state;
rb_dlink_node *ptr;
int i;
'Q', aconf->port, aconf->host, aconf->passwd);
}
- HASH_WALK(i, R_MAX, ptr, resvTable)
+ IRC_RADIXTREE_FOREACH(aconf, &state, resv_tree)
{
- aconf = ptr->data;
if(!aconf->hold)
sendto_one_numeric(source_p, RPL_STATSQLINE,
form_str(RPL_STATSQLINE),
'Q', aconf->port, aconf->host, aconf->passwd);
}
- HASH_WALK_END
}
static void
{ SHARED_TDLINE, 'd' },
{ SHARED_PDLINE, 'D' },
{ SHARED_UNDLINE, 'E' },
+ { SHARED_GRANT, 'G' },
{ 0, '\0'}
};