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