ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/modules/m_stats.c
(Generate patch)

Comparing ircd-hybrid/trunk/modules/m_stats.c (file contents):
Revision 7467 by michael, Sat Mar 12 14:16:55 2016 UTC vs.
Revision 7471 by michael, Sun Mar 13 11:51:03 2016 UTC

# Line 276 | Line 276 | stats_memory(struct Client *source_p, in
276    unsigned int channel_invex = 0;
277  
278    unsigned int wwu = 0;                  /* whowas users */
279  unsigned int class_count = 0;          /* classes */
279    unsigned int aways_counted = 0;
280    unsigned int number_ips_stored = 0;        /* number of ip addresses hashed */
281  
# Line 353 | Line 352 | stats_memory(struct Client *source_p, in
352      channel_invex_memory += dlink_list_length(&chptr->invexlist) * sizeof(struct Ban);
353    }
354  
355 <  if ((safelist_count = dlink_list_length(&listing_client_list)))
355 >  safelist_count = dlink_list_length(&listing_client_list);
356 >  if (safelist_count)
357    {
358      safelist_memory = safelist_count * sizeof(struct ListTask);
359  
# Line 401 | Line 401 | stats_memory(struct Client *source_p, in
401                       "z :Listeners %u(%zu)",
402                       listener_count, listener_memory);
403  
404  class_count = dlink_list_length(class_get_list());
404    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
405                       "z :Classes %u(%zu)",
406 <                     class_count, class_count * sizeof(struct ClassItem));
406 >                     dlink_list_length(class_get_list()),
407 >                     dlink_list_length(class_get_list()) * sizeof(struct ClassItem));
408  
409    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
410                       "z :Channels %u(%zu) Topics %u",
# Line 439 | Line 439 | stats_memory(struct Client *source_p, in
439                       "z :Whowas users %u(%zu)", wwu, wwm);
440  
441    motd_memory_count(source_p);
442 +
443    ipcache_get_stats(&number_ips_stored, &mem_ips_stored);
444    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
445                       "z :iphash %u(%zu)",
446                       number_ips_stored, mem_ips_stored);
447  
448 <  local_client_memory_used = local_client_count*(sizeof(struct Client) + sizeof(struct Connection));
448 >  local_client_memory_used = local_client_count *(sizeof(struct Client) + sizeof(struct Connection));
449    total_memory += local_client_memory_used;
450    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
451                       "z :Local client Memory in use: %u(%zu)",
# Line 480 | Line 481 | stats_dns_servers(struct Client *source_
481   static void
482   stats_deny(struct Client *source_p, int parc, char *parv[])
483   {
483  const struct MaskItem *conf = NULL;
484    const dlink_node *node = NULL;
485  
486    for (unsigned int i = 0; i < ATABLE_SIZE; ++i)
# Line 492 | Line 492 | stats_deny(struct Client *source_p, int
492        if (arec->type != CONF_DLINE)
493          continue;
494  
495 <      conf = arec->conf;
496 <
495 >      const struct MaskItem *conf = arec->conf;
496        /* Don't report a temporary dline as permanent dline */
497        if (conf->until)
498          continue;
# Line 512 | Line 511 | stats_deny(struct Client *source_p, int
511   static void
512   stats_tdeny(struct Client *source_p, int parc, char *parv[])
513   {
515  const struct MaskItem *conf = NULL;
514    const dlink_node *node = NULL;
515  
516    for (unsigned int i = 0; i < ATABLE_SIZE; ++i)
# Line 524 | Line 522 | stats_tdeny(struct Client *source_p, int
522        if (arec->type != CONF_DLINE)
523          continue;
524  
525 <      conf = arec->conf;
528 <
525 >      const struct MaskItem *conf = arec->conf;
526        /* Don't report a permanent dline as temporary dline */
527        if (!conf->until)
528          continue;
# Line 544 | Line 541 | stats_tdeny(struct Client *source_p, int
541   static void
542   stats_exempt(struct Client *source_p, int parc, char *parv[])
543   {
547  const struct MaskItem *conf = NULL;
544    const dlink_node *node = NULL;
545  
546    if (ConfigGeneral.stats_e_disabled)
# Line 562 | Line 558 | stats_exempt(struct Client *source_p, in
558        if (arec->type != CONF_EXEMPT)
559          continue;
560  
561 <      conf = arec->conf;
561 >      const struct MaskItem *conf = arec->conf;
562        sendto_one_numeric(source_p, &me, RPL_STATSDLINE, 'e', conf->host, "");
563      }
564    }
# Line 656 | Line 652 | show_iline_prefix(const struct Client *s
652   static void
653   report_auth(struct Client *source_p, int parc, char *parv[])
654   {
659  const struct MaskItem *conf = NULL;
655    const dlink_node *node = NULL;
656  
657    for (unsigned int i = 0; i < ATABLE_SIZE; ++i)
# Line 668 | Line 663 | report_auth(struct Client *source_p, int
663        if (arec->type != CONF_CLIENT)
664          continue;
665  
666 <      conf = arec->conf;
672 <
666 >      const struct MaskItem *conf = arec->conf;
667        if (!HasUMode(source_p, UMODE_OPER) && IsConfDoSpoofIp(conf))
668          continue;
669  
# Line 704 | Line 698 | stats_auth(struct Client *source_p, int
698        conf = find_conf_by_address(source_p->host, NULL, CONF_CLIENT, 0,
699                                    source_p->username, NULL, 1);
700  
701 <    if (conf == NULL)
701 >    if (!conf)
702        return;
703  
704      sendto_one_numeric(source_p, &me, RPL_STATSILINE,
# Line 726 | Line 720 | stats_auth(struct Client *source_p, int
720   static void
721   report_Klines(struct Client *source_p, int tkline)
722   {
729  const struct MaskItem *conf = NULL;
723    const dlink_node *node = NULL;
724    char c = '\0';
725  
# Line 744 | Line 737 | report_Klines(struct Client *source_p, i
737        if (arec->type != CONF_KLINE)
738          continue;
739  
740 <      conf = arec->conf;
748 <
740 >      const struct MaskItem *conf = arec->conf;
741        if ((!tkline && conf->until) ||
742            (tkline && !conf->until))
743          continue;
# Line 888 | Line 880 | stats_operedup(struct Client *source_p,
880   static void
881   show_ports(struct Client *source_p)
882   {
883 <  char buf[IRCD_BUFSIZE] = "";
892 <  char *p = NULL;
883 >  char buf[8] = "";
884    const dlink_node *node = NULL;
885  
886    DLINK_FOREACH(node, listener_get_list()->head)
887    {
888      const struct Listener *listener = node->data;
889 <    p = buf;
889 >    char *p = buf;
890  
891      if (listener->flags & LISTENER_HIDDEN)
892      {
# Line 910 | Line 901 | show_ports(struct Client *source_p)
901        *p++ = 's';
902      *p = '\0';
903  
913
904      if (HasUMode(source_p, UMODE_ADMIN) &&
905          (MyConnect(source_p) || !ConfigServerHide.hide_server_ips))
906        sendto_one_numeric(source_p, &me, RPL_STATSPLINE, 'P', listener->port,
# Line 998 | Line 988 | stats_tstats(struct Client *source_p, in
988                       "t :bytes sent %ju %ju",
989                       sp->is_cbs, sp->is_sbs);
990    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
991 <                     "t :bytes recv %ju %ju",
991 >                     "t :bytes received %ju %ju",
992                       sp->is_cbr, sp->is_sbr);
993    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
994                       "t :time connected %ju %ju",
# Line 1057 | Line 1047 | stats_servers(struct Client *source_p, i
1047   static void
1048   stats_class(struct Client *source_p, int parc, char *parv[])
1049   {
1050 <  const dlink_node *node = NULL;
1050 >  dlink_node *node = NULL;
1051  
1052    DLINK_FOREACH(node, class_get_list()->head)
1053    {
# Line 1078 | Line 1068 | stats_class(struct Client *source_p, int
1068   static void
1069   stats_servlinks(struct Client *source_p, int parc, char *parv[])
1070   {
1071 +  dlink_node *node;
1072    uintmax_t sendB = 0, recvB = 0;
1073    uintmax_t uptime = 0;
1083  dlink_node *node = NULL;
1074  
1075    if (ConfigServerHide.flatten_links && !HasUMode(source_p, UMODE_OPER))
1076    {
# Line 1090 | Line 1080 | stats_servlinks(struct Client *source_p,
1080  
1081    DLINK_FOREACH(node, local_server_list.head)
1082    {
1083 <    struct Client *target_p = node->data;
1083 >    const struct Client *target_p = node->data;
1084  
1085      if (HasFlag(target_p, FLAGS_SERVICE) && ConfigServerHide.hide_services)
1086        if (!HasUMode(source_p, UMODE_OPER))
# Line 1173 | Line 1163 | static void
1163   stats_L_list(struct Client *source_p, const char *name, int doall, int wilds,
1164               dlink_list *list, const char statchar)
1165   {
1166 <  dlink_node *node = NULL;
1166 >  dlink_node *node;
1167  
1168    /*
1169     * Send info about connections which match, or all if the
# Line 1183 | Line 1173 | stats_L_list(struct Client *source_p, co
1173     */
1174    DLINK_FOREACH(node, list->head)
1175    {
1176 <    struct Client *target_p = node->data;
1176 >    const struct Client *target_p = node->data;
1177  
1178      if (HasUMode(target_p, UMODE_INVISIBLE) && (doall || wilds) &&
1179          !(MyConnect(source_p) && HasUMode(source_p, UMODE_OPER)) &&

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines