stats.h File Reference


Detailed Description

Provides some statistics.

Definition in file stats.h.

#include <list>
#include <string>

Include dependency graph for stats.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void stats_botnet_auth_error ()
 Should be called when failed authentication with another bot on BOTNET.
void stats_botnet_auth_ok ()
 Should be called when successful authentication with another bot on BOTNET.
void stats_botnet_auth_proto_error ()
 Should be called when protocol error occured with another bot on BOTNET.
void stats_botnet_bytes_received (size_t bytes)
 Should be called when bytes were received from BOTNET.
void stats_botnet_bytes_sent (size_t bytes)
 Should be called when bytes were sent to BOTNET.
void stats_botnet_chandef_pulled ()
 Should be called when a channel definition was pulled (BOTNET).
void stats_botnet_chandef_pushed ()
 Should be called when a channel definition was pushed (BOTNET).
void stats_botnet_new_connection ()
 Should be called when new BOTNET connection was established.
void stats_botnet_partyline_event ()
 Should be called on a partyline event occured (BOTNET).
void stats_botnet_private_pulled ()
 Should be called when a private definition was pulled (BOTNET).
void stats_botnet_private_pushed ()
 Should be called when a private definition was pushed (BOTNET).
void stats_botnet_proc_pulled ()
 Should be called when a procedure was pulled (BOTNET).
void stats_botnet_proc_pushed ()
 Should be called when a procedure was pushed (BOTNET).
void stats_botnet_user_pulled ()
 Should be called when an user was pushed (BOTNET).
void stats_botnet_user_pushed ()
 Should be called when an user was pushed (BOTNET).
void stats_dcc_chat_bytes_received (size_t bytes)
 Should be called when bytes were received from DCC CHAT connection.
void stats_dcc_chat_bytes_sent (size_t bytes)
 Should be called when bytes were sent to DCC CHAT connection.
void stats_dcc_chat_new_connection ()
 Should be called when new DCC CHAT connection was established.
void stats_dcc_send_bytes_received (size_t bytes)
 Should be called when bytes were received from DCC SEND connection.
void stats_dcc_send_bytes_sent (size_t bytes)
 Should be called when bytes were sent to DCC SEND connection.
void stats_dcc_send_new_connection ()
 Should be called when new DCC SEND connection was established.
void stats_display (list< string > &lines, string lang)
 Puts statistics to an array.
void stats_identd_bytes_received (size_t bytes)
 Should be called when bytes were received from IDENTD request.
void stats_identd_bytes_sent (size_t bytes)
 Should be called when bytes were sent to IDENTD request.
void stats_identd_new_connection ()
 Should be called when new IDENTD connection was establish.
void stats_init ()
 Initializes statistics module.
void stats_irc_bytes_received (size_t bytes)
 Should be called when bytes were received from IRC server.
void stats_irc_bytes_sent (size_t bytes)
 Should be called when bytes were sent to IRC server.
void stats_irc_new_connection (string irc_server_host, unsigned short irc_server_port)
 Should be called when new connection to IRC server was established.
void stats_mail_sent ()
 Should be called when an e-mail was sent.


Function Documentation

void stats_botnet_auth_error  ) 
 

Should be called when failed authentication with another bot on BOTNET.

Author:
VooDooMan
Version:
1
Date:
2004

Definition at line 478 of file stats.cpp.

References s_stats::botnet_auth_error.

Referenced by botnet_loop().

00479 {
00480     stats.botnet_auth_error++;
00481 }

void stats_botnet_auth_ok  ) 
 

Should be called when successful authentication with another bot on BOTNET.

Author:
VooDooMan
Version:
1
Date:
2004

Definition at line 467 of file stats.cpp.

References s_stats::botnet_auth_ok.

Referenced by botnet_loop().

00468 {
00469     stats.botnet_auth_ok++;
00470 }

void stats_botnet_auth_proto_error  ) 
 

Should be called when protocol error occured with another bot on BOTNET.

Author:
VooDooMan
Version:
1
Date:
2004

Definition at line 489 of file stats.cpp.

References s_stats::botnet_auth_proto_error.

Referenced by botnet_loop().

00490 {
00491     stats.botnet_auth_proto_error++;
00492 }

void stats_botnet_bytes_received size_t  bytes  ) 
 

Should be called when bytes were received from BOTNET.

