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