3 #include "btree_cache.h"
20 #ifdef HAVE_SYS_TIME_H
26 #ifdef HAVE_SYS_RESOURCE_H
27 #include <sys/resource.h>
32 #if defined(HAVE_SYS_DIRENT_H) && !defined(HAVE_DIRENT_H)
33 #include <sys/dirent.h>
38 #ifdef HAVE_SYS_SOCKET_H
39 #include <sys/socket.h>
47 #ifdef HAVE_NETINET_IN_H
48 #include <netinet/in.h>
50 #ifdef HAVE_ARPA_INET_H
51 #include <arpa/inet.h>
53 #ifdef HAVE_SYS_STAT_H
62 #ifdef HAVE_SYS_WAIT_H
80 #ifdef HAVE_GDFONTMB_H
89 #ifdef HAVE_INTTYPES_H
104 #ifdef HAVE_EXECINFO_H
105 #include <execinfo.h>
110 #ifdef HAVE_STDBOOL_H
118 #if defined(HAVE_FOPEN64)
119 #define _FILE_OFFSET_BITS 64
120 #define MY_FOPEN fopen64
122 #define MY_FOPEN fopen
125 #if !defined(HAVE_BZERO)
126 #define bzero(mem,size) memset(mem,0,size)
129 #if defined(IBERTY_LIB) && !defined(HAVE_MKSTEMP)
130 int mkstemps(char *template, int suffixlen
);
131 #define mkstemp(template) mkstemps(template,0)
134 #if defined(ENABLE_NLS) && defined(HAVE_LIBINTL_H)
136 #define _(String) gettext(String)
138 #define N_(String) gettext_noop(String)
140 #define N_(String) (String)
143 #define _(String) (String)
144 #define N_(String) (String)
145 #define ngettext(String,Strings,num) (Strings)
146 #define textdomain(String)
147 #define bindtextdomain(Domain,Directory)
150 #if defined(__MINGW32__)
151 #define mkdir(p,m) _mkdir(p)
154 #define WIFEXITED(S) 1
158 #define WEXITSTATUS(S) (S)
161 #endif /*__MINGW32__*/
164 # define __attribute__(x)
168 #define MAX_URL_LEN 40000
169 #define MAX_TRUNCATED_URL 512
170 #define MAX_USER_LEN 256
171 #define MAX_USER_FNAME_LEN 128
172 #define MAX_IP_LEN 64
173 #define MAX_DATETIME_LEN 32
176 #define REPORT_TYPE_USERS_SITES 0x0001UL
177 #define REPORT_TYPE_SITE_USER_TIME_DATE 0x0002UL
178 #define REPORT_TYPE_TOPUSERS 0x0004UL
179 #define REPORT_TYPE_TOPSITES 0x0008UL
180 #define REPORT_TYPE_SITES_USERS 0x0010UL
181 #define REPORT_TYPE_DATE_TIME 0x0020UL
182 #define REPORT_TYPE_DENIED 0x0040UL
183 #define REPORT_TYPE_AUTH_FAILURES 0x0080UL
184 #define REPORT_TYPE_DOWNLOADS 0x0100UL
186 #define DATA_FIELD_USER 0x0001UL
187 #define DATA_FIELD_DATE 0x0002UL
188 #define DATA_FIELD_TIME 0x0004UL
189 #define DATA_FIELD_URL 0x0008UL
190 #define DATA_FIELD_CONNECT 0x0010UL
191 #define DATA_FIELD_BYTES 0x0020UL
192 #define DATA_FIELD_IN_CACHE 0x0040UL
193 #define DATA_FIELD_OUT_CACHE 0x0080UL
194 #define DATA_FIELD_ELAPSED 0x0100UL
196 #define TOPUSERFIELDS_NUM 0x0001UL
197 #define TOPUSERFIELDS_DATE_TIME 0x0002UL
198 #define TOPUSERFIELDS_USERID 0x0004UL
199 #define TOPUSERFIELDS_CONNECT 0x0008UL
200 #define TOPUSERFIELDS_BYTES 0x0010UL
201 #define TOPUSERFIELDS_SETYB 0x0020UL
202 #define TOPUSERFIELDS_IN_CACHE_OUT 0x0040UL
203 #define TOPUSERFIELDS_USED_TIME 0x0080UL
204 #define TOPUSERFIELDS_MILISEC 0x0100UL
205 #define TOPUSERFIELDS_PTIME 0x0200UL
206 #define TOPUSERFIELDS_TOTAL 0x0400UL
207 #define TOPUSERFIELDS_AVERAGE 0x0800UL
209 #define USERREPORTFIELDS_CONNECT 0x0001UL
210 #define USERREPORTFIELDS_BYTES 0x0002UL
211 #define USERREPORTFIELDS_SETYB 0x0004UL
212 #define USERREPORTFIELDS_IN_CACHE_OUT 0x0008UL
213 #define USERREPORTFIELDS_USED_TIME 0x0010UL
214 #define USERREPORTFIELDS_MILISEC 0x0020UL
215 #define USERREPORTFIELDS_PTIME 0x0040UL
216 #define USERREPORTFIELDS_TOTAL 0x0080UL
217 #define USERREPORTFIELDS_AVERAGE 0x0100UL
219 #define INDEX_YES 0x0001UL
220 #define INDEX_NO 0x0002UL
221 #define INDEX_ONLY 0x0004UL
223 #define INDEX_TREE_DATE 0x0001UL
224 #define INDEX_TREE_FILE 0x0002UL
226 #define NTLMUSERFORMAT_USER 0x0001UL
227 #define NTLMUSERFORMAT_DOMAINUSER 0x0002UL
229 #define RECORDWITHOUTUSER_IP 0x0001UL
230 #define RECORDWITHOUTUSER_IGNORE 0x0002UL
231 #define RECORDWITHOUTUSER_EVERYBODY 0x0004UL
233 #define DATAFILEURL_IP 0x0001UL
234 #define DATAFILEURL_NAME 0x0002UL
238 //! The first date of the period.
240 //! The last date of the period.
242 //! The textual representation of the date.
244 //! The HTML representation of the date.
249 char outdirname
[MAXLEN
];
250 struct periodstruct period
;
254 char parse_out
[MAXLEN
];
257 char ConfigFile
[MAXLEN
];
260 bool RemoveTempFiles
;
261 char ReplaceIndex
[256];
262 unsigned long int Index
;
263 bool OverwriteReport
;
264 unsigned long int RecordsWithoutUser
;
266 char MailUtility
[PATH_MAX
];
269 char ExcludeCodes
[256];
270 char TopsitesSortField
[15];
271 char TopsitesSortType
[20];
272 unsigned long int ReportType
;
273 char UserTabFile
[255];
279 char AccessLog
[MAXLOGS
][MAXLEN
];
280 int AccessLogFromCmdLine
;
282 char BgColor
[MAXLEN
];
283 char BgImage
[MAXLEN
];
284 char TxColor
[MAXLEN
];
285 char TxBgColor
[MAXLEN
];
286 char TiColor
[MAXLEN
];
287 char LogoImage
[MAXLEN
];
288 char LogoText
[MAXLEN
];
289 char LogoTextColor
[MAXLEN
];
292 char FontFace
[MAXLEN
];
293 char HeaderColor
[MAXLEN
];
294 char HeaderBgColor
[MAXLEN
];
295 char FontSize
[MAXLEN
];
296 char PasswdFile
[MAXLEN
];
297 char TempDir
[MAXLEN
];
298 char OutputDir
[MAXLEN
];
299 char OutputEmail
[MAXLEN
];
300 char TopuserSortField
[30];
301 char UserSortField
[30];
302 char TopuserSortOrder
[10];
303 char UserSortOrder
[10];
304 char UserAgentLog
[255];
306 char ExcludeHosts
[255];
307 char ExcludeUsers
[255];
309 char PerUserLimitFile
[255];
312 char MaxElapsed
[255];
315 char UserInvalidChar
[255];
317 char GraphDaysBytesBarColor
[255];
319 char PrivacyString
[255];
320 char PrivacyStringColor
[30];
321 char IncludeUsers
[MAXLEN
];
322 char ExcludeString
[MAXLEN
];
324 unsigned long int TopUserFields
;
325 unsigned long int UserReportFields
;
326 char DataFile
[MAXLEN
];
327 char DataFileDelimiter
[3];
328 unsigned long int DataFileFields
;
329 unsigned long int DataFileUrl
;
330 bool ShowReadStatistics
;
331 char IndexSortOrder
[5];
332 char DansGuardianConf
[MAXLEN
];
333 bool DansguardianIgnoreDate
;
334 char SquidGuardConf
[MAXLEN
];
335 char SquidGuarddbHome
[255];
336 char SquidGuardLogFormat
[MAXLEN
];
337 char SquidGuardLogAlternate
[MAXLEN
];
338 bool SquidguardIgnoreDate
;
340 bool BytesInSitesUsersReport
;
342 char ParsedOutputLog
[MAXLEN
];
343 char ParsedOutputLogCompress
[512];
344 char DisplayedValues
[20];
345 char HeaderFontSize
[5];
346 char TitleFontSize
[5];
347 char wwwDocumentRoot
[MAXLEN
];
348 char ExternalCSSFile
[MAXLEN
];
350 unsigned long int NtlmUserFormat
;
351 unsigned long int IndexTree
;
352 bool UserAuthentication
;
353 char AuthUserTemplateFile
[1024];
377 char RealtimeTypes
[1024];
380 char RealtimeUnauthRec
[15];
382 char LDAPBindDN
[512];
383 char LDAPBindPW
[255];
385 int LDAPProtocolVersion
;
386 char LDAPBaseSearch
[255];
387 char LDAPFilterSearch
[512];
388 char LDAPTargetAttr
[64];
389 char GraphFont
[MAXLEN
];
396 int dansguardian_count
;
397 int squidguard_count
;
416 int AuthfailReportLimit
;
417 int DeniedReportLimit
;
418 int DownloadReportLimit
;
419 int SiteUsersReportLimit
;
420 int DansGuardianReportLimit
;
421 int SquidGuardReportLimit
;
423 int realtime_refresh
;
424 int realtime_access_log_lines
;
433 long long int nocost
;
442 struct dirent
*direntp
;