]> git.ipfire.org Git - thirdparty/sarg.git/blob - include/conf.h
Fixed regressions in creation and reading of a sarg parsed log (thanks to Joao Alves)
[thirdparty/sarg.git] / include / conf.h
1 #include "config.h"
2 #include "info.h"
3
4 #ifdef HAVE_WINDOWS_H
5 #include <windows.h>
6 #endif
7 #ifdef HAVE_STDIO_H
8 #include <stdio.h>
9 #endif
10 #ifdef HAVE_STDLIB_H
11 #include <stdlib.h>
12 #endif
13 #ifdef HAVE_STRING_H
14 #include <string.h>
15 #endif
16 #ifdef HAVE_STRINGS_H
17 #include <strings.h>
18 #endif
19 #ifdef HAVE_SYS_TIME_H
20 #include <sys/time.h>
21 #endif
22 #ifdef HAVE_TIME_H
23 #include <time.h>
24 #endif
25 #ifdef HAVE_SYS_RESOURCE_H
26 #include <sys/resource.h>
27 #endif
28 #ifdef HAVE_UNISTD_H
29 #include <unistd.h>
30 #endif
31 #if defined(HAVE_SYS_DIRENT_H) && !defined(HAVE_DIRENT_H)
32 #include <sys/dirent.h>
33 #endif
34 #ifdef HAVE_DIRENT_H
35 #include <dirent.h>
36 #endif
37 #ifdef HAVE_SYS_SOCKET_H
38 #include <sys/socket.h>
39 #endif
40 #ifdef HAVE_NETDB_H
41 #include <netdb.h>
42 #endif
43 #ifdef HAVE_TYPES_H
44 #include <types.h>
45 #endif
46 #ifdef HAVE_NETINET_IN_H
47 #include <netinet/in.h>
48 #endif
49 #ifdef HAVE_ARPA_INET_H
50 #include <arpa/inet.h>
51 #endif
52 #ifdef HAVE_SYS_STAT_H
53 #include <sys/stat.h>
54 #endif
55 #ifdef HAVE_CTYPE_H
56 #include <ctype.h>
57 #endif
58 #ifdef HAVE_ERRNO_H
59 #include <errno.h>
60 #endif
61 #ifdef HAVE_SYS_WAIT_H
62 #include <sys/wait.h>
63 #endif
64 #ifdef HAVE_GD_H
65 #include <gd.h>
66 #define HAVE_GD
67 gdImagePtr im;
68 gdPoint points[4];
69 #endif
70 #ifdef HAVE_GDFONTL_H
71 #include <gdfontl.h>
72 #endif
73 #ifdef HAVE_GDFONTT_H
74 #include <gdfontt.h>
75 #endif
76 #ifdef HAVE_GDFONTS_H
77 #include <gdfonts.h>
78 #endif
79 #ifdef HAVE_GDFONTMB_H
80 #include <gdfontmb.h>
81 #endif
82 #ifdef HAVE_GDFONTG_H
83 #include <gdfontg.h>
84 #endif
85 #ifdef HAVE_STDARG_H
86 #include <stdarg.h>
87 #endif
88 #ifdef HAVE_INTTYPES_H
89 #include <inttypes.h>
90 #endif
91 #ifdef HAVE_LIMITS_H
92 #include <limits.h>
93 #endif
94 #ifdef HAVE_WINSOCK_H
95 #include <winsock.h>
96 #endif
97 #ifdef HAVE_LOCALE_H
98 #include <locale.h>
99 #endif
100 #ifdef HAVE_EXECINFO_H
101 #include <execinfo.h>
102 #endif
103
104 #if defined(HAVE_FOPEN64)
105 #define _FILE_OFFSET_BITS 64
106 #define MY_FOPEN fopen64
107 #else
108 #define MY_FOPEN fopen
109 #endif
110
111 #if !defined(HAVE_BZERO)
112 #define bzero(mem,size) memset(mem,0,size)
113 #endif
114
115 #if defined(IBERTY_LIB) && !defined(HAVE_MKSTEMP)
116 int mkstemps(char *template, int suffixlen);
117 #define mkstemp(template) mkstemps(template,0)
118 #endif
119
120 #if defined(__MINGW32__)
121 #define mkdir(p,m) _mkdir(p)
122
123 #ifndef WIFEXITED
124 #define WIFEXITED(S) 1
125 #endif
126
127 #ifndef WEXITSTATUS
128 #define WEXITSTATUS(S) (S)
129 #endif
130
131 #endif /*__MINGW32__*/
132
133 #define MAXLEN 20000
134 #define MAXLOGS 255
135
136 FILE *fp_tt;
137
138 char outdir[MAXLEN];
139 char dirname[MAXLEN];
140 char buf[MAXLEN];
141 char url[MAXLEN];
142 char urly[MAXLEN];
143 char user[MAXLEN];
144 char period[MAXLEN];
145 char msg[1024];
146 char code[MAXLEN];
147 char code2[MAXLEN];
148 char tmp[MAXLEN];
149 char tmp3[MAXLEN];
150 char tmp4[MAXLEN];
151 char tmp5[MAXLEN];
152 char tmp6[MAXLEN];
153 char tmp7[MAXLEN];
154 char parse_out[MAXLEN];
155 char arqtt[MAXLEN];
156 char html[MAXLEN];
157 char datestimes[MAXLEN];
158 char ConfigFile[MAXLEN];
159 char href[MAXLEN];
160 char href2[MAXLEN];
161 char href3[MAXLEN];
162 char df[20];
163 char day[3], month[4], year[5];
164 char ltext110[50];
165 char cdfrom[30];
166 char cduntil[30];
167 int LastLog;
168 int RemoveTempFiles;
169 char ReplaceIndex[256];
170 char Index[20];
171 int OverwriteReport;
172 char u2[255];
173 char RecordsWithoutUser[20];
174 int UseComma;
175 char MailUtility[PATH_MAX];
176 char TopSitesNum[20];
177 int TopUsersNum;
178 char ExcludeCodes[256];
179 char TopsitesSortField[15];
180 char TopsitesSortType[20];
181 char ReportType[255];
182 char UserTabFile[255];
183 char warea[MAXLEN];
184 char name[MAXLEN];
185 int LongUrl;
186 int Ip2Name;
187 char language[255];
188 char bufy[MAXLEN];
189 int NAccessLog;
190 char AccessLog[MAXLOGS][MAXLEN];
191 int AccessLogFromCmdLine;
192 char Title[MAXLEN];
193 char BgColor[MAXLEN];
194 char BgImage[MAXLEN];
195 char TxColor[MAXLEN];
196 char TxBgColor[MAXLEN];
197 char TiColor[MAXLEN];
198 char LogoImage[MAXLEN];
199 char LogoText[MAXLEN];
200 char LogoTextColor[MAXLEN];
201 char Width[MAXLEN];
202 char Height[MAXLEN];
203 char FontFace[MAXLEN];
204 char HeaderColor[MAXLEN];
205 char HeaderBgColor[MAXLEN];
206 char FontSize[MAXLEN];
207 char PasswdFile[MAXLEN];
208 char TempDir[MAXLEN];
209 char OutputDir[MAXLEN];
210 char OutputEmail[MAXLEN];
211 char TopuserSortField[30];
212 char UserSortField[30];
213 char TopuserSortOrder[10];
214 char UserSortOrder[10];
215 char UserAgentLog[255];
216 char module[255];
217 char ExcludeHosts[255];
218 char ExcludeUsers[255];
219 char DateFormat[2];
220 char PerUserLimitFile[255];
221 int PerUserLimit;
222 int UserIp;
223 char MaxElapsed[255];
224 char datetimeby[10];
225 char csort[255];
226 char CharSet[255];
227 char UserInvalidChar[255];
228 int Graphs;
229 char GraphDaysBytesBarColor[255];
230 int Privacy;
231 char PrivacyString[255];
232 char PrivacyStringColor[30];
233 char IncludeUsers[MAXLEN];
234 char ExcludeString[MAXLEN];
235 int SuccessfulMsg;
236 char TopUserFields[255];
237 char UserReportFields[255];
238 char DataFile[MAXLEN];
239 char DataFileDelimiter[3];
240 char DataFileFields[MAXLEN];
241 char DataFileUrl[20];
242 char SiteUserTimeDateType[10];
243 int ShowReadStatistics;
244 char IndexSortOrder[5];
245 char DansGuardianConf[MAXLEN];
246 int DansguardianIgnoreDate;
247 char SquidGuardConf[MAXLEN];
248 char SquidGuarddbHome[255];
249 char SquidGuardLogFormat[MAXLEN];
250 char SquidGuardLogAlternate[MAXLEN];
251 int SquidguardIgnoreDate;
252 int ShowSargInfo;
253 int BytesInSitesUsersReport;
254 int ShowSargLogo;
255 char ParsedOutputLog[MAXLEN];
256 char ParsedOutputLogCompress[512];
257 char DisplayedValues[20];
258 char HeaderFontSize[5];
259 char TitleFontSize[5];
260 char wwwDocumentRoot[MAXLEN];
261 char ExternalCSSFile[MAXLEN];
262 char BlockIt[255];
263 char BlockImage[512];
264 char NtlmUserFormat[30];
265 char hbc1[30];
266 char hbc2[255];
267 char hbc3[30];
268 char hbc4[30];
269 char hbc5[30];
270 char hbc6[30];
271 char hbc7[30];
272 char hbc8[30];
273 char hbc9[30];
274 char hbc10[30];
275 char IndexTree[10];
276 int UserAuthentication;
277 char AuthUserFile[255];
278 char AuthName[512];
279 char AuthType[255];
280 char Require[512];
281 char *userfile;
282 char *str;
283 char *str2;
284 char text[200][255];
285 char val1[MAXLEN];
286 char val2[MAXLEN];
287 char val3[MAXLEN];
288 char val4[MAXLEN];
289 char val5[MAXLEN];
290 char val6[MAXLEN];
291 char val7[MAXLEN];
292 char val8[MAXLEN];
293 char val9[MAXLEN];
294 char val10[MAXLEN];
295 char val11[MAXLEN];
296 char wwork1[MAXLEN];
297 char wwork2[MAXLEN];
298 char wwork3[MAXLEN];
299 char mask[MAXLEN];
300 char httplink[MAXLEN];
301 char html_old[MAXLEN];
302 char site[MAXLEN];
303 char us[50];
304 char email[MAXLEN];
305 char test[1];
306 char ouser2[255];
307 char user2[MAXLEN];
308 char wentp[512];
309 char addr[MAXLEN];
310 char Ulimit[6];
311 char RealtimeTypes[1024];
312 char cmd[255];
313 char ImageFile[255];
314 char tbuf[128];
315 char ip[25];
316 char RealtimeUnauthRec[15];
317
318 int idate;
319 int smartfilter;
320 int denied_count;
321 int download_count;
322 int authfail_count;
323 int dansguardian_count;
324 int squidguard_count;
325 int limit_flag;
326 int color1;
327 int color2;
328 int color3;
329 int z1, z2, z3;
330 int ttopen;
331 int ind2;
332 int sarglog;
333 int isalog;
334 int dfrom;
335 int duntil;
336 int dataonly;
337 int indexonly;
338 int iprel;
339 int userip;
340 int langcode;
341 int debug;
342 int debugz;
343 int debugm;
344 int AuthfailReportLimit;
345 int DeniedReportLimit;
346 int DownloadReportLimit;
347 int SiteUsersReportLimit;
348 int DansGuardianReportLimit;
349 int SquidGuardReportLimit;
350 int UserReportLimit;
351 int dotinuser;
352 int realtime_refresh;
353 int realtime_access_log_lines;
354 int realt;
355 int rc;
356 int ntopsites;
357 int nsitesusers;
358 int nrepday;
359 int ndownload;
360 int ntopuser;
361 int squid24;
362 float perc;
363
364 long long int nocost;
365 float cost;
366
367 typedef struct
368 { int list[ 24 ];
369 int len;
370 } numlist;
371
372 DIR *dirp;
373 struct dirent *direntp;