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
244 char outdirname
[MAXLEN
];
245 struct periodstruct period
;
249 char parse_out
[MAXLEN
];
252 char ConfigFile
[MAXLEN
];
257 bool RemoveTempFiles
;
258 char ReplaceIndex
[256];
259 unsigned long int Index
;
260 bool OverwriteReport
;
261 unsigned long int RecordsWithoutUser
;
263 char MailUtility
[PATH_MAX
];
266 char ExcludeCodes
[256];
267 char TopsitesSortField
[15];
268 char TopsitesSortType
[20];
269 unsigned long int ReportType
;
270 char UserTabFile
[255];
276 char AccessLog
[MAXLOGS
][MAXLEN
];
277 int AccessLogFromCmdLine
;
279 char BgColor
[MAXLEN
];
280 char BgImage
[MAXLEN
];
281 char TxColor
[MAXLEN
];
282 char TxBgColor
[MAXLEN
];
283 char TiColor
[MAXLEN
];
284 char LogoImage
[MAXLEN
];
285 char LogoText
[MAXLEN
];
286 char LogoTextColor
[MAXLEN
];
289 char FontFace
[MAXLEN
];
290 char HeaderColor
[MAXLEN
];
291 char HeaderBgColor
[MAXLEN
];
292 char FontSize
[MAXLEN
];
293 char PasswdFile
[MAXLEN
];
294 char TempDir
[MAXLEN
];
295 char OutputDir
[MAXLEN
];
296 char OutputEmail
[MAXLEN
];
297 char TopuserSortField
[30];
298 char UserSortField
[30];
299 char TopuserSortOrder
[10];
300 char UserSortOrder
[10];
301 char UserAgentLog
[255];
303 char ExcludeHosts
[255];
304 char ExcludeUsers
[255];
306 char PerUserLimitFile
[255];
309 char MaxElapsed
[255];
312 char UserInvalidChar
[255];
314 char GraphDaysBytesBarColor
[255];
316 char PrivacyString
[255];
317 char PrivacyStringColor
[30];
318 char IncludeUsers
[MAXLEN
];
319 char ExcludeString
[MAXLEN
];
321 unsigned long int TopUserFields
;
322 unsigned long int UserReportFields
;
323 char DataFile
[MAXLEN
];
324 char DataFileDelimiter
[3];
325 unsigned long int DataFileFields
;
326 unsigned long int DataFileUrl
;
327 bool ShowReadStatistics
;
328 char IndexSortOrder
[5];
329 char DansGuardianConf
[MAXLEN
];
330 bool DansguardianIgnoreDate
;
331 char SquidGuardConf
[MAXLEN
];
332 char SquidGuarddbHome
[255];
333 char SquidGuardLogFormat
[MAXLEN
];
334 char SquidGuardLogAlternate
[MAXLEN
];
335 bool SquidguardIgnoreDate
;
337 bool BytesInSitesUsersReport
;
339 char ParsedOutputLog
[MAXLEN
];
340 char ParsedOutputLogCompress
[512];
341 char DisplayedValues
[20];
342 char HeaderFontSize
[5];
343 char TitleFontSize
[5];
344 char wwwDocumentRoot
[MAXLEN
];
345 char ExternalCSSFile
[MAXLEN
];
347 unsigned long int NtlmUserFormat
;
348 unsigned long int IndexTree
;
349 bool UserAuthentication
;
350 char AuthUserTemplateFile
[1024];
374 char RealtimeTypes
[1024];
377 char RealtimeUnauthRec
[15];
379 char LDAPBindDN
[512];
380 char LDAPBindPW
[255];
382 int LDAPProtocolVersion
;
383 char LDAPBaseSearch
[255];
384 char LDAPFilterSearch
[512];
385 char LDAPTargetAttr
[64];
386 char GraphFont
[MAXLEN
];
393 int dansguardian_count
;
394 int squidguard_count
;
414 int AuthfailReportLimit
;
415 int DeniedReportLimit
;
416 int DownloadReportLimit
;
417 int SiteUsersReportLimit
;
418 int DansGuardianReportLimit
;
419 int SquidGuardReportLimit
;
421 int realtime_refresh
;
422 int realtime_access_log_lines
;
431 long long int nocost
;
440 struct dirent
*direntp
;