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)
126 #define _(String) gettext(String)
128 #define N_(String) gettext_noop(String)
130 #define N_(String) (String)
133 #define _(String) (String)
134 #define N_(String) (String)
135 #define textdomain(String)
136 #define bindtextdomain(Domain,Directory)
139 #if defined(__MINGW32__)
140 #define mkdir(p,m) _mkdir(p)
143 #define WIFEXITED(S) 1
147 #define WEXITSTATUS(S) (S)
150 #endif /*__MINGW32__*/
153 #define MAX_URL_LEN 40000
156 #define REPORT_TYPE_USERS_SITES 0x0001UL
157 #define REPORT_TYPE_SITE_USER_TIME_DATE 0x0002UL
158 #define REPORT_TYPE_TOPUSERS 0x0004UL
159 #define REPORT_TYPE_TOPSITES 0x0008UL
160 #define REPORT_TYPE_SITES_USERS 0x0010UL
161 #define REPORT_TYPE_DATE_TIME 0x0020UL
162 #define REPORT_TYPE_DENIED 0x0040UL
163 #define REPORT_TYPE_AUTH_FAILURES 0x0080UL
164 #define REPORT_TYPE_DOWNLOADS 0x0100UL
166 #define DATA_FIELD_USER 0x0001UL
167 #define DATA_FIELD_DATE 0x0002UL
168 #define DATA_FIELD_TIME 0x0004UL
169 #define DATA_FIELD_URL 0x0008UL
170 #define DATA_FIELD_CONNECT 0x0010UL
171 #define DATA_FIELD_BYTES 0x0020UL
172 #define DATA_FIELD_IN_CACHE 0x0040UL
173 #define DATA_FIELD_OUT_CACHE 0x0080UL
174 #define DATA_FIELD_ELAPSED 0x0100UL
176 #define TOPUSERFIELDS_NUM 0x0001UL
177 #define TOPUSERFIELDS_DATE_TIME 0x0002UL
178 #define TOPUSERFIELDS_USERID 0x0004UL
179 #define TOPUSERFIELDS_CONNECT 0x0008UL
180 #define TOPUSERFIELDS_BYTES 0x0010UL
181 #define TOPUSERFIELDS_SETYB 0x0020UL
182 #define TOPUSERFIELDS_IN_CACHE_OUT 0x0040UL
183 #define TOPUSERFIELDS_USED_TIME 0x0080UL
184 #define TOPUSERFIELDS_MILISEC 0x0100UL
185 #define TOPUSERFIELDS_PTIME 0x0200UL
186 #define TOPUSERFIELDS_TOTAL 0x0400UL
187 #define TOPUSERFIELDS_AVERAGE 0x0800UL
189 #define USERREPORTFIELDS_CONNECT 0x0001UL
190 #define USERREPORTFIELDS_BYTES 0x0002UL
191 #define USERREPORTFIELDS_SETYB 0x0004UL
192 #define USERREPORTFIELDS_IN_CACHE_OUT 0x0008UL
193 #define USERREPORTFIELDS_USED_TIME 0x0010UL
194 #define USERREPORTFIELDS_MILISEC 0x0020UL
195 #define USERREPORTFIELDS_PTIME 0x0040UL
196 #define USERREPORTFIELDS_TOTAL 0x0080UL
197 #define USERREPORTFIELDS_AVERAGE 0x0100UL
199 #define INDEX_YES 0x0001UL
200 #define INDEX_NO 0x0002UL
201 #define INDEX_ONLY 0x0004UL
203 #define INDEX_TREE_DATE 0x0001UL
204 #define INDEX_TREE_FILE 0x0002UL
209 char dirname
[MAXLEN
];
221 char parse_out
[MAXLEN
];
224 char datestimes
[MAXLEN
];
225 char ConfigFile
[MAXLEN
];
230 char day
[3], month
[4], year
[5];
235 char ReplaceIndex
[256];
236 unsigned long int Index
;
239 char RecordsWithoutUser
[20];
241 char MailUtility
[PATH_MAX
];
244 char ExcludeCodes
[256];
245 char TopsitesSortField
[15];
246 char TopsitesSortType
[20];
247 unsigned long int ReportType
;
248 char UserTabFile
[255];
256 char AccessLog
[MAXLOGS
][MAXLEN
];
257 int AccessLogFromCmdLine
;
259 char BgColor
[MAXLEN
];
260 char BgImage
[MAXLEN
];
261 char TxColor
[MAXLEN
];
262 char TxBgColor
[MAXLEN
];
263 char TiColor
[MAXLEN
];
264 char LogoImage
[MAXLEN
];
265 char LogoText
[MAXLEN
];
266 char LogoTextColor
[MAXLEN
];
269 char FontFace
[MAXLEN
];
270 char HeaderColor
[MAXLEN
];
271 char HeaderBgColor
[MAXLEN
];
272 char FontSize
[MAXLEN
];
273 char PasswdFile
[MAXLEN
];
274 char TempDir
[MAXLEN
];
275 char OutputDir
[MAXLEN
];
276 char OutputEmail
[MAXLEN
];
277 char TopuserSortField
[30];
278 char UserSortField
[30];
279 char TopuserSortOrder
[10];
280 char UserSortOrder
[10];
281 char UserAgentLog
[255];
283 char ExcludeHosts
[255];
284 char ExcludeUsers
[255];
286 char PerUserLimitFile
[255];
289 char MaxElapsed
[255];
293 char UserInvalidChar
[255];
295 char GraphDaysBytesBarColor
[255];
297 char PrivacyString
[255];
298 char PrivacyStringColor
[30];
299 char IncludeUsers
[MAXLEN
];
300 char ExcludeString
[MAXLEN
];
302 unsigned long int TopUserFields
;
303 unsigned long int UserReportFields
;
304 char DataFile
[MAXLEN
];
305 char DataFileDelimiter
[3];
306 unsigned long int DataFileFields
;
307 char DataFileUrl
[20];
308 int ShowReadStatistics
;
309 char IndexSortOrder
[5];
310 char DansGuardianConf
[MAXLEN
];
311 int DansguardianIgnoreDate
;
312 char SquidGuardConf
[MAXLEN
];
313 char SquidGuarddbHome
[255];
314 char SquidGuardLogFormat
[MAXLEN
];
315 char SquidGuardLogAlternate
[MAXLEN
];
316 int SquidguardIgnoreDate
;
318 int BytesInSitesUsersReport
;
320 char ParsedOutputLog
[MAXLEN
];
321 char ParsedOutputLogCompress
[512];
322 char DisplayedValues
[20];
323 char HeaderFontSize
[5];
324 char TitleFontSize
[5];
325 char wwwDocumentRoot
[MAXLEN
];
326 char ExternalCSSFile
[MAXLEN
];
328 char NtlmUserFormat
[30];
329 unsigned long int IndexTree
;
330 int UserAuthentication
;
331 char AuthUserFile
[255];
362 char RealtimeTypes
[1024];
367 char RealtimeUnauthRec
[15];
369 char LDAPBindDN
[512];
370 char LDAPBindPW
[255];
372 int LDAPProtocolVersion
;
373 char LDAPBaseSearch
[255];
374 char LDAPFilterSearch
[512];
375 char LDAPTargetAttr
[64];
376 char GraphFont
[MAXLEN
];
383 int dansguardian_count
;
384 int squidguard_count
;
405 int AuthfailReportLimit
;
406 int DeniedReportLimit
;
407 int DownloadReportLimit
;
408 int SiteUsersReportLimit
;
409 int DansGuardianReportLimit
;
410 int SquidGuardReportLimit
;
413 int realtime_refresh
;
414 int realtime_access_log_lines
;
425 long long int nocost
;
434 struct dirent
*direntp
;