Author:
VooDooMan
Version:
1
Date:
2004
Parameters:
bytes Number of bytes

Definition at line 300 of file stats.cpp.

References s_stats::all_bytes_received, and s_stats::botnet_bytes_received.

Referenced by botnet_loop(), botnet_receive(), and botnet_received_data_from_telnet().

void stats_botnet_bytes_sent size_t  bytes  ) 
 

Should be called when bytes were sent to BOTNET.

Author:
VooDooMan
Version:
1
Date:
2004
Parameters:
bytes Number of bytes

Definition at line 287 of file stats.cpp.

References s_stats::all_bytes_sent, and s_stats::botnet_bytes_sent.

Referenced by botnet_loop(), botnet_send_command(), and botnet_send_control().

00288 {
00289     stats.all_bytes_sent+=bytes;
00290     stats.botnet_bytes_sent+=bytes;
00291 }

void stats_botnet_chandef_pulled  ) 
 

Should be called when a channel definition was pulled (BOTNET).

Author:
VooDooMan
Version:
1
Date:
2004

Definition at line 444 of file stats.cpp.

References s_stats::botnet_chandef_pulled, and s_stats::botnet_objects_pulled.

Referenced by botnet_loop().

00445 {
00446     stats.botnet_objects_pulled++;
00447     stats.botnet_chandef_pulled++;
00448 }

void stats_botnet_chandef_pushed  ) 
 

Should be called when a channel definition was pushed (BOTNET).

Author:
VooDooMan
Version:
1
Date:
2004

Definition at line 432 of file stats.cpp.

References s_stats::botnet_chandef_pushed, and s_stats::botnet_objects_pushed.

Referenced by botnet_push_chan().

00433 {
00434     stats.botnet_objects_pushed++;
00435     stats.botnet_chandef_pushed++;
00436 }

void stats_botnet_new_connection  ) 
 

Should be called when new BOTNET connection was established.

Author:
VooDooMan
Version:
1
Date:
2004

Definition at line 349 of file stats.cpp.

References s_stats::botnet_connections.

Referenced by botnet_loop(), and botnet_received_data_from_telnet().

00350 {
00351     stats.botnet_connections++;
00352 }

void stats_botnet_partyline_event  ) 
 

Should be called on a partyline event occured (BOTNET).

Author:
VooDooMan
Version:
1
Date:
2004

Definition at line 456 of file stats.cpp.

References s_stats::botnet_partyline_events.

Referenced by botnet_loop().

00457 {
00458     stats.botnet_partyline_events++;
00459 }

void stats_botnet_private_pulled  ) 
 

Should be called when a private definition was pulled (BOTNET).

Author:
VooDooMan
Version:
1
Date:
2004

Definition at line 420 of file stats.cpp.

References s_stats::botnet_objects_pulled, and s_stats::botnet_private_pulled.

Referenced by botnet_loop().

00421 {
00422     stats.botnet_objects_pulled++;
00423     stats.botnet_private_pulled++;
00424 }

void stats_botnet_private_pushed  ) 
 

Should be called when a private definition was pushed (BOTNET).

Author:
VooDooMan
Version:
1
Date:
2004

Definition at line 408 of file stats.cpp.

References s_stats::botnet_objects_pushed, and s_stats::botnet_private_pushed.

Referenced by botnet_push_prv().

00409 {
00410     stats.botnet_objects_pushed++;
00411     stats.botnet_private_pushed++;
00412 }

void stats_botnet_proc_pulled  ) 
 

Should be called when a procedure was pulled (BOTNET).

Author:
VooDooMan
Version:
1
Date:
2004

Definition at line 372 of file stats.cpp.

References s_stats::botnet_objects_pulled, and s_stats::botnet_proc_pulled.

Referenced by botnet_loop().

00373 {
00374     stats.botnet_objects_pulled++;
00375     stats.botnet_proc_pulled++;
00376 }

void stats_botnet_proc_pushed  ) 
 

Should be called when a procedure was pushed (BOTNET).

Author:
VooDooMan
Version:
1
Date:
2004

Definition at line 360 of file stats.cpp.

References s_stats::botnet_objects_pushed, and s_stats::botnet_proc_pushed.

Referenced by botnet_push_proc().

00361 {
00362     stats.botnet_objects_pushed++;
00363     stats.botnet_proc_pushed++;
00364 }

