home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / analg211.zip / analhead.h < prev    next >
C/C++ Source or Header  |  1997-09-08  |  15KB  |  385 lines

  1. /*** analhead.h: header file for analog 2.1 ***/
  2. /* Please read Readme.html, or http://www.statslab.cam.ac.uk/~sret1/analog/  */
  3.  
  4. /*** Change any of these according to your desires ***/
  5.  
  6. #ifndef ANALHEAD
  7. #define ANALHEAD
  8.  
  9. /*** The first few options -- up to LOGOURL -- are ones that you may want to
  10.      change before compiling the program for the first time. However, all of
  11.      them except MANDATORYCONFIGFILE can be changed at run time as well. ***/
  12.  
  13. #define HOSTNAME "the Statistical Laboratory"
  14. /* the name of your organisation or WWW host. This is used for printing
  15.    at the top of the output */
  16.  
  17. #define HOSTURL "http://www.statslab.cam.ac.uk/"
  18. /* the URL of your host's home page, for linking to at the top of the
  19.    output; use "-" for no linking. */
  20.  
  21. #define HTTPDIR "/usr/local/etc/httpd/"
  22. #define ANALOGDIR HTTPDIR "analog/"
  23. /* The directories where your HTTP stuff lives and where your analog stuff
  24.    lives. You don't really need these; they are just used in this file to
  25.    build up other filenames. Note how you can stick together names by
  26.    just putting them next to each other; e.g., ANALOGDIR is defined as
  27.    HTTPDIR "analog/", which becomes "/usr/local/etc/httpd/analog/" */
  28.  
  29. #define DOMAINSFILE ANALOGDIR "domains.tab"
  30. /* the name of the file where the domain definitions live; see README.html
  31.    for the format of this file */
  32.  
  33. #define LOGFILE HTTPDIR "logs/access_log"
  34. /* The name of the default logfile; use "stdin" for stdin.
  35.    Can be a list, separated by commas (but no spaces). */
  36.  
  37. #define IMAGEDIR "/images/"
  38. /* URL of the directory where the images for the graphical reports live.
  39.    The URL can be absolute, or relative to the output page: e.g., just the
  40.    empty string "" for the same directory as the output page. Ends with /. */
  41.  
  42. #define LANGDIR ANALOGDIR "lang/"
  43. /* Directory where the language files live. */
  44.  
  45. /* #define DEFAULTCONFIGFILE ANALOGDIR "analog.cfg" */
  46. #define DEFAULTCONFIGFILE (getenv("ANALOG") ? getenv("ANALOG") : ANALOGDIR "analog.cfg")
  47. /* the name of the default configuration file; see README.html for a
  48.    description of this file. Use "none" for no configuration file. */
  49.  
  50. #define MANDATORYCONFIGFILE "none"
  51. /* A mandatory configuration file; read after all other arguments so
  52.    overrides everything. Program exits if it is not found. Use "none"
  53.    for none. */
  54.  
  55. #define LOGOURL IMAGEDIR "analogo.gif"
  56. /* the URL of the file where the analog logo lives. (One should have come
  57.    with the program). You can put another logo in here (your organisation's
  58.    logo, for example). Use "none" for no logo */
  59.  
  60. /*** The next few options are compiled into the program. They can't be
  61.      changed without re-compiling the program. ***/
  62.  
  63. #define MAX_CONFIGS (50)
  64. /* The maximum number of configuration files that are allowed. */
  65.  
  66. #define MINPAGEWIDTH (25)
  67. #define MAXPAGEWIDTH (240)
  68. /* the min and max allowed values of the pagewidth variable */
  69.  
  70. #define MINGRAPHWIDTH (15)
  71. /* bar charts must be at least this many characters wide */
  72.  
  73. #define FORMPROG "/cgi-bin/analform"
  74. /* If you make an analog form interface, what will be the URL of the
  75.    program that processes it? (It should be wherever cgi-bin programs
  76.    go on your server; normally in a cgi-bin directory). */
  77.  
  78. #define MAXLINELENGTH (2048)
  79. /* the maximum length of any line in the logfile (long lines can
  80.    result from searches), domains file or rc file. Longer lines
  81.    will be thrown away. */
  82.  
  83. #define MAXSTRINGLENGTH (256)
  84. /* how long is the longest string we want for a list of filenames, our
  85.    organisation name, an internet address, a geographical location,
  86.    an argument to a configuration command etc.?
  87.    (Longer strings will be truncated). MUST BE AT LEAST 256. */
  88.  
  89. /*** The rest of the options can be overridden when the program is run. ***/
  90.  
  91. #define OUTFILE "stdout"
  92. /* the default file for output. Use "stdout" for stdout. */
  93.  
  94. #define CACHEFILE "none"
  95. /* The default file of cached time info. Use "none" for none. */
  96.  
  97. #define REFERRER_LOG HTTPDIR "logs/referer_log"
  98. /* The name of the default referrer log (= referer_log). Use "none" for none.
  99.    Can be a list, separated by commas. */
  100.  
  101. #define BROWSER_LOG HTTPDIR "logs/agent_log"
  102. /* The name of the default browser log (= agent_log) similarly. */
  103.  
  104. #define ERROR_LOG HTTPDIR "logs/error_log"
  105. /* The name of the default error_log similarly. */
  106.  
  107. #define NUMLOOKUP (OFF)
  108. /* whether to try and resolve IP addresses. Can be slow. */
  109.  
  110. #define DNSFILE ANALOGDIR "dnscache"
  111. /* where to store resolved addresses so we don't have to look them up next
  112.    time */
  113.  
  114. #define DNSFRESHHOURS (168)
  115. /* How many hours the information stays fresh for before we have to look it
  116.    up again. */
  117.  
  118. #define DIRSUFFIX "index.html"
  119. /* the default filename tried if a directory is requested. The program
  120.    combines statistics from /dir/ and /dir/DIRSUFFIX. If you don't wish
  121.    this combining to occur, define DIRSUFFIX to be "". The usual value
  122.    is "index.html". (It would be nice to allow index.html or home.html,
  123.    say, but this is not possible to do accurately without knowing more
  124.    information than is in the logfile). */
  125.  
  126. #define REQHASHSIZE (1009)
  127. /* the size of the hash table for requests; must be odd, should be prime.
  128.    too small will make the program slower; too big might use a bit
  129.    more memory and be slightly less efficient. Maybe half the number
  130.    of URLs expected, but it shouldn't be at all critical. There is a list
  131.    of primes in the file primes.tab */
  132.  
  133. #define DIRHASHSIZE (97)
  134. /* ditto for directories */
  135.  
  136. #define TYPEHASHSIZE (97)
  137. /* and for filetypes */
  138.  
  139. #define HOSTHASHSIZE (3079)
  140. /* ditto for all hostnames that have accessed us */
  141.  
  142. #define SUBDOMHASHSIZE (503)
  143. /* and again for all subdomains we want to analyse */
  144.  
  145. #define REFHASHSIZE (659)
  146. /* and again for all URLs that have referenced our site */
  147.  
  148. #define BROWHASHSIZE (97)
  149. /* and for all makes of browser */
  150.  
  151. #define FULLBROWHASHSIZE (659)
  152. /* and for all browsers, distinguishing different versions etc. */
  153.  
  154. #define DNSHASHSIZE (3079)
  155. /* and for numerical addresses in the DNS cache */
  156.  
  157. #ifdef UNIX
  158. #define CASE (SENSITIVE)
  159. #else
  160. #define CASE (INSENSITIVE)
  161. #endif
  162. /* Do you have a case sensitive or case insensitive file system? */
  163.  
  164. #define REPORTORDER "mWdDhHoSitrfbBce"
  165. /* A string like "mWdDhHoSitrfbBce" giving the order in which the reports will
  166.    be output. You should make sure to include each of the above letters exactly
  167.    once or you will not get some report even if you specifically request it
  168.    later, or you may get some report twice. The letters mean
  169.    m = monthly report   W = weekly report    d = daily summary
  170.    D = daily report     h = hourly summary   H = hourly report
  171.    o = domain report    S = host report      i = directory report
  172.    r = request report   f = referrer report  b = browser summary
  173.    B = browser report   e = error report     c = status code report
  174.    t = filetype report */
  175.  
  176. /* whether we want each of the reports by default */
  177. #define GENERAL (ON)      /* General statistics and GoTo's */
  178. #define MONTHLY (ON)      /* Monthly report */
  179. #define DAILY (ON)        /* Daily summary */
  180. #define FULLDAILY (OFF)   /* Daily report */
  181. /* One line for each day. Think about the poor people loading your page from
  182.    the other side of the world before turning this on by default. */
  183. #define WEEKLY (OFF)      /* Weekly report */
  184. #define HOURLY (ON)       /* Hourly summary */
  185. #define FULLHOURLY (OFF)  /* Hourly report */
  186. /* One line for each hour ever. You really don't want this on by default. */
  187. #define DOMAINREP (ON)    /* Domain report */
  188. /* Not called DOMAIN because clashes with math.h */
  189. #define DIRECTORY (ON)    /* Directory report */
  190. #define FILETYPE (OFF)    /* File type report */
  191. #define REQUEST (ON)      /* Request report */
  192. #define FULLHOSTS (OFF)   /* Host report */
  193. /* Full hostname report. Typically very long output and slow to produce
  194.    on a full logfile, unless MIN_HOST_REQS or _BYTES is high as applicable */
  195. #define REFERRER (OFF)    /* Referrer report */
  196. #define BROWSER (OFF)     /* Browser summary */
  197. #define FULLBROWSER (OFF) /* Browser report */
  198. #define STATUS (OFF)      /* Status code report */
  199. #ifdef ERROR
  200. #undef ERROR
  201. #endif
  202. #define ERROR (OFF)       /* Error report */
  203.  
  204. #define DOMCOLS "Rb"
  205. /* Which columns we want to appear in the domain report, and in which order.
  206.    The string can contain any of the following four letters:
  207.    R   Number of requests from each domain
  208.    r   Percentage of the requests from each domain
  209.    P   Number of requests for pages from each domain
  210.    p   Percentage of the requests for pages from each domain
  211.    B   Total number of bytes transferred to each domain
  212.    b   The percentage of traffic to each domain */
  213. /* And the same for the other reports */
  214. #define HOSTCOLS "Rb"
  215. #define DIRCOLS "Rb"
  216. #define TYPECOLS "Rb"
  217. #define REQCOLS "Rb"
  218. #define MONTHCOLS "P"
  219. #define DAYCOLS "P"
  220. #define FULLDAYCOLS "P"
  221. #define WEEKCOLS "P"
  222. #define HOURCOLS "P"
  223. #define FULLHOURCOLS "P"
  224. #define REFCOLS "R"
  225. #define BROWCOLS "R"
  226. #define FULLBROWCOLS "R"
  227.  
  228. /* Should the time graphs be calculated by requests 'R', bytes 'B' or
  229.    pages 'P'? */
  230. #define MONTHGRAPH 'P'
  231. #define DAYGRAPH 'P'
  232. #define FULLDAYGRAPH 'P'
  233. #define HOURGRAPH 'P'
  234. #define FULLHOURGRAPH 'P'
  235. #define WEEKGRAPH 'P'
  236.  
  237. /* Should they go forwards (oldest entries at top) or backwards?
  238.    (NB You can mix them, but probably don't want to) */
  239. #define MONTHLYBACK (FALSE)
  240. #define FULLDAILYBACK (FALSE)
  241. #define FULLHOURLYBACK (FALSE)
  242. #define WEEKLYBACK (FALSE)
  243.  
  244. /* The maximum number of rows in each (0 for "show all time") */
  245. #define MONTHROWS (0)
  246. #define WEEKROWS (0)
  247. #define FULLDAYROWS (42)
  248. #define FULLHOURROWS (72)
  249.  
  250. #define GRAPHICAL (ON)
  251. /* whether the graphs should use proper graphics or just ASCII art. ON will
  252.    make it prettier but will make the output longer and harder to download */
  253.  
  254. #define MIN_URL_REQS "20"
  255. /* the min. no. of requests a URL should have before appearing on the
  256.    request report. Setting this to about 20 clears out a lot of junk.
  257.    You can also use e.g. "0.1%" for any file with 0.1% of the requests.
  258.    And setting it to a negative number gives a "top n" report. */
  259.  
  260. #define MIN_URL_BYTES "0.01%"
  261. /* if we are sorting by bytes, use this instead. You can use
  262.    "1000234" for 1000234 bytes
  263.    "100k"    for 100 kilobytes  (and 100M etc. similarly)
  264.    "0.01%"   for any file with 0.01% of the bytes
  265.    "-50"     for the 50 files with the most bytes  */
  266.  
  267. /* now the same for directory, domain and hostname reports under requests,
  268.    page requests, or bytes sorting. */
  269. #define MIN_DIR_REQS "10"
  270. #define MIN_DIR_PAGES "10"
  271. #define MIN_DIR_BYTES "0.01%"
  272. #define MIN_TYPE_REQS "100"
  273. #define MIN_TYPE_PAGES "100"
  274. #define MIN_TYPE_BYTES "0.1%"
  275. #define MIN_DOM_REQS "1"
  276. #define MIN_DOM_PAGES "1"
  277. #define MIN_DOM_BYTES "0"
  278. #define MIN_HOST_REQS "-100"
  279. #define MIN_HOST_PAGES "-100"
  280. #define MIN_HOST_BYTES "-100"
  281. #define MIN_REF_REQS "20"
  282. #define MIN_REF_PAGES "20"
  283. #define MIN_REF_BYTES "0.01%"
  284. #define MIN_BROW_REQS "-20"
  285. #define MIN_BROW_PAGES "-20"
  286. #define MIN_BROW_BYTES "-20"
  287. #define MIN_FULLBROW_REQS "-100"
  288. #define MIN_FULLBROW_PAGES "-100"
  289. #define MIN_FULLBROW_BYTES "-100"
  290. /* And the same for subdomains you have specified. These can't be negative. */
  291. #define MIN_SUBDOM_REQS "1000"
  292. #define MIN_SUBDOM_PAGES "300"
  293. #define MIN_SUBDOM_BYTES "0.5%"
  294. /* And the min number of occurences before an error gets on the error report */
  295. #define MIN_ERR_OCCS (1)
  296.  
  297. /* how should the various reports be sorted? Legal values ar BYREQUESTS,
  298.    BYPAGES, BYBYTES and ALPHABETICAL */
  299. #define REQSORTBY (BYREQUESTS)
  300. #define DOMSORTBY (BYBYTES)
  301. #define DIRSORTBY (BYBYTES)
  302. #define TYPESORTBY (BYBYTES)
  303. #define HOSTSORTBY (ALPHABETICAL)
  304. #define REFSORTBY (BYREQUESTS)
  305. #define BROWSORTBY (BYREQUESTS)
  306. #define FULLBROWSORTBY (BYREQUESTS)
  307.  
  308. #define WEEKBEGINSON (SUNDAY)
  309. /* The 1st day of the week. I think it's SUNDAY, but you can choose any day. */
  310.  
  311. #define SEPCHAR ' '
  312. /* The character to separate the thousands in a long number. I prefer ' ',
  313.    but some people prefer '.' or ','. Use '\0' for no separator. Use '9' if
  314.    you really want to inflate your statistics! :) */
  315.  
  316. #define REPSEPCHAR '\0'
  317. /* The same for long numbers within the detailed output */
  318.  
  319. #define DECPOINT '.'
  320. /* Character to use as the decimal point. */
  321.  
  322. #define PRESEP "\t"
  323. /* A separator string between fields in preformatted output */
  324.  
  325. #define APPROXHOSTSIZE (500000)
  326. /* The number of bytes to allocate for approximate hostname counting;
  327.    more will make it more accurate. About 3 bytes per host should give
  328.    you a very good estimate, though even 1 byte per host will be fair.
  329.    If statistics for last 7 days are asked for, twice this amount of space
  330.    will be used. */
  331.  
  332. #define BASEURL "none"
  333. /* A string which is prepended to all URLs linked to in the request report.
  334.    This is useful if you want to display the statistics on a different
  335.    server from the one that generated the logfile. Use "none" for none. */
  336.  
  337. #define RAWBYTES (OFF)
  338. /* whether bytes should be quoted in full (e.g., 1 021 453) as opposed to
  339.    in kilobytes, megabytes etc. (e.g., 998k). */
  340.  
  341. #define HEADERFILE "none"
  342. /* an extra file (with HTML markup if desired) placed between the page title
  343.    and the start of the statistics. Use "none" for none. */
  344.  
  345. #define FOOTERFILE "none"
  346. /* And one placed at the bottom of the page */
  347.  
  348. #define OUTPUT (HTML)
  349. /* Default output type: ASCII, HTML or CACHE */
  350.  
  351. #define LANGUAGE (ENGLISH)
  352. /* Default language for the output page:
  353.    ENGLISH, US_ENGLISH, FRENCH, GERMAN, ITALIAN, SPANISH, DANISH */
  354.  
  355. #define DEBUG (0)
  356. /* Level of debugging output: 0 = none, 1 = print all corrupt lines to stderr,
  357.    2 = also print hosts with unknown domains. */
  358.  
  359. #define PROGRESSFREQ (0)
  360. /* Frequency of progress reports. 0 for no reports. */
  361.  
  362. #define MARKCHAR '+'
  363. /* a character for the graphical displays */
  364.  
  365. #define PAGEWIDTH (65)
  366. /* the width of the output. Standard text screens have 80 columns, but for
  367.    WWW browsers something like 65 is probably better. */
  368.  
  369. #define DIRLEVEL (1)
  370. /* the level of directory report; see README */
  371.  
  372. #define COUNTHOSTS (ON)
  373. /* whether we want to count the number of distinct hosts
  374.    Can be ON, OFF or APPROX (for approximate count; in fact lower bound)
  375.    FULLHOSTS ON turns COUNTHOSTS ON
  376.    Turning this to OFF or APPROX will save a lot of memory */
  377.  
  378. #define LASTSEVEN (ON)
  379. /* whether we want statistics for the last seven days */
  380.  
  381. #define WARNINGS (ON)
  382. /* whether we want to see warnings */
  383.  
  384. #endif
  385.