]> git.ipfire.org Git - thirdparty/sarg.git/blob - include/conf.h
Ported r215 from branches/v2_2_7 (user ID mangling)
[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(__MINGW32__)
125 #define mkdir(p,m) _mkdir(p)
126
127 #ifndef WIFEXITED
128 #define WIFEXITED(S) 1
129 #endif
130
131 #ifndef WEXITSTATUS
132 #define WEXITSTATUS(S) (S)
133 #endif
134
135 #endif /*__MINGW32__*/
136
137 #define MAXLEN 20000
138 #define MAXLOGS 255
139
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
149
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
159
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
172
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
182
183 FILE *fp_tt;
184
185 char outdir[MAXLEN];
186 char dirname[MAXLEN];
187 char buf[MAXLEN];
188 char url[MAXLEN];
189 char urly[MAXLEN];
190 char user[MAXLEN];
191 char period[MAXLEN];
192 char code[MAXLEN];
193 char code2[MAXLEN];
194 char tmp[MAXLEN];
195 char tmp3[MAXLEN];
196 char tmp4[MAXLEN];
197 char tmp5[MAXLEN];
198 char tmp6[MAXLEN];
199 char tmp7[MAXLEN];
200 char parse_out[MAXLEN];
201 char arqtt[MAXLEN];
202 char html[MAXLEN];
203 char datestimes[MAXLEN];
204 char ConfigFile[MAXLEN];
205 char href[MAXLEN];
206 char href2[MAXLEN];
207 char href3[MAXLEN];
208 char df[20];
209 char day[3], month[4], year[5];
210 char ltext110[50];
211 char cdfrom[30];
212 char cduntil[30];
213 int LastLog;
214 int RemoveTempFiles;
215 char ReplaceIndex[256];
216 char Index[20];
217 int OverwriteReport;
218 char u2[255];
219 char RecordsWithoutUser[20];
220 int UseComma;
221 char MailUtility[PATH_MAX];
222 char TopSitesNum[20];
223 int TopUsersNum;
224 char ExcludeCodes[256];
225 char TopsitesSortField[15];
226 char TopsitesSortType[20];
227 unsigned long int ReportType;
228 char UserTabFile[255];
229 char warea[MAXLEN];
230 char name[MAXLEN];
231 int LongUrl;
232 int Ip2Name;
233 char language[255];
234 char bufy[MAXLEN];
235 int NAccessLog;
236 char AccessLog[MAXLOGS][MAXLEN];
237 int AccessLogFromCmdLine;
238 char Title[MAXLEN];
239 char BgColor[MAXLEN];
240 char BgImage[MAXLEN];
241 char TxColor[MAXLEN];
242 char TxBgColor[MAXLEN];
243 char TiColor[MAXLEN];
244 char LogoImage[MAXLEN];
245 char LogoText[MAXLEN];
246 char LogoTextColor[MAXLEN];
247 char Width[MAXLEN];
248 char Height[MAXLEN];
249 char FontFace[MAXLEN];
250 char HeaderColor[MAXLEN];
251 char HeaderBgColor[MAXLEN];
252 char FontSize[MAXLEN];
253 char PasswdFile[MAXLEN];
254 char TempDir[MAXLEN];
255 char OutputDir[MAXLEN];
256 char OutputEmail[MAXLEN];
257 char TopuserSortField[30];
258 char UserSortField[30];
259 char TopuserSortOrder[10];
260 char UserSortOrder[10];
261 char UserAgentLog[255];
262 char module[255];
263 char ExcludeHosts[255];
264 char ExcludeUsers[255];
265 char DateFormat[2];
266 char PerUserLimitFile[255];
267 int PerUserLimit;
268 int UserIp;
269 char MaxElapsed[255];
270 char datetimeby[10];
271 char csort[255];
272 char CharSet[255];
273 char UserInvalidChar[255];
274 int Graphs;
275 char GraphDaysBytesBarColor[255];
276 int Privacy;
277 char PrivacyString[255];
278 char PrivacyStringColor[30];
279 char IncludeUsers[MAXLEN];
280 char ExcludeString[MAXLEN];
281 int SuccessfulMsg;
282 unsigned long int TopUserFields;
283 unsigned long int UserReportFields;
284 char DataFile[MAXLEN];
285 char DataFileDelimiter[3];
286 unsigned long int DataFileFields;
287 char DataFileUrl[20];
288 char SiteUserTimeDateType[10];
289 int ShowReadStatistics;
290 char IndexSortOrder[5];
291 char DansGuardianConf[MAXLEN];
292 int DansguardianIgnoreDate;
293 char SquidGuardConf[MAXLEN];
294 char SquidGuarddbHome[255];
295 char SquidGuardLogFormat[MAXLEN];
296 char SquidGuardLogAlternate[MAXLEN];
297 int SquidguardIgnoreDate;
298 int ShowSargInfo;
299 int BytesInSitesUsersReport;
300 int ShowSargLogo;
301 char ParsedOutputLog[MAXLEN];
302 char ParsedOutputLogCompress[512];
303 char DisplayedValues[20];
304 char HeaderFontSize[5];
305 char TitleFontSize[5];
306 char wwwDocumentRoot[MAXLEN];
307 char ExternalCSSFile[MAXLEN];
308 char BlockIt[255];
309 char BlockImage[512];
310 char NtlmUserFormat[30];
311 char hbc1[30];
312 char hbc2[255];
313 char hbc3[30];
314 char hbc4[30];
315 char hbc5[30];
316 char hbc6[30];
317 char hbc7[30];
318 char hbc8[30];
319 char hbc9[30];
320 char hbc10[30];
321 char IndexTree[10];
322 int UserAuthentication;
323 char AuthUserFile[255];
324 char AuthName[512];
325 char AuthType[255];
326 char Require[512];
327 char *str;
328 char *str2;
329 char text[200][255];
330 char val1[MAXLEN];
331 char val2[MAXLEN];
332 char val3[MAXLEN];
333 char val4[MAXLEN];
334 char val5[MAXLEN];
335 char val6[MAXLEN];
336 char val7[MAXLEN];
337 char val8[MAXLEN];
338 char val9[MAXLEN];
339 char val10[MAXLEN];
340 char val11[MAXLEN];
341 char wwork1[MAXLEN];
342 char wwork2[MAXLEN];
343 char wwork3[MAXLEN];
344 char mask[MAXLEN];
345 char httplink[MAXLEN];
346 char html_old[MAXLEN];
347 char site[MAXLEN];
348 char us[50];
349 char email[MAXLEN];
350 char test[1];
351 char ouser2[255];
352 char user2[MAXLEN];
353 char wentp[512];
354 char addr[MAXLEN];
355 char Ulimit[6];
356 char RealtimeTypes[1024];
357 char cmd[255];
358 char ImageFile[255];
359 char tbuf[128];
360 char ip[25];
361 char RealtimeUnauthRec[15];
362 char LDAPHost[255];
363 char LDAPBindDN[512];
364 char LDAPBindPW[255];
365 int LDAPPort;
366 int LDAPProtocolVersion;
367 char LDAPBaseSearch[255];
368 char LDAPFilterSearch[512];
369 char LDAPTargetAttr[64];
370
371 int idate;
372 int smartfilter;
373 int denied_count;
374 int download_count;
375 int authfail_count;
376 int dansguardian_count;
377 int squidguard_count;
378 int limit_flag;
379 int color1;
380 int color2;
381 int color3;
382 int z1, z2, z3;
383 int ttopen;
384 int ind2;
385 int sarglog;
386 int isalog;
387 int dfrom;
388 int duntil;
389 int dataonly;
390 int indexonly;
391 int iprel;
392 int userip;
393 int langcode;
394 int debug;
395 int debugz;
396 int debugm;
397 int AuthfailReportLimit;
398 int DeniedReportLimit;
399 int DownloadReportLimit;
400 int SiteUsersReportLimit;
401 int DansGuardianReportLimit;
402 int SquidGuardReportLimit;
403 int UserReportLimit;
404 int dotinuser;
405 int realtime_refresh;
406 int realtime_access_log_lines;
407 int realt;
408 int rc;
409 int ntopsites;
410 int nsitesusers;
411 int nrepday;
412 int ndownload;
413 int ntopuser;
414 int squid24;
415 float perc;
416
417 long long int nocost;
418 float cost;
419
420 typedef struct
421 { int list[ 24 ];
422 int len;
423 } numlist;
424
425 DIR *dirp;
426 struct dirent *direntp;