]> git.ipfire.org Git - thirdparty/sarg.git/blob - include/conf.h
30432f3c6a1618378e78714687bb4f66f2ca8799
[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_LDAP_H
99 #include <ldap.h>
100 #endif
101 #ifdef HAVE_MATH_H
102 #include <math.h>
103 #endif
104 #ifdef HAVE_LOCALE_H
105 #include <locale.h>
106 #endif
107 #ifdef HAVE_EXECINFO_H
108 #include <execinfo.h>
109 #endif
110
111 #if defined(HAVE_FOPEN64)
112 #define _FILE_OFFSET_BITS 64
113 #define MY_FOPEN fopen64
114 #else
115 #define MY_FOPEN fopen
116 #endif
117
118 #if !defined(HAVE_BZERO)
119 #define bzero(mem,size) memset(mem,0,size)
120 #endif
121
122 #if defined(IBERTY_LIB) && !defined(HAVE_MKSTEMP)
123 int mkstemps(char *template, int suffixlen);
124 #define mkstemp(template) mkstemps(template,0)
125 #endif
126
127 #if defined(__MINGW32__)
128 #define mkdir(p,m) _mkdir(p)
129
130 #ifndef WIFEXITED
131 #define WIFEXITED(S) 1
132 #endif
133
134 #ifndef WEXITSTATUS
135 #define WEXITSTATUS(S) (S)
136 #endif
137
138 #endif /*__MINGW32__*/
139
140 #define MAXLEN 20000
141 #define MAXLOGS 255
142
143 FILE *fp_tt;
144
145 char outdir[MAXLEN];
146 char dirname[MAXLEN];
147 char buf[MAXLEN];
148 char url[MAXLEN];
149 char urly[MAXLEN];
150 char user[MAXLEN];
151 char period[MAXLEN];
152 char msg[1024];
153 char code[MAXLEN];
154 char code2[MAXLEN];
155 char tmp[MAXLEN];
156 char tmp3[MAXLEN];
157 char tmp4[MAXLEN];
158 char tmp5[MAXLEN];
159 char tmp6[MAXLEN];
160 char tmp7[MAXLEN];
161 char parse_out[MAXLEN];
162 char arqtt[MAXLEN];
163 char html[MAXLEN];
164 char datestimes[MAXLEN];
165 char ConfigFile[MAXLEN];
166 char href[MAXLEN];
167 char href2[MAXLEN];
168 char href3[MAXLEN];
169 char df[20];
170 char day[3], month[4], year[5];
171 char ltext110[50];
172 char cdfrom[30];
173 char cduntil[30];
174 int LastLog;
175 int RemoveTempFiles;
176 char ReplaceIndex[256];
177 char Index[20];
178 int OverwriteReport;
179 char u2[255];
180 char RecordsWithoutUser[20];
181 int UseComma;
182 char MailUtility[PATH_MAX];
183 char TopSitesNum[20];
184 int TopUsersNum;
185 char ExcludeCodes[256];
186 char TopsitesSortField[15];
187 char TopsitesSortType[20];
188 char ReportType[255];
189 char UserTabFile[255];
190 char warea[MAXLEN];
191 char name[MAXLEN];
192 int LongUrl;
193 int Ip2Name;
194 char language[255];
195 char bufy[MAXLEN];
196 int NAccessLog;
197 char AccessLog[MAXLOGS][MAXLEN];
198 int AccessLogFromCmdLine;
199 char Title[MAXLEN];
200 char BgColor[MAXLEN];
201 char BgImage[MAXLEN];
202 char TxColor[MAXLEN];
203 char TxBgColor[MAXLEN];
204 char TiColor[MAXLEN];
205 char LogoImage[MAXLEN];
206 char LogoText[MAXLEN];
207 char LogoTextColor[MAXLEN];
208 char Width[MAXLEN];
209 char Height[MAXLEN];
210 char FontFace[MAXLEN];
211 char HeaderColor[MAXLEN];
212 char HeaderBgColor[MAXLEN];
213 char FontSize[MAXLEN];
214 char PasswdFile[MAXLEN];
215 char TempDir[MAXLEN];
216 char OutputDir[MAXLEN];
217 char OutputEmail[MAXLEN];
218 char TopuserSortField[30];
219 char UserSortField[30];
220 char TopuserSortOrder[10];
221 char UserSortOrder[10];
222 char UserAgentLog[255];
223 char module[255];
224 char ExcludeHosts[255];
225 char ExcludeUsers[255];
226 char DateFormat[2];
227 char PerUserLimitFile[255];
228 int PerUserLimit;
229 int UserIp;
230 char MaxElapsed[255];
231 char datetimeby[10];
232 char csort[255];
233 char CharSet[255];
234 char UserInvalidChar[255];
235 int Graphs;
236 char GraphDaysBytesBarColor[255];
237 int Privacy;
238 char PrivacyString[255];
239 char PrivacyStringColor[30];
240 char IncludeUsers[MAXLEN];
241 char ExcludeString[MAXLEN];
242 int SuccessfulMsg;
243 char TopUserFields[255];
244 char UserReportFields[255];
245 char DataFile[MAXLEN];
246 char DataFileDelimiter[3];
247 char DataFileFields[MAXLEN];
248 char DataFileUrl[20];
249 char SiteUserTimeDateType[10];
250 int ShowReadStatistics;
251 char IndexSortOrder[5];
252 char DansGuardianConf[MAXLEN];
253 int DansguardianIgnoreDate;
254 char SquidGuardConf[MAXLEN];
255 char SquidGuarddbHome[255];
256 char SquidGuardLogFormat[MAXLEN];
257 char SquidGuardLogAlternate[MAXLEN];
258 int SquidguardIgnoreDate;
259 int ShowSargInfo;
260 int BytesInSitesUsersReport;
261 int ShowSargLogo;
262 char ParsedOutputLog[MAXLEN];
263 char ParsedOutputLogCompress[512];
264 char DisplayedValues[20];
265 char HeaderFontSize[5];
266 char TitleFontSize[5];
267 char wwwDocumentRoot[MAXLEN];
268 char ExternalCSSFile[MAXLEN];
269 char BlockIt[255];
270 char BlockImage[512];
271 char NtlmUserFormat[30];
272 char hbc1[30];
273 char hbc2[255];
274 char hbc3[30];
275 char hbc4[30];
276 char hbc5[30];
277 char hbc6[30];
278 char hbc7[30];
279 char hbc8[30];
280 char hbc9[30];
281 char hbc10[30];
282 char IndexTree[10];
283 int UserAuthentication;
284 char AuthUserFile[255];
285 char AuthName[512];
286 char AuthType[255];
287 char Require[512];
288 char *userfile;
289 char *str;
290 char *str2;
291 char text[200][255];
292 char val1[MAXLEN];
293 char val2[MAXLEN];
294 char val3[MAXLEN];
295 char val4[MAXLEN];
296 char val5[MAXLEN];
297 char val6[MAXLEN];
298 char val7[MAXLEN];
299 char val8[MAXLEN];
300 char val9[MAXLEN];
301 char val10[MAXLEN];
302 char val11[MAXLEN];
303 char wwork1[MAXLEN];
304 char wwork2[MAXLEN];
305 char wwork3[MAXLEN];
306 char mask[MAXLEN];
307 char httplink[MAXLEN];
308 char html_old[MAXLEN];
309 char site[MAXLEN];
310 char us[50];
311 char email[MAXLEN];
312 char test[1];
313 char ouser2[255];
314 char user2[MAXLEN];
315 char wentp[512];
316 char addr[MAXLEN];
317 char Ulimit[6];
318 char RealtimeTypes[1024];
319 char cmd[255];
320 char ImageFile[255];
321 char tbuf[128];
322 char ip[25];
323 char RealtimeUnauthRec[15];
324 char LDAPHost[255];
325 char LDAPBindDN[512];
326 char LDAPBindPW[255];
327 char LDAPPort[16];
328 char LDAPProtocolVersion[3];
329 char LDAPBaseSearch[255];
330 char LDAPFilterSearch[512];
331 char LDAPTargetAttr[64];
332
333 int idate;
334 int smartfilter;
335 int denied_count;
336 int download_count;
337 int authfail_count;
338 int dansguardian_count;
339 int squidguard_count;
340 int limit_flag;
341 int color1;
342 int color2;
343 int color3;
344 int z1, z2, z3;
345 int ttopen;
346 int ind2;
347 int sarglog;
348 int isalog;
349 int dfrom;
350 int duntil;
351 int dataonly;
352 int indexonly;
353 int iprel;
354 int userip;
355 int langcode;
356 int debug;
357 int debugz;
358 int debugm;
359 int AuthfailReportLimit;
360 int DeniedReportLimit;
361 int DownloadReportLimit;
362 int SiteUsersReportLimit;
363 int DansGuardianReportLimit;
364 int SquidGuardReportLimit;
365 int UserReportLimit;
366 int dotinuser;
367 int realtime_refresh;
368 int realtime_access_log_lines;
369 int realt;
370 int rc;
371 int ntopsites;
372 int nsitesusers;
373 int nrepday;
374 int ndownload;
375 int ntopuser;
376 int squid24;
377 float perc;
378
379 long long int nocost;
380 float cost;
381
382 typedef struct
383 { int list[ 24 ];
384 int len;
385 } numlist;
386
387 DIR *dirp;
388 struct dirent *direntp;