]> git.ipfire.org Git - thirdparty/sarg.git/blame - include/conf.h
Remove the u_long that may be incompatible with mini mac
[thirdparty/sarg.git] / include / conf.h
CommitLineData
b3695c67 1#include "config.h"
25697a35 2#include "info.h"
e3af0ae9 3#include "btree_cache.h"
25697a35 4
b3695c67
FM
5#ifdef HAVE_WINDOWS_H
6#include <windows.h>
7#endif
8#ifdef HAVE_STDIO_H
25697a35
GS
9#include <stdio.h>
10#endif
b3695c67 11#ifdef HAVE_STDLIB_H
25697a35
GS
12#include <stdlib.h>
13#endif
b3695c67 14#ifdef HAVE_STRING_H
25697a35
GS
15#include <string.h>
16#endif
b3695c67 17#ifdef HAVE_STRINGS_H
25697a35
GS
18#include <strings.h>
19#endif
b3695c67 20#ifdef HAVE_SYS_TIME_H
25697a35
GS
21#include <sys/time.h>
22#endif
b3695c67 23#ifdef HAVE_TIME_H
25697a35
GS
24#include <time.h>
25#endif
b3695c67 26#ifdef HAVE_SYS_RESOURCE_H
25697a35
GS
27#include <sys/resource.h>
28#endif
b3695c67 29#ifdef HAVE_UNISTD_H
25697a35
GS
30#include <unistd.h>
31#endif
b3695c67 32#if defined(HAVE_SYS_DIRENT_H) && !defined(HAVE_DIRENT_H)
25697a35
GS
33#include <sys/dirent.h>
34#endif
b3695c67 35#ifdef HAVE_DIRENT_H
25697a35
GS
36#include <dirent.h>
37#endif
b3695c67 38#ifdef HAVE_SYS_SOCKET_H
25697a35
GS
39#include <sys/socket.h>
40#endif
b3695c67 41#ifdef HAVE_NETDB_H
25697a35
GS
42#include <netdb.h>
43#endif
b3695c67 44#ifdef HAVE_TYPES_H
25697a35
GS
45#include <types.h>
46#endif
b3695c67 47#ifdef HAVE_NETINET_IN_H
25697a35
GS
48#include <netinet/in.h>
49#endif
b3695c67 50#ifdef HAVE_ARPA_INET_H
25697a35
GS
51#include <arpa/inet.h>
52#endif
b3695c67 53#ifdef HAVE_SYS_STAT_H
25697a35
GS
54#include <sys/stat.h>
55#endif
b3695c67 56#ifdef HAVE_CTYPE_H
25697a35
GS
57#include <ctype.h>
58#endif
b3695c67 59#ifdef HAVE_ERRNO_H
25697a35
GS
60#include <errno.h>
61#endif
b3695c67 62#ifdef HAVE_SYS_WAIT_H
d96e3ba6
FM
63#include <sys/wait.h>
64#endif
b3695c67 65#ifdef HAVE_GD_H
25697a35
GS
66#include <gd.h>
67#define HAVE_GD
68gdImagePtr im;
69gdPoint points[4];
70#endif
b3695c67 71#ifdef HAVE_GDFONTL_H
25697a35
GS
72#include <gdfontl.h>
73#endif
b3695c67 74#ifdef HAVE_GDFONTT_H
25697a35
GS
75#include <gdfontt.h>
76#endif
b3695c67 77#ifdef HAVE_GDFONTS_H
25697a35
GS
78#include <gdfonts.h>
79#endif
b3695c67 80#ifdef HAVE_GDFONTMB_H
25697a35
GS
81#include <gdfontmb.h>
82#endif
b3695c67 83#ifdef HAVE_GDFONTG_H
25697a35
GS
84#include <gdfontg.h>
85#endif
b3695c67 86#ifdef HAVE_STDARG_H
d2fe0c32
FM
87#include <stdarg.h>
88#endif
b3695c67 89#ifdef HAVE_INTTYPES_H
2357ef77
FM
90#include <inttypes.h>
91#endif
b3695c67 92#ifdef HAVE_LIMITS_H
4af2f8ff
FM
93#include <limits.h>
94#endif
b3695c67
FM
95#ifdef HAVE_WINSOCK_H
96#include <winsock.h>
97#endif
e3af0ae9
PO
98#ifdef HAVE_MATH_H
99#include <math.h>
100#endif
a1de61fe
FM
101#ifdef HAVE_LOCALE_H
102#include <locale.h>
103#endif
e6414a9d
FM
104#ifdef HAVE_EXECINFO_H
105#include <execinfo.h>
106#endif
d5d021c5
FM
107#ifdef HAVE_LIBGEN_H
108#include <libgen.h>
109#endif
25697a35 110
b3695c67 111#if defined(HAVE_FOPEN64)
25697a35 112#define _FILE_OFFSET_BITS 64
936c9905 113#define MY_FOPEN fopen64
25697a35
GS
114#else
115#define MY_FOPEN fopen
116#endif
117
b3695c67
FM
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)
123int mkstemps(char *template, int suffixlen);
124#define mkstemp(template) mkstemps(template,0)
125#endif
126
eca2cec9 127#if defined(ENABLE_NLS) && defined(HAVE_LIBINTL_H)
c0ec9cc7
FM
128#include <libintl.h>
129#define _(String) gettext(String)
130#ifdef gettext_noop
131#define N_(String) gettext_noop(String)
132#else
133#define N_(String) (String)
134#endif
135#else /* No NLS */
136#define _(String) (String)
137#define N_(String) (String)
138#define textdomain(String)
139#define bindtextdomain(Domain,Directory)
eca2cec9 140#endif //NLS
c0ec9cc7 141
b3695c67
FM
142#if defined(__MINGW32__)
143#define mkdir(p,m) _mkdir(p)
144
145#ifndef WIFEXITED
146 #define WIFEXITED(S) 1
147#endif
148
149#ifndef WEXITSTATUS
150 #define WEXITSTATUS(S) (S)
151#endif
152
153#endif /*__MINGW32__*/
25697a35
GS
154
155#define MAXLEN 20000
ac422f9b 156#define MAX_URL_LEN 40000
e5b2c6f0 157#define MAX_TRUNCATED_URL 512
f2ec8c75
FM
158#define MAX_USER_LEN 256
159#define MAX_USER_FNAME_LEN 128
2240dcea
FM
160#define MAX_IP_LEN 64
161#define MAX_DATETIME_LEN 32
0a4e18e1 162#define MAXLOGS 255
25697a35 163
085c1e1f
FM
164#define REPORT_TYPE_USERS_SITES 0x0001UL
165#define REPORT_TYPE_SITE_USER_TIME_DATE 0x0002UL
166#define REPORT_TYPE_TOPUSERS 0x0004UL
167#define REPORT_TYPE_TOPSITES 0x0008UL
168#define REPORT_TYPE_SITES_USERS 0x0010UL
169#define REPORT_TYPE_DATE_TIME 0x0020UL
170#define REPORT_TYPE_DENIED 0x0040UL
171#define REPORT_TYPE_AUTH_FAILURES 0x0080UL
172#define REPORT_TYPE_DOWNLOADS 0x0100UL
173
174#define DATA_FIELD_USER 0x0001UL
175#define DATA_FIELD_DATE 0x0002UL
176#define DATA_FIELD_TIME 0x0004UL
177#define DATA_FIELD_URL 0x0008UL
178#define DATA_FIELD_CONNECT 0x0010UL
179#define DATA_FIELD_BYTES 0x0020UL
180#define DATA_FIELD_IN_CACHE 0x0040UL
181#define DATA_FIELD_OUT_CACHE 0x0080UL
182#define DATA_FIELD_ELAPSED 0x0100UL
183
184#define TOPUSERFIELDS_NUM 0x0001UL
185#define TOPUSERFIELDS_DATE_TIME 0x0002UL
186#define TOPUSERFIELDS_USERID 0x0004UL
187#define TOPUSERFIELDS_CONNECT 0x0008UL
188#define TOPUSERFIELDS_BYTES 0x0010UL
189#define TOPUSERFIELDS_SETYB 0x0020UL
190#define TOPUSERFIELDS_IN_CACHE_OUT 0x0040UL
191#define TOPUSERFIELDS_USED_TIME 0x0080UL
192#define TOPUSERFIELDS_MILISEC 0x0100UL
193#define TOPUSERFIELDS_PTIME 0x0200UL
194#define TOPUSERFIELDS_TOTAL 0x0400UL
195#define TOPUSERFIELDS_AVERAGE 0x0800UL
196
197#define USERREPORTFIELDS_CONNECT 0x0001UL
198#define USERREPORTFIELDS_BYTES 0x0002UL
199#define USERREPORTFIELDS_SETYB 0x0004UL
200#define USERREPORTFIELDS_IN_CACHE_OUT 0x0008UL
201#define USERREPORTFIELDS_USED_TIME 0x0010UL
202#define USERREPORTFIELDS_MILISEC 0x0020UL
203#define USERREPORTFIELDS_PTIME 0x0040UL
204#define USERREPORTFIELDS_TOTAL 0x0080UL
205#define USERREPORTFIELDS_AVERAGE 0x0100UL
206
0349fa24
FM
207#define INDEX_YES 0x0001UL
208#define INDEX_NO 0x0002UL
209#define INDEX_ONLY 0x0004UL
210
211#define INDEX_TREE_DATE 0x0001UL
212#define INDEX_TREE_FILE 0x0002UL
213
f2ec8c75
FM
214#define NTLMUSERFORMAT_USER 0x0001UL
215#define NTLMUSERFORMAT_DOMAINUSER 0x0002UL
216
217#define RECORDWITHOUTUSER_IP 0x0001UL
218#define RECORDWITHOUTUSER_IGNORE 0x0002UL
219#define RECORDWITHOUTUSER_EVERYBODY 0x0004UL
220
f84a35a3
FM
221#define DATAFILEURL_IP 0x0001UL
222#define DATAFILEURL_NAME 0x0002UL
223
25697a35 224char outdir[MAXLEN];
d5d021c5 225char outdirname[MAXLEN];
25697a35 226char buf[MAXLEN];
d6e703cc 227char period[MAXLEN];
d6e703cc
FM
228char code[MAXLEN];
229char code2[MAXLEN];
25697a35 230char tmp[MAXLEN];
25697a35
GS
231char parse_out[MAXLEN];
232char arqtt[MAXLEN];
233char html[MAXLEN];
25697a35 234char ConfigFile[MAXLEN];
25697a35 235char df[20];
25697a35
GS
236char cdfrom[30];
237char cduntil[30];
0511cf2d 238int LastLog;
e6414a9d 239int RemoveTempFiles;
25697a35 240char ReplaceIndex[256];
0349fa24 241unsigned long int Index;
e6414a9d 242int OverwriteReport;
f2ec8c75 243unsigned long int RecordsWithoutUser;
e6414a9d 244int UseComma;
4af2f8ff 245char MailUtility[PATH_MAX];
c0ec9cc7 246int TopSitesNum;
fb7c5f27 247int TopUsersNum;
25697a35
GS
248char ExcludeCodes[256];
249char TopsitesSortField[15];
491b862f 250char TopsitesSortType[20];
085c1e1f 251unsigned long int ReportType;
25697a35
GS
252char UserTabFile[255];
253char warea[MAXLEN];
254char name[MAXLEN];
246c8489
FM
255int LongUrl;
256int Ip2Name;
0a4e18e1
FM
257int NAccessLog;
258char AccessLog[MAXLOGS][MAXLEN];
259int AccessLogFromCmdLine;
25697a35
GS
260char Title[MAXLEN];
261char BgColor[MAXLEN];
262char BgImage[MAXLEN];
263char TxColor[MAXLEN];
264char TxBgColor[MAXLEN];
265char TiColor[MAXLEN];
266char LogoImage[MAXLEN];
267char LogoText[MAXLEN];
268char LogoTextColor[MAXLEN];
269char Width[MAXLEN];
270char Height[MAXLEN];
271char FontFace[MAXLEN];
272char HeaderColor[MAXLEN];
273char HeaderBgColor[MAXLEN];
274char FontSize[MAXLEN];
275char PasswdFile[MAXLEN];
276char TempDir[MAXLEN];
277char OutputDir[MAXLEN];
278char OutputEmail[MAXLEN];
279char TopuserSortField[30];
280char UserSortField[30];
281char TopuserSortOrder[10];
282char UserSortOrder[10];
283char UserAgentLog[255];
284char module[255];
285char ExcludeHosts[255];
286char ExcludeUsers[255];
287char DateFormat[2];
288char PerUserLimitFile[255];
e6414a9d 289int PerUserLimit;
246c8489 290int UserIp;
25697a35
GS
291char MaxElapsed[255];
292char datetimeby[10];
25697a35
GS
293char CharSet[255];
294char UserInvalidChar[255];
e6414a9d 295int Graphs;
25697a35 296char GraphDaysBytesBarColor[255];
e6414a9d 297int Privacy;
25697a35
GS
298char PrivacyString[255];
299char PrivacyStringColor[30];
300char IncludeUsers[MAXLEN];
301char ExcludeString[MAXLEN];
e6414a9d 302int SuccessfulMsg;
085c1e1f
FM
303unsigned long int TopUserFields;
304unsigned long int UserReportFields;
25697a35
GS
305char DataFile[MAXLEN];
306char DataFileDelimiter[3];
085c1e1f 307unsigned long int DataFileFields;
f84a35a3 308unsigned long int DataFileUrl;
e6414a9d 309int ShowReadStatistics;
25697a35
GS
310char IndexSortOrder[5];
311char DansGuardianConf[MAXLEN];
e6414a9d 312int DansguardianIgnoreDate;
25697a35
GS
313char SquidGuardConf[MAXLEN];
314char SquidGuarddbHome[255];
315char SquidGuardLogFormat[MAXLEN];
491b862f 316char SquidGuardLogAlternate[MAXLEN];
e6414a9d
FM
317int SquidguardIgnoreDate;
318int ShowSargInfo;
319int BytesInSitesUsersReport;
320int ShowSargLogo;
25697a35 321char ParsedOutputLog[MAXLEN];
ff8d5836 322char ParsedOutputLogCompress[512];
25697a35 323char DisplayedValues[20];
933aca19 324char HeaderFontSize[5];
491b862f 325char TitleFontSize[5];
25697a35
GS
326char wwwDocumentRoot[MAXLEN];
327char ExternalCSSFile[MAXLEN];
328char BlockIt[255];
f2ec8c75 329unsigned long int NtlmUserFormat;
0349fa24 330unsigned long int IndexTree;
e6414a9d 331int UserAuthentication;
d5d021c5 332char AuthUserTemplateFile[1024];
25697a35
GS
333char *str;
334char *str2;
25697a35
GS
335char val1[MAXLEN];
336char val2[MAXLEN];
337char val3[MAXLEN];
338char val4[MAXLEN];
339char val5[MAXLEN];
340char val6[MAXLEN];
341char val7[MAXLEN];
342char val8[MAXLEN];
343char val9[MAXLEN];
344char val10[MAXLEN];
345char val11[MAXLEN];
346char wwork1[MAXLEN];
347char wwork2[MAXLEN];
348char wwork3[MAXLEN];
25697a35 349char mask[MAXLEN];
25697a35
GS
350char site[MAXLEN];
351char us[50];
352char email[MAXLEN];
353char test[1];
354char ouser2[255];
355char user2[MAXLEN];
356char wentp[512];
357char addr[MAXLEN];
491b862f
GS
358char Ulimit[6];
359char RealtimeTypes[1024];
25697a35 360char cmd[255];
491b862f
GS
361char ImageFile[255];
362char tbuf[128];
363char ip[25];
364char RealtimeUnauthRec[15];
e3af0ae9
PO
365char LDAPHost[255];
366char LDAPBindDN[512];
367char LDAPBindPW[255];
965c4a6f
FM
368int LDAPPort;
369int LDAPProtocolVersion;
e3af0ae9
PO
370char LDAPBaseSearch[255];
371char LDAPFilterSearch[512];
372char LDAPTargetAttr[64];
3becf85c 373char GraphFont[MAXLEN];
491b862f 374
25697a35
GS
375int idate;
376int smartfilter;
377int denied_count;
378int download_count;
379int authfail_count;
380int dansguardian_count;
381int squidguard_count;
c0ec9cc7 382int useragent_count;
25697a35
GS
383int limit_flag;
384int color1;
385int color2;
386int color3;
387int z1, z2, z3;
388int ttopen;
25697a35
GS
389int sarglog;
390int isalog;
2357ef77 391int dfrom;
25697a35
GS
392int duntil;
393int dataonly;
394int indexonly;
395int iprel;
396int userip;
397int langcode;
398int debug;
399int debugz;
400int debugm;
401int AuthfailReportLimit;
402int DeniedReportLimit;
94ff9470 403int DownloadReportLimit;
25697a35
GS
404int SiteUsersReportLimit;
405int DansGuardianReportLimit;
406int SquidGuardReportLimit;
407int UserReportLimit;
491b862f
GS
408int realtime_refresh;
409int realtime_access_log_lines;
410int realt;
491b862f 411int rc;
d6e703cc
FM
412int ntopsites;
413int nsitesusers;
414int nrepday;
415int ndownload;
416int ntopuser;
417int squid24;
25697a35
GS
418float perc;
419
491b862f
GS
420long long int nocost;
421float cost;
25697a35
GS
422
423typedef struct
424{ int list[ 24 ];
425 int len;
426} numlist;
427
428DIR *dirp;
429struct dirent *direntp;