]> git.ipfire.org Git - thirdparty/sarg.git/blob - include/conf.h
Output w3c compliant strict html (almost every output).
[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 #ifdef ENABLE_NLS
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
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 MAXLOGS 255
154
155 #define REPORT_TYPE_USERS_SITES 0x0001UL
156 #define REPORT_TYPE_SITE_USER_TIME_DATE 0x0002UL
157 #define REPORT_TYPE_TOPUSERS 0x0004UL
158 #define REPORT_TYPE_TOPSITES 0x0008UL
159 #define REPORT_TYPE_SITES_USERS 0x0010UL
160 #define REPORT_TYPE_DATE_TIME 0x0020UL
161 #define REPORT_TYPE_DENIED 0x0040UL
162 #define REPORT_TYPE_AUTH_FAILURES 0x0080UL
163 #define REPORT_TYPE_DOWNLOADS 0x0100UL
164
165 #define DATA_FIELD_USER 0x0001UL
166 #define DATA_FIELD_DATE 0x0002UL
167 #define DATA_FIELD_TIME 0x0004UL
168 #define DATA_FIELD_URL 0x0008UL
169 #define DATA_FIELD_CONNECT 0x0010UL
170 #define DATA_FIELD_BYTES 0x0020UL
171 #define DATA_FIELD_IN_CACHE 0x0040UL
172 #define DATA_FIELD_OUT_CACHE 0x0080UL
173 #define DATA_FIELD_ELAPSED 0x0100UL
174
175 #define TOPUSERFIELDS_NUM 0x0001UL
176 #define TOPUSERFIELDS_DATE_TIME 0x0002UL
177 #define TOPUSERFIELDS_USERID 0x0004UL
178 #define TOPUSERFIELDS_CONNECT 0x0008UL
179 #define TOPUSERFIELDS_BYTES 0x0010UL
180 #define TOPUSERFIELDS_SETYB 0x0020UL
181 #define TOPUSERFIELDS_IN_CACHE_OUT 0x0040UL
182 #define TOPUSERFIELDS_USED_TIME 0x0080UL
183 #define TOPUSERFIELDS_MILISEC 0x0100UL
184 #define TOPUSERFIELDS_PTIME 0x0200UL
185 #define TOPUSERFIELDS_TOTAL 0x0400UL
186 #define TOPUSERFIELDS_AVERAGE 0x0800UL
187
188 #define USERREPORTFIELDS_CONNECT 0x0001UL
189 #define USERREPORTFIELDS_BYTES 0x0002UL
190 #define USERREPORTFIELDS_SETYB 0x0004UL
191 #define USERREPORTFIELDS_IN_CACHE_OUT 0x0008UL
192 #define USERREPORTFIELDS_USED_TIME 0x0010UL
193 #define USERREPORTFIELDS_MILISEC 0x0020UL
194 #define USERREPORTFIELDS_PTIME 0x0040UL
195 #define USERREPORTFIELDS_TOTAL 0x0080UL
196 #define USERREPORTFIELDS_AVERAGE 0x0100UL
197
198 #define INDEX_YES 0x0001UL
199 #define INDEX_NO 0x0002UL
200 #define INDEX_ONLY 0x0004UL
201
202 #define INDEX_TREE_DATE 0x0001UL
203 #define INDEX_TREE_FILE 0x0002UL
204
205 FILE *fp_tt;
206
207 char outdir[MAXLEN];
208 char dirname[MAXLEN];
209 char buf[MAXLEN];
210 char url[MAXLEN];
211 char urly[MAXLEN];
212 char user[MAXLEN];
213 char period[MAXLEN];
214 char code[MAXLEN];
215 char code2[MAXLEN];
216 char tmp[MAXLEN];
217 char tmp3[MAXLEN];
218 char tmp4[MAXLEN];
219 char tmp5[MAXLEN];
220 char tmp6[MAXLEN];
221 char tmp7[MAXLEN];
222 char parse_out[MAXLEN];
223 char arqtt[MAXLEN];
224 char html[MAXLEN];
225 char datestimes[MAXLEN];
226 char ConfigFile[MAXLEN];
227 char href[MAXLEN];
228 char href2[MAXLEN];
229 char href3[MAXLEN];
230 char df[20];
231 char day[3], month[4], year[5];
232 char ltext110[50];
233 char cdfrom[30];
234 char cduntil[30];
235 int LastLog;
236 int RemoveTempFiles;
237 char ReplaceIndex[256];
238 unsigned long int Index;
239 int OverwriteReport;
240 char u2[255];
241 char RecordsWithoutUser[20];
242 int UseComma;
243 char MailUtility[PATH_MAX];
244 int TopSitesNum;
245 int TopUsersNum;
246 char ExcludeCodes[256];
247 char TopsitesSortField[15];
248 char TopsitesSortType[20];
249 unsigned long int ReportType;
250 char UserTabFile[255];
251 char warea[MAXLEN];
252 char name[MAXLEN];
253 int LongUrl;
254 int Ip2Name;
255 char language[255];
256 char bufy[MAXLEN];
257 int NAccessLog;
258 char AccessLog[MAXLOGS][MAXLEN];
259 int AccessLogFromCmdLine;
260 char Title[MAXLEN];
261 char BgColor[MAXLEN];
262 char BgImage[MAXLEN];
263 char TxColor[MAXLEN];
264 char TxBgColor[MAXLEN];
265 char TiColor[MAXLEN];
266 char LogoImage[MAXLEN];
267 char LogoText[MAXLEN];
268 char LogoTextColor[MAXLEN];
269 char Width[MAXLEN];
270 char Height[MAXLEN];
271 char FontFace[MAXLEN];
272 char HeaderColor[MAXLEN];
273 char HeaderBgColor[MAXLEN];
274 char FontSize[MAXLEN];
275 char PasswdFile[MAXLEN];
276 char TempDir[MAXLEN];
277 char OutputDir[MAXLEN];
278 char OutputEmail[MAXLEN];
279 char TopuserSortField[30];
280 char UserSortField[30];
281 char TopuserSortOrder[10];
282 char UserSortOrder[10];
283 char UserAgentLog[255];
284 char module[255];
285 char ExcludeHosts[255];
286 char ExcludeUsers[255];
287 char DateFormat[2];
288 char PerUserLimitFile[255];
289 int PerUserLimit;
290 int UserIp;
291 char MaxElapsed[255];
292 char datetimeby[10];
293 char csort[255];
294 char CharSet[255];
295 char UserInvalidChar[255];
296 int Graphs;
297 char GraphDaysBytesBarColor[255];
298 int Privacy;
299 char PrivacyString[255];
300 char PrivacyStringColor[30];
301 char IncludeUsers[MAXLEN];
302 char ExcludeString[MAXLEN];
303 int SuccessfulMsg;
304 unsigned long int TopUserFields;
305 unsigned long int UserReportFields;
306 char DataFile[MAXLEN];
307 char DataFileDelimiter[3];
308 unsigned long int DataFileFields;
309 char DataFileUrl[20];
310 char SiteUserTimeDateType[10];
311 int ShowReadStatistics;
312 char IndexSortOrder[5];
313 char DansGuardianConf[MAXLEN];
314 int DansguardianIgnoreDate;
315 char SquidGuardConf[MAXLEN];
316 char SquidGuarddbHome[255];
317 char SquidGuardLogFormat[MAXLEN];
318 char SquidGuardLogAlternate[MAXLEN];
319 int SquidguardIgnoreDate;
320 int ShowSargInfo;
321 int BytesInSitesUsersReport;
322 int ShowSargLogo;
323 char ParsedOutputLog[MAXLEN];
324 char ParsedOutputLogCompress[512];
325 char DisplayedValues[20];
326 char HeaderFontSize[5];
327 char TitleFontSize[5];
328 char wwwDocumentRoot[MAXLEN];
329 char ExternalCSSFile[MAXLEN];
330 char BlockIt[255];
331 char BlockImage[512];
332 char NtlmUserFormat[30];
333 unsigned long int IndexTree;
334 int UserAuthentication;
335 char AuthUserFile[255];
336 char AuthName[512];
337 char AuthType[255];
338 char Require[512];
339 char *str;
340 char *str2;
341 char text[200][255];
342 char val1[MAXLEN];
343 char val2[MAXLEN];
344 char val3[MAXLEN];
345 char val4[MAXLEN];
346 char val5[MAXLEN];
347 char val6[MAXLEN];
348 char val7[MAXLEN];
349 char val8[MAXLEN];
350 char val9[MAXLEN];
351 char val10[MAXLEN];
352 char val11[MAXLEN];
353 char wwork1[MAXLEN];
354 char wwork2[MAXLEN];
355 char wwork3[MAXLEN];
356 char mask[MAXLEN];
357 char html_old[MAXLEN];
358 char site[MAXLEN];
359 char us[50];
360 char email[MAXLEN];
361 char test[1];
362 char ouser2[255];
363 char user2[MAXLEN];
364 char wentp[512];
365 char addr[MAXLEN];
366 char Ulimit[6];
367 char RealtimeTypes[1024];
368 char cmd[255];
369 char ImageFile[255];
370 char tbuf[128];
371 char ip[25];
372 char RealtimeUnauthRec[15];
373 char LDAPHost[255];
374 char LDAPBindDN[512];
375 char LDAPBindPW[255];
376 int LDAPPort;
377 int LDAPProtocolVersion;
378 char LDAPBaseSearch[255];
379 char LDAPFilterSearch[512];
380 char LDAPTargetAttr[64];
381
382 int idate;
383 int smartfilter;
384 int denied_count;
385 int download_count;
386 int authfail_count;
387 int dansguardian_count;
388 int squidguard_count;
389 int useragent_count;
390 int limit_flag;
391 int color1;
392 int color2;
393 int color3;
394 int z1, z2, z3;
395 int ttopen;
396 int ind2;
397 int sarglog;
398 int isalog;
399 int dfrom;
400 int duntil;
401 int dataonly;
402 int indexonly;
403 int iprel;
404 int userip;
405 int langcode;
406 int debug;
407 int debugz;
408 int debugm;
409 int AuthfailReportLimit;
410 int DeniedReportLimit;
411 int DownloadReportLimit;
412 int SiteUsersReportLimit;
413 int DansGuardianReportLimit;
414 int SquidGuardReportLimit;
415 int UserReportLimit;
416 int dotinuser;
417 int realtime_refresh;
418 int realtime_access_log_lines;
419 int realt;
420 int rc;
421 int ntopsites;
422 int nsitesusers;
423 int nrepday;
424 int ndownload;
425 int ntopuser;
426 int squid24;
427 float perc;
428
429 long long int nocost;
430 float cost;
431
432 typedef struct
433 { int list[ 24 ];
434 int len;
435 } numlist;
436
437 DIR *dirp;
438 struct dirent *direntp;