]> git.ipfire.org Git - thirdparty/sarg.git/blame_incremental - include/conf.h
Remove trailing spaces in sarg.conf
[thirdparty/sarg.git] / include / conf.h
... / ...
CommitLineData
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#define HAVE_GD 1
67#include <gd.h>
68#endif
69#ifdef HAVE_GDFONTL_H
70#include <gdfontl.h>
71#endif
72#ifdef HAVE_GDFONTT_H
73#include <gdfontt.h>
74#endif
75#ifdef HAVE_GDFONTS_H
76#include <gdfonts.h>
77#endif
78#ifdef HAVE_GDFONTMB_H
79#include <gdfontmb.h>
80#endif
81#ifdef HAVE_GDFONTG_H
82#include <gdfontg.h>
83#endif
84#ifdef HAVE_STDARG_H
85#include <stdarg.h>
86#endif
87#ifdef HAVE_INTTYPES_H
88#include <inttypes.h>
89#endif
90#ifdef HAVE_LIMITS_H
91#include <limits.h>
92#endif
93#ifdef HAVE_WINSOCK_H
94#include <winsock.h>
95#endif
96#ifdef HAVE_MATH_H
97#include <math.h>
98#endif
99#ifdef HAVE_LOCALE_H
100#include <locale.h>
101#endif
102#ifdef HAVE_EXECINFO_H
103#include <execinfo.h>
104#endif
105#ifdef HAVE_LIBGEN_H
106#include <libgen.h>
107#endif
108#ifdef HAVE_STDBOOL_H
109#include <stdbool.h>
110#else
111typedef int bool;
112#define true 1
113#define false 0
114#endif
115
116#if defined(HAVE_FOPEN64)
117#define _FILE_OFFSET_BITS 64
118#define MY_FOPEN fopen64
119#else
120#define MY_FOPEN fopen
121#endif
122
123#if !defined(HAVE_BZERO)
124#define bzero(mem,size) memset(mem,0,size)
125#endif
126
127#if defined(IBERTY_LIB) && !defined(HAVE_MKSTEMP)
128int mkstemps(char *template, int suffixlen);
129#define mkstemp(template) mkstemps(template,0)
130#endif
131
132#if defined(ENABLE_NLS) && defined(HAVE_LIBINTL_H)
133#include <libintl.h>
134#define _(String) gettext(String)
135#ifdef gettext_noop
136#define N_(String) gettext_noop(String)
137#else
138#define N_(String) (String)
139#endif
140#else /* No NLS */
141#define _(String) (String)
142#define N_(String) (String)
143#define ngettext(String,Strings,num) (Strings)
144#define textdomain(String)
145#define bindtextdomain(Domain,Directory)
146#endif //NLS
147
148#if defined(__MINGW32__)
149#define mkdir(p,m) _mkdir(p)
150
151#ifndef WIFEXITED
152 #define WIFEXITED(S) 1
153#endif
154
155#ifndef WEXITSTATUS
156 #define WEXITSTATUS(S) (S)
157#endif
158
159#endif /*__MINGW32__*/
160
161#ifndef __GNUC__
162# define __attribute__(x)
163#endif
164
165#define MAXLEN 20000
166#define MAX_URL_LEN 40000
167#define MAX_TRUNCATED_URL 512
168#define MAX_USER_LEN 256
169#define MAX_USER_FNAME_LEN 128
170#define MAX_IP_LEN 64
171#define MAX_DATETIME_LEN 32
172#define MAXLOGS 255
173#define MAX_LOG_FILELEN 1024
174#define MAX_REDIRECTOR_LOGS 64
175#define MAX_REDIRECTOR_FILELEN 1024
176#define MAX_DATETIME_DAYS 90
177
178#define REPORT_TYPE_USERS_SITES 0x0001UL
179#define REPORT_TYPE_SITE_USER_TIME_DATE 0x0002UL
180#define REPORT_TYPE_TOPUSERS 0x0004UL
181#define REPORT_TYPE_TOPSITES 0x0008UL
182#define REPORT_TYPE_SITES_USERS 0x0010UL
183#define REPORT_TYPE_DATE_TIME 0x0020UL
184#define REPORT_TYPE_DENIED 0x0040UL
185#define REPORT_TYPE_AUTH_FAILURES 0x0080UL
186#define REPORT_TYPE_DOWNLOADS 0x0100UL
187
188#define DATA_FIELD_USER 0x0001UL
189#define DATA_FIELD_DATE 0x0002UL
190#define DATA_FIELD_TIME 0x0004UL
191#define DATA_FIELD_URL 0x0008UL
192#define DATA_FIELD_CONNECT 0x0010UL
193#define DATA_FIELD_BYTES 0x0020UL
194#define DATA_FIELD_IN_CACHE 0x0040UL
195#define DATA_FIELD_OUT_CACHE 0x0080UL
196#define DATA_FIELD_ELAPSED 0x0100UL
197
198#define TOPUSERFIELDS_NUM 0x0001UL
199#define TOPUSERFIELDS_DATE_TIME 0x0002UL
200#define TOPUSERFIELDS_USERID 0x0004UL
201#define TOPUSERFIELDS_CONNECT 0x0008UL
202#define TOPUSERFIELDS_BYTES 0x0010UL
203#define TOPUSERFIELDS_SETYB 0x0020UL
204#define TOPUSERFIELDS_IN_CACHE_OUT 0x0040UL
205#define TOPUSERFIELDS_USED_TIME 0x0080UL
206#define TOPUSERFIELDS_MILISEC 0x0100UL
207#define TOPUSERFIELDS_PTIME 0x0200UL
208#define TOPUSERFIELDS_TOTAL 0x0400UL
209#define TOPUSERFIELDS_AVERAGE 0x0800UL
210
211#define USERREPORTFIELDS_CONNECT 0x0001UL
212#define USERREPORTFIELDS_BYTES 0x0002UL
213#define USERREPORTFIELDS_SETYB 0x0004UL
214#define USERREPORTFIELDS_IN_CACHE_OUT 0x0008UL
215#define USERREPORTFIELDS_USED_TIME 0x0010UL
216#define USERREPORTFIELDS_MILISEC 0x0020UL
217#define USERREPORTFIELDS_PTIME 0x0040UL
218#define USERREPORTFIELDS_TOTAL 0x0080UL
219#define USERREPORTFIELDS_AVERAGE 0x0100UL
220
221#define INDEX_YES 0x0001UL
222#define INDEX_NO 0x0002UL
223#define INDEX_ONLY 0x0004UL
224
225#define INDEX_TREE_DATE 0x0001UL
226#define INDEX_TREE_FILE 0x0002UL
227
228#define NTLMUSERFORMAT_USER 0x0001UL
229#define NTLMUSERFORMAT_DOMAINUSER 0x0002UL
230
231#define RECORDWITHOUTUSER_IP 0x0001UL
232#define RECORDWITHOUTUSER_IGNORE 0x0002UL
233#define RECORDWITHOUTUSER_EVERYBODY 0x0004UL
234
235#define DATAFILEURL_IP 0x0001UL
236#define DATAFILEURL_NAME 0x0002UL
237
238#define DISPLAY_BYTES 0x0001UL
239#define DISPLAY_ABBREV 0x0002UL
240
241#define DATETIME_ELAP 0x0001UL
242#define DATETIME_BYTE 0x0002UL
243
244#define REALTIME_UNAUTH_REC_SHOW 0x0001UL
245#define REALTIME_UNAUTH_REC_IGNORE 0x0002UL
246
247#define SORT_REVERSE 0x0001
248
249#define TOPUSER_SORT_REVERSE SORT_REVERSE
250#define TOPUSER_SORT_BYTES 0x0002UL
251#define TOPUSER_SORT_USER 0x0004UL
252#define TOPUSER_SORT_CONNECT 0x0008UL
253#define TOPUSER_SORT_TIME 0x0010UL
254
255#define TOPSITE_SORT_REVERSE SORT_REVERSE
256#define TOPSITE_SORT_BYTES 0x0002UL
257#define TOPSITE_SORT_CONNECT 0x0004UL
258
259#define USER_SORT_REVERSE SORT_REVERSE
260#define USER_SORT_BYTES 0x0002UL
261#define USER_SORT_SITE 0x0004UL
262#define USER_SORT_CONNECT 0x0008UL
263#define USER_SORT_TIME 0x0010UL
264
265struct periodstruct
266{
267 //! The first date of the period.
268 struct tm start;
269 //! The last date of the period.
270 struct tm end;
271 //! The textual representation of the date.
272 char text[40];
273 //! The HTML representation of the date.
274 char html[40];
275};
276
277char outdir[MAXLEN];
278char outdirname[MAXLEN];
279struct periodstruct period;
280char code[MAXLEN];
281char code2[MAXLEN];
282char tmp[MAXLEN];
283char parse_out[MAXLEN];
284char arqtt[MAXLEN];
285char html[MAXLEN];
286char ConfigFile[MAXLEN];
287char df[20];
288int LastLog;
289bool RemoveTempFiles;
290char ReplaceIndex[256];
291unsigned long int Index;
292bool OverwriteReport;
293unsigned long int RecordsWithoutUser;
294bool UseComma;
295char MailUtility[PATH_MAX];
296int TopSitesNum;
297int TopUsersNum;
298char ExcludeCodes[256];
299unsigned long int TopsitesSort;
300unsigned long int ReportType;
301char UserTabFile[255];
302char warea[MAXLEN];
303char name[MAXLEN];
304bool LongUrl;
305bool Ip2Name;
306int NAccessLog;
307char AccessLog[MAXLOGS][MAX_LOG_FILELEN];
308int AccessLogFromCmdLine;
309char Title[MAXLEN];
310char BgColor[MAXLEN];
311char BgImage[MAXLEN];
312char TxColor[MAXLEN];
313char TxBgColor[MAXLEN];
314char TiColor[MAXLEN];
315char LogoImage[MAXLEN];
316char LogoText[MAXLEN];
317char LogoTextColor[MAXLEN];
318char Width[MAXLEN];
319char Height[MAXLEN];
320char FontFace[MAXLEN];
321char HeaderColor[MAXLEN];
322char HeaderBgColor[MAXLEN];
323char FontSize[MAXLEN];
324char PasswdFile[MAXLEN];
325char TempDir[MAXLEN];
326char OutputDir[MAXLEN];
327char OutputEmail[MAXLEN];
328unsigned long int TopuserSort;
329unsigned long int UserSort;
330char UserAgentLog[255];
331char module[255];
332char ExcludeHosts[255];
333char ExcludeUsers[255];
334char DateFormat[2];
335char PerUserLimitFile[255];
336int PerUserLimit;
337bool UserIp;
338char MaxElapsed[255];
339unsigned long int datetimeby;
340char CharSet[255];
341char UserInvalidChar[255];
342bool Graphs;
343char GraphDaysBytesBarColor[255];
344bool Privacy;
345char PrivacyString[255];
346char PrivacyStringColor[30];
347char IncludeUsers[MAXLEN];
348char ExcludeString[MAXLEN];
349bool SuccessfulMsg;
350unsigned long int TopUserFields;
351unsigned long int UserReportFields;
352char DataFile[MAXLEN];
353char DataFileDelimiter[3];
354unsigned long int DataFileFields;
355unsigned long int DataFileUrl;
356bool ShowReadStatistics;
357char IndexSortOrder[5];
358char DansGuardianConf[MAXLEN];
359bool DansguardianFilterOutDate;
360char SquidGuardConf[MAXLEN];
361char SquidGuarddbHome[255];
362char RedirectorLogFormat[4096];
363int NRedirectorLogs;
364char RedirectorLogs[MAX_REDIRECTOR_LOGS][MAX_REDIRECTOR_FILELEN];
365int RedirectorLogFromCmdLine;
366bool RedirectorFilterOutDate;
367bool ShowSargInfo;
368bool BytesInSitesUsersReport;
369bool ShowSargLogo;
370char ParsedOutputLog[MAXLEN];
371char ParsedOutputLogCompress[512];
372unsigned long int DisplayedValues;
373char HeaderFontSize[5];
374char TitleFontSize[5];
375char wwwDocumentRoot[MAXLEN];
376char ExternalCSSFile[MAXLEN];
377char BlockIt[255];
378unsigned long int NtlmUserFormat;
379unsigned long int IndexTree;
380bool UserAuthentication;
381char AuthUserTemplateFile[1024];
382char val1[MAXLEN];
383char val2[MAXLEN];
384char val3[MAXLEN];
385char val4[MAXLEN];
386char val5[MAXLEN];
387char val6[MAXLEN];
388char val7[MAXLEN];
389char val8[MAXLEN];
390char val9[MAXLEN];
391char val10[MAXLEN];
392char val11[MAXLEN];
393char wwork1[MAXLEN];
394char wwork2[MAXLEN];
395char wwork3[MAXLEN];
396char mask[MAXLEN];
397char site[MAXLEN];
398char us[50];
399char email[MAXLEN];
400char test[1];
401char user2[MAXLEN];
402char wentp[512];
403char addr[MAXLEN];
404char Ulimit[6];
405char RealtimeTypes[1024];
406char cmd[255];
407char ImageFile[255];
408unsigned long int RealtimeUnauthRec;
409char LDAPHost[255];
410char LDAPBindDN[512];
411char LDAPBindPW[255];
412int LDAPPort;
413int LDAPProtocolVersion;
414char LDAPBaseSearch[255];
415char LDAPFilterSearch[512];
416char LDAPTargetAttr[64];
417char GraphFont[MAXLEN];
418
419int idate;
420int smartfilter;
421int denied_count;
422int download_count;
423int authfail_count;
424int dansguardian_count;
425int squidguard_count;
426int useragent_count;
427int limit_flag;
428int z1, z2, z3;
429int ttopen;
430int sarglog;
431int isalog;
432int dfrom;
433int duntil;
434int dataonly;
435int indexonly;
436bool iprel;
437int langcode;
438int debug;
439int debugz;
440int debugm;
441int AuthfailReportLimit;
442int DeniedReportLimit;
443int DownloadReportLimit;
444int SiteUsersReportLimit;
445int DansGuardianReportLimit;
446int SquidGuardReportLimit;
447int UserReportLimit;
448int realtime_refresh;
449int realtime_access_log_lines;
450int rc;
451int ntopsites;
452int nsitesusers;
453int nrepday;
454int ndownload;
455int ntopuser;
456bool squid24;
457
458long long int nocost;
459float cost;
460
461typedef struct
462{ int list[ 24 ];
463 int len;
464} numlist;
465
466DIR *dirp;
467struct dirent *direntp;