void stats_botnet_user_pulled  ) 
 

Should be called when an user was pushed (BOTNET).

Author:
VooDooMan
Version:
1
Date:
2004

Definition at line 396 of file stats.cpp.

References s_stats::botnet_objects_pulled, and s_stats::botnet_user_pulled.

Referenced by botnet_loop().

00397 {
00398     stats.botnet_objects_pulled++;
00399     stats.botnet_user_pulled++;
00400 }

void stats_botnet_user_pushed  ) 
 

Should be called when an user was pushed (BOTNET).

Author:
VooDooMan
Version:
1
Date:
2004

Definition at line 384 of file stats.cpp.

References s_stats::botnet_objects_pushed, and s_stats::botnet_user_pushed.

Referenced by botnet_push_user().

00385 {
00386     stats.botnet_objects_pushed++;
00387     stats.botnet_user_pushed++;
00388 }

void stats_dcc_chat_bytes_received size_t  bytes  ) 
 

Should be called when bytes were received from DCC CHAT connection.

Author:
VooDooMan
Version:
1
Date:
2004
Parameters:
bytes Number of bytes

Definition at line 226 of file stats.cpp.

References s_stats::all_bytes_received, and s_stats::dcc_chat_bytes_received.

Referenced by dcc_loop().

void stats_dcc_chat_bytes_sent size_t  bytes  ) 
 

Should be called when bytes were sent to DCC CHAT connection.

Author:
VooDooMan
Version:
1
Date:
2004
Parameters:
bytes Number of bytes

Definition at line 213 of file stats.cpp.

References s_stats::all_bytes_sent, and s_stats::dcc_chat_bytes_sent.

Referenced by dcc_loop(), dcc_partyline_message(), and dcc_send_msg().

00214 {
00215     stats.all_bytes_sent+=bytes;
00216     stats.dcc_chat_bytes_sent+=bytes;
00217 }

void stats_dcc_chat_new_connection  ) 
 

Should be called when new DCC CHAT connection was established.

Author:
VooDooMan
Version:
1
Date:
2004

Definition at line 264 of file stats.cpp.

References s_stats::dcc_chat_connections.

Referenced by dcc_loop().

00265 {
00266     stats.dcc_chat_connections++;
00267 }

void stats_dcc_send_bytes_received size_t  bytes  ) 
 

Should be called when bytes were received from DCC SEND connection.

Author:
VooDooMan
Version:
1
Date:
2004
Parameters:
bytes Number of bytes

Definition at line 252 of file stats.cpp.

References s_stats::all_bytes_received, and s_stats::dcc_send_bytes_received.

Referenced by dcc_loop().

void stats_dcc_send_bytes_sent size_t  bytes  ) 
 

Should be called when bytes were sent to DCC SEND connection.

Author:
VooDooMan
Version:
1
Date:
2004
Parameters:
bytes Number of bytes

Definition at line 239 of file stats.cpp.

References s_stats::all_bytes_sent, and s_stats::dcc_send_bytes_sent.

Referenced by dcc_loop().

00240 {
00241     stats.all_bytes_sent+=bytes;
00242     stats.dcc_send_bytes_sent+=bytes;
00243 }

void stats_dcc_send_new_connection  ) 
 

Should be called when new DCC SEND connection was established.

Author:
VooDooMan
Version:
1
Date:
2004

Definition at line 275 of file stats.cpp.

References s_stats::dcc_send_connections.

Referenced by dcc_loop().

00276 {
00277     stats.dcc_send_connections++;
00278 }

void stats_display list< string > &  lines,
string  lang
 

Puts statistics to an array.

Author:
VooDooMan
Version:
1
Date:
2004
Parameters:
lines Returns array of strings (lines)
lang Language code (from file "lang/lang01.txt") or an empty string to use default english (not from language file; for log purpose)

Definition at line 538 of file stats.cpp.

