"Fossies" - the Fresh Open Source Software Archive

Member "sarg-2.4.0/documentation/report.txt" (9 Feb 2013, 6929 Bytes) of package /linux/privat/sarg-2.4.0.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "report.txt" see the Fossies "Dox" file reference documentation.

    1 /*! \file report.c
    2 \brief Generate the reports.
    3 */
    4 
    5 /*! \fn void gerarel(void)
    6 Generate the reports from the files created by main() in the temporary directory and sorted
    7 by sort_users_log().
    8 
    9 The function outputs several files:
   10 
   11 \arg \c user.utmp: The URL accessed by the user.
   12 \arg \c user.htmp: The date and time of usage of the web.
   13 
   14 The files are then organized in reports.
   15 
   16 */
   17 
   18 
   19 
   20 
   21 
   22 /*! \fn static void maketmp(const char *user, const char *dirname, int debug, int indexonly)
   23 Create a temporary file with the extension \c utmp to store the sites accessed by the user.
   24 
   25 \param user The name of the user.
   26 \param dirname The directory where to create the file.
   27 \param debug \c True to run in debug mode.
   28 \param indexonly \c True if only an index is created and not the actual files.
   29 
   30 The content of the file is created one line at a time by gravatmp().
   31 */
   32 
   33 
   34 
   35 
   36 
   37 
   38 /*! \fn static void maketmp_hour(const char *user, const char *dirname, int indexonly)
   39 Create a temporary file with the extension \c htmp to store the times the user surfed the web.
   40 
   41 \param user The name of the user.
   42 \param dirname The directory where to create the file.
   43 \param indexonly \c True if only an index is created and not the actual files.
   44 
   45 The content of the file is created one line at a time by gravatmp_hora().
   46 
   47 */
   48 
   49 
   50 
   51 
   52 
   53 /*! \fn void gravatmp(const char *oldaccuser, const char *dirname, const char *oldurl, long long int nacc, long long int nbytes, const char *oldmsg, long long int nelap, int indexonly, long long int incache, long long int oucache)
   54 Append one line into the \c utmp temporary file of the user.
   55 
   56 \param oldaccuser The user.
   57 \param dirname The directory with the temporary file.
   58 \param oldurl The URL being accessed.
   59 \param nacc The number of access to the site.
   60 \param nbytes The number of bytes transfered.
   61 \param oldmsg The status of the connection.
   62 \param nelap The time spent downloading the data.
   63 \param indexonly \c True if only an index is created and not the actual files.
   64 \param incache The number of bytes fetched from the cache of squid.
   65 \param oucache The number of bytes not fetched from the cache of squid.
   66 
   67 The file contains one line per entry with the following informations in that order:
   68 \arg the number of access;
   69 \arg the number of bytes transfered;
   70 \arg the URL access by the user;
   71 \arg the status of the connection;
   72 \arg the time spent downloading that URL;
   73 \arg the number of bytes comming from the cache of squid;
   74 \arg the number of bytes not found in the cache of squid.
   75 */
   76 
   77 
   78 
   79 
   80 
   81 /*! \fn static void gravatmp_hora(const char *dirname, const char *user, const char *data, const char *hora, const char *elap, const char *bytes, int indexonly)
   82 Append one line into the \c htmp temporary file of the user.
   83 
   84 \param dirname The directory with the temporary file.
   85 \param user The user.
   86 \param data The date of the access.
   87 \param hora The time of the access.
   88 \param elap The time spent.
   89 \param bytes The number of bytes transfered.
   90 \param indexonly \c True if only an index is created and not the actual files.
   91 
   92 The file contains one line per entry with the following informations in that order:
   93 \arg the date;
   94 \arg the time;
   95 \arg the number of bytes transfered or the time spent downloading them.
   96 
   97 */
   98 
   99 
  100 
  101 
  102 
  103 /*! \fn static void gravaporuser(const char *user, const char *dirname, const char *url, const char *ip, const char *data, const char *hora, const char *tam, const char *elap, int indexonly)
  104 Append one line into the \c ip temporary file of the user.
  105 
  106 \param user The user.
  107 \param dirname The directory with the temporary file.
  108 \param url The URL accessed by the user.
  109 \param ip The IP from which the user is accessing the web.
  110 \param data The date of the access.
  111 \param hora The time of the access.
  112 \param tam The number of bytes transfered.
  113 \param elap The time spent.
  114 \param indexonly \c True if only an index is created and not the actual files.
  115 */
  116 
  117 
  118 
  119 
  120 
  121 /*! \fn static void gravatmpf(const char *oldaccuser, const char *dirname, const char *oldurl, long long int nacc, long long int nbytes, const char *oldmsg, long long int nelap, int indexonly, long long int incache, long long int oucache)
  122 Looks suspiciously identical to gravatmp() except that it reset ::ind2 to zero.
  123 
  124 \param oldaccuser The user.
  125 \param dirname The directory with the temporary file.
  126 \param oldurl The URL being accessed.
  127 \param nacc The number of access to the site.
  128 \param nbytes The number of bytes transfered.
  129 \param oldmsg Unused.
  130 \param nelap The time spent downloading the data.
  131 \param indexonly \c True if only an index is created and not the actual files.
  132 \param incache The number of bytes fetched from the cache of squid.
  133 \param oucache The number of bytes not fetched from the cache of squid.
  134 */
  135 
  136 
  137 
  138 
  139 
  140 /*! \fn static void gravager(char *dirname, const char *user, long long int nacc, const char *url, long long int nbytes, const char *ip, const char *hora, const char *dia, long long int nelap, long long int incache, long long int oucache)
  141 Append a record to the sarg-general file.
  142 
  143 \param dirname The directory where the sarg-general file is. The string is modified when the function returns.
  144 \param user The user making the connection.
  145 \param nacc The number of access to the site.
  146 \param url The accessed URL.
  147 \param nbytes the number of bytes transfered.
  148 \param ip The IP address of the user.
  149 \param hora The time of the access.
  150 \param dia The date of the access.
  151 \param nelap The time spent on that site.
  152 \param incache Number of bytes fetched from the cache of squid.
  153 \param oucache Number of bytes not found in the cache of squid.
  154 */
  155 
  156 
  157 
  158 
  159 /*! \fn int ger_read(char *buffer,struct generalitemstruct *item,const char *filename)
  160 Parse one line of the file written by gravager().
  161 
  162 \param buffer The line of text to parse.
  163 \param item The structure to fill with the data parsed from the line. The structure contains
  164 pointers to strings but some of them are limited in length to detect a corruption of the file
  165 and to let the caller use simple string manipulation functions with fixed size buffer.
  166 \param filename The name of the file from which the line is extracted to report it if an
  167 error is found.
  168 
  169 \return Zero on succes. The program exits if an error is found.
  170 */
  171 
  172 
  173 
  174 
  175 
  176 /*! \fn static void grava_SmartFilter(const char *dirname, const char *user, const char *ip, const char *data, const char *hora, const char *url, const char *smart)
  177 Append a record into the \c smartfilter.unsort file of the specified directory.
  178 
  179 \param dirname The directory where to create the file.
  180 \param user The user to store in the record.
  181 \param ip The IP used by the user.
  182 \param data The date of the access.
  183 \param hora The time of the access.
  184 \param url The accessed URL.
  185 \param smart The last entry of the log file.
  186 
  187 \bug The function suspiciously appends the HTML tags to end the HTML file of the user but it doesn't flag the file
  188 as closed so other HTML data may end up after the closing of the HTML and be invisible to the user.
  189 
  190 */