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(ENABLE_NLS) && defined(HAVE_LIBINTL_H)
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
154 #define MAX_TRUNCATED_URL 512
155 #define MAX_USER_LEN 256
156 #define MAX_USER_FNAME_LEN 128
157 #define MAX_IP_LEN 64
158 #define MAX_DATETIME_LEN 32
161 #define REPORT_TYPE_USERS_SITES 0x0001UL
162 #define REPORT_TYPE_SITE_USER_TIME_DATE 0x0002UL
163 #define REPORT_TYPE_TOPUSERS 0x0004UL
164 #define REPORT_TYPE_TOPSITES 0x0008UL
165 #define REPORT_TYPE_SITES_USERS 0x0010UL
166 #define REPORT_TYPE_DATE_TIME 0x0020UL
167 #define REPORT_TYPE_DENIED 0x0040UL
168 #define REPORT_TYPE_AUTH_FAILURES 0x0080UL
169 #define REPORT_TYPE_DOWNLOADS 0x0100UL
171 #define DATA_FIELD_USER 0x0001UL
172 #define DATA_FIELD_DATE 0x0002UL
173 #define DATA_FIELD_TIME 0x0004UL
174 #define DATA_FIELD_URL 0x0008UL
175 #define DATA_FIELD_CONNECT 0x0010UL
176 #define DATA_FIELD_BYTES 0x0020UL
177 #define DATA_FIELD_IN_CACHE 0x0040UL
178 #define DATA_FIELD_OUT_CACHE 0x0080UL
179 #define DATA_FIELD_ELAPSED 0x0100UL
181 #define TOPUSERFIELDS_NUM 0x0001UL
182 #define TOPUSERFIELDS_DATE_TIME 0x0002UL
183 #define TOPUSERFIELDS_USERID 0x0004UL
184 #define TOPUSERFIELDS_CONNECT 0x0008UL
185 #define TOPUSERFIELDS_BYTES 0x0010UL
186 #define TOPUSERFIELDS_SETYB 0x0020UL
187 #define TOPUSERFIELDS_IN_CACHE_OUT 0x0040UL
188 #define TOPUSERFIELDS_USED_TIME 0x0080UL
189 #define TOPUSERFIELDS_MILISEC 0x0100UL
190 #define TOPUSERFIELDS_PTIME 0x0200UL
191 #define TOPUSERFIELDS_TOTAL 0x0400UL
192 #define TOPUSERFIELDS_AVERAGE 0x0800UL
194 #define USERREPORTFIELDS_CONNECT 0x0001UL
195 #define USERREPORTFIELDS_BYTES 0x0002UL
196 #define USERREPORTFIELDS_SETYB 0x0004UL
197 #define USERREPORTFIELDS_IN_CACHE_OUT 0x0008UL
198 #define USERREPORTFIELDS_USED_TIME 0x0010UL
199 #define USERREPORTFIELDS_MILISEC 0x0020UL
200 #define USERREPORTFIELDS_PTIME 0x0040UL
201 #define USERREPORTFIELDS_TOTAL 0x0080UL
202 #define USERREPORTFIELDS_AVERAGE 0x0100UL
204 #define INDEX_YES 0x0001UL
205 #define INDEX_NO 0x0002UL
206 #define INDEX_ONLY 0x0004UL
208 #define INDEX_TREE_DATE 0x0001UL
209 #define INDEX_TREE_FILE 0x0002UL
211 #define NTLMUSERFORMAT_USER 0x0001UL
212 #define NTLMUSERFORMAT_DOMAINUSER 0x0002UL
214 #define RECORDWITHOUTUSER_IP 0x0001UL
215 #define RECORDWITHOUTUSER_IGNORE 0x0002UL
216 #define RECORDWITHOUTUSER_EVERYBODY 0x0004UL
219 char dirname
[MAXLEN
];
225 char parse_out
[MAXLEN
];
228 char ConfigFile
[MAXLEN
];
234 char ReplaceIndex
[256];
235 unsigned long int Index
;
237 unsigned long int RecordsWithoutUser
;
239 char MailUtility
[PATH_MAX
];
242 char ExcludeCodes
[256];
243 char TopsitesSortField
[15];
244 char TopsitesSortType
[20];
245 unsigned long int ReportType
;
246 char UserTabFile
[255];
253 char AccessLog
[MAXLOGS
][MAXLEN
];
254 int AccessLogFromCmdLine
;
256 char BgColor
[MAXLEN
];
257 char BgImage
[MAXLEN
];
258 char TxColor
[MAXLEN
];
259 char TxBgColor
[MAXLEN
];
260 char TiColor
[MAXLEN
];
261 char LogoImage
[MAXLEN
];
262 char LogoText
[MAXLEN
];
263 char LogoTextColor
[MAXLEN
];
266 char FontFace
[MAXLEN
];
267 char HeaderColor
[MAXLEN
];
268 char HeaderBgColor
[MAXLEN
];
269 char FontSize
[MAXLEN
];
270 char PasswdFile
[MAXLEN
];
271 char TempDir
[MAXLEN
];
272 char OutputDir
[MAXLEN
];
273 char OutputEmail
[MAXLEN
];
274 char TopuserSortField
[30];
275 char UserSortField
[30];
276 char TopuserSortOrder
[10];
277 char UserSortOrder
[10];
278 char UserAgentLog
[255];
280 char ExcludeHosts
[255];
281 char ExcludeUsers
[255];
283 char PerUserLimitFile
[255];
286 char MaxElapsed
[255];
289 char UserInvalidChar
[255];
291 char GraphDaysBytesBarColor
[255];
293 char PrivacyString
[255];
294 char PrivacyStringColor
[30];
295 char IncludeUsers
[MAXLEN
];
296 char ExcludeString
[MAXLEN
];
298 unsigned long int TopUserFields
;
299 unsigned long int UserReportFields
;
300 char DataFile
[MAXLEN
];
301 char DataFileDelimiter
[3];
302 unsigned long int DataFileFields
;
303 char DataFileUrl
[20];
304 int ShowReadStatistics
;
305 char IndexSortOrder
[5];
306 char DansGuardianConf
[MAXLEN
];
307 int DansguardianIgnoreDate
;
308 char SquidGuardConf
[MAXLEN
];
309 char SquidGuarddbHome
[255];
310 char SquidGuardLogFormat
[MAXLEN
];
311 char SquidGuardLogAlternate
[MAXLEN
];
312 int SquidguardIgnoreDate
;
314 int BytesInSitesUsersReport
;
316 char ParsedOutputLog
[MAXLEN
];
317 char ParsedOutputLogCompress
[512];
318 char DisplayedValues
[20];
319 char HeaderFontSize
[5];
320 char TitleFontSize
[5];
321 char wwwDocumentRoot
[MAXLEN
];
322 char ExternalCSSFile
[MAXLEN
];
324 unsigned long int NtlmUserFormat
;
325 unsigned long int IndexTree
;
326 int UserAuthentication
;
327 char AuthUserFile
[255];
358 char RealtimeTypes
[1024];
363 char RealtimeUnauthRec
[15];
365 char LDAPBindDN
[512];
366 char LDAPBindPW
[255];
368 int LDAPProtocolVersion
;
369 char LDAPBaseSearch
[255];
370 char LDAPFilterSearch
[512];
371 char LDAPTargetAttr
[64];
372 char GraphFont
[MAXLEN
];
379 int dansguardian_count
;
380 int squidguard_count
;
400 int AuthfailReportLimit
;
401 int DeniedReportLimit
;
402 int DownloadReportLimit
;
403 int SiteUsersReportLimit
;
404 int DansGuardianReportLimit
;
405 int SquidGuardReportLimit
;
407 int realtime_refresh
;
408 int realtime_access_log_lines
;
419 long long int nocost
;
428 struct dirent
*direntp
;