stats.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                           stats.cpp  -  description
00003                              -------------------
00004     begin                : Thu Dec 9 2004
00005     copyright            : (C) 2004 by VooDooMan
00006     email                : vdmfun@hotmail.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010 
00011 VooDoo cIRCle - an IRC (ro)bot
00012 Copyright (C) 2004 by Marian VooDooMan Meravy (vdmfun@hotmail.com)
00013 
00014 This program is free software; you can redistribute it and/or
00015 modify it under the terms of the GNU General Public License
00016 as published by the Free Software Foundation; either version 2
00017 of the License, or (at your option) any later version.
00018 
00019 This program is distributed in the hope that it will be useful,
00020 but WITHOUT ANY WARRANTY; without even the implied warranty of
00021 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022 GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License
00025 along with this program; if not, write to the Free Software
00026 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00027 
00028 ****************************************************************************/
00029 
00030 /*!
00031     \file
00032     \brief Provides some statistics
00033 */
00034 
00035 #include <list>
00036 #include <string>
00037 #include <time.h>
00038 
00039 using namespace std;
00040 
00041 #include "stats.h"
00042 #include "lang.h"
00043 
00044 #include "params.h"
00045 
00046 #ifndef _WIN32
00047 #ifndef HAVE_LTOA
00048 extern char *ltoa(long value, char *buffer, int radix);
00049 #endif
00050 #endif
00051 
00052 time_t start_time=0;                //!< Timestamp of starup (used for UpTime statistics)
00053 
00054 /*!
00055     \brief Stores statistics informations
00056     \author VooDooMan
00057     \version 1
00058     \date 2004
00059 */
00060 struct s_stats {
00061     size_t all_bytes_sent;                          //!< All TCP bytes sent
00062     size_t all_bytes_received;                      //!< All TCP bytes received
00063 
00064     size_t irc_all_bytes_sent;                      //!< All bytes sent to IRC server
00065     size_t irc_all_bytes_received;                  //!< All bytes received from IRC server
00066 
00067     size_t irc_last_bytes_sent;                     //!< All bytes sent to IRC server on last connection
00068     size_t irc_last_bytes_received;                 //!< All bytes received from IRC server on last connection
00069 
00070     unsigned long irc_connections;                  //!< Number of connects to IRC server
00071 
00072     size_t dcc_chat_bytes_sent;                     //!< DCC CHAT / telnet all bytes sent
00073     size_t dcc_chat_bytes_received;                 //!< DCC CHAT / telnet all bytes received
00074 
00075     unsigned long dcc_chat_connections;             //!< Number of DCC CHAT / telnet or BOTNET connections
00076 
00077     size_t dcc_send_bytes_sent;                     //!< Number of bytes sent via DCC SEND
00078     size_t dcc_send_bytes_received;                 //!< Number of bytes received via DCC SEND
00079 
00080     unsigned long dcc_send_connections;             //!< Number of DCC SEND connections
00081 
00082     size_t botnet_bytes_sent;                       //!< Number of bytes sent via BOTNET
00083     size_t botnet_bytes_received;                   //!< Number of bytes received via BOTNET
00084 
00085     unsigned long botnet_connections;               //!< Number of BOTNET connections
00086     unsigned long botnet_auth_ok;                   //!< Number of successful authentication on BOTNET
00087     unsigned long botnet_auth_error;                //!< Number of failed authentication on BOTNET
00088     unsigned long botnet_auth_proto_error;          //!< Number of protocol errors on BOTNET
00089 
00090     unsigned long botnet_objects_pushed;            //!< Number of object pushed (BOTNET)
00091     unsigned long botnet_objects_pulled;            //!< Number of object pulled (BOTNET)
00092 
00093     unsigned long botnet_proc_pushed;               //!< Number of procedures pushed (BOTNET)
00094     unsigned long botnet_proc_pulled;               //!< Number of procedures pulled (BOTNET)
00095 
00096     unsigned long botnet_user_pushed;               //!< Number of users pushed (BOTNET)
00097     unsigned long botnet_user_pulled;               //!< Number of users pulled (BOTNET)
00098 
00099     unsigned long botnet_private_pushed;            //!< Number of private definitions pushed (BOTNET)
00100     unsigned long botnet_private_pulled;            //!< Number of private definitions pulled (BOTNET)
00101 
00102     unsigned long botnet_chandef_pushed;            //!< Number of channel definitions pushed (BOTNET)
00103     unsigned long botnet_chandef_pulled;            //!< Number of channel definitions pulled (BOTNET)
00104 
00105     unsigned long botnet_partyline_events;          //!< Number of partyline events (BOTNET)
00106 
00107     unsigned long mail_sent;                        //!< Number of e-mails sent
00108 
00109     size_t identd_bytes_sent;                       //!< Number of IDENTD bytes sent
00110     size_t identd_bytes_received;                   //!< Number of IDENTD bytes received
00111     unsigned long identd_connections;               //!< Number of IDENTD connections
00112 
00113     string current_irc_server_host;                 //!< Name of host of the curret IRC server
00114     unsigned short  current_irc_server_port;        //!< Port of the curret IRC server
00115 
00116     /*!
00117         \brief Clean-ups the structure
00118         \author VooDooMan
00119         \version 1
00120         \date 2004
00121     */
00122     void clear()
00123     {
00124         all_bytes_sent=all_bytes_received=irc_all_bytes_sent=irc_all_bytes_received=
00125             irc_last_bytes_sent=irc_last_bytes_received=dcc_chat_bytes_sent=
00126             dcc_chat_bytes_received=dcc_send_bytes_sent=dcc_send_bytes_received=
00127             botnet_bytes_sent=botnet_bytes_received=identd_bytes_sent=
00128             identd_bytes_received=0;
00129 
00130         irc_connections=dcc_chat_connections=dcc_send_connections=botnet_connections=
00131             botnet_auth_ok=botnet_auth_error=botnet_auth_proto_error=botnet_objects_pushed=
00132             botnet_objects_pulled=botnet_proc_pushed=botnet_proc_pulled=
00133             botnet_user_pushed=botnet_user_pulled=botnet_private_pushed=
00134             botnet_private_pulled=botnet_chandef_pushed=botnet_chandef_pulled=
00135             botnet_partyline_events=mail_sent=identd_connections=0;
00136 
00137         current_irc_server_host="";
00138         current_irc_server_port=0;
00139     }
00140 
00141     s_stats()
00142     {
00143         clear();
00144     }
00145 };
00146 
00147 s_stats stats;                                  //!< Structure with statistics
00148 
00149 /*!
00150     \brief Initializes statistics module
00151     \author VooDooMan
00152     \version 1
00153     \date 2004
00154 */
00155 void stats_init()
00156 {
00157     stats.clear();
00158     time(&start_time);
00159 }
00160 
00161 /*!
00162     \brief Should be called when bytes were sent to IRC server
00163     \author VooDooMan
00164     \version 1
00165     \date 2004
00166     \param bytes Number of bytes
00167 */
00168 void stats_irc_bytes_sent(size_t bytes)
00169 {
00170     stats.all_bytes_sent+=bytes;
00171     stats.irc_all_bytes_sent+=bytes;
00172     stats.irc_last_bytes_sent+=bytes;
00173 }
00174 
00175 /*!
00176     \brief Should be called when bytes were received from IRC server
00177     \author VooDooMan
00178     \version 1
00179     \date 2004
00180     \param bytes Number of bytes
00181 */
00182 void stats_irc_bytes_received(size_t bytes)
00183 {
00184     stats.all_bytes_received+=bytes;
00185     stats.irc_all_bytes_received+=bytes;
00186     stats.irc_last_bytes_received+=bytes;
00187 }
00188 
00189 /*!
00190     \brief Should be called when new connection to IRC server was established
00191     \author VooDooMan
00192     \version 1
00193     \date 2004
00194     \param irc_server_host Host for new IRC server
00195     \param irc_server_port Port for new IRC server
00196 */
00197 void stats_irc_new_connection(string irc_server_host, unsigned short irc_server_port)
00198 {
00199     stats.irc_last_bytes_received=0;
00200     stats.irc_last_bytes_sent=0;
00201     stats.irc_connections++;
00202     stats.current_irc_server_host=irc_server_host;
00203     stats.current_irc_server_port=irc_server_port;
00204 }
00205 
00206 /*!
00207     \brief Should be called when bytes were sent to DCC CHAT connection
00208     \author VooDooMan
00209     \version 1
00210     \date 2004
00211     \param bytes Number of bytes
00212 */
00213 void stats_dcc_chat_bytes_sent(size_t bytes)
00214 {
00215     stats.all_bytes_sent+=bytes;
00216     stats.dcc_chat_bytes_sent+=bytes;
00217 }
00218 
00219 /*!
00220     \brief Should be called when bytes were received from DCC CHAT connection
00221     \author VooDooMan
00222     \version 1
00223     \date 2004
00224     \param bytes Number of bytes
00225 */
00226 void stats_dcc_chat_bytes_received(size_t bytes)
00227 {
00228     stats.all_bytes_received+=bytes;
00229     stats.dcc_chat_bytes_received+=bytes;
00230 }
00231 
00232 /*!
00233     \brief Should be called when bytes were sent to DCC SEND connection
00234     \author VooDooMan
00235     \version 1
00236     \date 2004
00237     \param bytes Number of bytes
00238 */
00239 void stats_dcc_send_bytes_sent(size_t bytes)
00240 {
00241     stats.all_bytes_sent+=bytes;
00242     stats.dcc_send_bytes_sent+=bytes;
00243 }
00244 
00245 /*!
00246     \brief Should be called when bytes were received from DCC SEND connection
00247     \author VooDooMan
00248     \version 1
00249     \date 2004
00250     \param bytes Number of bytes
00251 */
00252 void stats_dcc_send_bytes_received(size_t bytes)
00253 {
00254     stats.all_bytes_received+=bytes;
00255     stats.dcc_send_bytes_received+=bytes;
00256 }
00257 
00258 /*!
00259     \brief Should be called when new DCC CHAT connection was established
00260     \author VooDooMan
00261     \version 1
00262     \date 2004
00263 */
00264 void stats_dcc_chat_new_connection()
00265 {
00266     stats.dcc_chat_connections++;
00267 }
00268 
00269 /*!
00270     \brief Should be called when new DCC SEND connection was established
00271     \author VooDooMan
00272     \version 1
00273     \date 2004
00274 */
00275 void stats_dcc_send_new_connection()
00276 {
00277     stats.dcc_send_connections++;
00278 }
00279 
00280 /*!
00281     \brief Should be called when bytes were sent to BOTNET
00282     \author VooDooMan
00283     \version 1
00284     \date 2004
00285     \param bytes Number of bytes
00286 */
00287 void stats_botnet_bytes_sent(size_t bytes)
00288 {
00289     stats.all_bytes_sent+=bytes;
00290     stats.botnet_bytes_sent+=bytes;
00291 }
00292 
00293 /*!
00294     \brief Should be called when bytes were received from BOTNET
00295     \author VooDooMan
00296     \version 1
00297     \date 2004
00298     \param bytes Number of bytes
00299 */
00300 void stats_botnet_bytes_received(size_t bytes)
00301 {
00302     stats.all_bytes_received+=bytes;
00303     stats.botnet_bytes_received+=bytes;
00304 }
00305 
00306 /*!
00307     \brief Should be called when new IDENTD connection was establish
00308     \author VooDooMan
00309     \version 1
00310     \date 2004
00311 */
00312 void stats_identd_new_connection()
00313 {
00314     stats.identd_connections++;
00315 }
00316 
00317 /*!
00318     \brief Should be called when bytes were sent to IDENTD request
00319     \author VooDooMan
00320     \version 1
00321     \date 2004
00322     \param bytes Number of bytes
00323 */
00324 void stats_identd_bytes_sent(size_t bytes)
00325 {
00326     stats.all_bytes_sent+=bytes;
00327     stats.identd_bytes_sent+=bytes;
00328 }
00329 
00330 /*!
00331     \brief Should be called when bytes were received from IDENTD request
00332     \author VooDooMan
00333     \version 1
00334     \date 2004
00335     \param bytes Number of bytes
00336 */
00337 void stats_identd_bytes_received(size_t bytes)
00338 {
00339     stats.all_bytes_received+=bytes;
00340     stats.identd_bytes_received+=bytes;
00341 }
00342 
00343 /*!
00344     \brief Should be called when new BOTNET connection was established
00345     \author VooDooMan
00346     \version 1
00347     \date 2004
00348 */
00349 void stats_botnet_new_connection()
00350 {
00351     stats.botnet_connections++;
00352 }
00353 
00354 /*!
00355     \brief Should be called when a procedure was pushed (BOTNET)
00356     \author VooDooMan
00357     \version 1
00358     \date 2004
00359 */
00360 void stats_botnet_proc_pushed()
00361 {
00362     stats.botnet_objects_pushed++;
00363     stats.botnet_proc_pushed++;
00364 }
00365 
00366 /*!
00367     \brief Should be called when a procedure was pulled (BOTNET)
00368     \author VooDooMan
00369     \version 1
00370     \date 2004
00371 */
00372 void stats_botnet_proc_pulled()
00373 {
00374     stats.botnet_objects_pulled++;
00375     stats.botnet_proc_pulled++;
00376 }
00377 
00378 /*!
00379     \brief Should be called when an user was pushed (BOTNET)
00380     \author VooDooMan
00381     \version 1
00382     \date 2004
00383 */
00384 void stats_botnet_user_pushed()
00385 {
00386     stats.botnet_objects_pushed++;
00387     stats.botnet_user_pushed++;
00388 }
00389 
00390 /*!
00391     \brief Should be called when an user was pushed (BOTNET)
00392     \author VooDooMan
00393     \version 1
00394     \date 2004
00395 */
00396 void stats_botnet_user_pulled()
00397 {
00398     stats.botnet_objects_pulled++;
00399     stats.botnet_user_pulled++;
00400 }
00401 
00402 /*!
00403     \brief Should be called when a private definition was pushed (BOTNET)
00404     \author VooDooMan
00405     \version 1
00406     \date 2004
00407 */
00408 void stats_botnet_private_pushed()
00409 {
00410     stats.botnet_objects_pushed++;
00411     stats.botnet_private_pushed++;
00412 }
00413 
00414 /*!
00415     \brief Should be called when a private definition was pulled (BOTNET)
00416     \author VooDooMan
00417     \version 1
00418     \date 2004
00419 */
00420 void stats_botnet_private_pulled()
00421 {
00422     stats.botnet_objects_pulled++;
00423     stats.botnet_private_pulled++;
00424 }
00425 
00426 /*!
00427     \brief Should be called when a channel definition was pushed (BOTNET)
00428     \author VooDooMan
00429     \version 1
00430     \date 2004
00431 */
00432 void stats_botnet_chandef_pushed()
00433 {
00434     stats.botnet_objects_pushed++;
00435     stats.botnet_chandef_pushed++;
00436 }
00437 
00438 /*!
00439     \brief Should be called when a channel definition was pulled (BOTNET)
00440     \author VooDooMan
00441     \version 1
00442     \date 2004
00443 */
00444 void stats_botnet_chandef_pulled()
00445 {
00446     stats.botnet_objects_pulled++;
00447     stats.botnet_chandef_pulled++;
00448 }
00449 
00450 /*!
00451     \brief Should be called on a partyline event occured (BOTNET)
00452     \author VooDooMan
00453     \version 1
00454     \date 2004
00455 */
00456 void stats_botnet_partyline_event()
00457 {
00458     stats.botnet_partyline_events++;
00459 }
00460 
00461 /*!
00462     \brief Should be called when successful authentication with another bot on BOTNET
00463     \author VooDooMan
00464     \version 1
00465     \date 2004
00466 */
00467 void stats_botnet_auth_ok()
00468 {
00469     stats.botnet_auth_ok++;
00470 }
00471 
00472 /*!
00473     \brief Should be called when failed authentication with another bot on BOTNET
00474     \author VooDooMan
00475     \version 1
00476     \date 2004
00477 */
00478 void stats_botnet_auth_error()
00479 {
00480     stats.botnet_auth_error++;
00481 }
00482 
00483 /*!
00484     \brief Should be called when protocol error occured with another bot on BOTNET
00485     \author VooDooMan
00486     \version 1
00487     \date 2004
00488 */
00489 void stats_botnet_auth_proto_error()
00490 {
00491     stats.botnet_auth_proto_error++;
00492 }
00493 
00494 /*!
00495     \brief Should be called when an e-mail was sent
00496     \author VooDooMan
00497     \version 1
00498     \date 2004
00499 */
00500 void stats_mail_sent()
00501 {
00502     stats.mail_sent++;
00503 }
00504 
00505 /*!
00506     \brief Converts number to string in format: 1,234,567
00507     \author VooDooMan
00508     \version 1
00509     \date 2004
00510     \param number Number to convert
00511     \return Returns formatted string
00512 */
00513 string stats_format_number(size_t number)
00514 {
00515     char tmp[64];
00516     ltoa((long)number,tmp,10);
00517     string str1=(string)"!"+tmp; // add dummy helper "!"
00518     string str2;
00519     int i2=0;
00520     for(size_t i1=str1.length()-1; (signed)i1>0; i1--, i2++) {
00521         if(i2==3) {
00522             str2=(string)","+str2;
00523             i2=0;
00524         }
00525         str2=(string)""+str1[i1]+str2;
00526     }
00527     return str2;
00528 }
00529 
00530 /*!
00531     \brief Puts statistics to an array
00532     \author VooDooMan
00533     \version 1
00534     \date 2004
00535     \param lines Returns array of strings (lines)
00536     \param lang Language code (from file "lang/lang01.txt") or an empty string to use default english (not from language file; for log purpose)
00537 */
00538 void stats_display(list<string>& lines, string lang)
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 }
00925 

Generated on Sun Jul 10 03:23:04 2005 for VooDoo cIRCle by doxygen 1.4.3

Hosted by SourceForge.net Logo