References s_stats::all_bytes_received, s_stats::all_bytes_sent, s_stats::botnet_auth_error, s_stats::botnet_auth_ok, s_stats::botnet_auth_proto_error, s_stats::botnet_bytes_received, s_stats::botnet_bytes_sent, s_stats::botnet_chandef_pulled, s_stats::botnet_chandef_pushed, s_stats::botnet_connections, s_stats::botnet_objects_pulled, s_stats::botnet_objects_pushed, s_stats::botnet_partyline_events, s_stats::botnet_private_pulled, s_stats::botnet_private_pushed, s_stats::botnet_proc_pulled, s_stats::botnet_proc_pushed, s_stats::botnet_user_pulled, s_stats::botnet_user_pushed, s_stats::current_irc_server_host, s_stats::current_irc_server_port, s_stats::dcc_chat_bytes_received, s_stats::dcc_chat_bytes_sent, s_stats::dcc_chat_connections, s_stats::dcc_send_bytes_received, s_stats::dcc_send_bytes_sent, s_stats::dcc_send_connections, s_stats::identd_bytes_received, s_stats::identd_bytes_sent, s_stats::identd_connections, s_stats::irc_all_bytes_received, s_stats::irc_all_bytes_sent, s_stats::irc_connections, s_stats::irc_last_bytes_received, s_stats::irc_last_bytes_sent, lang_get_string(), ltoa(), s_stats::mail_sent, start_time, and stats_format_number().

Referenced by dcc_loop(), and log_done().

