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>
108 #if defined(HAVE_FOPEN64)
109 #define _FILE_OFFSET_BITS 64
110 #define MY_FOPEN fopen64
112 #define MY_FOPEN fopen
115 #if !defined(HAVE_BZERO)
116 #define bzero(mem,size) memset(mem,0,size)
119 #if defined(IBERTY_LIB) && !defined(HAVE_MKSTEMP)
120 int mkstemps(char *template, int suffixlen
);
121 #define mkstemp(template) mkstemps(template,0)
124 #if defined(__MINGW32__)
125 #define mkdir(p,m) _mkdir(p)
128 #define WIFEXITED(S) 1
132 #define WEXITSTATUS(S) (S)
135 #endif /*__MINGW32__*/
140 #define REPORT_TYPE_USERS_SITES 0x0001UL
141 #define REPORT_TYPE_SITE_USER_TIME_DATE 0x0002UL
142 #define REPORT_TYPE_TOPUSERS 0x0004UL
143 #define REPORT_TYPE_TOPSITES 0x0008UL
144 #define REPORT_TYPE_SITES_USERS 0x0010UL
145 #define REPORT_TYPE_DATE_TIME 0x0020UL
146 #define REPORT_TYPE_DENIED 0x0040UL
147 #define REPORT_TYPE_AUTH_FAILURES 0x0080UL
148 #define REPORT_TYPE_DOWNLOADS 0x0100UL
150 #define DATA_FIELD_USER 0x0001UL
151 #define DATA_FIELD_DATE 0x0002UL
152 #define DATA_FIELD_TIME 0x0004UL
153 #define DATA_FIELD_URL 0x0008UL
154 #define DATA_FIELD_CONNECT 0x0010UL
155 #define DATA_FIELD_BYTES 0x0020UL
156 #define DATA_FIELD_IN_CACHE 0x0040UL
157 #define DATA_FIELD_OUT_CACHE 0x0080UL
158 #define DATA_FIELD_ELAPSED 0x0100UL
160 #define TOPUSERFIELDS_NUM 0x0001UL
161 #define TOPUSERFIELDS_DATE_TIME 0x0002UL
162 #define TOPUSERFIELDS_USERID 0x0004UL
163 #define TOPUSERFIELDS_CONNECT 0x0008UL
164 #define TOPUSERFIELDS_BYTES 0x0010UL
165 #define TOPUSERFIELDS_SETYB 0x0020UL
166 #define TOPUSERFIELDS_IN_CACHE_OUT 0x0040UL
167 #define TOPUSERFIELDS_USED_TIME 0x0080UL
168 #define TOPUSERFIELDS_MILISEC 0x0100UL
169 #define TOPUSERFIELDS_PTIME 0x0200UL
170 #define TOPUSERFIELDS_TOTAL 0x0400UL
171 #define TOPUSERFIELDS_AVERAGE 0x0800UL
173 #define USERREPORTFIELDS_CONNECT 0x0001UL
174 #define USERREPORTFIELDS_BYTES 0x0002UL
175 #define USERREPORTFIELDS_SETYB 0x0004UL
176 #define USERREPORTFIELDS_IN_CACHE_OUT 0x0008UL
177 #define USERREPORTFIELDS_USED_TIME 0x0010UL
178 #define USERREPORTFIELDS_MILISEC 0x0020UL
179 #define USERREPORTFIELDS_PTIME 0x0040UL
180 #define USERREPORTFIELDS_TOTAL 0x0080UL
181 #define USERREPORTFIELDS_AVERAGE 0x0100UL
183 #define INDEX_YES 0x0001UL
184 #define INDEX_NO 0x0002UL
185 #define INDEX_ONLY 0x0004UL
187 #define INDEX_TREE_DATE 0x0001UL
188 #define INDEX_TREE_FILE 0x0002UL
193 char dirname
[MAXLEN
];
207 char parse_out
[MAXLEN
];
210 char datestimes
[MAXLEN
];
211 char ConfigFile
[MAXLEN
];
216 char day
[3], month
[4], year
[5];
222 char ReplaceIndex
[256];
223 unsigned long int Index
;
226 char RecordsWithoutUser
[20];
228 char MailUtility
[PATH_MAX
];
229 char TopSitesNum
[20];
231 char ExcludeCodes
[256];
232 char TopsitesSortField
[15];
233 char TopsitesSortType
[20];
234 unsigned long int ReportType
;
235 char UserTabFile
[255];
243 char AccessLog
[MAXLOGS
][MAXLEN
];
244 int AccessLogFromCmdLine
;
246 char BgColor
[MAXLEN
];
247 char BgImage
[MAXLEN
];
248 char TxColor
[MAXLEN
];
249 char TxBgColor
[MAXLEN
];
250 char TiColor
[MAXLEN
];
251 char LogoImage
[MAXLEN
];
252 char LogoText
[MAXLEN
];
253 char LogoTextColor
[MAXLEN
];
256 char FontFace
[MAXLEN
];
257 char HeaderColor
[MAXLEN
];
258 char HeaderBgColor
[MAXLEN
];
259 char FontSize
[MAXLEN
];
260 char PasswdFile
[MAXLEN
];
261 char TempDir
[MAXLEN
];
262 char OutputDir
[MAXLEN
];
263 char OutputEmail
[MAXLEN
];
264 char TopuserSortField
[30];
265 char UserSortField
[30];
266 char TopuserSortOrder
[10];
267 char UserSortOrder
[10];
268 char UserAgentLog
[255];
270 char ExcludeHosts
[255];
271 char ExcludeUsers
[255];
273 char PerUserLimitFile
[255];
276 char MaxElapsed
[255];
280 char UserInvalidChar
[255];
282 char GraphDaysBytesBarColor
[255];
284 char PrivacyString
[255];
285 char PrivacyStringColor
[30];
286 char IncludeUsers
[MAXLEN
];
287 char ExcludeString
[MAXLEN
];
289 unsigned long int TopUserFields
;
290 unsigned long int UserReportFields
;
291 char DataFile
[MAXLEN
];
292 char DataFileDelimiter
[3];
293 unsigned long int DataFileFields
;
294 char DataFileUrl
[20];
295 char SiteUserTimeDateType
[10];
296 int ShowReadStatistics
;
297 char IndexSortOrder
[5];
298 char DansGuardianConf
[MAXLEN
];
299 int DansguardianIgnoreDate
;
300 char SquidGuardConf
[MAXLEN
];
301 char SquidGuarddbHome
[255];
302 char SquidGuardLogFormat
[MAXLEN
];
303 char SquidGuardLogAlternate
[MAXLEN
];
304 int SquidguardIgnoreDate
;
306 int BytesInSitesUsersReport
;
308 char ParsedOutputLog
[MAXLEN
];
309 char ParsedOutputLogCompress
[512];
310 char DisplayedValues
[20];
311 char HeaderFontSize
[5];
312 char TitleFontSize
[5];
313 char wwwDocumentRoot
[MAXLEN
];
314 char ExternalCSSFile
[MAXLEN
];
316 char BlockImage
[512];
317 char NtlmUserFormat
[30];
318 unsigned long int IndexTree
;
319 int UserAuthentication
;
320 char AuthUserFile
[255];
342 char html_old
[MAXLEN
];
352 char RealtimeTypes
[1024];
357 char RealtimeUnauthRec
[15];
359 char LDAPBindDN
[512];
360 char LDAPBindPW
[255];
362 int LDAPProtocolVersion
;
363 char LDAPBaseSearch
[255];
364 char LDAPFilterSearch
[512];
365 char LDAPTargetAttr
[64];
372 int dansguardian_count
;
373 int squidguard_count
;
393 int AuthfailReportLimit
;
394 int DeniedReportLimit
;
395 int DownloadReportLimit
;
396 int SiteUsersReportLimit
;
397 int DansGuardianReportLimit
;
398 int SquidGuardReportLimit
;
401 int realtime_refresh
;
402 int realtime_access_log_lines
;
413 long long int nocost
;
422 struct dirent
*direntp
;