#include <stdlib.h>
#include <sys/time.h>
-/*
- * m_stats/stats_conf
- *
- * Report N/C-configuration lines from this server. This could
- * report other configuration lines too, but converting the
- * status back to "char" is a bit akward--not worth the code
- * it needs...
- *
- * Note: The info is reported in the order the server uses
- * it--not reversed as in ircd.conf!
- */
-
-static unsigned int report_array[17][3] = {
- {CONF_SERVER, RPL_STATSCLINE, 'C'},
- {CONF_CLIENT, RPL_STATSILINE, 'I'},
- {CONF_KILL, RPL_STATSKLINE, 'K'},
- {CONF_IPKILL, RPL_STATSKLINE, 'k'},
- {CONF_LEAF, RPL_STATSLLINE, 'L'},
- {CONF_OPERATOR, RPL_STATSOLINE, 'O'},
- {CONF_HUB, RPL_STATSHLINE, 'H'},
- {CONF_LOCOP, RPL_STATSOLINE, 'o'},
- {CONF_CRULEALL, RPL_STATSDLINE, 'D'},
- {CONF_CRULEAUTO, RPL_STATSDLINE, 'd'},
- {CONF_UWORLD, RPL_STATSULINE, 'U'},
- {CONF_TLINES, RPL_STATSTLINE, 'T'},
- {0, 0}
-};
-
-void report_configured_links(struct Client *sptr, int mask)
-{
- static char null[] = "<NULL>";
- struct ConfItem *tmp;
- unsigned int *p;
- unsigned short int port;
- char c, *host, *pass, *name;
-
- for (tmp = GlobalConfList; tmp; tmp = tmp->next) {
- if ((tmp->status & mask))
- {
- for (p = &report_array[0][0]; *p; p += 3)
- if (*p == tmp->status)
- break;
- if (!*p)
- continue;
- c = (char)*(p + 2);
- host = BadPtr(tmp->host) ? null : tmp->host;
- pass = BadPtr(tmp->passwd) ? null : tmp->passwd;
- name = BadPtr(tmp->name) ? null : tmp->name;
- port = tmp->port;
- /*
- * On K line the passwd contents can be
- * displayed on STATS reply. -Vesa
- */
- /* Special-case 'k' or 'K' lines as appropriate... -Kev */
- if ((tmp->status & CONF_KLINE))
- sendto_one(sptr, rpl_str(p[1]), me.name,
- sptr->name, c, host, pass, name, port, get_conf_class(tmp));
- /*
- * connect rules are classless
- */
- else if ((tmp->status & CONF_CRULE))
- sendto_one(sptr, rpl_str(p[1]), me.name, sptr->name, c, host, name);
- else if ((tmp->status & CONF_TLINES))
- sendto_one(sptr, rpl_str(p[1]), me.name, sptr->name, c, host, pass);
- else if ((tmp->status & CONF_UWORLD))
- sendto_one(sptr, rpl_str(p[1]),
- me.name, sptr->name, c, host, pass, name, port,
- get_conf_class(tmp));
- else if ((tmp->status & (CONF_SERVER | CONF_HUB)))
- sendto_one(sptr, rpl_str(p[1]), me.name, sptr->name, c, "*", name,
- port, get_conf_class(tmp));
- else
- sendto_one(sptr, rpl_str(p[1]), me.name, sptr->name, c, host, name,
- port, get_conf_class(tmp));
- }
- }
-}
-
char *militime(char* sec, char* usec)
{
struct timeval tv;