00539 {
00540     lines.clear();
00541 
00542     string line;
00543 
00544     {
00545         time_t now=time(NULL);
00546         if(!start_time)
00547             start_time=now;
00548 
00549         time_t up=now-start_time;
00550 
00551         time_t days=up/(24*60*60);
00552         up%=24*60*60;
00553         time_t hrs=up/(60*60);
00554         up%=60*60;
00555         time_t mins=up/(60);
00556         up%=60;
00557         time_t secs=up;
00558 
00559         char tmp[64];
00560         if(!lang.empty()) {
00561             line+=lang_get_string(1,lang,552);
00562             line+=" ";
00563 
00564             line+=ltoa((long)days,tmp,10);
00565             line+=" ";
00566             line+=lang_get_string(1,lang,553);
00567             line+=", ";
00568 
00569             line+=ltoa((long)hrs,tmp,10);
00570             line+=" ";
00571             line+=lang_get_string(1,lang,554);
00572             line+=", ";
00573 
00574             line+=ltoa((long)mins,tmp,10);
00575             line+=" ";
00576             line+=lang_get_string(1,lang,555);
00577             line+=", ";
00578 
00579             line+=ltoa((long)secs,tmp,10);
00580             line+=" ";
00581             line+=lang_get_string(1,lang,556);
00582         } else {
00583             line+="Bot uptime: ";
00584 
00585             line+=ltoa((long)days,tmp,10);
00586             line+=" day(s), ";
00587 
00588             line+=ltoa((long)hrs,tmp,10);
00589             line+=" hour(s), ";
00590 
00591             line+=ltoa((long)mins,tmp,10);
00592             line+=" minute(s), ";
00593 
00594             line+=ltoa((long)secs,tmp,10);
00595             line+=" second(s)";
00596         }
00597         lines.push_back(line);
00598     }
00599 
00600     line="";
00601     if(!lang.empty())
00602         line+=lang_get_string(1,lang,559);
00603     else
00604         line+="Using IRC server host/port:";
00605     line+=" ";
00606     if(stats.current_irc_server_host.find(":",0)!=string::npos)
00607         line+="[";
00608     line+=stats.current_irc_server_host;
00609     if(stats.current_irc_server_host.find(":",0)!=string::npos)
00610         line+="]";
00611     line+=":";
00612     {
00613         char tmp[64];
00614         ltoa(stats.current_irc_server_port,tmp,10);
00615         line+=tmp;
00616     }
00617     lines.push_back(line);
00618 
00619     line="";
00620     if(!lang.empty())
00621         line+=lang_get_string(1,lang,503);
00622     else
00623         line+="All sent bytes:";
00624     line+=" ";
00625     line+=stats_format_number(stats.all_bytes_sent);
00626     lines.push_back(line);
00627 
00628     line="";
00629     if(!lang.empty())
00630         line+=lang_get_string(1,lang,504);
00631     else
00632         line+="All received bytes:";
00633     line+=" ";
00634     line+=stats_format_number(stats.all_bytes_received);
00635     lines.push_back(line);
00636 
00637     line="";
00638     if(!lang.empty())
00639         line+=lang_get_string(1,lang,505);
00640     else
00641         line+="All sent bytes to IRC server:";
00642     line+=" ";
00643     line+=stats_format_number(stats.irc_all_bytes_sent);
00644     lines.push_back(line);
00645 
00646     line="";
00647     if(!lang.empty())
00648         line+=lang_get_string(1,lang,506);
00649     else
00650         line+="All received bytes from IRC server:";
00651     line+=" ";
00652     line+=stats_format_number(stats.irc_all_bytes_received);
00653     lines.push_back(line);
00654 
00655     line="";
00656     if(!lang.empty())
00657         line+=lang_get_string(1,lang,507);
00658     else
00659         line+="All sent bytes to IRC server on last connection:";
00660     line+=" ";
00661     line+=stats_format_number(stats.irc_last_bytes_sent);
00662     lines.push_back(line);
00663 
00664     line="";
00665     if(!lang.empty())
00666         line+=lang_get_string(1,lang,508);
00667     else
00668         line+="All received bytes from IRC server on last connection:";
00669     line+=" ";
00670     line+=stats_format_number(stats.irc_last_bytes_received);
00671     lines.push_back(line);
00672 
00673     line="";
00674     if(!lang.empty())
00675         line+=lang_get_string(1,lang,509);
00676     else
00677         line+="Number of connections established to IRC server:";
00678     line+=" ";
00679     line+=stats_format_number(stats.irc_connections);
00680     lines.push_back(line);
00681 
00682     line="";
00683     if(!lang.empty())
00684         line+=lang_get_string(1,lang,510);
00685     else
00686         line+="All sent bytes to DCC CHAT / telnet:";
00687     line+=" ";
00688     line+=stats_format_number(stats.dcc_chat_bytes_sent);
00689     lines.push_back(line);
00690 
00691     line="";
00692     if(!lang.empty())
00693         line+=lang_get_string(1,lang,511);
00694     else
00695         line+="All received bytes from DCC CHAT / telnet:";
00696     line+=" ";
00697     line+=stats_format_number(stats.dcc_chat_bytes_received);
00698     lines.push_back(line);
00699 
00700     line="";
00701     if(!lang.empty())
00702         line+=lang_get_string(1,lang,512);
00703     else
00704         line+="Number of DCC CHAT / telnet, or incomming BOTNET connections established:";
00705     line+=" ";
00706     line+=stats_format_number(stats.dcc_chat_connections);
00707     lines.push_back(line);
00708 
00709     line="";
00710     if(!lang.empty())
00711         line+=lang_get_string(1,lang,513);
00712     else
00713         line+="All sent bytes to DCC SEND:";
00714     line+=" ";
00715     line+=stats_format_number(stats.dcc_send_bytes_sent);
00716     lines.push_back(line);
00717 
00718     line="";
00719     if(!lang.empty())
00720         line+=lang_get_string(1,lang,514);
00721     else
00722         line+="All received bytes from DCC SEND:";
00723     line+=" ";
00724     line+=stats_format_number(stats.dcc_send_bytes_received);
00725     lines.push_back(line);
00726 
00727     line="";
00728     if(!lang.empty())
00729         line+=lang_get_string(1,lang,515);
00730     else
00731         line+="Number of DCC SEND connections established:";
00732     line+=" ";
00733     line+=stats_format_number(stats.dcc_send_connections);
00734     lines.push_back(line);
00735 
00736     line="";
00737     if(!lang.empty())
00738         line+=lang_get_string(1,lang,536);
00739     else
00740         line+="All sent bytes to IDENT requests:";
00741     line+=" ";
00742     line+=stats_format_number(stats.identd_bytes_sent);
00743     lines.push_back(line);
00744 
00745     line="";
00746     if(!lang.empty())
00747         line+=lang_get_string(1,lang,537);
00748     else
00749         line+="All received bytes from IDENT requests:";
00750     line+=" ";
00751     line+=stats_format_number(stats.identd_bytes_received);
00752     lines.push_back(line);
00753 
00754     line="";
00755     if(!lang.empty())
00756         line+=lang_get_string(1,lang,538);
00757     else
00758         line+="Number of IDENT connections established:";
00759     line+=" ";
00760     line+=stats_format_number(stats.identd_connections);
00761     lines.push_back(line);
00762 
00763     line="";
00764     if(!lang.empty())
00765         line+=lang_get_string(1,lang,516);
00766     else
00767         line+="All sent bytes to BOTNET:";
00768     line+=" ";
00769     line+=stats_format_number(stats.botnet_bytes_sent);
00770     lines.push_back(line);
00771 
00772     line="";
00773     if(!lang.empty())
00774         line+=lang_get_string(1,lang,517);
00775     else
00776         line+="All received bytes from BOTNET:";
00777     line+=" ";
00778     line+=stats_format_number(stats.botnet_bytes_received);
00779     lines.push_back(line);
00780 
00781     line="";
00782     if(!lang.empty())
00783         line+=lang_get_string(1,lang,518);
00784     else
00785         line+="Number of BOTNET connections established:";
00786     line+=" ";
00787     line+=stats_format_number(stats.botnet_connections);
00788     lines.push_back(line);
00789 
00790     line="";
00791     if(!lang.empty())
00792         line+=lang_get_string(1,lang,519);
00793     else
00794         line+="Number of successful BOTNET authentications:";
00795     line+=" ";
00796     line+=stats_format_number(stats.botnet_auth_ok);
00797     lines.push_back(line);
00798 
00799     line="";
00800     if(!lang.empty())
00801         line+=lang_get_string(1,lang,520);
00802     else
00803         line+="Number of failed BOTNET authentications:";
00804     line+=" ";
00805     line+=stats_format_number(stats.botnet_auth_error);
00806     lines.push_back(line);
00807 
00808     line="";
00809     if(!lang.empty())
00810         line+=lang_get_string(1,lang,521);
00811     else
00812         line+="Number of BOTNET protocol errors:";
00813     line+=" ";
00814     line+=stats_format_number(stats.botnet_auth_proto_error);
00815     lines.push_back(line);
00816 
00817     line="";
00818     if(!lang.empty())
00819         line+=lang_get_string(1,lang,522);
00820     else
00821         line+="Number of all pushed BOTNET objects:";
00822     line+=" ";
00823     line+=stats_format_number(stats.botnet_objects_pushed);
00824     lines.push_back(line);
00825 
00826     line="";
00827     if(!lang.empty())
00828         line+=lang_get_string(1,lang,523);
00829     else
00830         line+="Number of all pulled BOTNET objects:";
00831     line+=" ";
00832     line+=stats_format_number(stats.botnet_objects_pulled);
00833     lines.push_back(line);
00834 
00835     line="";
00836     if(!lang.empty())
00837         line+=lang_get_string(1,lang,524);
00838     else
00839         line+="Number of pushed BOTNET procedures:";
00840     line+=" ";
00841     line+=stats_format_number(stats.botnet_proc_pushed);
00842     lines.push_back(line);
00843 
00844     line="";
00845     if(!lang.empty())
00846         line+=lang_get_string(1,lang,525);
00847     else
00848         line+="Number of pulled BOTNET procedures:";
00849     line+=" ";
00850     line+=stats_format_number(stats.botnet_proc_pulled);
00851     lines.push_back(line);
00852 
00853     line="";
00854     if(!lang.empty())
00855         line+=lang_get_string(1,lang,526);
00856     else
00857         line+="Number of pushed BOTNET users:";
00858     line+=" ";
00859     line+=stats_format_number(stats.botnet_user_pushed);
00860     lines.push_back(line);
00861 
00862     line="";
00863     if(!lang.empty())
00864         line+=lang_get_string(1,lang,527);
00865     else
00866         line+="Number of pulled BOTNET users:";
00867     line+=" ";
00868     line+=stats_format_number(stats.botnet_user_pulled);
00869     lines.push_back(line);
00870 
00871     line="";
00872     if(!lang.empty())
00873         line+=lang_get_string(1,lang,528);
00874     else
00875         line+="Number of pushed BOTNET private:";
00876     line+=" ";
00877     line+=stats_format_number(stats.botnet_private_pushed);
00878     lines.push_back(line);
00879 
00880     line="";
00881     if(!lang.empty())
00882         line+=lang_get_string(1,lang,529);
00883     else
00884         line+="Number of pulled BOTNET private:";
00885     line+=" ";
00886     line+=stats_format_number(stats.botnet_private_pulled);
00887     lines.push_back(line);
00888 
00889     line="";
00890     if(!lang.empty())
00891         line+=lang_get_string(1,lang,530);
00892     else
00893         line+="Number of pushed BOTNET channels:";
00894     line+=" ";
00895     line+=stats_format_number(stats.botnet_chandef_pushed);
00896     lines.push_back(line);
00897 
00898     line="";
00899     if(!lang.empty())
00900         line+=lang_get_string(1,lang,531);
00901     else
00902         line+="Number of pulled BOTNET channels:";
00903     line+=" ";
00904     line+=stats_format_number(stats.botnet_chandef_pulled);
00905     lines.push_back(line);
00906 
00907     line="";
00908     if(!lang.empty())
00909         line+=lang_get_string(1,lang,532);
00910     else
00911         line+="Number of BOTNET partyline events:";
00912     line+=" ";
00913     line+=stats_format_number(stats.botnet_partyline_events);
00914     lines.push_back(line);
00915 
00916     line="";
00917     if(!lang.empty())
00918         line+=lang_get_string(1,lang,533);
00919     else
00920         line+="Number of e-mail(s) sent:";
00921     line+=" ";
00922     line+=stats_format_number(stats.mail_sent);
00923     lines.push_back(line);
00924 }

