]> git.ipfire.org Git - thirdparty/sarg.git/blob - include/conf.h
Keep the user name intact in the report.
[thirdparty/sarg.git] / include / conf.h
1 #include "config.h"
2 #include "info.h"
3 #include "btree_cache.h"
4
5 #ifdef HAVE_WINDOWS_H
6 #include <windows.h>
7 #endif
8 #ifdef HAVE_STDIO_H
9 #include <stdio.h>
10 #endif
11 #ifdef HAVE_STDLIB_H
12 #include <stdlib.h>
13 #endif
14 #ifdef HAVE_STRING_H
15 #include <string.h>
16 #endif
17 #ifdef HAVE_STRINGS_H
18 #include <strings.h>
19 #endif
20 #ifdef HAVE_SYS_TIME_H
21 #include <sys/time.h>
22 #endif
23 #ifdef HAVE_TIME_H
24 #include <time.h>
25 #endif
26 #ifdef HAVE_SYS_RESOURCE_H
27 #include <sys/resource.h>
28 #endif
29 #ifdef HAVE_UNISTD_H
30 #include <unistd.h>
31 #endif
32 #if defined(HAVE_SYS_DIRENT_H) && !defined(HAVE_DIRENT_H)
33 #include <sys/dirent.h>
34 #endif
35 #ifdef HAVE_DIRENT_H
36 #include <dirent.h>
37 #endif
38 #ifdef HAVE_SYS_SOCKET_H
39 #include <sys/socket.h>
40 #endif
41 #ifdef HAVE_NETDB_H
42 #include <netdb.h>
43 #endif
44 #ifdef HAVE_TYPES_H
45 #include <types.h>
46 #endif
47 #ifdef HAVE_NETINET_IN_H
48 #include <netinet/in.h>
49 #endif
50 #ifdef HAVE_ARPA_INET_H
51 #include <arpa/inet.h>
52 #endif
53 #ifdef HAVE_SYS_STAT_H
54 #include <sys/stat.h>
55 #endif
56 #ifdef HAVE_CTYPE_H
57 #include <ctype.h>
58 #endif
59 #ifdef HAVE_ERRNO_H
60 #include <errno.h>
61 #endif
62 #ifdef HAVE_SYS_WAIT_H
63 #include <sys/wait.h>
64 #endif
65 #ifdef HAVE_GD_H
66 #include <gd.h>
67 #define HAVE_GD
68 gdImagePtr im;
69 gdPoint points[4];
70 #endif
71 #ifdef HAVE_GDFONTL_H
72 #include <gdfontl.h>
73 #endif
74 #ifdef HAVE_GDFONTT_H
75 #include <gdfontt.h>
76 #endif
77 #ifdef HAVE_GDFONTS_H
78 #include <gdfonts.h>
79 #endif
80 #ifdef HAVE_GDFONTMB_H
81 #include <gdfontmb.h>
82 #endif
83 #ifdef HAVE_GDFONTG_H
84 #include <gdfontg.h>
85 #endif
86 #ifdef HAVE_STDARG_H
87 #include <stdarg.h>
88 #endif
89 #ifdef HAVE_INTTYPES_H
90 #include <inttypes.h>
91 #endif
92 #ifdef HAVE_LIMITS_H
93 #include <limits.h>
94 #endif
95 #ifdef HAVE_WINSOCK_H
96 #include <winsock.h>
97 #endif
98 #ifdef HAVE_MATH_H
99 #include <math.h>
100 #endif
101 #ifdef HAVE_LOCALE_H
102 #include <locale.h>
103 #endif
104 #ifdef HAVE_EXECINFO_H
105 #include <execinfo.h>
106 #endif
107
108 #if defined(HAVE_FOPEN64)
109 #define _FILE_OFFSET_BITS 64
110 #define MY_FOPEN fopen64
111 #else
112 #define MY_FOPEN fopen
113 #endif
114
115 #if !defined(HAVE_BZERO)
116 #define bzero(mem,size) memset(mem,0,size)
117 #endif
118
119 #if defined(IBERTY_LIB) && !defined(HAVE_MKSTEMP)
120 int mkstemps(char *template, int suffixlen);
121 #define mkstemp(template) mkstemps(template,0)
122 #endif
123
124 #if defined(ENABLE_NLS) && defined(HAVE_LIBINTL_H)
125 #include <libintl.h>
126 #define _(String) gettext(String)
127 #ifdef gettext_noop
128 #define N_(String) gettext_noop(String)
129 #else
130 #define N_(String) (String)
131 #endif
132 #else /* No NLS */
133 #define _(String) (String)
134 #define N_(String) (String)
135 #define textdomain(String)
136 #define bindtextdomain(Domain,Directory)
137 #endif //NLS
138
139 #if defined(__MINGW32__)
140 #define mkdir(p,m) _mkdir(p)
141
142 #ifndef WIFEXITED
143 #define WIFEXITED(S) 1
144 #endif
145
146 #ifndef WEXITSTATUS
147 #define WEXITSTATUS(S) (S)
148 #endif
149
150 #endif /*__MINGW32__*/
151
152 #define MAXLEN 20000
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
159 #define MAXLOGS 255
160
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
170
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
180
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
193
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
203
204 #define INDEX_YES 0x0001UL
205 #define INDEX_NO 0x0002UL
206 #define INDEX_ONLY 0x0004UL
207
208 #define INDEX_TREE_DATE 0x0001UL
209 #define INDEX_TREE_FILE 0x0002UL
210
211 #define NTLMUSERFORMAT_USER 0x0001UL
212 #define NTLMUSERFORMAT_DOMAINUSER 0x0002UL
213
214 #define RECORDWITHOUTUSER_IP 0x0001UL
215 #define RECORDWITHOUTUSER_IGNORE 0x0002UL
216 #define RECORDWITHOUTUSER_EVERYBODY 0x0004UL
217
218 char outdir[MAXLEN];
219 char dirname[MAXLEN];
220 char buf[MAXLEN];
221 char period[MAXLEN];
222 char code[MAXLEN];
223 char code2[MAXLEN];
224 char tmp[MAXLEN];
225 char parse_out[MAXLEN];
226 char arqtt[MAXLEN];
227 char html[MAXLEN];
228 char ConfigFile[MAXLEN];
229 char df[20];
230 char cdfrom[30];
231 char cduntil[30];
232 int LastLog;
233 int RemoveTempFiles;
234 char ReplaceIndex[256];
235 unsigned long int Index;
236 int OverwriteReport;
237 unsigned long int RecordsWithoutUser;
238 int UseComma;
239 char MailUtility[PATH_MAX];
240 int TopSitesNum;
241 int TopUsersNum;
242 char ExcludeCodes[256];
243 char TopsitesSortField[15];
244 char TopsitesSortType[20];
245 unsigned long int ReportType;
246 char UserTabFile[255];
247 char warea[MAXLEN];
248 char name[MAXLEN];
249 int LongUrl;
250 int Ip2Name;
251 char language[255];
252 int NAccessLog;
253 char AccessLog[MAXLOGS][MAXLEN];
254 int AccessLogFromCmdLine;
255 char Title[MAXLEN];
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];
264 char Width[MAXLEN];
265 char Height[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];
279 char module[255];
280 char ExcludeHosts[255];
281 char ExcludeUsers[255];
282 char DateFormat[2];
283 char PerUserLimitFile[255];
284 int PerUserLimit;
285 int UserIp;
286 char MaxElapsed[255];
287 char datetimeby[10];
288 char CharSet[255];
289 char UserInvalidChar[255];
290 int Graphs;
291 char GraphDaysBytesBarColor[255];
292 int Privacy;
293 char PrivacyString[255];
294 char PrivacyStringColor[30];
295 char IncludeUsers[MAXLEN];
296 char ExcludeString[MAXLEN];
297 int SuccessfulMsg;
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;
313 int ShowSargInfo;
314 int BytesInSitesUsersReport;
315 int ShowSargLogo;
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];
323 char BlockIt[255];
324 unsigned long int NtlmUserFormat;
325 unsigned long int IndexTree;
326 int UserAuthentication;
327 char AuthUserFile[255];
328 char AuthName[512];
329 char AuthType[255];
330 char Require[512];
331 char *str;
332 char *str2;
333 char text[200][255];
334 char val1[MAXLEN];
335 char val2[MAXLEN];
336 char val3[MAXLEN];
337 char val4[MAXLEN];
338 char val5[MAXLEN];
339 char val6[MAXLEN];
340 char val7[MAXLEN];
341 char val8[MAXLEN];
342 char val9[MAXLEN];
343 char val10[MAXLEN];
344 char val11[MAXLEN];
345 char wwork1[MAXLEN];
346 char wwork2[MAXLEN];
347 char wwork3[MAXLEN];
348 char mask[MAXLEN];
349 char site[MAXLEN];
350 char us[50];
351 char email[MAXLEN];
352 char test[1];
353 char ouser2[255];
354 char user2[MAXLEN];
355 char wentp[512];
356 char addr[MAXLEN];
357 char Ulimit[6];
358 char RealtimeTypes[1024];
359 char cmd[255];
360 char ImageFile[255];
361 char tbuf[128];
362 char ip[25];
363 char RealtimeUnauthRec[15];
364 char LDAPHost[255];
365 char LDAPBindDN[512];
366 char LDAPBindPW[255];
367 int LDAPPort;
368 int LDAPProtocolVersion;
369 char LDAPBaseSearch[255];
370 char LDAPFilterSearch[512];
371 char LDAPTargetAttr[64];
372 char GraphFont[MAXLEN];
373
374 int idate;
375 int smartfilter;
376 int denied_count;
377 int download_count;
378 int authfail_count;
379 int dansguardian_count;
380 int squidguard_count;
381 int useragent_count;
382 int limit_flag;
383 int color1;
384 int color2;
385 int color3;
386 int z1, z2, z3;
387 int ttopen;
388 int sarglog;
389 int isalog;
390 int dfrom;
391 int duntil;
392 int dataonly;
393 int indexonly;
394 int iprel;
395 int userip;
396 int langcode;
397 int debug;
398 int debugz;
399 int debugm;
400 int AuthfailReportLimit;
401 int DeniedReportLimit;
402 int DownloadReportLimit;
403 int SiteUsersReportLimit;
404 int DansGuardianReportLimit;
405 int SquidGuardReportLimit;
406 int UserReportLimit;
407 int realtime_refresh;
408 int realtime_access_log_lines;
409 int realt;
410 int rc;
411 int ntopsites;
412 int nsitesusers;
413 int nrepday;
414 int ndownload;
415 int ntopuser;
416 int squid24;
417 float perc;
418
419 long long int nocost;
420 float cost;
421
422 typedef struct
423 { int list[ 24 ];
424 int len;
425 } numlist;
426
427 DIR *dirp;
428 struct dirent *direntp;