conf.h (sarg-2.3.11) | : | conf.h (sarg-2.4.0) | ||
---|---|---|---|---|
#include "config.h" | #include "config.h" | |||
#include "info.h" | #include "info.h" | |||
#include "btree_cache.h" | #include "btree_cache.h" | |||
#ifdef HAVE_WINSOCK2_H | ||||
#include <winsock2.h> | ||||
#endif | ||||
#ifdef HAVE_WINDOWS_H | #ifdef HAVE_WINDOWS_H | |||
#include <windows.h> | #include <windows.h> | |||
#endif | #endif | |||
#ifdef HAVE_STDIO_H | #ifdef HAVE_STDIO_H | |||
#include <stdio.h> | #include <stdio.h> | |||
#endif | #endif | |||
#ifdef HAVE_STDLIB_H | #ifdef HAVE_STDLIB_H | |||
#include <stdlib.h> | #include <stdlib.h> | |||
#endif | #endif | |||
#ifdef HAVE_STRING_H | #ifdef HAVE_STRING_H | |||
skipping to change at line 118 | skipping to change at line 121 | |||
#ifdef HAVE_STDBOOL_H | #ifdef HAVE_STDBOOL_H | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#else | #else | |||
typedef int bool; | typedef int bool; | |||
#define true 1 | #define true 1 | |||
#define false 0 | #define false 0 | |||
#endif | #endif | |||
#ifdef HAVE_FCNTL_H | #ifdef HAVE_FCNTL_H | |||
#include <fcntl.h> | #include <fcntl.h> | |||
#endif | #endif | |||
#ifdef HAVE_FNMATCH_H | ||||
#include <fnmatch.h> | ||||
#endif | ||||
#if defined(HAVE_FOPEN64) | #if defined(HAVE_FOPEN64) | |||
#define _FILE_OFFSET_BITS 64 | #define _FILE_OFFSET_BITS 64 | |||
#define MY_FOPEN fopen64 | #define MY_FOPEN fopen64 | |||
#else | #else | |||
#define MY_FOPEN fopen | #define MY_FOPEN fopen | |||
#endif | #endif | |||
#if !defined(HAVE_BZERO) | #if !defined(HAVE_BZERO) | |||
#define bzero(mem,size) memset(mem,0,size) | #define bzero(mem,size) memset(mem,0,size) | |||
#endif | #endif | |||
#if defined(IBERTY_LIB) && !defined(HAVE_MKSTEMP) | #if defined(IBERTY_LIB) && !defined(HAVE_MKSTEMP) | |||
int mkstemps(char *template, int suffixlen); | int mkstemps(char *template, int suffixlen); | |||
#define mkstemp(template) mkstemps(template,0) | #define mkstemp(template) mkstemps(template,0) | |||
#endif | #endif | |||
#ifdef __MINGW32__ | ||||
#define pgettext(msgctxt,msgid) (msgid) | ||||
#define ngettext(singular,plural,number) (plural) | ||||
#else | ||||
#include "gettext.h" | ||||
#endif | ||||
#if defined(ENABLE_NLS) && defined(HAVE_LIBINTL_H) | #if defined(ENABLE_NLS) && defined(HAVE_LIBINTL_H) | |||
#include <libintl.h> | ||||
#define _(String) gettext(String) | #define _(String) gettext(String) | |||
#ifdef gettext_noop | #ifdef gettext_noop | |||
#define N_(String) gettext_noop(String) | #define N_(String) gettext_noop(String) | |||
#else | #else | |||
#define N_(String) (String) | #define N_(String) (String) | |||
#endif | #endif | |||
#else /* No NLS */ | #else /* No NLS */ | |||
#define _(String) (String) | #define _(String) (String) | |||
#define N_(String) (String) | #define N_(String) (String) | |||
#define ngettext(String,Strings,num) (Strings) | ||||
#define textdomain(String) | ||||
#define bindtextdomain(Domain,Directory) | ||||
#endif //NLS | #endif //NLS | |||
#if defined(__MINGW32__) | #if defined(__MINGW32__) | |||
#define mkdir(p,m) _mkdir(p) | #define mkdir(p,m) _mkdir(p) | |||
#ifndef WIFEXITED | #ifndef WIFEXITED | |||
#define WIFEXITED(S) 1 | #define WIFEXITED(S) 1 | |||
#endif | #endif | |||
#ifndef WEXITSTATUS | #ifndef WEXITSTATUS | |||
skipping to change at line 170 | skipping to change at line 178 | |||
#endif | #endif | |||
#endif /*__MINGW32__*/ | #endif /*__MINGW32__*/ | |||
#ifndef __GNUC__ | #ifndef __GNUC__ | |||
# define __attribute__(x) | # define __attribute__(x) | |||
#endif | #endif | |||
#define MAXLEN 20000 | #define MAXLEN 20000 | |||
#define MAX_URL_LEN 40000 | #define MAX_URL_LEN 40000 | |||
#define MAX_TRUNCATED_URL 512 | #define MAX_TRUNCATED_URL 250 | |||
#define MAX_USER_LEN 256 | #define MAX_USER_LEN 256 | |||
#define MAX_USER_FNAME_LEN 128 | #define MAX_USER_FNAME_LEN 128 | |||
#define MAX_IP_LEN 64 | #define MAX_IP_LEN 64 | |||
#define MAX_DATETIME_LEN 32 | #define MAX_DATETIME_LEN 32 | |||
#define MAXLOGS 255 | ||||
#define MAX_LOG_FILELEN 1024 | ||||
#define MAX_REDIRECTOR_LOGS 64 | #define MAX_REDIRECTOR_LOGS 64 | |||
#define MAX_REDIRECTOR_FILELEN 1024 | #define MAX_REDIRECTOR_FILELEN 1024 | |||
/*! | /*! | |||
Arbitrary limit on the number of days that are accepted in the selected range of the log file. | Arbitrary limit on the number of days that are accepted in the selected range of the log file. | |||
Sarg will complain that there are too many days in the files if this limit is ov errun. | Sarg will complain that there are too many days in the files if this limit is ov errun. | |||
*/ | */ | |||
#define MAX_DATETIME_DAYS 1000 | #define MAX_DATETIME_DAYS 1000 | |||
#define REPORT_TYPE_USERS_SITES 0x0001UL | #define REPORT_TYPE_USERS_SITES 0x0001UL | |||
#define REPORT_TYPE_SITE_USER_TIME_DATE 0x0002UL | #define REPORT_TYPE_SITE_USER_TIME_DATE 0x0002UL | |||
#define REPORT_TYPE_TOPUSERS 0x0004UL | #define REPORT_TYPE_TOPUSERS 0x0004UL | |||
#define REPORT_TYPE_TOPSITES 0x0008UL | #define REPORT_TYPE_TOPSITES 0x0008UL | |||
#define REPORT_TYPE_SITES_USERS 0x0010UL | #define REPORT_TYPE_SITES_USERS 0x0010UL | |||
#define REPORT_TYPE_DATE_TIME 0x0020UL | #define REPORT_TYPE_DATE_TIME 0x0020UL | |||
#define REPORT_TYPE_DENIED 0x0040UL | #define REPORT_TYPE_DENIED 0x0040UL | |||
#define REPORT_TYPE_AUTH_FAILURES 0x0080UL | #define REPORT_TYPE_AUTH_FAILURES 0x0080UL | |||
#define REPORT_TYPE_DOWNLOADS 0x0100UL | #define REPORT_TYPE_DOWNLOADS 0x0100UL | |||
#define REPORT_TYPE_USERAGENT 0x0200UL | ||||
#define DATA_FIELD_USER 0x0001UL | #define DATA_FIELD_USER 0x0001UL | |||
#define DATA_FIELD_DATE 0x0002UL | #define DATA_FIELD_DATE 0x0002UL | |||
#define DATA_FIELD_TIME 0x0004UL | #define DATA_FIELD_TIME 0x0004UL | |||
#define DATA_FIELD_URL 0x0008UL | #define DATA_FIELD_URL 0x0008UL | |||
#define DATA_FIELD_CONNECT 0x0010UL | #define DATA_FIELD_CONNECT 0x0010UL | |||
#define DATA_FIELD_BYTES 0x0020UL | #define DATA_FIELD_BYTES 0x0020UL | |||
#define DATA_FIELD_IN_CACHE 0x0040UL | #define DATA_FIELD_IN_CACHE 0x0040UL | |||
#define DATA_FIELD_OUT_CACHE 0x0080UL | #define DATA_FIELD_OUT_CACHE 0x0080UL | |||
#define DATA_FIELD_ELAPSED 0x0100UL | #define DATA_FIELD_ELAPSED 0x0100UL | |||
skipping to change at line 217 | skipping to change at line 224 | |||
#define TOPUSERFIELDS_USERID 0x0004UL | #define TOPUSERFIELDS_USERID 0x0004UL | |||
#define TOPUSERFIELDS_CONNECT 0x0008UL | #define TOPUSERFIELDS_CONNECT 0x0008UL | |||
#define TOPUSERFIELDS_BYTES 0x0010UL | #define TOPUSERFIELDS_BYTES 0x0010UL | |||
#define TOPUSERFIELDS_SETYB 0x0020UL | #define TOPUSERFIELDS_SETYB 0x0020UL | |||
#define TOPUSERFIELDS_IN_CACHE_OUT 0x0040UL | #define TOPUSERFIELDS_IN_CACHE_OUT 0x0040UL | |||
#define TOPUSERFIELDS_USED_TIME 0x0080UL | #define TOPUSERFIELDS_USED_TIME 0x0080UL | |||
#define TOPUSERFIELDS_MILISEC 0x0100UL | #define TOPUSERFIELDS_MILISEC 0x0100UL | |||
#define TOPUSERFIELDS_PTIME 0x0200UL | #define TOPUSERFIELDS_PTIME 0x0200UL | |||
#define TOPUSERFIELDS_TOTAL 0x0400UL | #define TOPUSERFIELDS_TOTAL 0x0400UL | |||
#define TOPUSERFIELDS_AVERAGE 0x0800UL | #define TOPUSERFIELDS_AVERAGE 0x0800UL | |||
#define TOPUSERFIELDS_USERIP 0x1000UL | ||||
#define USERREPORTFIELDS_CONNECT 0x0001UL | #define USERREPORTFIELDS_CONNECT 0x0001UL | |||
#define USERREPORTFIELDS_BYTES 0x0002UL | #define USERREPORTFIELDS_BYTES 0x0002UL | |||
#define USERREPORTFIELDS_SETYB 0x0004UL | #define USERREPORTFIELDS_SETYB 0x0004UL | |||
#define USERREPORTFIELDS_IN_CACHE_OUT 0x0008UL | #define USERREPORTFIELDS_IN_CACHE_OUT 0x0008UL | |||
#define USERREPORTFIELDS_USED_TIME 0x0010UL | #define USERREPORTFIELDS_USED_TIME 0x0010UL | |||
#define USERREPORTFIELDS_MILISEC 0x0020UL | #define USERREPORTFIELDS_MILISEC 0x0020UL | |||
#define USERREPORTFIELDS_PTIME 0x0040UL | #define USERREPORTFIELDS_PTIME 0x0040UL | |||
#define USERREPORTFIELDS_TOTAL 0x0080UL | #define USERREPORTFIELDS_TOTAL 0x0080UL | |||
#define USERREPORTFIELDS_AVERAGE 0x0100UL | #define USERREPORTFIELDS_AVERAGE 0x0100UL | |||
skipping to change at line 284 | skipping to change at line 292 | |||
#define USER_SORT_TIME 0x0010UL | #define USER_SORT_TIME 0x0010UL | |||
//! Value to exclude all the javascripts from the html page. | //! Value to exclude all the javascripts from the html page. | |||
#define HTML_JS_NONE 0x0000 | #define HTML_JS_NONE 0x0000 | |||
//! Bit to include sorttable.js in the html plage. | //! Bit to include sorttable.js in the html plage. | |||
#define HTML_JS_SORTTABLE 0x0001 | #define HTML_JS_SORTTABLE 0x0001 | |||
//! The character prefixed in front of the host names that are aliased. | //! The character prefixed in front of the host names that are aliased. | |||
#define ALIAS_PREFIX '*' | #define ALIAS_PREFIX '*' | |||
//! Maximum number of limit files that can be stored. | ||||
#define MAX_USER_LIMITS 16 | ||||
//! Name of the html file containing the index of a report file. | ||||
#define INDEX_HTML_FILE "index.html" | ||||
struct periodstruct | struct periodstruct | |||
{ | { | |||
//! The first date of the period. | //! The first date of the period. | |||
struct tm start; | struct tm start; | |||
//! The last date of the period. | //! The last date of the period. | |||
struct tm end; | struct tm end; | |||
//! The textual representation of the date. | //! The textual representation of the date. | |||
char text[40]; | char text[90]; | |||
//! The HTML representation of the date. | //! The HTML representation of the date. | |||
char html[40]; | char html[90]; | |||
}; | }; | |||
char outdir[MAXLEN]; | char outdir[MAXLEN]; | |||
char outdirname[MAXLEN]; | char outdirname[MAXLEN]; | |||
struct periodstruct period; | struct periodstruct period; | |||
char code[MAXLEN]; | char code[MAXLEN]; | |||
char code2[MAXLEN]; | char code2[MAXLEN]; | |||
char tmp[MAXLEN]; | char tmp[MAXLEN]; | |||
char parse_out[MAXLEN]; | char parse_out[MAXLEN]; | |||
char arqtt[MAXLEN]; | ||||
char html[MAXLEN]; | char html[MAXLEN]; | |||
char ConfigFile[MAXLEN]; | char ConfigFile[MAXLEN]; | |||
char df[20]; | char df; | |||
int LastLog; | int LastLog; | |||
bool RemoveTempFiles; | bool RemoveTempFiles; | |||
char ReplaceIndex[256]; | char ReplaceIndex[256]; | |||
unsigned long int Index; | unsigned long int Index; | |||
bool OverwriteReport; | bool OverwriteReport; | |||
unsigned long int RecordsWithoutUser; | unsigned long int RecordsWithoutUser; | |||
bool UseComma; | bool UseComma; | |||
char MailUtility[PATH_MAX]; | char MailUtility[PATH_MAX]; | |||
int TopSitesNum; | int TopSitesNum; | |||
int TopUsersNum; | int TopUsersNum; | |||
char ExcludeCodes[256]; | char ExcludeCodes[256]; | |||
unsigned long int TopsitesSort; | unsigned long int TopsitesSort; | |||
unsigned long int ReportType; | unsigned long int ReportType; | |||
char UserTabFile[255]; | char UserTabFile[255]; | |||
char warea[MAXLEN]; | char warea[MAXLEN]; | |||
char name[MAXLEN]; | char name[MAXLEN]; | |||
bool LongUrl; | bool LongUrl; | |||
bool Ip2Name; | bool Ip2Name; | |||
int NAccessLog; | ||||
char AccessLog[MAXLOGS][MAX_LOG_FILELEN]; | ||||
int AccessLogFromCmdLine; | int AccessLogFromCmdLine; | |||
char Title[MAXLEN]; | char Title[MAXLEN]; | |||
char BgColor[MAXLEN]; | char BgColor[MAXLEN]; | |||
char BgImage[MAXLEN]; | char BgImage[MAXLEN]; | |||
char TxColor[MAXLEN]; | char TxColor[MAXLEN]; | |||
char TxBgColor[MAXLEN]; | char TxBgColor[MAXLEN]; | |||
char TiColor[MAXLEN]; | char TiColor[MAXLEN]; | |||
char LogoImage[MAXLEN]; | char LogoImage[MAXLEN]; | |||
char LogoText[MAXLEN]; | char LogoText[MAXLEN]; | |||
char LogoTextColor[MAXLEN]; | char LogoTextColor[MAXLEN]; | |||
char Width[MAXLEN]; | char Width[MAXLEN]; | |||
char Height[MAXLEN]; | char Height[MAXLEN]; | |||
char FontFace[MAXLEN]; | char FontFace[MAXLEN]; | |||
char HeaderColor[MAXLEN]; | char HeaderColor[MAXLEN]; | |||
char HeaderBgColor[MAXLEN]; | char HeaderBgColor[MAXLEN]; | |||
char FontSize[MAXLEN]; | char FontSize[MAXLEN]; | |||
char PasswdFile[MAXLEN]; | char PasswdFile[MAXLEN]; | |||
char TempDir[MAXLEN]; | char TempDir[MAXLEN]; | |||
char TempDirPath[MAXLEN]; | ||||
char OutputDir[MAXLEN]; | char OutputDir[MAXLEN]; | |||
char OutputEmail[MAXLEN]; | char OutputEmail[MAXLEN]; | |||
unsigned long int TopuserSort; | unsigned long int TopuserSort; | |||
unsigned long int UserSort; | unsigned long int UserSort; | |||
char UserAgentLog[255]; | ||||
char module[255]; | char module[255]; | |||
char ExcludeHosts[255]; | char ExcludeHosts[255]; | |||
char ExcludeUsers[255]; | char ExcludeUsers[255]; | |||
char DateFormat[2]; | char DateFormat; | |||
char PerUserLimitFile[255]; | ||||
int PerUserLimit; | ||||
bool UserIp; | bool UserIp; | |||
char MaxElapsed[255]; | char MaxElapsed[255]; | |||
unsigned long int datetimeby; | unsigned long int datetimeby; | |||
char CharSet[255]; | char CharSet[255]; | |||
char UserInvalidChar[255]; | char UserInvalidChar[255]; | |||
bool Graphs; | bool Graphs; | |||
char GraphDaysBytesBarColor[255]; | char GraphDaysBytesBarColor[255]; | |||
bool Privacy; | bool Privacy; | |||
char PrivacyString[255]; | char PrivacyString[255]; | |||
char PrivacyStringColor[30]; | char PrivacyStringColor[30]; | |||
char IncludeUsers[MAXLEN]; | char IncludeUsers[MAXLEN]; | |||
char ExcludeString[MAXLEN]; | char ExcludeString[MAXLEN]; | |||
bool SuccessfulMsg; | bool SuccessfulMsg; | |||
unsigned long int TopUserFields; | unsigned long int TopUserFields; | |||
unsigned long int UserReportFields; | unsigned long int UserReportFields; | |||
char DataFile[MAXLEN]; | char DataFile[MAXLEN]; | |||
char DataFileDelimiter[3]; | char DataFileDelimiter[3]; | |||
unsigned long int DataFileFields; | unsigned long int DataFileFields; | |||
unsigned long int DataFileUrl; | unsigned long int DataFileUrl; | |||
//! if \c true, show the number of lines read from the input log file during the reading of the file. | ||||
bool ShowReadStatistics; | bool ShowReadStatistics; | |||
/*! | ||||
If \c true, the read statistics also includes the percent of the number of lines | ||||
read. | ||||
Beware that it requires two readings of the input log file. It is not possible i | ||||
f the | ||||
input log file is stdin or a pipe. | ||||
*/ | ||||
bool ShowReadPercent; | ||||
char IndexSortOrder[5]; | char IndexSortOrder[5]; | |||
char DansGuardianConf[MAXLEN]; | char DansGuardianConf[MAXLEN]; | |||
bool DansguardianFilterOutDate; | bool DansguardianFilterOutDate; | |||
char SquidGuardConf[MAXLEN]; | char SquidGuardConf[MAXLEN]; | |||
char SquidGuarddbHome[255]; | char SquidGuarddbHome[255]; | |||
char RedirectorLogFormat[4096]; | char RedirectorLogFormat[4096]; | |||
int NRedirectorLogs; | int NRedirectorLogs; | |||
char RedirectorLogs[MAX_REDIRECTOR_LOGS][MAX_REDIRECTOR_FILELEN]; | char RedirectorLogs[MAX_REDIRECTOR_LOGS][MAX_REDIRECTOR_FILELEN]; | |||
int RedirectorLogFromCmdLine; | int RedirectorLogFromCmdLine; | |||
bool RedirectorFilterOutDate; | bool RedirectorFilterOutDate; | |||
skipping to change at line 436 | skipping to change at line 453 | |||
char ImageFile[255]; | char ImageFile[255]; | |||
unsigned long int RealtimeUnauthRec; | unsigned long int RealtimeUnauthRec; | |||
char LDAPHost[255]; | char LDAPHost[255]; | |||
char LDAPBindDN[512]; | char LDAPBindDN[512]; | |||
char LDAPBindPW[255]; | char LDAPBindPW[255]; | |||
int LDAPPort; | int LDAPPort; | |||
int LDAPProtocolVersion; | int LDAPProtocolVersion; | |||
char LDAPBaseSearch[255]; | char LDAPBaseSearch[255]; | |||
char LDAPFilterSearch[512]; | char LDAPFilterSearch[512]; | |||
char LDAPTargetAttr[64]; | char LDAPTargetAttr[64]; | |||
//! Character set to convert the LDAP returned string to. | ||||
char LDAPNativeCharset[20]; | ||||
char GraphFont[MAXLEN]; | char GraphFont[MAXLEN]; | |||
//! The full path to sorttable.js if the table in the reports must be dynamicaly sorted. | //! The full path to sorttable.js if the table in the reports must be dynamicaly sorted. | |||
char SortTableJs[256]; | char SortTableJs[256]; | |||
//! The name of the file containing the host names to replace by an alias in the report. | //! The name of the file containing the host names to replace by an alias in the report. | |||
char HostAliasFile[512]; | char HostAliasFile[512]; | |||
//! The name of the file containing the user names to replace by an alias in the | ||||
report. | ||||
char UserAliasFile[512]; | ||||
//! The number of consecutive errors allowed in an input log file before the pro | ||||
cess is interrupted. | ||||
int NumLogSuccessiveErrors; | ||||
/*! | ||||
The total number of errors allowed in an input log file before the process is in | ||||
terrupted. A negative | ||||
value means the process should never fails irrespective of the number of errors | ||||
found in the input | ||||
log files. | ||||
*/ | ||||
int NumLogTotalErrors; | ||||
//! Count the number of lines read from the input log files. | ||||
unsigned long int lines_read; | ||||
//! Count the number of records kept for the processing. | ||||
unsigned long int records_kept; | ||||
//! Count the number of users. | ||||
unsigned long int nusers; | ||||
int idate; | int idate; | |||
int smartfilter; | ||||
int denied_count; | ||||
int download_count; | ||||
int authfail_count; | ||||
int dansguardian_count; | int dansguardian_count; | |||
int redirector_count; | int redirector_count; | |||
int useragent_count; | int useragent_count; | |||
int limit_flag; | ||||
int z1, z2, z3; | int z1, z2, z3; | |||
int ttopen; | int ttopen; | |||
int sarglog; | int sarglog; | |||
int isalog; | int isalog; | |||
int dfrom; | bool dataonly; | |||
int duntil; | bool indexonly; | |||
int dataonly; | bool iprel; | |||
bool indexonly; | ||||
bool iprel; | ||||
int langcode; | int langcode; | |||
int debug; | int debug; | |||
int debugz; | int debugz; | |||
int debugm; | ||||
int AuthfailReportLimit; | int AuthfailReportLimit; | |||
int DeniedReportLimit; | int DeniedReportLimit; | |||
int DownloadReportLimit; | int DownloadReportLimit; | |||
int SiteUsersReportLimit; | int SiteUsersReportLimit; | |||
int DansGuardianReportLimit; | int DansGuardianReportLimit; | |||
int SquidGuardReportLimit; | int SquidGuardReportLimit; | |||
int UserReportLimit; | int UserReportLimit; | |||
int realtime_refresh; | int realtime_refresh; | |||
int realtime_access_log_lines; | int realtime_access_log_lines; | |||
int rc; | int rc; | |||
int ntopsites; | int ntopsites; | |||
int nrepday; | int nrepday; | |||
int ndownload; | ||||
int ntopuser; | ||||
bool squid24; | bool squid24; | |||
//! \c True to keep the temporary files for inspection. | //! \c True to keep the temporary files for inspection. | |||
bool KeepTempLog; | bool KeepTempLog; | |||
long long int nocost; | long long int nocost; | |||
float cost; | float cost; | |||
typedef struct | ||||
{ int list[ 24 ]; | ||||
int len; | ||||
} numlist; | ||||
End of changes. 28 change blocks. | ||||
30 lines changed or deleted | 61 lines changed or added |