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>
111 #if defined(HAVE_FOPEN64)
112 #define _FILE_OFFSET_BITS 64
113 #define MY_FOPEN fopen64
115 #define MY_FOPEN fopen
118 #if !defined(HAVE_BZERO)
119 #define bzero(mem,size) memset(mem,0,size)
122 #if defined(IBERTY_LIB) && !defined(HAVE_MKSTEMP)
123 int mkstemps(char *template, int suffixlen
);
124 #define mkstemp(template) mkstemps(template,0)
127 #if defined(ENABLE_NLS) && defined(HAVE_LIBINTL_H)
129 #define _(String) gettext(String)
131 #define N_(String) gettext_noop(String)
133 #define N_(String) (String)
136 #define _(String) (String)
137 #define N_(String) (String)
138 #define textdomain(String)
139 #define bindtextdomain(Domain,Directory)
142 #if defined(__MINGW32__)
143 #define mkdir(p,m) _mkdir(p)
146 #define WIFEXITED(S) 1
150 #define WEXITSTATUS(S) (S)
153 #endif /*__MINGW32__*/
156 #define MAX_URL_LEN 40000
157 #define MAX_TRUNCATED_URL 512
158 #define MAX_USER_LEN 256
159 #define MAX_USER_FNAME_LEN 128
160 #define MAX_IP_LEN 64
161 #define MAX_DATETIME_LEN 32
164 #define REPORT_TYPE_USERS_SITES 0x0001UL
165 #define REPORT_TYPE_SITE_USER_TIME_DATE 0x0002UL
166 #define REPORT_TYPE_TOPUSERS 0x0004UL
167 #define REPORT_TYPE_TOPSITES 0x0008UL
168 #define REPORT_TYPE_SITES_USERS 0x0010UL
169 #define REPORT_TYPE_DATE_TIME 0x0020UL
170 #define REPORT_TYPE_DENIED 0x0040UL
171 #define REPORT_TYPE_AUTH_FAILURES 0x0080UL
172 #define REPORT_TYPE_DOWNLOADS 0x0100UL
174 #define DATA_FIELD_USER 0x0001UL
175 #define DATA_FIELD_DATE 0x0002UL
176 #define DATA_FIELD_TIME 0x0004UL
177 #define DATA_FIELD_URL 0x0008UL
178 #define DATA_FIELD_CONNECT 0x0010UL
179 #define DATA_FIELD_BYTES 0x0020UL
180 #define DATA_FIELD_IN_CACHE 0x0040UL
181 #define DATA_FIELD_OUT_CACHE 0x0080UL
182 #define DATA_FIELD_ELAPSED 0x0100UL
184 #define TOPUSERFIELDS_NUM 0x0001UL
185 #define TOPUSERFIELDS_DATE_TIME 0x0002UL
186 #define TOPUSERFIELDS_USERID 0x0004UL
187 #define TOPUSERFIELDS_CONNECT 0x0008UL
188 #define TOPUSERFIELDS_BYTES 0x0010UL
189 #define TOPUSERFIELDS_SETYB 0x0020UL
190 #define TOPUSERFIELDS_IN_CACHE_OUT 0x0040UL
191 #define TOPUSERFIELDS_USED_TIME 0x0080UL
192 #define TOPUSERFIELDS_MILISEC 0x0100UL
193 #define TOPUSERFIELDS_PTIME 0x0200UL
194 #define TOPUSERFIELDS_TOTAL 0x0400UL
195 #define TOPUSERFIELDS_AVERAGE 0x0800UL
197 #define USERREPORTFIELDS_CONNECT 0x0001UL
198 #define USERREPORTFIELDS_BYTES 0x0002UL
199 #define USERREPORTFIELDS_SETYB 0x0004UL
200 #define USERREPORTFIELDS_IN_CACHE_OUT 0x0008UL
201 #define USERREPORTFIELDS_USED_TIME 0x0010UL
202 #define USERREPORTFIELDS_MILISEC 0x0020UL
203 #define USERREPORTFIELDS_PTIME 0x0040UL
204 #define USERREPORTFIELDS_TOTAL 0x0080UL
205 #define USERREPORTFIELDS_AVERAGE 0x0100UL
207 #define INDEX_YES 0x0001UL
208 #define INDEX_NO 0x0002UL
209 #define INDEX_ONLY 0x0004UL
211 #define INDEX_TREE_DATE 0x0001UL
212 #define INDEX_TREE_FILE 0x0002UL
214 #define NTLMUSERFORMAT_USER 0x0001UL
215 #define NTLMUSERFORMAT_DOMAINUSER 0x0002UL
217 #define RECORDWITHOUTUSER_IP 0x0001UL
218 #define RECORDWITHOUTUSER_IGNORE 0x0002UL
219 #define RECORDWITHOUTUSER_EVERYBODY 0x0004UL
221 #define DATAFILEURL_IP 0x0001UL
222 #define DATAFILEURL_NAME 0x0002UL
225 char outdirname
[MAXLEN
];
231 char parse_out
[MAXLEN
];
234 char ConfigFile
[MAXLEN
];
240 char ReplaceIndex
[256];
241 unsigned long int Index
;
243 unsigned long int RecordsWithoutUser
;
245 char MailUtility
[PATH_MAX
];
248 char ExcludeCodes
[256];
249 char TopsitesSortField
[15];
250 char TopsitesSortType
[20];
251 unsigned long int ReportType
;
252 char UserTabFile
[255];
258 char AccessLog
[MAXLOGS
][MAXLEN
];
259 int AccessLogFromCmdLine
;
261 char BgColor
[MAXLEN
];
262 char BgImage
[MAXLEN
];
263 char TxColor
[MAXLEN
];
264 char TxBgColor
[MAXLEN
];
265 char TiColor
[MAXLEN
];
266 char LogoImage
[MAXLEN
];
267 char LogoText
[MAXLEN
];
268 char LogoTextColor
[MAXLEN
];
271 char FontFace
[MAXLEN
];
272 char HeaderColor
[MAXLEN
];
273 char HeaderBgColor
[MAXLEN
];
274 char FontSize
[MAXLEN
];
275 char PasswdFile
[MAXLEN
];
276 char TempDir
[MAXLEN
];
277 char OutputDir
[MAXLEN
];
278 char OutputEmail
[MAXLEN
];
279 char TopuserSortField
[30];
280 char UserSortField
[30];
281 char TopuserSortOrder
[10];
282 char UserSortOrder
[10];
283 char UserAgentLog
[255];
285 char ExcludeHosts
[255];
286 char ExcludeUsers
[255];
288 char PerUserLimitFile
[255];
291 char MaxElapsed
[255];
294 char UserInvalidChar
[255];
296 char GraphDaysBytesBarColor
[255];
298 char PrivacyString
[255];
299 char PrivacyStringColor
[30];
300 char IncludeUsers
[MAXLEN
];
301 char ExcludeString
[MAXLEN
];
303 unsigned long int TopUserFields
;
304 unsigned long int UserReportFields
;
305 char DataFile
[MAXLEN
];
306 char DataFileDelimiter
[3];
307 unsigned long int DataFileFields
;
308 unsigned long int DataFileUrl
;
309 int ShowReadStatistics
;
310 char IndexSortOrder
[5];
311 char DansGuardianConf
[MAXLEN
];
312 int DansguardianIgnoreDate
;
313 char SquidGuardConf
[MAXLEN
];
314 char SquidGuarddbHome
[255];
315 char SquidGuardLogFormat
[MAXLEN
];
316 char SquidGuardLogAlternate
[MAXLEN
];
317 int SquidguardIgnoreDate
;
319 int BytesInSitesUsersReport
;
321 char ParsedOutputLog
[MAXLEN
];
322 char ParsedOutputLogCompress
[512];
323 char DisplayedValues
[20];
324 char HeaderFontSize
[5];
325 char TitleFontSize
[5];
326 char wwwDocumentRoot
[MAXLEN
];
327 char ExternalCSSFile
[MAXLEN
];
329 unsigned long int NtlmUserFormat
;
330 unsigned long int IndexTree
;
331 int UserAuthentication
;
332 char AuthUserTemplateFile
[1024];
359 char RealtimeTypes
[1024];
364 char RealtimeUnauthRec
[15];
366 char LDAPBindDN
[512];
367 char LDAPBindPW
[255];
369 int LDAPProtocolVersion
;
370 char LDAPBaseSearch
[255];
371 char LDAPFilterSearch
[512];
372 char LDAPTargetAttr
[64];
373 char GraphFont
[MAXLEN
];
380 int dansguardian_count
;
381 int squidguard_count
;
401 int AuthfailReportLimit
;
402 int DeniedReportLimit
;
403 int DownloadReportLimit
;
404 int SiteUsersReportLimit
;
405 int DansGuardianReportLimit
;
406 int SquidGuardReportLimit
;
408 int realtime_refresh
;
409 int realtime_access_log_lines
;
420 long long int nocost
;
429 struct dirent
*direntp
;