Here is the call graph for this function:

void stats_identd_bytes_received size_t  bytes  ) 
 

Should be called when bytes were received from IDENTD request.

Author:
VooDooMan
Version:
1
Date:
2004
Parameters:
bytes Number of bytes

Definition at line 337 of file stats.cpp.

References s_stats::all_bytes_received, and s_stats::identd_bytes_received.

Referenced by identd_check().

void stats_identd_bytes_sent size_t  bytes  ) 
 

Should be called when bytes were sent to IDENTD request.

Author:
VooDooMan
Version:
1
Date:
2004
Parameters:
bytes Number of bytes

Definition at line 324 of file stats.cpp.

References s_stats::all_bytes_sent, and s_stats::identd_bytes_sent.

Referenced by identd_check().

00325 {
00326     stats.all_bytes_sent+=bytes;
00327     stats.identd_bytes_sent+=bytes;
00328 }

void stats_identd_new_connection  ) 
 

Should be called when new IDENTD connection was establish.

Author:
VooDooMan
Version:
1
Date:
2004

Definition at line 312 of file stats.cpp.

References s_stats::identd_connections.

Referenced by identd_check().

00313 {
00314     stats.identd_connections++;
00315 }

void stats_init  ) 
 

Initializes statistics module.

Author:
VooDooMan
Version:
1
Date:
2004

