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 4576 by michael, Mon Aug 25 09:45:11 2014 UTC vs.
Revision 4588 by michael, Tue Aug 26 15:59:07 2014 UTC

# Line 266 | Line 266 | stats_usage(struct Client *source_p, int
266    if (secs == 0)
267      secs = 1;
268  
269 <  rup = (CurrentTime - me.localClient->since) * hzz;
269 >  rup = (CurrentTime - me.connection->since) * hzz;
270  
271    if (rup == 0)
272      rup = 1;
# Line 355 | Line 355 | stats_memory(struct Client *source_p, in
355      if (MyConnect(target_p))
356      {
357        ++local_client_count;
358 <      local_client_conf_count += dlink_list_length(&target_p->localClient->confs);
359 <      watch_list_entries += dlink_list_length(&target_p->localClient->watches);
358 >      local_client_conf_count += dlink_list_length(&target_p->connection->confs);
359 >      watch_list_entries += dlink_list_length(&target_p->connection->watches);
360      }
361      else
362        ++remote_client_count;
# Line 428 | Line 428 | stats_memory(struct Client *source_p, in
428      {
429        const struct Client *acptr = gptr->data;
430  
431 <      DLINK_FOREACH(dlink, acptr->localClient->list_task->show_mask.head)
431 >      DLINK_FOREACH(dlink, acptr->connection->list_task->show_mask.head)
432          safelist_memory += strlen(dlink->data);
433  
434 <      DLINK_FOREACH(dlink, acptr->localClient->list_task->hide_mask.head)
434 >      DLINK_FOREACH(dlink, acptr->connection->list_task->hide_mask.head)
435          safelist_memory += strlen(dlink->data);
436      }
437    }
# Line 908 | Line 908 | stats_auth(struct Client *source_p, int
908  
909      if (MyConnect(source_p))
910        conf = find_conf_by_address(source_p->host,
911 <                                  &source_p->localClient->ip, CONF_CLIENT,
912 <                                  source_p->localClient->aftype,
911 >                                  &source_p->connection->ip, CONF_CLIENT,
912 >                                  source_p->connection->aftype,
913                                    source_p->username,
914 <                                  source_p->localClient->password, 1);
914 >                                  source_p->connection->password, 1);
915      else
916        conf = find_conf_by_address(source_p->host, NULL, CONF_CLIENT, 0,
917                                    source_p->username, NULL, 1);
# Line 982 | Line 982 | stats_tklines(struct Client *source_p, i
982  
983      if (MyConnect(source_p))
984        conf = find_conf_by_address(source_p->host,
985 <                                  &source_p->localClient->ip, CONF_KLINE,
986 <                                  source_p->localClient->aftype,
985 >                                  &source_p->connection->ip, CONF_KLINE,
986 >                                  source_p->connection->aftype,
987                                    source_p->username, NULL, 1);
988      else
989        conf = find_conf_by_address(source_p->host, NULL, CONF_KLINE, 0,
# Line 1018 | Line 1018 | stats_klines(struct Client *source_p, in
1018      /* Search for a kline */
1019      if (MyConnect(source_p))
1020        conf = find_conf_by_address(source_p->host,
1021 <                                  &source_p->localClient->ip, CONF_KLINE,
1022 <                                  source_p->localClient->aftype,
1021 >                                  &source_p->connection->ip, CONF_KLINE,
1022 >                                  source_p->connection->aftype,
1023                                    source_p->username, NULL, 0);
1024      else
1025        conf = find_conf_by_address(source_p->host, NULL, CONF_KLINE, 0,
# Line 1083 | Line 1083 | stats_operedup(struct Client *source_p,
1083        sendto_one_numeric(source_p, &me, RPL_STATSDEBUG|SND_EXPLICIT,
1084                           "p :[%c][%s] %s (%s@%s) Idle: %s",
1085                           HasUMode(target_p, UMODE_ADMIN) ? 'A' : 'O',
1086 <                         oper_privs_as_string(target_p->localClient->operflags),
1086 >                         oper_privs_as_string(target_p->connection->operflags),
1087                           target_p->name, target_p->username, target_p->host, buf);
1088      else
1089        sendto_one_numeric(source_p, &me, RPL_STATSDEBUG|SND_EXPLICIT,
# Line 1139 | Line 1139 | stats_tstats(struct Client *source_p, in
1139    {
1140      target_p = ptr->data;
1141  
1142 <    sp->is_sbs += target_p->localClient->send.bytes;
1143 <    sp->is_sbr += target_p->localClient->recv.bytes;
1144 <    sp->is_sti += CurrentTime - target_p->localClient->firsttime;
1142 >    sp->is_sbs += target_p->connection->send.bytes;
1143 >    sp->is_sbr += target_p->connection->recv.bytes;
1144 >    sp->is_sti += CurrentTime - target_p->connection->firsttime;
1145    }
1146  
1147    sp->is_cl += dlink_list_length(&local_client_list);
# Line 1150 | Line 1150 | stats_tstats(struct Client *source_p, in
1150    {
1151      target_p = ptr->data;
1152  
1153 <    sp->is_cbs += target_p->localClient->send.bytes;
1154 <    sp->is_cbr += target_p->localClient->recv.bytes;
1155 <    sp->is_cti += CurrentTime - target_p->localClient->firsttime;
1153 >    sp->is_cbs += target_p->connection->send.bytes;
1154 >    sp->is_cbr += target_p->connection->recv.bytes;
1155 >    sp->is_cti += CurrentTime - target_p->connection->firsttime;
1156    }
1157  
1158    sp->is_ni += dlink_list_length(&unknown_list);
# Line 1200 | Line 1200 | stats_uptime(struct Client *source_p, in
1200      sendto_one_numeric(source_p, &me, ERR_NOPRIVILEGES);
1201    else
1202    {
1203 <    time_t now = CurrentTime - me.localClient->since;
1203 >    time_t now = CurrentTime - me.connection->since;
1204  
1205      sendto_one_numeric(source_p, &me, RPL_STATSUPTIME, now / 86400,
1206                         (now / 3600) % 24, (now / 60) % 60, now % 60);
# Line 1236 | Line 1236 | stats_servers(struct Client *source_p, i
1236                         "v :%s (%s!%s@%s) Idle: %d",
1237                         target_p->name,
1238                         (target_p->serv->by[0] ? target_p->serv->by : "Remote."),
1239 <                       "*", "*", (int)(CurrentTime - target_p->localClient->lasttime));
1239 >                       "*", "*", (int)(CurrentTime - target_p->connection->lasttime));
1240    }
1241  
1242    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG|SND_EXPLICIT,
# Line 1292 | Line 1292 | stats_servlinks(struct Client *source_p,
1292        if (!HasUMode(source_p, UMODE_OPER))
1293          continue;
1294  
1295 <    sendB += target_p->localClient->send.bytes;
1296 <    recvB += target_p->localClient->recv.bytes;
1295 >    sendB += target_p->connection->send.bytes;
1296 >    recvB += target_p->connection->recv.bytes;
1297  
1298      /* ":%s 211 %s %s %u %u %llu %u %llu :%u %u %s" */
1299      sendto_one_numeric(source_p, &me, RPL_STATSLINKINFO,
1300                 get_client_name(target_p, HasUMode(source_p, UMODE_ADMIN) ? SHOW_IP : MASK_IP),
1301 <               dbuf_length(&target_p->localClient->buf_sendq),
1302 <               target_p->localClient->send.messages,
1303 <               target_p->localClient->send.bytes >> 10,
1304 <               target_p->localClient->recv.messages,
1305 <               target_p->localClient->recv.bytes >> 10,
1306 <               (unsigned)(CurrentTime - target_p->localClient->firsttime),
1307 <               (CurrentTime > target_p->localClient->since) ? (unsigned)(CurrentTime - target_p->localClient->since) : 0,
1301 >               dbuf_length(&target_p->connection->buf_sendq),
1302 >               target_p->connection->send.messages,
1303 >               target_p->connection->send.bytes >> 10,
1304 >               target_p->connection->recv.messages,
1305 >               target_p->connection->recv.bytes >> 10,
1306 >               (unsigned)(CurrentTime - target_p->connection->firsttime),
1307 >               (CurrentTime > target_p->connection->since) ? (unsigned)(CurrentTime - target_p->connection->since) : 0,
1308                 HasUMode(source_p, UMODE_OPER) ? show_capabilities(target_p) : "TS");
1309    }
1310  
# Line 1318 | Line 1318 | stats_servlinks(struct Client *source_p,
1318    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG|SND_EXPLICIT, "? :Recv total: %7.2f %s",
1319                       _GMKv(recvB), _GMKs(recvB));
1320  
1321 <  uptime = (CurrentTime - me.localClient->since);
1321 >  uptime = (CurrentTime - me.connection->since);
1322  
1323    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG|SND_EXPLICIT,
1324                       "? :Server send: %7.2f %s (%4.1f K/s)",
1325 <                     _GMKv((me.localClient->send.bytes>>10)),
1326 <                     _GMKs((me.localClient->send.bytes>>10)),
1327 <                     (float)((float)((me.localClient->send.bytes) >> 10) /
1325 >                     _GMKv((me.connection->send.bytes>>10)),
1326 >                     _GMKs((me.connection->send.bytes>>10)),
1327 >                     (float)((float)((me.connection->send.bytes) >> 10) /
1328                       (float)uptime));
1329    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG|SND_EXPLICIT,
1330                       "? :Server recv: %7.2f %s (%4.1f K/s)",
1331 <                     _GMKv((me.localClient->recv.bytes>>10)),
1332 <                     _GMKs((me.localClient->recv.bytes>>10)),
1333 <                     (float)((float)((me.localClient->recv.bytes) >> 10) /
1331 >                     _GMKv((me.connection->recv.bytes>>10)),
1332 >                     _GMKs((me.connection->recv.bytes>>10)),
1333 >                     (float)((float)((me.connection->recv.bytes) >> 10) /
1334                       (float)uptime));
1335   }
1336  
# Line 1405 | Line 1405 | stats_L_list(struct Client *source_p, ch
1405                   (IsUpper(statchar)) ?
1406                   get_client_name(target_p, SHOW_IP) :
1407                   get_client_name(target_p, HIDE_IP),
1408 <                 dbuf_length(&target_p->localClient->buf_sendq),
1409 <                 target_p->localClient->send.messages,
1410 <                 target_p->localClient->send.bytes>>10,
1411 <                 target_p->localClient->recv.messages,
1412 <                 target_p->localClient->recv.bytes>>10,
1413 <                 (unsigned)(CurrentTime - target_p->localClient->firsttime),
1414 <                 (CurrentTime > target_p->localClient->since) ? (unsigned)(CurrentTime - target_p->localClient->since) : 0,
1408 >                 dbuf_length(&target_p->connection->buf_sendq),
1409 >                 target_p->connection->send.messages,
1410 >                 target_p->connection->send.bytes>>10,
1411 >                 target_p->connection->recv.messages,
1412 >                 target_p->connection->recv.bytes>>10,
1413 >                 (unsigned)(CurrentTime - target_p->connection->firsttime),
1414 >                 (CurrentTime > target_p->connection->since) ? (unsigned)(CurrentTime - target_p->connection->since) : 0,
1415                   IsServer(target_p) ? show_capabilities(target_p) : "-");
1416      }
1417      else
# Line 1421 | Line 1421 | stats_L_list(struct Client *source_p, ch
1421            IsHandshake(target_p) || IsConnecting(target_p))
1422          sendto_one_numeric(source_p, &me, RPL_STATSLINKINFO,
1423                     get_client_name(target_p, MASK_IP),
1424 <                   dbuf_length(&target_p->localClient->buf_sendq),
1425 <                   target_p->localClient->send.messages,
1426 <                   target_p->localClient->send.bytes>>10,
1427 <                   target_p->localClient->recv.messages,
1428 <                   target_p->localClient->recv.bytes>>10,
1429 <                   (unsigned)(CurrentTime - target_p->localClient->firsttime),
1430 <                   (CurrentTime > target_p->localClient->since) ? (unsigned)(CurrentTime - target_p->localClient->since):0,
1424 >                   dbuf_length(&target_p->connection->buf_sendq),
1425 >                   target_p->connection->send.messages,
1426 >                   target_p->connection->send.bytes>>10,
1427 >                   target_p->connection->recv.messages,
1428 >                   target_p->connection->recv.bytes>>10,
1429 >                   (unsigned)(CurrentTime - target_p->connection->firsttime),
1430 >                   (CurrentTime > target_p->connection->since) ? (unsigned)(CurrentTime - target_p->connection->since):0,
1431                     IsServer(target_p) ? show_capabilities(target_p) : "-");
1432        else /* show the real IP */
1433          sendto_one_numeric(source_p, &me, RPL_STATSLINKINFO,
1434                     (IsUpper(statchar)) ?
1435                     get_client_name(target_p, SHOW_IP) :
1436                     get_client_name(target_p, HIDE_IP),
1437 <                   dbuf_length(&target_p->localClient->buf_sendq),
1438 <                   target_p->localClient->send.messages,
1439 <                   target_p->localClient->send.bytes>>10,
1440 <                   target_p->localClient->recv.messages,
1441 <                   target_p->localClient->recv.bytes>>10,
1442 <                   (unsigned)(CurrentTime - target_p->localClient->firsttime),
1443 <                   (CurrentTime > target_p->localClient->since) ? (unsigned)(CurrentTime - target_p->localClient->since):0,
1437 >                   dbuf_length(&target_p->connection->buf_sendq),
1438 >                   target_p->connection->send.messages,
1439 >                   target_p->connection->send.bytes>>10,
1440 >                   target_p->connection->recv.messages,
1441 >                   target_p->connection->recv.bytes>>10,
1442 >                   (unsigned)(CurrentTime - target_p->connection->firsttime),
1443 >                   (CurrentTime > target_p->connection->since) ? (unsigned)(CurrentTime - target_p->connection->since):0,
1444                     IsServer(target_p) ? show_capabilities(target_p) : "-");
1445      }
1446    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines