extern struct ServerStatistics ServerStats;
-extern void init_stats(void);
-extern void tstats(struct Client *client);
-
extern void count_memory(struct Client *);
#endif /* INCLUDED_s_stats_h */
(int) rus.ru_nivcsw);
}
-static void
-stats_tstats (struct Client *source_p)
-{
- tstats (source_p);
+static void\r
+stats_tstats(struct Client *source_p)\r
+{\r
+ struct Client *target_p;\r
+ struct ServerStatistics sp;\r
+ rb_dlink_node *ptr;\r
+\r
+ memcpy(&sp, &ServerStats, sizeof(struct ServerStatistics));\r
+\r
+ RB_DLINK_FOREACH(ptr, serv_list.head)\r
+ {\r
+ target_p = ptr->data;\r
+\r
+ sp.is_sbs += target_p->localClient->sendB;\r
+ sp.is_sbr += target_p->localClient->receiveB;\r
+ sp.is_sti += rb_current_time() - target_p->localClient->firsttime;\r
+ sp.is_sv++;\r
+ }\r
+\r
+ RB_DLINK_FOREACH(ptr, lclient_list.head)\r
+ {\r
+ target_p = ptr->data;\r
+\r
+ sp.is_cbs += target_p->localClient->sendB;\r
+ sp.is_cbr += target_p->localClient->receiveB;\r
+ sp.is_cti += rb_current_time() - target_p->localClient->firsttime;\r
+ sp.is_cl++;\r
+ }\r
+\r
+ sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+ "T :accepts %u refused %u", \r
+ sp.is_ac, sp.is_ref);\r
+ sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+ "T :rejected %u delaying %lu", \r
+ sp.is_rej, delay_exit_length());\r
+ sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+ "T :nicks being delayed %lu", get_nd_count());\r
+ sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+ "T :unknown commands %u prefixes %u",\r
+ sp.is_unco, sp.is_unpf);\r
+ sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+ "T :nick collisions %u saves %u unknown closes %u",\r
+ sp.is_kill, sp.is_save, sp.is_ni);\r
+ sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+ "T :wrong direction %u empty %u", \r
+ sp.is_wrdi, sp.is_empt);\r
+ sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+ "T :numerics seen %u", \r
+ sp.is_num);\r
+ sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+ "T :auth successes %u fails %u",\r
+ sp.is_asuc, sp.is_abad);\r
+ sendto_one_numeric(source_p, RPL_STATSDEBUG, "T :Client Server");\r
+ sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+ "T :connected %u %u",\r
+ sp.is_cl, sp.is_sv);\r
+ sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+ "T :bytes sent %lluK %lluK",\r
+ sp.is_cbs / 1024, \r
+ sp.is_sbs / 1024);\r
+ sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+ "T :bytes recv %lluK %lluK",\r
+ sp.is_cbr / 1024, \r
+ sp.is_sbr / 1024);\r
+ sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+ "T :time connected %lu %lu",\r
+ sp.is_cti, sp.is_sti);\r
}
static void
init_channels();
initclass();
initwhowas();
- init_stats();
init_reject();
init_cache();
init_monitor();
*/
struct ServerStatistics ServerStats;
-void
-init_stats()
-{
- /* XXX nothing to do - was ServerStats init -- dwr */
-}
-
-/*
- * tstats
- *
- * inputs - client to report to
- * output - NONE
- * side effects -
- */
-void\r
-tstats(struct Client *source_p)\r
-{\r
- struct Client *target_p;\r
- struct ServerStatistics sp;\r
- rb_dlink_node *ptr;\r
-\r
- memcpy(&sp, &ServerStats, sizeof(struct ServerStatistics));\r
-\r
- RB_DLINK_FOREACH(ptr, serv_list.head)\r
- {\r
- target_p = ptr->data;\r
-\r
- sp.is_sbs += target_p->localClient->sendB;\r
- sp.is_sbr += target_p->localClient->receiveB;\r
- sp.is_sti += rb_current_time() - target_p->localClient->firsttime;\r
- sp.is_sv++;\r
- }\r
-\r
- RB_DLINK_FOREACH(ptr, lclient_list.head)\r
- {\r
- target_p = ptr->data;\r
-\r
- sp.is_cbs += target_p->localClient->sendB;\r
- sp.is_cbr += target_p->localClient->receiveB;\r
- sp.is_cti += rb_current_time() - target_p->localClient->firsttime;\r
- sp.is_cl++;\r
- }\r
-\r
- sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
- "T :accepts %u refused %u", \r
- sp.is_ac, sp.is_ref);\r
- sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
- "T :rejected %u delaying %lu", \r
- sp.is_rej, delay_exit_length());\r
- sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
- "T :nicks being delayed %lu", get_nd_count());\r
- sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
- "T :unknown commands %u prefixes %u",\r
- sp.is_unco, sp.is_unpf);\r
- sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
- "T :nick collisions %u saves %u unknown closes %u",\r
- sp.is_kill, sp.is_save, sp.is_ni);\r
- sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
- "T :wrong direction %u empty %u", \r
- sp.is_wrdi, sp.is_empt);\r
- sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
- "T :numerics seen %u", \r
- sp.is_num);\r
- sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
- "T :auth successes %u fails %u",\r
- sp.is_asuc, sp.is_abad);\r
- sendto_one_numeric(source_p, RPL_STATSDEBUG, "T :Client Server");\r
- sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
- "T :connected %u %u",\r
- sp.is_cl, sp.is_sv);\r
- sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
- "T :bytes sent %lluK %lluK",\r
- sp.is_cbs / 1024, \r
- sp.is_sbs / 1024);\r
- sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
- "T :bytes recv %lluK %lluK",\r
- sp.is_cbr / 1024, \r
- sp.is_sbr / 1024);\r
- sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
- "T :time connected %lu %lu",\r
- sp.is_cti, sp.is_sti);\r
-}
-
void
count_memory(struct Client *source_p)
{