File: report.txt

package info (click to toggle)
sarg 2.4.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,456 kB
  • sloc: ansic: 17,692; sh: 4,581; xml: 371; javascript: 352; php: 205; makefile: 183; sed: 16; pascal: 2
file content (190 lines) | stat: -rw-r--r-- 6,929 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/*! \file report.c
\brief Generate the reports.
*/

/*! \fn void gerarel(void)
Generate the reports from the files created by main() in the temporary directory and sorted
by sort_users_log().

The function outputs several files:

\arg \c user.utmp: The URL accessed by the user.
\arg \c user.htmp: The date and time of usage of the web.

The files are then organized in reports.

*/





/*! \fn static void maketmp(const char *user, const char *dirname, int debug, int indexonly)
Create a temporary file with the extension \c utmp to store the sites accessed by the user.

\param user The name of the user.
\param dirname The directory where to create the file.
\param debug \c True to run in debug mode.
\param indexonly \c True if only an index is created and not the actual files.

The content of the file is created one line at a time by gravatmp().
*/






/*! \fn static void maketmp_hour(const char *user, const char *dirname, int indexonly)
Create a temporary file with the extension \c htmp to store the times the user surfed the web.

\param user The name of the user.
\param dirname The directory where to create the file.
\param indexonly \c True if only an index is created and not the actual files.

The content of the file is created one line at a time by gravatmp_hora().

*/





/*! \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)
Append one line into the \c utmp temporary file of the user.

\param oldaccuser The user.
\param dirname The directory with the temporary file.
\param oldurl The URL being accessed.
\param nacc The number of access to the site.
\param nbytes The number of bytes transfered.
\param oldmsg The status of the connection.
\param nelap The time spent downloading the data.
\param indexonly \c True if only an index is created and not the actual files.
\param incache The number of bytes fetched from the cache of squid.
\param oucache The number of bytes not fetched from the cache of squid.

The file contains one line per entry with the following informations in that order:
\arg the number of access;
\arg the number of bytes transfered;
\arg the URL access by the user;
\arg the status of the connection;
\arg the time spent downloading that URL;
\arg the number of bytes comming from the cache of squid;
\arg the number of bytes not found in the cache of squid.
*/





/*! \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)
Append one line into the \c htmp temporary file of the user.

\param dirname The directory with the temporary file.
\param user The user.
\param data The date of the access.
\param hora The time of the access.
\param elap The time spent.
\param bytes The number of bytes transfered.
\param indexonly \c True if only an index is created and not the actual files.

The file contains one line per entry with the following informations in that order:
\arg the date;
\arg the time;
\arg the number of bytes transfered or the time spent downloading them.

*/





/*! \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)
Append one line into the \c ip temporary file of the user.

\param user The user.
\param dirname The directory with the temporary file.
\param url The URL accessed by the user.
\param ip The IP from which the user is accessing the web.
\param data The date of the access.
\param hora The time of the access.
\param tam The number of bytes transfered.
\param elap The time spent.
\param indexonly \c True if only an index is created and not the actual files.
*/





/*! \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)
Looks suspiciously identical to gravatmp() except that it reset ::ind2 to zero.

\param oldaccuser The user.
\param dirname The directory with the temporary file.
\param oldurl The URL being accessed.
\param nacc The number of access to the site.
\param nbytes The number of bytes transfered.
\param oldmsg Unused.
\param nelap The time spent downloading the data.
\param indexonly \c True if only an index is created and not the actual files.
\param incache The number of bytes fetched from the cache of squid.
\param oucache The number of bytes not fetched from the cache of squid.
*/





/*! \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)
Append a record to the sarg-general file.

\param dirname The directory where the sarg-general file is. The string is modified when the function returns.
\param user The user making the connection.
\param nacc The number of access to the site.
\param url The accessed URL.
\param nbytes the number of bytes transfered.
\param ip The IP address of the user.
\param hora The time of the access.
\param dia The date of the access.
\param nelap The time spent on that site.
\param incache Number of bytes fetched from the cache of squid.
\param oucache Number of bytes not found in the cache of squid.
*/




/*! \fn int ger_read(char *buffer,struct generalitemstruct *item,const char *filename)
Parse one line of the file written by gravager().

\param buffer The line of text to parse.
\param item The structure to fill with the data parsed from the line. The structure contains
pointers to strings but some of them are limited in length to detect a corruption of the file
and to let the caller use simple string manipulation functions with fixed size buffer.
\param filename The name of the file from which the line is extracted to report it if an
error is found.

\return Zero on succes. The program exits if an error is found.
*/





/*! \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)
Append a record into the \c smartfilter.unsort file of the specified directory.

\param dirname The directory where to create the file.
\param user The user to store in the record.
\param ip The IP used by the user.
\param data The date of the access.
\param hora The time of the access.
\param url The accessed URL.
\param smart The last entry of the log file.

\bug The function suspiciously appends the HTML tags to end the HTML file of the user but it doesn't flag the file
as closed so other HTML data may end up after the closing of the HTML and be invisible to the user.

*/