Definition at line 155 of file stats.cpp.

References s_stats::clear(), and start_time.

Referenced by main().

00156 {
00157     stats.clear();
00158     time(&start_time);
00159 }

Here is the call graph for this function:

void stats_irc_bytes_received size_t  bytes  ) 
 

Should be called when bytes were received from IRC server.

Author:
VooDooMan
Version:
1
Date:
2004
Parameters:
bytes Number of bytes

Definition at line 182 of file stats.cpp.

References s_stats::all_bytes_received, s_stats::irc_all_bytes_received, and s_stats::irc_last_bytes_received.

Referenced by irc_loop_putserv().

void stats_irc_bytes_sent size_t  bytes  ) 
 

Should be called when bytes were sent to IRC server.

Author:
VooDooMan
Version:
1
Date:
2004
Parameters:
bytes Number of bytes

Definition at line 168 of file stats.cpp.

References s_stats::all_bytes_sent, s_stats::irc_all_bytes_sent, and s_stats::irc_last_bytes_sent.

Referenced by irc_putserv_immediately().

void stats_irc_new_connection string  irc_server_host,
unsigned short  irc_server_port
 

Should be called when new connection to IRC server was established.

Author:
VooDooMan
Version:
1
Date:
2004
Parameters:
irc_server_host Host for new IRC server
irc_server_port Port for new IRC server

Definition at line 197 of file stats.cpp.

References s_stats::current_irc_server_host, s_stats::current_irc_server_port, s_stats::irc_connections, s_stats::irc_last_bytes_received, and s_stats::irc_last_bytes_sent.

Referenced by irc_connect().

void stats_mail_sent  ) 
 

Should be called when an e-mail was sent.

Author:
VooDooMan
Version:
1
Date:
2004

Definition at line 500 of file stats.cpp.

References s_stats::mail_sent.

Referenced by logic_exec().

00501 {
00502     stats.mail_sent++;
00503 }


Generated on Sun Jul 10 05:43:29 2005 for VooDoo cIRCle by doxygen 1.4.3

Hosted by SourceForge.net Logo