1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513
|
#ifndef HAVE_CONF_H
#define HAVE_CONF_H
#include "config.h"
#include "info.h"
#include "btree_cache.h"
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_TIME_H
#include <time.h>
#endif
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#if defined(HAVE_SYS_DIRENT_H) && !defined(HAVE_DIRENT_H)
#include <sys/dirent.h>
#endif
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#ifdef HAVE_TYPES_H
#include <types.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#ifdef HAVE_GD_H
#define HAVE_GD 1
#include <gd.h>
#endif
#ifdef HAVE_GDFONTL_H
#include <gdfontl.h>
#endif
#ifdef HAVE_GDFONTT_H
#include <gdfontt.h>
#endif
#ifdef HAVE_GDFONTS_H
#include <gdfonts.h>
#endif
#ifdef HAVE_GDFONTMB_H
#include <gdfontmb.h>
#endif
#ifdef HAVE_GDFONTG_H
#include <gdfontg.h>
#endif
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
#endif
#ifdef HAVE_MATH_H
#include <math.h>
#endif
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
#endif
#ifdef HAVE_LIBGEN_H
#include <libgen.h>
#endif
#ifdef HAVE_STDBOOL_H
#include <stdbool.h>
#else
typedef int bool;
#define true 1
#define false 0
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_FNMATCH_H
#include <fnmatch.h>
#endif
#if defined(HAVE_FOPEN64)
#define _FILE_OFFSET_BITS 64
#define MY_FOPEN fopen64
#else
#define MY_FOPEN fopen
#endif
#if !defined(HAVE_BZERO)
#define bzero(mem,size) memset(mem,0,size)
#endif
#if defined(IBERTY_LIB) && !defined(HAVE_MKSTEMP)
int mkstemps(char *template, int suffixlen);
#define mkstemp(template) mkstemps(template,0)
#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)
#define _(String) gettext(String)
#ifdef gettext_noop
#define N_(String) gettext_noop(String)
#else
#define N_(String) (String)
#endif
#else /* No NLS */
#define _(String) (String)
#define N_(String) (String)
#endif //NLS
#if defined(__MINGW32__)
#define mkdir(p,m) _mkdir(p)
#ifndef WIFEXITED
#define WIFEXITED(S) 1
#endif
#ifndef WEXITSTATUS
#define WEXITSTATUS(S) (S)
#endif
#endif /*__MINGW32__*/
#ifndef __GNUC__
# define __attribute__(x)
#endif
#define MAXLEN 20000
#define MAX_URL_LEN 40000
#define MAX_TRUNCATED_URL 250
#define MAX_USER_LEN 256
#define MAX_USER_FNAME_LEN 128
#define MAX_IP_LEN 64
#define MAX_DATETIME_LEN 32
#define MAX_REDIRECTOR_LOGS 64
#define MAX_REDIRECTOR_FILELEN 1024
/*!
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 overrun.
*/
#define MAX_DATETIME_DAYS 1000
#define REPORT_TYPE_USERS_SITES 0x0001UL
#define REPORT_TYPE_SITE_USER_TIME_DATE 0x0002UL
#define REPORT_TYPE_TOPUSERS 0x0004UL
#define REPORT_TYPE_TOPSITES 0x0008UL
#define REPORT_TYPE_SITES_USERS 0x0010UL
#define REPORT_TYPE_DATE_TIME 0x0020UL
#define REPORT_TYPE_DENIED 0x0040UL
#define REPORT_TYPE_AUTH_FAILURES 0x0080UL
#define REPORT_TYPE_DOWNLOADS 0x0100UL
#define REPORT_TYPE_USERAGENT 0x0200UL
#define DATA_FIELD_USER 0x0001UL
#define DATA_FIELD_DATE 0x0002UL
#define DATA_FIELD_TIME 0x0004UL
#define DATA_FIELD_URL 0x0008UL
#define DATA_FIELD_CONNECT 0x0010UL
#define DATA_FIELD_BYTES 0x0020UL
#define DATA_FIELD_IN_CACHE 0x0040UL
#define DATA_FIELD_OUT_CACHE 0x0080UL
#define DATA_FIELD_ELAPSED 0x0100UL
#define TOPUSERFIELDS_NUM 0x0001UL
#define TOPUSERFIELDS_DATE_TIME 0x0002UL
#define TOPUSERFIELDS_USERID 0x0004UL
#define TOPUSERFIELDS_CONNECT 0x0008UL
#define TOPUSERFIELDS_BYTES 0x0010UL
#define TOPUSERFIELDS_SETYB 0x0020UL
#define TOPUSERFIELDS_IN_CACHE_OUT 0x0040UL
#define TOPUSERFIELDS_USED_TIME 0x0080UL
#define TOPUSERFIELDS_MILISEC 0x0100UL
#define TOPUSERFIELDS_PTIME 0x0200UL
#define TOPUSERFIELDS_TOTAL 0x0400UL
#define TOPUSERFIELDS_AVERAGE 0x0800UL
#define TOPUSERFIELDS_USERIP 0x1000UL
#define USERREPORTFIELDS_CONNECT 0x0001UL
#define USERREPORTFIELDS_BYTES 0x0002UL
#define USERREPORTFIELDS_SETYB 0x0004UL
#define USERREPORTFIELDS_IN_CACHE_OUT 0x0008UL
#define USERREPORTFIELDS_USED_TIME 0x0010UL
#define USERREPORTFIELDS_MILISEC 0x0020UL
#define USERREPORTFIELDS_PTIME 0x0040UL
#define USERREPORTFIELDS_TOTAL 0x0080UL
#define USERREPORTFIELDS_AVERAGE 0x0100UL
#define INDEX_YES 0x0001UL
#define INDEX_NO 0x0002UL
#define INDEX_ONLY 0x0004UL
#define INDEX_TREE_DATE 0x0001UL
#define INDEX_TREE_FILE 0x0002UL
#define INDEXFIELDS_DIRSIZE 0x0001UL
#define NTLMUSERFORMAT_USER 0x0001UL
#define NTLMUSERFORMAT_DOMAINUSER 0x0002UL
#define RECORDWITHOUTUSER_IP 0x0001UL
#define RECORDWITHOUTUSER_IGNORE 0x0002UL
#define RECORDWITHOUTUSER_EVERYBODY 0x0004UL
#define DATAFILEURL_IP 0x0001UL
#define DATAFILEURL_NAME 0x0002UL
#define DISPLAY_BYTES 0x0001UL
#define DISPLAY_ABBREV 0x0002UL
#define DATETIME_ELAP 0x0001UL
#define DATETIME_BYTE 0x0002UL
#define REALTIME_UNAUTH_REC_SHOW 0x0001UL
#define REALTIME_UNAUTH_REC_IGNORE 0x0002UL
#define SORT_REVERSE 0x0001
#define TOPUSER_SORT_REVERSE SORT_REVERSE
#define TOPUSER_SORT_BYTES 0x0002UL
#define TOPUSER_SORT_USER 0x0004UL
#define TOPUSER_SORT_CONNECT 0x0008UL
#define TOPUSER_SORT_TIME 0x0010UL
#define TOPSITE_SORT_REVERSE SORT_REVERSE
#define TOPSITE_SORT_BYTES 0x0002UL
#define TOPSITE_SORT_CONNECT 0x0004UL
#define TOPSITE_SORT_TIME 0x0008UL
#define TOPSITE_SORT_USER 0x0010UL
#define USER_SORT_REVERSE SORT_REVERSE
#define USER_SORT_BYTES 0x0002UL
#define USER_SORT_SITE 0x0004UL
#define USER_SORT_CONNECT 0x0008UL
#define USER_SORT_TIME 0x0010UL
//! Value to exclude all the javascripts from the html page.
#define HTML_JS_NONE 0x0000
//! Bit to include sorttable.js in the html plage.
#define HTML_JS_SORTTABLE 0x0001
//! The character prefixed in front of the host names that are aliased.
#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
{
//! The first date of the period.
struct tm start;
//! The last date of the period.
struct tm end;
//! The textual representation of the date.
char text[90];
//! The HTML representation of the date.
char html[90];
};
extern char outdir[MAXLEN];
extern char outdirname[MAXLEN];
extern struct periodstruct period;
extern char code[MAXLEN];
extern char code2[MAXLEN];
extern char tmp[MAXLEN];
extern char parse_out[MAXLEN];
extern char html[MAXLEN];
extern char ConfigFile[MAXLEN];
extern char df;
extern int LastLog;
extern bool RemoveTempFiles;
extern char ReplaceIndex[256];
extern unsigned long int Index;
extern bool OverwriteReport;
extern unsigned long int RecordsWithoutUser;
extern bool UseComma;
extern char MailUtility[PATH_MAX];
extern int TopSitesNum;
extern int TopUsersNum;
extern char ExcludeCodes[256];
extern unsigned long int TopsitesSort;
extern unsigned long int ReportType;
extern char UserTabFile[255];
extern char warea[MAXLEN];
extern char name[MAXLEN];
extern bool LongUrl;
extern bool Ip2Name;
extern int AccessLogFromCmdLine;
extern char Title[MAXLEN];
extern char BgColor[MAXLEN];
extern char BgImage[MAXLEN];
extern char TxColor[MAXLEN];
extern char TxBgColor[MAXLEN];
extern char TiColor[MAXLEN];
extern char LogoImage[MAXLEN];
extern char LogoText[MAXLEN];
extern char LogoTextColor[MAXLEN];
extern char Width[MAXLEN];
extern char Height[MAXLEN];
extern char FontFace[MAXLEN];
extern char HeaderColor[MAXLEN];
extern char HeaderBgColor[MAXLEN];
extern char FontSize[MAXLEN];
extern char PasswdFile[MAXLEN];
extern char TempDir[MAXLEN];
extern char TempDirPath[MAXLEN];
extern char OutputDir[MAXLEN];
extern char OutputEmail[MAXLEN];
extern unsigned long int TopuserSort;
extern unsigned long int UserSort;
extern char module[255];
extern char ExcludeHosts[255];
extern char ExcludeUsers[255];
extern char DateFormat;
extern bool UserIp;
extern char MaxElapsed[255];
extern unsigned long int datetimeby;
extern char CharSet[255];
extern char UserInvalidChar[255];
extern bool Graphs;
extern char GraphDaysBytesBarColor[255];
extern bool Privacy;
extern char PrivacyString[255];
extern char PrivacyStringColor[30];
extern char IncludeUsers[MAXLEN];
extern char ExcludeString[MAXLEN];
extern bool SuccessfulMsg;
extern unsigned long int TopUserFields;
extern unsigned long int UserReportFields;
extern char DataFile[MAXLEN];
extern char DataFileDelimiter[3];
extern unsigned long int DataFileFields;
extern unsigned long int DataFileUrl;
//! if \c true, show the number of lines read from the input log file during the reading of the file.
extern 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 if the
input log file is stdin or a pipe.
*/
extern bool ShowReadPercent;
extern char IndexSortOrder[5];
extern char DansGuardianConf[MAXLEN];
extern bool DansguardianFilterOutDate;
extern char SquidGuardConf[MAXLEN];
extern char SquidGuarddbHome[255];
extern char RedirectorLogFormat[4096];
extern int NRedirectorLogs;
extern char RedirectorLogs[MAX_REDIRECTOR_LOGS][MAX_REDIRECTOR_FILELEN];
extern int RedirectorLogFromCmdLine;
extern bool RedirectorFilterOutDate;
extern bool ShowSargInfo;
extern bool BytesInSitesUsersReport;
extern bool ShowSargLogo;
extern char ParsedOutputLog[MAXLEN];
extern char ParsedOutputLogCompress[512];
extern unsigned long int DisplayedValues;
extern char HeaderFontSize[5];
extern char TitleFontSize[5];
extern char wwwDocumentRoot[MAXLEN];
extern char ExternalCSSFile[MAXLEN];
extern char BlockIt[255];
extern unsigned long int NtlmUserFormat;
//! How to display the index of the reports.
extern unsigned long int IndexTree;
//! The columns to show in the index of the reports.
extern unsigned long int IndexFields;
extern bool UserAuthentication;
extern char AuthUserTemplateFile[1024];
//! \c True to use anonymous file and directory names in the report.
extern bool AnonymousOutputFiles;
extern char val1[MAXLEN];
extern char val3[MAXLEN];
extern char val5[MAXLEN];
extern char val6[MAXLEN];
extern char val7[MAXLEN];
extern char val8[MAXLEN];
extern char val9[MAXLEN];
extern char val10[MAXLEN];
extern char val11[MAXLEN];
extern char mask[MAXLEN];
extern char site[MAXLEN];
extern char us[50];
extern char email[MAXLEN];
extern char test[1];
extern char user2[MAXLEN];
extern char wentp[512];
extern char addr[MAXLEN];
extern char Ulimit[6];
extern char RealtimeTypes[1024];
extern char cmd[255];
extern char ImageFile[255];
extern unsigned long int RealtimeUnauthRec;
extern char LDAPHost[255];
extern char LDAPBindDN[512];
extern char LDAPBindPW[255];
extern int LDAPPort;
extern int LDAPProtocolVersion;
extern char LDAPBaseSearch[255];
extern char LDAPFilterSearch[512];
extern char LDAPTargetAttr[64];
//! Character set to convert the LDAP returned string to.
extern char LDAPNativeCharset[20];
extern char GraphFont[MAXLEN];
//! The full path to sorttable.js if the table in the reports must be dynamicaly sorted.
extern char SortTableJs[256];
//! The name of the file containing the host names to replace by an alias in the report.
extern char HostAliasFile[512];
//! The name of the file containing the user names to replace by an alias in the report.
extern char UserAliasFile[512];
//! The number of consecutive errors allowed in an input log file before the process is interrupted.
extern int NumLogSuccessiveErrors;
/*!
The total number of errors allowed in an input log file before the process is interrupted. A negative
value means the process should never fails irrespective of the number of errors found in the input
log files.
*/
extern int NumLogTotalErrors;
//! Count the number of lines read from the input log files.
extern unsigned long int lines_read;
//! Count the number of records kept for the processing.
extern unsigned long int records_kept;
//! Count the number of users.
extern unsigned long int nusers;
extern int idate;
extern int dansguardian_count;
extern int redirector_count;
extern int useragent_count;
extern int z1, z2, z3;
extern int ttopen;
extern int sarglog;
extern int isalog;
extern bool dataonly;
extern bool indexonly;
extern bool iprel;
extern int langcode;
extern int debug;
extern int debugz;
extern int AuthfailReportLimit;
extern int DeniedReportLimit;
extern int DownloadReportLimit;
extern int SiteUsersReportLimit;
extern int DansGuardianReportLimit;
extern int SquidGuardReportLimit;
extern int UserReportLimit;
extern int realtime_refresh;
extern int realtime_access_log_lines;
extern int rc;
extern int ntopsites;
extern int nrepday;
extern bool squid24;
//! \c True to keep the temporary files for inspection.
extern bool KeepTempLog;
extern long long int nocost;
extern float cost;
#endif /* ! HAVE_CONF_H */
|